@justeattakeaway/pie-divider 0.10.2 → 0.12.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.
@@ -0,0 +1,127 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/defs-react.js",
8
+ "declarations": [],
9
+ "exports": []
10
+ },
11
+ {
12
+ "kind": "javascript-module",
13
+ "path": "src/defs.js",
14
+ "declarations": [
15
+ {
16
+ "kind": "variable",
17
+ "name": "variants",
18
+ "type": {
19
+ "text": "['default', 'inverse']"
20
+ },
21
+ "default": "['default', 'inverse']"
22
+ },
23
+ {
24
+ "kind": "variable",
25
+ "name": "orientations",
26
+ "type": {
27
+ "text": "['horizontal', 'vertical']"
28
+ },
29
+ "default": "['horizontal', 'vertical']"
30
+ }
31
+ ],
32
+ "exports": [
33
+ {
34
+ "kind": "js",
35
+ "name": "variants",
36
+ "declaration": {
37
+ "name": "variants",
38
+ "module": "src/defs.js"
39
+ }
40
+ },
41
+ {
42
+ "kind": "js",
43
+ "name": "orientations",
44
+ "declaration": {
45
+ "name": "orientations",
46
+ "module": "src/defs.js"
47
+ }
48
+ }
49
+ ]
50
+ },
51
+ {
52
+ "kind": "javascript-module",
53
+ "path": "src/index.js",
54
+ "declarations": [
55
+ {
56
+ "kind": "class",
57
+ "description": "",
58
+ "name": "PieDivider",
59
+ "members": [
60
+ {
61
+ "kind": "field",
62
+ "name": "variant",
63
+ "type": {
64
+ "text": "DividerProps['variant']"
65
+ },
66
+ "privacy": "public",
67
+ "default": "'default'",
68
+ "attribute": "variant"
69
+ },
70
+ {
71
+ "kind": "field",
72
+ "name": "orientation",
73
+ "type": {
74
+ "text": "DividerProps['orientation']"
75
+ },
76
+ "privacy": "public",
77
+ "default": "'horizontal'",
78
+ "attribute": "orientation"
79
+ }
80
+ ],
81
+ "attributes": [
82
+ {
83
+ "name": "variant",
84
+ "type": {
85
+ "text": "DividerProps['variant']"
86
+ },
87
+ "default": "'default'",
88
+ "fieldName": "variant"
89
+ },
90
+ {
91
+ "name": "orientation",
92
+ "type": {
93
+ "text": "DividerProps['orientation']"
94
+ },
95
+ "default": "'horizontal'",
96
+ "fieldName": "orientation"
97
+ }
98
+ ],
99
+ "superclass": {
100
+ "name": "LitElement",
101
+ "package": "lit"
102
+ },
103
+ "tagName": "pie-divider",
104
+ "customElement": true
105
+ }
106
+ ],
107
+ "exports": [
108
+ {
109
+ "kind": "js",
110
+ "name": "*",
111
+ "declaration": {
112
+ "name": "*",
113
+ "package": "./defs"
114
+ }
115
+ },
116
+ {
117
+ "kind": "js",
118
+ "name": "PieDivider",
119
+ "declaration": {
120
+ "name": "PieDivider",
121
+ "module": "src/index.js"
122
+ }
123
+ }
124
+ ]
125
+ }
126
+ ]
127
+ }
package/dist/index.d.ts CHANGED
@@ -6,11 +6,11 @@ export declare interface DividerProps {
6
6
  /**
7
7
  * What style variant the divider should be such as default or vertical.
8
8
  */
9
- variant: typeof variants[number];
9
+ variant?: typeof variants[number];
10
10
  /**
11
11
  * What orientation the divider should be such as horizontal or inverse.
12
12
  */
13
- orientation: typeof orientations[number];
13
+ orientation?: typeof orientations[number];
14
14
  }
15
15
 
16
16
  export declare const orientations: readonly ["horizontal", "vertical"];
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@ class o extends h {
20
20
  data-test-id="pie-divider"
21
21
  aria-hidden="true"
22
22
  class="c-divider"
23
- variant=${i}
24
- orientation=${e}
23
+ variant=${i || "default"}
24
+ orientation=${e || "horizontal"}
25
25
  />`;
26
26
  }
27
27
  }
package/dist/react.d.ts CHANGED
@@ -1,22 +1,22 @@
1
1
  import type { CSSResult } from 'lit';
2
2
  import type { LitElement } from 'lit';
3
- import type { ReactWebComponent } from '@lit/react';
3
+ import * as React_2 from 'react';
4
4
  import type { TemplateResult } from 'lit-html';
5
5
 
6
6
  export declare interface DividerProps {
7
7
  /**
8
8
  * What style variant the divider should be such as default or vertical.
9
9
  */
10
- variant: typeof variants[number];
10
+ variant?: typeof variants[number];
11
11
  /**
12
12
  * What orientation the divider should be such as horizontal or inverse.
13
13
  */
14
- orientation: typeof orientations[number];
14
+ orientation?: typeof orientations[number];
15
15
  }
16
16
 
17
17
  export declare const orientations: readonly ["horizontal", "vertical"];
18
18
 
19
- export declare const PieDivider: ReactWebComponent<PieDivider_2, {}>;
19
+ export declare const PieDivider: React_2.ForwardRefExoticComponent<DividerProps & React_2.RefAttributes<PieDivider_2> & ReactBaseType>;
20
20
 
21
21
  /**
22
22
  * @tagname pie-divider
@@ -28,6 +28,8 @@ declare class PieDivider_2 extends LitElement implements DividerProps {
28
28
  static styles: CSSResult;
29
29
  }
30
30
 
31
+ declare type ReactBaseType = React_2.HTMLAttributes<HTMLHRElement>;
32
+
31
33
  export declare const variants: readonly ["default", "inverse"];
32
34
 
33
35
  export { }
package/dist/react.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import * as e from "react";
2
2
  import { createComponent as i } from "@lit/react";
3
3
  import { PieDivider as r } from "./index.js";
4
- import { orientations as v, variants as c } from "./index.js";
4
+ import { orientations as c, variants as D } from "./index.js";
5
5
  import "lit";
6
6
  import "lit/decorators.js";
7
7
  import "@justeattakeaway/pie-webc-core";
8
- const s = i({
8
+ const t = i({
9
9
  displayName: "PieDivider",
10
10
  elementClass: r,
11
11
  react: e,
12
12
  tagName: "pie-divider",
13
13
  events: {}
14
- });
14
+ }), n = t;
15
15
  export {
16
- s as PieDivider,
17
- v as orientations,
18
- c as variants
16
+ n as PieDivider,
17
+ c as orientations,
18
+ D as variants
19
19
  };
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-divider",
3
3
  "description": "PIE Design System Divider built using Web Components",
4
- "version": "0.10.2",
4
+ "version": "0.12.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "files": [
10
+ "custom-elements.json",
10
11
  "src",
11
12
  "dist",
12
13
  "**/*.d.ts"
13
14
  ],
14
15
  "scripts": {
15
- "build": "yarn build:wrapper pie-divider && run -T vite build",
16
+ "build": "run -T vite build",
17
+ "build:react-wrapper": "npx build-react-wrapper",
18
+ "create:manifest": "yarn cem analyze --litelement",
16
19
  "lint:scripts": "run -T eslint .",
17
20
  "lint:scripts:fix": "yarn lint:scripts --fix",
18
21
  "lint:style": "run -T stylelint ./src/**/*.{css,scss}",
@@ -28,14 +31,18 @@
28
31
  "author": "Just Eat Takeaway.com - Design System Team",
29
32
  "license": "Apache-2.0",
30
33
  "devDependencies": {
31
- "@justeattakeaway/pie-components-config": "0.7.0"
34
+ "@custom-elements-manifest/analyzer": "0.9.0",
35
+ "@justeattakeaway/pie-components-config": "0.9.0",
36
+ "@justeattakeaway/pie-wrapper-react": "0.13.0",
37
+ "cem-plugin-module-file-extensions": "0.0.5"
32
38
  },
33
39
  "dependencies": {
34
- "@justeattakeaway/pie-webc-core": "0.15.0"
40
+ "@justeattakeaway/pie-webc-core": "0.17.0"
35
41
  },
36
42
  "volta": {
37
43
  "extends": "../../../package.json"
38
44
  },
45
+ "customElements": "custom-elements.json",
39
46
  "sideEffects": [
40
47
  "dist/*.js"
41
48
  ]
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+
3
+ export type ReactBaseType = React.HTMLAttributes<HTMLHRElement>
package/src/defs.ts CHANGED
@@ -5,9 +5,9 @@ export interface DividerProps {
5
5
  /**
6
6
  * What style variant the divider should be such as default or vertical.
7
7
  */
8
- variant: typeof variants[number];
8
+ variant?: typeof variants[number];
9
9
  /**
10
10
  * What orientation the divider should be such as horizontal or inverse.
11
11
  */
12
- orientation: typeof orientations[number];
12
+ orientation?: typeof orientations[number];
13
13
  }
package/src/index.ts CHANGED
@@ -29,8 +29,8 @@ export class PieDivider extends LitElement implements DividerProps {
29
29
  data-test-id="pie-divider"
30
30
  aria-hidden="true"
31
31
  class="c-divider"
32
- variant=${variant}
33
- orientation=${orientation}
32
+ variant=${variant || 'default'}
33
+ orientation=${orientation || 'horizontal'}
34
34
  />`;
35
35
  }
36
36
 
package/src/react.ts ADDED
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { createComponent } from '@lit/react';
3
+ import { PieDivider as PieDividerLit } from './index';
4
+ import { DividerProps } from './defs';
5
+
6
+ export * from './defs';
7
+
8
+ const PieDividerReact = createComponent({
9
+ displayName: 'PieDivider',
10
+ elementClass: PieDividerLit,
11
+ react: React,
12
+ tagName: 'pie-divider',
13
+ events: {},
14
+ });
15
+
16
+ type ReactBaseType = React.HTMLAttributes<HTMLHRElement>
17
+
18
+
19
+
20
+ export const PieDivider = PieDividerReact as React.ForwardRefExoticComponent<React.PropsWithoutRef<DividerProps> & React.RefAttributes<PieDividerLit> & ReactBaseType>;