q2-tecton-elements 1.13.0-alpha.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/dist/cjs/click-elsewhere.cjs.entry.js +5 -7
  2. package/dist/cjs/{icons-4595ee47.js → icons-08ffe5c9.js} +394 -384
  3. package/dist/cjs/{index-c2e53804.js → index-7febb200.js} +112 -65
  4. package/dist/cjs/{index-a55d3c34.js → index-dd823ee6.js} +27 -14
  5. package/dist/cjs/loader.cjs.js +3 -3
  6. package/dist/cjs/q2-avatar.cjs.entry.js +2 -2
  7. package/dist/cjs/q2-badge.cjs.entry.js +43 -0
  8. package/dist/cjs/q2-btn_2.cjs.entry.js +13 -13
  9. package/dist/cjs/q2-calendar.cjs.entry.js +53 -59
  10. package/dist/cjs/q2-card.cjs.entry.js +127 -0
  11. package/dist/cjs/q2-carousel-pane.cjs.entry.js +5 -5
  12. package/dist/cjs/q2-carousel.cjs.entry.js +318 -106
  13. package/dist/cjs/q2-checkbox-group.cjs.entry.js +6 -3
  14. package/dist/cjs/q2-checkbox.cjs.entry.js +18 -10
  15. package/dist/cjs/q2-dropdown-item.cjs.entry.js +7 -7
  16. package/dist/cjs/q2-dropdown.cjs.entry.js +8 -17
  17. package/dist/cjs/q2-editable-field.cjs.entry.js +5 -8
  18. package/dist/cjs/q2-icon.cjs.entry.js +3 -3
  19. package/dist/cjs/q2-input.cjs.entry.js +439 -437
  20. package/dist/cjs/q2-loading-element.cjs.entry.js +3 -3
  21. package/dist/cjs/q2-loc.cjs.entry.js +2 -2
  22. package/dist/cjs/q2-message.cjs.entry.js +5 -5
  23. package/dist/cjs/q2-optgroup.cjs.entry.js +3 -3
  24. package/dist/cjs/q2-option-list.cjs.entry.js +359 -0
  25. package/dist/cjs/q2-option.cjs.entry.js +3 -11
  26. package/dist/cjs/q2-pagination.cjs.entry.js +116 -0
  27. package/dist/cjs/q2-pill.cjs.entry.js +137 -0
  28. package/dist/cjs/q2-radio-group.cjs.entry.js +43 -18
  29. package/dist/cjs/q2-radio.cjs.entry.js +21 -4
  30. package/dist/cjs/q2-section.cjs.entry.js +5 -7
  31. package/dist/cjs/q2-select.cjs.entry.js +23 -26
  32. package/dist/cjs/q2-stepper-pane.cjs.entry.js +42 -4
  33. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +278 -0
  34. package/dist/cjs/q2-stepper.cjs.entry.js +10 -12
  35. package/dist/cjs/q2-tab-container.cjs.entry.js +12 -8
  36. package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
  37. package/dist/cjs/q2-tag.cjs.entry.js +94 -0
  38. package/dist/cjs/q2-tecton-elements.cjs.js +3 -3
  39. package/dist/cjs/q2-textarea.cjs.entry.js +8 -8
  40. package/dist/cjs/{shapes-086c0365.js → shapes-305746b5.js} +9 -16
  41. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -5
  42. package/dist/collection/collection-manifest.json +10 -3
  43. package/dist/collection/components/click-elsewhere/index.js +4 -6
  44. package/dist/collection/components/q2-badge/index.js +148 -0
  45. package/dist/collection/components/q2-badge/styles.css +134 -0
  46. package/dist/collection/components/q2-btn/index.js +14 -14
  47. package/dist/collection/components/q2-btn/styles.css +1 -1
  48. package/dist/collection/components/q2-calendar/helpers.js +22 -20
  49. package/dist/collection/components/q2-calendar/index.js +44 -37
  50. package/dist/collection/components/q2-calendar/validation.js +4 -2
  51. package/dist/collection/components/q2-card/index.js +347 -0
  52. package/dist/collection/components/q2-card/styles.css +177 -0
  53. package/dist/collection/components/q2-carousel/index.js +11 -16
  54. package/dist/collection/components/q2-carousel/styles.css +3 -3
  55. package/dist/collection/components/q2-carousel-pane/index.js +2 -2
  56. package/dist/collection/components/q2-carousel-pane/styles.css +8 -3
  57. package/dist/collection/components/q2-checkbox/index.js +37 -12
  58. package/dist/collection/components/q2-checkbox-group/index.js +22 -1
  59. package/dist/collection/components/q2-dropdown/index.js +6 -15
  60. package/dist/collection/components/q2-dropdown-item/index.js +5 -5
  61. package/dist/collection/components/q2-editable-field/index.js +3 -6
  62. package/dist/collection/components/q2-icon/icons.js +393 -383
  63. package/dist/collection/components/q2-input/formatting/credit-card.js +15 -13
  64. package/dist/collection/components/q2-input/formatting/currency.js +162 -162
  65. package/dist/collection/components/q2-input/formatting/date.js +1 -1
  66. package/dist/collection/components/q2-input/formatting/generic.js +7 -8
  67. package/dist/collection/components/q2-input/formatting/number.js +6 -9
  68. package/dist/collection/components/q2-input/formatting/numeric.js +5 -5
  69. package/dist/collection/components/q2-input/formatting/phone.js +215 -215
  70. package/dist/collection/components/q2-input/formatting/postal.js +1 -1
  71. package/dist/collection/components/q2-input/index.js +81 -25
  72. package/dist/collection/components/q2-input/styles.css +19 -14
  73. package/dist/collection/components/q2-loading/index.js +4 -4
  74. package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +1 -1
  75. package/dist/collection/components/q2-loading/skeleton/shapes.js +8 -15
  76. package/dist/collection/components/q2-message/index.js +3 -3
  77. package/dist/collection/components/q2-optgroup/index.js +1 -1
  78. package/dist/collection/components/q2-option/index.js +19 -25
  79. package/dist/collection/components/q2-option/styles.css +5 -0
  80. package/dist/collection/components/q2-option-list/index.js +648 -0
  81. package/dist/collection/components/q2-option-list/styles.css +128 -0
  82. package/dist/collection/components/q2-pagination/index.js +275 -0
  83. package/dist/collection/components/q2-pagination/styles.css +120 -0
  84. package/dist/collection/components/q2-pill/index.js +324 -0
  85. package/dist/collection/components/q2-pill/styles.css +229 -0
  86. package/dist/collection/components/q2-radio/index.js +38 -1
  87. package/dist/collection/components/q2-radio-group/index.js +66 -24
  88. package/dist/collection/components/q2-section/index.js +5 -7
  89. package/dist/collection/components/q2-select/index.js +40 -25
  90. package/dist/collection/components/q2-stepper/index.js +8 -10
  91. package/dist/collection/components/q2-stepper/styles.css +5 -5
  92. package/dist/collection/components/q2-stepper-pane/index.js +133 -5
  93. package/dist/collection/components/q2-stepper-vertical/index.js +346 -0
  94. package/dist/collection/components/q2-stepper-vertical/styles.css +273 -0
  95. package/dist/collection/components/q2-tab-container/index.js +11 -7
  96. package/dist/collection/components/q2-tag/index.js +200 -0
  97. package/dist/collection/components/q2-tag/styles.css +141 -0
  98. package/dist/collection/components/q2-textarea/index.js +6 -6
  99. package/dist/collection/components/tecton-tab-pane/index.js +3 -10
  100. package/dist/collection/utils/index.js +25 -13
  101. package/dist/esm/click-elsewhere.entry.js +5 -7
  102. package/dist/esm/{icons-3ee662ea.js → icons-b1e11526.js} +394 -384
  103. package/dist/esm/{index-ec6660af.js → index-0ff8de52.js} +27 -15
  104. package/dist/esm/{index-be8376c0.js → index-dbfb3ecc.js} +112 -65
  105. package/dist/esm/loader.js +3 -3
  106. package/dist/esm/polyfills/css-shim.js +1 -1
  107. package/dist/esm/q2-avatar.entry.js +2 -2
  108. package/dist/esm/q2-badge.entry.js +39 -0
  109. package/dist/esm/q2-btn_2.entry.js +13 -13
  110. package/dist/esm/q2-calendar.entry.js +53 -59
  111. package/dist/esm/q2-card.entry.js +123 -0
  112. package/dist/esm/q2-carousel-pane.entry.js +5 -5
  113. package/dist/esm/q2-carousel.entry.js +318 -106
  114. package/dist/esm/q2-checkbox-group.entry.js +6 -3
  115. package/dist/esm/q2-checkbox.entry.js +18 -10
  116. package/dist/esm/q2-dropdown-item.entry.js +7 -7
  117. package/dist/esm/q2-dropdown.entry.js +8 -17
  118. package/dist/esm/q2-editable-field.entry.js +5 -8
  119. package/dist/esm/q2-icon.entry.js +3 -3
  120. package/dist/esm/q2-input.entry.js +439 -437
  121. package/dist/esm/q2-loading-element.entry.js +3 -3
  122. package/dist/esm/q2-loc.entry.js +2 -2
  123. package/dist/esm/q2-message.entry.js +5 -5
  124. package/dist/esm/q2-optgroup.entry.js +3 -3
  125. package/dist/esm/q2-option-list.entry.js +355 -0
  126. package/dist/esm/q2-option.entry.js +3 -11
  127. package/dist/esm/q2-pagination.entry.js +112 -0
  128. package/dist/esm/q2-pill.entry.js +133 -0
  129. package/dist/esm/q2-radio-group.entry.js +43 -18
  130. package/dist/esm/q2-radio.entry.js +21 -4
  131. package/dist/esm/q2-section.entry.js +5 -7
  132. package/dist/esm/q2-select.entry.js +23 -26
  133. package/dist/esm/q2-stepper-pane.entry.js +42 -4
  134. package/dist/esm/q2-stepper-vertical.entry.js +274 -0
  135. package/dist/esm/q2-stepper.entry.js +10 -12
  136. package/dist/esm/q2-tab-container.entry.js +12 -8
  137. package/dist/esm/q2-tab-pane.entry.js +1 -1
  138. package/dist/esm/q2-tag.entry.js +90 -0
  139. package/dist/esm/q2-tecton-elements.js +3 -3
  140. package/dist/esm/q2-textarea.entry.js +8 -8
  141. package/dist/esm/{shapes-81c11dfe.js → shapes-cff4e1f0.js} +9 -16
  142. package/dist/esm/tecton-tab-pane.entry.js +2 -5
  143. package/dist/loader/index.d.ts +0 -1
  144. package/dist/q2-tecton-elements/{p-75e87cca.entry.js → p-00e8f782.entry.js} +1 -1
  145. package/dist/q2-tecton-elements/p-0900bec1.entry.js +1 -0
  146. package/dist/q2-tecton-elements/p-10264ecb.entry.js +1 -0
  147. package/dist/q2-tecton-elements/p-123cdfb9.entry.js +1 -0
  148. package/dist/q2-tecton-elements/{p-fbf7c5e6.entry.js → p-1305ec5f.entry.js} +1 -1
  149. package/dist/q2-tecton-elements/p-148391d6.entry.js +1 -0
  150. package/dist/q2-tecton-elements/p-1dfaee64.entry.js +1 -0
  151. package/dist/q2-tecton-elements/{p-32ad664c.entry.js → p-221abbf6.entry.js} +1 -1
  152. package/dist/q2-tecton-elements/{p-c90a6016.js → p-255b2b4c.js} +1 -1
  153. package/dist/q2-tecton-elements/p-27736b6b.entry.js +1 -0
  154. package/dist/q2-tecton-elements/p-2846ab94.entry.js +1 -0
  155. package/dist/q2-tecton-elements/p-2bc1de01.entry.js +1 -0
  156. package/dist/q2-tecton-elements/{p-8ea2c4f7.entry.js → p-2c15414c.entry.js} +1 -1
  157. package/dist/q2-tecton-elements/p-2caa89fd.js +1 -0
  158. package/dist/q2-tecton-elements/p-327cca41.entry.js +1 -0
  159. package/dist/q2-tecton-elements/p-3a420dbf.entry.js +1 -0
  160. package/dist/q2-tecton-elements/p-3abcb09d.entry.js +1 -0
  161. package/dist/q2-tecton-elements/p-3fe98e3e.entry.js +1 -0
  162. package/dist/q2-tecton-elements/{p-bb2e110a.entry.js → p-430a979b.entry.js} +1 -1
  163. package/dist/q2-tecton-elements/{p-7e6fc65d.entry.js → p-45eb7739.entry.js} +1 -1
  164. package/dist/q2-tecton-elements/{p-750bcd33.entry.js → p-49b2abc4.entry.js} +1 -1
  165. package/dist/q2-tecton-elements/{p-9b50c3c3.entry.js → p-4ab30466.entry.js} +1 -1
  166. package/dist/q2-tecton-elements/p-50e218c7.entry.js +1 -0
  167. package/dist/q2-tecton-elements/p-5bbf2bfe.entry.js +1 -0
  168. package/dist/q2-tecton-elements/{p-ac859fcc.entry.js → p-6fec9235.entry.js} +1 -1
  169. package/dist/q2-tecton-elements/p-824aebd9.js +1 -0
  170. package/dist/q2-tecton-elements/p-a4ae89cc.entry.js +1 -0
  171. package/dist/q2-tecton-elements/{p-50967020.entry.js → p-a5562aaa.entry.js} +1 -1
  172. package/dist/q2-tecton-elements/p-ae4fed23.entry.js +1 -0
  173. package/dist/q2-tecton-elements/p-b2302cd3.entry.js +1 -0
  174. package/dist/q2-tecton-elements/p-c20cbb2d.entry.js +1 -0
  175. package/dist/q2-tecton-elements/p-ca7a3380.entry.js +1 -0
  176. package/dist/q2-tecton-elements/{p-a6f8d09a.entry.js → p-d33e152c.entry.js} +1 -1
  177. package/dist/q2-tecton-elements/{p-9024859f.entry.js → p-d5218cd6.entry.js} +1 -1
  178. package/dist/q2-tecton-elements/p-d52b435e.entry.js +1 -0
  179. package/dist/q2-tecton-elements/p-dd02cf8d.js +1 -0
  180. package/dist/q2-tecton-elements/{p-07a5d703.entry.js → p-e0e7ae8b.entry.js} +1 -1
  181. package/dist/q2-tecton-elements/{p-7e030e92.entry.js → p-ede12fc1.entry.js} +1 -1
  182. package/dist/q2-tecton-elements/{p-df182f61.entry.js → p-fdfbe75b.entry.js} +1 -1
  183. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  184. package/dist/test/elements/q2-tag-test.js +151 -0
  185. package/dist/test/helpers.js +20 -9
  186. package/dist/types/components/q2-badge/index.d.ts +13 -0
  187. package/dist/types/components/q2-btn/index.d.ts +3 -3
  188. package/dist/types/components/q2-calendar/helpers.d.ts +1 -0
  189. package/dist/types/components/q2-calendar/index.d.ts +2 -1
  190. package/dist/types/components/q2-calendar/validation.d.ts +1 -1
  191. package/dist/types/components/q2-card/index.d.ts +35 -0
  192. package/dist/types/components/q2-checkbox/index.d.ts +3 -1
  193. package/dist/types/components/q2-checkbox-group/index.d.ts +1 -0
  194. package/dist/types/components/q2-dropdown/index.d.ts +1 -1
  195. package/dist/types/components/q2-editable-field/index.d.ts +1 -1
  196. package/dist/types/components/q2-input/formatting/credit-card.d.ts +1 -3
  197. package/dist/types/components/q2-input/index.d.ts +5 -2
  198. package/dist/types/components/q2-option/index.d.ts +2 -3
  199. package/dist/types/components/q2-option-list/index.d.ts +62 -0
  200. package/dist/types/components/q2-pagination/index.d.ts +30 -0
  201. package/dist/types/components/q2-pill/index.d.ts +39 -0
  202. package/dist/types/components/q2-radio/index.d.ts +4 -1
  203. package/dist/types/components/q2-radio-group/index.d.ts +5 -1
  204. package/dist/types/components/q2-select/index.d.ts +2 -1
  205. package/dist/types/components/q2-stepper/index.d.ts +1 -1
  206. package/dist/types/components/q2-stepper-pane/index.d.ts +16 -1
  207. package/dist/types/components/q2-stepper-vertical/index.d.ts +52 -0
  208. package/dist/types/components/q2-tab-container/index.d.ts +1 -1
  209. package/dist/types/components/q2-tag/index.d.ts +28 -0
  210. package/dist/types/components/tecton-tab-pane/index.d.ts +2 -2
  211. package/dist/types/components.d.ts +235 -11
  212. package/dist/types/global.d.ts +1 -0
  213. package/dist/types/stencil-public-runtime.d.ts +6 -4
  214. package/dist/types/util.d.ts +2 -10
  215. package/dist/types/utils/index.d.ts +1 -0
  216. package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/elements/q2-tag-test.d.ts +1 -0
  217. package/dist/types/workspace/workspace/{_production_release_1.11.0-alpha → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +6 -3
  218. package/package.json +13 -13
  219. package/dist/q2-tecton-elements/p-06fff43d.entry.js +0 -1
  220. package/dist/q2-tecton-elements/p-080839ed.js +0 -1
  221. package/dist/q2-tecton-elements/p-29a37091.entry.js +0 -1
  222. package/dist/q2-tecton-elements/p-37aba2a4.js +0 -1
  223. package/dist/q2-tecton-elements/p-4cd00f1a.js +0 -1
  224. package/dist/q2-tecton-elements/p-6702eb4d.entry.js +0 -1
  225. package/dist/q2-tecton-elements/p-768e3a5d.entry.js +0 -1
  226. package/dist/q2-tecton-elements/p-843b1ee9.entry.js +0 -1
  227. package/dist/q2-tecton-elements/p-943c7745.entry.js +0 -1
  228. package/dist/q2-tecton-elements/p-95a73559.entry.js +0 -1
  229. package/dist/q2-tecton-elements/p-9a977ee6.entry.js +0 -1
  230. package/dist/q2-tecton-elements/p-b281c349.entry.js +0 -1
  231. package/dist/q2-tecton-elements/p-c5e55b9f.entry.js +0 -1
  232. package/dist/q2-tecton-elements/p-ccbe9158.entry.js +0 -1
  233. package/dist/q2-tecton-elements/p-db6f90ac.entry.js +0 -1
  234. package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +0 -1
@@ -0,0 +1,347 @@
1
+ import { Component, Prop, Event, h, Fragment, Listen, Element, State, Watch, } from '@stencil/core';
2
+ import { isTouchDevice, overrideFocus, isEventFromElement } from 'src/utils';
3
+ const SUPPORTED_THEME_COLORS = [
4
+ 'primary',
5
+ 'secondary',
6
+ 'tertiary',
7
+ 'accent-1',
8
+ 'accent-2',
9
+ 'accent-3',
10
+ 'accent-4',
11
+ 'accent-5',
12
+ 'accent-6',
13
+ 'accent-7',
14
+ 'accent-8',
15
+ 'accent-9',
16
+ 'accent-10',
17
+ 'accent-11',
18
+ 'accent-12',
19
+ ];
20
+ const STOPLIGHT_COLORS = ['info', 'success', 'warning', 'alert'];
21
+ export class Q2Card {
22
+ constructor() {
23
+ this.isTouch = isTouchDevice();
24
+ this.isAutoTouch = false;
25
+ this.isAutoSmall = false;
26
+ this.handleClick = (event) => {
27
+ if (this.url)
28
+ return true;
29
+ event.preventDefault();
30
+ event.stopPropagation();
31
+ this.click.emit();
32
+ };
33
+ }
34
+ componentWillLoad() {
35
+ this.checkBar();
36
+ }
37
+ componentDidLoad() {
38
+ const { hostElement, clickableElement } = this;
39
+ hostElement.click = () => clickableElement.click();
40
+ overrideFocus(this.hostElement);
41
+ this.resizeObserver = new ResizeObserver(() => this.determineAutoSmall());
42
+ this.resizeObserver.observe(this.hostElement);
43
+ }
44
+ willDestroyElement() {
45
+ this.resizeObserver = null;
46
+ }
47
+ onHostElementFocus(event) {
48
+ if (!isEventFromElement(event, this.hostElement))
49
+ return;
50
+ this.clickableElement.focus();
51
+ }
52
+ checkBar() {
53
+ const { bar } = this;
54
+ if (!bar)
55
+ return;
56
+ if (SUPPORTED_THEME_COLORS.includes(bar)) {
57
+ this.barColor = `var(--t-${bar})`;
58
+ }
59
+ else if (STOPLIGHT_COLORS.includes(bar)) {
60
+ this.barColor = `var(--const-stoplight-${bar})`;
61
+ }
62
+ else {
63
+ this.barColor = bar;
64
+ }
65
+ }
66
+ determineAutoTouch() {
67
+ if (this.hostElement.hasAttribute('is-touch'))
68
+ return;
69
+ this.isAutoTouch = isTouchDevice();
70
+ }
71
+ determineAutoSmall() {
72
+ var _a, _b;
73
+ if (this.hostElement.hasAttribute('is-small'))
74
+ return;
75
+ const { containerElement, avatarElement } = this;
76
+ const avatarWidth = (_a = avatarElement === null || avatarElement === void 0 ? void 0 : avatarElement.offsetWidth) !== null && _a !== void 0 ? _a : 0;
77
+ const containerWidth = (_b = containerElement === null || containerElement === void 0 ? void 0 : containerElement.offsetWidth) !== null && _b !== void 0 ? _b : 0;
78
+ const totalWidth = avatarWidth + containerWidth;
79
+ this.isAutoSmall = totalWidth < 350;
80
+ }
81
+ generateAvatar() {
82
+ const { avatarName, avatarInitials, avatarSrc, avatarIcon } = this;
83
+ if (avatarIcon) {
84
+ return (h("q2-icon", { type: avatarIcon, ref: e => (this.avatarElement = e), "test-id": "avatar" }));
85
+ }
86
+ else if (avatarName || avatarInitials || avatarSrc) {
87
+ return (h("q2-avatar", { name: avatarName, initials: avatarInitials, src: avatarSrc, ref: e => (this.avatarElement = e), "test-id": "avatar" }));
88
+ }
89
+ }
90
+ generateContent() {
91
+ return (h(Fragment, null,
92
+ this.bar && (h("div", { class: "bar", "test-id": "bar", style: { '--comp-bar-color': this.barColor } })),
93
+ this.generateAvatar(),
94
+ h("div", { class: "container", "test-id": "contentContainer", ref: e => (this.containerElement = e) },
95
+ this.title && h("h3", { "test-id": "title" }, this.title),
96
+ this.description && h("p", { "test-id": "description" }, this.description)),
97
+ this.isTouch && (h("q2-icon", { "test-id": "touchIndicator", type: "chevron-right", class: "touch-indicator" }))));
98
+ }
99
+ generateContainerClasses() {
100
+ const { isSmall, isAutoSmall, avatarName, avatarInitials, avatarSrc, avatarIcon, isTouch, isAutoTouch } = this;
101
+ const result = [];
102
+ const showSmall = isSmall || isAutoSmall;
103
+ const showTouch = isTouch || isAutoTouch;
104
+ const hasAvatar = avatarName || avatarInitials || avatarSrc || avatarIcon;
105
+ if (showSmall)
106
+ result.push('is-small');
107
+ if (showTouch)
108
+ result.push('is-touch');
109
+ if (hasAvatar)
110
+ result.push('has-avatar');
111
+ return result.join(' ');
112
+ }
113
+ render() {
114
+ const { url } = this;
115
+ return !!url ? (h("a", { ref: e => (this.clickableElement = e), href: this.url, class: this.generateContainerClasses(), target: this.target, rel: "noopener noreferrer", "test-id": "clickableElement", onClick: this.handleClick }, this.generateContent())) : (h("button", { ref: e => (this.clickableElement = e), class: this.generateContainerClasses(), "test-id": "clickableElement", type: "button", onClick: this.handleClick }, this.generateContent()));
116
+ }
117
+ static get is() { return "q2-card"; }
118
+ static get encapsulation() { return "shadow"; }
119
+ static get originalStyleUrls() { return {
120
+ "$": ["styles.scss"]
121
+ }; }
122
+ static get styleUrls() { return {
123
+ "$": ["styles.css"]
124
+ }; }
125
+ static get properties() { return {
126
+ "title": {
127
+ "type": "string",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "string",
131
+ "resolved": "string",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": ""
139
+ },
140
+ "attribute": "title",
141
+ "reflect": true
142
+ },
143
+ "description": {
144
+ "type": "string",
145
+ "mutable": false,
146
+ "complexType": {
147
+ "original": "string",
148
+ "resolved": "string",
149
+ "references": {}
150
+ },
151
+ "required": false,
152
+ "optional": false,
153
+ "docs": {
154
+ "tags": [],
155
+ "text": ""
156
+ },
157
+ "attribute": "description",
158
+ "reflect": true
159
+ },
160
+ "avatarName": {
161
+ "type": "string",
162
+ "mutable": false,
163
+ "complexType": {
164
+ "original": "string",
165
+ "resolved": "string",
166
+ "references": {}
167
+ },
168
+ "required": false,
169
+ "optional": false,
170
+ "docs": {
171
+ "tags": [],
172
+ "text": ""
173
+ },
174
+ "attribute": "avatar-name",
175
+ "reflect": true
176
+ },
177
+ "avatarInitials": {
178
+ "type": "string",
179
+ "mutable": false,
180
+ "complexType": {
181
+ "original": "string",
182
+ "resolved": "string",
183
+ "references": {}
184
+ },
185
+ "required": false,
186
+ "optional": false,
187
+ "docs": {
188
+ "tags": [],
189
+ "text": ""
190
+ },
191
+ "attribute": "avatar-initials",
192
+ "reflect": true
193
+ },
194
+ "avatarIcon": {
195
+ "type": "string",
196
+ "mutable": false,
197
+ "complexType": {
198
+ "original": "string",
199
+ "resolved": "string",
200
+ "references": {}
201
+ },
202
+ "required": false,
203
+ "optional": false,
204
+ "docs": {
205
+ "tags": [],
206
+ "text": ""
207
+ },
208
+ "attribute": "avatar-icon",
209
+ "reflect": true
210
+ },
211
+ "avatarSrc": {
212
+ "type": "string",
213
+ "mutable": false,
214
+ "complexType": {
215
+ "original": "string",
216
+ "resolved": "string",
217
+ "references": {}
218
+ },
219
+ "required": false,
220
+ "optional": false,
221
+ "docs": {
222
+ "tags": [],
223
+ "text": ""
224
+ },
225
+ "attribute": "avatar-src",
226
+ "reflect": true
227
+ },
228
+ "isSmall": {
229
+ "type": "boolean",
230
+ "mutable": false,
231
+ "complexType": {
232
+ "original": "boolean",
233
+ "resolved": "boolean",
234
+ "references": {}
235
+ },
236
+ "required": false,
237
+ "optional": false,
238
+ "docs": {
239
+ "tags": [],
240
+ "text": ""
241
+ },
242
+ "attribute": "is-small",
243
+ "reflect": true
244
+ },
245
+ "bar": {
246
+ "type": "string",
247
+ "mutable": false,
248
+ "complexType": {
249
+ "original": "string",
250
+ "resolved": "string",
251
+ "references": {}
252
+ },
253
+ "required": false,
254
+ "optional": false,
255
+ "docs": {
256
+ "tags": [],
257
+ "text": ""
258
+ },
259
+ "attribute": "bar",
260
+ "reflect": true
261
+ },
262
+ "isTouch": {
263
+ "type": "boolean",
264
+ "mutable": false,
265
+ "complexType": {
266
+ "original": "boolean",
267
+ "resolved": "boolean",
268
+ "references": {}
269
+ },
270
+ "required": false,
271
+ "optional": false,
272
+ "docs": {
273
+ "tags": [],
274
+ "text": ""
275
+ },
276
+ "attribute": "is-touch",
277
+ "reflect": true,
278
+ "defaultValue": "isTouchDevice()"
279
+ },
280
+ "url": {
281
+ "type": "string",
282
+ "mutable": false,
283
+ "complexType": {
284
+ "original": "string",
285
+ "resolved": "string",
286
+ "references": {}
287
+ },
288
+ "required": false,
289
+ "optional": false,
290
+ "docs": {
291
+ "tags": [],
292
+ "text": ""
293
+ },
294
+ "attribute": "url",
295
+ "reflect": true
296
+ },
297
+ "target": {
298
+ "type": "string",
299
+ "mutable": false,
300
+ "complexType": {
301
+ "original": "'_self' | '_blank' | '_parent' | '_top'",
302
+ "resolved": "\"_blank\" | \"_parent\" | \"_self\" | \"_top\"",
303
+ "references": {}
304
+ },
305
+ "required": false,
306
+ "optional": false,
307
+ "docs": {
308
+ "tags": [],
309
+ "text": ""
310
+ },
311
+ "attribute": "target",
312
+ "reflect": true
313
+ }
314
+ }; }
315
+ static get states() { return {
316
+ "isAutoTouch": {},
317
+ "isAutoSmall": {}
318
+ }; }
319
+ static get events() { return [{
320
+ "method": "click",
321
+ "name": "click",
322
+ "bubbles": true,
323
+ "cancelable": true,
324
+ "composed": true,
325
+ "docs": {
326
+ "tags": [],
327
+ "text": ""
328
+ },
329
+ "complexType": {
330
+ "original": "any",
331
+ "resolved": "any",
332
+ "references": {}
333
+ }
334
+ }]; }
335
+ static get elementRef() { return "hostElement"; }
336
+ static get watchers() { return [{
337
+ "propName": "bar",
338
+ "methodName": "checkBar"
339
+ }]; }
340
+ static get listeners() { return [{
341
+ "name": "focus",
342
+ "method": "onHostElementFocus",
343
+ "target": undefined,
344
+ "capture": false,
345
+ "passive": false
346
+ }]; }
347
+ }
@@ -0,0 +1,177 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ *:active {
6
+ outline: none;
7
+ }
8
+
9
+ *:focus {
10
+ outline: none;
11
+ box-shadow: var(--const-global-focus);
12
+ }
13
+
14
+ :host {
15
+ box-shadow: none !important;
16
+ }
17
+
18
+ ::-moz-focus-inner {
19
+ border: none;
20
+ }
21
+
22
+ input,
23
+ textarea,
24
+ button {
25
+ font-family: inherit;
26
+ font-size: inherit;
27
+ }
28
+
29
+ :host(.sr),
30
+ :host(.sr) button {
31
+ border: 0;
32
+ clip: rect(0 0 0 0);
33
+ height: 1px;
34
+ margin: -1px;
35
+ overflow: hidden;
36
+ padding: 0;
37
+ position: absolute;
38
+ width: 1px;
39
+ white-space: nowrap;
40
+ }
41
+
42
+ .sr,
43
+ .sr button {
44
+ border: 0;
45
+ clip: rect(0 0 0 0);
46
+ height: 1px;
47
+ margin: -1px;
48
+ overflow: hidden;
49
+ padding: 0;
50
+ position: absolute;
51
+ width: 1px;
52
+ white-space: nowrap;
53
+ }
54
+
55
+ .hidden {
56
+ display: none;
57
+ }
58
+
59
+ :host([hidden]) {
60
+ display: none;
61
+ }
62
+
63
+ .invisible {
64
+ visibility: hidden;
65
+ }
66
+
67
+ :host {
68
+ display: block;
69
+ }
70
+
71
+ button,
72
+ a {
73
+ --comp-border-radius: var(--tct-card-border-radius, var(--t-card-border-radius, var(--app-border-radius-1, 3px)));
74
+ --comp-border-width: var(--tct-card-border-width, var(--t-card-border-width, 0px));
75
+ position: relative;
76
+ width: 100%;
77
+ text-align: start;
78
+ cursor: pointer;
79
+ height: 100%;
80
+ display: grid;
81
+ gap: var(--tct-card-gap, var(--t-card-gap, var(--app-scale-3x, 15px)));
82
+ margin: 0;
83
+ border: none;
84
+ background: var(--tct-card-background, var(--t-card-background, var(--t-base, #ffffff)));
85
+ padding: var(--tct-card-padding, var(--t-card-padding, var(--app-scale-4x, 20px)));
86
+ color: var(--tct-card-color, var(--t-card-color, var(--t-text, #4d4d4d)));
87
+ text-decoration: none;
88
+ border-width: var(--comp-border-width);
89
+ border-color: var(--tct-card-border-color, var(--t-card-border-color, transparent));
90
+ border-style: solid;
91
+ border-radius: var(--comp-border-radius);
92
+ transition: box-shadow var(--tct-tween-1, var(--app-tween-1, 0.2s ease));
93
+ box-shadow: var(--tct-card-box-shadow, var(--t-card-box-shadow, var(--app-shadow-2, 0 3px 6px rgba(0, 0, 0, 0.3))));
94
+ --comp-avatar-size: var(--tct-card-avatar-size, var(--t-card-avatar-size, 44px));
95
+ --comp-chevron-size: 0;
96
+ }
97
+ @media (hover: hover) {
98
+ button:hover, button:active, button:focus,
99
+ a:hover,
100
+ a:active,
101
+ a:focus {
102
+ color: var(--tct-card-color, var(--t-card-color, var(--t-text, #4d4d4d)));
103
+ }
104
+ button:hover,
105
+ a:hover {
106
+ box-shadow: var(--tct-card-hover-box-shadow, var(--t-card-hover-box-shadow, var(--app-shadow-3, 0 4px 12px rgba(0, 0, 0, 0.3))));
107
+ }
108
+ button:active,
109
+ a:active {
110
+ box-shadow: var(--tct-card-active-box-shadow, var(--t-card-active-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))));
111
+ }
112
+ }
113
+ button.is-small,
114
+ a.is-small {
115
+ --comp-avatar-size: var(--tct-card-avatar-size, var(--t-card-avatar-size, 26px));
116
+ }
117
+ button.is-touch,
118
+ a.is-touch {
119
+ --comp-chevron-size: var(--tct-card-chevron-size, var(--t-card-chevron-size, 26px));
120
+ grid-template-columns: 1fr var(--comp-chevron-size);
121
+ }
122
+ button.has-avatar,
123
+ a.has-avatar {
124
+ grid-template-columns: var(--comp-avatar-size) 1fr;
125
+ --tct-avatar-width: var(--comp-avatar-size);
126
+ --tct-avatar-height: var(--comp-avatar-size);
127
+ --tct-icon-size: var(--comp-avatar-size);
128
+ }
129
+ button.has-avatar.is-touch,
130
+ a.has-avatar.is-touch {
131
+ grid-template-columns: var(--comp-avatar-size) 1fr var(--comp-chevron-size);
132
+ }
133
+
134
+ .container {
135
+ overflow: hidden;
136
+ display: grid;
137
+ gap: var(--tct-card-container-gap, var(--t-card-container-gap, var(--app-scale-1x, 5px)));
138
+ align-content: start;
139
+ }
140
+
141
+ h3,
142
+ p {
143
+ margin: 0;
144
+ padding: 0;
145
+ line-height: var(--tct-card-font-height, var(--t-card-font-height, 20px));
146
+ }
147
+
148
+ h3 {
149
+ font-weight: var(--tct-card-font-weight, var(--t-card-font-weight, 600));
150
+ font-size: var(--tct-card-font-size, var(--t-card-font-size, 17px));
151
+ text-overflow: ellipsis;
152
+ overflow: hidden;
153
+ white-space: nowrap;
154
+ }
155
+
156
+ p {
157
+ text-overflow: ellipsis;
158
+ overflow: hidden;
159
+ display: -webkit-box;
160
+ -webkit-line-clamp: 2;
161
+ -webkit-box-orient: vertical;
162
+ }
163
+
164
+ .bar {
165
+ --comp-bar-border-radius: calc(var(--comp-border-radius) - var(--comp-border-width));
166
+ border-radius: var(--comp-bar-border-radius) 0 0 var(--comp-bar-border-radius);
167
+ position: absolute;
168
+ inset: 0 auto auto 0;
169
+ width: var(--tct-card-bar-width, var(--t-card-bar-width, var(--app-scale-2x, 10px)));
170
+ background: var(--comp-bar-color);
171
+ height: 100%;
172
+ }
173
+
174
+ .touch-indicator {
175
+ align-self: center;
176
+ --tct-icon-size: var(--comp-chevron-size);
177
+ }
@@ -1,4 +1,4 @@
1
- import { Component, Prop, Watch, State, Fragment, Element, Host, h, Event, Listen } from '@stencil/core';
1
+ import { Component, Prop, Watch, State, Fragment, Element, Host, h, Event, Listen, } from '@stencil/core';
2
2
  import Swiper, { Autoplay } from 'swiper';
3
3
  import { createGuid, loc, handleAriaLabel, overrideFocus, isEventFromElement } from 'src/utils';
4
4
  const carouselBreakpoint = 500; /* width in px of this host element where the layout starts to get unruly */
@@ -31,10 +31,10 @@ export class Q2Carousel {
31
31
  }
32
32
  else if (isCarouselFocused)
33
33
  swiper.slides[swiper.activeIndex].focus({
34
- preventScroll: true
34
+ preventScroll: true,
35
35
  });
36
- }
37
- }
36
+ },
37
+ },
38
38
  };
39
39
  this.fullWidthDisplayOptions = Object.assign({ slidesPerView: 1, spaceBetween: 100 }, this.universalCarouselOptions);
40
40
  this.activePaneIndex = this.realIndex;
@@ -75,7 +75,7 @@ export class Q2Carousel {
75
75
  });
76
76
  };
77
77
  this.handleAutoPlayPause = () => {
78
- const { swiper: { autoplay } } = this;
78
+ const { swiper: { autoplay }, } = this;
79
79
  if (!autoplay)
80
80
  return;
81
81
  if (autoplay === null || autoplay === void 0 ? void 0 : autoplay.running)
@@ -149,25 +149,20 @@ export class Q2Carousel {
149
149
  if (this.dynamicPaginationDots)
150
150
  paginationContainerClasses = [...paginationContainerClasses, 'dynamic'];
151
151
  return (h("div", { class: paginationContainerClasses.join(' '), role: "tablist", "aria-label": loc('tecton.element.carousel.tabWrapperLabel') }, this.paneArray.map(pane => {
152
- let btnClasses = [
153
- 'q2-carousel-page-indicator',
154
- `q2-carousel-page-indicator-${pane.index}`
155
- ];
152
+ let btnClasses = ['q2-carousel-page-indicator', `q2-carousel-page-indicator-${pane.index}`];
156
153
  if (pane.isActivePane)
157
154
  btnClasses = [...btnClasses, 'active-page'];
158
155
  if (this.dynamicPaginationDots)
159
156
  btnClasses = [...btnClasses, 'dynamic'];
160
- let withinOneOfActive = pane.index === this.activePaneIndex + 1 ||
161
- pane.index === this.activePaneIndex - 1;
157
+ const withinOneOfActive = pane.index === this.activePaneIndex + 1 || pane.index === this.activePaneIndex - 1;
162
158
  if (withinOneOfActive)
163
159
  btnClasses = [...btnClasses, 'active-adjacent'];
164
- let withinTwoOfActive = pane.index === this.activePaneIndex + 2 ||
165
- pane.index === this.activePaneIndex - 2;
160
+ const withinTwoOfActive = pane.index === this.activePaneIndex + 2 || pane.index === this.activePaneIndex - 2;
166
161
  if (withinTwoOfActive)
167
162
  btnClasses = [...btnClasses, 'active-adjacent-adjacent'];
168
163
  return (h("button", { type: "button", role: "tab", tabIndex: pane.isActivePane ? undefined : -1, "aria-selected": pane.isActivePane ? 'true' : 'false', class: btnClasses.join(' '), onClick: () => this.handleCarouselNavigationSelection(pane.index, true), onKeyDown: event => this.onPaginationKeyDown(event), "aria-label": loc('tecton.element.carousel.itemDescription', [
169
164
  (pane.index + 1).toString(),
170
- this.paneCount.toString()
165
+ this.paneCount.toString(),
171
166
  ]) }));
172
167
  })));
173
168
  };
@@ -192,7 +187,7 @@ export class Q2Carousel {
192
187
  this.insufficientPanesDisplay = () => {
193
188
  let insufficientPanesContainerClasses = [
194
189
  'insufficient-pane-feedback',
195
- this.fullWidthPanes ? 'full-width-display' : 'content-peek-display'
190
+ this.fullWidthPanes ? 'full-width-display' : 'content-peek-display',
196
191
  ];
197
192
  if (this.compactMode)
198
193
  insufficientPanesContainerClasses = [...insufficientPanesContainerClasses, 'compact'];
@@ -285,7 +280,7 @@ export class Q2Carousel {
285
280
  let carouselContainerClasses = [
286
281
  'q2-carousel-swiper-container',
287
282
  'swiper-container',
288
- this.fullWidthPanes ? 'full-width-display' : 'content-peek-display'
283
+ this.fullWidthPanes ? 'full-width-display' : 'content-peek-display',
289
284
  ];
290
285
  if (this.compactMode)
291
286
  carouselContainerClasses = [...carouselContainerClasses, 'compact'];
@@ -93,12 +93,11 @@ q2-carousel {
93
93
 
94
94
  .insufficient-pane-feedback {
95
95
  text-align: center;
96
- box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.25);
96
+ box-shadow: var(--app-shadow-2, 0px 2px 8px 0px rgba(0, 0, 0, 0.25));
97
97
  background-color: var(--tct-carousel-background-color, var(--t-carousel-background-color, var(--tct-white, var(--app-white, #ffffff))));
98
98
  border: var(--tct-carousel-pane-border-width, var(--t-carousel-pane-border-width, 1px)) solid var(--tct-carousel-pane-border-color, var(--t-carousel-pane-border-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))));
99
99
  border-radius: var(--tct-carousel-pane-border-radius, var(--t-carousel-pane-border-radius, 8px));
100
100
  padding: var(--tct-carousel-pane-padding, var(--t-carousel-pane-padding, 0.5rem 0.5rem 0.5rem 0.5rem));
101
- min-height: 10em;
102
101
  }
103
102
  .insufficient-pane-feedback.content-peek-display {
104
103
  max-width: 395px;
@@ -128,6 +127,8 @@ q2-carousel {
128
127
  display: flex;
129
128
  justify-content: center;
130
129
  align-items: center;
130
+ margin-top: var(--app-scale-2x, 10px);
131
+ min-height: 44px;
131
132
  }
132
133
  .q2-carousel-pagination-navigation-wrapper.evenly-space {
133
134
  justify-content: space-between;
@@ -192,7 +193,6 @@ q2-carousel {
192
193
  .q2-carousel-swiper-container .swiper-wrapper {
193
194
  position: relative;
194
195
  width: 100%;
195
- min-height: 12em;
196
196
  z-index: 1;
197
197
  display: flex;
198
198
  transition-property: transform;
@@ -11,7 +11,7 @@ export class Q2Carousel {
11
11
  event.preventDefault();
12
12
  this.clickCarouselPane.emit({
13
13
  paneIndex: this.index,
14
- pane: this.hostElement
14
+ pane: this.hostElement,
15
15
  });
16
16
  };
17
17
  }
@@ -52,7 +52,7 @@ export class Q2Carousel {
52
52
  ? loc(label)
53
53
  : loc('tecton.element.carousel.itemDescription', [
54
54
  (this.currentPaneIndex + 1).toString(),
55
- (this.siblingCount || 0).toString()
55
+ (this.siblingCount || 0).toString(),
56
56
  ]), onClick: this.paneClicked },
57
57
  h("article", { class: "q2-carousel-pane-main-content" },
58
58
  h("slot", null))));
@@ -74,6 +74,7 @@ q2-carousel .swiper-slide {
74
74
  }
75
75
 
76
76
  q2-carousel-pane.q2-carousel-pane {
77
+ --comp-carousel-pane-tween: var(--tct-tween-1, var(--app-tween-1, 0.2s ease));
77
78
  cursor: grab;
78
79
  }
79
80
  q2-carousel-pane.q2-carousel-pane:not([is-active-pane]) * {
@@ -87,10 +88,14 @@ q2-carousel-pane.q2-carousel-pane:focus .q2-carousel-pane-main-content {
87
88
  box-shadow: var(--tct-global-focus, var(--const-global-focus, 0 0 0 2px #33b4ff));
88
89
  }
89
90
  q2-carousel-pane.q2-carousel-pane .q2-carousel-pane-main-content {
90
- box-shadow: 0px 2px 8px 0px var(--t-top-a1, rgba(0, 0, 0, 0.25));
91
+ box-shadow: var(--app-shadow-2, 0px 2px 8px 0px var(--t-top-a1, rgba(0, 0, 0, 0.25)));
92
+ transition: var(--comp-carousel-pane-tween);
91
93
  background-color: var(--tct-carousel-background-color, var(--t-carousel-background-color, var(--tct-white, var(--app-white, #ffffff))));
92
- border: var(--tct-carousel-pane-border-width, var(--t-carousel-pane-border-width, 1px)) solid var(--tct-carousel-pane-border-color, var(--t-carousel-pane-border-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))));
94
+ border: var(--tct-carousel-pane-border-width, var(--t-carousel-pane-border-width, 0px)) solid var(--tct-carousel-pane-border-color, var(--t-carousel-pane-border-color, var(--tct-gray-11, var(--t-gray-11, var(--tct-gray-l1, var(--app-gray-l1, #cccccc))))));
93
95
  border-radius: var(--tct-carousel-pane-border-radius, var(--t-carousel-pane-border-radius, 8px));
94
96
  padding: var(--tct-carousel-pane-padding, var(--t-carousel-pane-padding, 0.5rem 0.5rem 0.5rem 0.5rem));
95
- min-height: 10em;
97
+ height: var(--tct-carousel-pane-height, var(--t-carousel-pane-height, 10em));
98
+ }
99
+ q2-carousel-pane.q2-carousel-pane .q2-carousel-pane-main-content:hover {
100
+ box-shadow: var(--app-shadow-3, 0px 2px 8px 0px var(--t-top-a1, rgba(0, 0, 0, 0.25)));
96
101
  }