@justeattakeaway/pie-tag 0.3.0 → 0.4.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
@@ -21,15 +21,15 @@ export declare interface TagProps {
21
21
  /**
22
22
  * What style variant the tag should be such as neutral/ghost etc.
23
23
  */
24
- variant: typeof variants[number];
24
+ variant?: typeof variants[number];
25
25
  /**
26
26
  * When true, the 'green', "yellow", "red", "blue" and "neutral" variants change their styles and become bolder
27
27
  */
28
- isStrong: boolean;
28
+ isStrong?: boolean;
29
29
  /**
30
30
  * What size the tag should be.
31
31
  */
32
- size: typeof sizes[number];
32
+ size?: typeof sizes[number];
33
33
  }
34
34
 
35
35
  export declare const variants: readonly ["neutral-alternative", "neutral", "outline", "ghost", "blue", "green", "yellow", "red", "brand"];
package/dist/index.js CHANGED
@@ -22,8 +22,8 @@ class e extends u {
22
22
  return s`
23
23
  <div
24
24
  class="c-tag"
25
- variant=${a}
26
- size=${r}
25
+ variant=${a || "neutral"}
26
+ size=${r || "large"}
27
27
  ?isStrong=${o}
28
28
  data-test-id="pie-tag"
29
29
  >
package/dist/react.d.ts CHANGED
@@ -1,9 +1,9 @@
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
- export declare const PieTag: ReactWebComponent<PieTag_2, {}>;
6
+ export declare const PieTag: React_2.ForwardRefExoticComponent<TagProps & React_2.RefAttributes<PieTag_2> & ReactBaseType>;
7
7
 
8
8
  /**
9
9
  * @tagname pie-tag
@@ -18,21 +18,23 @@ declare class PieTag_2 extends LitElement implements TagProps {
18
18
  static styles: CSSResult;
19
19
  }
20
20
 
21
+ declare type ReactBaseType = React_2.HTMLAttributes<HTMLSpanElement>;
22
+
21
23
  export declare const sizes: readonly ["small", "large"];
22
24
 
23
25
  export declare interface TagProps {
24
26
  /**
25
27
  * What style variant the tag should be such as neutral/ghost etc.
26
28
  */
27
- variant: typeof variants[number];
29
+ variant?: typeof variants[number];
28
30
  /**
29
31
  * When true, the 'green', "yellow", "red", "blue" and "neutral" variants change their styles and become bolder
30
32
  */
31
- isStrong: boolean;
33
+ isStrong?: boolean;
32
34
  /**
33
35
  * What size the tag should be.
34
36
  */
35
- size: typeof sizes[number];
37
+ size?: typeof sizes[number];
36
38
  }
37
39
 
38
40
  export declare const variants: readonly ["neutral-alternative", "neutral", "outline", "ghost", "blue", "green", "yellow", "red", "brand"];
package/dist/react.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import * as e from "react";
2
2
  import { createComponent as t } from "@lit/react";
3
3
  import { PieTag as a } from "./index.js";
4
- import { sizes as c, variants as f } from "./index.js";
4
+ import { sizes as P, variants as T } from "./index.js";
5
5
  import "lit";
6
6
  import "lit/decorators.js";
7
7
  import "@justeattakeaway/pie-webc-core";
8
- const s = t({
8
+ const o = t({
9
9
  displayName: "PieTag",
10
10
  elementClass: a,
11
11
  react: e,
12
12
  tagName: "pie-tag",
13
13
  events: {}
14
- });
14
+ }), g = o;
15
15
  export {
16
- s as PieTag,
17
- c as sizes,
18
- f as variants
16
+ g as PieTag,
17
+ P as sizes,
18
+ T as variants
19
19
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-tag",
3
3
  "description": "PIE Design System Tag built using Web Components",
4
- "version": "0.3.0",
4
+ "version": "0.4.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "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.HTMLAttributes<HTMLSpanElement>
package/src/defs.ts CHANGED
@@ -5,15 +5,15 @@ export interface TagProps {
5
5
  /**
6
6
  * What style variant the tag should be such as neutral/ghost etc.
7
7
  */
8
- variant: typeof variants[number];
8
+ variant?: typeof variants[number];
9
9
 
10
10
  /**
11
11
  * When true, the 'green', "yellow", "red", "blue" and "neutral" variants change their styles and become bolder
12
12
  */
13
- isStrong: boolean;
13
+ isStrong?: boolean;
14
14
 
15
15
  /**
16
16
  * What size the tag should be.
17
17
  */
18
- size: typeof sizes[number];
18
+ size?: typeof sizes[number];
19
19
  }
package/src/index.ts CHANGED
@@ -37,8 +37,8 @@ export class PieTag extends LitElement implements TagProps {
37
37
  return html`
38
38
  <div
39
39
  class="c-tag"
40
- variant=${variant}
41
- size=${size}
40
+ variant=${variant || 'neutral'}
41
+ size=${size || 'large'}
42
42
  ?isStrong=${isStrong}
43
43
  data-test-id="pie-tag"
44
44
  >
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 { PieTag as PieTagReact } from './index';
3
+ import { PieTag as PieTagLit } from './index';
4
+ import { TagProps } from './defs';
5
5
 
6
6
  export * from './defs';
7
7
 
8
- export const PieTag = createComponent({
8
+ const PieTagReact = createComponent({
9
9
  displayName: 'PieTag',
10
- elementClass: PieTagReact,
10
+ elementClass: PieTagLit,
11
11
  react: React,
12
12
  tagName: 'pie-tag',
13
13
  events: {},
14
14
  });
15
+
16
+ type ReactBaseType = React.HTMLAttributes<HTMLSpanElement>
17
+
18
+ export const PieTag = PieTagReact as React.ForwardRefExoticComponent<React.PropsWithoutRef<TagProps>
19
+ & React.RefAttributes<PieTagLit> & ReactBaseType>;