@usecapsule/core-components 3.3.0-dev.2 → 3.3.0-dev.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. package/css/capsule-core.css +25 -10
  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-0e558c7f.entry.js +10 -0
  8. package/dist/capsule/{p-05cb769b.entry.js.map → p-0e558c7f.entry.js.map} +1 -1
  9. package/dist/capsule/{p-69c3c53b.entry.js → p-1bd11889.entry.js} +2 -2
  10. package/dist/capsule/{p-69c3c53b.entry.js.map → p-1bd11889.entry.js.map} +1 -1
  11. package/dist/capsule/p-32cdf894.entry.js +2 -0
  12. package/dist/capsule/p-32cdf894.entry.js.map +1 -0
  13. package/dist/capsule/p-3b042fd1.entry.js +2 -0
  14. package/dist/capsule/p-5965b15e.entry.js +2 -0
  15. package/dist/capsule/{p-c1aa1ffb.entry.js.map → p-5965b15e.entry.js.map} +1 -1
  16. package/dist/capsule/{p-742bda0b.entry.js → p-5d62e610.entry.js} +2 -2
  17. package/dist/capsule/p-60508b1e.entry.js +20 -0
  18. package/dist/capsule/p-60508b1e.entry.js.map +1 -0
  19. package/dist/cjs/capsule.cjs.js +1 -1
  20. package/dist/cjs/{cpsl-alert_33.cjs.entry.js → cpsl-alert_34.cjs.entry.js} +17028 -13461
  21. package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +1 -0
  22. package/dist/cjs/cpsl-animation.cjs.entry.js +3 -2
  23. package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -1
  24. package/dist/cjs/cpsl-hero.cjs.entry.js +9 -6
  25. package/dist/cjs/cpsl-hero.cjs.entry.js.map +1 -1
  26. package/dist/cjs/cpsl-identicon.cjs.entry.js +1 -1
  27. package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
  28. package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
  29. package/dist/cjs/cpsl-modal-v2.cjs.entry.js +1 -1
  30. package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -1
  31. package/dist/cjs/cpsl-row.cjs.entry.js +1 -1
  32. package/dist/cjs/index-65f57499.js +2 -2
  33. package/dist/cjs/index.cjs.js +35 -12
  34. package/dist/cjs/index.cjs.js.map +1 -1
  35. package/dist/cjs/loader.cjs.js +1 -1
  36. package/dist/collection/assets/icons/arrow-circle-broken-down-left.svg +3 -0
  37. package/dist/collection/assets/icons/bank.svg +3 -0
  38. package/dist/collection/assets/icons/credit-card.svg +3 -0
  39. package/dist/collection/assets/icons/dot.svg +3 -0
  40. package/dist/collection/assets/icons/download.svg +3 -0
  41. package/dist/collection/assets/icons/globe.svg +3 -0
  42. package/dist/collection/assets/icons/hero-alert-circle.svg +3 -0
  43. package/dist/collection/assets/icons/hero-checkmark-capsule.svg +11 -0
  44. package/dist/collection/assets/icons/hero-checkmark.svg +3 -0
  45. package/dist/collection/assets/icons/hero-external-connection.svg +71 -0
  46. package/dist/collection/assets/icons/index.js +21 -1
  47. package/dist/collection/assets/icons/index.js.map +1 -1
  48. package/dist/collection/assets/icons/link-external.svg +3 -0
  49. package/dist/collection/assets/icons/log-out.svg +3 -0
  50. package/dist/collection/assets/icons/moonpay-brand.svg +10 -0
  51. package/dist/collection/assets/icons/puzzle-piece.svg +3 -0
  52. package/dist/collection/assets/icons/qr-code-02.svg +3 -0
  53. package/dist/collection/assets/icons/qr-code.svg +3 -0
  54. package/dist/collection/assets/icons/refresh.svg +3 -3
  55. package/dist/collection/assets/icons/search.svg +3 -0
  56. package/dist/collection/assets/icons/send.svg +3 -0
  57. package/dist/collection/assets/icons/shield.svg +3 -0
  58. package/dist/collection/assets/icons/stripe-brand.svg +3 -0
  59. package/dist/collection/collection-manifest.json +2 -1
  60. package/dist/collection/components/cpsl-alert/cpsl-alert.js +2 -2
  61. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  62. package/dist/collection/components/{cpsl-modal/cpsl-modal.css → cpsl-auth-modal/cpsl-auth-modal.css} +33 -58
  63. package/dist/collection/components/{cpsl-modal/cpsl-modal.js → cpsl-auth-modal/cpsl-auth-modal.js} +11 -129
  64. package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.js.map +1 -0
  65. package/dist/collection/components/cpsl-button/cpsl-button.css +89 -2
  66. package/dist/collection/components/cpsl-button/cpsl-button.js +6 -5
  67. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  68. package/dist/collection/components/cpsl-button/cpsl-button.stories.js.map +1 -1
  69. package/dist/collection/components/cpsl-card/cpsl-card.css +5 -2
  70. package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +3 -0
  71. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +11 -7
  72. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
  73. package/dist/collection/components/cpsl-divider/cpsl-divider.css +2 -1
  74. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +1 -1
  75. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
  76. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +2 -2
  77. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
  78. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +1 -6
  79. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
  80. package/dist/collection/components/cpsl-hero/cpsl-hero.css +136 -71
  81. package/dist/collection/components/cpsl-hero/cpsl-hero.js +63 -9
  82. package/dist/collection/components/cpsl-hero/cpsl-hero.js.map +1 -1
  83. package/dist/collection/components/cpsl-icon/cpsl-icon.css +8 -0
  84. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  85. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.css +97 -0
  86. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js +121 -0
  87. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js.map +1 -0
  88. package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +1 -1
  89. package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -2
  90. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  91. package/dist/collection/components/cpsl-input/cpsl-input.css +21 -2
  92. package/dist/collection/components/cpsl-input/cpsl-input.js +100 -28
  93. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  94. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +1 -1
  95. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js.map +1 -1
  96. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +1 -1
  97. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +1 -1
  98. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
  99. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  100. package/dist/collection/components/cpsl-popover/cpsl-popover.css +2 -0
  101. package/dist/collection/components/cpsl-popover/cpsl-popover.js +9 -11
  102. package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -1
  103. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +12 -3
  104. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +28 -23
  105. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js.map +1 -1
  106. package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
  107. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  108. package/dist/collection/components/cpsl-select/cpsl-select.css +17 -0
  109. package/dist/collection/components/cpsl-select/cpsl-select.js +95 -5
  110. package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -1
  111. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +1 -1
  112. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js.map +1 -1
  113. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  114. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js.map +1 -1
  115. package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +30 -8
  116. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +5 -7
  117. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js.map +1 -1
  118. package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
  119. package/dist/collection/components/cpsl-tab/cpsl-tab.css +24 -1
  120. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  121. package/dist/collection/components/cpsl-tab/cpsl-tab.js.map +1 -1
  122. package/dist/collection/components/cpsl-table/cpsl-table.js +1 -9
  123. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
  124. package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +1 -4
  125. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +1 -4
  126. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
  127. package/dist/collection/components/cpsl-text/cpsl-text.css +19 -0
  128. package/dist/collection/components/cpsl-text/cpsl-text.js +5 -4
  129. package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
  130. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +3 -1
  131. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  132. package/dist/collection/interface.js.map +1 -1
  133. package/dist/collection/utils/theme/generateBorderRadii.js +4 -3
  134. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  135. package/dist/collection/utils/theme/generatePalette.js +22 -6
  136. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  137. package/dist/collection/utils/theme/generateTheme.js +9 -3
  138. package/dist/collection/utils/theme/generateTheme.js.map +1 -1
  139. package/dist/collection/utils/theme/utils.js.map +1 -1
  140. package/dist/esm/capsule.js +1 -1
  141. package/dist/esm/{cpsl-alert_33.entry.js → cpsl-alert_34.entry.js} +17029 -13463
  142. package/dist/esm/cpsl-alert_34.entry.js.map +1 -0
  143. package/dist/esm/cpsl-animation.entry.js +2 -1
  144. package/dist/esm/cpsl-animation.entry.js.map +1 -1
  145. package/dist/esm/cpsl-hero.entry.js +10 -7
  146. package/dist/esm/cpsl-hero.entry.js.map +1 -1
  147. package/dist/esm/cpsl-identicon.entry.js +1 -1
  148. package/dist/esm/cpsl-info-box.entry.js +2 -2
  149. package/dist/esm/cpsl-info-box.entry.js.map +1 -1
  150. package/dist/esm/cpsl-modal-v2.entry.js +1 -1
  151. package/dist/esm/cpsl-modal-v2.entry.js.map +1 -1
  152. package/dist/esm/cpsl-row.entry.js +1 -1
  153. package/dist/esm/index-91db3414.js +2 -2
  154. package/dist/esm/index.js +35 -12
  155. package/dist/esm/index.js.map +1 -1
  156. package/dist/esm/loader.js +1 -1
  157. package/dist/types/assets/icons/index.d.ts +20 -0
  158. package/dist/types/components/{cpsl-modal/cpsl-modal.d.ts → cpsl-auth-modal/cpsl-auth-modal.d.ts} +3 -23
  159. package/dist/types/components/cpsl-button/cpsl-button.d.ts +2 -2
  160. package/dist/types/components/cpsl-hero/cpsl-hero.d.ts +18 -3
  161. package/dist/types/components/cpsl-icon-group/cpsl-icon-group.d.ts +20 -0
  162. package/dist/types/components/cpsl-input/cpsl-input.d.ts +13 -3
  163. package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +2 -2
  164. package/dist/types/components/cpsl-qr-code/cpsl-qr-code.d.ts +1 -0
  165. package/dist/types/components/cpsl-select/cpsl-select.d.ts +22 -1
  166. package/dist/types/components/cpsl-text/cpsl-text.d.ts +1 -1
  167. package/dist/types/components.d.ts +222 -146
  168. package/dist/types/interface.d.ts +13 -0
  169. package/dist/types/utils/theme/generateBorderRadii.d.ts +1 -1
  170. package/dist/types/utils/theme/generatePalette.d.ts +4 -2
  171. package/dist/types/utils/theme/generateTheme.d.ts +1 -1
  172. package/package.json +3 -2
  173. package/dist/capsule/p-0462f723.js +0 -2
  174. package/dist/capsule/p-0462f723.js.map +0 -1
  175. package/dist/capsule/p-05cb769b.entry.js +0 -10
  176. package/dist/capsule/p-0eea90f8.entry.js +0 -2
  177. package/dist/capsule/p-4203888d.entry.js +0 -29
  178. package/dist/capsule/p-4203888d.entry.js.map +0 -1
  179. package/dist/capsule/p-c1aa1ffb.entry.js +0 -2
  180. package/dist/capsule/p-d351f076.entry.js +0 -2
  181. package/dist/capsule/p-d351f076.entry.js.map +0 -1
  182. package/dist/cjs/_commonjsHelpers-b3309d7b.js +0 -12
  183. package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
  184. package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +0 -1
  185. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +0 -1
  186. package/dist/esm/_commonjsHelpers-1789f0cf.js +0 -9
  187. package/dist/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
  188. package/dist/esm/cpsl-alert_33.entry.js.map +0 -1
  189. /package/dist/capsule/{p-0eea90f8.entry.js.map → p-3b042fd1.entry.js.map} +0 -0
  190. /package/dist/capsule/{p-742bda0b.entry.js.map → p-5d62e610.entry.js.map} +0 -0
@@ -54,29 +54,15 @@
54
54
  * }
55
55
  */
56
56
  :host {
57
- --container-width: 360px;
58
- --container-gap: 16px;
59
- --container-border-radius: var(--cpsl-border-radius-modal);
60
- --container-border-width: 1px;
61
- --container-border-color: var(--cpsl-color-modal-border);
62
- --container-background-color: var(--cpsl-color-modal-surface-footer);
63
- --container-padding-bottom: 16px;
64
- --container-box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.12);
65
- --inner-container-background-color: var(--cpsl-color-modal-surface-main);
66
- --inner-container-border-radius: var(--cpsl-border-radius-modal);
67
- --inner-container-box-shadow: 0px 1px 2px 0px var(--cpsl-color-alpha-black-8);
68
- --inner-container-padding-top: 16px;
69
- --inner-container-padding-end: 16px;
70
- --inner-container-padding-bottom: 24px;
71
- --inner-container-padding-start: 16px;
72
- --inner-container-margin-bottom: 16px;
57
+ --container-width: 560px;
58
+ --container-gap: 8px;
73
59
  display: block;
74
- z-index: 10005;
60
+ z-index: 10011;
75
61
  position: relative;
76
62
  }
77
63
 
78
64
  :host cpsl-overlay {
79
- z-index: 10005;
65
+ z-index: 10011;
80
66
  }
81
67
 
82
68
  @media (max-width: 480px) {
@@ -93,21 +79,21 @@
93
79
  border-bottom-left-radius: 0px;
94
80
  border-bottom-right-radius: 0px;
95
81
  }
82
+ :host(.include-mobile-styling) .modal-body-card {
83
+ --card-border-radius-bl: 0px;
84
+ --card-border-radius-br: 0px;
85
+ }
96
86
  }
97
87
 
98
88
  :host(.no-overlay) {
99
89
  z-index: 0;
100
90
  }
101
-
102
- .modal-header {
103
- position: sticky;
104
- top: 0;
105
- padding-top: var(--inner-container-padding-top);
106
- background: var(--inner-container-background-color);
91
+ :host(.no-overlay) .modal-body-card {
92
+ --card-border-width: 1px;
107
93
  }
108
94
 
109
95
  .modal-wrapper {
110
- z-index: 10005;
96
+ z-index: 10011;
111
97
  position: fixed;
112
98
  top: 0;
113
99
  left: 0;
@@ -124,19 +110,10 @@
124
110
  .modal-container {
125
111
  position: relative;
126
112
  overflow: hidden;
127
- -webkit-padding-start: var(--container-padding-start);
128
- padding-inline-start: var(--container-padding-start);
129
- -webkit-padding-end: var(--container-padding-end);
130
- padding-inline-end: var(--container-padding-end);
131
- padding-top: var(--container-padding-top);
132
- padding-bottom: var(--container-padding-bottom);
133
113
  width: var(--container-width);
134
114
  display: flex;
135
115
  flex-direction: column;
136
- border: var(--container-border-width) solid var(--container-border-color);
137
- border-radius: var(--container-border-radius);
138
- box-shadow: var(--container-box-shadow);
139
- background: var(--container-background-color);
116
+ gap: var(--container-gap);
140
117
  max-width: 95vw;
141
118
  max-height: 95vh;
142
119
  max-height: 95dvh;
@@ -148,35 +125,33 @@
148
125
  .modal-container ::-webkit-scrollbar {
149
126
  display: none;
150
127
  }
151
-
152
- .modal-inner-container {
153
- -webkit-padding-start: var(--inner-container-padding-start);
154
- padding-inline-start: var(--inner-container-padding-start);
155
- -webkit-padding-end: var(--inner-container-padding-end);
156
- padding-inline-end: var(--inner-container-padding-end);
157
- padding-top: 0;
158
- padding-bottom: var(--inner-container-padding-bottom);
159
- margin-bottom: var(--inner-container-margin-bottom);
160
- border-radius: var(--inner-container-border-radius);
161
- box-shadow: var(--inner-container-box-shadow);
162
- background: var(--inner-container-background-color);
128
+ .modal-container.no-footer {
129
+ gap: 0px;
163
130
  }
164
131
 
165
- .expanded {
166
- height: 0px;
167
- overflow: hidden;
168
- display: none;
132
+ .modal-body-card {
133
+ --card-padding-top: 16px;
134
+ --card-padding-bottom: 16px;
135
+ --card-padding-start: 16px;
136
+ --card-padding-end: 16px;
137
+ --card-border-width: 0px;
138
+ box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.08);
169
139
  }
170
140
 
171
- .modal-inner-container.no-footer {
172
- margin-bottom: 0px;
173
- box-shadow: none;
141
+ .no-opacity {
142
+ opacity: 0;
174
143
  }
175
144
 
176
- .modal-container.no-footer {
177
- padding-bottom: 0px;
145
+ .mobile-footer {
146
+ margin-top: 16px;
178
147
  }
179
148
 
180
- .no-opacity {
181
- opacity: 0;
149
+ .footer-hidden {
150
+ height: 0px;
151
+ visibility: hidden;
152
+ --card-padding-top: 0px;
153
+ --card-padding-bottom: 0px;
154
+ --card-padding-start: 0px;
155
+ --card-padding-end: 0px;
156
+ --card-border-width: 0px;
182
157
  }
@@ -1,26 +1,17 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import gsap from "gsap";
3
- import Draggable from "gsap/Draggable";
4
3
  import { MOBILE_SIZE } from "../../constants";
5
- gsap.registerPlugin(Draggable);
6
4
  const mm = gsap.matchMedia();
7
- export class CpslModal {
5
+ export class CpslAuthModal {
8
6
  constructor() {
9
- this.getDraggableHeight = () => {
10
- return this.innerContainerEl.clientHeight;
11
- };
12
7
  this.hasFooter = undefined;
8
+ this.isMobile = undefined;
13
9
  this.enterTransitionDuration = 0.15;
14
10
  this.exitTransitionDuration = 0.15;
15
- this.footerExpanded = undefined;
16
- this.footerTransitionDuration = 0.15;
17
11
  this.noOverlay = undefined;
18
12
  this.open = undefined;
19
13
  this.zIndexOverride = undefined;
20
14
  }
21
- toggleHeight() {
22
- this.footerExpanded ? this.expandFooterTl.play() : this.expandFooterTl.reverse();
23
- }
24
15
  toggleModal() {
25
16
  if (this.hasAnimatedIn) {
26
17
  this.handleAnimation();
@@ -30,13 +21,12 @@ export class CpslModal {
30
21
  this.handleAnimation();
31
22
  this.hasAnimatedIn = true;
32
23
  mm.add(`(min-width: ${MOBILE_SIZE + 1}px)`, () => {
33
- var _a;
34
- (_a = this.draggable) === null || _a === void 0 ? void 0 : _a.disable();
35
24
  gsap.timeline({}).set(this.modalWrapperEl, { yPercent: 0, scale: this.open ? 1 : 0.8, opacity: this.open ? 1 : 0 });
25
+ this.isMobile = false;
36
26
  });
37
27
  mm.add(`(max-width: ${MOBILE_SIZE}px)`, () => {
38
- this.initDraggable();
39
28
  gsap.timeline({}).set(this.modalWrapperEl, { scale: 1, opacity: 1, yPercent: this.open ? -100 : 0 });
29
+ this.isMobile = true;
40
30
  });
41
31
  this.hasFooter = this.footerSlotEl.assignedNodes().length >= 1;
42
32
  this.footerSlotEl.addEventListener('slotchange', () => {
@@ -57,7 +47,6 @@ export class CpslModal {
57
47
  this.cpslModalEntering.emit();
58
48
  },
59
49
  onComplete: () => {
60
- this.addExpandAnim();
61
50
  this.cpslModalEntered.emit();
62
51
  },
63
52
  })
@@ -75,7 +64,6 @@ export class CpslModal {
75
64
  this.cpslModalEntering.emit();
76
65
  },
77
66
  onComplete: () => {
78
- this.addExpandAnim();
79
67
  this.cpslModalEntered.emit();
80
68
  },
81
69
  })
@@ -125,89 +113,20 @@ export class CpslModal {
125
113
  }
126
114
  }
127
115
  }
128
- addExpandAnim() {
129
- setTimeout(() => {
130
- this.expandFooterTl = gsap
131
- .timeline({
132
- reversed: true,
133
- paused: true,
134
- onReverseComplete: () => {
135
- this.contentEl.style.setProperty('height', 'auto');
136
- },
137
- defaults: {
138
- duration: this.footerTransitionDuration,
139
- },
140
- })
141
- .set(this.footerExpandedEl, { overflow: 'auto', display: 'block' })
142
- .set(this.headerExpandedEl, { display: 'block' })
143
- .to(this.innerContainerEl, { paddingBottom: '8px' })
144
- .to(this.contentEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')
145
- .to(this.footerEl, { height: '0px', overflow: 'hidden', opacity: 0 }, '<')
146
- .to(this.footerExpandedEl, { height: 'auto', opacity: 1 }, '<')
147
- .to(this.headerExpandedEl, { height: 'auto', opacity: 1 }, '<');
148
- }, 10);
149
- }
150
- initDraggable() {
151
- this.draggable = Draggable.create(this.modalContainerEl, {
152
- trigger: this.headerEl,
153
- dragClickables: false,
154
- type: 'y',
155
- edgeResistance: 0.2,
156
- liveSnap: {
157
- y: function (y) {
158
- if (y < 0)
159
- return 0; // Restricts dragging to down
160
- return y;
161
- },
162
- },
163
- onDrag: () => {
164
- const y = gsap.utils.mapRange(0, this.getDraggableHeight(), 1, 0, this.draggable.y);
165
- gsap.set(this.overlayEl, { opacity: y });
166
- },
167
- onDragEnd: () => {
168
- if (this.draggable.y > 60) {
169
- this.cpslModalRequestClose.emit();
170
- }
171
- else {
172
- gsap.set(this.overlayEl, { opacity: 1 });
173
- gsap.set(this.modalWrapperEl, { yPercent: -100 });
174
- gsap.set(this.modalContainerEl, { y: 0 });
175
- }
176
- },
177
- })[0];
178
- }
179
116
  get footerEl() {
180
117
  return this.el.shadowRoot.getElementById('modal-footer');
181
118
  }
182
- get footerExpandedEl() {
183
- return this.el.shadowRoot.getElementById('modal-footer-expanded');
184
- }
185
- get headerExpandedEl() {
186
- return this.el.shadowRoot.getElementById('modal-header-expanded');
187
- }
188
- get innerContainerEl() {
189
- return this.el.shadowRoot.getElementById('modal-inner-container');
190
- }
191
- get contentEl() {
192
- return this.el.shadowRoot.getElementById('modal-content');
193
- }
194
119
  get modalWrapperEl() {
195
120
  return this.el.shadowRoot.getElementById('modal-wrapper');
196
121
  }
197
122
  get modalContainerEl() {
198
123
  return this.el.shadowRoot.getElementById('modal-container');
199
124
  }
200
- get overlayEl() {
201
- return this.el.shadowRoot.getElementById('overlay');
202
- }
203
125
  get footerSlotEl() {
204
126
  return this.footerEl.querySelectorAll('slot')[0];
205
127
  }
206
- get headerEl() {
207
- return this.el.shadowRoot.getElementById('modal-header');
208
- }
209
128
  get Modal() {
210
- return (h("div", { class: { 'modal-container': true, 'no-footer': !this.hasFooter }, part: "modal-container", id: "modal-container" }, h("slot", null), h("div", { id: "modal-inner-container", class: { 'modal-inner-container': true, 'no-footer': !this.hasFooter }, part: "modal-inner-container" }, h("div", { id: "modal-content", part: "modal-content" }, h("div", { id: "modal-header", class: "modal-header", part: "modal-header" }, h("slot", { name: "header" })), h("div", { id: "modal-body", class: "modal-body", part: "modal-body" }, h("slot", { name: "body" }))), h("div", { id: "modal-header-expanded", class: { 'modal-header': true, 'expanded': true, 'no-opacity': true }, part: "modal-header-expanded" }, h("slot", { name: "footerExpandedHeader" }))), h("div", { id: "modal-footer", part: "modal-footer" }, h("slot", { name: "footer" })), h("div", { id: "modal-footer-expanded", class: { 'expanded': true, 'no-opacity': true }, part: "modal-footer-expanded" }, h("slot", { name: "footerExpandedFooter" }))));
129
+ return (h("div", { class: { 'modal-container': true, 'no-footer': !this.hasFooter }, part: "modal-container", id: "modal-container" }, h("cpsl-card", { id: "modal-body-card", class: { 'modal-body-card': true }, part: "modal-body-card" }, h("slot", { name: "body" }), this.isMobile && (h("div", { class: "mobile-footer" }, h("slot", { name: "footer" })))), h("cpsl-card", { id: "modal-footer", part: "modal-footer", class: { 'footer-hidden': !this.hasFooter, 'modal-body-card': true }, style: { display: !this.isMobile ? 'block' : 'none' } }, h("slot", { name: "footer" }))));
211
130
  }
212
131
  render() {
213
132
  if (this.noOverlay) {
@@ -215,16 +134,16 @@ export class CpslModal {
215
134
  }
216
135
  return (h(Host, { style: this.zIndexOverride ? { zIndex: `${this.zIndexOverride}` } : {}, class: { 'include-mobile-styling': true } }, h("cpsl-overlay", { zIndexOverride: this.zIndexOverride ? this.zIndexOverride : undefined, id: "overlay", open: this.open, enterTransitionDuration: this.enterTransitionDuration, exitTransitionDuration: this.exitTransitionDuration }), h("div", { id: "modal-wrapper", class: "modal-wrapper" }, this.Modal)));
217
136
  }
218
- static get is() { return "cpsl-modal"; }
137
+ static get is() { return "cpsl-auth-modal"; }
219
138
  static get encapsulation() { return "shadow"; }
220
139
  static get originalStyleUrls() {
221
140
  return {
222
- "$": ["cpsl-modal.scss"]
141
+ "$": ["cpsl-auth-modal.scss"]
223
142
  };
224
143
  }
225
144
  static get styleUrls() {
226
145
  return {
227
- "$": ["cpsl-modal.css"]
146
+ "$": ["cpsl-auth-modal.css"]
228
147
  };
229
148
  }
230
149
  static get properties() {
@@ -265,41 +184,6 @@ export class CpslModal {
265
184
  "reflect": false,
266
185
  "defaultValue": "0.15"
267
186
  },
268
- "footerExpanded": {
269
- "type": "boolean",
270
- "mutable": false,
271
- "complexType": {
272
- "original": "boolean",
273
- "resolved": "boolean",
274
- "references": {}
275
- },
276
- "required": false,
277
- "optional": true,
278
- "docs": {
279
- "tags": [],
280
- "text": "Whether or not to show `footerExpandedFooter` and `footerExpandedHeader` slots."
281
- },
282
- "attribute": "footer-expanded",
283
- "reflect": false
284
- },
285
- "footerTransitionDuration": {
286
- "type": "number",
287
- "mutable": false,
288
- "complexType": {
289
- "original": "number",
290
- "resolved": "number",
291
- "references": {}
292
- },
293
- "required": false,
294
- "optional": true,
295
- "docs": {
296
- "tags": [],
297
- "text": "Duration in seconds of the footer expansion animation.\nDefault is 0.15."
298
- },
299
- "attribute": "footer-transition-duration",
300
- "reflect": false,
301
- "defaultValue": "0.15"
302
- },
303
187
  "noOverlay": {
304
188
  "type": "boolean",
305
189
  "mutable": false,
@@ -355,7 +239,8 @@ export class CpslModal {
355
239
  }
356
240
  static get states() {
357
241
  return {
358
- "hasFooter": {}
242
+ "hasFooter": {},
243
+ "isMobile": {}
359
244
  };
360
245
  }
361
246
  static get events() {
@@ -439,12 +324,9 @@ export class CpslModal {
439
324
  static get elementRef() { return "el"; }
440
325
  static get watchers() {
441
326
  return [{
442
- "propName": "footerExpanded",
443
- "methodName": "toggleHeight"
444
- }, {
445
327
  "propName": "open",
446
328
  "methodName": "toggleModal"
447
329
  }];
448
330
  }
449
331
  }
450
- //# sourceMappingURL=cpsl-modal.js.map
332
+ //# sourceMappingURL=cpsl-auth-modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-auth-modal.js","sourceRoot":"","sources":["../../../../src/components/cpsl-auth-modal/cpsl-auth-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACrG,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;AAM7B,MAAM,OAAO,aAAa;;;;uCAYmB,IAAI;sCAML,IAAI;;;;;IA2C9C,WAAW;QACT,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAE1B,EAAE,CAAC,GAAG,CAAC,eAAe,WAAW,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE;YAC/C,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC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ACE,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,EACrE,EAAE,EAAC,SAAS,EACZ,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EACrD,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,GACnD;YACF,WAAK,EAAE,EAAC,eAAe,EAAC,KAAK,EAAC,eAAe,IAC1C,IAAI,CAAC,KAAK,CACP,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, Watch, h, Event, EventEmitter } from '@stencil/core';\nimport gsap from 'gsap';\nimport { MOBILE_SIZE } from '../../constants';\n\nconst mm = gsap.matchMedia();\n@Component({\n tag: 'cpsl-auth-modal',\n styleUrl: 'cpsl-auth-modal.scss',\n shadow: true,\n})\nexport class CpslAuthModal {\n private hasAnimatedIn: boolean;\n\n @Element() el!: HTMLCpslAuthModalElement;\n\n @State() hasFooter: boolean;\n @State() isMobile: boolean;\n\n /**\n * Duration in seconds of the modal entering.\n * Default is .15.\n */\n @Prop() enterTransitionDuration?: number = 0.15;\n\n /**\n * Duration in seconds of the modal exiting.\n * Default is .15.\n */\n @Prop() exitTransitionDuration?: number = 0.15;\n\n /**\n * Whether or not to show the overlay. This will always show the modal, regardless of the value of `open`.\n */\n @Prop() noOverlay?: boolean;\n\n /**\n * Whether or not to show the modal.\n */\n @Prop() open: boolean;\n\n /**\n * Emitted when enter animation starts.\n */\n @Event() cpslModalEntering!: EventEmitter<null>;\n\n /**\n * Emitted when enter animation finishes.\n */\n @Event() cpslModalEntered!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation starts.\n */\n @Event() cpslModalExiting!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalExited!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalRequestClose!: EventEmitter<null>;\n\n /**\n * Override z-index.\n */\n @Prop() zIndexOverride?: number;\n\n @Watch('open')\n toggleModal() {\n if (this.hasAnimatedIn) {\n this.handleAnimation();\n }\n }\n\n componentDidLoad() {\n this.handleAnimation();\n this.hasAnimatedIn = true;\n\n mm.add(`(min-width: ${MOBILE_SIZE + 1}px)`, () => {\n gsap.timeline({}).set(this.modalWrapperEl, { yPercent: 0, scale: this.open ? 1 : 0.8, opacity: this.open ? 1 : 0 });\n this.isMobile = false;\n });\n mm.add(`(max-width: ${MOBILE_SIZE}px)`, () => {\n gsap.timeline({}).set(this.modalWrapperEl, { scale: 1, opacity: 1, yPercent: this.open ? -100 : 0 });\n this.isMobile = true;\n });\n\n this.hasFooter = this.footerSlotEl.assignedNodes().length >= 1;\n this.footerSlotEl.addEventListener('slotchange', () => {\n if (this.footerSlotEl.assignedNodes().length >= 1) {\n this.hasFooter = true;\n } else {\n this.hasFooter = false;\n }\n });\n }\n\n private handleAnimation() {\n if (this.open) {\n if (window.innerWidth >= MOBILE_SIZE + 1) {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalEntering.emit();\n },\n onComplete: () => {\n this.cpslModalEntered.emit();\n },\n })\n .set(this.modalWrapperEl, { display: 'flex', yPercent: 0 })\n .to(this.modalWrapperEl, {\n scale: 1,\n opacity: 1,\n duration: this.enterTransitionDuration,\n });\n } else {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalEntering.emit();\n },\n onComplete: () => {\n this.cpslModalEntered.emit();\n },\n })\n .set(this.modalWrapperEl, { display: 'flex', scale: 1, opacity: 1 })\n .to(this.modalWrapperEl, {\n yPercent: -100,\n duration: this.enterTransitionDuration,\n });\n }\n } else {\n if (window.innerWidth >= MOBILE_SIZE + 1) {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalExiting.emit();\n },\n onComplete: () => {\n this.cpslModalExited.emit();\n this.modalWrapperEl?.style.setProperty('display', 'none');\n },\n })\n .to(this.modalWrapperEl, {\n scale: 0.8,\n opacity: 0,\n duration: this.exitTransitionDuration,\n });\n } else {\n gsap\n .timeline({\n onStart: () => {\n this.cpslModalExiting.emit();\n },\n onComplete: () => {\n this.cpslModalExited.emit();\n this.modalWrapperEl?.style.setProperty('display', 'none');\n },\n })\n .to(this.modalWrapperEl, {\n yPercent: 0,\n duration: this.exitTransitionDuration,\n })\n .set(this.modalContainerEl, { y: 0 });\n }\n }\n }\n\n private get footerEl() {\n return this.el.shadowRoot.getElementById('modal-footer');\n }\n\n private get modalWrapperEl() {\n return this.el.shadowRoot.getElementById('modal-wrapper');\n }\n\n private get modalContainerEl() {\n return this.el.shadowRoot.getElementById('modal-container');\n }\n\n private get footerSlotEl() {\n return this.footerEl.querySelectorAll('slot')[0];\n }\n\n private get Modal() {\n return (\n <div class={{ 'modal-container': true, 'no-footer': !this.hasFooter }} part=\"modal-container\" id=\"modal-container\">\n <cpsl-card id=\"modal-body-card\" class={{ 'modal-body-card': true }} part=\"modal-body-card\">\n <slot name=\"body\"></slot>\n {this.isMobile && (\n <div class=\"mobile-footer\">\n <slot name=\"footer\"></slot>\n </div>\n )}\n </cpsl-card>\n <cpsl-card\n id=\"modal-footer\"\n part=\"modal-footer\"\n class={{ 'footer-hidden': !this.hasFooter, 'modal-body-card': true }}\n style={{ display: !this.isMobile ? 'block' : 'none' }}\n >\n <slot name=\"footer\"></slot>\n </cpsl-card>\n </div>\n );\n }\n\n render() {\n if (this.noOverlay) {\n return (\n <Host style={this.zIndexOverride ? { zIndex: `${this.zIndexOverride}` } : {}} class=\"no-overlay\">\n {this.Modal}\n </Host>\n );\n }\n\n return (\n <Host style={this.zIndexOverride ? { zIndex: `${this.zIndexOverride}` } : {}} class={{ 'include-mobile-styling': true }}>\n <cpsl-overlay\n zIndexOverride={this.zIndexOverride ? this.zIndexOverride : undefined}\n id=\"overlay\"\n open={this.open}\n enterTransitionDuration={this.enterTransitionDuration}\n exitTransitionDuration={this.exitTransitionDuration}\n />\n <div id=\"modal-wrapper\" class=\"modal-wrapper\">\n {this.Modal}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -101,6 +101,22 @@
101
101
  --button-secondary-active-background-color: var(--cpsl-color-secondary-button-surface-pressed);
102
102
  --button-secondary-active-border-color: var(--cpsl-color-secondary-button-border-default);
103
103
  --button-secondary-active-icon-color: var(--cpsl-color-secondary-button-text);
104
+ --button-tertiary-color: var(--cpsl-color-tertiary-button-text);
105
+ --button-tertiary-background-color: var(--cpsl-color-tertiary-button-surface-default);
106
+ --button-tertiary-border-color: var(--cpsl-color-tertiary-button-border-default);
107
+ --button-tertiary-icon-color: var(--cpsl-color-tertiary-button-text);
108
+ --button-tertiary-disabled-color: var(--cpsl-color-text-disabled);
109
+ --button-tertiary-disabled-background-color: var(--cpsl-color-tertiary-button-surface-disabled);
110
+ --button-tertiary-disabled-border-color: var(--cpsl-color-tertiary-button-border-disabled);
111
+ --button-tertiary-disabled-icon-color: var(--cpsl-color-tertiary-button-text);
112
+ --button-tertiary-hover-color: var(--cpsl-color-tertiary-button-text);
113
+ --button-tertiary-hover-background-color: var(--cpsl-color-tertiary-button-surface-hover);
114
+ --button-tertiary-hover-border-color: var(--cpsl-color-tertiary-button-surface-hover);
115
+ --button-tertiary-hover-icon-color: var(--cpsl-color-tertiary-button-text);
116
+ --button-tertiary-active-color: var(--cpsl-color-tertiary-button-text);
117
+ --button-tertiary-active-background-color: var(--cpsl-color-tertiary-button-surface-pressed);
118
+ --button-tertiary-active-border-color: var(--cpsl-color-tertiary-button-surface-pressed);
119
+ --button-tertiary-active-icon-color: var(--cpsl-color-tertiary-button-text);
104
120
  --button-ghost-color: var(--cpsl-color-ghost-button-default);
105
121
  --button-ghost-disabled-color: var(--cpsl-color-ghost-button-disabled);
106
122
  --button-ghost-hover-color: var(--cpsl-color-ghost-button-hover);
@@ -151,6 +167,11 @@
151
167
  --button-padding-bottom: 13px;
152
168
  }
153
169
 
170
+ :host(.small.tertiary) {
171
+ --button-padding-top: 13px;
172
+ --button-padding-bottom: 13px;
173
+ }
174
+
154
175
  :host(.medium) {
155
176
  --button-font-size: var(--cpsl-font-size-body-m);
156
177
  --button-padding-top: 14px;
@@ -161,12 +182,21 @@
161
182
  --button-padding-top: 15px;
162
183
  --button-padding-bottom: 15px;
163
184
  }
185
+ :host(.medium) :host(.tertiary) {
186
+ --button-padding-top: 15px;
187
+ --button-padding-bottom: 15px;
188
+ }
164
189
 
165
190
  :host(.medium.primary) {
166
191
  --button-padding-top: 15px;
167
192
  --button-padding-bottom: 15px;
168
193
  }
169
194
 
195
+ :host(.medium.tertiary) {
196
+ --button-padding-top: 15px;
197
+ --button-padding-bottom: 15px;
198
+ }
199
+
170
200
  :host(.disabled) {
171
201
  cursor: default;
172
202
  pointer-events: none;
@@ -198,6 +228,9 @@
198
228
  :host(.primary):host(.disabled) ::slotted(cpsl-icon) {
199
229
  --icon-color: var(--button-primary-disabled-icon-color);
200
230
  }
231
+ :host(.primary):host(.disabled) ::slotted(cpsl-spinner) {
232
+ --background-color: var(--button-primary-disabled-background-color);
233
+ }
201
234
  :host(.primary) :not(.disabled):hover {
202
235
  --button-color: var(--button-primary-hover-color);
203
236
  --button-background-color: var(--button-primary-hover-background-color);
@@ -236,6 +269,9 @@
236
269
  :host(.secondary):host(.disabled) ::slotted(cpsl-icon) {
237
270
  --icon-color: var(--button-secondary-disabled-icon-color);
238
271
  }
272
+ :host(.secondary):host(.disabled) ::slotted(cpsl-spinner) {
273
+ --background-color: var(--button-secondary-disabled-icon-color);
274
+ }
239
275
  :host(.secondary) :not(.disabled):hover {
240
276
  --button-color: var(--button-secondary-hover-color);
241
277
  --button-border-color: var(--button-secondary-hover-border-color);
@@ -256,6 +292,50 @@
256
292
  --button-outline-color: var(--cpsl-color-secondary-button-outline);
257
293
  }
258
294
 
295
+ :host(.tertiary) {
296
+ --button-border-radius: var(--cpsl-border-radius-tertiary-button);
297
+ --button-color: var(--button-tertiary-color);
298
+ --button-background-color: var(--button-tertiary-background-color);
299
+ --button-border-color: var(--button-tertiary-border-color);
300
+ --button-padding-start: 17px;
301
+ --button-padding-end: 17px;
302
+ --button-border-width: 0px;
303
+ }
304
+ :host(.tertiary) ::slotted(cpsl-icon) {
305
+ --icon-color: var(--button-tertiary-icon-color);
306
+ }
307
+ :host(.tertiary):host(.disabled) {
308
+ --button-color: var(--button-tertiary-disabled-color);
309
+ --button-background-color: var(--button-tertiary-disabled-background-color);
310
+ --button-border-color: var(--button-tertiary-disabled-border-color);
311
+ --button-outline-color: transparent;
312
+ }
313
+ :host(.tertiary):host(.disabled) ::slotted(cpsl-icon) {
314
+ --icon-color: var(--button-tertiary-disabled-icon-color);
315
+ }
316
+ :host(.tertiary):host(.disabled) ::slotted(cpsl-spinner) {
317
+ --background-color: var(--button-tertiary-disabled-icon-color);
318
+ }
319
+ :host(.tertiary) :not(.disabled):hover {
320
+ --button-color: var(--button-tertiary-hover-color);
321
+ --button-background-color: var(--button-tertiary-hover-background-color);
322
+ --button-border-color: var(--button-tertiary-hover-border-color);
323
+ }
324
+ :host(.tertiary) :not(.disabled):hover ::slotted(cpsl-icon) {
325
+ --icon-color: var(--button-tertiary-hover-icon-color);
326
+ }
327
+ :host(.tertiary) :not(.disabled):active {
328
+ --button-color: var(--button-tertiary-active-color);
329
+ --button-background-color: var(--button-tertiary-active-background-color);
330
+ --button-border-color: var(--button-tertiary-active-border-color);
331
+ }
332
+ :host(.tertiary) :not(.disabled):active ::slotted(cpsl-icon) {
333
+ --icon-color: var(--button-tertiary-active-icon-color);
334
+ }
335
+ :host(.tertiary) :not(.disabled):focus-visible {
336
+ --button-outline-color: var(--cpsl-color-tertiary-button-outline);
337
+ }
338
+
259
339
  :host(.ghost) {
260
340
  --button-color: var(--button-ghost-color);
261
341
  --button-background-color: transparent;
@@ -269,8 +349,6 @@
269
349
  }
270
350
  :host(.ghost) ::slotted(cpsl-icon) {
271
351
  --icon-color: var(--button-ghost-color);
272
- --height: var(--cpsl-font-size-body-xl);
273
- --width: var(--cpsl-font-size-body-xl);
274
352
  }
275
353
  :host(.ghost):host(.disabled) {
276
354
  --button-color: var(--button-ghost-disabled-color);
@@ -278,6 +356,9 @@
278
356
  :host(.ghost):host(.disabled) ::slotted(cpsl-icon) {
279
357
  --icon-color: var(--button-ghost-disabled-color);
280
358
  }
359
+ :host(.ghost):host(.disabled) ::slotted(cpsl-spinner) {
360
+ --background-color: var(--button-ghost-disabled-color);
361
+ }
281
362
  :host(.ghost) :not(.disabled):hover {
282
363
  --button-color: var(--button-ghost-hover-color);
283
364
  }
@@ -379,4 +460,10 @@
379
460
 
380
461
  :host ::slotted(cpsl-text) {
381
462
  color: var(--button-color);
463
+ }
464
+ :host ::slotted(cpsl-icon-group) {
465
+ --container-border-color: var(--button-background-color);
466
+ }
467
+ :host ::slotted(cpsl-spinner) {
468
+ --background-color: var(--button-background-color);
382
469
  }
@@ -10,10 +10,11 @@ export class CpslButton {
10
10
  this.variant = 'primary';
11
11
  }
12
12
  render() {
13
- return (h(Host, { key: '554350e7af597bd14c9584f9924f73e04fe44093', class: {
13
+ return (h(Host, { key: '7411754a763990dcbef83edbef353ebf3066f71d', class: {
14
14
  // VARIANTS
15
15
  'primary': this.variant === 'primary',
16
16
  'secondary': this.variant === 'secondary',
17
+ 'tertiary': this.variant === 'tertiary',
17
18
  'ghost': this.variant === 'ghost',
18
19
  'destructive': this.variant === 'destructive',
19
20
  // STATE
@@ -22,7 +23,7 @@ export class CpslButton {
22
23
  // SIZES
23
24
  'small': this.size === 'small',
24
25
  'medium': this.size === 'medium',
25
- } }, h(this.as, { key: '20b6865c03e312d263c523f681bb775d8626fc9c', href: this.href, target: this.target, part: "button-native", class: "button-native" }, h("slot", { key: '4ee8d68b06ce21288e63bfcff9aa186908b89af2', name: "start" }), h("slot", { key: '9c0a5f0daa64c75886d03fb830739c8f8cfb65d9' }), h("slot", { key: 'cf9addee55b0a0d8f487313c972d7b48d6f8c75c', name: "end" }))));
26
+ } }, h(this.as, { key: '1c49c08c3ea7a105ce6c69302e2adc2bc6a443eb', href: this.href, target: this.target, part: "button-native", class: "button-native" }, h("slot", { key: '5ef09afd70e95c9c596c46d84a8d3410a8eba2a9', name: "start" }), h("slot", { key: 'f055ad44f74ca07a612c967432714c00e4b56ba9' }), h("slot", { key: '2a53e40d635b3de4441aed9005b4bb13d42e9d04', name: "end" }))));
26
27
  }
27
28
  static get is() { return "cpsl-button"; }
28
29
  static get encapsulation() { return "shadow"; }
@@ -148,15 +149,15 @@ export class CpslButton {
148
149
  "type": "string",
149
150
  "mutable": false,
150
151
  "complexType": {
151
- "original": "'primary' | 'secondary' | 'ghost' | 'destructive'",
152
- "resolved": "\"destructive\" | \"ghost\" | \"primary\" | \"secondary\"",
152
+ "original": "'primary' | 'secondary' | 'tertiary' | 'ghost' | 'destructive'",
153
+ "resolved": "\"destructive\" | \"ghost\" | \"primary\" | \"secondary\" | \"tertiary\"",
153
154
  "references": {}
154
155
  },
155
156
  "required": false,
156
157
  "optional": true,
157
158
  "docs": {
158
159
  "tags": [],
159
- "text": "The variant of the button.\nOptions are: `\"primary\"`, `\"secondary\", `\"icon\", `\"text\"`.\nDefault is: `\"primary\"`."
160
+ "text": "The variant of the button.\nOptions are: `\"primary\"`, `\"secondary\", `\"tertiary\", `\"ghost\"`, `\"destructive\"`.\nDefault is: `\"primary\"`."
160
161
  },
161
162
  "attribute": "variant",
162
163
  "reflect": true,
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-button.js","sourceRoot":"","sources":["../../../../src/components/cpsl-button/cpsl-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,UAAU;;kBAMS,QAAQ;wBAMQ,KAAK;yBAMrB,KAAK;;oBAYC,QAAQ;;uBAY2C,SAAS;;IAEhG,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,WAAW;gBACX,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS;gBACrC,WAAW,EAAE,IAAI,CAAC,OAAO,KAAK,WAAW;gBACzC,OAAO,EAAE,IAAI,CAAC,OAAO,KAAK,OAAO;gBACjC,aAAa,EAAE,IAAI,CAAC,OAAO,KAAK,aAAa;gBAC7C,QAAQ;gBACR,UAAU,EAAE,IAAI,CAAC,QAAQ;gBACzB,YAAY,EAAE,IAAI,CAAC,SAAS;gBAC5B,QAAQ;gBACR,OAAO,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;gBAC9B,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;aACjC;YAED,EAAC,IAAI,CAAC,EAAE,qDAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,eAAe;gBACvF,6DAAM,IAAI,EAAC,OAAO,GAAQ;gBAC1B,8DAAa;gBACb,6DAAM,IAAI,EAAC,KAAK,GAAQ,CAChB,CACL,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-button',\n styleUrl: 'cpsl-button.scss',\n shadow: true,\n})\nexport class CpslButton {\n /**\n * The tag for the button.\n * Options are: `\"button\"`, `\"a\".\n * Default is: `\"button\"`.\n */\n @Prop() as?: 'button' | 'a' = 'button';\n\n /**\n * If the button is disabled.\n * Default is: false.\n */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /**\n * Whether the button takes the full width of it's container.\n * Default is: false.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * href to use when using a link.\n */\n @Prop() href?: string;\n\n /**\n * The size of the button.\n * Options are: `\"small\"`, `\"medium\".\n * Default is: `\"medium\"`.\n */\n @Prop() size?: 'small' | 'medium' = 'medium';\n\n /**\n * target to use when using a link.\n */\n @Prop() target?: string;\n\n /**\n * The variant of the button.\n * Options are: `\"primary\"`, `\"secondary\", `\"icon\", `\"text\"`.\n * Default is: `\"primary\"`.\n */\n @Prop({ reflect: true }) variant?: 'primary' | 'secondary' | 'ghost' | 'destructive' = 'primary';\n\n render() {\n return (\n <Host\n class={{\n // VARIANTS\n 'primary': this.variant === 'primary',\n 'secondary': this.variant === 'secondary',\n 'ghost': this.variant === 'ghost',\n 'destructive': this.variant === 'destructive',\n // STATE\n 'disabled': this.disabled,\n 'full-width': this.fullWidth,\n // SIZES\n 'small': this.size === 'small',\n 'medium': this.size === 'medium',\n }}\n >\n <this.as href={this.href} target={this.target} part=\"button-native\" class=\"button-native\">\n <slot name=\"start\"></slot>\n <slot></slot>\n <slot name=\"end\"></slot>\n </this.as>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cpsl-button.js","sourceRoot":"","sources":["../../../../src/components/cpsl-button/cpsl-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,UAAU;;kBAMS,QAAQ;wBAMQ,KAAK;yBAMrB,KAAK;;oBAYC,QAAQ;;uBAYwD,SAAS;;IAE7G,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,WAAW;gBACX,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS;gBACrC,WAAW,EAAE,IAAI,CAAC,OAAO,KAAK,WAAW;gBACzC,UAAU,EAAE,IAAI,CAAC,OAAO,KAAK,UAAU;gBACvC,OAAO,EAAE,IAAI,CAAC,OAAO,KAAK,OAAO;gBACjC,aAAa,EAAE,IAAI,CAAC,OAAO,KAAK,aAAa;gBAC7C,QAAQ;gBACR,UAAU,EAAE,IAAI,CAAC,QAAQ;gBACzB,YAAY,EAAE,IAAI,CAAC,SAAS;gBAC5B,QAAQ;gBACR,OAAO,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;gBAC9B,QAAQ,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;aACjC;YAED,EAAC,IAAI,CAAC,EAAE,qDAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,eAAe;gBACvF,6DAAM,IAAI,EAAC,OAAO,GAAQ;gBAC1B,8DAAa;gBACb,6DAAM,IAAI,EAAC,KAAK,GAAQ,CAChB,CACL,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-button',\n styleUrl: 'cpsl-button.scss',\n shadow: true,\n})\nexport class CpslButton {\n /**\n * The tag for the button.\n * Options are: `\"button\"`, `\"a\".\n * Default is: `\"button\"`.\n */\n @Prop() as?: 'button' | 'a' = 'button';\n\n /**\n * If the button is disabled.\n * Default is: false.\n */\n @Prop({ reflect: true }) disabled?: boolean = false;\n\n /**\n * Whether the button takes the full width of it's container.\n * Default is: false.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * href to use when using a link.\n */\n @Prop() href?: string;\n\n /**\n * The size of the button.\n * Options are: `\"small\"`, `\"medium\".\n * Default is: `\"medium\"`.\n */\n @Prop() size?: 'small' | 'medium' = 'medium';\n\n /**\n * target to use when using a link.\n */\n @Prop() target?: string;\n\n /**\n * The variant of the button.\n * Options are: `\"primary\"`, `\"secondary\", `\"tertiary\", `\"ghost\"`, `\"destructive\"`.\n * Default is: `\"primary\"`.\n */\n @Prop({ reflect: true }) variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'destructive' = 'primary';\n\n render() {\n return (\n <Host\n class={{\n // VARIANTS\n 'primary': this.variant === 'primary',\n 'secondary': this.variant === 'secondary',\n 'tertiary': this.variant === 'tertiary',\n 'ghost': this.variant === 'ghost',\n 'destructive': this.variant === 'destructive',\n // STATE\n 'disabled': this.disabled,\n 'full-width': this.fullWidth,\n // SIZES\n 'small': this.size === 'small',\n 'medium': this.size === 'medium',\n }}\n >\n <this.as href={this.href} target={this.target} part=\"button-native\" class=\"button-native\">\n <slot name=\"start\"></slot>\n <slot></slot>\n <slot name=\"end\"></slot>\n </this.as>\n </Host>\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-button.stories.js","sourceRoot":"","sources":["../../../../src/components/cpsl-button/cpsl-button.stories.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAA4C;IACpD,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE;IAC7D,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;YACD,OAAO,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,CAAC;SAC1D;QACD,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;YACD,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;SAC7B;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,M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;CAC7B,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/html';\nimport { type CpslButton } from './cpsl-button';\n\nconst meta: Meta<CpslButton & { content?: string }> = {\n title: 'Components/CpslButton',\n args: { variant: 'primary', size: 'medium', content: 'Test' },\n argTypes: {\n variant: {\n control: {\n type: 'select',\n },\n options: ['primary', 'secondary', 'ghost', 'destructive'],\n },\n size: {\n control: {\n type: 'select',\n },\n options: ['small', 'medium'],\n },\n },\n};\n\nexport default meta;\n\ntype Story = StoryFn<CpslButton & { content?: string }>;\n\nconst Template: Story = args => `<cpsl-button variant=\"${args.variant}\" size=\"${args.size}\">${args.content}</cpsl-button>`;\nconst TemplateWithIcon: Story = args =>\n `<cpsl-button variant=\"${args.variant}\" size=\"${args.size}\"><cpsl-icon icon=\"home\" slot=\"start\"></cpsl-icon>${args.content}</cpsl-button>`;\n\nexport const Primary: Story = Template.bind({});\nPrimary.args = {\n content: 'Primary',\n};\n\nexport const Secondary: Story = Template.bind({});\nSecondary.args = {\n content: 'Secondary',\n variant: 'secondary',\n};\n\nexport const Ghost: Story = Template.bind({});\nGhost.args = {\n content: 'Ghost',\n variant: 'ghost',\n};\n\nexport const Destructive: Story = Template.bind({});\nDestructive.args = {\n content: 'Destructive',\n variant: 'destructive',\n};\n\nexport const Icon: Story = TemplateWithIcon.bind({});\nIcon.args = {\n content: '',\n variant: 'ghost',\n};\n\nexport const PrimaryWithIcon: Story = TemplateWithIcon.bind({});\nPrimaryWithIcon.args = {\n content: 'Primary With Icon',\n};\n"]}
1
+ {"version":3,"file":"cpsl-button.stories.js","sourceRoot":"","sources":["../../../../src/components/cpsl-button/cpsl-button.stories.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAA4C;IACpD,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE;IAC7D,QAAQ,EAAE;QACR,OAAO,EAAE;YACP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AC,MAAM,IAAI,GAAU,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrD,IAAI,CAAC,IAAI,GAAG;IACV,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAU,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChE,eAAe,CAAC,IAAI,GAAG;IACrB,OAAO,EAAE,mBAAmB;CAC7B,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/html';\nimport { type CpslButton } from './cpsl-button';\n\nconst meta: Meta<CpslButton & { content?: string }> = {\n title: 'Components/CpslButton',\n args: { variant: 'primary', size: 'medium', content: 'Test' },\n argTypes: {\n variant: {\n control: {\n type: 'select',\n },\n options: ['primary', 'secondary', 'ghost', 'destructive'],\n },\n size: {\n control: {\n type: 'select',\n },\n options: ['small', 'medium'],\n },\n },\n};\n\nexport default meta;\n\ntype Story = StoryFn<CpslButton & { content?: string }>;\n\nconst Template: Story = args => `<cpsl-button variant=\"${args.variant}\" size=\"${args.size}\">${args.content}</cpsl-button>`;\nconst TemplateWithIcon: Story = args => `<cpsl-button variant=\"${args.variant}\" size=\"${args.size}\"><cpsl-icon icon=\"home\" slot=\"start\"></cpsl-icon>${args.content}</cpsl-button>`;\n\nexport const Primary: Story = Template.bind({});\nPrimary.args = {\n content: 'Primary',\n};\n\nexport const Secondary: Story = Template.bind({});\nSecondary.args = {\n content: 'Secondary',\n variant: 'secondary',\n};\n\nexport const Ghost: Story = Template.bind({});\nGhost.args = {\n content: 'Ghost',\n variant: 'ghost',\n};\n\nexport const Destructive: Story = Template.bind({});\nDestructive.args = {\n content: 'Destructive',\n variant: 'destructive',\n};\n\nexport const Icon: Story = TemplateWithIcon.bind({});\nIcon.args = {\n content: '',\n variant: 'ghost',\n};\n\nexport const PrimaryWithIcon: Story = TemplateWithIcon.bind({});\nPrimaryWithIcon.args = {\n content: 'Primary With Icon',\n};\n"]}