@usecapsule/core-components 2.0.9 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. package/css/capsule-core.css +54 -19
  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-415384b7.entry.js → p-0d0a0037.entry.js} +2 -2
  8. package/dist/capsule/p-4d8e4d86.entry.js +29 -0
  9. package/dist/capsule/p-4d8e4d86.entry.js.map +1 -0
  10. package/dist/capsule/p-86e48e61.js +3 -0
  11. package/dist/capsule/p-86e48e61.js.map +1 -0
  12. package/dist/capsule/p-ad14a817.entry.js +2 -0
  13. package/dist/capsule/p-b6b38e73.js +2 -0
  14. package/dist/capsule/p-b6b38e73.js.map +1 -0
  15. package/dist/capsule/p-d28b96ba.entry.js +10 -0
  16. package/dist/capsule/{p-b76350fd.entry.js.map → p-d28b96ba.entry.js.map} +1 -1
  17. package/dist/capsule/{p-4d957466.entry.js → p-fa078837.entry.js} +2 -2
  18. package/dist/capsule/{p-fa4e3c14.entry.js → p-fcead80b.entry.js} +2 -2
  19. package/dist/cjs/capsule.cjs.js +2 -2
  20. package/dist/cjs/constants-0869a780.js +29 -0
  21. package/dist/cjs/constants-0869a780.js.map +1 -0
  22. package/dist/cjs/{cpsl-alert_18.cjs.entry.js → cpsl-alert_29.cjs.entry.js} +598 -185
  23. package/dist/cjs/cpsl-alert_29.cjs.entry.js.map +1 -0
  24. package/dist/cjs/cpsl-animation.cjs.entry.js +2 -2
  25. package/dist/cjs/cpsl-col.cjs.entry.js +2 -2
  26. package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
  27. package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
  28. package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
  29. package/dist/cjs/{index-87ba56f9.js → index-5733071e.js} +6 -3
  30. package/dist/cjs/index-5733071e.js.map +1 -0
  31. package/dist/cjs/index.cjs.js +53 -24
  32. package/dist/cjs/index.cjs.js.map +1 -1
  33. package/dist/cjs/loader.cjs.js +2 -2
  34. package/dist/collection/assets/icons/check-circle.svg +3 -0
  35. package/dist/collection/assets/icons/home.svg +3 -0
  36. package/dist/collection/assets/icons/index.js +4 -1
  37. package/dist/collection/assets/icons/index.js.map +1 -1
  38. package/dist/collection/assets/icons/settings.svg +4 -0
  39. package/dist/collection/collection-manifest.json +11 -0
  40. package/dist/collection/components/cpsl-alert/cpsl-alert.css +21 -11
  41. package/dist/collection/components/cpsl-alert/cpsl-alert.js +34 -26
  42. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  43. package/dist/collection/components/cpsl-animation/cpsl-animation.js +1 -1
  44. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.css +67 -0
  45. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +69 -0
  46. package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js.map +1 -0
  47. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js +29 -0
  48. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js.map +1 -0
  49. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js +37 -0
  50. package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js.map +1 -0
  51. package/dist/collection/components/cpsl-avatar/cpsl-avatar.css +31 -0
  52. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +81 -0
  53. package/dist/collection/components/cpsl-avatar/cpsl-avatar.js.map +1 -0
  54. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js +29 -0
  55. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js.map +1 -0
  56. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js +37 -0
  57. package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js.map +1 -0
  58. package/dist/collection/components/cpsl-button/cpsl-button.css +175 -51
  59. package/dist/collection/components/cpsl-button/cpsl-button.js +46 -5
  60. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  61. package/dist/collection/components/cpsl-button-group/cpsl-button-group.css +88 -0
  62. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +78 -0
  63. package/dist/collection/components/cpsl-button-group/cpsl-button-group.js.map +1 -0
  64. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js +29 -0
  65. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js.map +1 -0
  66. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js +37 -0
  67. package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js.map +1 -0
  68. package/dist/collection/components/cpsl-card/cpsl-card.css +81 -0
  69. package/dist/collection/components/cpsl-card/cpsl-card.js +19 -0
  70. package/dist/collection/components/cpsl-card/cpsl-card.js.map +1 -0
  71. package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js +29 -0
  72. package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js.map +1 -0
  73. package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js +37 -0
  74. package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js.map +1 -0
  75. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.css +110 -0
  76. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +64 -0
  77. package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js.map +1 -0
  78. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js +29 -0
  79. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js.map +1 -0
  80. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js +37 -0
  81. package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js.map +1 -0
  82. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +1 -1
  83. package/dist/collection/components/cpsl-col/cpsl-col.js +1 -1
  84. package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
  85. package/dist/collection/components/cpsl-drawer/cpsl-drawer.css +90 -0
  86. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +149 -0
  87. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -0
  88. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js +29 -0
  89. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js.map +1 -0
  90. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js +37 -0
  91. package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js.map +1 -0
  92. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +1 -1
  93. package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
  94. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  95. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  96. package/dist/collection/components/cpsl-input/cpsl-input.css +35 -19
  97. package/dist/collection/components/cpsl-input/cpsl-input.js +47 -6
  98. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  99. package/dist/collection/components/cpsl-modal/cpsl-modal.css +12 -2
  100. package/dist/collection/components/cpsl-modal/cpsl-modal.js +20 -2
  101. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -1
  102. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.css +50 -0
  103. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +78 -0
  104. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js.map +1 -0
  105. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js +29 -0
  106. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js.map +1 -0
  107. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js +37 -0
  108. package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js.map +1 -0
  109. package/dist/collection/components/cpsl-overlay/cpsl-overlay.css +61 -3
  110. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +35 -17
  111. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +1 -1
  112. package/dist/collection/components/cpsl-pagination/cpsl-pagination.css +67 -0
  113. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +174 -0
  114. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js.map +1 -0
  115. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js +29 -0
  116. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js.map +1 -0
  117. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js +37 -0
  118. package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js.map +1 -0
  119. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  120. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +1 -1
  121. package/dist/collection/components/cpsl-radio/cpsl-radio.css +97 -0
  122. package/dist/collection/components/cpsl-radio/cpsl-radio.js +66 -0
  123. package/dist/collection/components/cpsl-radio/cpsl-radio.js.map +1 -0
  124. package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js +29 -0
  125. package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js.map +1 -0
  126. package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js +37 -0
  127. package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js.map +1 -0
  128. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  129. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  130. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +2 -2
  131. package/dist/collection/components/cpsl-switch/cpsl-switch.css +115 -0
  132. package/dist/collection/components/cpsl-switch/cpsl-switch.js +64 -0
  133. package/dist/collection/components/cpsl-switch/cpsl-switch.js.map +1 -0
  134. package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js +29 -0
  135. package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js.map +1 -0
  136. package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js +37 -0
  137. package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js.map +1 -0
  138. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  139. package/dist/collection/components/cpsl-table/cpsl-table.css +179 -0
  140. package/dist/collection/components/cpsl-table/cpsl-table.js +88 -0
  141. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -0
  142. package/dist/collection/components/cpsl-table/table-interface.js +2 -0
  143. package/dist/collection/components/cpsl-table/table-interface.js.map +1 -0
  144. package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js +29 -0
  145. package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js.map +1 -0
  146. package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js +37 -0
  147. package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js.map +1 -0
  148. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +1 -1
  149. package/dist/collection/components/cpsl-text/cpsl-text.js +1 -1
  150. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  151. package/dist/collection/constants.js +14 -0
  152. package/dist/collection/constants.js.map +1 -1
  153. package/dist/collection/interface.js.map +1 -1
  154. package/dist/collection/utils/theme/generateBorderRadii.js +24 -7
  155. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  156. package/dist/collection/utils/theme/generatePalette.js +22 -18
  157. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  158. package/dist/collection/utils/theme/utils.js +8 -0
  159. package/dist/collection/utils/theme/utils.js.map +1 -1
  160. package/dist/esm/capsule.js +3 -3
  161. package/dist/esm/constants-6acf4ea8.js +23 -0
  162. package/dist/esm/constants-6acf4ea8.js.map +1 -0
  163. package/dist/esm/{cpsl-alert_18.entry.js → cpsl-alert_29.entry.js} +588 -186
  164. package/dist/esm/cpsl-alert_29.entry.js.map +1 -0
  165. package/dist/esm/cpsl-animation.entry.js +2 -2
  166. package/dist/esm/cpsl-col.entry.js +2 -2
  167. package/dist/esm/cpsl-grid.entry.js +3 -3
  168. package/dist/esm/cpsl-info-box.entry.js +2 -2
  169. package/dist/esm/cpsl-row.entry.js +2 -2
  170. package/dist/esm/{index-fd970ca2.js → index-8fe9f35e.js} +6 -3
  171. package/dist/esm/index-8fe9f35e.js.map +1 -0
  172. package/dist/esm/index.js +53 -24
  173. package/dist/esm/index.js.map +1 -1
  174. package/dist/esm/loader.js +3 -3
  175. package/dist/types/assets/icons/index.d.ts +3 -0
  176. package/dist/types/components/cpsl-alert/cpsl-alert.d.ts +2 -2
  177. package/dist/types/components/cpsl-app-bar/cpsl-app-bar.d.ts +5 -0
  178. package/dist/types/components/cpsl-avatar/cpsl-avatar.d.ts +6 -0
  179. package/dist/types/components/cpsl-button/cpsl-button.d.ts +2 -0
  180. package/dist/types/components/cpsl-button-group/cpsl-button-group.d.ts +9 -0
  181. package/dist/types/components/cpsl-card/cpsl-card.d.ts +3 -0
  182. package/dist/types/components/cpsl-checkbox/cpsl-checkbox.d.ts +7 -0
  183. package/dist/types/components/cpsl-drawer/cpsl-drawer.d.ts +9 -0
  184. package/dist/types/components/cpsl-input/cpsl-input.d.ts +4 -0
  185. package/dist/types/components/cpsl-modal/cpsl-modal.d.ts +1 -0
  186. package/dist/types/components/cpsl-nav-button-group/cpsl-nav-button-group.d.ts +9 -0
  187. package/dist/types/components/cpsl-overlay/cpsl-overlay.d.ts +2 -1
  188. package/dist/types/components/cpsl-pagination/cpsl-pagination.d.ts +14 -0
  189. package/dist/types/components/cpsl-radio/cpsl-radio.d.ts +7 -0
  190. package/dist/types/components/cpsl-switch/cpsl-switch.d.ts +7 -0
  191. package/dist/types/components/cpsl-table/cpsl-table.d.ts +9 -0
  192. package/dist/types/components/cpsl-table/table-interface.d.ts +19 -0
  193. package/dist/types/components.d.ts +435 -6
  194. package/dist/types/constants.d.ts +14 -0
  195. package/dist/types/interface.d.ts +35 -0
  196. package/dist/types/utils/theme/utils.d.ts +1 -0
  197. package/package.json +3 -2
  198. package/dist/capsule/p-2ce99420.entry.js +0 -29
  199. package/dist/capsule/p-2ce99420.entry.js.map +0 -1
  200. package/dist/capsule/p-6b02ea8d.entry.js +0 -2
  201. package/dist/capsule/p-b2997f3c.js +0 -3
  202. package/dist/capsule/p-b2997f3c.js.map +0 -1
  203. package/dist/capsule/p-b76350fd.entry.js +0 -10
  204. package/dist/capsule/p-c2bf050b.js +0 -2
  205. package/dist/capsule/p-c2bf050b.js.map +0 -1
  206. package/dist/cjs/constants-4bb85cc5.js +0 -12
  207. package/dist/cjs/constants-4bb85cc5.js.map +0 -1
  208. package/dist/cjs/cpsl-alert_18.cjs.entry.js.map +0 -1
  209. package/dist/cjs/index-87ba56f9.js.map +0 -1
  210. package/dist/esm/constants-7b49abd5.js +0 -9
  211. package/dist/esm/constants-7b49abd5.js.map +0 -1
  212. package/dist/esm/cpsl-alert_18.entry.js.map +0 -1
  213. package/dist/esm/index-fd970ca2.js.map +0 -1
  214. /package/dist/capsule/{p-415384b7.entry.js.map → p-0d0a0037.entry.js.map} +0 -0
  215. /package/dist/capsule/{p-6b02ea8d.entry.js.map → p-ad14a817.entry.js.map} +0 -0
  216. /package/dist/capsule/{p-4d957466.entry.js.map → p-fa078837.entry.js.map} +0 -0
  217. /package/dist/capsule/{p-fa4e3c14.entry.js.map → p-fcead80b.entry.js.map} +0 -0
  218. /package/dist/types/Users/{vinay → taylorbosch}/Documents/GitHub/Capsule/component-library/core/.stencil/scripts/buildIconLibrary.d.ts +0 -0
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Convert a font size to a dynamic font size.
3
+ * Fonts that participate in Dynamic Type should use
4
+ * dynamic font sizes.
5
+ * @param size - The initial font size including the unit (i.e. px or pt)
6
+ * @param unit (optional) - The unit to convert to. Use this if you want to
7
+ * convert to a unit other than $baselineUnit.
8
+ */
9
+ /**
10
+ * Convert a font size to a dynamic font size but impose
11
+ * a maximum font size.
12
+ * @param size - The initial font size including the unit (i.e. px or pt)
13
+ * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
14
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
15
+ * convert to a unit other than $baselineUnit.
16
+ */
17
+ /**
18
+ * Convert a font size to a dynamic font size but impose
19
+ * a minimum font size.
20
+ * @param size - The initial font size including the unit (i.e. px or pt)
21
+ * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
22
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
23
+ * convert to a unit other than $baselineUnit.
24
+ */
25
+ /**
26
+ * Convert a font size to a dynamic font size but impose
27
+ * maximum and minimum font sizes.
28
+ * @param size - The initial font size including the unit (i.e. px or pt)
29
+ * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
30
+ * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
31
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
32
+ * convert to a unit other than $baselineUnit.
33
+ */
34
+ /**
35
+ * A heuristic that applies CSS to tablet
36
+ * viewports.
37
+ *
38
+ * Usage:
39
+ * @include tablet-viewport() {
40
+ * :host {
41
+ * background-color: green;
42
+ * }
43
+ * }
44
+ */
45
+ /**
46
+ * A heuristic that applies CSS to mobile
47
+ * viewports (i.e. phones, not tablets).
48
+ *
49
+ * Usage:
50
+ * @include mobile-viewport() {
51
+ * :host {
52
+ * background-color: blue;
53
+ * }
54
+ * }
55
+ */
56
+ :host {
57
+ --button-size: 32px;
58
+ display: flex;
59
+ }
60
+
61
+ :host ::slotted(cpsl-button:first-child) {
62
+ --button-border-radius-top-end: 0px;
63
+ --button-border-radius-bottom-end: 0px;
64
+ }
65
+ :host ::slotted(cpsl-button:last-child) {
66
+ --button-border-width-start: 0px;
67
+ --button-border-radius-top-start: 0px;
68
+ --button-border-radius-bottom-start: 0px;
69
+ }
70
+ :host ::slotted(cpsl-button:not(:first-child):not(:last-child)) {
71
+ --button-border-width-start: 0px;
72
+ --button-border-radius-top-start: 0px;
73
+ --button-border-radius-bottom-start: 0px;
74
+ --button-border-radius-top-end: 0px;
75
+ --button-border-radius-bottom-end: 0px;
76
+ }
77
+ :host ::slotted(cpsl-button) {
78
+ --button-color: var(--cpsl-color-text-tertiary);
79
+ --button-padding-start: 0px;
80
+ --button-padding-end: 0px;
81
+ --button-padding-top: 0px;
82
+ --button-padding-bottom: 0px;
83
+ height: var(--button-size);
84
+ width: var(--button-size);
85
+ }
86
+ :host ::slotted(cpsl-button.selected) {
87
+ --button-color: var(--cpsl-color-text-primary);
88
+ }
@@ -0,0 +1,78 @@
1
+ import { Host, h } from "@stencil/core";
2
+ export class CpslButtonGroup {
3
+ constructor() {
4
+ this.selectedId = undefined;
5
+ }
6
+ selectItem() {
7
+ this.buttonSlots.forEach(item => {
8
+ if (item.id === this.selectedId) {
9
+ item.classList.add('selected');
10
+ }
11
+ else {
12
+ item.classList.remove('selected');
13
+ }
14
+ });
15
+ }
16
+ componentWillRender() {
17
+ var _a;
18
+ this.buttonSlots.forEach(item => {
19
+ item.setAttribute('variant', 'secondary');
20
+ item.setAttribute('full-width', 'true');
21
+ this.selectItem();
22
+ });
23
+ if (Boolean((_a = this.otherSlots) === null || _a === void 0 ? void 0 : _a.length)) {
24
+ console.error('cpsl-button is the only valid child of cpsl-button-group');
25
+ this.otherSlots.forEach(item => item.remove());
26
+ }
27
+ }
28
+ get buttonSlots() {
29
+ return this.el.querySelectorAll('cpsl-button');
30
+ }
31
+ get otherSlots() {
32
+ return this.el.querySelectorAll('&> *:not(cpsl-button)');
33
+ }
34
+ render() {
35
+ return (h(Host, { key: 'e15232f4180db66b6b7bd21b5e22980f197514be' }, h("slot", { key: 'f3c566eaf9574fb38331e8a44c5c369d1edd5223' })));
36
+ }
37
+ static get is() { return "cpsl-button-group"; }
38
+ static get encapsulation() { return "shadow"; }
39
+ static get originalStyleUrls() {
40
+ return {
41
+ "$": ["cpsl-button-group.scss"]
42
+ };
43
+ }
44
+ static get styleUrls() {
45
+ return {
46
+ "$": ["cpsl-button-group.css"]
47
+ };
48
+ }
49
+ static get properties() {
50
+ return {
51
+ "selectedId": {
52
+ "type": "string",
53
+ "mutable": false,
54
+ "complexType": {
55
+ "original": "string",
56
+ "resolved": "string",
57
+ "references": {}
58
+ },
59
+ "required": false,
60
+ "optional": true,
61
+ "docs": {
62
+ "tags": [],
63
+ "text": "The id of the selected button."
64
+ },
65
+ "attribute": "selected-id",
66
+ "reflect": false
67
+ }
68
+ };
69
+ }
70
+ static get elementRef() { return "el"; }
71
+ static get watchers() {
72
+ return [{
73
+ "propName": "selectedId",
74
+ "methodName": "selectItem"
75
+ }];
76
+ }
77
+ }
78
+ //# sourceMappingURL=cpsl-button-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-button-group.js","sourceRoot":"","sources":["../../../../src/components/cpsl-button-group/cpsl-button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOzE,MAAM,OAAO,eAAe;;;;IAS1B,UAAU;QACR,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC9B,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACpC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,mBAAmB;;QACjB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC9B,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;YAC1C,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YACxC,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,MAAA,IAAI,CAAC,UAAU,0CAAE,MAAM,CAAC,EAAE,CAAC;YACrC,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;YAC1E,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;IACjD,CAAC;IAED,IAAY,UAAU;QACpB,OAAO,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, Element, h, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-button-group',\n styleUrl: 'cpsl-button-group.scss',\n shadow: true,\n})\nexport class CpslButtonGroup {\n @Element() el!: HTMLCpslButtonGroupElement;\n\n /**\n * The id of the selected button.\n */\n @Prop() selectedId?: string;\n\n @Watch('selectedId')\n selectItem() {\n this.buttonSlots.forEach(item => {\n if (item.id === this.selectedId) {\n item.classList.add('selected');\n } else {\n item.classList.remove('selected');\n }\n });\n }\n\n componentWillRender() {\n this.buttonSlots.forEach(item => {\n item.setAttribute('variant', 'secondary');\n item.setAttribute('full-width', 'true');\n this.selectItem();\n });\n\n if (Boolean(this.otherSlots?.length)) {\n console.error('cpsl-button is the only valid child of cpsl-button-group');\n this.otherSlots.forEach(item => item.remove());\n }\n }\n\n private get buttonSlots() {\n return this.el.querySelectorAll('cpsl-button');\n }\n\n private get otherSlots() {\n return this.el.querySelectorAll('&> *:not(cpsl-button)');\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\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-button-group', () => {
22
+ it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
23
+ const page = yield newE2EPage();
24
+ yield page.setContent('<cpsl-button-group></cpsl-button-group>');
25
+ const element = yield page.find('cpsl-button-group');
26
+ expect(element).toHaveClass('hydrated');
27
+ }));
28
+ });
29
+ //# sourceMappingURL=cpsl-button-group.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-button-group.e2e.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-button-group/test/cpsl-button-group.e2e.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,yCAAyC,CAAC,CAAC;QAEjE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACrD,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-button-group', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cpsl-button-group></cpsl-button-group>');\n\n const element = await page.find('cpsl-button-group');\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 { CpslButtonGroup } from "../cpsl-button-group";
22
+ describe('cpsl-button-group', () => {
23
+ it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
24
+ const page = yield newSpecPage({
25
+ components: [CpslButtonGroup],
26
+ html: `<cpsl-button-group></cpsl-button-group>`,
27
+ });
28
+ expect(page.root).toEqualHtml(`
29
+ <cpsl-button-group>
30
+ <mock:shadow-root>
31
+ <slot></slot>
32
+ </mock:shadow-root>
33
+ </cpsl-button-group>
34
+ `);
35
+ }));
36
+ });
37
+ //# sourceMappingURL=cpsl-button-group.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-button-group.spec.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-button-group/test/cpsl-button-group.spec.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,eAAe,CAAC;YAC7B,IAAI,EAAE,yCAAyC;SAChD,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 { CpslButtonGroup } from '../cpsl-button-group';\n\ndescribe('cpsl-button-group', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CpslButtonGroup],\n html: `<cpsl-button-group></cpsl-button-group>`,\n });\n expect(page.root).toEqualHtml(`\n <cpsl-button-group>\n <mock:shadow-root>\n <slot></slot>\n </mock:shadow-root>\n </cpsl-button-group>\n `);\n });\n});\n"]}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Convert a font size to a dynamic font size.
3
+ * Fonts that participate in Dynamic Type should use
4
+ * dynamic font sizes.
5
+ * @param size - The initial font size including the unit (i.e. px or pt)
6
+ * @param unit (optional) - The unit to convert to. Use this if you want to
7
+ * convert to a unit other than $baselineUnit.
8
+ */
9
+ /**
10
+ * Convert a font size to a dynamic font size but impose
11
+ * a maximum font size.
12
+ * @param size - The initial font size including the unit (i.e. px or pt)
13
+ * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
14
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
15
+ * convert to a unit other than $baselineUnit.
16
+ */
17
+ /**
18
+ * Convert a font size to a dynamic font size but impose
19
+ * a minimum font size.
20
+ * @param size - The initial font size including the unit (i.e. px or pt)
21
+ * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
22
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
23
+ * convert to a unit other than $baselineUnit.
24
+ */
25
+ /**
26
+ * Convert a font size to a dynamic font size but impose
27
+ * maximum and minimum font sizes.
28
+ * @param size - The initial font size including the unit (i.e. px or pt)
29
+ * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
30
+ * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
31
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
32
+ * convert to a unit other than $baselineUnit.
33
+ */
34
+ /**
35
+ * A heuristic that applies CSS to tablet
36
+ * viewports.
37
+ *
38
+ * Usage:
39
+ * @include tablet-viewport() {
40
+ * :host {
41
+ * background-color: green;
42
+ * }
43
+ * }
44
+ */
45
+ /**
46
+ * A heuristic that applies CSS to mobile
47
+ * viewports (i.e. phones, not tablets).
48
+ *
49
+ * Usage:
50
+ * @include mobile-viewport() {
51
+ * :host {
52
+ * background-color: blue;
53
+ * }
54
+ * }
55
+ */
56
+ :host {
57
+ --card-padding-top: 24px;
58
+ --card-padding-end: 24px;
59
+ --card-padding-bottom: 24px;
60
+ --card-padding-start: 24px;
61
+ --card-border-width: 1px;
62
+ --card-border-color: var(--cpsl-color-card-border);
63
+ --card-border-radius: var(--cpsl-border-radius-card);
64
+ --card-background-color: var(--cpsl-color-card-surface);
65
+ display: block;
66
+ }
67
+
68
+ .card {
69
+ -webkit-padding-start: var(--card-padding-start);
70
+ padding-inline-start: var(--card-padding-start);
71
+ -webkit-padding-end: var(--card-padding-end);
72
+ padding-inline-end: var(--card-padding-end);
73
+ padding-top: var(--card-padding-top);
74
+ padding-bottom: var(--card-padding-bottom);
75
+ display: block;
76
+ box-sizing: border-box;
77
+ overflow: hidden;
78
+ border: var(--card-border-width) solid var(--card-border-color);
79
+ border-radius: var(--card-border-radius);
80
+ background-color: var(--card-background-color);
81
+ }
@@ -0,0 +1,19 @@
1
+ import { Host, h } from "@stencil/core";
2
+ export class CpslCard {
3
+ render() {
4
+ return (h(Host, { key: '8633aeaedaaf81af67835ee3ffc8964ec28ced92' }, h("div", { key: '3f2a22aad0a9dde3c6819ec9746576691d2084e5', class: { card: true } }, h("slot", { key: 'c6f573694f67d2096cac429c27f87f3b04547d4b' }))));
5
+ }
6
+ static get is() { return "cpsl-card"; }
7
+ static get encapsulation() { return "shadow"; }
8
+ static get originalStyleUrls() {
9
+ return {
10
+ "$": ["cpsl-card.scss"]
11
+ };
12
+ }
13
+ static get styleUrls() {
14
+ return {
15
+ "$": ["cpsl-card.css"]
16
+ };
17
+ }
18
+ }
19
+ //# sourceMappingURL=cpsl-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-card.js","sourceRoot":"","sources":["../../../../src/components/cpsl-card/cpsl-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOnD,MAAM,OAAO,QAAQ;IACnB,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;gBACxB,8DAAa,CACT,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-card',\n styleUrl: 'cpsl-card.scss',\n shadow: true,\n})\nexport class CpslCard {\n render() {\n return (\n <Host>\n <div class={{ card: true }}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\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-card', () => {
22
+ it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
23
+ const page = yield newE2EPage();
24
+ yield page.setContent('<cpsl-card></cpsl-card>');
25
+ const element = yield page.find('cpsl-card');
26
+ expect(element).toHaveClass('hydrated');
27
+ }));
28
+ });
29
+ //# sourceMappingURL=cpsl-card.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-card.e2e.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-card/test/cpsl-card.e2e.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC;QAEjD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC7C,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-card', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cpsl-card></cpsl-card>');\n\n const element = await page.find('cpsl-card');\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 { CpslCard } from "../cpsl-card";
22
+ describe('cpsl-card', () => {
23
+ it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
24
+ const page = yield newSpecPage({
25
+ components: [CpslCard],
26
+ html: `<cpsl-card></cpsl-card>`,
27
+ });
28
+ expect(page.root).toEqualHtml(`
29
+ <cpsl-card>
30
+ <mock:shadow-root>
31
+ <slot></slot>
32
+ </mock:shadow-root>
33
+ </cpsl-card>
34
+ `);
35
+ }));
36
+ });
37
+ //# sourceMappingURL=cpsl-card.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-card.spec.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-card/test/cpsl-card.spec.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,QAAQ,CAAC;YACtB,IAAI,EAAE,yBAAyB;SAChC,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 { CpslCard } from '../cpsl-card';\n\ndescribe('cpsl-card', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CpslCard],\n html: `<cpsl-card></cpsl-card>`,\n });\n expect(page.root).toEqualHtml(`\n <cpsl-card>\n <mock:shadow-root>\n <slot></slot>\n </mock:shadow-root>\n </cpsl-card>\n `);\n });\n});\n"]}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Convert a font size to a dynamic font size.
3
+ * Fonts that participate in Dynamic Type should use
4
+ * dynamic font sizes.
5
+ * @param size - The initial font size including the unit (i.e. px or pt)
6
+ * @param unit (optional) - The unit to convert to. Use this if you want to
7
+ * convert to a unit other than $baselineUnit.
8
+ */
9
+ /**
10
+ * Convert a font size to a dynamic font size but impose
11
+ * a maximum font size.
12
+ * @param size - The initial font size including the unit (i.e. px or pt)
13
+ * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
14
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
15
+ * convert to a unit other than $baselineUnit.
16
+ */
17
+ /**
18
+ * Convert a font size to a dynamic font size but impose
19
+ * a minimum font size.
20
+ * @param size - The initial font size including the unit (i.e. px or pt)
21
+ * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
22
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
23
+ * convert to a unit other than $baselineUnit.
24
+ */
25
+ /**
26
+ * Convert a font size to a dynamic font size but impose
27
+ * maximum and minimum font sizes.
28
+ * @param size - The initial font size including the unit (i.e. px or pt)
29
+ * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
30
+ * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
31
+ * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
32
+ * convert to a unit other than $baselineUnit.
33
+ */
34
+ /**
35
+ * A heuristic that applies CSS to tablet
36
+ * viewports.
37
+ *
38
+ * Usage:
39
+ * @include tablet-viewport() {
40
+ * :host {
41
+ * background-color: green;
42
+ * }
43
+ * }
44
+ */
45
+ /**
46
+ * A heuristic that applies CSS to mobile
47
+ * viewports (i.e. phones, not tablets).
48
+ *
49
+ * Usage:
50
+ * @include mobile-viewport() {
51
+ * :host {
52
+ * background-color: blue;
53
+ * }
54
+ * }
55
+ */
56
+ :host {
57
+ --container-height: 20px;
58
+ --container-width: 20px;
59
+ --container-border-radius: var(--cpsl-border-radius-checkbox);
60
+ --container-border-width: 2px;
61
+ --container-background-color-default: var(--cpsl-color-checkbox-surface-default);
62
+ --container-border-color-default: var(--cpsl-color-checkbox-border-default);
63
+ --container-background-color-checked: var(--cpsl-color-checkbox-surface-checked);
64
+ --container-border-color-checked: var(--cpsl-color-checkbox-border-checked);
65
+ --icon-height: 16px;
66
+ --icon-width: 16px;
67
+ --checkbox-icon-color: var(--cpsl-color-checkbox-icon);
68
+ display: block;
69
+ position: relative;
70
+ height: var(--container-height);
71
+ width: var(--container-width);
72
+ cursor: pointer;
73
+ }
74
+
75
+ input {
76
+ position: absolute;
77
+ width: 100%;
78
+ height: 100%;
79
+ margin: 0px;
80
+ opacity: 0;
81
+ }
82
+
83
+ span.container {
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: center;
87
+ position: relative;
88
+ box-sizing: border-box;
89
+ width: 100%;
90
+ height: 100%;
91
+ border-radius: var(--container-border-radius);
92
+ border: var(--container-border-width) solid;
93
+ background-color: var(--container-background-color-default);
94
+ border-color: var(--container-border-color-default);
95
+ transition: all 0.15s ease-in-out;
96
+ }
97
+ span.container cpsl-icon {
98
+ --height: var(--icon-height);
99
+ --width: var(--icon-width);
100
+ opacity: 0;
101
+ --icon-color: var(--checkbox-icon-color);
102
+ transition: all 0.15s ease-in-out;
103
+ }
104
+ span.container.checked {
105
+ background-color: var(--container-background-color-checked);
106
+ border-color: var(--container-border-color-checked);
107
+ }
108
+ span.container.checked cpsl-icon {
109
+ opacity: 1;
110
+ }
@@ -0,0 +1,64 @@
1
+ import { Host, h } from "@stencil/core";
2
+ export class CpslCheckbox {
3
+ constructor() {
4
+ this.handleCheckboxClick = () => {
5
+ this.cpslCheckboxChanged.emit(!this.checked);
6
+ };
7
+ this.checked = undefined;
8
+ }
9
+ render() {
10
+ return (h(Host, { key: 'b5d7963285854a20983f8655c8a9545b8d0735e9' }, h("input", { key: 'b822a505e826f06d47f1da51fff0c7f310d9c9ce', type: "checkbox", checked: this.checked }), h("span", { key: '3747cf548b8d88ceee19eae5c1df78cdc5f9c87e', onClick: this.handleCheckboxClick, class: { container: true, checked: this.checked } }, h("cpsl-icon", { key: '9d5d0cdba4b22bc2167aed23e7748201320a6553', icon: "check" }))));
11
+ }
12
+ static get is() { return "cpsl-checkbox"; }
13
+ static get encapsulation() { return "shadow"; }
14
+ static get originalStyleUrls() {
15
+ return {
16
+ "$": ["cpsl-checkbox.scss"]
17
+ };
18
+ }
19
+ static get styleUrls() {
20
+ return {
21
+ "$": ["cpsl-checkbox.css"]
22
+ };
23
+ }
24
+ static get properties() {
25
+ return {
26
+ "checked": {
27
+ "type": "boolean",
28
+ "mutable": false,
29
+ "complexType": {
30
+ "original": "boolean",
31
+ "resolved": "boolean",
32
+ "references": {}
33
+ },
34
+ "required": false,
35
+ "optional": false,
36
+ "docs": {
37
+ "tags": [],
38
+ "text": "Whether or not the checkbox is checked."
39
+ },
40
+ "attribute": "checked",
41
+ "reflect": false
42
+ }
43
+ };
44
+ }
45
+ static get events() {
46
+ return [{
47
+ "method": "cpslCheckboxChanged",
48
+ "name": "cpslCheckboxChanged",
49
+ "bubbles": true,
50
+ "cancelable": true,
51
+ "composed": true,
52
+ "docs": {
53
+ "tags": [],
54
+ "text": "Emitted when the checkbox state changes."
55
+ },
56
+ "complexType": {
57
+ "original": "boolean",
58
+ "resolved": "boolean",
59
+ "references": {}
60
+ }
61
+ }];
62
+ }
63
+ }
64
+ //# sourceMappingURL=cpsl-checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-checkbox.js","sourceRoot":"","sources":["../../../../src/components/cpsl-checkbox/cpsl-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAO9E,MAAM,OAAO,YAAY;;QAWf,wBAAmB,GAAG,GAAG,EAAE;YACjC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC,CAAC;;;IAEF,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,8DAAO,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,GAAI;YAChD,6DAAM,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;gBACxF,kEAAW,IAAI,EAAC,OAAO,GAAG,CACrB,CACF,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, EventEmitter, Host, Prop, Event, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-checkbox',\n styleUrl: 'cpsl-checkbox.scss',\n shadow: true,\n})\nexport class CpslCheckbox {\n /**\n * Whether or not the checkbox is checked.\n */\n @Prop() checked: boolean;\n\n /**\n * Emitted when the checkbox state changes.\n */\n @Event() cpslCheckboxChanged!: EventEmitter<boolean>;\n\n private handleCheckboxClick = () => {\n this.cpslCheckboxChanged.emit(!this.checked);\n };\n\n render() {\n return (\n <Host>\n <input type=\"checkbox\" checked={this.checked} />\n <span onClick={this.handleCheckboxClick} class={{ container: true, checked: this.checked }}>\n <cpsl-icon icon=\"check\" />\n </span>\n </Host>\n );\n }\n}\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-checkbox', () => {
22
+ it('renders', () => __awaiter(void 0, void 0, void 0, function* () {
23
+ const page = yield newE2EPage();
24
+ yield page.setContent('<cpsl-checkbox></cpsl-checkbox>');
25
+ const element = yield page.find('cpsl-checkbox');
26
+ expect(element).toHaveClass('hydrated');
27
+ }));
28
+ });
29
+ //# sourceMappingURL=cpsl-checkbox.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-checkbox.e2e.js","sourceRoot":"","sources":["../../../../../src/components/cpsl-checkbox/test/cpsl-checkbox.e2e.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,iCAAiC,CAAC,CAAC;QAEzD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACjD,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-checkbox', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cpsl-checkbox></cpsl-checkbox>');\n\n const element = await page.find('cpsl-checkbox');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}