@planningcenter/tapestry-react 3.0.0-rc.1 → 3.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.
- package/dist/cjs/Logo/ Logo.test.js +20 -11
- package/dist/cjs/Logo/Logo.js +5 -5
- package/dist/cjs/Logo/logos/services.js +6 -6
- package/dist/esm/Logo/ Logo.test.js +20 -11
- package/dist/esm/Logo/Logo.js +5 -5
- package/dist/esm/Logo/logos/services.js +6 -6
- package/dist/types/Logo/Logo.d.ts +1 -1
- package/package.json +1 -1
- package/src/Logo/ Logo.test.tsx +19 -11
- package/src/Logo/Logo.mdx +1 -1
- package/src/Logo/Logo.tsx +6 -6
- package/src/Logo/logos/services.tsx +6 -6
|
@@ -19,7 +19,7 @@ describe('Logo component', function () {
|
|
|
19
19
|
Object.keys(_logos.logos).forEach(function (logoName) {
|
|
20
20
|
themes.forEach(function (theme) {
|
|
21
21
|
markOnlyOptions.forEach(function (markOnly) {
|
|
22
|
-
|
|
22
|
+
test("<Logo name=\"" + logoName + "\" theme=\"" + theme + "\" markOnly=" + markOnly + " />", function () {
|
|
23
23
|
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Logo["default"], {
|
|
24
24
|
name: logoName,
|
|
25
25
|
theme: theme,
|
|
@@ -28,18 +28,23 @@ describe('Logo component', function () {
|
|
|
28
28
|
container = _render.container;
|
|
29
29
|
|
|
30
30
|
var svg = container.querySelector('svg');
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
|
|
32
|
+
if (svg) {
|
|
33
|
+
var title = svg.querySelector('title');
|
|
34
|
+
var titleId = title == null ? void 0 : title.id;
|
|
35
|
+
expect(svg).toBeInTheDocument();
|
|
36
|
+
expect(title).toBeInTheDocument();
|
|
37
|
+
expect(svg).toHaveAttribute('role', 'img');
|
|
38
|
+
expect(svg).toHaveAttribute('aria-labelledby', titleId);
|
|
39
|
+
} else {
|
|
40
|
+
throw new Error('SVG element not found');
|
|
41
|
+
}
|
|
37
42
|
});
|
|
38
43
|
});
|
|
39
44
|
});
|
|
40
45
|
});
|
|
41
46
|
});
|
|
42
|
-
|
|
47
|
+
test('Render a Logo with defined size', function () {
|
|
43
48
|
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Logo["default"], {
|
|
44
49
|
name: "people",
|
|
45
50
|
theme: "color",
|
|
@@ -49,8 +54,12 @@ describe('Logo component', function () {
|
|
|
49
54
|
|
|
50
55
|
var svgParent = container.querySelector('span');
|
|
51
56
|
var svg = container.querySelector('svg');
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
|
|
58
|
+
if (!svgParent || !svg) {
|
|
59
|
+
throw new Error('SVG element (or parent element) not found');
|
|
60
|
+
} else {
|
|
61
|
+
expect(svg).toBeInTheDocument();
|
|
62
|
+
expect(window.getComputedStyle(svgParent).height).toBe('48px');
|
|
63
|
+
}
|
|
55
64
|
});
|
|
56
65
|
});
|
package/dist/cjs/Logo/Logo.js
CHANGED
|
@@ -12,11 +12,11 @@ var _Box = _interopRequireDefault(require("../Box"));
|
|
|
12
12
|
var _logos = require("./logos");
|
|
13
13
|
|
|
14
14
|
var sizes = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
xs: '14px',
|
|
16
|
+
sm: '16px',
|
|
17
|
+
md: '18px',
|
|
18
|
+
lg: '24px',
|
|
19
|
+
xl: '32px'
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
var Logo = function Logo(_ref) {
|
|
@@ -186,22 +186,22 @@ var services = {
|
|
|
186
186
|
d: "M20.9992 0C4.19693 0 0 4.20032 0 21C0 37.7997 4.19693 42 20.9992 42C37.8015 42 42 37.8029 42 21C42 4.19709 37.7998 0 20.9992 0Z",
|
|
187
187
|
fill: "url(#paint0_linear_0_50)"
|
|
188
188
|
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
189
|
-
d: "
|
|
189
|
+
d: "M11.3982 16.5436C12.6222 16.5436 13.6144 15.5513 13.6144 14.3273C13.6144 13.1033 12.6222 12.1111 11.3982 12.1111C10.1742 12.1111 9.18192 13.1033 9.18192 14.3273C9.18192 15.5513 10.1742 16.5436 11.3982 16.5436Z",
|
|
190
190
|
fill: "white"
|
|
191
191
|
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
192
|
-
d: "
|
|
192
|
+
d: "M11.3982 23.7532C12.6222 23.7532 13.6144 22.761 13.6144 21.537C13.6144 20.313 12.6222 19.3207 11.3982 19.3207C10.1742 19.3207 9.18192 20.313 9.18192 21.537C9.18192 22.761 10.1742 23.7532 11.3982 23.7532Z",
|
|
193
193
|
fill: "white"
|
|
194
194
|
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
195
|
-
d: "
|
|
195
|
+
d: "M11.3982 30.9629C12.6222 30.9629 13.6144 29.9706 13.6144 28.7466C13.6144 27.5226 12.6222 26.5304 11.3982 26.5304C10.1742 26.5304 9.18192 27.5226 9.18192 28.7466C9.18192 29.9706 10.1742 30.9629 11.3982 30.9629Z",
|
|
196
196
|
fill: "white"
|
|
197
197
|
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
198
|
-
d: "
|
|
198
|
+
d: "M31.4135 15.3141C31.4135 15.8751 30.9588 16.3298 30.3978 16.3298H17.036C16.475 16.3298 16.0203 15.8751 16.0203 15.3141V13.339C16.0203 12.778 16.475 12.3232 17.036 12.3232H30.3946C30.9555 12.3232 31.4103 12.778 31.4103 13.339L31.4135 15.3141Z",
|
|
199
199
|
fill: "white"
|
|
200
200
|
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
201
|
-
d: "
|
|
201
|
+
d: "M16.0235 20.1649C16.0235 19.8159 16.3065 19.5329 16.6555 19.5329H30.7815C31.1306 19.5329 31.4135 19.8159 31.4135 20.1649V22.9091C31.4135 23.2582 31.1306 23.5411 30.7815 23.5411H16.6555C16.3065 23.5411 16.0235 23.2582 16.0235 22.9091V20.1649Z",
|
|
202
202
|
fill: "white"
|
|
203
203
|
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
204
|
-
d: "
|
|
204
|
+
d: "M16.0235 27.3745C16.0235 27.0254 16.3065 26.7425 16.6555 26.7425H30.7815C31.1306 26.7425 31.4135 27.0254 31.4135 27.3745V30.1187C31.4135 30.4678 31.1306 30.7507 30.7815 30.7507H16.6555C16.3065 30.7507 16.0235 30.4678 16.0235 30.1187V27.3745Z",
|
|
205
205
|
fill: "white"
|
|
206
206
|
})), /*#__PURE__*/_react["default"].createElement("defs", null, /*#__PURE__*/_react["default"].createElement("linearGradient", {
|
|
207
207
|
id: "paint0_linear_0_50",
|
|
@@ -17,7 +17,7 @@ describe('Logo component', function () {
|
|
|
17
17
|
Object.keys(logos).forEach(function (logoName) {
|
|
18
18
|
themes.forEach(function (theme) {
|
|
19
19
|
markOnlyOptions.forEach(function (markOnly) {
|
|
20
|
-
|
|
20
|
+
test("<Logo name=\"" + logoName + "\" theme=\"" + theme + "\" markOnly=" + markOnly + " />", function () {
|
|
21
21
|
var _render = render( /*#__PURE__*/React.createElement(Logo, {
|
|
22
22
|
name: logoName,
|
|
23
23
|
theme: theme,
|
|
@@ -26,25 +26,34 @@ describe('Logo component', function () {
|
|
|
26
26
|
container = _render.container;
|
|
27
27
|
|
|
28
28
|
var svg = container.querySelector('svg');
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
|
|
30
|
+
if (svg) {
|
|
31
|
+
var title = svg.querySelector('title');
|
|
32
|
+
var titleId = title == null ? void 0 : title.id;
|
|
33
|
+
expect(svg).toBeInTheDocument();
|
|
34
|
+
expect(title).toBeInTheDocument();
|
|
35
|
+
expect(svg).toHaveAttribute('role', 'img');
|
|
36
|
+
expect(svg).toHaveAttribute('aria-labelledby', titleId);
|
|
37
|
+
} else {
|
|
38
|
+
throw new Error('SVG element not found');
|
|
39
|
+
}
|
|
35
40
|
});
|
|
36
41
|
});
|
|
37
42
|
});
|
|
38
43
|
});
|
|
39
44
|
});
|
|
40
|
-
|
|
45
|
+
test('Render a Logo with defined size', function () {
|
|
41
46
|
var _render2 = render(_ref),
|
|
42
47
|
container = _render2.container;
|
|
43
48
|
|
|
44
49
|
var svgParent = container.querySelector('span');
|
|
45
50
|
var svg = container.querySelector('svg');
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
|
|
52
|
+
if (!svgParent || !svg) {
|
|
53
|
+
throw new Error('SVG element (or parent element) not found');
|
|
54
|
+
} else {
|
|
55
|
+
expect(svg).toBeInTheDocument();
|
|
56
|
+
expect(window.getComputedStyle(svgParent).height).toBe('48px');
|
|
57
|
+
}
|
|
49
58
|
});
|
|
50
59
|
});
|
package/dist/esm/Logo/Logo.js
CHANGED
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import Box from '../Box';
|
|
3
3
|
import { logos } from './logos';
|
|
4
4
|
var sizes = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
xs: '14px',
|
|
6
|
+
sm: '16px',
|
|
7
|
+
md: '18px',
|
|
8
|
+
lg: '24px',
|
|
9
|
+
xl: '32px'
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
var Logo = function Logo(_ref) {
|
|
@@ -178,22 +178,22 @@ export var services = {
|
|
|
178
178
|
d: "M20.9992 0C4.19693 0 0 4.20032 0 21C0 37.7997 4.19693 42 20.9992 42C37.8015 42 42 37.8029 42 21C42 4.19709 37.7998 0 20.9992 0Z",
|
|
179
179
|
fill: "url(#paint0_linear_0_50)"
|
|
180
180
|
}), /*#__PURE__*/React.createElement("path", {
|
|
181
|
-
d: "
|
|
181
|
+
d: "M11.3982 16.5436C12.6222 16.5436 13.6144 15.5513 13.6144 14.3273C13.6144 13.1033 12.6222 12.1111 11.3982 12.1111C10.1742 12.1111 9.18192 13.1033 9.18192 14.3273C9.18192 15.5513 10.1742 16.5436 11.3982 16.5436Z",
|
|
182
182
|
fill: "white"
|
|
183
183
|
}), /*#__PURE__*/React.createElement("path", {
|
|
184
|
-
d: "
|
|
184
|
+
d: "M11.3982 23.7532C12.6222 23.7532 13.6144 22.761 13.6144 21.537C13.6144 20.313 12.6222 19.3207 11.3982 19.3207C10.1742 19.3207 9.18192 20.313 9.18192 21.537C9.18192 22.761 10.1742 23.7532 11.3982 23.7532Z",
|
|
185
185
|
fill: "white"
|
|
186
186
|
}), /*#__PURE__*/React.createElement("path", {
|
|
187
|
-
d: "
|
|
187
|
+
d: "M11.3982 30.9629C12.6222 30.9629 13.6144 29.9706 13.6144 28.7466C13.6144 27.5226 12.6222 26.5304 11.3982 26.5304C10.1742 26.5304 9.18192 27.5226 9.18192 28.7466C9.18192 29.9706 10.1742 30.9629 11.3982 30.9629Z",
|
|
188
188
|
fill: "white"
|
|
189
189
|
}), /*#__PURE__*/React.createElement("path", {
|
|
190
|
-
d: "
|
|
190
|
+
d: "M31.4135 15.3141C31.4135 15.8751 30.9588 16.3298 30.3978 16.3298H17.036C16.475 16.3298 16.0203 15.8751 16.0203 15.3141V13.339C16.0203 12.778 16.475 12.3232 17.036 12.3232H30.3946C30.9555 12.3232 31.4103 12.778 31.4103 13.339L31.4135 15.3141Z",
|
|
191
191
|
fill: "white"
|
|
192
192
|
}), /*#__PURE__*/React.createElement("path", {
|
|
193
|
-
d: "
|
|
193
|
+
d: "M16.0235 20.1649C16.0235 19.8159 16.3065 19.5329 16.6555 19.5329H30.7815C31.1306 19.5329 31.4135 19.8159 31.4135 20.1649V22.9091C31.4135 23.2582 31.1306 23.5411 30.7815 23.5411H16.6555C16.3065 23.5411 16.0235 23.2582 16.0235 22.9091V20.1649Z",
|
|
194
194
|
fill: "white"
|
|
195
195
|
}), /*#__PURE__*/React.createElement("path", {
|
|
196
|
-
d: "
|
|
196
|
+
d: "M16.0235 27.3745C16.0235 27.0254 16.3065 26.7425 16.6555 26.7425H30.7815C31.1306 26.7425 31.4135 27.0254 31.4135 27.3745V30.1187C31.4135 30.4678 31.1306 30.7507 30.7815 30.7507H16.6555C16.3065 30.7507 16.0235 30.4678 16.0235 30.1187V27.3745Z",
|
|
197
197
|
fill: "white"
|
|
198
198
|
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
|
199
199
|
id: "paint0_linear_0_50",
|
|
@@ -21,7 +21,7 @@ export declare type LogoProps = {
|
|
|
21
21
|
* - predetermined sizes "sm" through "xxl" (similar to [Icon](/icon#size))
|
|
22
22
|
* - pixel value as a `string` (example: "28px")
|
|
23
23
|
*/
|
|
24
|
-
size?: '
|
|
24
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | `${number}px`;
|
|
25
25
|
/**
|
|
26
26
|
* Display the full-color or white/reversed version of the logo (default value is `white`).
|
|
27
27
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/tapestry-react",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.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",
|
package/src/Logo/ Logo.test.tsx
CHANGED
|
@@ -12,7 +12,7 @@ describe('Logo component', () => {
|
|
|
12
12
|
Object.keys(logos).forEach((logoName) => {
|
|
13
13
|
themes.forEach((theme) => {
|
|
14
14
|
markOnlyOptions.forEach((markOnly) => {
|
|
15
|
-
|
|
15
|
+
test(`<Logo name="${logoName}" theme="${theme}" markOnly=${markOnly} />`, () => {
|
|
16
16
|
const { container } = render(
|
|
17
17
|
<Logo
|
|
18
18
|
name={logoName as LogoProps['name']}
|
|
@@ -21,28 +21,36 @@ describe('Logo component', () => {
|
|
|
21
21
|
/>
|
|
22
22
|
)
|
|
23
23
|
const svg = container.querySelector('svg')
|
|
24
|
-
const title = svg.querySelector('title')
|
|
25
|
-
const titleId = title?.id
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
if (svg) {
|
|
26
|
+
const title = svg.querySelector('title')
|
|
27
|
+
const titleId = title?.id
|
|
28
|
+
|
|
29
|
+
expect(svg).toBeInTheDocument()
|
|
30
|
+
expect(title).toBeInTheDocument()
|
|
31
|
+
expect(svg).toHaveAttribute('role', 'img')
|
|
32
|
+
expect(svg).toHaveAttribute('aria-labelledby', titleId)
|
|
33
|
+
} else {
|
|
34
|
+
throw new Error('SVG element not found')
|
|
35
|
+
}
|
|
31
36
|
})
|
|
32
37
|
})
|
|
33
38
|
})
|
|
34
39
|
})
|
|
35
40
|
})
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
test('Render a Logo with defined size', () => {
|
|
38
43
|
const { container } = render(
|
|
39
44
|
<Logo name="people" theme="color" size="48px" />
|
|
40
45
|
)
|
|
41
46
|
const svgParent = container.querySelector('span')
|
|
42
47
|
const svg = container.querySelector('svg')
|
|
43
|
-
const computedStyles = window.getComputedStyle(svgParent)
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
if (!svgParent || !svg) {
|
|
50
|
+
throw new Error('SVG element (or parent element) not found')
|
|
51
|
+
} else {
|
|
52
|
+
expect(svg).toBeInTheDocument()
|
|
53
|
+
expect(window.getComputedStyle(svgParent).height).toBe('48px')
|
|
54
|
+
}
|
|
47
55
|
})
|
|
48
56
|
})
|
package/src/Logo/Logo.mdx
CHANGED
package/src/Logo/Logo.tsx
CHANGED
|
@@ -3,11 +3,11 @@ import Box from '../Box'
|
|
|
3
3
|
import { logos } from './logos'
|
|
4
4
|
|
|
5
5
|
const sizes = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
xs: '14px',
|
|
7
|
+
sm: '16px',
|
|
8
|
+
md: '18px',
|
|
9
|
+
lg: '24px',
|
|
10
|
+
xl: '32px',
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export type LogoProps = {
|
|
@@ -34,7 +34,7 @@ export type LogoProps = {
|
|
|
34
34
|
* - predetermined sizes "sm" through "xxl" (similar to [Icon](/icon#size))
|
|
35
35
|
* - pixel value as a `string` (example: "28px")
|
|
36
36
|
*/
|
|
37
|
-
size?: '
|
|
37
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | `${number}px`
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Display the full-color or white/reversed version of the logo (default value is `white`).
|
|
@@ -210,27 +210,27 @@ export const services: Logos = {
|
|
|
210
210
|
fill="url(#paint0_linear_0_50)"
|
|
211
211
|
/>
|
|
212
212
|
<path
|
|
213
|
-
d="
|
|
213
|
+
d="M11.3982 16.5436C12.6222 16.5436 13.6144 15.5513 13.6144 14.3273C13.6144 13.1033 12.6222 12.1111 11.3982 12.1111C10.1742 12.1111 9.18192 13.1033 9.18192 14.3273C9.18192 15.5513 10.1742 16.5436 11.3982 16.5436Z"
|
|
214
214
|
fill="white"
|
|
215
215
|
/>
|
|
216
216
|
<path
|
|
217
|
-
d="
|
|
217
|
+
d="M11.3982 23.7532C12.6222 23.7532 13.6144 22.761 13.6144 21.537C13.6144 20.313 12.6222 19.3207 11.3982 19.3207C10.1742 19.3207 9.18192 20.313 9.18192 21.537C9.18192 22.761 10.1742 23.7532 11.3982 23.7532Z"
|
|
218
218
|
fill="white"
|
|
219
219
|
/>
|
|
220
220
|
<path
|
|
221
|
-
d="
|
|
221
|
+
d="M11.3982 30.9629C12.6222 30.9629 13.6144 29.9706 13.6144 28.7466C13.6144 27.5226 12.6222 26.5304 11.3982 26.5304C10.1742 26.5304 9.18192 27.5226 9.18192 28.7466C9.18192 29.9706 10.1742 30.9629 11.3982 30.9629Z"
|
|
222
222
|
fill="white"
|
|
223
223
|
/>
|
|
224
224
|
<path
|
|
225
|
-
d="
|
|
225
|
+
d="M31.4135 15.3141C31.4135 15.8751 30.9588 16.3298 30.3978 16.3298H17.036C16.475 16.3298 16.0203 15.8751 16.0203 15.3141V13.339C16.0203 12.778 16.475 12.3232 17.036 12.3232H30.3946C30.9555 12.3232 31.4103 12.778 31.4103 13.339L31.4135 15.3141Z"
|
|
226
226
|
fill="white"
|
|
227
227
|
/>
|
|
228
228
|
<path
|
|
229
|
-
d="
|
|
229
|
+
d="M16.0235 20.1649C16.0235 19.8159 16.3065 19.5329 16.6555 19.5329H30.7815C31.1306 19.5329 31.4135 19.8159 31.4135 20.1649V22.9091C31.4135 23.2582 31.1306 23.5411 30.7815 23.5411H16.6555C16.3065 23.5411 16.0235 23.2582 16.0235 22.9091V20.1649Z"
|
|
230
230
|
fill="white"
|
|
231
231
|
/>
|
|
232
232
|
<path
|
|
233
|
-
d="
|
|
233
|
+
d="M16.0235 27.3745C16.0235 27.0254 16.3065 26.7425 16.6555 26.7425H30.7815C31.1306 26.7425 31.4135 27.0254 31.4135 27.3745V30.1187C31.4135 30.4678 31.1306 30.7507 30.7815 30.7507H16.6555C16.3065 30.7507 16.0235 30.4678 16.0235 30.1187V27.3745Z"
|
|
234
234
|
fill="white"
|
|
235
235
|
/>
|
|
236
236
|
</g>
|