@everymatrix/ui-skeleton 0.0.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.
Files changed (49) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-c4768c66.js +1239 -0
  3. package/dist/cjs/index.cjs.js +10 -0
  4. package/dist/cjs/loader.cjs.js +15 -0
  5. package/dist/cjs/ui-skeleton-43520ebc.js +136 -0
  6. package/dist/cjs/ui-skeleton.cjs.entry.js +10 -0
  7. package/dist/cjs/ui-skeleton.cjs.js +25 -0
  8. package/dist/collection/collection-manifest.json +12 -0
  9. package/dist/collection/components/ui-skeleton/index.js +1 -0
  10. package/dist/collection/components/ui-skeleton/ui-skeleton.css +59 -0
  11. package/dist/collection/components/ui-skeleton/ui-skeleton.js +418 -0
  12. package/dist/collection/index.js +1 -0
  13. package/dist/collection/utils/utils.js +3 -0
  14. package/dist/esm/app-globals-0f993ce5.js +3 -0
  15. package/dist/esm/index-f5cf3f14.js +1213 -0
  16. package/dist/esm/index.js +2 -0
  17. package/dist/esm/loader.js +11 -0
  18. package/dist/esm/ui-skeleton-2473e87c.js +134 -0
  19. package/dist/esm/ui-skeleton.entry.js +2 -0
  20. package/dist/esm/ui-skeleton.js +20 -0
  21. package/dist/index.cjs.js +1 -0
  22. package/dist/index.js +1 -0
  23. package/dist/stencil.config.dev.js +19 -0
  24. package/dist/stencil.config.js +17 -0
  25. package/dist/storybook/main.js +21 -0
  26. package/dist/storybook/preview.js +9 -0
  27. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/packages/stencil/ui-skeleton/stencil.config.d.ts +2 -0
  28. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/packages/stencil/ui-skeleton/stencil.config.dev.d.ts +2 -0
  29. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/packages/stencil/ui-skeleton/storybook/main.d.ts +3 -0
  30. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/ui-skeleton/.stencil/packages/stencil/ui-skeleton/storybook/preview.d.ts +70 -0
  31. package/dist/types/components/ui-skeleton/index.d.ts +1 -0
  32. package/dist/types/components/ui-skeleton/ui-skeleton.d.ts +71 -0
  33. package/dist/types/components.d.ts +149 -0
  34. package/dist/types/index.d.ts +1 -0
  35. package/dist/types/stencil-public-runtime.d.ts +1680 -0
  36. package/dist/types/utils/utils.d.ts +1 -0
  37. package/dist/ui-skeleton/index.esm.js +1 -0
  38. package/dist/ui-skeleton/p-443310cf.js +2 -0
  39. package/dist/ui-skeleton/p-75e06c6c.js +1 -0
  40. package/dist/ui-skeleton/p-933ae591.entry.js +1 -0
  41. package/dist/ui-skeleton/p-e1255160.js +1 -0
  42. package/dist/ui-skeleton/ui-skeleton.esm.js +1 -0
  43. package/loader/cdn.js +1 -0
  44. package/loader/index.cjs.js +1 -0
  45. package/loader/index.d.ts +24 -0
  46. package/loader/index.es2017.js +1 -0
  47. package/loader/index.js +2 -0
  48. package/loader/package.json +11 -0
  49. package/package.json +26 -0
@@ -0,0 +1,418 @@
1
+ import { h } from "@stencil/core";
2
+ export class UiSkeleton {
3
+ constructor() {
4
+ /**
5
+ * Toggles skeleton animation
6
+ */
7
+ this.animation = true;
8
+ }
9
+ handleStructureChange(newValue, oldValue) {
10
+ if (oldValue !== newValue) {
11
+ this.handleStructure(newValue);
12
+ }
13
+ }
14
+ updateStyles() {
15
+ if (this.primaryColor) {
16
+ this.skeletonContainer.style.setProperty('--emw-skeleton-primary-color', this.primaryColor);
17
+ }
18
+ if (this.secondaryColor) {
19
+ this.skeletonContainer.style.setProperty('--emw-skeleton-secondary-color', this.secondaryColor);
20
+ }
21
+ }
22
+ handleStructure(structure) {
23
+ switch (structure) {
24
+ case 'logo':
25
+ return this.renderLogo();
26
+ case 'image':
27
+ return this.renderImage();
28
+ case 'title':
29
+ return this.renderTitle();
30
+ case 'text':
31
+ return this.renderText();
32
+ case 'rectangle':
33
+ return this.renderRectangle();
34
+ case 'circle':
35
+ return this.renderCircle();
36
+ default:
37
+ // nothing
38
+ break;
39
+ }
40
+ }
41
+ renderLogo() {
42
+ const styles = {
43
+ width: `${this.width}px`,
44
+ height: `${this.height}px`,
45
+ 'background-color': `${this.color}`,
46
+ 'border-radius': `${this.borderRadius}px`,
47
+ 'margin-bottom': `${this.marginBottom}px`,
48
+ 'margin-top': `${this.marginTop}px`,
49
+ 'margin-left': `${this.marginLeft}px`,
50
+ 'margin-right': `${this.marginRight}px`
51
+ };
52
+ return (h("div", { style: styles, class: "Skeleton Logo" }));
53
+ }
54
+ renderImage() {
55
+ const styles = {
56
+ width: `${this.width}px`,
57
+ height: `${this.height}px`,
58
+ 'background-color': `${this.color}`,
59
+ 'border-radius': `${this.borderRadius}px`,
60
+ 'margin-bottom': `${this.marginBottom}px`,
61
+ 'margin-top': `${this.marginTop}px`,
62
+ 'margin-left': `${this.marginLeft}px`,
63
+ 'margin-right': `${this.marginRight}px`
64
+ };
65
+ return (h("div", { style: styles, class: "Skeleton Image" }));
66
+ }
67
+ renderTitle() {
68
+ const styles = {
69
+ width: `${this.width}px`,
70
+ height: `${this.height}px`,
71
+ 'background-color': `${this.color}`,
72
+ 'border-radius': `${this.borderRadius}px`,
73
+ 'margin-bottom': `${this.marginBottom}px`,
74
+ 'margin-top': `${this.marginTop}px`,
75
+ 'margin-left': `${this.marginLeft}px`,
76
+ 'margin-right': `${this.marginRight}px`
77
+ };
78
+ return (h("div", { style: styles, class: "Skeleton Title" }));
79
+ }
80
+ renderText() {
81
+ const styles = {
82
+ width: `${this.width}px`,
83
+ height: `${this.height}px`,
84
+ 'background-color': `${this.color}`,
85
+ 'border-radius': `${this.borderRadius}px`,
86
+ 'margin-bottom': `${this.marginBottom}px`,
87
+ 'margin-top': `${this.marginTop}px`,
88
+ 'margin-left': `${this.marginLeft}px`,
89
+ 'margin-right': `${this.marginRight}px`
90
+ };
91
+ return (Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index) => (h("div", { style: styles, key: index, class: "Skeleton Text" }))));
92
+ }
93
+ renderRectangle() {
94
+ const styles = {
95
+ width: `${this.width}px`,
96
+ height: `${this.height}px`,
97
+ 'backgroud-color': `${this.color}`,
98
+ 'border-radius': `${this.borderRadius}px`,
99
+ 'margin-bottom': `${this.marginBottom}px`,
100
+ 'margin-top': `${this.marginTop}px`,
101
+ 'margin-left': `${this.marginLeft}px`,
102
+ 'margin-right': `${this.marginRight}px`
103
+ };
104
+ return (h("div", { style: styles, class: "Skeleton Rectangle" }));
105
+ }
106
+ renderCircle() {
107
+ const styles = {
108
+ width: `${this.size}px`,
109
+ height: `${this.size}px`,
110
+ 'background-color': `${this.color}`,
111
+ 'margin-bottom': `${this.marginBottom}px`,
112
+ 'margin-top': `${this.marginTop}px`,
113
+ 'margin-left': `${this.marginLeft}px`,
114
+ 'margin-right': `${this.marginRight}px`
115
+ };
116
+ return (h("div", { ref: el => this.skeletonContainer = el }, h("div", { style: styles, class: "Circle " + (this.animation ? 'Skeleton' : '') })));
117
+ }
118
+ componentDidLoad() {
119
+ this.updateStyles();
120
+ }
121
+ render() {
122
+ return (this.handleStructure(this.structure));
123
+ }
124
+ static get is() { return "ui-skeleton"; }
125
+ static get originalStyleUrls() {
126
+ return {
127
+ "$": ["ui-skeleton.scss"]
128
+ };
129
+ }
130
+ static get styleUrls() {
131
+ return {
132
+ "$": ["ui-skeleton.css"]
133
+ };
134
+ }
135
+ static get properties() {
136
+ return {
137
+ "structure": {
138
+ "type": "string",
139
+ "mutable": false,
140
+ "complexType": {
141
+ "original": "'logo' | 'image' | 'title' | 'text' | 'rectangle' | 'circle'",
142
+ "resolved": "\"circle\" | \"image\" | \"logo\" | \"rectangle\" | \"text\" | \"title\"",
143
+ "references": {}
144
+ },
145
+ "required": false,
146
+ "optional": false,
147
+ "docs": {
148
+ "tags": [],
149
+ "text": "The structure of the skeleton"
150
+ },
151
+ "getter": false,
152
+ "setter": false,
153
+ "attribute": "structure",
154
+ "reflect": false
155
+ },
156
+ "width": {
157
+ "type": "number",
158
+ "mutable": false,
159
+ "complexType": {
160
+ "original": "number",
161
+ "resolved": "number",
162
+ "references": {}
163
+ },
164
+ "required": false,
165
+ "optional": false,
166
+ "docs": {
167
+ "tags": [],
168
+ "text": "Width of the element"
169
+ },
170
+ "getter": false,
171
+ "setter": false,
172
+ "attribute": "width",
173
+ "reflect": false
174
+ },
175
+ "height": {
176
+ "type": "number",
177
+ "mutable": false,
178
+ "complexType": {
179
+ "original": "number",
180
+ "resolved": "number",
181
+ "references": {}
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": "Height of the element"
188
+ },
189
+ "getter": false,
190
+ "setter": false,
191
+ "attribute": "height",
192
+ "reflect": false
193
+ },
194
+ "borderRadius": {
195
+ "type": "number",
196
+ "mutable": false,
197
+ "complexType": {
198
+ "original": "number",
199
+ "resolved": "number",
200
+ "references": {}
201
+ },
202
+ "required": false,
203
+ "optional": false,
204
+ "docs": {
205
+ "tags": [],
206
+ "text": "The border radius of the element"
207
+ },
208
+ "getter": false,
209
+ "setter": false,
210
+ "attribute": "border-radius",
211
+ "reflect": false
212
+ },
213
+ "marginBottom": {
214
+ "type": "number",
215
+ "mutable": false,
216
+ "complexType": {
217
+ "original": "number",
218
+ "resolved": "number",
219
+ "references": {}
220
+ },
221
+ "required": false,
222
+ "optional": false,
223
+ "docs": {
224
+ "tags": [],
225
+ "text": "Margin bottom for the element"
226
+ },
227
+ "getter": false,
228
+ "setter": false,
229
+ "attribute": "margin-bottom",
230
+ "reflect": false
231
+ },
232
+ "marginTop": {
233
+ "type": "number",
234
+ "mutable": false,
235
+ "complexType": {
236
+ "original": "number",
237
+ "resolved": "number",
238
+ "references": {}
239
+ },
240
+ "required": false,
241
+ "optional": false,
242
+ "docs": {
243
+ "tags": [],
244
+ "text": "Margin top for the element"
245
+ },
246
+ "getter": false,
247
+ "setter": false,
248
+ "attribute": "margin-top",
249
+ "reflect": false
250
+ },
251
+ "marginLeft": {
252
+ "type": "number",
253
+ "mutable": false,
254
+ "complexType": {
255
+ "original": "number",
256
+ "resolved": "number",
257
+ "references": {}
258
+ },
259
+ "required": false,
260
+ "optional": false,
261
+ "docs": {
262
+ "tags": [],
263
+ "text": "Margin left for the element"
264
+ },
265
+ "getter": false,
266
+ "setter": false,
267
+ "attribute": "margin-left",
268
+ "reflect": false
269
+ },
270
+ "marginRight": {
271
+ "type": "number",
272
+ "mutable": false,
273
+ "complexType": {
274
+ "original": "number",
275
+ "resolved": "number",
276
+ "references": {}
277
+ },
278
+ "required": false,
279
+ "optional": false,
280
+ "docs": {
281
+ "tags": [],
282
+ "text": "Margin right for the element"
283
+ },
284
+ "getter": false,
285
+ "setter": false,
286
+ "attribute": "margin-right",
287
+ "reflect": false
288
+ },
289
+ "animation": {
290
+ "type": "boolean",
291
+ "mutable": false,
292
+ "complexType": {
293
+ "original": "boolean",
294
+ "resolved": "boolean",
295
+ "references": {}
296
+ },
297
+ "required": false,
298
+ "optional": false,
299
+ "docs": {
300
+ "tags": [],
301
+ "text": "Toggles skeleton animation"
302
+ },
303
+ "getter": false,
304
+ "setter": false,
305
+ "attribute": "animation",
306
+ "reflect": false,
307
+ "defaultValue": "true"
308
+ },
309
+ "rows": {
310
+ "type": "number",
311
+ "mutable": false,
312
+ "complexType": {
313
+ "original": "number",
314
+ "resolved": "number",
315
+ "references": {}
316
+ },
317
+ "required": false,
318
+ "optional": false,
319
+ "docs": {
320
+ "tags": [],
321
+ "text": "Number of rows displayed - only for `text`"
322
+ },
323
+ "getter": false,
324
+ "setter": false,
325
+ "attribute": "rows",
326
+ "reflect": false
327
+ },
328
+ "size": {
329
+ "type": "number",
330
+ "mutable": false,
331
+ "complexType": {
332
+ "original": "number",
333
+ "resolved": "number",
334
+ "references": {}
335
+ },
336
+ "required": false,
337
+ "optional": false,
338
+ "docs": {
339
+ "tags": [],
340
+ "text": "The size of the circle - only for `circle"
341
+ },
342
+ "getter": false,
343
+ "setter": false,
344
+ "attribute": "size",
345
+ "reflect": false
346
+ },
347
+ "color": {
348
+ "type": "string",
349
+ "mutable": false,
350
+ "complexType": {
351
+ "original": "string",
352
+ "resolved": "string",
353
+ "references": {}
354
+ },
355
+ "required": false,
356
+ "optional": false,
357
+ "docs": {
358
+ "tags": [],
359
+ "text": "Color of the skeleton when animation is `off` - hexa value (e.g. #c2c2c2)"
360
+ },
361
+ "getter": false,
362
+ "setter": false,
363
+ "attribute": "color",
364
+ "reflect": false
365
+ },
366
+ "primaryColor": {
367
+ "type": "string",
368
+ "mutable": false,
369
+ "complexType": {
370
+ "original": "string",
371
+ "resolved": "string",
372
+ "references": {}
373
+ },
374
+ "required": false,
375
+ "optional": false,
376
+ "docs": {
377
+ "tags": [],
378
+ "text": "Primary color of the skeleton when animation is `on` - hexa value (e.g. #c2c2c2)"
379
+ },
380
+ "getter": false,
381
+ "setter": false,
382
+ "attribute": "primary-color",
383
+ "reflect": false
384
+ },
385
+ "secondaryColor": {
386
+ "type": "string",
387
+ "mutable": false,
388
+ "complexType": {
389
+ "original": "string",
390
+ "resolved": "string",
391
+ "references": {}
392
+ },
393
+ "required": false,
394
+ "optional": false,
395
+ "docs": {
396
+ "tags": [],
397
+ "text": "Secondary color of the skeleton when animation is `on` - hexa value (e.g. #ffffff)"
398
+ },
399
+ "getter": false,
400
+ "setter": false,
401
+ "attribute": "secondary-color",
402
+ "reflect": false
403
+ }
404
+ };
405
+ }
406
+ static get watchers() {
407
+ return [{
408
+ "propName": "structure",
409
+ "methodName": "handleStructureChange"
410
+ }, {
411
+ "propName": "primaryColor",
412
+ "methodName": "updateStyles"
413
+ }, {
414
+ "propName": "secondaryColor",
415
+ "methodName": "updateStyles"
416
+ }];
417
+ }
418
+ }
@@ -0,0 +1 @@
1
+ export * from './components/ui-skeleton';
@@ -0,0 +1,3 @@
1
+ export function format(first, middle, last) {
2
+ return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
3
+ }
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };