@justeattakeaway/pie-icon-button 0.25.2 → 0.27.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/custom-elements.json +174 -0
- package/dist/react.d.ts +4 -2
- package/dist/react.js +5 -5
- package/package.json +15 -5
- package/src/defs-react.ts +3 -0
- package/src/react.ts +20 -0
|
@@ -0,0 +1,174 @@
|
|
|
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": "sizes",
|
|
18
|
+
"type": {
|
|
19
|
+
"text": "['xsmall', 'small', 'medium', 'large']"
|
|
20
|
+
},
|
|
21
|
+
"default": "['xsmall', 'small', 'medium', 'large']"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"kind": "variable",
|
|
25
|
+
"name": "variants",
|
|
26
|
+
"type": {
|
|
27
|
+
"text": "['primary', 'secondary', 'outline', 'ghost',\n 'ghost-secondary', 'inverse', 'ghost-inverse']"
|
|
28
|
+
},
|
|
29
|
+
"default": "['primary', 'secondary', 'outline', 'ghost',\n 'ghost-secondary', 'inverse', 'ghost-inverse']"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"exports": [
|
|
33
|
+
{
|
|
34
|
+
"kind": "js",
|
|
35
|
+
"name": "sizes",
|
|
36
|
+
"declaration": {
|
|
37
|
+
"name": "sizes",
|
|
38
|
+
"module": "src/defs.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"kind": "js",
|
|
43
|
+
"name": "variants",
|
|
44
|
+
"declaration": {
|
|
45
|
+
"name": "variants",
|
|
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": "PieIconButton",
|
|
59
|
+
"members": [
|
|
60
|
+
{
|
|
61
|
+
"kind": "field",
|
|
62
|
+
"name": "size",
|
|
63
|
+
"type": {
|
|
64
|
+
"text": "IconButtonProps['size'] | undefined"
|
|
65
|
+
},
|
|
66
|
+
"privacy": "public",
|
|
67
|
+
"default": "'medium'",
|
|
68
|
+
"attribute": "size"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"kind": "field",
|
|
72
|
+
"name": "variant",
|
|
73
|
+
"type": {
|
|
74
|
+
"text": "IconButtonProps['variant'] | undefined"
|
|
75
|
+
},
|
|
76
|
+
"privacy": "public",
|
|
77
|
+
"default": "'primary'",
|
|
78
|
+
"attribute": "variant"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"kind": "field",
|
|
82
|
+
"name": "disabled",
|
|
83
|
+
"type": {
|
|
84
|
+
"text": "boolean"
|
|
85
|
+
},
|
|
86
|
+
"privacy": "public",
|
|
87
|
+
"default": "false",
|
|
88
|
+
"attribute": "disabled"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"kind": "field",
|
|
92
|
+
"name": "isLoading",
|
|
93
|
+
"type": {
|
|
94
|
+
"text": "boolean"
|
|
95
|
+
},
|
|
96
|
+
"privacy": "public",
|
|
97
|
+
"default": "false",
|
|
98
|
+
"attribute": "isLoading"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"kind": "method",
|
|
102
|
+
"name": "renderSpinner",
|
|
103
|
+
"privacy": "private",
|
|
104
|
+
"return": {
|
|
105
|
+
"type": {
|
|
106
|
+
"text": "TemplateResult"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"description": "Template for the loading state"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"attributes": [
|
|
113
|
+
{
|
|
114
|
+
"name": "size",
|
|
115
|
+
"type": {
|
|
116
|
+
"text": "IconButtonProps['size'] | undefined"
|
|
117
|
+
},
|
|
118
|
+
"default": "'medium'",
|
|
119
|
+
"fieldName": "size"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "variant",
|
|
123
|
+
"type": {
|
|
124
|
+
"text": "IconButtonProps['variant'] | undefined"
|
|
125
|
+
},
|
|
126
|
+
"default": "'primary'",
|
|
127
|
+
"fieldName": "variant"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "disabled",
|
|
131
|
+
"type": {
|
|
132
|
+
"text": "boolean"
|
|
133
|
+
},
|
|
134
|
+
"default": "false",
|
|
135
|
+
"fieldName": "disabled"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "isLoading",
|
|
139
|
+
"type": {
|
|
140
|
+
"text": "boolean"
|
|
141
|
+
},
|
|
142
|
+
"default": "false",
|
|
143
|
+
"fieldName": "isLoading"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"superclass": {
|
|
147
|
+
"name": "LitElement",
|
|
148
|
+
"package": "lit"
|
|
149
|
+
},
|
|
150
|
+
"tagName": "pie-icon-button",
|
|
151
|
+
"customElement": true
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"exports": [
|
|
155
|
+
{
|
|
156
|
+
"kind": "js",
|
|
157
|
+
"name": "*",
|
|
158
|
+
"declaration": {
|
|
159
|
+
"name": "*",
|
|
160
|
+
"package": "./defs"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"kind": "js",
|
|
165
|
+
"name": "PieIconButton",
|
|
166
|
+
"declaration": {
|
|
167
|
+
"name": "PieIconButton",
|
|
168
|
+
"module": "src/index.js"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|
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
|
|
3
|
+
import * as React_2 from 'react';
|
|
4
4
|
import type { TemplateResult } from 'lit';
|
|
5
5
|
|
|
6
6
|
export declare interface IconButtonProps {
|
|
@@ -26,7 +26,7 @@ export declare interface IconButtonProps {
|
|
|
26
26
|
isLoading?: boolean;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export declare const PieIconButton:
|
|
29
|
+
export declare const PieIconButton: React_2.ForwardRefExoticComponent<IconButtonProps & React_2.RefAttributes<PieIconButton_2> & ReactBaseType>;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* @tagname pie-icon-button
|
|
@@ -46,6 +46,8 @@ declare class PieIconButton_2 extends LitElement implements IconButtonProps {
|
|
|
46
46
|
static styles: CSSResult;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
declare type ReactBaseType = React_2.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
50
|
+
|
|
49
51
|
export declare const sizes: readonly ["xsmall", "small", "medium", "large"];
|
|
50
52
|
|
|
51
53
|
export declare const variants: readonly ["primary", "secondary", "outline", "ghost", "ghost-secondary", "inverse", "ghost-inverse"];
|
package/dist/react.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as t from "react";
|
|
2
2
|
import { createComponent as o } from "@lit/react";
|
|
3
3
|
import { PieIconButton as e } from "./index.js";
|
|
4
|
-
import { sizes as
|
|
4
|
+
import { sizes as I, variants as P } from "./index.js";
|
|
5
5
|
import "lit";
|
|
6
6
|
import "lit/decorators.js";
|
|
7
7
|
import "@justeattakeaway/pie-webc-core";
|
|
8
8
|
import "@justeattakeaway/pie-spinner";
|
|
9
|
-
const
|
|
9
|
+
const n = o({
|
|
10
10
|
displayName: "PieIconButton",
|
|
11
11
|
elementClass: e,
|
|
12
12
|
react: t,
|
|
13
13
|
tagName: "pie-icon-button",
|
|
14
14
|
events: {}
|
|
15
|
-
});
|
|
15
|
+
}), s = n;
|
|
16
16
|
export {
|
|
17
17
|
s as PieIconButton,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
I as sizes,
|
|
19
|
+
P as variants
|
|
20
20
|
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-icon-button",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "PIE Design System Icon Button built using Web Components",
|
|
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": "
|
|
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": "run -T eslint . --fix",
|
|
18
21
|
"lint:style": "run -T stylelint ./src/**/*.{css,scss}",
|
|
@@ -25,14 +28,21 @@
|
|
|
25
28
|
},
|
|
26
29
|
"author": "Just Eat Takeaway.com - Design System Team",
|
|
27
30
|
"license": "Apache-2.0",
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
33
|
+
"@justeattakeaway/pie-components-config": "0.9.0",
|
|
34
|
+
"@justeattakeaway/pie-wrapper-react": "0.13.0",
|
|
35
|
+
"cem-plugin-module-file-extensions": "0.0.5"
|
|
36
|
+
},
|
|
28
37
|
"dependencies": {
|
|
29
|
-
"@justeattakeaway/pie-icons-webc": "0.
|
|
30
|
-
"@justeattakeaway/pie-spinner": "0.
|
|
31
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
38
|
+
"@justeattakeaway/pie-icons-webc": "0.17.1",
|
|
39
|
+
"@justeattakeaway/pie-spinner": "0.5.0",
|
|
40
|
+
"@justeattakeaway/pie-webc-core": "0.17.0"
|
|
32
41
|
},
|
|
33
42
|
"volta": {
|
|
34
43
|
"extends": "../../../package.json"
|
|
35
44
|
},
|
|
45
|
+
"customElements": "custom-elements.json",
|
|
36
46
|
"sideEffects": [
|
|
37
47
|
"dist/*.js"
|
|
38
48
|
]
|
package/src/react.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { PieIconButton as PieIconButtonLit } from './index';
|
|
4
|
+
import { IconButtonProps } from './defs';
|
|
5
|
+
|
|
6
|
+
export * from './defs';
|
|
7
|
+
|
|
8
|
+
const PieIconButtonReact = createComponent({
|
|
9
|
+
displayName: 'PieIconButton',
|
|
10
|
+
elementClass: PieIconButtonLit,
|
|
11
|
+
react: React,
|
|
12
|
+
tagName: 'pie-icon-button',
|
|
13
|
+
events: {},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
type ReactBaseType = React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export const PieIconButton = PieIconButtonReact as React.ForwardRefExoticComponent<React.PropsWithoutRef<IconButtonProps> & React.RefAttributes<PieIconButtonLit> & ReactBaseType>;
|