@justeattakeaway/pie-button 0.43.0 → 0.44.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,509 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/defs.js",
8
+ "declarations": [
9
+ {
10
+ "kind": "variable",
11
+ "name": "sizes",
12
+ "type": {
13
+ "text": "['xsmall', 'small-productive', 'small-expressive', 'medium', 'large']"
14
+ },
15
+ "default": "['xsmall', 'small-productive', 'small-expressive', 'medium', 'large']"
16
+ },
17
+ {
18
+ "kind": "variable",
19
+ "name": "responsiveSizes",
20
+ "type": {
21
+ "text": "['productive', 'expressive']"
22
+ },
23
+ "default": "['productive', 'expressive']"
24
+ },
25
+ {
26
+ "kind": "variable",
27
+ "name": "types",
28
+ "type": {
29
+ "text": "['submit', 'button', 'reset']"
30
+ },
31
+ "default": "['submit', 'button', 'reset']"
32
+ },
33
+ {
34
+ "kind": "variable",
35
+ "name": "variants",
36
+ "type": {
37
+ "text": "[\n 'primary', 'secondary', 'outline', 'outline-inverse', 'ghost',\n 'inverse', 'ghost-inverse', 'destructive', 'destructive-ghost',\n]"
38
+ },
39
+ "default": "[\n 'primary', 'secondary', 'outline', 'outline-inverse', 'ghost',\n 'inverse', 'ghost-inverse', 'destructive', 'destructive-ghost',\n]"
40
+ },
41
+ {
42
+ "kind": "variable",
43
+ "name": "iconPlacements",
44
+ "type": {
45
+ "text": "['leading', 'trailing']"
46
+ },
47
+ "default": "['leading', 'trailing']"
48
+ },
49
+ {
50
+ "kind": "variable",
51
+ "name": "formEncodingtypes",
52
+ "type": {
53
+ "text": "['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain']"
54
+ },
55
+ "default": "['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain']"
56
+ },
57
+ {
58
+ "kind": "variable",
59
+ "name": "formMethodTypes",
60
+ "type": {
61
+ "text": "['post', 'get', 'dialog']"
62
+ },
63
+ "default": "['post', 'get', 'dialog']"
64
+ },
65
+ {
66
+ "kind": "variable",
67
+ "name": "formTargetTypes",
68
+ "type": {
69
+ "text": "['_self', '_blank', '_parent', '_top']"
70
+ },
71
+ "default": "['_self', '_blank', '_parent', '_top']"
72
+ }
73
+ ],
74
+ "exports": [
75
+ {
76
+ "kind": "js",
77
+ "name": "sizes",
78
+ "declaration": {
79
+ "name": "sizes",
80
+ "module": "src/defs.js"
81
+ }
82
+ },
83
+ {
84
+ "kind": "js",
85
+ "name": "responsiveSizes",
86
+ "declaration": {
87
+ "name": "responsiveSizes",
88
+ "module": "src/defs.js"
89
+ }
90
+ },
91
+ {
92
+ "kind": "js",
93
+ "name": "types",
94
+ "declaration": {
95
+ "name": "types",
96
+ "module": "src/defs.js"
97
+ }
98
+ },
99
+ {
100
+ "kind": "js",
101
+ "name": "variants",
102
+ "declaration": {
103
+ "name": "variants",
104
+ "module": "src/defs.js"
105
+ }
106
+ },
107
+ {
108
+ "kind": "js",
109
+ "name": "iconPlacements",
110
+ "declaration": {
111
+ "name": "iconPlacements",
112
+ "module": "src/defs.js"
113
+ }
114
+ },
115
+ {
116
+ "kind": "js",
117
+ "name": "formEncodingtypes",
118
+ "declaration": {
119
+ "name": "formEncodingtypes",
120
+ "module": "src/defs.js"
121
+ }
122
+ },
123
+ {
124
+ "kind": "js",
125
+ "name": "formMethodTypes",
126
+ "declaration": {
127
+ "name": "formMethodTypes",
128
+ "module": "src/defs.js"
129
+ }
130
+ },
131
+ {
132
+ "kind": "js",
133
+ "name": "formTargetTypes",
134
+ "declaration": {
135
+ "name": "formTargetTypes",
136
+ "module": "src/defs.js"
137
+ }
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ "kind": "javascript-module",
143
+ "path": "src/index.js",
144
+ "declarations": [
145
+ {
146
+ "kind": "class",
147
+ "description": "",
148
+ "name": "PieButton",
149
+ "slots": [
150
+ {
151
+ "description": "The icon slot",
152
+ "name": "icon"
153
+ },
154
+ {
155
+ "description": "Default slot",
156
+ "name": ""
157
+ }
158
+ ],
159
+ "members": [
160
+ {
161
+ "kind": "field",
162
+ "name": "size",
163
+ "type": {
164
+ "text": "ButtonProps['size']"
165
+ },
166
+ "privacy": "public",
167
+ "default": "'medium'",
168
+ "attribute": "size"
169
+ },
170
+ {
171
+ "kind": "field",
172
+ "name": "type",
173
+ "type": {
174
+ "text": "ButtonProps['type']"
175
+ },
176
+ "privacy": "public",
177
+ "default": "'submit'",
178
+ "attribute": "type"
179
+ },
180
+ {
181
+ "kind": "field",
182
+ "name": "variant",
183
+ "type": {
184
+ "text": "ButtonProps['variant']"
185
+ },
186
+ "privacy": "public",
187
+ "default": "'primary'",
188
+ "attribute": "variant"
189
+ },
190
+ {
191
+ "kind": "field",
192
+ "name": "iconPlacement",
193
+ "type": {
194
+ "text": "ButtonProps['iconPlacement']"
195
+ },
196
+ "privacy": "public",
197
+ "default": "'leading'",
198
+ "attribute": "iconPlacement"
199
+ },
200
+ {
201
+ "kind": "field",
202
+ "name": "disabled",
203
+ "type": {
204
+ "text": "boolean"
205
+ },
206
+ "privacy": "public",
207
+ "default": "false",
208
+ "attribute": "disabled"
209
+ },
210
+ {
211
+ "kind": "field",
212
+ "name": "isLoading",
213
+ "type": {
214
+ "text": "boolean"
215
+ },
216
+ "privacy": "public",
217
+ "default": "false",
218
+ "attribute": "isLoading",
219
+ "reflects": true
220
+ },
221
+ {
222
+ "kind": "field",
223
+ "name": "isFullWidth",
224
+ "type": {
225
+ "text": "boolean"
226
+ },
227
+ "privacy": "public",
228
+ "default": "false",
229
+ "attribute": "isFullWidth"
230
+ },
231
+ {
232
+ "kind": "field",
233
+ "name": "isResponsive",
234
+ "type": {
235
+ "text": "boolean"
236
+ },
237
+ "privacy": "public",
238
+ "default": "false",
239
+ "attribute": "isResponsive"
240
+ },
241
+ {
242
+ "kind": "field",
243
+ "name": "name",
244
+ "type": {
245
+ "text": "string | undefined"
246
+ },
247
+ "privacy": "public",
248
+ "attribute": "name"
249
+ },
250
+ {
251
+ "kind": "field",
252
+ "name": "value",
253
+ "type": {
254
+ "text": "string | undefined"
255
+ },
256
+ "privacy": "public",
257
+ "attribute": "value"
258
+ },
259
+ {
260
+ "kind": "field",
261
+ "name": "formaction",
262
+ "type": {
263
+ "text": "ButtonProps['formaction']"
264
+ },
265
+ "privacy": "public",
266
+ "attribute": "formaction"
267
+ },
268
+ {
269
+ "kind": "field",
270
+ "name": "formenctype",
271
+ "type": {
272
+ "text": "ButtonProps['formenctype']"
273
+ },
274
+ "privacy": "public",
275
+ "attribute": "formenctype"
276
+ },
277
+ {
278
+ "kind": "field",
279
+ "name": "formmethod",
280
+ "type": {
281
+ "text": "ButtonProps['formmethod']"
282
+ },
283
+ "privacy": "public",
284
+ "attribute": "formmethod"
285
+ },
286
+ {
287
+ "kind": "field",
288
+ "name": "formnovalidate",
289
+ "type": {
290
+ "text": "ButtonProps['formnovalidate']"
291
+ },
292
+ "privacy": "public",
293
+ "attribute": "formnovalidate"
294
+ },
295
+ {
296
+ "kind": "field",
297
+ "name": "formtarget",
298
+ "type": {
299
+ "text": "ButtonProps['formtarget']"
300
+ },
301
+ "privacy": "public",
302
+ "attribute": "formtarget"
303
+ },
304
+ {
305
+ "kind": "field",
306
+ "name": "responsiveSize",
307
+ "type": {
308
+ "text": "ButtonProps['responsiveSize'] | undefined"
309
+ },
310
+ "privacy": "public",
311
+ "attribute": "responsiveSize"
312
+ },
313
+ {
314
+ "kind": "method",
315
+ "name": "_simulateNativeButtonClick",
316
+ "privacy": "private",
317
+ "parameters": [
318
+ {
319
+ "name": "btnType",
320
+ "type": {
321
+ "text": "'submit' | 'reset'"
322
+ }
323
+ }
324
+ ],
325
+ "description": "This method creates an invisible button of the same type as pie-button. It is then clicked, and immediately removed from the DOM.\nThis is done so that we trigger native form actions, such as submit and reset in the browser. The performance impact of adding and removing a single button to the DOM\nshould be neglible, however this should be monitored.\nThis is the only viable way of guaranteeing native button behaviour when using a web component in place of an actual HTML button.\n\nTODO: if we need to repeat this logic elsewhere, then we should consider moving this code to a shared class or mixin."
326
+ },
327
+ {
328
+ "kind": "method",
329
+ "name": "_handleClick",
330
+ "privacy": "private"
331
+ },
332
+ {
333
+ "kind": "field",
334
+ "name": "_handleFormKeyDown",
335
+ "privacy": "private"
336
+ },
337
+ {
338
+ "kind": "method",
339
+ "name": "renderSpinner",
340
+ "privacy": "private",
341
+ "return": {
342
+ "type": {
343
+ "text": "TemplateResult"
344
+ }
345
+ },
346
+ "description": "Template for the loading state"
347
+ },
348
+ {
349
+ "kind": "method",
350
+ "name": "focus"
351
+ }
352
+ ],
353
+ "attributes": [
354
+ {
355
+ "name": "size",
356
+ "type": {
357
+ "text": "ButtonProps['size']"
358
+ },
359
+ "default": "'medium'",
360
+ "fieldName": "size"
361
+ },
362
+ {
363
+ "name": "type",
364
+ "type": {
365
+ "text": "ButtonProps['type']"
366
+ },
367
+ "default": "'submit'",
368
+ "fieldName": "type"
369
+ },
370
+ {
371
+ "name": "variant",
372
+ "type": {
373
+ "text": "ButtonProps['variant']"
374
+ },
375
+ "default": "'primary'",
376
+ "fieldName": "variant"
377
+ },
378
+ {
379
+ "name": "iconPlacement",
380
+ "type": {
381
+ "text": "ButtonProps['iconPlacement']"
382
+ },
383
+ "default": "'leading'",
384
+ "fieldName": "iconPlacement"
385
+ },
386
+ {
387
+ "name": "disabled",
388
+ "type": {
389
+ "text": "boolean"
390
+ },
391
+ "default": "false",
392
+ "fieldName": "disabled"
393
+ },
394
+ {
395
+ "name": "isLoading",
396
+ "type": {
397
+ "text": "boolean"
398
+ },
399
+ "default": "false",
400
+ "fieldName": "isLoading"
401
+ },
402
+ {
403
+ "name": "isFullWidth",
404
+ "type": {
405
+ "text": "boolean"
406
+ },
407
+ "default": "false",
408
+ "fieldName": "isFullWidth"
409
+ },
410
+ {
411
+ "name": "isResponsive",
412
+ "type": {
413
+ "text": "boolean"
414
+ },
415
+ "default": "false",
416
+ "fieldName": "isResponsive"
417
+ },
418
+ {
419
+ "name": "name",
420
+ "type": {
421
+ "text": "string | undefined"
422
+ },
423
+ "fieldName": "name"
424
+ },
425
+ {
426
+ "name": "value",
427
+ "type": {
428
+ "text": "string | undefined"
429
+ },
430
+ "fieldName": "value"
431
+ },
432
+ {
433
+ "name": "formaction",
434
+ "type": {
435
+ "text": "ButtonProps['formaction']"
436
+ },
437
+ "fieldName": "formaction"
438
+ },
439
+ {
440
+ "name": "formenctype",
441
+ "type": {
442
+ "text": "ButtonProps['formenctype']"
443
+ },
444
+ "fieldName": "formenctype"
445
+ },
446
+ {
447
+ "name": "formmethod",
448
+ "type": {
449
+ "text": "ButtonProps['formmethod']"
450
+ },
451
+ "fieldName": "formmethod"
452
+ },
453
+ {
454
+ "name": "formnovalidate",
455
+ "type": {
456
+ "text": "ButtonProps['formnovalidate']"
457
+ },
458
+ "fieldName": "formnovalidate"
459
+ },
460
+ {
461
+ "name": "formtarget",
462
+ "type": {
463
+ "text": "ButtonProps['formtarget']"
464
+ },
465
+ "fieldName": "formtarget"
466
+ },
467
+ {
468
+ "name": "responsiveSize",
469
+ "type": {
470
+ "text": "ButtonProps['responsiveSize'] | undefined"
471
+ },
472
+ "fieldName": "responsiveSize"
473
+ }
474
+ ],
475
+ "mixins": [
476
+ {
477
+ "name": "FormControlMixin",
478
+ "package": "@justeattakeaway/pie-webc-core"
479
+ }
480
+ ],
481
+ "superclass": {
482
+ "name": "LitElement",
483
+ "package": "lit"
484
+ },
485
+ "tagName": "pie-button",
486
+ "customElement": true
487
+ }
488
+ ],
489
+ "exports": [
490
+ {
491
+ "kind": "js",
492
+ "name": "*",
493
+ "declaration": {
494
+ "name": "*",
495
+ "package": "./defs"
496
+ }
497
+ },
498
+ {
499
+ "kind": "js",
500
+ "name": "PieButton",
501
+ "declaration": {
502
+ "name": "PieButton",
503
+ "module": "src/index.js"
504
+ }
505
+ }
506
+ ]
507
+ }
508
+ ]
509
+ }
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-button",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
4
4
  "description": "PIE design system 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": "yarn build:wrapper pie-button && 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": "run -T eslint . --fix",
18
21
  "lint:style": "run -T stylelint ./src/**/*.{css,scss}",
@@ -28,17 +31,21 @@
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.8.0",
36
+ "@justeattakeaway/pie-wrapper-react": "0.12.0",
37
+ "cem-plugin-module-file-extensions": "0.0.5"
32
38
  },
33
39
  "volta": {
34
40
  "extends": "../../../package.json"
35
41
  },
42
+ "customElements": "custom-elements.json",
36
43
  "sideEffects": [
37
44
  "dist/*.js"
38
45
  ],
39
46
  "dependencies": {
40
- "@justeattakeaway/pie-spinner": "0.3.3",
41
- "@justeattakeaway/pie-webc-core": "0.15.0",
47
+ "@justeattakeaway/pie-spinner": "0.4.0",
48
+ "@justeattakeaway/pie-webc-core": "0.16.0",
42
49
  "element-internals-polyfill": "1.3.9"
43
50
  }
44
51
  }
package/src/react.ts ADDED
@@ -0,0 +1,14 @@
1
+
2
+ import * as React from 'react';
3
+ import { createComponent } from '@lit/react';
4
+ import { PieButton as PieButtonReact } from './index';
5
+
6
+ export * from './defs';
7
+
8
+ export const PieButton = createComponent({
9
+ displayName: 'PieButton',
10
+ elementClass: PieButtonReact,
11
+ react: React,
12
+ tagName: 'pie-button',
13
+ events: {},
14
+ });