@justeattakeaway/pie-divider 0.2.0 → 0.4.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/index.d.ts +27 -0
- package/dist/react.d.ts +30 -0
- package/dist/react.js +42 -1561
- package/package.json +7 -2
- package/src/index.ts +1 -5
- package/.eslintignore +0 -6
- package/.turbo/turbo-build.log +0 -14
- package/CHANGELOG.md +0 -19
- package/dist/types/index.d.ts +0 -1
- package/dist/types/packages/components/pie-divider/src/defs.d.ts +0 -13
- package/dist/types/packages/components/pie-divider/src/defs.d.ts.map +0 -1
- package/dist/types/packages/components/pie-divider/src/index.d.ts +0 -16
- package/dist/types/packages/components/pie-divider/src/index.d.ts.map +0 -1
- package/dist/types/packages/components/pie-divider/src/react.d.ts +0 -3
- package/dist/types/packages/components/pie-divider/src/react.d.ts.map +0 -1
- package/dist/types/react.d.ts +0 -1
- package/playwright/index.html +0 -57
- package/playwright/index.ts +0 -1
- package/playwright-lit-visual.config.ts +0 -4
- package/playwright-lit.config.ts +0 -4
- package/test/accessibility/pie-divider.spec.ts +0 -18
- package/test/component/pie-divider.spec.ts +0 -20
- package/test/visual/pie-divider.spec.ts +0 -50
- package/tsconfig.json +0 -8
- package/vite.config.js +0 -3
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-divider",
|
|
3
3
|
"description": "PIE Design System Divider built using Web Components",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
8
|
-
"types": "dist/
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"src",
|
|
11
|
+
"dist",
|
|
12
|
+
"**/*.d.ts"
|
|
13
|
+
],
|
|
9
14
|
"scripts": {
|
|
10
15
|
"build": "yarn build:wrapper pie-divider && run -T vite build",
|
|
11
16
|
"lint:scripts": "run -T eslint .",
|
package/src/index.ts
CHANGED
|
@@ -5,11 +5,7 @@ import styles from './divider.scss?inline';
|
|
|
5
5
|
import { DividerProps, variants, orientations } from './defs';
|
|
6
6
|
|
|
7
7
|
// Valid values available to consumers
|
|
8
|
-
export
|
|
9
|
-
type DividerProps,
|
|
10
|
-
variants,
|
|
11
|
-
orientations,
|
|
12
|
-
};
|
|
8
|
+
export * from './defs';
|
|
13
9
|
|
|
14
10
|
const componentSelector = 'pie-divider';
|
|
15
11
|
|
package/.eslintignore
DELETED
package/.turbo/turbo-build.log
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
[2:03:48 PM] @custom-elements-manifest/analyzer: Created new manifest.
|
|
2
|
-
react wrapper has been added!
|
|
3
|
-
[36mvite v4.3.9 [32mbuilding for production...[36m[39m
|
|
4
|
-
transforming...
|
|
5
|
-
[32m✓[39m 22 modules transformed.
|
|
6
|
-
rendering chunks...
|
|
7
|
-
computing gzip size...
|
|
8
|
-
[2mdist/[22m[36mindex.js [39m[1m[2m 2.04 kB[22m[1m[22m[2m │ gzip: 0.94 kB[22m
|
|
9
|
-
[2mdist/[22m[36mreact.js [39m[1m[2m59.02 kB[22m[1m[22m[2m │ gzip: 15.91 kB[22m
|
|
10
|
-
[32m
|
|
11
|
-
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
12
|
-
[32m✓ built in 45.92s[39m
|
|
13
|
-
[32m[36m[vite:dts][32m Declaration files built in 43220ms.
|
|
14
|
-
[39m
|
package/CHANGELOG.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# @justeattakeaway/pie-divider
|
|
2
|
-
|
|
3
|
-
## 0.2.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- [Added] pie divider component ([#704](https://github.com/justeattakeaway/pie/pull/704)) by [@raoufswe](https://github.com/raoufswe)
|
|
8
|
-
|
|
9
|
-
- [Changed] - skip visual tests ([#709](https://github.com/justeattakeaway/pie/pull/709)) by [@raoufswe](https://github.com/raoufswe)
|
|
10
|
-
|
|
11
|
-
- [Changed] extend ts config using relative paths ([#704](https://github.com/justeattakeaway/pie/pull/704)) by [@raoufswe](https://github.com/raoufswe)
|
|
12
|
-
|
|
13
|
-
## 0.1.0
|
|
14
|
-
|
|
15
|
-
### Minor Changes
|
|
16
|
-
|
|
17
|
-
- [Added] - Create a skeleton divider web component using our component generator ([#693](https://github.com/justeattakeaway/pie/pull/693)) by [@raoufswe](https://github.com/raoufswe)
|
|
18
|
-
|
|
19
|
-
- [Added] - init pie link ([#707](https://github.com/justeattakeaway/pie/pull/707)) by [@raoufswe](https://github.com/raoufswe)
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './packages/components/pie-divider/src/index'
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const variants: readonly ["default", "inverse"];
|
|
2
|
-
export declare const orientations: readonly ["horizontal", "vertical"];
|
|
3
|
-
export interface DividerProps {
|
|
4
|
-
/**
|
|
5
|
-
* What style variant the divider should be such as default or vertical.
|
|
6
|
-
*/
|
|
7
|
-
variant: typeof variants[number];
|
|
8
|
-
/**
|
|
9
|
-
* What orientation the divider should be such as horizontal or inverse.
|
|
10
|
-
*/
|
|
11
|
-
orientation: typeof orientations[number];
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=defs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../src/defs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,iCAAkC,CAAC;AACxD,eAAO,MAAM,YAAY,qCAAsC,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC1B;;QAEI;IACJ,OAAO,EAAE,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChC;;OAEG;IACJ,WAAW,EAAE,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;CAC3C"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import { DividerProps, variants, orientations } from './defs';
|
|
3
|
-
export { type DividerProps, variants, orientations, };
|
|
4
|
-
declare const componentSelector = "pie-divider";
|
|
5
|
-
export declare class PieDivider extends LitElement implements DividerProps {
|
|
6
|
-
variant: DividerProps['variant'];
|
|
7
|
-
orientation: DividerProps['orientation'];
|
|
8
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
-
static styles: import("lit").CSSResult;
|
|
10
|
-
}
|
|
11
|
-
declare global {
|
|
12
|
-
interface HTMLElementTagNameMap {
|
|
13
|
-
[componentSelector]: PieDivider;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAIlD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAG9D,OAAO,EACH,KAAK,YAAY,EACjB,QAAQ,EACR,YAAY,GACf,CAAC;AAEF,QAAA,MAAM,iBAAiB,gBAAgB,CAAC;AAExC,qBAAa,UAAW,SAAQ,UAAW,YAAW,YAAY;IAGvD,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAa;IAI7C,WAAW,EAAG,YAAY,CAAC,aAAa,CAAC,CAAgB;IAEhE,MAAM;IAcN,MAAM,CAAC,MAAM,0BAAqB;CACrC;AAID,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;KACnC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/react.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,SAAS,CAAC;AAExD,eAAO,MAAM,UAAU,kEAMrB,CAAC"}
|
package/dist/types/react.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './packages/components/pie-divider/src/react'
|
package/playwright/index.html
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff2" as="font" type="font/woff2" crossorigin>
|
|
7
|
-
<link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff2" as="font" type="font/woff2" crossorigin>
|
|
8
|
-
<link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff2" as="font" type="font/woff2" crossorigin>
|
|
9
|
-
<style>
|
|
10
|
-
@font-face {
|
|
11
|
-
font-family: JETSansDigital;
|
|
12
|
-
src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff2') format("woff2"),
|
|
13
|
-
url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff') format("woff");
|
|
14
|
-
font-weight: 400;
|
|
15
|
-
font-display: swap;
|
|
16
|
-
}
|
|
17
|
-
@font-face {
|
|
18
|
-
font-family: JETSansDigital;
|
|
19
|
-
src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff2') format("woff2"),
|
|
20
|
-
url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff') format("woff");
|
|
21
|
-
font-weight: 700;
|
|
22
|
-
font-display: swap;
|
|
23
|
-
}
|
|
24
|
-
@font-face {
|
|
25
|
-
font-family: JETSansDigital;
|
|
26
|
-
src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff2') format("woff2"),
|
|
27
|
-
url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff') format("woff");
|
|
28
|
-
font-weight: 800;
|
|
29
|
-
font-display: swap;
|
|
30
|
-
}
|
|
31
|
-
body {
|
|
32
|
-
font-feature-settings: "tnum"; /* Enable tabular numbers */
|
|
33
|
-
}
|
|
34
|
-
/* basic styles to center align components and give them some spacing */
|
|
35
|
-
#root {
|
|
36
|
-
padding: 1em;
|
|
37
|
-
min-height: 300px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
#root > * {
|
|
41
|
-
display: block;
|
|
42
|
-
margin-inline: auto;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
#root > * + * {
|
|
46
|
-
margin-top: 1em;
|
|
47
|
-
}
|
|
48
|
-
</style>
|
|
49
|
-
<title>Testing Page</title>
|
|
50
|
-
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@justeat/pie-design-tokens/dist/jet.css" />
|
|
51
|
-
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@justeat/pie-design-tokens/dist/jet-hsl-colors.css" />
|
|
52
|
-
</head>
|
|
53
|
-
<body>
|
|
54
|
-
<div id="root"></div>
|
|
55
|
-
<script type="module" src="./index.ts"></script>
|
|
56
|
-
</body>
|
|
57
|
-
</html>
|
package/playwright/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// Import common styles here
|
package/playwright-lit.config.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/fixtures.ts';
|
|
3
|
-
import { PieDivider, DividerProps } from '@/index';
|
|
4
|
-
|
|
5
|
-
test.describe('PieDivider - Accessibility tests', () => {
|
|
6
|
-
test('a11y - should test the PieDivider component WCAG compliance', async ({ makeAxeBuilder, mount }) => {
|
|
7
|
-
await mount(
|
|
8
|
-
PieDivider,
|
|
9
|
-
{
|
|
10
|
-
props: {} as DividerProps,
|
|
11
|
-
},
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
const results = await makeAxeBuilder().analyze();
|
|
15
|
-
|
|
16
|
-
expect(results.violations).toEqual([]);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { test, expect } from '@sand4rt/experimental-ct-web';
|
|
3
|
-
import { PieDivider, DividerProps } from '@/index';
|
|
4
|
-
|
|
5
|
-
const componentSelector = '[data-test-id="pie-divider"]';
|
|
6
|
-
|
|
7
|
-
test.describe('PieDivider - Component tests', () => {
|
|
8
|
-
test('should render successfully', async ({ mount, page }) => {
|
|
9
|
-
// Arrange
|
|
10
|
-
await mount(PieDivider, {
|
|
11
|
-
props: {} as DividerProps,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
// Act
|
|
15
|
-
const divider = page.locator(componentSelector);
|
|
16
|
-
|
|
17
|
-
// Assert
|
|
18
|
-
expect(divider).toBeVisible();
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { test } from '@sand4rt/experimental-ct-web';
|
|
3
|
-
import percySnapshot from '@percy/playwright';
|
|
4
|
-
import type {
|
|
5
|
-
PropObject, WebComponentPropValues, WebComponentTestInput,
|
|
6
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/defs.ts';
|
|
7
|
-
import {
|
|
8
|
-
getAllPropCombinations, splitCombinationsByPropertyValue,
|
|
9
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/get-all-prop-combos.ts';
|
|
10
|
-
import {
|
|
11
|
-
createTestWebComponent,
|
|
12
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/rendering.ts';
|
|
13
|
-
import {
|
|
14
|
-
WebComponentTestWrapper,
|
|
15
|
-
} from '@justeattakeaway/pie-webc-testing/src/helpers/components/web-component-test-wrapper/WebComponentTestWrapper.ts';
|
|
16
|
-
import { variants, orientations } from '@/defs';
|
|
17
|
-
import { PieDivider } from '@/index';
|
|
18
|
-
|
|
19
|
-
const props: PropObject = {
|
|
20
|
-
variant: variants,
|
|
21
|
-
orientation: orientations,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const renderTestPieDivider = (propVals: WebComponentPropValues) => `<pie-divider variant="${propVals.variant}" orientation="${propVals.orientation}" />`;
|
|
25
|
-
|
|
26
|
-
const componentPropsMatrix : WebComponentPropValues[] = getAllPropCombinations(props);
|
|
27
|
-
const componentPropsMatrixByVariant: Record<string, WebComponentPropValues[]> = splitCombinationsByPropertyValue(componentPropsMatrix, 'variant');
|
|
28
|
-
const componentVariants: string[] = Object.keys(componentPropsMatrixByVariant);
|
|
29
|
-
|
|
30
|
-
test.beforeEach(async ({ page, mount }) => {
|
|
31
|
-
await mount(PieDivider, {});
|
|
32
|
-
await page.evaluate(() => {
|
|
33
|
-
const element : Element | null = document.querySelector('pie-divider');
|
|
34
|
-
element?.remove();
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
componentVariants.forEach((variant) => test(`Render all prop variations for Variant: ${variant}`, async ({ page, mount }) => {
|
|
39
|
-
await Promise.all(componentPropsMatrixByVariant[variant].map(async (combo: WebComponentPropValues) => {
|
|
40
|
-
const testComponent: WebComponentTestInput = createTestWebComponent(combo, renderTestPieDivider);
|
|
41
|
-
const propKeyValues = `orientation: ${testComponent.propValues.orientation}}`;
|
|
42
|
-
|
|
43
|
-
await mount(
|
|
44
|
-
WebComponentTestWrapper,
|
|
45
|
-
{ props: { propKeyValues, darkMode: variant === 'inverse' } },
|
|
46
|
-
);
|
|
47
|
-
}));
|
|
48
|
-
|
|
49
|
-
await percySnapshot(page, `PIE Divider - Variant: ${variant}`);
|
|
50
|
-
}));
|
package/tsconfig.json
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../configs/pie-components-config/tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"rootDir": ".",
|
|
6
|
-
},
|
|
7
|
-
"include": ["src/**/*.ts","./declaration.d.ts", "test/**/*.ts", "playwright-lit-visual.config.ts", "playwright-lit.config.ts"],
|
|
8
|
-
}
|
package/vite.config.js
DELETED