q2-tecton-elements 1.58.3 → 1.59.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 (275) hide show
  1. package/dist/bundle-report.json +271 -212
  2. package/dist/cjs/{index-rwi7bp0v.js → index-B6mUspT0.js} +37 -2
  3. package/dist/cjs/index-B6mUspT0.js.map +1 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/q2-action-group_2.cjs.entry.js +2 -2
  6. package/dist/cjs/q2-action-sheet.cjs.entry.js +1 -1
  7. package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
  8. package/dist/cjs/q2-avatar.cjs.entry.js.map +1 -1
  9. package/dist/cjs/q2-avatar.entry.cjs.js.map +1 -1
  10. package/dist/cjs/q2-badge.q2-btn.q2-icon.q2-input.q2-loading.q2-tab-container.q2-tab-pane.entry.cjs.js.map +1 -1
  11. package/dist/cjs/q2-badge_7.cjs.entry.js +10 -9
  12. package/dist/cjs/q2-badge_7.cjs.entry.js.map +1 -1
  13. package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
  14. package/dist/cjs/q2-card.cjs.entry.js +2 -2
  15. package/dist/cjs/q2-card.cjs.entry.js.map +1 -1
  16. package/dist/cjs/q2-card.entry.cjs.js.map +1 -1
  17. package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
  18. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  19. package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
  20. package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
  22. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  23. package/dist/cjs/q2-checkbox.cjs.entry.js +3 -3
  24. package/dist/cjs/q2-checkbox.cjs.entry.js.map +1 -1
  25. package/dist/cjs/q2-checkbox.entry.cjs.js.map +1 -1
  26. package/dist/cjs/q2-context.cjs.entry.js +1 -1
  27. package/dist/cjs/q2-currency.cjs.entry.js +24 -11
  28. package/dist/cjs/q2-currency.cjs.entry.js.map +1 -1
  29. package/dist/cjs/q2-currency.entry.cjs.js.map +1 -1
  30. package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
  31. package/dist/cjs/q2-detail.cjs.entry.js +2 -2
  32. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  33. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  34. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  35. package/dist/cjs/q2-example.cjs.entry.js +1 -1
  36. package/dist/cjs/q2-file-picker.cjs.entry.js +1 -1
  37. package/dist/cjs/q2-form.cjs.entry.js +1 -1
  38. package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
  39. package/dist/cjs/q2-item.cjs.entry.js +2 -2
  40. package/dist/cjs/q2-legend.cjs.entry.js +1 -1
  41. package/dist/cjs/q2-link_2.cjs.entry.js +2 -2
  42. package/dist/cjs/q2-loc.cjs.entry.js +1 -1
  43. package/dist/cjs/q2-message.cjs.entry.js +2 -2
  44. package/dist/cjs/q2-modal.cjs.entry.js +2 -2
  45. package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
  46. package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
  47. package/dist/cjs/q2-option-list_2.cjs.entry.js +1 -1
  48. package/dist/cjs/q2-option.cjs.entry.js +1 -1
  49. package/dist/cjs/q2-pagination.cjs.entry.js +4 -4
  50. package/dist/cjs/q2-pill.cjs.entry.js +2 -2
  51. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  52. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  53. package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
  54. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  55. package/dist/cjs/q2-select.cjs.entry.js +17 -9
  56. package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
  57. package/dist/cjs/q2-select.entry.cjs.js.map +1 -1
  58. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  59. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
  60. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  61. package/dist/cjs/q2-tag.cjs.entry.js +2 -2
  62. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  63. package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
  64. package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
  65. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  66. package/dist/collection/components/q2-avatar/q2-avatar.css +1 -0
  67. package/dist/collection/components/q2-badge/q2-badge.css +2 -0
  68. package/dist/collection/components/q2-btn/q2-btn.css +7 -0
  69. package/dist/collection/components/q2-card/q2-card.css +1 -0
  70. package/dist/collection/components/q2-checkbox/q2-checkbox.css +26 -9
  71. package/dist/collection/components/q2-checkbox/q2-checkbox.js +1 -1
  72. package/dist/collection/components/q2-checkbox/q2-checkbox.js.map +1 -1
  73. package/dist/collection/components/q2-currency/q2-currency.css +42 -4
  74. package/dist/collection/components/q2-currency/q2-currency.js +47 -13
  75. package/dist/collection/components/q2-currency/q2-currency.js.map +1 -1
  76. package/dist/collection/components/q2-detail/q2-detail.js +1 -1
  77. package/dist/collection/components/q2-example/q2-example.js +1 -1
  78. package/dist/collection/components/q2-form/q2-form.js +1 -1
  79. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
  80. package/dist/collection/components/q2-input/q2-input.js +7 -6
  81. package/dist/collection/components/q2-input/q2-input.js.map +1 -1
  82. package/dist/collection/components/q2-item/q2-item.js +1 -1
  83. package/dist/collection/components/q2-legend/q2-legend.js +1 -1
  84. package/dist/collection/components/q2-list/q2-list.js +1 -1
  85. package/dist/collection/components/q2-message/q2-message.js +1 -1
  86. package/dist/collection/components/q2-modal/q2-modal.js +1 -1
  87. package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
  88. package/dist/collection/components/q2-pagination/q2-pagination.js +3 -3
  89. package/dist/collection/components/q2-pill/q2-pill.js +1 -1
  90. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  91. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
  92. package/dist/collection/components/q2-section/q2-section.js +2 -2
  93. package/dist/collection/components/q2-select/q2-select.js +23 -9
  94. package/dist/collection/components/q2-select/q2-select.js.map +1 -1
  95. package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
  96. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
  97. package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
  98. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  99. package/dist/collection/components/q2-tag/q2-tag.js +1 -1
  100. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  101. package/dist/collection/utils/helpers.js +39 -66
  102. package/dist/collection/utils/helpers.js.map +1 -1
  103. package/dist/collection/utils/index.js +34 -0
  104. package/dist/collection/utils/index.js.map +1 -1
  105. package/dist/components/index2.js +35 -1
  106. package/dist/components/index2.js.map +1 -1
  107. package/dist/components/q2-avatar2.js +1 -1
  108. package/dist/components/q2-avatar2.js.map +1 -1
  109. package/dist/components/q2-badge2.js +1 -1
  110. package/dist/components/q2-badge2.js.map +1 -1
  111. package/dist/components/q2-btn2.js +1 -1
  112. package/dist/components/q2-btn2.js.map +1 -1
  113. package/dist/components/q2-card.js +1 -1
  114. package/dist/components/q2-card.js.map +1 -1
  115. package/dist/components/q2-checkbox2.js +2 -2
  116. package/dist/components/q2-checkbox2.js.map +1 -1
  117. package/dist/components/q2-currency.js +27 -12
  118. package/dist/components/q2-currency.js.map +1 -1
  119. package/dist/components/q2-detail.js +1 -1
  120. package/dist/components/q2-example.js +1 -1
  121. package/dist/components/q2-form.js +1 -1
  122. package/dist/components/q2-formatted-text.js +1 -1
  123. package/dist/components/q2-input2.js +5 -4
  124. package/dist/components/q2-input2.js.map +1 -1
  125. package/dist/components/q2-item2.js +1 -1
  126. package/dist/components/q2-legend2.js +1 -1
  127. package/dist/components/q2-list2.js +1 -1
  128. package/dist/components/q2-message2.js +1 -1
  129. package/dist/components/q2-modal.js +1 -1
  130. package/dist/components/q2-optgroup2.js +1 -1
  131. package/dist/components/q2-pagination.js +3 -3
  132. package/dist/components/q2-pill.js +1 -1
  133. package/dist/components/q2-relative-time.js +1 -1
  134. package/dist/components/q2-resize-observer2.js +1 -1
  135. package/dist/components/q2-section.js +2 -2
  136. package/dist/components/q2-select2.js +18 -10
  137. package/dist/components/q2-select2.js.map +1 -1
  138. package/dist/components/q2-stepper-vertical.js +1 -1
  139. package/dist/components/q2-stepper.js +1 -1
  140. package/dist/components/q2-tab-container.js +1 -1
  141. package/dist/components/q2-tab-pane.js +1 -1
  142. package/dist/components/q2-tag.js +1 -1
  143. package/dist/components/tecton-tab-pane.js +2 -2
  144. package/dist/esm/{index-EcLnUn1d.js → index-CkXFIBxL.js} +37 -3
  145. package/dist/esm/index-CkXFIBxL.js.map +1 -0
  146. package/dist/esm/loader.js +1 -1
  147. package/dist/esm/q2-action-group_2.entry.js +2 -2
  148. package/dist/esm/q2-action-sheet.entry.js +1 -1
  149. package/dist/esm/q2-avatar.entry.js +1 -1
  150. package/dist/esm/q2-avatar.entry.js.map +1 -1
  151. package/dist/esm/q2-badge.q2-btn.q2-icon.q2-input.q2-loading.q2-tab-container.q2-tab-pane.entry.js.map +1 -1
  152. package/dist/esm/q2-badge_7.entry.js +10 -9
  153. package/dist/esm/q2-badge_7.entry.js.map +1 -1
  154. package/dist/esm/q2-calendar.entry.js +1 -1
  155. package/dist/esm/q2-card.entry.js +2 -2
  156. package/dist/esm/q2-card.entry.js.map +1 -1
  157. package/dist/esm/q2-carousel-pane.entry.js +1 -1
  158. package/dist/esm/q2-carousel.entry.js +1 -1
  159. package/dist/esm/q2-chart-area.entry.js +1 -1
  160. package/dist/esm/q2-chart-bar.entry.js +1 -1
  161. package/dist/esm/q2-chart-donut.entry.js +1 -1
  162. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  163. package/dist/esm/q2-checkbox.entry.js +3 -3
  164. package/dist/esm/q2-checkbox.entry.js.map +1 -1
  165. package/dist/esm/q2-context.entry.js +1 -1
  166. package/dist/esm/q2-currency.entry.js +24 -11
  167. package/dist/esm/q2-currency.entry.js.map +1 -1
  168. package/dist/esm/q2-data-table.entry.js +1 -1
  169. package/dist/esm/q2-detail.entry.js +2 -2
  170. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  171. package/dist/esm/q2-dropdown.entry.js +1 -1
  172. package/dist/esm/q2-editable-field.entry.js +1 -1
  173. package/dist/esm/q2-example.entry.js +1 -1
  174. package/dist/esm/q2-file-picker.entry.js +1 -1
  175. package/dist/esm/q2-form.entry.js +1 -1
  176. package/dist/esm/q2-formatted-text.entry.js +1 -1
  177. package/dist/esm/q2-item.entry.js +2 -2
  178. package/dist/esm/q2-legend.entry.js +1 -1
  179. package/dist/esm/q2-link_2.entry.js +2 -2
  180. package/dist/esm/q2-loc.entry.js +1 -1
  181. package/dist/esm/q2-message.entry.js +2 -2
  182. package/dist/esm/q2-modal.entry.js +2 -2
  183. package/dist/esm/q2-month-picker.entry.js +1 -1
  184. package/dist/esm/q2-optgroup.entry.js +2 -2
  185. package/dist/esm/q2-option-list_2.entry.js +1 -1
  186. package/dist/esm/q2-option.entry.js +1 -1
  187. package/dist/esm/q2-pagination.entry.js +4 -4
  188. package/dist/esm/q2-pill.entry.js +2 -2
  189. package/dist/esm/q2-radio-group.entry.js +1 -1
  190. package/dist/esm/q2-radio.entry.js +1 -1
  191. package/dist/esm/q2-relative-time.entry.js +2 -2
  192. package/dist/esm/q2-section.entry.js +3 -3
  193. package/dist/esm/q2-select.entry.js +17 -9
  194. package/dist/esm/q2-select.entry.js.map +1 -1
  195. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  196. package/dist/esm/q2-stepper-vertical.entry.js +2 -2
  197. package/dist/esm/q2-stepper.entry.js +2 -2
  198. package/dist/esm/q2-tag.entry.js +2 -2
  199. package/dist/esm/q2-tecton-elements.js +1 -1
  200. package/dist/esm/q2-textarea.entry.js +1 -1
  201. package/dist/esm/q2-tooltip.entry.js +1 -1
  202. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  203. package/dist/q2-tecton-elements/{index-EcLnUn1d.js → index-CkXFIBxL.js} +53 -18
  204. package/dist/q2-tecton-elements/index-CkXFIBxL.js.map +1 -0
  205. package/dist/q2-tecton-elements/q2-action-group_2.entry.js +2 -2
  206. package/dist/q2-tecton-elements/q2-action-sheet.entry.js +1 -1
  207. package/dist/q2-tecton-elements/q2-avatar.entry.esm.js.map +1 -1
  208. package/dist/q2-tecton-elements/q2-avatar.entry.js +1 -1
  209. package/dist/q2-tecton-elements/q2-avatar.entry.js.map +1 -1
  210. package/dist/q2-tecton-elements/q2-badge.q2-btn.q2-icon.q2-input.q2-loading.q2-tab-container.q2-tab-pane.entry.esm.js.map +1 -1
  211. package/dist/q2-tecton-elements/q2-badge_7.entry.js +79 -77
  212. package/dist/q2-tecton-elements/q2-badge_7.entry.js.map +1 -1
  213. package/dist/q2-tecton-elements/q2-calendar.entry.js +1 -1
  214. package/dist/q2-tecton-elements/q2-card.entry.esm.js.map +1 -1
  215. package/dist/q2-tecton-elements/q2-card.entry.js +2 -2
  216. package/dist/q2-tecton-elements/q2-card.entry.js.map +1 -1
  217. package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +1 -1
  218. package/dist/q2-tecton-elements/q2-carousel.entry.js +1 -1
  219. package/dist/q2-tecton-elements/q2-chart-area.entry.js +1 -1
  220. package/dist/q2-tecton-elements/q2-chart-bar.entry.js +1 -1
  221. package/dist/q2-tecton-elements/q2-chart-donut.entry.js +5 -5
  222. package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +1 -1
  223. package/dist/q2-tecton-elements/q2-checkbox.entry.esm.js.map +1 -1
  224. package/dist/q2-tecton-elements/q2-checkbox.entry.js +36 -34
  225. package/dist/q2-tecton-elements/q2-checkbox.entry.js.map +1 -1
  226. package/dist/q2-tecton-elements/q2-context.entry.js +1 -1
  227. package/dist/q2-tecton-elements/q2-currency.entry.esm.js.map +1 -1
  228. package/dist/q2-tecton-elements/q2-currency.entry.js +45 -29
  229. package/dist/q2-tecton-elements/q2-currency.entry.js.map +1 -1
  230. package/dist/q2-tecton-elements/q2-data-table.entry.js +1 -1
  231. package/dist/q2-tecton-elements/q2-detail.entry.js +4 -4
  232. package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +4 -4
  233. package/dist/q2-tecton-elements/q2-dropdown.entry.js +1 -1
  234. package/dist/q2-tecton-elements/q2-editable-field.entry.js +1 -1
  235. package/dist/q2-tecton-elements/q2-example.entry.js +1 -1
  236. package/dist/q2-tecton-elements/q2-file-picker.entry.js +1 -1
  237. package/dist/q2-tecton-elements/q2-form.entry.js +7 -7
  238. package/dist/q2-tecton-elements/q2-formatted-text.entry.js +2 -2
  239. package/dist/q2-tecton-elements/q2-item.entry.js +13 -13
  240. package/dist/q2-tecton-elements/q2-legend.entry.js +2 -2
  241. package/dist/q2-tecton-elements/q2-link_2.entry.js +7 -7
  242. package/dist/q2-tecton-elements/q2-loc.entry.js +1 -1
  243. package/dist/q2-tecton-elements/q2-message.entry.js +6 -6
  244. package/dist/q2-tecton-elements/q2-modal.entry.js +18 -18
  245. package/dist/q2-tecton-elements/q2-month-picker.entry.js +1 -1
  246. package/dist/q2-tecton-elements/q2-optgroup.entry.js +5 -5
  247. package/dist/q2-tecton-elements/q2-option-list_2.entry.js +1 -1
  248. package/dist/q2-tecton-elements/q2-option.entry.js +1 -1
  249. package/dist/q2-tecton-elements/q2-pagination.entry.js +28 -28
  250. package/dist/q2-tecton-elements/q2-pill.entry.js +22 -22
  251. package/dist/q2-tecton-elements/q2-radio-group.entry.js +1 -1
  252. package/dist/q2-tecton-elements/q2-radio.entry.js +4 -4
  253. package/dist/q2-tecton-elements/q2-relative-time.entry.js +5 -5
  254. package/dist/q2-tecton-elements/q2-section.entry.js +22 -22
  255. package/dist/q2-tecton-elements/q2-select.entry.esm.js.map +1 -1
  256. package/dist/q2-tecton-elements/q2-select.entry.js +34 -25
  257. package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -1
  258. package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +1 -1
  259. package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +5 -5
  260. package/dist/q2-tecton-elements/q2-stepper.entry.js +45 -45
  261. package/dist/q2-tecton-elements/q2-tag.entry.js +11 -11
  262. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  263. package/dist/q2-tecton-elements/q2-textarea.entry.js +3 -3
  264. package/dist/q2-tecton-elements/q2-tooltip.entry.js +1 -1
  265. package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +9 -9
  266. package/dist/types/components/q2-currency/q2-currency.d.ts +12 -4
  267. package/dist/types/components/q2-input/q2-input.d.ts +2 -2
  268. package/dist/types/components/q2-select/q2-select.d.ts +1 -0
  269. package/dist/types/components.d.ts +14 -6
  270. package/dist/types/utils/helpers.d.ts +1 -1
  271. package/dist/types/utils/index.d.ts +4 -0
  272. package/package.json +4 -4
  273. package/dist/cjs/index-rwi7bp0v.js.map +0 -1
  274. package/dist/esm/index-EcLnUn1d.js.map +0 -1
  275. package/dist/q2-tecton-elements/index-EcLnUn1d.js.map +0 -1
@@ -70,10 +70,48 @@ button {
70
70
  }
71
71
 
72
72
  .currency {
73
- color: var(--tct-currency-color, inherit);
73
+ --comp-currency-color: var(--tct-currency-color, var(--t-text, #4d4d4d));
74
+ color: var(--comp-currency-color);
74
75
  font-size: var(--tct-currency-font-size, inherit);
75
76
  font-weight: var(--tct-currency-font-weight, inherit);
76
77
  }
78
+ .currency.positive {
79
+ color: var(--tct-currency-positive-color, var(--comp-currency-color));
80
+ }
81
+ .currency.negative {
82
+ color: var(--tct-currency-negative-color, var(--comp-currency-color));
83
+ }
84
+ .currency.debit.positive {
85
+ color: var(--tct-currency-debit-positive-color, var(--const-stoplight-success, #0e8a00));
86
+ }
87
+ .currency.debit.negative {
88
+ color: var(--tct-currency-debit-negative-color, var(--const-stoplight-alert, #d20a0a));
89
+ }
90
+ .currency.credit.positive {
91
+ color: var(--tct-currency-credit-positive-color, var(--const-stoplight-alert, #d20a0a));
92
+ }
93
+ .currency.credit.negative {
94
+ color: var(--tct-currency-credit-negative-color, var(--const-stoplight-success, #0e8a00));
95
+ }
96
+ .currency.masked {
97
+ line-height: 1;
98
+ }
99
+ .currency.masked.positive {
100
+ background: var(--tct-currency-masked-positive-background, linear-gradient(180deg, var(--t-text, #4d4d4d) 0%, #b3b3b3 100%));
101
+ background-clip: text;
102
+ -webkit-background-clip: text;
103
+ -webkit-text-fill-color: transparent;
104
+ -moz-background-clip: text;
105
+ -moz-text-fill-color: transparent;
106
+ }
107
+ .currency.masked.negative {
108
+ background: var(--tct-currency-masked-negative-background, linear-gradient(180deg, var(--t-text, #4d4d4d) 0%, #b3b3b3 100%));
109
+ background-clip: text;
110
+ -webkit-background-clip: text;
111
+ -webkit-text-fill-color: transparent;
112
+ -moz-background-clip: text;
113
+ -moz-text-fill-color: transparent;
114
+ }
77
115
 
78
116
  .currency-small {
79
117
  color: var(--tct-currency-small-color, inherit);
@@ -83,7 +121,7 @@ button {
83
121
  .currency-small .superscript {
84
122
  vertical-align: super;
85
123
  color: var(--tct-currency-small-superscript-color, inherit);
86
- font-size: var(--tct-currency-small-superscript-font-size, var(--app-font-size-small, 12px));
124
+ font-size: var(--tct-currency-small-superscript-font-size, 0.5em);
87
125
  font-weight: var(--tct-currency-small-superscript-font-weight, 700);
88
126
  }
89
127
 
@@ -95,7 +133,7 @@ button {
95
133
  .currency-medium .superscript {
96
134
  vertical-align: super;
97
135
  color: var(--tct-currency-medium-superscript-color, inherit);
98
- font-size: var(--tct-currency-medium-superscript-font-size, 21px);
136
+ font-size: var(--tct-currency-medium-superscript-font-size, 0.5em);
99
137
  font-weight: var(--tct-currency-medium-superscript-font-weight, 700);
100
138
  }
101
139
 
@@ -107,6 +145,6 @@ button {
107
145
  .currency-large .superscript {
108
146
  vertical-align: super;
109
147
  color: var(--tct-currency-large-superscript-color, inherit);
110
- font-size: var(--tct-currency-large-superscript-font-size, 35px);
148
+ font-size: var(--tct-currency-large-superscript-font-size, 0.5em);
111
149
  font-weight: var(--tct-currency-large-superscript-font-weight, 800);
112
150
  }
@@ -9,9 +9,10 @@ export class Q2Currency {
9
9
  * Determine how the positive or negative sign should display.
10
10
  *
11
11
  * Behavior:
12
+ * - `accounting`: No sign displays for positive amounts and parentheses wrap negative amounts.
12
13
  * - `always`: Always display the sign.
13
- * - `auto`: Sign displays for negative numbers only, including negative zero.
14
- * - `exceptZero`: Sign displays for positive and negative numbers, but not zero.
14
+ * - `auto`: Sign displays for negative amounts only, including negative zero.
15
+ * - `exceptZero`: Sign displays for positive and negative amounts, but not zero.
15
16
  * - `never`: Never display the sign.
16
17
  */
17
18
  this.signDisplay = 'auto';
@@ -24,13 +25,13 @@ export class Q2Currency {
24
25
  // #endregion
25
26
  // #region Public Methods API
26
27
  /**
27
- * A method to select a tab pane corresponding with the value.
28
+ * A method to retrieve the displayed currency value.
28
29
  *
29
30
  * @testOnly
30
31
  */
31
32
  async displayedMessageValue() {
32
33
  const currency = this.hostElement.shadowRoot.querySelector('[test-id="q2CurrencyInner"]');
33
- return currency === null || currency === void 0 ? void 0 : currency.ariaLabel;
34
+ return (currency === null || currency === void 0 ? void 0 : currency.getAttribute('aria-label')) || '';
34
35
  }
35
36
  // #endregion
36
37
  // #region Watchers
@@ -58,8 +59,13 @@ export class Q2Currency {
58
59
  return amount;
59
60
  }
60
61
  get currencyClasses() {
62
+ const { size, slotSize, isNegativeAmount, variant } = this;
61
63
  const classes = ['currency'];
62
- const sizeClass = this.size ? this.size : this.slotSize;
64
+ const sizeClass = size ? size : slotSize;
65
+ const sign = isNegativeAmount ? 'negative' : 'positive';
66
+ classes.push(sign);
67
+ if (!!variant)
68
+ classes.push(variant);
63
69
  if (!!sizeClass)
64
70
  classes.push(`currency-${sizeClass}`);
65
71
  return classes.join(' ');
@@ -86,6 +92,11 @@ export class Q2Currency {
86
92
  get hasPlusMinusSign() {
87
93
  return this.formattedParts.some((part) => part.type === 'minusSign' || part.type === 'plusSign');
88
94
  }
95
+ get isNegativeAmount() {
96
+ const hasNegativePart = this.formattedParts.some((part) => part.type === 'minusSign');
97
+ const hasNegativeDash = String(this.amount).startsWith('-');
98
+ return hasNegativePart || hasNegativeDash;
99
+ }
89
100
  get plusMinusSign() {
90
101
  const { formattedParts, hasPlusMinusSign } = this;
91
102
  if (!hasPlusMinusSign)
@@ -94,8 +105,9 @@ export class Q2Currency {
94
105
  return sign.value;
95
106
  }
96
107
  get shouldSuperscriptFraction() {
108
+ var _a;
97
109
  const fractionIndex = this.formattedParts.findIndex((part) => part.type === 'fraction');
98
- const commaBeforeFraction = this.formattedParts[fractionIndex - 1].value === ',';
110
+ const commaBeforeFraction = ((_a = this.formattedParts[fractionIndex - 1]) === null || _a === void 0 ? void 0 : _a.value) === ',';
99
111
  if (commaBeforeFraction || !this.currencyIsFront || this.sizeValue === 'small' || !this.sizeProvided)
100
112
  return false;
101
113
  return true;
@@ -115,7 +127,7 @@ export class Q2Currency {
115
127
  const formatOptions = new Intl.NumberFormat(this.locale, {
116
128
  style: 'currency',
117
129
  currency: this.currency,
118
- signDisplay: this.signDisplay,
130
+ signDisplay: this.signDisplay === 'accounting' ? 'never' : this.signDisplay,
119
131
  });
120
132
  this.formattedParts = formatOptions.formatToParts(this.amount);
121
133
  this.readableCurrency = formatOptions.format(this.amount);
@@ -123,8 +135,8 @@ export class Q2Currency {
123
135
  // #endregion
124
136
  // #region Render Methods
125
137
  render() {
126
- const { hasPlusMinusSign, plusMinusSign, currencyIsFront, currencySymbol, shouldSuperscriptSymbol, amountCore, fraction, shouldSuperscriptFraction, readableCurrency, currencyClasses, } = this;
127
- return (h("div", { key: 'fbcb104524d149fcf0ea516d3d7062e2abd2efc9', "test-id": "q2CurrencyInner", class: currencyClasses, "aria-label": readableCurrency }, hasPlusMinusSign && h("span", { key: 'b0616d4dfffa6f97a196a5d3d42e53f4e977685c' }, plusMinusSign), currencyIsFront && h("span", { key: 'aafd7db7a616f78cbc697681cbf3c14a87d53978', class: shouldSuperscriptSymbol ? 'superscript' : '' }, currencySymbol), h("span", { key: 'cf30e6eaa0cb6eb2ab6ca6c9e0d56208b3171c52' }, amountCore), h("span", { key: '91771c99e2001976f67283b6a3eafbb4fea08cfb', class: shouldSuperscriptFraction ? 'superscript' : '' }, fraction), !currencyIsFront && h("span", { key: '242f487962506d42d512427198f8ddc8a29fd12c', class: shouldSuperscriptSymbol ? 'superscript' : '' }, currencySymbol)));
138
+ const { hasPlusMinusSign, plusMinusSign, currencyIsFront, currencySymbol, shouldSuperscriptSymbol, amountCore, fraction, shouldSuperscriptFraction, readableCurrency, currencyClasses, signDisplay, isNegativeAmount, } = this;
139
+ return (h("div", { key: '15e4db8a4c25c1b1bea2382abd5e4dbf28e36090', "test-id": "q2CurrencyInner", class: currencyClasses, "aria-label": readableCurrency }, signDisplay === 'accounting' && isNegativeAmount && h("span", { key: '5474998b938cf27ff7db553534f08f028dd61347' }, '('), hasPlusMinusSign && h("span", { key: '10caf4a1a73a08e9fb31b52fb0a70e1ab2f69d10' }, plusMinusSign), currencyIsFront && h("span", { key: '6b78b88b1af0c58237933add94b2b0fef9fc8e53', class: shouldSuperscriptSymbol ? 'superscript' : '' }, currencySymbol), h("span", { key: 'e87cd1eaf3805a619f98d40faa29a6145bebde84' }, amountCore), h("span", { key: 'cb6822a0919027c08303b1e2759bea96c0605552', class: shouldSuperscriptFraction ? 'superscript' : '' }, fraction), !currencyIsFront && h("span", { key: 'e22b1b657f06ebec478573e6e0b8fe4b83b229ba', class: shouldSuperscriptSymbol ? 'superscript' : '' }, currencySymbol), signDisplay === 'accounting' && isNegativeAmount && h("span", { key: '4adea6d83042aea5f8fd78f248c95304735ee7e2' }, ')')));
128
140
  }
129
141
  static get is() { return "q2-currency"; }
130
142
  static get encapsulation() { return "shadow"; }
@@ -204,15 +216,15 @@ export class Q2Currency {
204
216
  "attribute": "sign-display",
205
217
  "mutable": false,
206
218
  "complexType": {
207
- "original": "'never' | 'auto' | 'always' | 'exceptZero'",
208
- "resolved": "\"always\" | \"auto\" | \"exceptZero\" | \"never\"",
219
+ "original": "'accounting' | 'always' | 'auto' | 'exceptZero' | 'never'",
220
+ "resolved": "\"accounting\" | \"always\" | \"auto\" | \"exceptZero\" | \"never\"",
209
221
  "references": {}
210
222
  },
211
223
  "required": false,
212
224
  "optional": false,
213
225
  "docs": {
214
226
  "tags": [],
215
- "text": "Determine how the positive or negative sign should display.\n\nBehavior:\n- `always`: Always display the sign.\n- `auto`: Sign displays for negative numbers only, including negative zero.\n- `exceptZero`: Sign displays for positive and negative numbers, but not zero.\n- `never`: Never display the sign."
227
+ "text": "Determine how the positive or negative sign should display.\n\nBehavior:\n- `accounting`: No sign displays for positive amounts and parentheses wrap negative amounts.\n- `always`: Always display the sign.\n- `auto`: Sign displays for negative amounts only, including negative zero.\n- `exceptZero`: Sign displays for positive and negative amounts, but not zero.\n- `never`: Never display the sign."
216
228
  },
217
229
  "getter": false,
218
230
  "setter": false,
@@ -259,6 +271,25 @@ export class Q2Currency {
259
271
  "getter": false,
260
272
  "setter": false,
261
273
  "reflect": true
274
+ },
275
+ "variant": {
276
+ "type": "string",
277
+ "attribute": "variant",
278
+ "mutable": false,
279
+ "complexType": {
280
+ "original": "'debit' | 'credit' | 'masked'",
281
+ "resolved": "\"credit\" | \"debit\" | \"masked\"",
282
+ "references": {}
283
+ },
284
+ "required": false,
285
+ "optional": false,
286
+ "docs": {
287
+ "tags": [],
288
+ "text": "The variant controls how the currency is colored and exposes unique CSS overrides.\nThe `debit` and `credit` variants align styling with common practices for coloring debit and credit accounts.\nThe `masked` variant exposes the ability to use gradients and images to color the currency."
289
+ },
290
+ "getter": false,
291
+ "setter": false,
292
+ "reflect": true
262
293
  }
263
294
  };
264
295
  }
@@ -277,7 +308,7 @@ export class Q2Currency {
277
308
  "return": "Promise<string>"
278
309
  },
279
310
  "docs": {
280
- "text": "A method to select a tab pane corresponding with the value.",
311
+ "text": "A method to retrieve the displayed currency value.",
281
312
  "tags": [{
282
313
  "name": "testOnly",
283
314
  "text": undefined
@@ -306,6 +337,9 @@ export class Q2Currency {
306
337
  }, {
307
338
  "propName": "signDisplay",
308
339
  "methodName": "propsUpdated"
340
+ }, {
341
+ "propName": "variant",
342
+ "methodName": "propsUpdated"
309
343
  }];
310
344
  }
311
345
  }
@@ -1 +1 @@
1
- {"version":3,"file":"q2-currency.js","sourceRoot":"","sources":["../../../../src/components/q2-currency/q2-currency.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAsB,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE/F,MAAM,OAAO,UAAU;IADvB;QAsBI,mDAAmD;QAEnD,aAAQ,GAAW,KAAK,CAAC;QAEzB,sGAAsG;QAEtG,WAAM,GAAsB,QAAQ,CAAC,eAAe,CAAC,IAAI,IAAI,OAAO,CAAC;QAErE;;;;;;;;WAQG;QAEH,gBAAW,GAA+C,MAAM,CAAC;KAuLpE;IA7KG,aAAa;IACb,qCAAqC;IAErC,iBAAiB;QACb,IAAI,CAAC,cAAc,EAAE,CAAC;IAC1B,CAAC;IAED,aAAa;IACb,6BAA6B;IAE7B;;;;OAIG;IAEH,KAAK,CAAC,qBAAqB;QACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,6BAA6B,CAAC,CAAC;QAC1F,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,SAAS,CAAC;IAC/B,CAAC;IAED,aAAa;IACb,mBAAmB;IAQnB,YAAY;QACR,IAAI,CAAC,cAAc,EAAE,CAAC;IAC1B,CAAC;IAED,aAAa;IACb,wBAAwB;IAExB,IAAI,UAAU;QACV,MAAM,EAAE,cAAc,EAAE,yBAAyB,EAA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AAuB,EACvB,UAAU,EACV,QAAQ,EACR,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,GAClB,GAAG,IAAI,CAAC;QAET,OAAO,CACH,uEACY,iBAAiB,EACzB,KAAK,EAAE,eAAe,gBACV,gBAAgB;YAE3B,gBAAgB,IAAI,+DAAO,aAAa,CAAQ;YAChD,eAAe,IAAI,6DAAM,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,IAAG,cAAc,CAAQ;YACtG,+DAAO,UAAU,CAAQ;YACzB,6DAAM,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,IAAG,QAAQ,CAAQ;YAC7E,CAAC,eAAe,IAAI,6DAAM,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,IAAG,cAAc,CAAQ,CACrG,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGJ","sourcesContent":["import { Component, Prop, Watch, h, ComponentInterface, Element, Method } from '@stencil/core';\n@Component({ tag: 'q2-currency', shadow: true, styleUrl: 'q2-currency.scss' })\nexport class Q2Currency implements ComponentInterface {\n // #region Own Properties\n\n /** @private The parts of the formatted number. */\n formattedParts: Intl.NumberFormatPart[];\n /** @private The full currency for aria-label purposes. */\n readableCurrency: string;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** The amount you want formatted. */\n @Prop({ reflect: true })\n amount: number;\n\n /** Formats the `amount` to a specific currency. */\n @Prop({ reflect: true })\n currency: string = 'USD';\n\n /** Formats to the language provided. Accepts multiple locales in an array as sequential fallbacks. */\n @Prop({ reflect: true })\n locale: string | string[] = document.documentElement.lang || 'en-US';\n\n /**\n * Determine how the positive or negative sign should display.\n *\n * Behavior:\n * - `always`: Always display the sign.\n * - `auto`: Sign displays for negative numbers only, including negative zero.\n * - `exceptZero`: Sign displays for positive and negative numbers, but not zero.\n * - `never`: Never display the sign.\n */\n @Prop({ reflect: true })\n signDisplay: 'never' | 'auto' | 'always' | 'exceptZero' = 'auto';\n\n /** Applies styling based on the size provided. If no size is provided, it will display as inline text. */\n @Prop({ reflect: true })\n size: 'small' | 'medium' | 'large';\n\n /** @private Inherited from q2-detail when slotted to match styling of q2-detail and q2-currency texts. */\n @Prop({ reflect: true })\n slotSize: string;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad(): void | Promise<void> {\n this.formatCurrency();\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * A method to select a tab pane corresponding with the value.\n *\n * @testOnly\n */\n @Method()\n async displayedMessageValue() {\n const currency = this.hostElement.shadowRoot.querySelector('[test-id=\"q2CurrencyInner\"]');\n return currency?.ariaLabel;\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('amount')\n @Watch('currency')\n @Watch('locale')\n @Watch('size')\n @Watch('slotSize')\n @Watch('signDisplay')\n propsUpdated() {\n this.formatCurrency();\n }\n\n // #endregion\n // #region Local Methods\n\n get amountCore(): string {\n const { formattedParts, shouldSuperscriptFraction } = this;\n let amount: string = '';\n\n for (const part of formattedParts) {\n if (\n part.type === 'integer' ||\n part.type === 'decimal' ||\n part.type === 'group' ||\n part.type === 'literal'\n ) {\n amount += part.value;\n }\n }\n\n // removes trailing decimal point if superscripting the fraction\n if (shouldSuperscriptFraction && amount[amount.length - 1] === '.') amount = amount.slice(0, -1);\n // removes end whitespace that breaks formatting\n amount = amount.trimEnd();\n\n return amount;\n }\n\n get currencyClasses(): string {\n const classes = ['currency'];\n const sizeClass = this.size ? this.size : this.slotSize;\n\n if (!!sizeClass) classes.push(`currency-${sizeClass}`);\n\n return classes.join(' ');\n }\n\n get currencyIsFront(): boolean {\n const index = this.formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'currency');\n if (index === 0 || index === 1) return true;\n return false;\n }\n\n get currencySymbol(): string {\n const { formattedParts, currencyIsFront } = this;\n const currencyIndex = formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'currency');\n const symbol = formattedParts[currencyIndex].value;\n return currencyIsFront ? symbol : ' ' + symbol;\n }\n\n get fraction(): string {\n const { formattedParts } = this;\n const fraction = formattedParts.find((part: Intl.NumberFormatPart) => part.type === 'fraction');\n if (!fraction) return;\n\n return fraction.value;\n }\n\n get hasPlusMinusSign(): boolean {\n return this.formattedParts.some(\n (part: Intl.NumberFormatPart) => part.type === 'minusSign' || part.type === 'plusSign'\n );\n }\n\n get plusMinusSign(): string {\n const { formattedParts, hasPlusMinusSign } = this;\n if (!hasPlusMinusSign) return;\n\n const sign = formattedParts.find(\n (part: Intl.NumberFormatPart) => part.type === 'minusSign' || part.type === 'plusSign'\n );\n return sign.value;\n }\n\n get shouldSuperscriptFraction(): boolean {\n const fractionIndex = this.formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'fraction');\n const commaBeforeFraction = this.formattedParts[fractionIndex - 1].value === ',';\n\n if (commaBeforeFraction || !this.currencyIsFront || this.sizeValue === 'small' || !this.sizeProvided)\n return false;\n\n return true;\n }\n\n get shouldSuperscriptSymbol(): boolean {\n if (!this.currencyIsFront || this.sizeProvided) return true;\n\n return false;\n }\n\n get sizeProvided(): boolean {\n return !!this.size || !!this.slotSize;\n }\n\n get sizeValue(): string {\n return this.size ? this.size : this.slotSize;\n }\n\n formatCurrency() {\n const formatOptions = new Intl.NumberFormat(this.locale, {\n style: 'currency',\n currency: this.currency,\n signDisplay: this.signDisplay,\n });\n this.formattedParts = formatOptions.formatToParts(this.amount);\n this.readableCurrency = formatOptions.format(this.amount);\n }\n\n // #endregion\n // #region Render Methods\n\n render() {\n const {\n hasPlusMinusSign,\n plusMinusSign,\n currencyIsFront,\n currencySymbol,\n shouldSuperscriptSymbol,\n amountCore,\n fraction,\n shouldSuperscriptFraction,\n readableCurrency,\n currencyClasses,\n } = this;\n\n return (\n <div\n test-id=\"q2CurrencyInner\"\n class={currencyClasses}\n aria-label={readableCurrency}\n >\n {hasPlusMinusSign && <span>{plusMinusSign}</span>}\n {currencyIsFront && <span class={shouldSuperscriptSymbol ? 'superscript' : ''}>{currencySymbol}</span>}\n <span>{amountCore}</span>\n <span class={shouldSuperscriptFraction ? 'superscript' : ''}>{fraction}</span>\n {!currencyIsFront && <span class={shouldSuperscriptSymbol ? 'superscript' : ''}>{currencySymbol}</span>}\n </div>\n );\n }\n\n // #endregion\n}\n"]}
1
+ {"version":3,"file":"q2-currency.js","sourceRoot":"","sources":["../../../../src/components/q2-currency/q2-currency.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAsB,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE/F,MAAM,OAAO,UAAU;IADvB;QAsBI,mDAAmD;QAEnD,aAAQ,GAAW,KAAK,CAAC;QAEzB,sGAAsG;QAEtG,WAAM,GAAsB,QAAQ,CAAC,eAAe,CAAC,IAAI,IAAI,OAAO,CAAC;QAErE;;;;;;;;;WASG;QAEH,gBAAW,GAA8D,MAAM,CAAC;KA8MnF;IA5LG,aAAa;IACb,qCAAqC;IAErC,iBAAiB;QACb,IAAI,CAAC,cAAc,EAAE,CAAC;IAC1B,CAAC;IAED,aAAa;IACb,6BAA6B;IAE7B;;;;OAIG;IAEH,KAAK,CAAC,qBAAqB;QACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,6BAA6B,CAAC,CAAC;QAC1F,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,YAAY,CAAC,YAAY,CAAC,KAAI,EAAE,CA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Ac,CAAQ;YACtG,+DAAO,UAAU,CAAQ;YACzB,6DAAM,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,IAAG,QAAQ,CAAQ;YAC7E,CAAC,eAAe,IAAI,6DAAM,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,IAAG,cAAc,CAAQ;YACtG,WAAW,KAAK,YAAY,IAAI,gBAAgB,IAAI,+DAAO,GAAG,CAAQ,CACrE,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGJ","sourcesContent":["import { Component, Prop, Watch, h, ComponentInterface, Element, Method } from '@stencil/core';\n@Component({ tag: 'q2-currency', shadow: true, styleUrl: 'q2-currency.scss' })\nexport class Q2Currency implements ComponentInterface {\n // #region Own Properties\n\n /** @private The parts of the formatted number. */\n formattedParts: Intl.NumberFormatPart[];\n /** @private The full currency for aria-label purposes. */\n readableCurrency: string;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** The amount you want formatted. */\n @Prop({ reflect: true })\n amount: number;\n\n /** Formats the `amount` to a specific currency. */\n @Prop({ reflect: true })\n currency: string = 'USD';\n\n /** Formats to the language provided. Accepts multiple locales in an array as sequential fallbacks. */\n @Prop({ reflect: true })\n locale: string | string[] = document.documentElement.lang || 'en-US';\n\n /**\n * Determine how the positive or negative sign should display.\n *\n * Behavior:\n * - `accounting`: No sign displays for positive amounts and parentheses wrap negative amounts.\n * - `always`: Always display the sign.\n * - `auto`: Sign displays for negative amounts only, including negative zero.\n * - `exceptZero`: Sign displays for positive and negative amounts, but not zero.\n * - `never`: Never display the sign.\n */\n @Prop({ reflect: true })\n signDisplay: 'accounting' | 'always' | 'auto' | 'exceptZero' | 'never' = 'auto';\n\n /** Applies styling based on the size provided. If no size is provided, it will display as inline text. */\n @Prop({ reflect: true })\n size: 'small' | 'medium' | 'large';\n\n /** @private Inherited from q2-detail when slotted to match styling of q2-detail and q2-currency texts. */\n @Prop({ reflect: true })\n slotSize: string;\n\n /**\n * The variant controls how the currency is colored and exposes unique CSS overrides.\n * The `debit` and `credit` variants align styling with common practices for coloring debit and credit accounts.\n * The `masked` variant exposes the ability to use gradients and images to color the currency.\n */\n @Prop({ reflect: true })\n variant: 'debit' | 'credit' | 'masked';\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad(): void | Promise<void> {\n this.formatCurrency();\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * A method to retrieve the displayed currency value.\n *\n * @testOnly\n */\n @Method()\n async displayedMessageValue() {\n const currency = this.hostElement.shadowRoot.querySelector('[test-id=\"q2CurrencyInner\"]');\n return currency?.getAttribute('aria-label') || '';\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('amount')\n @Watch('currency')\n @Watch('locale')\n @Watch('size')\n @Watch('slotSize')\n @Watch('signDisplay')\n @Watch('variant')\n propsUpdated() {\n this.formatCurrency();\n }\n\n // #endregion\n // #region Local Methods\n\n get amountCore(): string {\n const { formattedParts, shouldSuperscriptFraction } = this;\n let amount: string = '';\n\n for (const part of formattedParts) {\n if (\n part.type === 'integer' ||\n part.type === 'decimal' ||\n part.type === 'group' ||\n part.type === 'literal'\n ) {\n amount += part.value;\n }\n }\n\n // removes trailing decimal point if superscripting the fraction\n if (shouldSuperscriptFraction && amount[amount.length - 1] === '.') amount = amount.slice(0, -1);\n // removes end whitespace that breaks formatting\n amount = amount.trimEnd();\n\n return amount;\n }\n\n get currencyClasses(): string {\n const { size, slotSize, isNegativeAmount, variant } = this;\n const classes = ['currency'];\n const sizeClass = size ? size : slotSize;\n const sign = isNegativeAmount ? 'negative' : 'positive';\n\n classes.push(sign);\n if (!!variant) classes.push(variant);\n if (!!sizeClass) classes.push(`currency-${sizeClass}`);\n\n return classes.join(' ');\n }\n\n get currencyIsFront(): boolean {\n const index = this.formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'currency');\n if (index === 0 || index === 1) return true;\n return false;\n }\n\n get currencySymbol(): string {\n const { formattedParts, currencyIsFront } = this;\n const currencyIndex = formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'currency');\n const symbol = formattedParts[currencyIndex].value;\n return currencyIsFront ? symbol : ' ' + symbol;\n }\n\n get fraction(): string {\n const { formattedParts } = this;\n const fraction = formattedParts.find((part: Intl.NumberFormatPart) => part.type === 'fraction');\n if (!fraction) return;\n\n return fraction.value;\n }\n\n get hasPlusMinusSign(): boolean {\n return this.formattedParts.some(\n (part: Intl.NumberFormatPart) => part.type === 'minusSign' || part.type === 'plusSign'\n );\n }\n\n get isNegativeAmount(): boolean {\n const hasNegativePart = this.formattedParts.some((part: Intl.NumberFormatPart) => part.type === 'minusSign');\n const hasNegativeDash = String(this.amount).startsWith('-');\n return hasNegativePart || hasNegativeDash;\n }\n\n get plusMinusSign(): string {\n const { formattedParts, hasPlusMinusSign } = this;\n if (!hasPlusMinusSign) return;\n\n const sign = formattedParts.find(\n (part: Intl.NumberFormatPart) => part.type === 'minusSign' || part.type === 'plusSign'\n );\n return sign.value;\n }\n\n get shouldSuperscriptFraction(): boolean {\n const fractionIndex = this.formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'fraction');\n const commaBeforeFraction = this.formattedParts[fractionIndex - 1]?.value === ',';\n\n if (commaBeforeFraction || !this.currencyIsFront || this.sizeValue === 'small' || !this.sizeProvided)\n return false;\n\n return true;\n }\n\n get shouldSuperscriptSymbol(): boolean {\n if (!this.currencyIsFront || this.sizeProvided) return true;\n\n return false;\n }\n\n get sizeProvided(): boolean {\n return !!this.size || !!this.slotSize;\n }\n\n get sizeValue(): string {\n return this.size ? this.size : this.slotSize;\n }\n\n formatCurrency() {\n const formatOptions = new Intl.NumberFormat(this.locale, {\n style: 'currency',\n currency: this.currency,\n signDisplay: this.signDisplay === 'accounting' ? 'never' : this.signDisplay,\n });\n this.formattedParts = formatOptions.formatToParts(this.amount);\n this.readableCurrency = formatOptions.format(this.amount);\n }\n\n // #endregion\n // #region Render Methods\n\n render() {\n const {\n hasPlusMinusSign,\n plusMinusSign,\n currencyIsFront,\n currencySymbol,\n shouldSuperscriptSymbol,\n amountCore,\n fraction,\n shouldSuperscriptFraction,\n readableCurrency,\n currencyClasses,\n signDisplay,\n isNegativeAmount,\n } = this;\n\n return (\n <div\n test-id=\"q2CurrencyInner\"\n class={currencyClasses}\n aria-label={readableCurrency}\n >\n {signDisplay === 'accounting' && isNegativeAmount && <span>{'('}</span>}\n {hasPlusMinusSign && <span>{plusMinusSign}</span>}\n {currencyIsFront && <span class={shouldSuperscriptSymbol ? 'superscript' : ''}>{currencySymbol}</span>}\n <span>{amountCore}</span>\n <span class={shouldSuperscriptFraction ? 'superscript' : ''}>{fraction}</span>\n {!currencyIsFront && <span class={shouldSuperscriptSymbol ? 'superscript' : ''}>{currencySymbol}</span>}\n {signDisplay === 'accounting' && isNegativeAmount && <span>{')'}</span>}\n </div>\n );\n }\n\n // #endregion\n}\n"]}
@@ -102,7 +102,7 @@ export class Q2Detail {
102
102
  // #endregion
103
103
  // #region Render Methods
104
104
  render() {
105
- return (h("div", { key: '90561750f346b07815d6fa42076104e9c229503d', class: this.detailClasses }, this.hasLabel && (h("div", { key: '6ddeb20f72cc9d309a0382b55b451bc82a9986a4', class: this.labelClasses, "aria-describedby": !!this.description ? 'label-description' : undefined }, !!this.label ? loc(this.label) : this.hasLabelSlotContent ? h("slot", { name: "label" }) : '')), this.hasDescripiton && (h("div", { key: 'b9fd947bd8e42a62376fa6a401e81343898193a4', id: "label-description", class: this.descriptionClasses }, !!this.description ? loc(this.description) : this.hasDefaultSlotContent ? h("slot", null) : ''))));
105
+ return (h("div", { key: '0bcc193663fa2730a1da75169d29563c3a14a311', class: this.detailClasses }, this.hasLabel && (h("div", { key: '703d7e91f10a223bfdd2f9cb6975a7c15029d450', class: this.labelClasses, "aria-describedby": !!this.description ? 'label-description' : undefined }, !!this.label ? loc(this.label) : this.hasLabelSlotContent ? h("slot", { name: "label" }) : '')), this.hasDescripiton && (h("div", { key: '811569a0eff620ab21ce49e8a91379c5ea06be86', id: "label-description", class: this.descriptionClasses }, !!this.description ? loc(this.description) : this.hasDefaultSlotContent ? h("slot", null) : ''))));
106
106
  }
107
107
  static get is() { return "q2-detail"; }
108
108
  static get encapsulation() { return "shadow"; }
@@ -118,7 +118,7 @@ export class Q2Example {
118
118
  }, onClick: () => this.tctClick.emit(), role: "menu" }, h("slot", null))));
119
119
  }
120
120
  render() {
121
- return h(Host, { key: 'dbe4a678c04f60cc08aabd47cc9fa3871265e0f0', attribute: "navigation" }, this.renderMenuInner());
121
+ return h(Host, { key: '8139598dfeeceeaef460ad83acae011c3badbebb', attribute: "navigation" }, this.renderMenuInner());
122
122
  }
123
123
  static get is() { return "q2-example"; }
124
124
  static get encapsulation() { return "shadow"; }
@@ -8,7 +8,7 @@ export class Q2Checkbox {
8
8
  // #endregion
9
9
  // #region Render Methods
10
10
  render() {
11
- return (h("div", { key: '6e0a67a4fed55809b56ecff76c213a299f6e27bd', class: "container" }, h("slot", { key: 'da7ac7244b4953d28ed6382dd1a09cc97b4a6f3e' })));
11
+ return (h("div", { key: '2cb63c515c7df055a3549d04135d235dd2055738', class: "container" }, h("slot", { key: 'a50bf633942f06fbce47d945ec7a05eeefa7bb8c' })));
12
12
  }
13
13
  static get is() { return "q2-form"; }
14
14
  static get encapsulation() { return "shadow"; }
@@ -58,7 +58,7 @@ export class Q2FormattedText {
58
58
  // #region Render Methods
59
59
  render() {
60
60
  const { formattedTextClasses } = this;
61
- return (h("div", { key: '0af18c53d8fa788cabd68b542c60d8fee98c632c', class: formattedTextClasses, "aria-label": this.formattedValue }, h("span", { key: 'ac6995260060b2120c61f90a9b72a194256464a1' }, this.formattedValue)));
61
+ return (h("div", { key: '08fe8c32d469d77afdb886addcced59c6a6edbcc', class: formattedTextClasses, "aria-label": this.formattedValue }, h("span", { key: '6f5031262bf199f7887eb0b1f9ef1d8f920a29fc' }, this.formattedValue)));
62
62
  }
63
63
  static get is() { return "q2-formatted-text"; }
64
64
  static get encapsulation() { return "shadow"; }
@@ -176,11 +176,12 @@ export class Q2Input {
176
176
  this.textHidden = !this.textHidden;
177
177
  };
178
178
  this.validateInput = () => {
179
- var _a, _b;
179
+ var _a, _b, _c;
180
180
  this.validity = (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.validity;
181
181
  if (((_b = this.validity) === null || _b === void 0 ? void 0 : _b.valid) === false) {
182
182
  this.invalid.emit();
183
183
  }
184
+ return !!((_c = this.validity) === null || _c === void 0 ? void 0 : _c.valid);
184
185
  };
185
186
  }
186
187
  // #endregion
@@ -240,7 +241,7 @@ export class Q2Input {
240
241
  */
241
242
  async checkValidity() {
242
243
  this.inputRef.checkValidity();
243
- this.validateInput();
244
+ return this.validateInput();
244
245
  }
245
246
  /**
246
247
  * Emulates clicking the clear button when the input is clearable.
@@ -643,7 +644,7 @@ export class Q2Input {
643
644
  }
644
645
  renderInputContainerDOM() {
645
646
  const { hasInputLeftSlot, hasInputRightSlot } = this;
646
- return (h("div", { class: "input-container", tabindex: -1, "test-id": "inputContainer" }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("div", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("div", null, h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft }))), hasInputLeftSlot && h("slot", { name: "input-left" }), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" })))), this.pseudo ? this.renderPseudoInputDOM() : this.renderStandardInputDOM(), h("div", { class: "input-icons-container-right" }, h("q2-btn", { class: this.clearClasses.join(' '), label: loc('tecton.element.input.clear', [this.label]), hideLabel: true, "test-id": "clearButton", onClick: this.onClearInput }, h("q2-icon", { type: "close", class: "icon-clear" })), ['password', 'text', 'ssn', 'tin'].includes(this.type) && this.showVisibilityToggle && (h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility, label: loc(this.visibilityToggleAriaLabel, { label: this.label }), "hide-label": true }, this.visibilityToggleText)), this.formattedValueObject.suffix && (h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.hasError && this.type !== 'currency' && (h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" }))), this.iconRight && !this.formattedValueObject.suffix && (h("div", null, h("q2-icon", { type: this.iconRight, class: "icon-right" }))), hasInputRightSlot && h("slot", { name: "input-right" }))));
647
+ return (h("div", { class: "input-container", tabindex: -1, "test-id": "inputContainer" }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("div", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("div", null, h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft }))), hasInputLeftSlot && h("slot", { name: "input-left" }), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" })))), this.pseudo ? this.renderPseudoInputDOM() : this.renderStandardInputDOM(), h("div", { class: "input-icons-container-right" }, h("q2-btn", { class: this.clearClasses.join(' '), label: loc('tecton.element.input.clear', [this.label]), hideLabel: true, "test-id": "clearButton", onClick: this.onClearInput, onKeyDown: e => e.stopPropagation() }, h("q2-icon", { type: "close", class: "icon-clear" })), ['password', 'text', 'ssn', 'tin'].includes(this.type) && this.showVisibilityToggle && (h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility, label: loc(this.visibilityToggleAriaLabel, { label: this.label }), "hide-label": true }, this.visibilityToggleText)), this.formattedValueObject.suffix && (h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.hasError && this.type !== 'currency' && (h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" }))), this.iconRight && !this.formattedValueObject.suffix && (h("div", null, h("q2-icon", { type: this.iconRight, class: "icon-right" }))), hasInputRightSlot && h("slot", { name: "input-right" }))));
647
648
  }
648
649
  renderPseudoInputDOM() {
649
650
  const showPlaceholder = !this.value && !!this.placeholder;
@@ -660,7 +661,7 @@ export class Q2Input {
660
661
  }
661
662
  render() {
662
663
  const { ariaControls, ariaExpanded } = this.ariaAttributes;
663
- return (h(Host, { key: '94de6859228b9e57400ee4c48f60200e5ee04b0e', role: this._role, "aria-controls": ariaControls, "aria-expanded": ariaExpanded }, h("div", { key: '680591185b170f1d527b363b41488f354ae7d05f', class: this.wrapperClasses }, h("div", { key: '5c2499e85f9aeeff06e5404d0ebd5f8ddbbd1047', class: "label-wrapper" }, renderLabel(this), this.renderCountDOM()), this.renderInputContainerDOM(), renderMessages(this))));
664
+ return (h(Host, { key: '7ec6adb05155d11846fd68e6e06bea2f07ba9caf', role: this._role, "aria-controls": ariaControls, "aria-expanded": ariaExpanded }, h("div", { key: 'cfcde15de76e44cd280abbcc3e4c7bd2aa41ef80', class: this.wrapperClasses }, h("div", { key: '0b0f96352fa75f19d040e87a35a41ae3575ae228', class: "label-wrapper" }, renderLabel(this), this.renderCountDOM()), this.renderInputContainerDOM(), renderMessages(this))));
664
665
  }
665
666
  static get is() { return "q2-input"; }
666
667
  static get encapsulation() { return "shadow"; }
@@ -1668,7 +1669,7 @@ export class Q2Input {
1668
1669
  return {
1669
1670
  "checkValidity": {
1670
1671
  "complexType": {
1671
- "signature": "() => Promise<void>",
1672
+ "signature": "() => Promise<boolean>",
1672
1673
  "parameters": [],
1673
1674
  "references": {
1674
1675
  "Promise": {
@@ -1676,7 +1677,7 @@ export class Q2Input {
1676
1677
  "id": "global::Promise"
1677
1678
  }
1678
1679
  },
1679
- "return": "Promise<void>"
1680
+ "return": "Promise<boolean>"
1680
1681
  },
1681
1682
  "docs": {
1682
1683
  "text": "Emulates firing checkValidity on `<input>`, emits `invalid` event if validation failed.",