@usecapsule/core-components 1.0.13 → 2.0.0-dev.dropdown

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. package/css/capsule-core.css +86 -41
  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-0462f723.js +2 -0
  8. package/dist/capsule/p-0462f723.js.map +1 -0
  9. package/dist/capsule/p-0cab90fa.entry.js +2 -0
  10. package/dist/capsule/{p-1dc07cd7.entry.js.map → p-0cab90fa.entry.js.map} +1 -1
  11. package/dist/capsule/{p-11048392.entry.js → p-193ac141.entry.js} +2 -2
  12. package/dist/capsule/p-6fb7c4d1.js +3 -0
  13. package/dist/capsule/p-6fb7c4d1.js.map +1 -0
  14. package/dist/capsule/{p-62e7869a.entry.js → p-a95ec4df.entry.js} +2 -2
  15. package/dist/capsule/p-bea93fae.entry.js +29 -0
  16. package/dist/capsule/p-bea93fae.entry.js.map +1 -0
  17. package/dist/capsule/p-c2bf050b.js +2 -0
  18. package/dist/capsule/p-c2bf050b.js.map +1 -0
  19. package/dist/capsule/p-cb8dc0a4.entry.js +2 -0
  20. package/dist/capsule/p-d7be092d.entry.js +10 -0
  21. package/dist/capsule/p-d7be092d.entry.js.map +1 -0
  22. package/dist/cjs/_commonjsHelpers-b3309d7b.js +12 -0
  23. package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
  24. package/dist/cjs/capsule.cjs.js +2 -2
  25. package/dist/cjs/constants-4bb85cc5.js +12 -0
  26. package/dist/cjs/constants-4bb85cc5.js.map +1 -0
  27. package/dist/cjs/{cpsl-alert_17.cjs.entry.js → cpsl-alert_18.cjs.entry.js} +3838 -537
  28. package/dist/cjs/cpsl-alert_18.cjs.entry.js.map +1 -0
  29. package/dist/cjs/cpsl-animation.cjs.entry.js +20129 -0
  30. package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -0
  31. package/dist/cjs/cpsl-col.cjs.entry.js +2 -2
  32. package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
  33. package/dist/cjs/cpsl-info-box.cjs.entry.js +3 -3
  34. package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
  35. package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
  36. package/dist/cjs/{index-2a026742.js → index-3fccb5b4.js} +24 -3
  37. package/dist/cjs/index-3fccb5b4.js.map +1 -0
  38. package/dist/cjs/index.cjs.js +358 -0
  39. package/dist/cjs/index.cjs.js.map +1 -1
  40. package/dist/cjs/loader.cjs.js +2 -2
  41. package/dist/collection/assets/icons/capsule-rings-dark.svg +34 -0
  42. package/dist/collection/assets/icons/capsule.svg +4 -4
  43. package/dist/collection/assets/icons/chevron-up.svg +3 -0
  44. package/dist/collection/assets/icons/hero-email.svg +8 -30
  45. package/dist/collection/assets/icons/hero-lock.svg +4 -34
  46. package/dist/collection/assets/icons/hero-passkey.svg +9 -17
  47. package/dist/collection/assets/icons/hero-phone.svg +4 -15
  48. package/dist/collection/assets/icons/hero-wallet.svg +5 -44
  49. package/dist/collection/assets/icons/index.js +5 -2
  50. package/dist/collection/assets/icons/index.js.map +1 -1
  51. package/dist/collection/assets/icons/more-login-options.svg +10 -10
  52. package/dist/collection/assets/icons/plus-circle.svg +5 -0
  53. package/dist/collection/assets/icons/wallet.svg +5 -0
  54. package/dist/collection/collection-manifest.json +2 -0
  55. package/dist/collection/components/cpsl-alert/cpsl-alert.js +1 -1
  56. package/dist/collection/components/cpsl-animation/cpsl-animation.css +17 -0
  57. package/dist/collection/components/cpsl-animation/cpsl-animation.js +102 -0
  58. package/dist/collection/components/cpsl-animation/cpsl-animation.js.map +1 -0
  59. package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js +29 -0
  60. package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js.map +1 -0
  61. package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js +37 -0
  62. package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js.map +1 -0
  63. package/dist/collection/components/cpsl-button/cpsl-button.css +3 -0
  64. package/dist/collection/components/cpsl-button/cpsl-button.js +2 -2
  65. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  66. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +1 -1
  67. package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
  68. package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
  69. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.css +88 -0
  70. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +113 -0
  71. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -0
  72. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.e2e.js +29 -0
  73. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.e2e.js.map +1 -0
  74. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.spec.js +37 -0
  75. package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.spec.js.map +1 -0
  76. package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
  77. package/dist/collection/components/cpsl-icon/cpsl-icon.css +14 -0
  78. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -3
  79. package/dist/collection/components/cpsl-icon/cpsl-icon.js.map +1 -1
  80. package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -1
  81. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  82. package/dist/collection/components/cpsl-input/cpsl-input.css +12 -7
  83. package/dist/collection/components/cpsl-input/cpsl-input.js +8 -6
  84. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  85. package/dist/collection/components/cpsl-modal/cpsl-modal.css +46 -4
  86. package/dist/collection/components/cpsl-modal/cpsl-modal.js +341 -24
  87. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -1
  88. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +30 -13
  89. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +1 -1
  90. package/dist/collection/components/cpsl-pill/cpsl-pill.css +3 -3
  91. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  92. package/dist/collection/components/cpsl-progress-indicator/cpsl-progress-indicator.css +3 -3
  93. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +3 -3
  94. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
  95. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  96. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.css +11 -9
  97. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  98. package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +2 -2
  99. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
  100. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  101. package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +17 -16
  102. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +2 -2
  103. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
  104. package/dist/collection/components/cpsl-text/cpsl-text.css +101 -0
  105. package/dist/collection/components/cpsl-text/cpsl-text.js +110 -1
  106. package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
  107. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +3 -0
  108. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  109. package/dist/collection/constants.js +6 -0
  110. package/dist/collection/constants.js.map +1 -0
  111. package/dist/collection/index.js +1 -0
  112. package/dist/collection/index.js.map +1 -1
  113. package/dist/collection/interface.js.map +1 -1
  114. package/dist/collection/utils/theme/generateBorderRadii.js +56 -0
  115. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -0
  116. package/dist/collection/utils/theme/generateFont.js +28 -0
  117. package/dist/collection/utils/theme/generateFont.js.map +1 -0
  118. package/dist/collection/utils/theme/generatePalette.js +46 -0
  119. package/dist/collection/utils/theme/generatePalette.js.map +1 -0
  120. package/dist/collection/utils/theme/generateTheme.js +11 -0
  121. package/dist/collection/utils/theme/generateTheme.js.map +1 -0
  122. package/dist/collection/utils/theme/utils.js +21 -0
  123. package/dist/collection/utils/theme/utils.js.map +1 -0
  124. package/dist/esm/_commonjsHelpers-1789f0cf.js +9 -0
  125. package/dist/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
  126. package/dist/esm/capsule.js +3 -3
  127. package/dist/esm/constants-7b49abd5.js +9 -0
  128. package/dist/esm/constants-7b49abd5.js.map +1 -0
  129. package/dist/esm/{cpsl-alert_17.entry.js → cpsl-alert_18.entry.js} +3837 -537
  130. package/dist/esm/cpsl-alert_18.entry.js.map +1 -0
  131. package/dist/esm/cpsl-animation.entry.js +20125 -0
  132. package/dist/esm/cpsl-animation.entry.js.map +1 -0
  133. package/dist/esm/cpsl-col.entry.js +2 -2
  134. package/dist/esm/cpsl-grid.entry.js +3 -3
  135. package/dist/esm/cpsl-info-box.entry.js +3 -3
  136. package/dist/esm/cpsl-info-box.entry.js.map +1 -1
  137. package/dist/esm/cpsl-row.entry.js +2 -2
  138. package/dist/esm/{index-7c2f5cb9.js → index-f00e090c.js} +24 -3
  139. package/dist/esm/index-f00e090c.js.map +1 -0
  140. package/dist/esm/index.js +355 -0
  141. package/dist/esm/index.js.map +1 -1
  142. package/dist/esm/loader.js +3 -3
  143. package/dist/types/assets/icons/index.d.ts +4 -1
  144. package/dist/types/components/cpsl-animation/cpsl-animation.d.ts +9 -0
  145. package/dist/types/components/cpsl-dropdown/cpsl-dropdown.d.ts +25 -0
  146. package/dist/types/components/cpsl-modal/cpsl-modal.d.ts +26 -5
  147. package/dist/types/components/cpsl-overlay/cpsl-overlay.d.ts +2 -2
  148. package/dist/types/components/cpsl-text/cpsl-text.d.ts +4 -0
  149. package/dist/types/components.d.ts +170 -13
  150. package/dist/types/constants.d.ts +3 -0
  151. package/dist/types/index.d.ts +2 -0
  152. package/dist/types/interface.d.ts +137 -0
  153. package/dist/types/utils/theme/generateBorderRadii.d.ts +2 -0
  154. package/dist/types/utils/theme/generateFont.d.ts +2 -0
  155. package/dist/types/utils/theme/generatePalette.d.ts +7 -0
  156. package/dist/types/utils/theme/generateTheme.d.ts +2 -0
  157. package/dist/types/utils/theme/utils.d.ts +5 -0
  158. package/package.json +5 -3
  159. package/dist/capsule/p-0e2fbb7f.entry.js +0 -20
  160. package/dist/capsule/p-0e2fbb7f.entry.js.map +0 -1
  161. package/dist/capsule/p-1dc07cd7.entry.js +0 -2
  162. package/dist/capsule/p-5c020abe.entry.js +0 -2
  163. package/dist/capsule/p-9647dd63.js +0 -3
  164. package/dist/capsule/p-9647dd63.js.map +0 -1
  165. package/dist/cjs/cpsl-alert_17.cjs.entry.js.map +0 -1
  166. package/dist/cjs/index-2a026742.js.map +0 -1
  167. package/dist/collection/assets/icons/more-login-options-dark.svg +0 -13
  168. package/dist/esm/cpsl-alert_17.entry.js.map +0 -1
  169. package/dist/esm/index-7c2f5cb9.js.map +0 -1
  170. /package/dist/capsule/{p-11048392.entry.js.map → p-193ac141.entry.js.map} +0 -0
  171. /package/dist/capsule/{p-62e7869a.entry.js.map → p-a95ec4df.entry.js.map} +0 -0
  172. /package/dist/capsule/{p-5c020abe.entry.js.map → p-cb8dc0a4.entry.js.map} +0 -0
  173. /package/dist/types/Users/{taylorbosch → vinay}/Documents/GitHub/Capsule/component-library/core/.stencil/scripts/buildIconLibrary.d.ts +0 -0
@@ -26,6 +26,16 @@ export namespace Components {
26
26
  */
27
27
  "type"?: 'error';
28
28
  }
29
+ interface CpslAnimation {
30
+ /**
31
+ * Will replay the animation
32
+ */
33
+ "replayAnimation": () => Promise<void>;
34
+ /**
35
+ * Source of the Lottie animation file.
36
+ */
37
+ "src": string;
38
+ }
29
39
  interface CpslButton {
30
40
  /**
31
41
  * If the button is disabled. Default is: false.
@@ -158,6 +168,16 @@ export namespace Components {
158
168
  }
159
169
  interface CpslDivider {
160
170
  }
171
+ interface CpslDropdown {
172
+ /**
173
+ * Items to be presented in the dropdown
174
+ */
175
+ "items": Array<{ icon: string, label: string, value: string, selectedLabel?: string }>;
176
+ /**
177
+ * Width of the dropdown
178
+ */
179
+ "width": string;
180
+ }
161
181
  interface CpslGrid {
162
182
  /**
163
183
  * If `true`, the grid will have a fixed width based on the screen size.
@@ -287,24 +307,44 @@ export namespace Components {
287
307
  "value"?: string;
288
308
  }
289
309
  interface CpslModal {
310
+ /**
311
+ * Duration in seconds of the modal entering. Default is .15.
312
+ */
313
+ "enterTransitionDuration"?: number;
314
+ /**
315
+ * Duration in seconds of the modal exiting. Default is .15.
316
+ */
317
+ "exitTransitionDuration"?: number;
290
318
  /**
291
319
  * Whether or not to show `footerExpandedFooter` and `footerExpandedHeader` slots.
292
320
  */
293
- "footerExpanded": boolean;
321
+ "footerExpanded"?: boolean;
322
+ /**
323
+ * Duration in seconds of the footer expansion animation. Default is 0.15.
324
+ */
325
+ "footerTransitionDuration"?: number;
294
326
  /**
295
- * Duration in seconds of the footer expansion animation. Default is .5.
327
+ * Whether or not to show the overlay. This will always show the modal, regardless of the value of `open`.
296
328
  */
297
- "transitionDuration": number;
329
+ "noOverlay"?: boolean;
330
+ /**
331
+ * Whether or not to show the modal.
332
+ */
333
+ "open": boolean;
298
334
  }
299
335
  interface CpslOverlay {
300
336
  /**
301
- * Whether or not to show the overlay.
337
+ * Duration in seconds of the fade out animation. Default is .5.
302
338
  */
303
- "open": boolean;
339
+ "enterTransitionDuration"?: number;
304
340
  /**
305
- * Duration in seconds of the fade in/out animation. Default is .5.
341
+ * Duration in seconds of the fade out animation. Default is .5.
306
342
  */
307
- "transitionDuration": number;
343
+ "exitTransitionDuration"?: number;
344
+ /**
345
+ * Whether or not to show the overlay.
346
+ */
347
+ "open": boolean;
308
348
  }
309
349
  interface CpslPill {
310
350
  /**
@@ -391,6 +431,18 @@ export namespace Components {
391
431
  "selectedTab"?: string;
392
432
  }
393
433
  interface CpslText {
434
+ /**
435
+ * The color of text. Options are: `"primary"`, `"secondary", `"subtle", `"inverted", `"error". Default is: `"primary"`.
436
+ */
437
+ "color"?: 'primary' | 'secondary' | 'subtle' | 'inverted' | 'error';
438
+ /**
439
+ * The variant of text. Options are: `"body2XS"`, `"bodyXS", `"bodyS", `"bodyM", `"bodyL", `"bodyXL", `"headingXS", `"headingS", `"headingM", `"headingL", `"headingXL", `"heading2XL". Default is: `"bodyM"`.
440
+ */
441
+ "variant"?: 'body2XS' | 'bodyXS' | 'bodyS' | 'bodyM' | 'bodyL' | 'bodyXL' | 'headingXS' | 'headingS' | 'headingM' | 'headingL' | 'headingXL' | 'heading2XL';
442
+ /**
443
+ * The weight of text. Options are: `"regular"`, `"medium", `"semiBold", `"bold". Default is: `"regular"`.
444
+ */
445
+ "weight"?: 'regular' | 'medium' | 'semiBold' | 'bold';
394
446
  }
395
447
  interface CpslTileButton {
396
448
  /**
@@ -411,6 +463,10 @@ export interface CpslInputCustomEvent<T> extends CustomEvent<T> {
411
463
  detail: T;
412
464
  target: HTMLCpslInputElement;
413
465
  }
466
+ export interface CpslModalCustomEvent<T> extends CustomEvent<T> {
467
+ detail: T;
468
+ target: HTMLCpslModalElement;
469
+ }
414
470
  export interface CpslSlideButtonCustomEvent<T> extends CustomEvent<T> {
415
471
  detail: T;
416
472
  target: HTMLCpslSlideButtonElement;
@@ -430,6 +486,12 @@ declare global {
430
486
  prototype: HTMLCpslAlertElement;
431
487
  new (): HTMLCpslAlertElement;
432
488
  };
489
+ interface HTMLCpslAnimationElement extends Components.CpslAnimation, HTMLStencilElement {
490
+ }
491
+ var HTMLCpslAnimationElement: {
492
+ prototype: HTMLCpslAnimationElement;
493
+ new (): HTMLCpslAnimationElement;
494
+ };
433
495
  interface HTMLCpslButtonElement extends Components.CpslButton, HTMLStencilElement {
434
496
  }
435
497
  var HTMLCpslButtonElement: {
@@ -465,6 +527,12 @@ declare global {
465
527
  prototype: HTMLCpslDividerElement;
466
528
  new (): HTMLCpslDividerElement;
467
529
  };
530
+ interface HTMLCpslDropdownElement extends Components.CpslDropdown, HTMLStencilElement {
531
+ }
532
+ var HTMLCpslDropdownElement: {
533
+ prototype: HTMLCpslDropdownElement;
534
+ new (): HTMLCpslDropdownElement;
535
+ };
468
536
  interface HTMLCpslGridElement extends Components.CpslGrid, HTMLStencilElement {
469
537
  }
470
538
  var HTMLCpslGridElement: {
@@ -503,7 +571,22 @@ declare global {
503
571
  prototype: HTMLCpslInputElement;
504
572
  new (): HTMLCpslInputElement;
505
573
  };
574
+ interface HTMLCpslModalElementEventMap {
575
+ "cpslModalEntering": null;
576
+ "cpslModalEntered": null;
577
+ "cpslModalExiting": null;
578
+ "cpslModalExited": null;
579
+ "cpslModalRequestClose": null;
580
+ }
506
581
  interface HTMLCpslModalElement extends Components.CpslModal, HTMLStencilElement {
582
+ addEventListener<K extends keyof HTMLCpslModalElementEventMap>(type: K, listener: (this: HTMLCpslModalElement, ev: CpslModalCustomEvent<HTMLCpslModalElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
583
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
584
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
585
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
586
+ removeEventListener<K extends keyof HTMLCpslModalElementEventMap>(type: K, listener: (this: HTMLCpslModalElement, ev: CpslModalCustomEvent<HTMLCpslModalElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
587
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
588
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
589
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
507
590
  }
508
591
  var HTMLCpslModalElement: {
509
592
  prototype: HTMLCpslModalElement;
@@ -611,10 +694,12 @@ declare global {
611
694
  };
612
695
  interface HTMLElementTagNameMap {
613
696
  "cpsl-alert": HTMLCpslAlertElement;
697
+ "cpsl-animation": HTMLCpslAnimationElement;
614
698
  "cpsl-button": HTMLCpslButtonElement;
615
699
  "cpsl-code-input": HTMLCpslCodeInputElement;
616
700
  "cpsl-col": HTMLCpslColElement;
617
701
  "cpsl-divider": HTMLCpslDividerElement;
702
+ "cpsl-dropdown": HTMLCpslDropdownElement;
618
703
  "cpsl-grid": HTMLCpslGridElement;
619
704
  "cpsl-icon": HTMLCpslIconElement;
620
705
  "cpsl-info-box": HTMLCpslInfoBoxElement;
@@ -644,6 +729,12 @@ declare namespace LocalJSX {
644
729
  */
645
730
  "type"?: 'error';
646
731
  }
732
+ interface CpslAnimation {
733
+ /**
734
+ * Source of the Lottie animation file.
735
+ */
736
+ "src"?: string;
737
+ }
647
738
  interface CpslButton {
648
739
  /**
649
740
  * If the button is disabled. Default is: false.
@@ -780,6 +871,16 @@ declare namespace LocalJSX {
780
871
  }
781
872
  interface CpslDivider {
782
873
  }
874
+ interface CpslDropdown {
875
+ /**
876
+ * Items to be presented in the dropdown
877
+ */
878
+ "items"?: Array<{ icon: string, label: string, value: string, selectedLabel?: string }>;
879
+ /**
880
+ * Width of the dropdown
881
+ */
882
+ "width"?: string;
883
+ }
783
884
  interface CpslGrid {
784
885
  /**
785
886
  * If `true`, the grid will have a fixed width based on the screen size.
@@ -925,24 +1026,64 @@ declare namespace LocalJSX {
925
1026
  "value"?: string;
926
1027
  }
927
1028
  interface CpslModal {
1029
+ /**
1030
+ * Duration in seconds of the modal entering. Default is .15.
1031
+ */
1032
+ "enterTransitionDuration"?: number;
1033
+ /**
1034
+ * Duration in seconds of the modal exiting. Default is .15.
1035
+ */
1036
+ "exitTransitionDuration"?: number;
928
1037
  /**
929
1038
  * Whether or not to show `footerExpandedFooter` and `footerExpandedHeader` slots.
930
1039
  */
931
1040
  "footerExpanded"?: boolean;
932
1041
  /**
933
- * Duration in seconds of the footer expansion animation. Default is .5.
1042
+ * Duration in seconds of the footer expansion animation. Default is 0.15.
1043
+ */
1044
+ "footerTransitionDuration"?: number;
1045
+ /**
1046
+ * Whether or not to show the overlay. This will always show the modal, regardless of the value of `open`.
1047
+ */
1048
+ "noOverlay"?: boolean;
1049
+ /**
1050
+ * Emitted when enter animation finishes.
1051
+ */
1052
+ "onCpslModalEntered"?: (event: CpslModalCustomEvent<null>) => void;
1053
+ /**
1054
+ * Emitted when enter animation starts.
934
1055
  */
935
- "transitionDuration"?: number;
1056
+ "onCpslModalEntering"?: (event: CpslModalCustomEvent<null>) => void;
1057
+ /**
1058
+ * Emitted when exit animation finishes.
1059
+ */
1060
+ "onCpslModalExited"?: (event: CpslModalCustomEvent<null>) => void;
1061
+ /**
1062
+ * Emitted when exit animation starts.
1063
+ */
1064
+ "onCpslModalExiting"?: (event: CpslModalCustomEvent<null>) => void;
1065
+ /**
1066
+ * Emitted when exit animation finishes.
1067
+ */
1068
+ "onCpslModalRequestClose"?: (event: CpslModalCustomEvent<null>) => void;
1069
+ /**
1070
+ * Whether or not to show the modal.
1071
+ */
1072
+ "open"?: boolean;
936
1073
  }
937
1074
  interface CpslOverlay {
938
1075
  /**
939
- * Whether or not to show the overlay.
1076
+ * Duration in seconds of the fade out animation. Default is .5.
940
1077
  */
941
- "open"?: boolean;
1078
+ "enterTransitionDuration"?: number;
942
1079
  /**
943
- * Duration in seconds of the fade in/out animation. Default is .5.
1080
+ * Duration in seconds of the fade out animation. Default is .5.
944
1081
  */
945
- "transitionDuration"?: number;
1082
+ "exitTransitionDuration"?: number;
1083
+ /**
1084
+ * Whether or not to show the overlay.
1085
+ */
1086
+ "open"?: boolean;
946
1087
  }
947
1088
  interface CpslPill {
948
1089
  /**
@@ -1037,6 +1178,18 @@ declare namespace LocalJSX {
1037
1178
  "selectedTab"?: string;
1038
1179
  }
1039
1180
  interface CpslText {
1181
+ /**
1182
+ * The color of text. Options are: `"primary"`, `"secondary", `"subtle", `"inverted", `"error". Default is: `"primary"`.
1183
+ */
1184
+ "color"?: 'primary' | 'secondary' | 'subtle' | 'inverted' | 'error';
1185
+ /**
1186
+ * The variant of text. Options are: `"body2XS"`, `"bodyXS", `"bodyS", `"bodyM", `"bodyL", `"bodyXL", `"headingXS", `"headingS", `"headingM", `"headingL", `"headingXL", `"heading2XL". Default is: `"bodyM"`.
1187
+ */
1188
+ "variant"?: 'body2XS' | 'bodyXS' | 'bodyS' | 'bodyM' | 'bodyL' | 'bodyXL' | 'headingXS' | 'headingS' | 'headingM' | 'headingL' | 'headingXL' | 'heading2XL';
1189
+ /**
1190
+ * The weight of text. Options are: `"regular"`, `"medium", `"semiBold", `"bold". Default is: `"regular"`.
1191
+ */
1192
+ "weight"?: 'regular' | 'medium' | 'semiBold' | 'bold';
1040
1193
  }
1041
1194
  interface CpslTileButton {
1042
1195
  /**
@@ -1050,10 +1203,12 @@ declare namespace LocalJSX {
1050
1203
  }
1051
1204
  interface IntrinsicElements {
1052
1205
  "cpsl-alert": CpslAlert;
1206
+ "cpsl-animation": CpslAnimation;
1053
1207
  "cpsl-button": CpslButton;
1054
1208
  "cpsl-code-input": CpslCodeInput;
1055
1209
  "cpsl-col": CpslCol;
1056
1210
  "cpsl-divider": CpslDivider;
1211
+ "cpsl-dropdown": CpslDropdown;
1057
1212
  "cpsl-grid": CpslGrid;
1058
1213
  "cpsl-icon": CpslIcon;
1059
1214
  "cpsl-info-box": CpslInfoBox;
@@ -1077,10 +1232,12 @@ declare module "@stencil/core" {
1077
1232
  export namespace JSX {
1078
1233
  interface IntrinsicElements {
1079
1234
  "cpsl-alert": LocalJSX.CpslAlert & JSXBase.HTMLAttributes<HTMLCpslAlertElement>;
1235
+ "cpsl-animation": LocalJSX.CpslAnimation & JSXBase.HTMLAttributes<HTMLCpslAnimationElement>;
1080
1236
  "cpsl-button": LocalJSX.CpslButton & JSXBase.HTMLAttributes<HTMLCpslButtonElement>;
1081
1237
  "cpsl-code-input": LocalJSX.CpslCodeInput & JSXBase.HTMLAttributes<HTMLCpslCodeInputElement>;
1082
1238
  "cpsl-col": LocalJSX.CpslCol & JSXBase.HTMLAttributes<HTMLCpslColElement>;
1083
1239
  "cpsl-divider": LocalJSX.CpslDivider & JSXBase.HTMLAttributes<HTMLCpslDividerElement>;
1240
+ "cpsl-dropdown": LocalJSX.CpslDropdown & JSXBase.HTMLAttributes<HTMLCpslDropdownElement>;
1084
1241
  "cpsl-grid": LocalJSX.CpslGrid & JSXBase.HTMLAttributes<HTMLCpslGridElement>;
1085
1242
  "cpsl-icon": LocalJSX.CpslIcon & JSXBase.HTMLAttributes<HTMLCpslIconElement>;
1086
1243
  "cpsl-info-box": LocalJSX.CpslInfoBox & JSXBase.HTMLAttributes<HTMLCpslInfoBoxElement>;
@@ -0,0 +1,3 @@
1
+ import { Theme } from './interface';
2
+ export declare const MOBILE_SIZE = 480;
3
+ export declare const DEFAULT_THEME: Theme;
@@ -1 +1,3 @@
1
1
  export * from './components';
2
+ export { generateTheme } from './utils/theme/generateTheme';
3
+ export type { Theme, BorderRadius } from './interface';
@@ -8,3 +8,140 @@ export type CssClassMap = {
8
8
  [className: string]: boolean;
9
9
  };
10
10
  export type IconType = keyof typeof Icons;
11
+ export type Theme = {
12
+ foregroundColor?: string;
13
+ backgroundColor?: string;
14
+ borderRadius?: BorderRadius;
15
+ font?: string;
16
+ customPalette?: CustomPalette;
17
+ customFontSizes?: CustomFontSizes;
18
+ };
19
+ export type BorderRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'full';
20
+ export interface CustomFontSizes {
21
+ body2XS?: string;
22
+ bodyXS?: string;
23
+ bodyS?: string;
24
+ bodyM?: string;
25
+ bodyL?: string;
26
+ bodyXL?: string;
27
+ headingXS?: string;
28
+ headingS?: string;
29
+ headingM?: string;
30
+ headingL?: string;
31
+ headingXL?: string;
32
+ heading2XL?: string;
33
+ }
34
+ export interface CustomPalette {
35
+ text?: {
36
+ primary?: string;
37
+ secondary?: string;
38
+ subtle?: string;
39
+ inverted?: string;
40
+ error?: string;
41
+ };
42
+ modal?: {
43
+ surface?: {
44
+ main?: string;
45
+ footer?: string;
46
+ };
47
+ border?: string;
48
+ };
49
+ input?: {
50
+ surface?: {
51
+ disabled?: string;
52
+ default?: string;
53
+ };
54
+ border?: {
55
+ placeholder?: string;
56
+ active?: string;
57
+ error?: string;
58
+ };
59
+ };
60
+ tileButton?: {
61
+ surface?: {
62
+ default?: string;
63
+ hover?: string;
64
+ pressed?: string;
65
+ };
66
+ border?: string;
67
+ };
68
+ primaryButton?: {
69
+ surface?: {
70
+ default?: string;
71
+ hover?: string;
72
+ pressed?: string;
73
+ disabled?: string;
74
+ };
75
+ border?: {
76
+ default?: string;
77
+ disabled?: string;
78
+ };
79
+ outline?: string;
80
+ };
81
+ secondaryButton?: {
82
+ surface?: {
83
+ default?: string;
84
+ hover?: string;
85
+ pressed?: string;
86
+ disabled?: string;
87
+ };
88
+ border?: {
89
+ default?: string;
90
+ disabled?: string;
91
+ };
92
+ outline?: string;
93
+ };
94
+ divider?: string;
95
+ spinner?: {
96
+ path?: string;
97
+ circle?: string;
98
+ };
99
+ pill?: {
100
+ text?: string;
101
+ container?: {
102
+ background?: string;
103
+ border?: string;
104
+ };
105
+ };
106
+ progressIndicator?: {
107
+ active?: string;
108
+ next?: string;
109
+ previous?: string;
110
+ };
111
+ qr?: {
112
+ fill?: string;
113
+ background?: string;
114
+ border?: string;
115
+ };
116
+ slideButton?: {
117
+ slider?: {
118
+ background?: string;
119
+ border?: string;
120
+ text?: string;
121
+ container?: {
122
+ start?: {
123
+ background?: string;
124
+ border?: string;
125
+ };
126
+ end?: {
127
+ background?: string;
128
+ border?: string;
129
+ };
130
+ };
131
+ };
132
+ start?: {
133
+ text?: string;
134
+ };
135
+ end?: {
136
+ text?: string;
137
+ };
138
+ };
139
+ alert?: {
140
+ surface?: {
141
+ error?: string;
142
+ };
143
+ border?: {
144
+ error?: string;
145
+ };
146
+ };
147
+ }
@@ -0,0 +1,2 @@
1
+ import { Theme } from '../../interface';
2
+ export declare const generateBorderRadii: ({ borderRadius }: Pick<Theme, 'borderRadius'>) => void;
@@ -0,0 +1,2 @@
1
+ import { Theme } from '../../interface';
2
+ export declare const generateFont: ({ font, customFontSizes }: Pick<Theme, 'font' | 'customFontSizes'>) => void;
@@ -0,0 +1,7 @@
1
+ import { Theme } from '../../interface';
2
+ export type Palette = {
3
+ foregroundColors: string[];
4
+ backgroundColors: string[];
5
+ isDarkBackground: boolean;
6
+ };
7
+ export declare const generatePalette: ({ foregroundColor, backgroundColor, customPalette }: Pick<Theme, 'foregroundColor' | 'backgroundColor' | 'customPalette'>) => Palette;
@@ -0,0 +1,2 @@
1
+ import { Theme } from '../../interface';
2
+ export declare const generateTheme: ({ foregroundColor, backgroundColor, font, customPalette, borderRadius, customFontSizes, }: Theme) => boolean;
@@ -0,0 +1,5 @@
1
+ import { CustomPalette } from '../../interface';
2
+ export declare const isColor: (strColor: any) => boolean;
3
+ export declare const getCssColors: (customPalette: CustomPalette) => {
4
+ [k: string]: string;
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usecapsule/core-components",
3
- "version": "1.0.13",
3
+ "version": "2.0.0-dev.dropdown",
4
4
  "description": "Capsule Core Components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -27,7 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@stencil/core": "^4.7.0",
30
+ "color2k": "^2.0.3",
30
31
  "gsap": "^3.12.5",
32
+ "lottie-web": "^5.12.2",
31
33
  "qr-code-styling": "^1.6.0-rc.1"
32
34
  },
33
35
  "devDependencies": {
@@ -43,9 +45,9 @@
43
45
  "jest": "^29.7.0",
44
46
  "jest-cli": "^29.7.0",
45
47
  "puppeteer": "^21.9.0",
48
+ "rollup-plugin-dotenv": "^0.5.0",
46
49
  "sass": "^1.71.1",
47
50
  "stencil-inline-svg": "^1.1.0",
48
51
  "ts-node": "^10.9.2"
49
- },
50
- "gitHead": "09410910d0605605fadb4e0afaf4f9d6c494a252"
52
+ }
51
53
  }