@justeattakeaway/pie-card 0.16.0 → 0.17.1

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.
@@ -2,6 +2,12 @@
2
2
  "schemaVersion": "1.0.0",
3
3
  "readme": "",
4
4
  "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/defs-react.js",
8
+ "declarations": [],
9
+ "exports": []
10
+ },
5
11
  {
6
12
  "kind": "javascript-module",
7
13
  "path": "src/defs.js",
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export declare interface CardProps {
14
14
  /**
15
15
  * When true, the card is disabled.
16
16
  */
17
- disabled: boolean;
17
+ disabled?: boolean;
18
18
  /**
19
19
  * The URL that the card should point to (this will not take effect unless the card is a link).
20
20
  */
@@ -30,11 +30,11 @@ export declare interface CardProps {
30
30
  /**
31
31
  * What style variant the card should be such as default or inverse.
32
32
  */
33
- variant: typeof variants[number];
33
+ variant?: typeof variants[number];
34
34
  /**
35
35
  * Allows the consumer to set draggable css styles (grab/grabbing cursor styles).
36
36
  */
37
- isDraggable: boolean;
37
+ isDraggable?: boolean;
38
38
  /**
39
39
  * What HTML element the card should be such as `a` or `button`.
40
40
  */
package/dist/index.js CHANGED
@@ -25,9 +25,9 @@ class t extends p {
25
25
  <a
26
26
  class="c-card"
27
27
  data-test-id="pie-card"
28
- tag=${this.tag}
28
+ tag=${this.tag || "a"}
29
29
  ?isDraggable="${this.isDraggable}"
30
- variant=${this.variant}
30
+ variant=${this.variant || "default"}
31
31
  ?disabled=${this.disabled}
32
32
  href=${this.href || i}
33
33
  target=${this.target || i}
@@ -70,9 +70,9 @@ class t extends p {
70
70
  <div
71
71
  class="c-card"
72
72
  data-test-id="pie-card"
73
- tag=${e}
73
+ tag=${e || "button"}
74
74
  ?isDraggable="${n}"
75
- variant=${o}
75
+ variant=${o || "default"}
76
76
  ?disabled=${a}
77
77
  role="button"
78
78
  tabindex="0"
package/dist/react.d.ts CHANGED
@@ -1,6 +1,6 @@
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';
5
5
 
6
6
  export declare type AriaProps = {
@@ -15,7 +15,7 @@ export declare interface CardProps {
15
15
  /**
16
16
  * When true, the card is disabled.
17
17
  */
18
- disabled: boolean;
18
+ disabled?: boolean;
19
19
  /**
20
20
  * The URL that the card should point to (this will not take effect unless the card is a link).
21
21
  */
@@ -31,11 +31,11 @@ export declare interface CardProps {
31
31
  /**
32
32
  * What style variant the card should be such as default or inverse.
33
33
  */
34
- variant: typeof variants[number];
34
+ variant?: typeof variants[number];
35
35
  /**
36
36
  * Allows the consumer to set draggable css styles (grab/grabbing cursor styles).
37
37
  */
38
- isDraggable: boolean;
38
+ isDraggable?: boolean;
39
39
  /**
40
40
  * What HTML element the card should be such as `a` or `button`.
41
41
  */
@@ -52,7 +52,7 @@ declare type PaddingValue = typeof spacingTokens[number];
52
52
 
53
53
  export declare const paddingValues: string[];
54
54
 
55
- export declare const PieCard: ReactWebComponent<PieCard_2, {}>;
55
+ export declare const PieCard: React_2.ForwardRefExoticComponent<CardProps & React_2.RefAttributes<PieCard_2> & React_2.AnchorHTMLAttributes<HTMLAnchorElement> & React_2.ButtonHTMLAttributes<HTMLButtonElement>>;
56
56
 
57
57
  /**
58
58
  * @tagname pie-card
package/dist/react.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import * as a from "react";
2
2
  import { createComponent as e } from "@lit/react";
3
3
  import { PieCard as r } from "./index.js";
4
- import { paddingValues as C, tags as c, variants as f } from "./index.js";
4
+ import { paddingValues as C, tags as P, variants as f } from "./index.js";
5
5
  import "lit";
6
6
  import "lit/decorators.js";
7
7
  import "@justeattakeaway/pie-webc-core";
8
- const s = e({
8
+ const t = e({
9
9
  displayName: "PieCard",
10
10
  elementClass: r,
11
11
  react: a,
12
12
  tagName: "pie-card",
13
13
  events: {}
14
- });
14
+ }), d = t;
15
15
  export {
16
- s as PieCard,
16
+ d as PieCard,
17
17
  C as paddingValues,
18
- c as tags,
18
+ P as tags,
19
19
  f as variants
20
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-card",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "description": "PIE Design System Card built using Web Components",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -32,12 +32,12 @@
32
32
  "license": "Apache-2.0",
33
33
  "devDependencies": {
34
34
  "@custom-elements-manifest/analyzer": "0.9.0",
35
- "@justeattakeaway/pie-components-config": "0.8.0",
36
- "@justeattakeaway/pie-wrapper-react": "0.12.0",
35
+ "@justeattakeaway/pie-components-config": "0.9.0",
36
+ "@justeattakeaway/pie-wrapper-react": "0.14.0",
37
37
  "cem-plugin-module-file-extensions": "0.0.5"
38
38
  },
39
39
  "dependencies": {
40
- "@justeattakeaway/pie-webc-core": "0.16.0"
40
+ "@justeattakeaway/pie-webc-core": "0.17.1"
41
41
  },
42
42
  "volta": {
43
43
  "extends": "../../../package.json"
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+
3
+ export type ReactBaseType = React.AnchorHTMLAttributes<HTMLAnchorElement> & React.ButtonHTMLAttributes<HTMLButtonElement>
package/src/defs.ts CHANGED
@@ -19,7 +19,7 @@ export interface CardProps {
19
19
  /**
20
20
  * When true, the card is disabled.
21
21
  */
22
- disabled: boolean;
22
+ disabled?: boolean;
23
23
 
24
24
  /**
25
25
  * The URL that the card should point to (this will not take effect unless the card is a link).
@@ -39,12 +39,12 @@ export interface CardProps {
39
39
  /**
40
40
  * What style variant the card should be such as default or inverse.
41
41
  */
42
- variant: typeof variants[number];
42
+ variant?: typeof variants[number];
43
43
 
44
44
  /**
45
45
  * Allows the consumer to set draggable css styles (grab/grabbing cursor styles).
46
46
  */
47
- isDraggable: boolean;
47
+ isDraggable?: boolean;
48
48
 
49
49
  /**
50
50
  * What HTML element the card should be such as `a` or `button`.
package/src/index.ts CHANGED
@@ -62,9 +62,9 @@ export class PieCard extends LitElement implements CardProps {
62
62
  <a
63
63
  class="c-card"
64
64
  data-test-id="pie-card"
65
- tag=${this.tag}
65
+ tag=${this.tag || 'a'}
66
66
  ?isDraggable="${this.isDraggable}"
67
- variant=${this.variant}
67
+ variant=${this.variant || 'default'}
68
68
  ?disabled=${this.disabled}
69
69
  href=${this.href || nothing}
70
70
  target=${this.target || nothing}
@@ -134,9 +134,9 @@ export class PieCard extends LitElement implements CardProps {
134
134
  <div
135
135
  class="c-card"
136
136
  data-test-id="pie-card"
137
- tag=${tag}
137
+ tag=${tag || 'button'}
138
138
  ?isDraggable="${isDraggable}"
139
- variant=${variant}
139
+ variant=${variant || 'default'}
140
140
  ?disabled=${disabled}
141
141
  role="button"
142
142
  tabindex="0"
package/src/react.ts CHANGED
@@ -1,14 +1,19 @@
1
-
2
1
  import * as React from 'react';
3
2
  import { createComponent } from '@lit/react';
4
- import { PieCard as PieCardReact } from './index';
3
+ import { PieCard as PieCardLit } from './index';
4
+ import { CardProps } from './defs';
5
5
 
6
6
  export * from './defs';
7
7
 
8
- export const PieCard = createComponent({
8
+ const PieCardReact = createComponent({
9
9
  displayName: 'PieCard',
10
- elementClass: PieCardReact,
10
+ elementClass: PieCardLit,
11
11
  react: React,
12
12
  tagName: 'pie-card',
13
13
  events: {},
14
14
  });
15
+
16
+ type ReactBaseType = React.AnchorHTMLAttributes<HTMLAnchorElement> & React.ButtonHTMLAttributes<HTMLButtonElement>
17
+
18
+ export const PieCard = PieCardReact as React.ForwardRefExoticComponent<React.PropsWithoutRef<CardProps>
19
+ & React.RefAttributes<PieCardLit> & ReactBaseType>;