@usecapsule/core-components 3.0.1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. package/css/capsule-core.css +93 -24
  2. package/css/capsule-core.css.map +1 -1
  3. package/dist/capsule/capsule.esm.js +1 -1
  4. package/dist/capsule/capsule.esm.js.map +1 -1
  5. package/dist/capsule/index.esm.js +1 -1
  6. package/dist/capsule/index.esm.js.map +1 -1
  7. package/dist/capsule/p-397edab5.entry.js +2 -0
  8. package/dist/capsule/{p-ad14a817.entry.js.map → p-397edab5.entry.js.map} +1 -1
  9. package/dist/capsule/p-52d6ebee.entry.js +2 -0
  10. package/dist/capsule/{p-fcead80b.entry.js.map → p-52d6ebee.entry.js.map} +1 -1
  11. package/dist/capsule/p-5ed5e96c.entry.js +2 -0
  12. package/dist/capsule/p-5ed5e96c.entry.js.map +1 -0
  13. package/dist/capsule/p-6e71539d.js +3 -0
  14. package/dist/capsule/p-6e71539d.js.map +1 -0
  15. package/dist/capsule/p-6e900654.entry.js +29 -0
  16. package/dist/capsule/p-6e900654.entry.js.map +1 -0
  17. package/dist/capsule/{p-0d0a0037.entry.js → p-70f95c93.entry.js} +2 -2
  18. package/dist/capsule/{p-0d0a0037.entry.js.map → p-70f95c93.entry.js.map} +1 -1
  19. package/dist/capsule/p-86e6cba5.entry.js +10 -0
  20. package/dist/capsule/{p-d28b96ba.entry.js.map → p-86e6cba5.entry.js.map} +1 -1
  21. package/dist/capsule/p-f2393be6.js +2 -0
  22. package/dist/capsule/p-f2393be6.js.map +1 -0
  23. package/dist/capsule/{p-fa078837.entry.js → p-f9351426.entry.js} +2 -2
  24. package/dist/capsule/{p-fa078837.entry.js.map → p-f9351426.entry.js.map} +1 -1
  25. package/dist/cjs/capsule.cjs.js +10 -10
  26. package/dist/cjs/capsule.cjs.js.map +1 -1
  27. package/dist/cjs/{constants-0869a780.js → constants-9b1b01bb.js} +3 -3
  28. package/dist/cjs/{constants-0869a780.js.map → constants-9b1b01bb.js.map} +1 -1
  29. package/dist/cjs/{cpsl-alert_29.cjs.entry.js → cpsl-alert_33.cjs.entry.js} +663 -94
  30. package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +1 -0
  31. package/dist/cjs/cpsl-animation.cjs.entry.js +2 -2
  32. package/dist/cjs/cpsl-col.cjs.entry.js +2 -2
  33. package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
  34. package/dist/cjs/cpsl-info-box.cjs.entry.js +3 -3
  35. package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
  36. package/dist/cjs/cpsl-modal-v2.cjs.entry.js +55 -0
  37. package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -0
  38. package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
  39. package/dist/cjs/index-85125285.js +1414 -0
  40. package/dist/cjs/index-85125285.js.map +1 -0
  41. package/dist/cjs/index.cjs.js +116 -107
  42. package/dist/cjs/index.cjs.js.map +1 -1
  43. package/dist/cjs/loader.cjs.js +2 -2
  44. package/dist/collection/assets/icons/chevron-up.svg +2 -2
  45. package/dist/collection/assets/icons/close.svg +3 -4
  46. package/dist/collection/assets/icons/cube.svg +3 -0
  47. package/dist/collection/assets/icons/farcaster-brand.svg +10 -0
  48. package/dist/collection/assets/icons/farcaster.svg +10 -0
  49. package/dist/collection/assets/icons/image.svg +3 -0
  50. package/dist/collection/assets/icons/index.js +9 -1
  51. package/dist/collection/assets/icons/index.js.map +1 -1
  52. package/dist/collection/assets/icons/menu.svg +3 -0
  53. package/dist/collection/assets/icons/refresh.svg +3 -0
  54. package/dist/collection/assets/icons/stars.svg +4 -0
  55. package/dist/collection/assets/icons/x.svg +3 -0
  56. package/dist/collection/collection-manifest.json +7 -2
  57. package/dist/collection/components/cpsl-alert/cpsl-alert.js +2 -2
  58. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  59. package/dist/collection/components/cpsl-animation/cpsl-animation.js +1 -1
  60. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +20 -4
  61. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js.map +1 -1
  62. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +1 -1
  63. package/dist/collection/components/cpsl-button/cpsl-button.css +113 -17
  64. package/dist/collection/components/cpsl-button/cpsl-button.js +63 -7
  65. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  66. package/dist/collection/components/cpsl-button-group/cpsl-button-group.css +1 -0
  67. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +1 -1
  68. package/dist/collection/components/cpsl-card/cpsl-card.css +1 -1
  69. package/dist/collection/components/cpsl-card/cpsl-card.js +1 -1
  70. package/dist/collection/components/cpsl-card/cpsl-card.js.map +1 -1
  71. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.css +2 -2
  72. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +1 -1
  73. package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +1 -1
  74. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +2 -2
  75. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
  76. package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
  77. package/dist/collection/components/cpsl-divider/cpsl-divider.css +1 -1
  78. package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
  79. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +84 -11
  80. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
  81. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +1 -1
  82. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
  83. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.css +211 -0
  84. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +406 -0
  85. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -0
  86. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js +29 -0
  87. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js.map +1 -0
  88. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js +37 -0
  89. package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js.map +1 -0
  90. package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
  91. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  92. package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -1
  93. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  94. package/dist/collection/components/cpsl-input/cpsl-input.css +7 -6
  95. package/dist/collection/components/cpsl-input/cpsl-input.js +3 -8
  96. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  97. package/dist/collection/components/cpsl-modal/cpsl-modal.css +4 -4
  98. package/dist/collection/components/cpsl-modal/cpsl-modal.js +1 -0
  99. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -1
  100. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.css +91 -0
  101. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +224 -0
  102. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js.map +1 -0
  103. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js +29 -0
  104. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js.map +1 -0
  105. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js +37 -0
  106. package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js.map +1 -0
  107. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +1 -1
  108. package/dist/collection/components/cpsl-overlay/cpsl-overlay.css +1 -1
  109. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +1 -1
  110. package/dist/collection/components/cpsl-pagination/cpsl-pagination.css +4 -0
  111. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
  112. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js.map +1 -1
  113. package/dist/collection/components/cpsl-pill/cpsl-pill.css +1 -1
  114. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  115. package/dist/collection/components/cpsl-popover/cpsl-popover.css +98 -0
  116. package/dist/collection/components/cpsl-popover/cpsl-popover.js +511 -0
  117. package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -0
  118. package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js +29 -0
  119. package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js.map +1 -0
  120. package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js +37 -0
  121. package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js.map +1 -0
  122. package/dist/collection/components/cpsl-progress-indicator/cpsl-progress-indicator.css +3 -3
  123. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +1 -1
  124. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
  125. package/dist/collection/components/cpsl-radio/cpsl-radio.css +2 -2
  126. package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
  127. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  128. package/dist/collection/components/cpsl-select/cpsl-select.css +229 -0
  129. package/dist/collection/components/cpsl-select/cpsl-select.js +409 -0
  130. package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -0
  131. package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js +29 -0
  132. package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js.map +1 -0
  133. package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js +37 -0
  134. package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js.map +1 -0
  135. package/dist/collection/components/cpsl-select-item/cpsl-select-item.css +114 -0
  136. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +85 -0
  137. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js.map +1 -0
  138. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js +29 -0
  139. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js.map +1 -0
  140. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js +37 -0
  141. package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js.map +1 -0
  142. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.css +3 -3
  143. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  144. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
  145. package/dist/collection/components/cpsl-switch/cpsl-switch.css +4 -4
  146. package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
  147. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  148. package/dist/collection/components/cpsl-table/cpsl-table.css +48 -60
  149. package/dist/collection/components/cpsl-table/cpsl-table.js +34 -58
  150. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
  151. package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +2 -2
  152. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +1 -1
  153. package/dist/collection/components/cpsl-text/cpsl-text.css +4 -0
  154. package/dist/collection/components/cpsl-text/cpsl-text.js +5 -4
  155. package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
  156. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +1 -1
  157. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  158. package/dist/collection/constants.js +2 -2
  159. package/dist/collection/constants.js.map +1 -1
  160. package/dist/collection/interface.js.map +1 -1
  161. package/dist/collection/utils/theme/generateBorderRadii.js +40 -39
  162. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  163. package/dist/collection/utils/theme/generatePalette.js +11 -3
  164. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  165. package/dist/collection/utils/theme/generateTheme.js +2 -2
  166. package/dist/collection/utils/theme/generateTheme.js.map +1 -1
  167. package/dist/collection/utils/theme/utils.js +1 -0
  168. package/dist/collection/utils/theme/utils.js.map +1 -1
  169. package/dist/esm/capsule.js +11 -11
  170. package/dist/esm/capsule.js.map +1 -1
  171. package/dist/esm/{constants-6acf4ea8.js → constants-fce138fa.js} +3 -3
  172. package/dist/esm/{constants-6acf4ea8.js.map → constants-fce138fa.js.map} +1 -1
  173. package/dist/esm/{cpsl-alert_29.entry.js → cpsl-alert_33.entry.js} +660 -95
  174. package/dist/esm/cpsl-alert_33.entry.js.map +1 -0
  175. package/dist/esm/cpsl-animation.entry.js +2 -2
  176. package/dist/esm/cpsl-col.entry.js +2 -2
  177. package/dist/esm/cpsl-grid.entry.js +3 -3
  178. package/dist/esm/cpsl-info-box.entry.js +3 -3
  179. package/dist/esm/cpsl-info-box.entry.js.map +1 -1
  180. package/dist/esm/cpsl-modal-v2.entry.js +51 -0
  181. package/dist/esm/cpsl-modal-v2.entry.js.map +1 -0
  182. package/dist/esm/cpsl-row.entry.js +2 -2
  183. package/dist/esm/index-b9a060b3.js +1383 -0
  184. package/dist/esm/index-b9a060b3.js.map +1 -0
  185. package/dist/esm/index.js +116 -107
  186. package/dist/esm/index.js.map +1 -1
  187. package/dist/esm/loader.js +3 -3
  188. package/dist/loader/cdn.js +1 -3
  189. package/dist/loader/index.cjs.js +1 -3
  190. package/dist/loader/index.es2017.js +1 -3
  191. package/dist/loader/index.js +1 -3
  192. package/dist/types/assets/icons/index.d.ts +8 -0
  193. package/dist/types/components/cpsl-app-bar/cpsl-app-bar.d.ts +1 -0
  194. package/dist/types/components/cpsl-button/cpsl-button.d.ts +4 -1
  195. package/dist/types/components/cpsl-drawer/cpsl-drawer.d.ts +10 -1
  196. package/dist/types/components/cpsl-file-upload/cpsl-file-upload.d.ts +34 -0
  197. package/dist/types/components/cpsl-input/cpsl-input.d.ts +1 -1
  198. package/dist/types/components/cpsl-modal-v2/cpsl-modal-v2.d.ts +17 -0
  199. package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +35 -0
  200. package/dist/types/components/cpsl-select/cpsl-select.d.ts +38 -0
  201. package/dist/types/components/cpsl-select-item/cpsl-select-item.d.ts +8 -0
  202. package/dist/types/components/cpsl-table/cpsl-table.d.ts +6 -3
  203. package/dist/types/components/cpsl-text/cpsl-text.d.ts +1 -1
  204. package/dist/types/components.d.ts +596 -28
  205. package/dist/types/constants.d.ts +2 -2
  206. package/dist/types/interface.d.ts +68 -1
  207. package/dist/types/stencil-public-runtime.d.ts +3 -8
  208. package/dist/types/utils/theme/generateBorderRadii.d.ts +1 -1
  209. package/dist/types/utils/theme/generateTheme.d.ts +1 -1
  210. package/dist/types/utils/theme/utils.d.ts +4 -1
  211. package/package.json +2 -2
  212. package/dist/capsule/p-107e1ff5.entry.js +0 -29
  213. package/dist/capsule/p-107e1ff5.entry.js.map +0 -1
  214. package/dist/capsule/p-86e48e61.js +0 -3
  215. package/dist/capsule/p-86e48e61.js.map +0 -1
  216. package/dist/capsule/p-ad14a817.entry.js +0 -2
  217. package/dist/capsule/p-b6b38e73.js +0 -2
  218. package/dist/capsule/p-b6b38e73.js.map +0 -1
  219. package/dist/capsule/p-d28b96ba.entry.js +0 -10
  220. package/dist/capsule/p-fcead80b.entry.js +0 -2
  221. package/dist/cjs/cpsl-alert_29.cjs.entry.js.map +0 -1
  222. package/dist/cjs/index-5733071e.js +0 -2020
  223. package/dist/cjs/index-5733071e.js.map +0 -1
  224. package/dist/collection/components/cpsl-table/table-interface.js +0 -2
  225. package/dist/collection/components/cpsl-table/table-interface.js.map +0 -1
  226. package/dist/esm/cpsl-alert_29.entry.js.map +0 -1
  227. package/dist/esm/index-8fe9f35e.js +0 -1990
  228. package/dist/esm/index-8fe9f35e.js.map +0 -1
  229. package/dist/esm/polyfills/core-js.js +0 -11
  230. package/dist/esm/polyfills/dom.js +0 -79
  231. package/dist/esm/polyfills/es5-html-element.js +0 -1
  232. package/dist/esm/polyfills/index.js +0 -34
  233. package/dist/esm/polyfills/system.js +0 -6
  234. package/dist/types/components/cpsl-table/table-interface.d.ts +0 -19
@@ -0,0 +1,406 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try {
5
+ step(generator.next(value));
6
+ }
7
+ catch (e) {
8
+ reject(e);
9
+ } }
10
+ function rejected(value) { try {
11
+ step(generator["throw"](value));
12
+ }
13
+ catch (e) {
14
+ reject(e);
15
+ } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ import { Host, h, Fragment } from "@stencil/core";
21
+ export class CpslFileUpload {
22
+ constructor() {
23
+ this.inputId = `cpsl-file-upload-${inputIds++}`;
24
+ this.handleDrop = (ev) => __awaiter(this, void 0, void 0, function* () {
25
+ var _a;
26
+ ev.preventDefault();
27
+ const item = (_a = Array.from(ev.dataTransfer.items)) === null || _a === void 0 ? void 0 : _a[0];
28
+ if (item && this.isValidFile(item.type)) {
29
+ const file = item.getAsFile();
30
+ yield this.addFile(file);
31
+ }
32
+ this.dragOver = false;
33
+ this.dragError = false;
34
+ this.cpslOnDrop.emit(ev);
35
+ });
36
+ this.handleDragEnter = (ev) => {
37
+ var _a;
38
+ ev.preventDefault();
39
+ this.dragOver = true;
40
+ const item = (_a = Array.from(ev.dataTransfer.items)) === null || _a === void 0 ? void 0 : _a[0];
41
+ if (item && this.isValidFile(item.type)) {
42
+ this.dragError = true;
43
+ }
44
+ this.cpslOnDragEnter.emit(ev);
45
+ };
46
+ this.handleDragLeave = (ev) => {
47
+ ev.preventDefault();
48
+ this.dragOver = false;
49
+ this.dragError = false;
50
+ this.cpslOnDragLeave.emit(ev);
51
+ };
52
+ this.handleInputChange = (ev) => __awaiter(this, void 0, void 0, function* () {
53
+ ev.preventDefault();
54
+ const input = this.inputEl;
55
+ if (Boolean(input.files.length)) {
56
+ const file = input.files[0];
57
+ if (this.isValidFile(file.type)) {
58
+ yield this.addFile(file);
59
+ }
60
+ }
61
+ });
62
+ this.isValidFile = (type) => {
63
+ var _a;
64
+ if (Boolean((_a = this.fileTypes) === null || _a === void 0 ? void 0 : _a.length) ? !this.fileTypes.includes(type) : false) {
65
+ return false;
66
+ }
67
+ return true;
68
+ };
69
+ this.addFile = (file) => __awaiter(this, void 0, void 0, function* () {
70
+ this.file = file;
71
+ this.cpslFileChange.emit(file);
72
+ this.uploadError = false;
73
+ this.isUploading = true;
74
+ const uploadSuccess = Boolean(this.uploadFile) ? yield this.uploadFile(file) : true;
75
+ if (!uploadSuccess) {
76
+ this.uploadError = true;
77
+ const input = this.inputEl;
78
+ input.value = '';
79
+ }
80
+ this.isUploading = false;
81
+ });
82
+ this.removeFile = (e) => {
83
+ e.preventDefault();
84
+ this.file = undefined;
85
+ const input = this.inputEl;
86
+ input.value = '';
87
+ this.cpslFileRemoved.emit();
88
+ };
89
+ this.file = undefined;
90
+ this.dragOver = undefined;
91
+ this.dragError = undefined;
92
+ this.isUploading = undefined;
93
+ this.uploadError = undefined;
94
+ this.errorText = undefined;
95
+ this.externalFilename = undefined;
96
+ this.externalSrc = undefined;
97
+ this.fileTypes = undefined;
98
+ this.helperText = undefined;
99
+ this.label = undefined;
100
+ this.required = false;
101
+ this.showOptionalLabel = false;
102
+ this.uploadFile = undefined;
103
+ }
104
+ get inputEl() {
105
+ return this.el.shadowRoot.getElementById(this.inputId);
106
+ }
107
+ get FileContent() {
108
+ var _a;
109
+ const hasFile = Boolean(this.file) || Boolean(this.externalSrc);
110
+ const isUploading = this.isUploading;
111
+ const error = this.uploadError;
112
+ const text = !hasFile ? (h(Fragment, null, 'Drag file here or ', h("cpsl-text", { class: "inline-text", variant: "bodyXS" }, "upload file"))) : isUploading ? (`${this.file.name} is uploading`) : error ? ('Upload Failed') : (((_a = this.file) === null || _a === void 0 ? void 0 : _a.name) || this.externalFilename || '');
113
+ const TopElement = !hasFile ? (h("cpsl-icon", { icon: "image" })) : isUploading ? (h("cpsl-spinner", null)) : error ? (h("cpsl-icon", { icon: "close" })) : (h("img", { class: "sample-img", src: Boolean(this.file) ? URL.createObjectURL(this.file) : this.externalSrc, alt: "Sample Image" }));
114
+ return (h(Fragment, null, TopElement, h("span", { class: "sample-image-name-container" }, h("cpsl-text", { class: "sample-image-name", variant: "bodyXS" }, text), hasFile && !error && !isUploading && h("cpsl-icon", { icon: "close", onClick: this.removeFile }))));
115
+ }
116
+ render() {
117
+ var _a, _b, _c;
118
+ return (h(Host, { key: '762561d4a888f40c6ef7914d44d3b5d29952c6eb' }, this.label && (h("label", { key: 'ca7847701395b4334d14e34cf065f943bec0d1af', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("slot", { key: '370ca2d812f44f13b20383f303ca7d6daefdfd84', name: "label" }), h("div", { key: 'bece00a4a0a32bb37c4573775cbbe5c89ae3030e', class: { 'container': true, 'error': Boolean(this.errorText), 'drag': this.dragOver, 'drag-error': this.dragError } }, h("div", { key: '32220f003406b15f94c68337ab321b6b07151be0', class: { 'label-container': true } }, h("slot", { key: '88a46b859592b1dbbea964d871ef36d77760da78', name: "left-content" })), h("div", { key: 'd4cbd5c095c8ba522c51a451d749d20c0fd7a5ab', class: { 'file-container': true } }, this.FileContent), h("input", { key: '3798b69f5670e18e9fa4dc34ae7ca661cd6f9294', id: this.inputId, type: "file", accept: (_b = (_a = this.fileTypes) === null || _a === void 0 ? void 0 : _a.join(', ')) !== null && _b !== void 0 ? _b : '*', files: Boolean(this.file) ? [this.file] : undefined, onDrop: this.handleDrop, onDragEnter: this.handleDragEnter, onDragLeave: this.handleDragLeave, onChange: this.handleInputChange })), (this.errorText || this.helperText) && (h("div", { key: '9217cfba0fabd2d8cad86ba34fd69f15cf0186a0', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", { key: '0e6f9be6e2042f72b0438cc5d979b21eb9f47356' }, (_c = this.errorText) !== null && _c !== void 0 ? _c : this.helperText)))));
119
+ }
120
+ static get is() { return "cpsl-file-upload"; }
121
+ static get encapsulation() { return "shadow"; }
122
+ static get originalStyleUrls() {
123
+ return {
124
+ "$": ["cpsl-file-upload.scss"]
125
+ };
126
+ }
127
+ static get styleUrls() {
128
+ return {
129
+ "$": ["cpsl-file-upload.css"]
130
+ };
131
+ }
132
+ static get properties() {
133
+ return {
134
+ "errorText": {
135
+ "type": "string",
136
+ "mutable": false,
137
+ "complexType": {
138
+ "original": "string",
139
+ "resolved": "string",
140
+ "references": {}
141
+ },
142
+ "required": false,
143
+ "optional": true,
144
+ "docs": {
145
+ "tags": [],
146
+ "text": "Error text to show below the input. If this is provided the input will enter an error state."
147
+ },
148
+ "attribute": "error-text",
149
+ "reflect": false
150
+ },
151
+ "externalFilename": {
152
+ "type": "string",
153
+ "mutable": false,
154
+ "complexType": {
155
+ "original": "string",
156
+ "resolved": "string",
157
+ "references": {}
158
+ },
159
+ "required": false,
160
+ "optional": true,
161
+ "docs": {
162
+ "tags": [],
163
+ "text": "Filename for the external source of the selected file."
164
+ },
165
+ "attribute": "external-filename",
166
+ "reflect": false
167
+ },
168
+ "externalSrc": {
169
+ "type": "string",
170
+ "mutable": false,
171
+ "complexType": {
172
+ "original": "string",
173
+ "resolved": "string",
174
+ "references": {}
175
+ },
176
+ "required": false,
177
+ "optional": true,
178
+ "docs": {
179
+ "tags": [],
180
+ "text": "External source for the selected file."
181
+ },
182
+ "attribute": "external-src",
183
+ "reflect": false
184
+ },
185
+ "fileTypes": {
186
+ "type": "unknown",
187
+ "mutable": false,
188
+ "complexType": {
189
+ "original": "string[]",
190
+ "resolved": "string[]",
191
+ "references": {}
192
+ },
193
+ "required": false,
194
+ "optional": true,
195
+ "docs": {
196
+ "tags": [],
197
+ "text": "Valid file types."
198
+ }
199
+ },
200
+ "helperText": {
201
+ "type": "string",
202
+ "mutable": false,
203
+ "complexType": {
204
+ "original": "string",
205
+ "resolved": "string",
206
+ "references": {}
207
+ },
208
+ "required": false,
209
+ "optional": true,
210
+ "docs": {
211
+ "tags": [],
212
+ "text": "Helper text to show below the input. If `\"errorText\"` is provided that will take precedence."
213
+ },
214
+ "attribute": "helper-text",
215
+ "reflect": false
216
+ },
217
+ "label": {
218
+ "type": "string",
219
+ "mutable": false,
220
+ "complexType": {
221
+ "original": "string",
222
+ "resolved": "string",
223
+ "references": {}
224
+ },
225
+ "required": false,
226
+ "optional": true,
227
+ "docs": {
228
+ "tags": [],
229
+ "text": "The label for the input."
230
+ },
231
+ "attribute": "label",
232
+ "reflect": false
233
+ },
234
+ "required": {
235
+ "type": "boolean",
236
+ "mutable": false,
237
+ "complexType": {
238
+ "original": "boolean",
239
+ "resolved": "boolean",
240
+ "references": {}
241
+ },
242
+ "required": false,
243
+ "optional": false,
244
+ "docs": {
245
+ "tags": [],
246
+ "text": "If `true`, the user must fill in a value before submitting a form."
247
+ },
248
+ "attribute": "required",
249
+ "reflect": false,
250
+ "defaultValue": "false"
251
+ },
252
+ "showOptionalLabel": {
253
+ "type": "boolean",
254
+ "mutable": false,
255
+ "complexType": {
256
+ "original": "boolean",
257
+ "resolved": "boolean",
258
+ "references": {}
259
+ },
260
+ "required": false,
261
+ "optional": false,
262
+ "docs": {
263
+ "tags": [],
264
+ "text": "If `true`, the label will display an \"optional\" tag."
265
+ },
266
+ "attribute": "show-optional-label",
267
+ "reflect": false,
268
+ "defaultValue": "false"
269
+ },
270
+ "uploadFile": {
271
+ "type": "unknown",
272
+ "mutable": false,
273
+ "complexType": {
274
+ "original": "(file: File) => Promise<boolean>",
275
+ "resolved": "(file: File) => Promise<boolean>",
276
+ "references": {
277
+ "File": {
278
+ "location": "global",
279
+ "id": "global::File"
280
+ },
281
+ "Promise": {
282
+ "location": "global",
283
+ "id": "global::Promise"
284
+ }
285
+ }
286
+ },
287
+ "required": false,
288
+ "optional": true,
289
+ "docs": {
290
+ "tags": [],
291
+ "text": "Function to trigger file upload to server.\nReturns: boolean indicating success or failure."
292
+ }
293
+ }
294
+ };
295
+ }
296
+ static get states() {
297
+ return {
298
+ "file": {},
299
+ "dragOver": {},
300
+ "dragError": {},
301
+ "isUploading": {},
302
+ "uploadError": {}
303
+ };
304
+ }
305
+ static get events() {
306
+ return [{
307
+ "method": "cpslOnDrop",
308
+ "name": "cpslOnDrop",
309
+ "bubbles": true,
310
+ "cancelable": true,
311
+ "composed": true,
312
+ "docs": {
313
+ "tags": [],
314
+ "text": "Emitted when the file is dropped in the input."
315
+ },
316
+ "complexType": {
317
+ "original": "DragEvent",
318
+ "resolved": "DragEvent",
319
+ "references": {
320
+ "DragEvent": {
321
+ "location": "global",
322
+ "id": "global::DragEvent"
323
+ }
324
+ }
325
+ }
326
+ }, {
327
+ "method": "cpslOnDragEnter",
328
+ "name": "cpslOnDragEnter",
329
+ "bubbles": true,
330
+ "cancelable": true,
331
+ "composed": true,
332
+ "docs": {
333
+ "tags": [],
334
+ "text": "Emitted when the file drag enters the input."
335
+ },
336
+ "complexType": {
337
+ "original": "DragEvent",
338
+ "resolved": "DragEvent",
339
+ "references": {
340
+ "DragEvent": {
341
+ "location": "global",
342
+ "id": "global::DragEvent"
343
+ }
344
+ }
345
+ }
346
+ }, {
347
+ "method": "cpslOnDragLeave",
348
+ "name": "cpslOnDragLeave",
349
+ "bubbles": true,
350
+ "cancelable": true,
351
+ "composed": true,
352
+ "docs": {
353
+ "tags": [],
354
+ "text": "Emitted when the file drag leaves the input."
355
+ },
356
+ "complexType": {
357
+ "original": "DragEvent",
358
+ "resolved": "DragEvent",
359
+ "references": {
360
+ "DragEvent": {
361
+ "location": "global",
362
+ "id": "global::DragEvent"
363
+ }
364
+ }
365
+ }
366
+ }, {
367
+ "method": "cpslFileChange",
368
+ "name": "cpslFileChange",
369
+ "bubbles": true,
370
+ "cancelable": true,
371
+ "composed": true,
372
+ "docs": {
373
+ "tags": [],
374
+ "text": "Emitted when the file changes."
375
+ },
376
+ "complexType": {
377
+ "original": "File",
378
+ "resolved": "File",
379
+ "references": {
380
+ "File": {
381
+ "location": "global",
382
+ "id": "global::File"
383
+ }
384
+ }
385
+ }
386
+ }, {
387
+ "method": "cpslFileRemoved",
388
+ "name": "cpslFileRemoved",
389
+ "bubbles": true,
390
+ "cancelable": true,
391
+ "composed": true,
392
+ "docs": {
393
+ "tags": [],
394
+ "text": "Emitted when the file is removed."
395
+ },
396
+ "complexType": {
397
+ "original": "void",
398
+ "resolved": "void",
399
+ "references": {}
400
+ }
401
+ }];
402
+ }
403
+ static get elementRef() { return "el"; }
404
+ }
405
+ let inputIds = 0;
406
+ //# sourceMappingURL=cpsl-file-upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-file-upload.js","sourceRoot":"","sources":["../../../../src/components/cpsl-file-upload/cpsl-file-upload.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAgB,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOxG,MAAM,OAAO,cAAc;;QAGjB,YAAO,GAAG,oBAAoB,QAAQ,EAAE,EAAE,CAAC;QA+E3C,eAAU,GAAG,CAAO,EAAa,EAAE,EAAE;;YAC3C,EAAE,CAAC,cAAc,EAAE,CAAC;YAEpB,MAAM,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,0CAAG,CAAC,CAAC,CAAC;YAEpD,IAAI,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;gBAC9B,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC;YAED,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YAEvB,IAAI,CAAC,UAAU,CAAC,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E,MAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,IAAI,CAAC,IAAI,CAAC,mCAAI,GAAG,EACzC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EACnD,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,WAAW,EAAE,IAAI,CAAC,eAAe,EACjC,WAAW,EAAE,IAAI,CAAC,eAAe,EACjC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,GAChC,CACE;YACL,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CACtC,4DAAK,KAAK,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;gBAClF,+DAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,UAAU,CAAQ,CAC5C,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, Event, h, EventEmitter, State, Fragment, Element } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-file-upload',\n styleUrl: 'cpsl-file-upload.scss',\n shadow: true,\n})\nexport class CpslFileUpload {\n @Element() el!: HTMLCpslFileUploadElement;\n\n private inputId = `cpsl-file-upload-${inputIds++}`;\n\n @State() file?: File;\n @State() dragOver?: boolean;\n @State() dragError?: boolean;\n @State() isUploading?: boolean;\n @State() uploadError?: boolean;\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Filename for the external source of the selected file.\n */\n @Prop() externalFilename?: string;\n\n /**\n * External source for the selected file.\n */\n @Prop() externalSrc?: string;\n\n /**\n * Valid file types.\n */\n @Prop() fileTypes?: string[];\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * Function to trigger file upload to server.\n * Returns: boolean indicating success or failure.\n */\n @Prop() uploadFile?: (file: File) => Promise<boolean>;\n\n /**\n * Emitted when the file is dropped in the input.\n */\n @Event() cpslOnDrop!: EventEmitter<DragEvent>;\n\n /**\n * Emitted when the file drag enters the input.\n */\n @Event() cpslOnDragEnter!: EventEmitter<DragEvent>;\n\n /**\n * Emitted when the file drag leaves the input.\n */\n @Event() cpslOnDragLeave!: EventEmitter<DragEvent>;\n\n /**\n * Emitted when the file changes.\n */\n @Event() cpslFileChange!: EventEmitter<File>;\n\n /**\n * Emitted when the file is removed.\n */\n @Event() cpslFileRemoved!: EventEmitter<void>;\n\n private handleDrop = async (ev: DragEvent) => {\n ev.preventDefault();\n\n const item = Array.from(ev.dataTransfer.items)?.[0];\n\n if (item && this.isValidFile(item.type)) {\n const file = item.getAsFile();\n await this.addFile(file);\n }\n\n this.dragOver = false;\n this.dragError = false;\n\n this.cpslOnDrop.emit(ev);\n };\n\n private handleDragEnter = (ev: DragEvent) => {\n ev.preventDefault();\n\n this.dragOver = true;\n\n const item = Array.from(ev.dataTransfer.items)?.[0];\n\n if (item && this.isValidFile(item.type)) {\n this.dragError = true;\n }\n\n this.cpslOnDragEnter.emit(ev);\n };\n\n private handleDragLeave = (ev: DragEvent) => {\n ev.preventDefault();\n\n this.dragOver = false;\n this.dragError = false;\n\n this.cpslOnDragLeave.emit(ev);\n };\n\n private handleInputChange = async (ev: Event) => {\n ev.preventDefault();\n\n const input = this.inputEl;\n\n if (Boolean(input.files.length)) {\n const file = input.files[0];\n\n if (this.isValidFile(file.type)) {\n await this.addFile(file);\n }\n }\n };\n\n private isValidFile = (type: string) => {\n if (Boolean(this.fileTypes?.length) ? !this.fileTypes.includes(type) : false) {\n return false;\n }\n\n return true;\n };\n\n private addFile = async (file: File) => {\n this.file = file;\n this.cpslFileChange.emit(file);\n this.uploadError = false;\n this.isUploading = true;\n const uploadSuccess = Boolean(this.uploadFile) ? await this.uploadFile(file) : true;\n if (!uploadSuccess) {\n this.uploadError = true;\n const input = this.inputEl;\n input.value = '';\n }\n this.isUploading = false;\n };\n\n private removeFile = (e: MouseEvent) => {\n e.preventDefault();\n\n this.file = undefined;\n\n const input = this.inputEl;\n input.value = '';\n\n this.cpslFileRemoved.emit();\n };\n\n get inputEl() {\n return this.el.shadowRoot.getElementById(this.inputId) as HTMLInputElement;\n }\n\n get FileContent() {\n const hasFile = Boolean(this.file) || Boolean(this.externalSrc);\n const isUploading = this.isUploading;\n const error = this.uploadError;\n\n const text = !hasFile ? (\n <Fragment>\n {'Drag file here or '}\n <cpsl-text class=\"inline-text\" variant=\"bodyXS\">\n upload file\n </cpsl-text>\n </Fragment>\n ) : isUploading ? (\n `${this.file.name} is uploading`\n ) : error ? (\n 'Upload Failed'\n ) : (\n this.file?.name || this.externalFilename || ''\n );\n const TopElement = !hasFile ? (\n <cpsl-icon icon=\"image\" />\n ) : isUploading ? (\n <cpsl-spinner />\n ) : error ? (\n <cpsl-icon icon=\"close\" />\n ) : (\n <img class=\"sample-img\" src={Boolean(this.file) ? URL.createObjectURL(this.file) : this.externalSrc} alt=\"Sample Image\" />\n );\n\n return (\n <Fragment>\n {TopElement}\n <span class=\"sample-image-name-container\">\n <cpsl-text class=\"sample-image-name\" variant=\"bodyXS\">\n {text}\n </cpsl-text>\n {hasFile && !error && !isUploading && <cpsl-icon icon=\"close\" onClick={this.removeFile} />}\n </span>\n </Fragment>\n );\n }\n\n render() {\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n {this.required ? '*' : ' '}\n {!this.required && this.showOptionalLabel ? <span class=\"optional-label\">(optional)</span> : ''}\n </label>\n )}\n <slot name=\"label\"></slot>\n <div class={{ 'container': true, 'error': Boolean(this.errorText), 'drag': this.dragOver, 'drag-error': this.dragError }}>\n <div class={{ 'label-container': true }}>\n <slot name=\"left-content\"></slot>\n </div>\n <div class={{ 'file-container': true }}>{this.FileContent}</div>\n <input\n id={this.inputId}\n type=\"file\"\n accept={this.fileTypes?.join(', ') ?? '*'}\n files={Boolean(this.file) ? [this.file] : undefined}\n onDrop={this.handleDrop}\n onDragEnter={this.handleDragEnter}\n onDragLeave={this.handleDragLeave}\n onChange={this.handleInputChange}\n />\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
@@ -0,0 +1,29 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try {
5
+ step(generator.next(value));
6
+ }
7
+ catch (e) {
8
+ reject(e);
9
+ } }
10
+ function rejected(value) { try {
11
+ step(generator["throw"](value));
12
+ }
13
+ catch (e) {
14
+ reject(e);
15
+ } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ import { newE2EPage } from "@stencil/core/testing";
21
+ describe('cpsl-file-upload', () => {
22
+ it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
23
+ const page = yield newE2EPage();
24
+ yield page.setContent('<cpsl-file-upload></cpsl-file-upload>');
25
+ const element = yield page.find('cpsl-file-upload');
26
+ expect(element).toHaveClass('hydrated');
27
+ }));
28
+ });
29
+ //# sourceMappingURL=cpsl-file-upload.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-file-upload.e2e.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-file-upload/test/cpsl-file-upload.e2e.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,uCAAuC,CAAC,CAAC;QAE/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACpD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cpsl-file-upload', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cpsl-file-upload></cpsl-file-upload>');\n\n const element = await page.find('cpsl-file-upload');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
@@ -0,0 +1,37 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try {
5
+ step(generator.next(value));
6
+ }
7
+ catch (e) {
8
+ reject(e);
9
+ } }
10
+ function rejected(value) { try {
11
+ step(generator["throw"](value));
12
+ }
13
+ catch (e) {
14
+ reject(e);
15
+ } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ import { newSpecPage } from "@stencil/core/testing";
21
+ import { CpslFileUpload } from "../cpsl-file-upload";
22
+ describe('cpsl-file-upload', () => {
23
+ it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
24
+ const page = yield newSpecPage({
25
+ components: [CpslFileUpload],
26
+ html: `<cpsl-file-upload></cpsl-file-upload>`,
27
+ });
28
+ expect(page.root).toEqualHtml(`
29
+ <cpsl-file-upload>
30
+ <mock:shadow-root>
31
+ <slot></slot>
32
+ </mock:shadow-root>
33
+ </cpsl-file-upload>
34
+ `);
35
+ }));
36
+ });
37
+ //# sourceMappingURL=cpsl-file-upload.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-file-upload.spec.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-file-upload/test/cpsl-file-upload.spec.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,cAAc,CAAC;YAC5B,IAAI,EAAE,uCAAuC;SAC9C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CpslFileUpload } from '../cpsl-file-upload';\n\ndescribe('cpsl-file-upload', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CpslFileUpload],\n html: `<cpsl-file-upload></cpsl-file-upload>`,\n });\n expect(page.root).toEqualHtml(`\n <cpsl-file-upload>\n <mock:shadow-root>\n <slot></slot>\n </mock:shadow-root>\n </cpsl-file-upload>\n `);\n });\n});\n"]}
@@ -4,9 +4,9 @@ export class CpslGrid {
4
4
  this.fixed = false;
5
5
  }
6
6
  render() {
7
- return (h(Host, { key: '7f71c4736413c5fd6a742716da614991ef6a585e', class: {
7
+ return (h(Host, { key: '76084ea41988e4fdff4a48dc400988d2aa190a56', class: {
8
8
  'grid-fixed': this.fixed,
9
- } }, h("slot", { key: '98f624d6d897aca30adcd75b14ef88124781981a' })));
9
+ } }, h("slot", { key: '1eb8c755910397d58a2165238a1428769623ef6b' })));
10
10
  }
11
11
  static get is() { return "cpsl-grid"; }
12
12
  static get encapsulation() { return "shadow"; }
@@ -6,7 +6,7 @@ export class CpslIcon {
6
6
  this.icon = undefined;
7
7
  }
8
8
  render() {
9
- return (h(Host, { key: '5e1a7143534342f6c3d79ccf1edcc40aa903773a', part: "icon", role: "img" }, !Boolean(this.icon) ? h("img", { src: this.src }) : h("div", { innerHTML: Icons[this.icon] })));
9
+ return (h(Host, { key: 'fe58523210b92237924bd768007f3a191b401a57', part: "icon", role: "img" }, !Boolean(this.icon) ? h("img", { src: this.src }) : h("div", { innerHTML: Icons[this.icon] })));
10
10
  }
11
11
  static get is() { return "cpsl-icon"; }
12
12
  static get encapsulation() { return "shadow"; }
@@ -44,7 +44,7 @@ export class CpslIcon {
44
44
  "mutable": false,
45
45
  "complexType": {
46
46
  "original": "IconType",
47
- "resolved": "\"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\" | \"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"settings\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"youtubeBrand\" | \"youtube\"",
47
+ "resolved": "\"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\" | \"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"menu\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"settings\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\"",
48
48
  "references": {
49
49
  "IconType": {
50
50
  "location": "import",
@@ -71,7 +71,7 @@
71
71
  padding-top: var(--box-padding-top);
72
72
  padding-bottom: var(--box-padding-bottom);
73
73
  display: flex;
74
- background-color: var(--cpsl-color-background-secondary);
74
+ background: var(--cpsl-color-background-secondary);
75
75
  border: var(--box-border-width) solid var(--cpsl-color-input-border-placeholder);
76
76
  border-radius: var(--box-border-radius);
77
77
  }
@@ -1,7 +1,7 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  export class CpslInfoBox {
3
3
  render() {
4
- return (h(Host, { key: '519995e7bf034f2bf6bda24249a0acf5264bc0ab' }, h("div", { key: '076b0866fbfa4812c5403511ec7048c99bba1823', class: "info-box-container" }, h("slot", { key: 'e00f6c9efa7f3701b58f8f20808b6323f9618877' }))));
4
+ return (h(Host, { key: '15b85f109d7e5371f6fa35f38dc35f86a061c46c' }, h("div", { key: '39eae7146dfa17771e1d68045255c9b0db5d0a0c', class: "info-box-container" }, h("slot", { key: '008e3552b563dd2f3b6d10bc7afe59b0f2a2ba3a' }))));
5
5
  }
6
6
  static get is() { return "cpsl-info-box"; }
7
7
  static get encapsulation() { return "shadow"; }
@@ -55,7 +55,7 @@
55
55
  */
56
56
  :host {
57
57
  --container-box-shadow: none;
58
- --container-box-shadow-color: var(--cpsl-color-input-border-placeholder);
58
+ --container-box-shadow-color: none;
59
59
  --container-border-color: var(--cpsl-color-input-border-active);
60
60
  --container-border-error-color: var(--cpsl-color-input-border-error);
61
61
  --container-background-color: var(--cpsl-color-input-surface-default);
@@ -67,7 +67,7 @@
67
67
  --container-padding-end: 12px;
68
68
  --container-padding-start: 12px;
69
69
  --container-height: 48px;
70
- --container-gap: 12px;
70
+ --container-gap: 8px;
71
71
  --input-background-color: var(--cpsl-color-input-surface-default);
72
72
  --input-background-color-disabled: var(--cpsl-color-input-surface-disabled);
73
73
  --input-color: var(--cpsl-color-text-primary);
@@ -100,6 +100,7 @@
100
100
  --container-background-color: var(--container-background-color-disabled);
101
101
  --input-background-color: var(--input-background-color-disabled);
102
102
  --input-color: var(--cpsl-color-text-disabled);
103
+ --container-border-color: transparent;
103
104
  }
104
105
 
105
106
  :host(.focused) {
@@ -124,7 +125,7 @@
124
125
  border-width: var(--container-border-width);
125
126
  border-color: var(--container-border-color);
126
127
  border-radius: var(--container-border-radius);
127
- background-color: var(--container-background-color);
128
+ background: var(--container-background-color);
128
129
  box-shadow: var(--container-box-shadow);
129
130
  }
130
131
 
@@ -140,7 +141,7 @@
140
141
  box-sizing: border-box;
141
142
  font-size: var(--input-font-size);
142
143
  color: var(--input-color);
143
- background-color: var(--input-background-color);
144
+ background: var(--input-background-color);
144
145
  font-family: var(--cpsl-font-family, inherit);
145
146
  }
146
147
  .native-input:focus, .native-input:focus-visible {
@@ -189,10 +190,10 @@
189
190
  }
190
191
 
191
192
  :host ::slotted([slot=start]) {
192
- flex: 0;
193
+ flex: 0 0 auto;
193
194
  }
194
195
  :host ::slotted([slot=end]) {
195
- flex: 0;
196
+ flex: 0 0 auto;
196
197
  }
197
198
  :host ::slotted(cpsl-icon) {
198
199
  --icon-color: var(--input-color);