@heartlandone/vega 2.75.1 → 2.76.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 (725) hide show
  1. package/dist/cjs/{app-globals-35614ce8.js → app-globals-12b7d808.js} +28 -32
  2. package/dist/cjs/breakpoints-751d433a.js +56 -0
  3. package/dist/cjs/{child-nodes-event-prevent-slimmer-aca87dac.js → child-nodes-event-prevent-slimmer-84435957.js} +2 -2
  4. package/dist/cjs/{child-nodes-notify-observer-slimmer-257fedb3.js → child-nodes-notify-observer-slimmer-ed39283b.js} +1 -1
  5. package/dist/cjs/{code-block-c1d2e6a8.js → code-block-f1480ec3.js} +17 -17
  6. package/dist/cjs/{component-global-style-slimmer-adfa2e59.js → component-global-style-slimmer-93c5fb50.js} +2 -1
  7. package/dist/cjs/{component-usage-runtime-metrics-d10ace87.js → component-usage-runtime-metrics-4572c5b7.js} +1 -1
  8. package/dist/cjs/{component-value-history-controller-slimmer.abstract-787c67dc.js → component-value-history-controller-slimmer.abstract-a9264cc8.js} +5 -5
  9. package/dist/cjs/{create-public-api-runtime-metrics-slimmer-e2e274e1.js → create-public-api-runtime-metrics-slimmer-9cb09fb2.js} +3 -41
  10. package/dist/cjs/{dark-mode-style-controller-c21172aa.js → dark-mode-style-controller-3a04af3d.js} +292 -1254
  11. package/dist/cjs/{date-required-rule-30ee62d0.js → date-required-rule-912469e0.js} +1 -1
  12. package/dist/cjs/{design-token-bb39e07e.js → design-token-41baf118.js} +2 -2
  13. package/dist/cjs/dom-node-subject-observer-factory-c62823de.js +141 -0
  14. package/dist/cjs/{dto-renderer-manager-03e1a038.js → dto-renderer-manager-809c947b.js} +33 -33
  15. package/dist/cjs/{element-appender-slimmer-daa8b9f5.js → element-appender-slimmer-34e4eb56.js} +349 -166
  16. package/dist/cjs/{event-emit-slimmer-2dacabbd.js → event-emit-slimmer-062cdcb8.js} +2 -2
  17. package/dist/cjs/{feature-flag-controller-ce2162c8.js → feature-flag-controller-04cb1e69.js} +7 -1
  18. package/dist/cjs/{form-field-controller-slimmer-aef2fb1e.js → form-field-controller-slimmer-102f37c7.js} +13 -14
  19. package/dist/cjs/{internal-icon-manager-32f9ed63.js → icon-manager-c12c6ea9.js} +1 -52
  20. package/dist/cjs/{image-annotation-action-3fa501b7.js → image-annotation-action-8d9fa20c.js} +10 -9
  21. package/dist/cjs/index-592b4052.js +220 -0
  22. package/dist/cjs/{index-4d7bce1a.js → index-f054eb5d.js} +15 -3
  23. package/dist/cjs/index.cjs.js +68 -65
  24. package/dist/cjs/{inject-keyboard-manager-d21b4387.js → inject-keyboard-manager-0f5bd568.js} +1 -1
  25. package/dist/cjs/internal-icon-manager-c989189a.js +55 -0
  26. package/dist/cjs/{translation-5f9f9c0c.js → internal-translation-controller-053eb0f1.js} +0 -93
  27. package/dist/cjs/{internal-vega-event-manager-6befeb34.js → internal-vega-event-manager-f7ecf3d4.js} +81 -81
  28. package/dist/cjs/internal-vega-z-index-manager-f03ddb37.js +180 -0
  29. package/dist/cjs/{keyboard-manager-3dea6b28.js → keyboard-manager-055e9f67.js} +2 -2
  30. package/dist/cjs/{keyboard-manager-slimmer-0d45f944.js → keyboard-manager-slimmer-0cc0c1c7.js} +1 -1
  31. package/dist/cjs/loader.cjs.js +26 -23
  32. package/dist/cjs/misc-3d30df91.js +41 -0
  33. package/dist/cjs/{month-view-generator-49cc5fc2.js → month-view-generator-6a6dd527.js} +1 -1
  34. package/dist/cjs/{page-resize-observer-slimmer-11937d6f.js → page-resize-observer-slimmer-7f065ee1.js} +2 -54
  35. package/dist/cjs/{public-rules-dc2a8d62.js → public-rules-922849f3.js} +12 -13
  36. package/dist/cjs/{range-79b668e7.js → range-8aa49b08.js} +2 -2
  37. package/dist/cjs/{responsive-format-facade-d5dba942.js → responsive-format-facade-ea59bdcd.js} +13 -22
  38. package/dist/cjs/{rich-text-editor-required-rule-ba312af9.js → rich-text-editor-required-rule-22225840.js} +1 -1
  39. package/dist/cjs/{string-format-strategy.abstract-63514c60.js → string-format-strategy.abstract-f2575647.js} +1 -1
  40. package/dist/cjs/{string-input-formatter-slimmer-f3e0bbc7.js → string-input-formatter-slimmer-0a334fc6.js} +5 -5
  41. package/dist/cjs/{string-mask-strategy-d23ac21a.js → string-mask-strategy-dda58395.js} +2 -2
  42. package/dist/cjs/{style-formatter-49693da7.js → style-formatter-0c3ced39.js} +2 -2
  43. package/dist/cjs/{sub-state-notify-slimmer-468e19aa.js → sub-state-notify-slimmer-58121111.js} +1 -1
  44. package/dist/cjs/{sub-state-observer-slimmer-5d0b8ac3.js → sub-state-observer-slimmer-1dfbc4c3.js} +2 -2
  45. package/dist/cjs/{time-required-rule-c96ecdc9.js → time-required-rule-d6fa7aa8.js} +1 -1
  46. package/dist/cjs/{function-extension-cfbbc57e.js → token-extension-07cac85d.js} +501 -387
  47. package/dist/cjs/{translation-slimmer-f0ebe710.js → translation-slimmer-4533bd67.js} +4 -4
  48. package/dist/cjs/{type-guard-a0f026d8.js → type-guard-407ba0b8.js} +3 -3
  49. package/dist/cjs/{ui-9e181079.js → ui-234ea151.js} +12 -0
  50. package/dist/cjs/{valid-credit-card-number-rule-c854bed9.js → valid-credit-card-number-rule-41a8b51b.js} +1 -1
  51. package/dist/cjs/vega-accordion.cjs.entry.js +21 -30
  52. package/dist/cjs/vega-app-footer.cjs.entry.js +3 -3
  53. package/dist/cjs/vega-app-header-button.cjs.entry.js +183 -49
  54. package/dist/cjs/vega-backdrop.cjs.entry.js +2 -2
  55. package/dist/cjs/vega-banner.cjs.entry.js +15 -13
  56. package/dist/cjs/vega-bar-chart.cjs.entry.js +1 -1
  57. package/dist/cjs/vega-box.cjs.entry.js +18 -33
  58. package/dist/cjs/vega-brand-logo.cjs.entry.js +7 -5
  59. package/dist/cjs/vega-breadcrumb.cjs.entry.js +14 -13
  60. package/dist/cjs/vega-button-circle.cjs.entry.js +20 -30
  61. package/dist/cjs/vega-button-group_2.cjs.entry.js +15 -15
  62. package/dist/cjs/vega-button-link.cjs.entry.js +15 -14
  63. package/dist/cjs/vega-button.cjs.entry.js +21 -30
  64. package/dist/cjs/vega-calendar_4.cjs.entry.js +48 -45
  65. package/dist/cjs/vega-card.cjs.entry.js +9 -28
  66. package/dist/cjs/vega-carousel.cjs.entry.js +15 -26
  67. package/dist/cjs/vega-checkbox_2.cjs.entry.js +22 -20
  68. package/dist/cjs/vega-chip.cjs.entry.js +22 -33
  69. package/dist/cjs/vega-code-block.cjs.entry.js +658 -2709
  70. package/dist/cjs/vega-color-picker.cjs.entry.js +15 -12
  71. package/dist/cjs/vega-combo-box.cjs.entry.js +29 -28
  72. package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
  73. package/dist/cjs/vega-date-picker_2.cjs.entry.js +53 -56
  74. package/dist/cjs/vega-dialog-controller-03ef4d9a.js +84 -0
  75. package/dist/cjs/vega-dialog_2.cjs.entry.js +37 -44
  76. package/dist/cjs/vega-divider.cjs.entry.js +12 -30
  77. package/dist/cjs/vega-dropdown_5.cjs.entry.js +49 -55
  78. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  79. package/dist/cjs/{dom-node-subject-observer-factory-b5e71bf6.js → vega-event-id-ee01d8dd.js} +0 -139
  80. package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
  81. package/dist/cjs/vega-field-label.cjs.entry.js +9 -8
  82. package/dist/cjs/vega-file-uploader.cjs.entry.js +28 -23
  83. package/dist/cjs/vega-flag-icon.cjs.entry.js +13 -27
  84. package/dist/cjs/vega-flex.cjs.entry.js +11 -28
  85. package/dist/cjs/vega-font.cjs.entry.js +12 -29
  86. package/dist/cjs/vega-form.cjs.entry.js +24 -22
  87. package/dist/cjs/vega-grid.cjs.entry.js +9 -28
  88. package/dist/cjs/vega-hint.cjs.entry.js +1 -1
  89. package/dist/cjs/vega-icon.cjs.entry.js +18 -31
  90. package/dist/cjs/vega-image-uploader.cjs.entry.js +34 -37
  91. package/dist/cjs/vega-input-credit-card.cjs.entry.js +31 -27
  92. package/dist/cjs/vega-input-numeric.cjs.entry.js +24 -22
  93. package/dist/cjs/vega-input-passcode.cjs.entry.js +26 -24
  94. package/dist/cjs/vega-input-phone-number.cjs.entry.js +31 -35
  95. package/dist/cjs/vega-input-range.cjs.entry.js +22 -20
  96. package/dist/cjs/vega-input-select.cjs.entry.js +41 -46
  97. package/dist/cjs/vega-input.cjs.entry.js +43 -31
  98. package/dist/cjs/vega-item-toggle.cjs.entry.js +8 -7
  99. package/dist/cjs/vega-left-nav_5.cjs.entry.js +38 -40
  100. package/dist/cjs/vega-line-chart.cjs.entry.js +1 -1
  101. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +16 -32
  102. package/dist/cjs/vega-page-notification_2.cjs.entry.js +5 -4
  103. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +12 -12
  104. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +9 -10
  105. package/dist/cjs/vega-pagination.cjs.entry.js +28 -38
  106. package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
  107. package/dist/cjs/vega-popover_2.cjs.entry.js +21 -31
  108. package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +66 -39
  109. package/dist/cjs/vega-radio_2.cjs.entry.js +25 -23
  110. package/dist/cjs/vega-rich-text-content.cjs.entry.js +22 -20
  111. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +58 -55
  112. package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
  113. package/dist/cjs/vega-segment-control.cjs.entry.js +10 -8
  114. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +25 -32
  115. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +22 -20
  116. package/dist/cjs/vega-sidenav_3.cjs.entry.js +34 -40
  117. package/dist/cjs/vega-signature-capture.cjs.entry.js +27 -31
  118. package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
  119. package/dist/cjs/vega-slot-container.cjs.entry.js +1 -1
  120. package/dist/cjs/vega-stepper.cjs.entry.js +23 -21
  121. package/dist/cjs/vega-tab-group_2.cjs.entry.js +15 -14
  122. package/dist/cjs/vega-table_11.cjs.entry.js +67 -68
  123. package/dist/cjs/vega-text.cjs.entry.js +4 -3
  124. package/dist/cjs/vega-textarea.cjs.entry.js +22 -20
  125. package/dist/cjs/vega-time-picker_2.cjs.entry.js +35 -41
  126. package/dist/cjs/vega-toggle-switch.cjs.entry.js +15 -12
  127. package/dist/cjs/vega-tooltip_2.cjs.entry.js +17 -28
  128. package/dist/cjs/vega.cjs.js +26 -23
  129. package/dist/cjs/{index-95fca64f.js → wait-for-component-did-render-70a01bf9.js} +1 -12
  130. package/dist/collection/components/vega-app-header-button/vega-app-header-button.js +17 -2
  131. package/dist/collection/components/vega-box/slimmers/controllers/vega-box-responsive-style-controller.js +2 -1
  132. package/dist/collection/components/vega-box/slimmers/controllers/vega-box-state-styles-controller.js +2 -1
  133. package/dist/collection/components/vega-button/vega-button.js +2 -1
  134. package/dist/collection/components/vega-button-circle/vega-button-circle.js +2 -1
  135. package/dist/collection/components/vega-button-link/vega-button-link.css +1 -1
  136. package/dist/collection/components/vega-button-link/vega-button-link.js +2 -1
  137. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/base-repeat-pattern.js +1 -1
  138. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-daily-repeat-pattern.js +1 -1
  139. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-monthly-repeat-pattern.js +1 -1
  140. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-weekly-repeat-pattern.js +1 -1
  141. package/dist/collection/components/vega-calendar/slimmers/common/helpers/repeat-pattern/calendar-event-yearly-repeat-pattern.js +1 -1
  142. package/dist/collection/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.js +5 -14
  143. package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-dropdown-renderer.js +2 -2
  144. package/dist/collection/components/vega-date-picker/slimmers/controllers/vega-date-picker-calendar-open-state-controller.js +1 -1
  145. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +1 -1
  146. package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-search-controller.js +2 -2
  147. package/dist/collection/components/vega-dropdown/slimmers/renderers/vega-dropdown-list-renderer.js +2 -2
  148. package/dist/collection/components/vega-dropdown/vega-dropdown-group/slimmers/renderers/vega-dropdown-group-renderer.js +3 -3
  149. package/dist/collection/components/vega-dropdown/vega-dropdown-item/slimmers/renderers/vega-dropdown-item-renderer.js +6 -4
  150. package/dist/collection/components/vega-icon/vega-icon.js +2 -1
  151. package/dist/collection/components/vega-input/slimmers/renderers/vega-input-input-container-renderer.js +10 -2
  152. package/dist/collection/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.js +1 -1
  153. package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +2 -2
  154. package/dist/collection/components/vega-pagination/vega-pagination.js +1 -1
  155. package/dist/collection/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.js +30 -6
  156. package/dist/collection/components/vega-progress-tracker/slimmers/controllers/vega-progress-tracker-current-steps-controller.js +1 -1
  157. package/dist/collection/components/vega-progress-tracker/slimmers/renderers/vega-progress-tracker-renderer.js +8 -1
  158. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.js +27 -0
  159. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.css +12 -0
  160. package/dist/collection/components/vega-progress-tracker/vega-progress-tracker.js +8 -3
  161. package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +1 -1
  162. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/value-controller.js +1 -1
  163. package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +1 -1
  164. package/dist/collection/components/vega-signature-capture/slimmers/written-mode/controllers/written-mode-svg-controller.js +2 -1
  165. package/dist/collection/components/vega-table/interface.js +3 -0
  166. package/dist/collection/components/vega-table/vega-table-foot-cell/slimmers/renderers/vega-table-foot-cell-renderer.js +1 -1
  167. package/dist/collection/global/scripts/before-vega-load.js +4 -3
  168. package/dist/collection/helpers/calendar/calendar-date.js +1 -1
  169. package/dist/collection/helpers/calendar/calendar-event.js +1 -1
  170. package/dist/collection/helpers/calendar/calendar-time.js +1 -1
  171. package/dist/collection/helpers/code-format/test/code-formatter.test.js +1 -1
  172. package/dist/collection/helpers/common/index.js +2 -37
  173. package/dist/collection/helpers/common/test/wait-for-vega-handler.test.js +2 -2
  174. package/dist/collection/helpers/common/wait-for-component-did-render.js +27 -0
  175. package/dist/collection/helpers/common/wait-for-vega-handler.js +12 -1
  176. package/dist/collection/helpers/feature-control/feature-flags-map.js +6 -0
  177. package/dist/collection/helpers/formatter/responsive-map-formatter/responsive-border-radius-style-formatter.js +1 -1
  178. package/dist/collection/helpers/public-api.js +0 -2
  179. package/dist/collection/helpers/slimmers/component-global-style-slimmer.js +2 -1
  180. package/dist/collection/helpers/slimmers/field-error-ui-controller-slimmer.js +3 -4
  181. package/dist/collection/helpers/slimmers/form-field-message-translator.js +1 -1
  182. package/dist/collection/helpers/slimmers/global/vega-translate-observer-slimmer.js +1 -1
  183. package/dist/collection/helpers/slimmers/global/vega-watch-method-cancel-slimmer.js +1 -1
  184. package/dist/collection/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.js +128 -0
  185. package/dist/collection/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.js +196 -0
  186. package/dist/collection/helpers/slimmers/position-calculation/base-position-calculation-strategy.js +162 -151
  187. package/dist/collection/helpers/slimmers/position-calculation/position-calculation-controller.js +9 -0
  188. package/dist/collection/helpers/slimmers/position-calculation/screen-position-calculation-strategy.js +112 -1
  189. package/dist/collection/helpers/slimmers/position-calculation/screen-scroll-position-update.js +53 -0
  190. package/dist/collection/helpers/slimmers/position-calculation/test/screen-position-calculation-strategy.test.js +103 -6
  191. package/dist/collection/helpers/slimmers/string-input-formatter-slimmer.js +1 -1
  192. package/dist/collection/helpers/slimmers/translation/translation-slimmer.js +1 -1
  193. package/dist/collection/helpers/theme/controllers/brand-style-controller.js +3 -1
  194. package/dist/collection/helpers/theme/controllers/color-schema-overriding-controller.js +8 -6
  195. package/dist/collection/helpers/theme/controllers/dark-mode-style-controller.js +3 -1
  196. package/dist/collection/helpers/theme/internal-theme-manager.js +2 -1
  197. package/dist/collection/helpers/theme/tests/theme-manager-controller.test.js +1 -2
  198. package/dist/collection/helpers/ui/element-appender.js +4 -5
  199. package/dist/collection/helpers/ui/test/element-appender.test.js +66 -17
  200. package/dist/collection/index.js +2 -0
  201. package/dist/collection/polyfill/prism/index.js +2 -0
  202. package/dist/collection/polyfill/prism/languages/css.js +86 -0
  203. package/dist/collection/polyfill/prism/languages/javascript.js +96 -0
  204. package/dist/collection/polyfill/prism/languages/jsx.js +46 -0
  205. package/dist/collection/polyfill/prism/languages/language-registry.js +41 -0
  206. package/dist/collection/polyfill/prism/languages/markup.js +71 -0
  207. package/dist/collection/polyfill/prism/languages/tsx.js +10 -0
  208. package/dist/collection/polyfill/prism/languages/typescript.js +64 -0
  209. package/dist/collection/polyfill/prism/test/css.test.js +61 -0
  210. package/dist/collection/polyfill/prism/test/javascript.test.js +113 -0
  211. package/dist/collection/polyfill/prism/test/jsx.test.js +48 -0
  212. package/dist/collection/polyfill/prism/test/language-registry.test.js +77 -0
  213. package/dist/collection/polyfill/prism/test/markup.test.js +57 -0
  214. package/dist/collection/polyfill/prism/test/test-utils.js +22 -0
  215. package/dist/collection/polyfill/prism/test/tokenizer.test.js +180 -0
  216. package/dist/collection/polyfill/prism/test/tsx.test.js +87 -0
  217. package/dist/collection/polyfill/prism/test/typescript.test.js +86 -0
  218. package/dist/collection/polyfill/prism/tokenizer.js +242 -0
  219. package/dist/collection/polyfill/tinycolor/tinycolor-polyfill.js +320 -0
  220. package/dist/collection/polyfill/tinycolor/tinycolor-polyfill.test.js +361 -0
  221. package/dist/collection/types/ui.type.js +12 -0
  222. package/dist/collection/utils/e2e-utils.js +10 -3
  223. package/dist/collection/utils/sanitize/constants/tag-sets.js +5 -0
  224. package/dist/collection/utils/sanitize/core/html-sanitizer.js +39 -0
  225. package/dist/collection/utils/sanitize/core/sanitize-strategy.js +62 -0
  226. package/dist/collection/utils/sanitize/core/types.js +4 -0
  227. package/dist/collection/utils/sanitize/index.js +12 -0
  228. package/dist/collection/utils/sanitize/strategies/empty-sanitize-strategy.js +17 -0
  229. package/dist/collection/utils/sanitize/strategies/index.js +3 -0
  230. package/dist/collection/utils/sanitize/strategies/label-sanitize-strategy.js +13 -0
  231. package/dist/collection/utils/sanitize/strategies/style-sanitize-strategy.js +50 -0
  232. package/dist/collection/utils/sanitize/test/empty-strategy.test.js +12 -0
  233. package/dist/collection/utils/sanitize/test/html-sanitizer.test.js +57 -0
  234. package/dist/collection/utils/sanitize/test/label-strategy.test.js +56 -0
  235. package/dist/collection/utils/sanitize/test/sanitize-strategy.test.js +85 -0
  236. package/dist/collection/utils/sanitize/test/sanitize.test.js +22 -0
  237. package/dist/collection/utils/sanitize/test/serialize-fragment.test.js +25 -0
  238. package/dist/collection/utils/sanitize/test/style-strategy.test.js +45 -0
  239. package/dist/collection/utils/sanitize/utils/serialize-fragment.js +17 -0
  240. package/dist/esm/{app-globals-2ac60ff5.js → app-globals-c0676920.js} +12 -16
  241. package/dist/esm/breakpoints-56e5407b.js +53 -0
  242. package/dist/esm/{child-nodes-event-prevent-slimmer-e662bee2.js → child-nodes-event-prevent-slimmer-649b9d30.js} +2 -2
  243. package/dist/esm/{child-nodes-notify-observer-slimmer-b676cd2b.js → child-nodes-notify-observer-slimmer-541dd6a4.js} +1 -1
  244. package/dist/esm/{code-block-8ee34ab6.js → code-block-b6247a45.js} +7 -7
  245. package/dist/esm/{component-global-style-slimmer-08046b38.js → component-global-style-slimmer-ac703085.js} +2 -1
  246. package/dist/esm/{component-usage-runtime-metrics-a84cc93e.js → component-usage-runtime-metrics-46020a03.js} +1 -1
  247. package/dist/esm/{component-value-history-controller-slimmer.abstract-a61bf821.js → component-value-history-controller-slimmer.abstract-2bb8533d.js} +6 -6
  248. package/dist/esm/{create-public-api-runtime-metrics-slimmer-bedf3a1e.js → create-public-api-runtime-metrics-slimmer-aaadaa08.js} +3 -38
  249. package/dist/esm/{dark-mode-style-controller-de88a117.js → dark-mode-style-controller-82e5c1c6.js} +292 -1254
  250. package/dist/esm/{date-required-rule-47ecc28f.js → date-required-rule-e771e7d9.js} +1 -1
  251. package/dist/esm/{design-token-007efbaa.js → design-token-4aee1c56.js} +2 -2
  252. package/dist/esm/dom-node-subject-observer-factory-82f346e3.js +138 -0
  253. package/dist/esm/{dto-renderer-manager-ee1a5864.js → dto-renderer-manager-6fd22ab7.js} +7 -7
  254. package/dist/esm/{element-appender-slimmer-35e26b5a.js → element-appender-slimmer-e4713a72.js} +348 -165
  255. package/dist/esm/{event-emit-slimmer-09827cec.js → event-emit-slimmer-ffaecb9a.js} +2 -2
  256. package/dist/esm/{feature-flag-controller-51659753.js → feature-flag-controller-09ea7e87.js} +7 -1
  257. package/dist/esm/{form-field-controller-slimmer-5d9dc384.js → form-field-controller-slimmer-5817d14d.js} +10 -11
  258. package/dist/esm/{internal-icon-manager-f0486245.js → icon-manager-539d7cf7.js} +2 -52
  259. package/dist/esm/{image-annotation-action-285d432e.js → image-annotation-action-6701b4c9.js} +6 -5
  260. package/dist/esm/index-3b327f29.js +215 -0
  261. package/dist/esm/{index-e9da316f.js → index-bfc6dfa2.js} +13 -1
  262. package/dist/esm/index.js +32 -29
  263. package/dist/esm/{inject-keyboard-manager-83d76ff5.js → inject-keyboard-manager-78730062.js} +1 -1
  264. package/dist/esm/internal-icon-manager-bd80b3bb.js +53 -0
  265. package/dist/esm/{translation-96e5debd.js → internal-translation-controller-911515f9.js} +1 -93
  266. package/dist/esm/{internal-vega-event-manager-efb6786e.js → internal-vega-event-manager-32a3d848.js} +1 -1
  267. package/dist/esm/internal-vega-z-index-manager-7d2b54c3.js +178 -0
  268. package/dist/esm/{keyboard-manager-c92808d8.js → keyboard-manager-38934f94.js} +2 -2
  269. package/dist/esm/{keyboard-manager-slimmer-79c78ce8.js → keyboard-manager-slimmer-9984d922.js} +1 -1
  270. package/dist/esm/loader.js +27 -24
  271. package/dist/esm/misc-9fdbcfbb.js +37 -0
  272. package/dist/esm/{month-view-generator-16192182.js → month-view-generator-eaf9029c.js} +1 -1
  273. package/dist/esm/{page-resize-observer-slimmer-8744cb44.js → page-resize-observer-slimmer-d6af0d86.js} +2 -52
  274. package/dist/esm/{public-rules-724873f5.js → public-rules-25cc3a39.js} +13 -14
  275. package/dist/esm/{range-5257c062.js → range-663f44dc.js} +2 -2
  276. package/dist/esm/{responsive-format-facade-28ee2dbd.js → responsive-format-facade-7a071174.js} +3 -12
  277. package/dist/esm/{rich-text-editor-required-rule-873e2e67.js → rich-text-editor-required-rule-a238b862.js} +1 -1
  278. package/dist/esm/{string-format-strategy.abstract-fc60db79.js → string-format-strategy.abstract-713fba36.js} +1 -1
  279. package/dist/esm/{string-input-formatter-slimmer-ee32b1fd.js → string-input-formatter-slimmer-5b413ff9.js} +4 -4
  280. package/dist/esm/{string-mask-strategy-0b0accaa.js → string-mask-strategy-6beaf664.js} +2 -2
  281. package/dist/esm/{style-formatter-314b37f3.js → style-formatter-3d06b72d.js} +2 -2
  282. package/dist/esm/{sub-state-notify-slimmer-4453047a.js → sub-state-notify-slimmer-5133f1a8.js} +2 -2
  283. package/dist/esm/{sub-state-observer-slimmer-202ec7dc.js → sub-state-observer-slimmer-478c9f41.js} +3 -3
  284. package/dist/esm/{time-required-rule-5fa43804.js → time-required-rule-e4138a76.js} +1 -1
  285. package/dist/esm/{function-extension-e8c0e43e.js → token-extension-e33fd151.js} +488 -376
  286. package/dist/esm/{translation-slimmer-c936cb1b.js → translation-slimmer-2394b173.js} +1 -1
  287. package/dist/esm/{type-guard-c65a227d.js → type-guard-f50e34d6.js} +1 -1
  288. package/dist/esm/{ui-bb99c0c2.js → ui-ee31416b.js} +12 -0
  289. package/dist/esm/{valid-credit-card-number-rule-666c415d.js → valid-credit-card-number-rule-22ce81db.js} +1 -1
  290. package/dist/esm/vega-accordion.entry.js +19 -28
  291. package/dist/esm/vega-app-footer.entry.js +3 -3
  292. package/dist/esm/vega-app-header-button.entry.js +174 -40
  293. package/dist/esm/vega-backdrop.entry.js +2 -2
  294. package/dist/esm/vega-banner.entry.js +12 -10
  295. package/dist/esm/vega-bar-chart.entry.js +1 -1
  296. package/dist/esm/vega-box.entry.js +14 -29
  297. package/dist/esm/vega-brand-logo.entry.js +7 -5
  298. package/dist/esm/vega-breadcrumb.entry.js +11 -10
  299. package/dist/esm/vega-button-circle.entry.js +19 -29
  300. package/dist/esm/vega-button-group_2.entry.js +12 -12
  301. package/dist/esm/vega-button-link.entry.js +13 -12
  302. package/dist/esm/vega-button.entry.js +19 -28
  303. package/dist/esm/vega-calendar_4.entry.js +23 -20
  304. package/dist/esm/vega-card.entry.js +9 -28
  305. package/dist/esm/vega-carousel.entry.js +14 -25
  306. package/dist/esm/vega-checkbox_2.entry.js +19 -17
  307. package/dist/esm/vega-chip.entry.js +18 -29
  308. package/dist/esm/vega-code-block.entry.js +653 -2704
  309. package/dist/esm/vega-color-picker.entry.js +15 -12
  310. package/dist/esm/vega-combo-box.entry.js +22 -21
  311. package/dist/esm/vega-counter-badge.entry.js +1 -1
  312. package/dist/esm/vega-date-picker_2.entry.js +34 -37
  313. package/dist/esm/vega-dialog-controller-bbb2fc52.js +82 -0
  314. package/dist/esm/vega-dialog_2.entry.js +23 -30
  315. package/dist/esm/vega-divider.entry.js +11 -29
  316. package/dist/esm/vega-dropdown_5.entry.js +39 -45
  317. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  318. package/dist/esm/vega-event-id-38aa77a0.js +113 -0
  319. package/dist/esm/vega-field-error.entry.js +1 -1
  320. package/dist/esm/vega-field-label.entry.js +7 -6
  321. package/dist/esm/vega-file-uploader.entry.js +19 -14
  322. package/dist/esm/vega-flag-icon.entry.js +12 -26
  323. package/dist/esm/vega-flex.entry.js +11 -28
  324. package/dist/esm/vega-font.entry.js +11 -28
  325. package/dist/esm/vega-form.entry.js +20 -18
  326. package/dist/esm/vega-grid.entry.js +9 -28
  327. package/dist/esm/vega-hint.entry.js +1 -1
  328. package/dist/esm/vega-icon.entry.js +15 -28
  329. package/dist/esm/vega-image-uploader.entry.js +28 -31
  330. package/dist/esm/vega-input-credit-card.entry.js +25 -21
  331. package/dist/esm/vega-input-numeric.entry.js +21 -19
  332. package/dist/esm/vega-input-passcode.entry.js +20 -18
  333. package/dist/esm/vega-input-phone-number.entry.js +27 -31
  334. package/dist/esm/vega-input-range.entry.js +19 -17
  335. package/dist/esm/vega-input-select.entry.js +27 -32
  336. package/dist/esm/vega-input.entry.js +33 -21
  337. package/dist/esm/{vega-internal-event-id-4a06d705.js → vega-internal-event-id-799d012e.js} +1 -1
  338. package/dist/esm/vega-item-toggle.entry.js +6 -5
  339. package/dist/esm/vega-left-nav_5.entry.js +29 -31
  340. package/dist/esm/vega-line-chart.entry.js +1 -1
  341. package/dist/esm/vega-loader-wrapper_2.entry.js +13 -29
  342. package/dist/esm/vega-page-notification_2.entry.js +4 -3
  343. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +9 -9
  344. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +7 -8
  345. package/dist/esm/vega-pagination.entry.js +20 -30
  346. package/dist/esm/vega-pie-chart.entry.js +1 -1
  347. package/dist/esm/vega-popover_2.entry.js +20 -30
  348. package/dist/esm/vega-progress-tracker_2.entry.js +64 -37
  349. package/dist/esm/vega-radio_2.entry.js +21 -19
  350. package/dist/esm/vega-rich-text-content.entry.js +18 -16
  351. package/dist/esm/vega-rich-text-editor_4.entry.js +33 -30
  352. package/dist/esm/vega-section-title.entry.js +1 -1
  353. package/dist/esm/vega-segment-control.entry.js +9 -7
  354. package/dist/esm/vega-selection-chip_2.entry.js +22 -29
  355. package/dist/esm/vega-selection-tile_2.entry.js +19 -17
  356. package/dist/esm/vega-sidenav_3.entry.js +24 -30
  357. package/dist/esm/vega-signature-capture.entry.js +24 -28
  358. package/dist/esm/vega-skeleton.entry.js +1 -1
  359. package/dist/esm/vega-slot-container.entry.js +1 -1
  360. package/dist/esm/vega-stepper.entry.js +18 -16
  361. package/dist/esm/vega-tab-group_2.entry.js +11 -10
  362. package/dist/esm/vega-table_11.entry.js +28 -29
  363. package/dist/esm/vega-text.entry.js +4 -3
  364. package/dist/esm/vega-textarea.entry.js +18 -16
  365. package/dist/esm/vega-time-picker_2.entry.js +26 -32
  366. package/dist/esm/vega-toggle-switch.entry.js +15 -12
  367. package/dist/esm/vega-tooltip_2.entry.js +18 -29
  368. package/dist/esm/vega.js +27 -24
  369. package/dist/esm/{index-51a7da7f.js → wait-for-component-did-render-b08ef07b.js} +3 -13
  370. package/dist/sri/vega-sri-manifest.json +418 -406
  371. package/dist/types/components/vega-app-footer/types.d.ts +18 -0
  372. package/dist/types/components/vega-app-header-button/types.d.ts +31 -0
  373. package/dist/types/components/vega-app-header-button/vega-app-header-button.d.ts +2 -0
  374. package/dist/types/components/vega-banner/types.d.ts +9 -0
  375. package/dist/types/components/vega-box/interface.d.ts +46 -0
  376. package/dist/types/components/vega-breadcrumb/types.d.ts +28 -0
  377. package/dist/types/components/vega-button/types.d.ts +12 -0
  378. package/dist/types/components/vega-button-circle/types.d.ts +9 -0
  379. package/dist/types/components/vega-button-group/types.d.ts +48 -0
  380. package/dist/types/components/vega-button-link/types.d.ts +3 -0
  381. package/dist/types/components/vega-calendar/types.d.ts +189 -0
  382. package/dist/types/components/vega-calendar/vega-calendar-event-preview/types.d.ts +6 -0
  383. package/dist/types/components/vega-chart/vega-bar-chart/types.d.ts +3 -0
  384. package/dist/types/components/vega-chip/types.d.ts +12 -0
  385. package/dist/types/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.d.ts +2 -10
  386. package/dist/types/components/vega-combo-box/types.d.ts +6 -0
  387. package/dist/types/components/vega-date-picker/types.d.ts +39 -0
  388. package/dist/types/components/vega-dialog/types.d.ts +5 -0
  389. package/dist/types/components/vega-divider/interface.d.ts +18 -0
  390. package/dist/types/components/vega-dropdown/types.d.ts +30 -0
  391. package/dist/types/components/vega-dropdown/vega-dropdown-item/types.d.ts +9 -1
  392. package/dist/types/components/vega-field-error/types.d.ts +12 -0
  393. package/dist/types/components/vega-field-label/types.d.ts +16 -0
  394. package/dist/types/components/vega-file-uploader/types.d.ts +12 -0
  395. package/dist/types/components/vega-font/types.d.ts +3 -0
  396. package/dist/types/components/vega-form/types.d.ts +45 -0
  397. package/dist/types/components/vega-image-uploader/types.d.ts +33 -1
  398. package/dist/types/components/vega-input/types.d.ts +31 -0
  399. package/dist/types/components/vega-input-phone-number/types.d.ts +15 -0
  400. package/dist/types/components/vega-input-range/types.d.ts +9 -0
  401. package/dist/types/components/vega-input-select/types.d.ts +45 -0
  402. package/dist/types/components/vega-item-toggle/types.d.ts +21 -0
  403. package/dist/types/components/vega-loading-indicator/types.d.ts +3 -0
  404. package/dist/types/components/vega-modal/types.d.ts +9 -0
  405. package/dist/types/components/vega-nav/interface.d.ts +108 -0
  406. package/dist/types/components/vega-page-notification/types.d.ts +15 -0
  407. package/dist/types/components/vega-pagination/types.d.ts +11 -0
  408. package/dist/types/components/vega-progress-tracker/slimmers/controllers/dto/internal-progress-tracker-step.d.ts +16 -4
  409. package/dist/types/components/vega-progress-tracker/type.d.ts +8 -0
  410. package/dist/types/components/vega-progress-tracker/vega-progress-tracker-step/vega-progress-tracker-step.d.ts +6 -0
  411. package/dist/types/components/vega-progress-tracker/vega-progress-tracker.d.ts +2 -2
  412. package/dist/types/components/vega-rich-text-editor/interface.d.ts +473 -2
  413. package/dist/types/components/vega-rich-text-editor/vega-rich-text-image-editor/types.d.ts +24 -0
  414. package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/types.d.ts +24 -0
  415. package/dist/types/components/vega-segment-control/types.d.ts +18 -0
  416. package/dist/types/components/vega-selection-chip/interface.d.ts +12 -0
  417. package/dist/types/components/vega-selection-chip/vega-selection-chip-group/interface.d.ts +4 -0
  418. package/dist/types/components/vega-selection-tile/interface.d.ts +9 -0
  419. package/dist/types/components/vega-sidenav/types.d.ts +51 -0
  420. package/dist/types/components/vega-signature-capture/types.d.ts +29 -2
  421. package/dist/types/components/vega-skeleton/interface.d.ts +6 -0
  422. package/dist/types/components/vega-tab-group/types.d.ts +36 -0
  423. package/dist/types/components/vega-table/interface.d.ts +237 -20
  424. package/dist/types/components/vega-table/vega-table-expand-row/types.d.ts +6 -0
  425. package/dist/types/components/vega-table/vega-table-foot/types.d.ts +9 -0
  426. package/dist/types/components/vega-table/vega-table-foot-row/types.d.ts +9 -0
  427. package/dist/types/components/vega-table/vega-table-head/types.d.ts +9 -0
  428. package/dist/types/components/vega-table/vega-table-head-row/types.d.ts +12 -0
  429. package/dist/types/components/vega-table/vega-table-row/types.d.ts +18 -0
  430. package/dist/types/components/vega-text/types.d.ts +6 -0
  431. package/dist/types/components/vega-time-picker/types.d.ts +33 -0
  432. package/dist/types/components/vega-virtual-scroll/types.d.ts +30 -1
  433. package/dist/types/components.d.ts +13 -3
  434. package/dist/types/helpers/common/index.d.ts +2 -15
  435. package/dist/types/helpers/common/wait-for-component-did-render.d.ts +8 -0
  436. package/dist/types/helpers/common/wait-for-vega-handler.d.ts +6 -15
  437. package/dist/types/helpers/feature-control/feature-flag.d.ts +2 -1
  438. package/dist/types/helpers/public-api.d.ts +0 -2
  439. package/dist/types/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.d.ts +44 -0
  440. package/dist/types/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.d.ts +1 -0
  441. package/dist/types/helpers/slimmers/position-calculation/base-position-calculation-strategy.d.ts +57 -48
  442. package/dist/types/helpers/slimmers/position-calculation/position-calculation-controller.d.ts +5 -0
  443. package/dist/types/helpers/slimmers/position-calculation/screen-position-calculation-strategy.d.ts +41 -1
  444. package/dist/types/helpers/slimmers/position-calculation/screen-scroll-position-update.d.ts +39 -0
  445. package/dist/types/helpers/ui/element-appender.d.ts +0 -1
  446. package/dist/types/index.d.ts +2 -0
  447. package/dist/types/polyfill/prism/index.d.ts +3 -0
  448. package/dist/types/polyfill/prism/languages/css.d.ts +6 -0
  449. package/dist/types/polyfill/prism/languages/javascript.d.ts +7 -0
  450. package/dist/types/polyfill/prism/languages/jsx.d.ts +7 -0
  451. package/dist/types/polyfill/prism/languages/language-registry.d.ts +8 -0
  452. package/dist/types/polyfill/prism/languages/markup.d.ts +6 -0
  453. package/dist/types/polyfill/prism/languages/tsx.d.ts +7 -0
  454. package/dist/types/polyfill/prism/languages/typescript.d.ts +2 -0
  455. package/dist/types/polyfill/prism/test/css.test.d.ts +1 -0
  456. package/dist/types/polyfill/prism/test/javascript.test.d.ts +1 -0
  457. package/dist/types/polyfill/prism/test/jsx.test.d.ts +1 -0
  458. package/dist/types/polyfill/prism/test/language-registry.test.d.ts +1 -0
  459. package/dist/types/polyfill/prism/test/markup.test.d.ts +1 -0
  460. package/dist/types/polyfill/prism/test/test-utils.d.ts +10 -0
  461. package/dist/types/polyfill/prism/test/tokenizer.test.d.ts +1 -0
  462. package/dist/types/polyfill/prism/test/tsx.test.d.ts +1 -0
  463. package/dist/types/polyfill/prism/test/typescript.test.d.ts +1 -0
  464. package/dist/types/polyfill/prism/tokenizer.d.ts +17 -0
  465. package/dist/types/polyfill/prism/types.d.ts +25 -0
  466. package/dist/types/polyfill/tinycolor/tinycolor-polyfill.d.ts +149 -0
  467. package/dist/types/polyfill/tinycolor/tinycolor-polyfill.test.d.ts +1 -0
  468. package/dist/types/types/components.type.d.ts +4 -1
  469. package/dist/types/types/design-token.type.d.ts +36 -0
  470. package/dist/types/types/flag.type.d.ts +3 -0
  471. package/dist/types/types/general.d.ts +12 -0
  472. package/dist/types/types/ui.type.d.ts +372 -0
  473. package/dist/types/types/vega-chart.d.ts +281 -2
  474. package/dist/types/utils/e2e-utils.d.ts +2 -0
  475. package/dist/types/utils/sanitize/constants/tag-sets.d.ts +6 -0
  476. package/dist/types/utils/sanitize/core/html-sanitizer.d.ts +22 -0
  477. package/dist/types/utils/sanitize/core/sanitize-strategy.d.ts +27 -0
  478. package/dist/types/utils/sanitize/core/types.d.ts +13 -0
  479. package/dist/types/utils/sanitize/index.d.ts +12 -0
  480. package/dist/types/utils/sanitize/strategies/empty-sanitize-strategy.d.ts +14 -0
  481. package/dist/types/utils/sanitize/strategies/index.d.ts +3 -0
  482. package/dist/types/utils/sanitize/strategies/label-sanitize-strategy.d.ts +10 -0
  483. package/dist/types/utils/sanitize/strategies/style-sanitize-strategy.d.ts +24 -0
  484. package/dist/types/utils/sanitize/test/empty-strategy.test.d.ts +1 -0
  485. package/dist/types/utils/sanitize/test/html-sanitizer.test.d.ts +1 -0
  486. package/dist/types/utils/sanitize/test/label-strategy.test.d.ts +1 -0
  487. package/dist/types/utils/sanitize/test/sanitize-strategy.test.d.ts +1 -0
  488. package/dist/types/utils/sanitize/test/sanitize.test.d.ts +1 -0
  489. package/dist/types/utils/sanitize/test/serialize-fragment.test.d.ts +1 -0
  490. package/dist/types/utils/sanitize/test/style-strategy.test.d.ts +1 -0
  491. package/dist/types/utils/sanitize/utils/serialize-fragment.d.ts +12 -0
  492. package/dist/vega/index.esm.js +1 -1
  493. package/dist/vega/p-01d58eb8.entry.js +1 -0
  494. package/dist/vega/p-021d4ae4.js +1 -0
  495. package/dist/vega/p-02a7d60c.entry.js +1 -0
  496. package/dist/vega/{p-66fa700b.js → p-02c9796a.js} +1 -1
  497. package/dist/vega/p-033c31d8.entry.js +1 -0
  498. package/dist/vega/{p-e77a83e4.js → p-07cb0243.js} +1 -1
  499. package/dist/vega/p-087ea379.entry.js +1 -0
  500. package/dist/vega/{p-e5af5a4d.entry.js → p-0b4880bd.entry.js} +1 -1
  501. package/dist/vega/{p-920719ad.js → p-0e679d8c.js} +1 -1
  502. package/dist/vega/{p-c9b6b5a9.js → p-10734a00.js} +1 -1
  503. package/dist/vega/p-154f9cf7.entry.js +1 -0
  504. package/dist/vega/p-179aad4f.entry.js +1 -0
  505. package/dist/vega/p-1a3236e7.entry.js +1 -0
  506. package/dist/vega/p-1f3cd061.entry.js +1 -0
  507. package/dist/vega/p-1f5e35dc.entry.js +1 -0
  508. package/dist/vega/p-242fbcad.entry.js +1 -0
  509. package/dist/vega/p-249df6d2.entry.js +1 -0
  510. package/dist/vega/p-28ad1864.entry.js +1 -0
  511. package/dist/vega/p-2a10e2e5.js +1 -0
  512. package/dist/vega/p-2b49686d.entry.js +1 -0
  513. package/dist/vega/p-2ba78982.entry.js +1 -0
  514. package/dist/vega/p-2bb5a232.js +1 -0
  515. package/dist/vega/{p-e9b86dac.entry.js → p-2c1a85dd.entry.js} +1 -1
  516. package/dist/vega/p-2cc9d126.entry.js +1 -0
  517. package/dist/vega/p-2d69632d.js +1 -0
  518. package/dist/vega/p-2e91295d.entry.js +1 -0
  519. package/dist/vega/p-31ac7386.js +1 -0
  520. package/dist/vega/p-32033e7a.js +1 -0
  521. package/dist/vega/p-32183637.entry.js +1 -0
  522. package/dist/vega/p-3244c605.entry.js +1 -0
  523. package/dist/vega/p-32faa460.entry.js +1 -0
  524. package/dist/vega/p-33f9ad94.entry.js +1 -0
  525. package/dist/vega/{p-4897bedd.entry.js → p-358b4a06.entry.js} +1 -1
  526. package/dist/vega/p-3afc025e.entry.js +1 -0
  527. package/dist/vega/p-3d8122ab.entry.js +1 -0
  528. package/dist/vega/{p-ea04a387.entry.js → p-3f3c771a.entry.js} +1 -1
  529. package/dist/vega/{p-1f83cebf.js → p-415ffa35.js} +1 -1
  530. package/dist/vega/{p-d849e0f5.js → p-4415ad28.js} +1 -1
  531. package/dist/vega/{p-0575d22e.js → p-464559e3.js} +1 -1
  532. package/dist/vega/p-49845a91.js +1 -0
  533. package/dist/vega/{p-e16b3adf.js → p-4bffdb28.js} +1 -1
  534. package/dist/vega/p-4e017458.entry.js +1 -0
  535. package/dist/vega/p-4e4a0228.entry.js +1 -0
  536. package/dist/vega/{p-a2aeb646.js → p-4ea30592.js} +1 -1
  537. package/dist/vega/{p-0b38a01f.entry.js → p-51fcb07f.entry.js} +1 -1
  538. package/dist/vega/p-57927b10.entry.js +1 -0
  539. package/dist/vega/p-5831d6d3.entry.js +1 -0
  540. package/dist/vega/p-593e0f80.js +1 -0
  541. package/dist/vega/p-5a25014f.js +1 -0
  542. package/dist/vega/p-5eb7f382.js +1 -0
  543. package/dist/vega/p-5f377954.js +1 -1
  544. package/dist/vega/p-644f701a.js +1 -0
  545. package/dist/vega/p-6a62e476.entry.js +1 -0
  546. package/dist/vega/{p-75f981ce.js → p-6b6f0fb4.js} +1 -1
  547. package/dist/vega/p-6d219c44.entry.js +1 -0
  548. package/dist/vega/p-6d60b66a.entry.js +1 -0
  549. package/dist/vega/{p-ad2055f4.entry.js → p-6dcdb580.entry.js} +1 -1
  550. package/dist/vega/{p-691ba1ae.js → p-7181861a.js} +1 -1
  551. package/dist/vega/p-76181a70.entry.js +1 -0
  552. package/dist/vega/p-781fd6e0.js +1 -0
  553. package/dist/vega/p-7958614a.entry.js +1 -0
  554. package/dist/vega/{p-5b71c85e.js → p-7c39ce96.js} +1 -1
  555. package/dist/vega/p-7d7aaff9.entry.js +1 -0
  556. package/dist/vega/{p-4dd6554e.entry.js → p-7f46cc1e.entry.js} +1 -1
  557. package/dist/vega/{p-badad9ed.js → p-81b044b9.js} +1 -1
  558. package/dist/vega/p-8950987b.entry.js +1 -0
  559. package/dist/vega/p-89f2e16d.entry.js +1 -0
  560. package/dist/vega/p-8ac2d165.js +1 -0
  561. package/dist/vega/p-8b153acd.entry.js +1 -0
  562. package/dist/vega/p-8b5d3a52.js +1 -0
  563. package/dist/vega/{p-fff13ed1.entry.js → p-8b891f36.entry.js} +1 -1
  564. package/dist/vega/p-8dbdd609.entry.js +1 -0
  565. package/dist/vega/{p-dd11f735.js → p-9339c6c4.js} +1 -1
  566. package/dist/vega/p-94a77fbe.entry.js +1 -0
  567. package/dist/vega/p-95528b47.js +1 -0
  568. package/dist/vega/p-9a137bab.entry.js +1 -0
  569. package/dist/vega/{p-6f8be8ea.js → p-a0b66c25.js} +1 -1
  570. package/dist/vega/{p-0bb3be0b.entry.js → p-a13a73fa.entry.js} +1 -1
  571. package/dist/vega/p-a560d8c5.entry.js +1 -0
  572. package/dist/vega/{p-d0e31633.js → p-a786259a.js} +1 -1
  573. package/dist/vega/p-a7a8a4eb.entry.js +1 -0
  574. package/dist/vega/p-a8792e3d.js +1 -0
  575. package/dist/vega/{p-60851f9d.js → p-aa1174dc.js} +1 -1
  576. package/dist/vega/p-ab834f06.js +1 -0
  577. package/dist/vega/p-b136ebba.entry.js +1 -0
  578. package/dist/vega/p-b201f379.js +1 -0
  579. package/dist/vega/p-b256b7a4.js +1 -0
  580. package/dist/vega/p-b366deff.entry.js +1 -0
  581. package/dist/vega/p-b597393b.entry.js +1 -0
  582. package/dist/vega/p-b7f3221f.js +1 -0
  583. package/dist/vega/p-bb5e0192.entry.js +1 -0
  584. package/dist/vega/p-be1a210b.js +1 -0
  585. package/dist/vega/p-bebfbe95.entry.js +1 -0
  586. package/dist/vega/p-bf6fc19f.entry.js +1 -0
  587. package/dist/vega/p-c1d13eec.entry.js +1 -0
  588. package/dist/vega/p-c29068fb.entry.js +1 -0
  589. package/dist/vega/p-c3d2f316.js +1 -0
  590. package/dist/vega/{p-671afda4.entry.js → p-c72e08c6.entry.js} +1 -1
  591. package/dist/vega/p-c801c85d.js +1 -0
  592. package/dist/vega/p-c8feb644.entry.js +1 -0
  593. package/dist/vega/p-ca5898dc.entry.js +1 -0
  594. package/dist/vega/p-d555f677.entry.js +1 -0
  595. package/dist/vega/p-d64fab3d.js +1 -0
  596. package/dist/vega/p-d6dbbe61.entry.js +1 -0
  597. package/dist/vega/p-d7a78c5e.entry.js +1 -0
  598. package/dist/vega/p-d8fadcdc.entry.js +1 -0
  599. package/dist/vega/p-dad3ba5f.js +1 -0
  600. package/dist/vega/p-dd3a94f4.entry.js +1 -0
  601. package/dist/vega/p-e1431c14.entry.js +1 -0
  602. package/dist/vega/p-e1fbfd20.js +1 -0
  603. package/dist/vega/p-e2af0e24.entry.js +1 -0
  604. package/dist/vega/{p-521d1d07.js → p-e52890db.js} +1 -1
  605. package/dist/vega/{p-1298b126.js → p-e632475e.js} +1 -1
  606. package/dist/vega/p-e6adf829.js +1 -0
  607. package/dist/vega/{p-77edf50c.js → p-e827d56d.js} +1 -1
  608. package/dist/vega/p-e8775a56.entry.js +1 -0
  609. package/dist/vega/p-e89e3ede.entry.js +1 -0
  610. package/dist/vega/p-eda988d5.entry.js +1 -0
  611. package/dist/vega/p-f05b8f76.entry.js +1 -0
  612. package/dist/vega/p-f0e828d8.js +1 -0
  613. package/dist/vega/p-f14a5eae.entry.js +1 -0
  614. package/dist/vega/p-f2b0b58a.js +1 -0
  615. package/dist/vega/p-f3d0f2dc.js +1 -0
  616. package/dist/vega/{p-5910be31.entry.js → p-f5bafc45.entry.js} +1 -1
  617. package/dist/vega/p-fc1fa345.js +1 -0
  618. package/dist/vega/p-fd7ddd64.entry.js +1 -0
  619. package/dist/vega/vega.esm.js +1 -1
  620. package/package.json +3 -5
  621. package/dist/cjs/_commonjsHelpers-537d719a.js +0 -20
  622. package/dist/cjs/language-extension-8c4a56ff.js +0 -210
  623. package/dist/cjs/sanitize-fb222510.js +0 -131
  624. package/dist/cjs/wait-for-vega-handler-5469ff80.js +0 -63
  625. package/dist/collection/utils/sanitize.js +0 -126
  626. package/dist/collection/utils/test/sanitize.test.js +0 -65
  627. package/dist/esm/_commonjsHelpers-9943807e.js +0 -17
  628. package/dist/esm/dom-node-subject-observer-factory-064ee2b2.js +0 -250
  629. package/dist/esm/language-extension-29bf8acd.js +0 -207
  630. package/dist/esm/sanitize-fd0cb40d.js +0 -129
  631. package/dist/esm/wait-for-vega-handler-c2c07ac3.js +0 -61
  632. package/dist/types/utils/sanitize.d.ts +0 -71
  633. package/dist/vega/p-011b94b1.entry.js +0 -1
  634. package/dist/vega/p-012753b5.entry.js +0 -1
  635. package/dist/vega/p-024331ce.entry.js +0 -1
  636. package/dist/vega/p-08a90cc6.entry.js +0 -1
  637. package/dist/vega/p-0ede1fea.entry.js +0 -1
  638. package/dist/vega/p-10ac8b57.js +0 -1
  639. package/dist/vega/p-112455b1.js +0 -1
  640. package/dist/vega/p-17c55205.entry.js +0 -1
  641. package/dist/vega/p-1e0d8228.entry.js +0 -1
  642. package/dist/vega/p-3353b3d7.js +0 -1
  643. package/dist/vega/p-365b1b35.entry.js +0 -1
  644. package/dist/vega/p-3ae9ee3d.entry.js +0 -1
  645. package/dist/vega/p-3af92370.entry.js +0 -1
  646. package/dist/vega/p-3bf66be2.js +0 -1
  647. package/dist/vega/p-3c5a28e4.entry.js +0 -1
  648. package/dist/vega/p-3e5f362f.js +0 -1
  649. package/dist/vega/p-430be941.js +0 -1
  650. package/dist/vega/p-43f585f7.entry.js +0 -1
  651. package/dist/vega/p-45296fd4.entry.js +0 -1
  652. package/dist/vega/p-476a173a.js +0 -1
  653. package/dist/vega/p-491618a6.entry.js +0 -1
  654. package/dist/vega/p-4a537391.entry.js +0 -1
  655. package/dist/vega/p-4aa893ef.entry.js +0 -1
  656. package/dist/vega/p-4c47e8bb.entry.js +0 -1
  657. package/dist/vega/p-4da75f2b.js +0 -1
  658. package/dist/vega/p-509eb52e.entry.js +0 -1
  659. package/dist/vega/p-5110ba73.entry.js +0 -1
  660. package/dist/vega/p-556f9a21.entry.js +0 -1
  661. package/dist/vega/p-55b54ba0.entry.js +0 -1
  662. package/dist/vega/p-5d676a94.js +0 -1
  663. package/dist/vega/p-5ea2e43c.entry.js +0 -1
  664. package/dist/vega/p-5efc6fe1.entry.js +0 -1
  665. package/dist/vega/p-64cd1931.entry.js +0 -1
  666. package/dist/vega/p-67fcf6f2.entry.js +0 -9
  667. package/dist/vega/p-68df4288.js +0 -1
  668. package/dist/vega/p-6a2205a1.entry.js +0 -1
  669. package/dist/vega/p-6a4277df.entry.js +0 -1
  670. package/dist/vega/p-6e136980.js +0 -1
  671. package/dist/vega/p-6fa8e231.entry.js +0 -1
  672. package/dist/vega/p-7045e84c.entry.js +0 -1
  673. package/dist/vega/p-7288f8c4.js +0 -1
  674. package/dist/vega/p-749f96a4.js +0 -1
  675. package/dist/vega/p-7aaece55.entry.js +0 -1
  676. package/dist/vega/p-7ec6a104.entry.js +0 -1
  677. package/dist/vega/p-81134e9e.entry.js +0 -1
  678. package/dist/vega/p-89d685a8.js +0 -1
  679. package/dist/vega/p-8c0eb12f.entry.js +0 -1
  680. package/dist/vega/p-8c9ea6f4.js +0 -1
  681. package/dist/vega/p-8d0ca805.js +0 -1
  682. package/dist/vega/p-8d701832.entry.js +0 -1
  683. package/dist/vega/p-8e42a14c.entry.js +0 -1
  684. package/dist/vega/p-8ed0faa2.entry.js +0 -1
  685. package/dist/vega/p-94394df7.entry.js +0 -1
  686. package/dist/vega/p-99aa554b.entry.js +0 -1
  687. package/dist/vega/p-9a2446f1.entry.js +0 -1
  688. package/dist/vega/p-9fd503e9.entry.js +0 -1
  689. package/dist/vega/p-a4670e23.js +0 -1
  690. package/dist/vega/p-a475d525.entry.js +0 -1
  691. package/dist/vega/p-a530797f.entry.js +0 -1
  692. package/dist/vega/p-a85ad369.entry.js +0 -1
  693. package/dist/vega/p-ac5e9955.entry.js +0 -1
  694. package/dist/vega/p-aedf7146.js +0 -1
  695. package/dist/vega/p-b1f869fb.js +0 -1
  696. package/dist/vega/p-b4ea3fad.js +0 -1
  697. package/dist/vega/p-bb4a558d.entry.js +0 -1
  698. package/dist/vega/p-bb8339ed.entry.js +0 -1
  699. package/dist/vega/p-be930e85.entry.js +0 -1
  700. package/dist/vega/p-bf2bd6d0.entry.js +0 -1
  701. package/dist/vega/p-c2488ed6.js +0 -1
  702. package/dist/vega/p-c379a5a5.entry.js +0 -1
  703. package/dist/vega/p-c616c592.js +0 -1
  704. package/dist/vega/p-ca3472c1.entry.js +0 -1
  705. package/dist/vega/p-cc43bffb.js +0 -1
  706. package/dist/vega/p-cf5b80f9.entry.js +0 -1
  707. package/dist/vega/p-db60a38e.entry.js +0 -1
  708. package/dist/vega/p-db8cdba6.js +0 -1
  709. package/dist/vega/p-e93545fd.js +0 -1
  710. package/dist/vega/p-e9c4fd24.entry.js +0 -1
  711. package/dist/vega/p-eb60cfe1.entry.js +0 -1
  712. package/dist/vega/p-ec192283.entry.js +0 -1
  713. package/dist/vega/p-ef9cbad1.js +0 -1
  714. package/dist/vega/p-f2a3a1ec.entry.js +0 -1
  715. package/dist/vega/p-f2cdd212.entry.js +0 -1
  716. package/dist/vega/p-f3c3ff26.entry.js +0 -1
  717. package/dist/vega/p-f4c05b4a.entry.js +0 -1
  718. package/dist/vega/p-f52a0155.entry.js +0 -1
  719. package/dist/vega/p-f69f84a7.js +0 -1
  720. package/dist/vega/p-f8641214.entry.js +0 -1
  721. package/dist/vega/p-f89443aa.entry.js +0 -1
  722. package/dist/vega/p-f8f7cf48.entry.js +0 -1
  723. package/dist/vega/p-fe12eff6.js +0 -1
  724. /package/dist/{types/utils/test/sanitize.test.d.ts → collection/polyfill/prism/types.js} +0 -0
  725. /package/dist/vega/{p-d9671d27.js → p-6c170474.js} +0 -0
@@ -3,8 +3,8 @@
3
3
  const staticSubjectTitle = require('./static-subject-title-5829a298.js');
4
4
  const changeManager = require('./change-manager-a297e4d2.js');
5
5
  const observer = require('./observer-f49483e8.js');
6
- const _commonjsHelpers = require('./_commonjsHelpers-537d719a.js');
7
6
  const vegaNonceManager = require('./vega-nonce-manager-df69d3ed.js');
7
+ const index = require('./index-592b4052.js');
8
8
 
9
9
  /* This file is generated by vega-design 2.0.80 */
10
10
  const DarkModeColorTokens$1 = {
@@ -484,1291 +484,326 @@ const DarkModeRingTokens = {
484
484
  'ring-action-danger-focus': '255, 56, 97, 0.25',
485
485
  };
486
486
 
487
- var tinycolor = _commonjsHelpers.createCommonjsModule(function (module, exports) {
488
- // This file is autogenerated. It's used to publish CJS to npm.
489
- (function (global, factory) {
490
- module.exports = factory() ;
491
- })(_commonjsHelpers.commonjsGlobal, (function () {
492
- // https://github.com/bgrins/TinyColor
493
- // Brian Grinstead, MIT License
494
-
495
- const trimLeft = /^\s+/;
496
- const trimRight = /\s+$/;
497
-
498
- function tinycolor(color, opts) {
499
- color = color ? color : "";
500
- opts = opts || {};
501
-
502
- // If input is already a tinycolor, return itself
503
- if (color instanceof tinycolor) {
504
- return color;
505
- }
506
- // If we are called as a function, call using new instead
507
- if (!(this instanceof tinycolor)) {
508
- return new tinycolor(color, opts);
509
- }
510
-
511
- var rgb = inputToRGB(color);
512
- (this._originalInput = color),
513
- (this._r = rgb.r),
514
- (this._g = rgb.g),
515
- (this._b = rgb.b),
516
- (this._a = rgb.a),
517
- (this._roundA = Math.round(100 * this._a) / 100),
518
- (this._format = opts.format || rgb.format);
519
- this._gradientType = opts.gradientType;
520
-
521
- // Don't let the range of [0,255] come back in [0,1].
522
- // Potentially lose a little bit of precision here, but will fix issues where
523
- // .5 gets interpreted as half of the total, instead of half of 1
524
- // If it was supposed to be 128, this was already taken care of by `inputToRgb`
525
- if (this._r < 1) this._r = Math.round(this._r);
526
- if (this._g < 1) this._g = Math.round(this._g);
527
- if (this._b < 1) this._b = Math.round(this._b);
528
-
529
- this._ok = rgb.ok;
487
+ /**
488
+ * TinyColor Polyfill - A lightweight color manipulation utility.
489
+ *
490
+ * This is a drop-in replacement for tinycolor2, implementing only the methods
491
+ * used in the Vega theme overriding system.
492
+ *
493
+ * @see VD-5026 - [Zero Dependencies] remove tinycolor2 dependency
494
+ */
495
+ /**
496
+ * TinyColor polyfill class for color manipulation.
497
+ * Implements the same interface as tinycolor2.Instance for the methods used in Vega.
498
+ */
499
+ class TinyColorPolyfill {
500
+ /**
501
+ * Create a new TinyColorPolyfill instance.
502
+ *
503
+ * @param {string | RgbaValue} color - The color to parse.
504
+ */
505
+ constructor(color) {
506
+ const rgba = TinyColorPolyfill.parseColor(color);
507
+ this._r = rgba.r;
508
+ this._g = rgba.g;
509
+ this._b = rgba.b;
510
+ this._a = rgba.a;
530
511
  }
531
-
532
- tinycolor.prototype = {
533
- isDark: function () {
534
- return this.getBrightness() < 128;
535
- },
536
- isLight: function () {
537
- return !this.isDark();
538
- },
539
- isValid: function () {
540
- return this._ok;
541
- },
542
- getOriginalInput: function () {
543
- return this._originalInput;
544
- },
545
- getFormat: function () {
546
- return this._format;
547
- },
548
- getAlpha: function () {
549
- return this._a;
550
- },
551
- getBrightness: function () {
552
- //http://www.w3.org/TR/AERT#color-contrast
553
- var rgb = this.toRgb();
554
- return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
555
- },
556
- getLuminance: function () {
557
- //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
558
- var rgb = this.toRgb();
559
- var RsRGB, GsRGB, BsRGB, R, G, B;
560
- RsRGB = rgb.r / 255;
561
- GsRGB = rgb.g / 255;
562
- BsRGB = rgb.b / 255;
563
-
564
- if (RsRGB <= 0.03928) R = RsRGB / 12.92;
565
- else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
566
- if (GsRGB <= 0.03928) G = GsRGB / 12.92;
567
- else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
568
- if (BsRGB <= 0.03928) B = BsRGB / 12.92;
569
- else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
570
- return 0.2126 * R + 0.7152 * G + 0.0722 * B;
571
- },
572
- setAlpha: function (value) {
573
- this._a = boundAlpha(value);
574
- this._roundA = Math.round(100 * this._a) / 100;
575
- return this;
576
- },
577
- toHsv: function () {
578
- var hsv = rgbToHsv(this._r, this._g, this._b);
579
- return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
580
- },
581
- toHsvString: function () {
582
- var hsv = rgbToHsv(this._r, this._g, this._b);
583
- var h = Math.round(hsv.h * 360),
584
- s = Math.round(hsv.s * 100),
585
- v = Math.round(hsv.v * 100);
586
- return this._a == 1
587
- ? "hsv(" + h + ", " + s + "%, " + v + "%)"
588
- : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
589
- },
590
- toHsl: function () {
591
- var hsl = rgbToHsl(this._r, this._g, this._b);
592
- return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
593
- },
594
- toHslString: function () {
595
- var hsl = rgbToHsl(this._r, this._g, this._b);
596
- var h = Math.round(hsl.h * 360),
597
- s = Math.round(hsl.s * 100),
598
- l = Math.round(hsl.l * 100);
599
- return this._a == 1
600
- ? "hsl(" + h + ", " + s + "%, " + l + "%)"
601
- : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
602
- },
603
- toHex: function (allow3Char) {
604
- return rgbToHex(this._r, this._g, this._b, allow3Char);
605
- },
606
- toHexString: function (allow3Char) {
607
- return "#" + this.toHex(allow3Char);
608
- },
609
- toHex8: function (allow4Char) {
610
- return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
611
- },
612
- toHex8String: function (allow4Char) {
613
- return "#" + this.toHex8(allow4Char);
614
- },
615
- toRgb: function () {
616
- return {
617
- r: Math.round(this._r),
618
- g: Math.round(this._g),
619
- b: Math.round(this._b),
620
- a: this._a,
621
- };
622
- },
623
- toRgbString: function () {
624
- return this._a == 1
625
- ? "rgb(" +
626
- Math.round(this._r) +
627
- ", " +
628
- Math.round(this._g) +
629
- ", " +
630
- Math.round(this._b) +
631
- ")"
632
- : "rgba(" +
633
- Math.round(this._r) +
634
- ", " +
635
- Math.round(this._g) +
636
- ", " +
637
- Math.round(this._b) +
638
- ", " +
639
- this._roundA +
640
- ")";
641
- },
642
- toPercentageRgb: function () {
512
+ // ==================== Private Static Helper Methods ====================
513
+ /**
514
+ * Clamp a value between a minimum and maximum.
515
+ *
516
+ * @param {number} value - The value to clamp.
517
+ * @param {number} min - The minimum allowed value.
518
+ * @param {number} max - The maximum allowed value.
519
+ * @returns {number} The clamped value.
520
+ */
521
+ static clamp(value, min, max) {
522
+ return Math.min(Math.max(value, min), max);
523
+ }
524
+ /**
525
+ * Parse a color string or RGBA object into an RgbaValue.
526
+ *
527
+ * Supported formats:
528
+ * - Hex: #RGB, #RRGGBB, #RRGGBBAA
529
+ * - RGB: rgb(r, g, b)
530
+ * - RGBA: rgba(r, g, b, a)
531
+ * - Object: { r, g, b, a? }
532
+ *
533
+ * @param {string | RgbaValue} color - The color to parse.
534
+ * @returns {RgbaValue} The parsed RGBA value.
535
+ */
536
+ static parseColor(color) {
537
+ if (typeof color === 'object' && 'r' in color && 'g' in color && 'b' in color) {
643
538
  return {
644
- r: Math.round(bound01(this._r, 255) * 100) + "%",
645
- g: Math.round(bound01(this._g, 255) * 100) + "%",
646
- b: Math.round(bound01(this._b, 255) * 100) + "%",
647
- a: this._a,
539
+ r: Math.round(TinyColorPolyfill.clamp(color.r, 0, 255)),
540
+ g: Math.round(TinyColorPolyfill.clamp(color.g, 0, 255)),
541
+ b: Math.round(TinyColorPolyfill.clamp(color.b, 0, 255)),
542
+ a: color.a !== undefined ? TinyColorPolyfill.clamp(color.a, 0, 1) : 1,
648
543
  };
649
- },
650
- toPercentageRgbString: function () {
651
- return this._a == 1
652
- ? "rgb(" +
653
- Math.round(bound01(this._r, 255) * 100) +
654
- "%, " +
655
- Math.round(bound01(this._g, 255) * 100) +
656
- "%, " +
657
- Math.round(bound01(this._b, 255) * 100) +
658
- "%)"
659
- : "rgba(" +
660
- Math.round(bound01(this._r, 255) * 100) +
661
- "%, " +
662
- Math.round(bound01(this._g, 255) * 100) +
663
- "%, " +
664
- Math.round(bound01(this._b, 255) * 100) +
665
- "%, " +
666
- this._roundA +
667
- ")";
668
- },
669
- toName: function () {
670
- if (this._a === 0) {
671
- return "transparent";
672
- }
673
-
674
- if (this._a < 1) {
675
- return false;
676
- }
677
-
678
- return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
679
- },
680
- toFilter: function (secondColor) {
681
- var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
682
- var secondHex8String = hex8String;
683
- var gradientType = this._gradientType ? "GradientType = 1, " : "";
684
-
685
- if (secondColor) {
686
- var s = tinycolor(secondColor);
687
- secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
688
- }
689
-
690
- return (
691
- "progid:DXImageTransform.Microsoft.gradient(" +
692
- gradientType +
693
- "startColorstr=" +
694
- hex8String +
695
- ",endColorstr=" +
696
- secondHex8String +
697
- ")"
698
- );
699
- },
700
- toString: function (format) {
701
- var formatSet = !!format;
702
- format = format || this._format;
703
-
704
- var formattedString = false;
705
- var hasAlpha = this._a < 1 && this._a >= 0;
706
- var needsAlphaFormat =
707
- !formatSet &&
708
- hasAlpha &&
709
- (format === "hex" ||
710
- format === "hex6" ||
711
- format === "hex3" ||
712
- format === "hex4" ||
713
- format === "hex8" ||
714
- format === "name");
715
-
716
- if (needsAlphaFormat) {
717
- // Special case for "transparent", all other non-alpha formats
718
- // will return rgba when there is transparency.
719
- if (format === "name" && this._a === 0) {
720
- return this.toName();
721
- }
722
- return this.toRgbString();
723
- }
724
- if (format === "rgb") {
725
- formattedString = this.toRgbString();
726
- }
727
- if (format === "prgb") {
728
- formattedString = this.toPercentageRgbString();
729
- }
730
- if (format === "hex" || format === "hex6") {
731
- formattedString = this.toHexString();
732
- }
733
- if (format === "hex3") {
734
- formattedString = this.toHexString(true);
735
- }
736
- if (format === "hex4") {
737
- formattedString = this.toHex8String(true);
738
- }
739
- if (format === "hex8") {
740
- formattedString = this.toHex8String();
741
- }
742
- if (format === "name") {
743
- formattedString = this.toName();
744
- }
745
- if (format === "hsl") {
746
- formattedString = this.toHslString();
747
- }
748
- if (format === "hsv") {
749
- formattedString = this.toHsvString();
750
- }
751
-
752
- return formattedString || this.toHexString();
753
- },
754
- clone: function () {
755
- return tinycolor(this.toString());
756
- },
757
-
758
- _applyModification: function (fn, args) {
759
- var color = fn.apply(null, [this].concat([].slice.call(args)));
760
- this._r = color._r;
761
- this._g = color._g;
762
- this._b = color._b;
763
- this.setAlpha(color._a);
764
- return this;
765
- },
766
- lighten: function () {
767
- return this._applyModification(lighten, arguments);
768
- },
769
- brighten: function () {
770
- return this._applyModification(brighten, arguments);
771
- },
772
- darken: function () {
773
- return this._applyModification(darken, arguments);
774
- },
775
- desaturate: function () {
776
- return this._applyModification(desaturate, arguments);
777
- },
778
- saturate: function () {
779
- return this._applyModification(saturate, arguments);
780
- },
781
- greyscale: function () {
782
- return this._applyModification(greyscale, arguments);
783
- },
784
- spin: function () {
785
- return this._applyModification(spin, arguments);
786
- },
787
-
788
- _applyCombination: function (fn, args) {
789
- return fn.apply(null, [this].concat([].slice.call(args)));
790
- },
791
- analogous: function () {
792
- return this._applyCombination(analogous, arguments);
793
- },
794
- complement: function () {
795
- return this._applyCombination(complement, arguments);
796
- },
797
- monochromatic: function () {
798
- return this._applyCombination(monochromatic, arguments);
799
- },
800
- splitcomplement: function () {
801
- return this._applyCombination(splitcomplement, arguments);
802
- },
803
- // Disabled until https://github.com/bgrins/TinyColor/issues/254
804
- // polyad: function (number) {
805
- // return this._applyCombination(polyad, [number]);
806
- // },
807
- triad: function () {
808
- return this._applyCombination(polyad, [3]);
809
- },
810
- tetrad: function () {
811
- return this._applyCombination(polyad, [4]);
812
- },
813
- };
814
-
815
- // If input is an object, force 1 into "1.0" to handle ratios properly
816
- // String input requires "1.0" as input, so 1 will be treated as 1
817
- tinycolor.fromRatio = function (color, opts) {
818
- if (typeof color == "object") {
819
- var newColor = {};
820
- for (var i in color) {
821
- if (color.hasOwnProperty(i)) {
822
- if (i === "a") {
823
- newColor[i] = color[i];
824
- } else {
825
- newColor[i] = convertToPercentage(color[i]);
826
- }
827
- }
828
- }
829
- color = newColor;
830
544
  }
831
-
832
- return tinycolor(color, opts);
833
- };
834
-
835
- // Given a string or object, convert that input to RGB
836
- // Possible string inputs:
837
- //
838
- // "red"
839
- // "#f00" or "f00"
840
- // "#ff0000" or "ff0000"
841
- // "#ff000000" or "ff000000"
842
- // "rgb 255 0 0" or "rgb (255, 0, 0)"
843
- // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
844
- // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
845
- // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
846
- // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
847
- // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
848
- // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
849
- //
850
- function inputToRGB(color) {
851
- var rgb = { r: 0, g: 0, b: 0 };
852
- var a = 1;
853
- var s = null;
854
- var v = null;
855
- var l = null;
856
- var ok = false;
857
- var format = false;
858
-
859
- if (typeof color == "string") {
860
- color = stringInputToObject(color);
545
+ if (typeof color !== 'string') {
546
+ return { r: 0, g: 0, b: 0, a: 1 };
861
547
  }
862
-
863
- if (typeof color == "object") {
864
- if (
865
- isValidCSSUnit(color.r) &&
866
- isValidCSSUnit(color.g) &&
867
- isValidCSSUnit(color.b)
868
- ) {
869
- rgb = rgbToRgb(color.r, color.g, color.b);
870
- ok = true;
871
- format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
872
- } else if (
873
- isValidCSSUnit(color.h) &&
874
- isValidCSSUnit(color.s) &&
875
- isValidCSSUnit(color.v)
876
- ) {
877
- s = convertToPercentage(color.s);
878
- v = convertToPercentage(color.v);
879
- rgb = hsvToRgb(color.h, s, v);
880
- ok = true;
881
- format = "hsv";
882
- } else if (
883
- isValidCSSUnit(color.h) &&
884
- isValidCSSUnit(color.s) &&
885
- isValidCSSUnit(color.l)
886
- ) {
887
- s = convertToPercentage(color.s);
888
- l = convertToPercentage(color.l);
889
- rgb = hslToRgb(color.h, s, l);
890
- ok = true;
891
- format = "hsl";
892
- }
893
-
894
- if (color.hasOwnProperty("a")) {
895
- a = color.a;
896
- }
548
+ const trimmed = color.trim().toLowerCase();
549
+ // Hex format
550
+ if (trimmed.startsWith('#')) {
551
+ return TinyColorPolyfill.parseHex(trimmed);
552
+ }
553
+ // RGB/RGBA format
554
+ if (trimmed.startsWith('rgb')) {
555
+ return TinyColorPolyfill.parseRgbString(trimmed);
556
+ }
557
+ // Fallback to black for unsupported formats
558
+ return { r: 0, g: 0, b: 0, a: 1 };
559
+ }
560
+ /* eslint-disable spellcheck/spell-checker */
561
+ /**
562
+ * Parse a hex color string into RGBA values.
563
+ *
564
+ * @param {string} hex - The hex color string (e.g., "#fff", "#ffffff", "#ffffffff").
565
+ * @returns {RgbaValue} The parsed RGBA value.
566
+ */
567
+ static parseHex(hex) {
568
+ /* eslint-enable spellcheck/spell-checker */
569
+ // Remove the # prefix
570
+ let hexValue = hex.slice(1);
571
+ // Expand shorthand format (#RGB -> #RRGGBB)
572
+ if (hexValue.length === 3) {
573
+ hexValue = hexValue
574
+ .split('')
575
+ .map((c) => c + c)
576
+ .join('');
577
+ }
578
+ // Handle #RGBA shorthand
579
+ if (hexValue.length === 4) {
580
+ hexValue = hexValue
581
+ .split('')
582
+ .map((c) => c + c)
583
+ .join('');
584
+ }
585
+ const r = parseInt(hexValue.slice(0, 2), 16);
586
+ const g = parseInt(hexValue.slice(2, 4), 16);
587
+ const b = parseInt(hexValue.slice(4, 6), 16);
588
+ let a = 1;
589
+ // Handle #RRGGBBAA format
590
+ if (hexValue.length === 8) {
591
+ a = parseInt(hexValue.slice(6, 8), 16) / 255;
897
592
  }
898
-
899
- a = boundAlpha(a);
900
-
901
593
  return {
902
- ok: ok,
903
- format: color.format || format,
904
- r: Math.min(255, Math.max(rgb.r, 0)),
905
- g: Math.min(255, Math.max(rgb.g, 0)),
906
- b: Math.min(255, Math.max(rgb.b, 0)),
907
- a: a,
594
+ r: Number.isNaN(r) ? 0 : r,
595
+ g: Number.isNaN(g) ? 0 : g,
596
+ b: Number.isNaN(b) ? 0 : b,
597
+ a: Number.isNaN(a) ? 1 : a,
908
598
  };
909
599
  }
910
-
911
- // Conversion Functions
912
- // --------------------
913
-
914
- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
915
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
916
-
917
- // `rgbToRgb`
918
- // Handle bounds / percentage checking to conform to CSS color spec
919
- // <http://www.w3.org/TR/css3-color/>
920
- // *Assumes:* r, g, b in [0, 255] or [0, 1]
921
- // *Returns:* { r, g, b } in [0, 255]
922
- function rgbToRgb(r, g, b) {
600
+ /**
601
+ * Parse an RGB or RGBA string into RGBA values.
602
+ *
603
+ * @param {string} rgbString - The RGB/RGBA string (e.g., "rgb(255, 128, 0)" or "rgba(255, 128, 0, 0.5)").
604
+ * @returns {RgbaValue} The parsed RGBA value.
605
+ */
606
+ static parseRgbString(rgbString) {
607
+ // Match rgb(r, g, b) or rgba(r, g, b, a) with comma-separated integer values.
608
+ // Note: Does NOT support percentage values (e.g., rgb(100%, 50%, 0%)) or
609
+ // modern CSS space-separated syntax (e.g., rgb(255 128 0 / 0.5)).
610
+ const match = rgbString.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+\.?\d*))?\s*\)/);
611
+ if (!match) {
612
+ return { r: 0, g: 0, b: 0, a: 1 };
613
+ }
923
614
  return {
924
- r: bound01(r, 255) * 255,
925
- g: bound01(g, 255) * 255,
926
- b: bound01(b, 255) * 255,
615
+ r: TinyColorPolyfill.clamp(parseInt(match[1], 10), 0, 255),
616
+ g: TinyColorPolyfill.clamp(parseInt(match[2], 10), 0, 255),
617
+ b: TinyColorPolyfill.clamp(parseInt(match[3], 10), 0, 255),
618
+ a: match[4] !== undefined ? TinyColorPolyfill.clamp(parseFloat(match[4]), 0, 1) : 1,
927
619
  };
928
620
  }
929
-
930
- // `rgbToHsl`
931
- // Converts an RGB color value to HSL.
932
- // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
933
- // *Returns:* { h, s, l } in [0,1]
934
- function rgbToHsl(r, g, b) {
935
- r = bound01(r, 255);
936
- g = bound01(g, 255);
937
- b = bound01(b, 255);
938
-
939
- var max = Math.max(r, g, b),
940
- min = Math.min(r, g, b);
941
- var h,
942
- s,
943
- l = (max + min) / 2;
944
-
945
- if (max == min) {
946
- h = s = 0; // achromatic
947
- } else {
948
- var d = max - min;
621
+ /**
622
+ * Convert RGB to HSL.
623
+ *
624
+ * @param {number} r - Red (0-255).
625
+ * @param {number} g - Green (0-255).
626
+ * @param {number} b - Blue (0-255).
627
+ * @returns {HslValue} The HSL values (h: 0-360, s: 0-1, l: 0-1).
628
+ */
629
+ static rgbToHsl(r, g, b) {
630
+ r /= 255;
631
+ g /= 255;
632
+ b /= 255;
633
+ const max = Math.max(r, g, b);
634
+ const min = Math.min(r, g, b);
635
+ const l = (max + min) / 2;
636
+ let h = 0;
637
+ let s = 0;
638
+ if (max !== min) {
639
+ const d = max - min;
949
640
  s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
950
641
  switch (max) {
951
642
  case r:
952
- h = (g - b) / d + (g < b ? 6 : 0);
643
+ h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
953
644
  break;
954
645
  case g:
955
- h = (b - r) / d + 2;
646
+ h = ((b - r) / d + 2) / 6;
956
647
  break;
957
648
  case b:
958
- h = (r - g) / d + 4;
649
+ h = ((r - g) / d + 4) / 6;
959
650
  break;
960
651
  }
961
-
962
- h /= 6;
963
652
  }
964
-
965
- return { h: h, s: s, l: l };
653
+ return { h: h * 360, s, l };
966
654
  }
967
-
968
- // `hslToRgb`
969
- // Converts an HSL color value to RGB.
970
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
971
- // *Returns:* { r, g, b } in the set [0, 255]
972
- function hslToRgb(h, s, l) {
973
- var r, g, b;
974
-
975
- h = bound01(h, 360);
976
- s = bound01(s, 100);
977
- l = bound01(l, 100);
978
-
979
- function hue2rgb(p, q, t) {
980
- if (t < 0) t += 1;
981
- if (t > 1) t -= 1;
982
- if (t < 1 / 6) return p + (q - p) * 6 * t;
983
- if (t < 1 / 2) return q;
984
- if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
985
- return p;
986
- }
987
-
655
+ /**
656
+ * Convert HSL to RGB.
657
+ *
658
+ * @param {number} h - Hue (0-360).
659
+ * @param {number} s - Saturation (0-1).
660
+ * @param {number} l - Lightness (0-1).
661
+ * @returns {RgbValue} The RGB values (0-255).
662
+ */
663
+ static hslToRgb(h, s, l) {
664
+ h /= 360;
665
+ let r;
666
+ let g;
667
+ let b;
988
668
  if (s === 0) {
989
- r = g = b = l; // achromatic
990
- } else {
991
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
992
- var p = 2 * l - q;
669
+ r = g = b = l;
670
+ }
671
+ else {
672
+ /**
673
+ * Helper function to convert hue to RGB component.
674
+ *
675
+ * @param {number} p - First intermediate value.
676
+ * @param {number} q - Second intermediate value.
677
+ * @param {number} t - Hue offset value.
678
+ * @returns {number} RGB component value (0-1).
679
+ */
680
+ const hue2rgb = (p, q, t) => {
681
+ if (t < 0)
682
+ t += 1;
683
+ if (t > 1)
684
+ t -= 1;
685
+ if (t < 1 / 6)
686
+ return p + (q - p) * 6 * t;
687
+ if (t < 1 / 2)
688
+ return q;
689
+ if (t < 2 / 3)
690
+ return p + (q - p) * (2 / 3 - t) * 6;
691
+ return p;
692
+ };
693
+ const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
694
+ const p = 2 * l - q;
993
695
  r = hue2rgb(p, q, h + 1 / 3);
994
696
  g = hue2rgb(p, q, h);
995
697
  b = hue2rgb(p, q, h - 1 / 3);
996
698
  }
997
-
998
- return { r: r * 255, g: g * 255, b: b * 255 };
999
- }
1000
-
1001
- // `rgbToHsv`
1002
- // Converts an RGB color value to HSV
1003
- // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
1004
- // *Returns:* { h, s, v } in [0,1]
1005
- function rgbToHsv(r, g, b) {
1006
- r = bound01(r, 255);
1007
- g = bound01(g, 255);
1008
- b = bound01(b, 255);
1009
-
1010
- var max = Math.max(r, g, b),
1011
- min = Math.min(r, g, b);
1012
- var h,
1013
- s,
1014
- v = max;
1015
-
1016
- var d = max - min;
1017
- s = max === 0 ? 0 : d / max;
1018
-
1019
- if (max == min) {
1020
- h = 0; // achromatic
1021
- } else {
1022
- switch (max) {
1023
- case r:
1024
- h = (g - b) / d + (g < b ? 6 : 0);
1025
- break;
1026
- case g:
1027
- h = (b - r) / d + 2;
1028
- break;
1029
- case b:
1030
- h = (r - g) / d + 4;
1031
- break;
1032
- }
1033
- h /= 6;
1034
- }
1035
- return { h: h, s: s, v: v };
1036
- }
1037
-
1038
- // `hsvToRgb`
1039
- // Converts an HSV color value to RGB.
1040
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
1041
- // *Returns:* { r, g, b } in the set [0, 255]
1042
- function hsvToRgb(h, s, v) {
1043
- h = bound01(h, 360) * 6;
1044
- s = bound01(s, 100);
1045
- v = bound01(v, 100);
1046
-
1047
- var i = Math.floor(h),
1048
- f = h - i,
1049
- p = v * (1 - s),
1050
- q = v * (1 - f * s),
1051
- t = v * (1 - (1 - f) * s),
1052
- mod = i % 6,
1053
- r = [v, q, p, p, t, v][mod],
1054
- g = [t, v, v, q, p, p][mod],
1055
- b = [p, p, t, v, v, q][mod];
1056
-
1057
- return { r: r * 255, g: g * 255, b: b * 255 };
1058
- }
1059
-
1060
- // `rgbToHex`
1061
- // Converts an RGB color to hex
1062
- // Assumes r, g, and b are contained in the set [0, 255]
1063
- // Returns a 3 or 6 character hex
1064
- function rgbToHex(r, g, b, allow3Char) {
1065
- var hex = [
1066
- pad2(Math.round(r).toString(16)),
1067
- pad2(Math.round(g).toString(16)),
1068
- pad2(Math.round(b).toString(16)),
1069
- ];
1070
-
1071
- // Return a 3 character hex if possible
1072
- if (
1073
- allow3Char &&
1074
- hex[0].charAt(0) == hex[0].charAt(1) &&
1075
- hex[1].charAt(0) == hex[1].charAt(1) &&
1076
- hex[2].charAt(0) == hex[2].charAt(1)
1077
- ) {
1078
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
1079
- }
1080
-
1081
- return hex.join("");
1082
- }
1083
-
1084
- // `rgbaToHex`
1085
- // Converts an RGBA color plus alpha transparency to hex
1086
- // Assumes r, g, b are contained in the set [0, 255] and
1087
- // a in [0, 1]. Returns a 4 or 8 character rgba hex
1088
- function rgbaToHex(r, g, b, a, allow4Char) {
1089
- var hex = [
1090
- pad2(Math.round(r).toString(16)),
1091
- pad2(Math.round(g).toString(16)),
1092
- pad2(Math.round(b).toString(16)),
1093
- pad2(convertDecimalToHex(a)),
1094
- ];
1095
-
1096
- // Return a 4 character hex if possible
1097
- if (
1098
- allow4Char &&
1099
- hex[0].charAt(0) == hex[0].charAt(1) &&
1100
- hex[1].charAt(0) == hex[1].charAt(1) &&
1101
- hex[2].charAt(0) == hex[2].charAt(1) &&
1102
- hex[3].charAt(0) == hex[3].charAt(1)
1103
- ) {
1104
- return (
1105
- hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0)
1106
- );
1107
- }
1108
-
1109
- return hex.join("");
1110
- }
1111
-
1112
- // `rgbaToArgbHex`
1113
- // Converts an RGBA color to an ARGB Hex8 string
1114
- // Rarely used, but required for "toFilter()"
1115
- function rgbaToArgbHex(r, g, b, a) {
1116
- var hex = [
1117
- pad2(convertDecimalToHex(a)),
1118
- pad2(Math.round(r).toString(16)),
1119
- pad2(Math.round(g).toString(16)),
1120
- pad2(Math.round(b).toString(16)),
1121
- ];
1122
-
1123
- return hex.join("");
1124
- }
1125
-
1126
- // `equals`
1127
- // Can be called with any tinycolor input
1128
- tinycolor.equals = function (color1, color2) {
1129
- if (!color1 || !color2) return false;
1130
- return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
1131
- };
1132
-
1133
- tinycolor.random = function () {
1134
- return tinycolor.fromRatio({
1135
- r: Math.random(),
1136
- g: Math.random(),
1137
- b: Math.random(),
1138
- });
1139
- };
1140
-
1141
- // Modification Functions
1142
- // ----------------------
1143
- // Thanks to less.js for some of the basics here
1144
- // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
1145
-
1146
- function desaturate(color, amount) {
1147
- amount = amount === 0 ? 0 : amount || 10;
1148
- var hsl = tinycolor(color).toHsl();
1149
- hsl.s -= amount / 100;
1150
- hsl.s = clamp01(hsl.s);
1151
- return tinycolor(hsl);
1152
- }
1153
-
1154
- function saturate(color, amount) {
1155
- amount = amount === 0 ? 0 : amount || 10;
1156
- var hsl = tinycolor(color).toHsl();
1157
- hsl.s += amount / 100;
1158
- hsl.s = clamp01(hsl.s);
1159
- return tinycolor(hsl);
1160
- }
1161
-
1162
- function greyscale(color) {
1163
- return tinycolor(color).desaturate(100);
1164
- }
1165
-
1166
- function lighten(color, amount) {
1167
- amount = amount === 0 ? 0 : amount || 10;
1168
- var hsl = tinycolor(color).toHsl();
1169
- hsl.l += amount / 100;
1170
- hsl.l = clamp01(hsl.l);
1171
- return tinycolor(hsl);
1172
- }
1173
-
1174
- function brighten(color, amount) {
1175
- amount = amount === 0 ? 0 : amount || 10;
1176
- var rgb = tinycolor(color).toRgb();
1177
- rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
1178
- rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
1179
- rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
1180
- return tinycolor(rgb);
1181
- }
1182
-
1183
- function darken(color, amount) {
1184
- amount = amount === 0 ? 0 : amount || 10;
1185
- var hsl = tinycolor(color).toHsl();
1186
- hsl.l -= amount / 100;
1187
- hsl.l = clamp01(hsl.l);
1188
- return tinycolor(hsl);
1189
- }
1190
-
1191
- // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
1192
- // Values outside of this range will be wrapped into this range.
1193
- function spin(color, amount) {
1194
- var hsl = tinycolor(color).toHsl();
1195
- var hue = (hsl.h + amount) % 360;
1196
- hsl.h = hue < 0 ? 360 + hue : hue;
1197
- return tinycolor(hsl);
1198
- }
1199
-
1200
- // Combination Functions
1201
- // ---------------------
1202
- // Thanks to jQuery xColor for some of the ideas behind these
1203
- // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
1204
-
1205
- function complement(color) {
1206
- var hsl = tinycolor(color).toHsl();
1207
- hsl.h = (hsl.h + 180) % 360;
1208
- return tinycolor(hsl);
1209
- }
1210
-
1211
- function polyad(color, number) {
1212
- if (isNaN(number) || number <= 0) {
1213
- throw new Error("Argument to polyad must be a positive number");
1214
- }
1215
- var hsl = tinycolor(color).toHsl();
1216
- var result = [tinycolor(color)];
1217
- var step = 360 / number;
1218
- for (var i = 1; i < number; i++) {
1219
- result.push(tinycolor({ h: (hsl.h + i * step) % 360, s: hsl.s, l: hsl.l }));
1220
- }
1221
-
1222
- return result;
1223
- }
1224
-
1225
- function splitcomplement(color) {
1226
- var hsl = tinycolor(color).toHsl();
1227
- var h = hsl.h;
1228
- return [
1229
- tinycolor(color),
1230
- tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),
1231
- tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }),
1232
- ];
1233
- }
1234
-
1235
- function analogous(color, results, slices) {
1236
- results = results || 6;
1237
- slices = slices || 30;
1238
-
1239
- var hsl = tinycolor(color).toHsl();
1240
- var part = 360 / slices;
1241
- var ret = [tinycolor(color)];
1242
-
1243
- for (hsl.h = (hsl.h - ((part * results) >> 1) + 720) % 360; --results; ) {
1244
- hsl.h = (hsl.h + part) % 360;
1245
- ret.push(tinycolor(hsl));
1246
- }
1247
- return ret;
1248
- }
1249
-
1250
- function monochromatic(color, results) {
1251
- results = results || 6;
1252
- var hsv = tinycolor(color).toHsv();
1253
- var h = hsv.h,
1254
- s = hsv.s,
1255
- v = hsv.v;
1256
- var ret = [];
1257
- var modification = 1 / results;
1258
-
1259
- while (results--) {
1260
- ret.push(tinycolor({ h: h, s: s, v: v }));
1261
- v = (v + modification) % 1;
1262
- }
1263
-
1264
- return ret;
1265
- }
1266
-
1267
- // Utility Functions
1268
- // ---------------------
1269
-
1270
- tinycolor.mix = function (color1, color2, amount) {
1271
- amount = amount === 0 ? 0 : amount || 50;
1272
-
1273
- var rgb1 = tinycolor(color1).toRgb();
1274
- var rgb2 = tinycolor(color2).toRgb();
1275
-
1276
- var p = amount / 100;
1277
-
1278
- var rgba = {
1279
- r: (rgb2.r - rgb1.r) * p + rgb1.r,
1280
- g: (rgb2.g - rgb1.g) * p + rgb1.g,
1281
- b: (rgb2.b - rgb1.b) * p + rgb1.b,
1282
- a: (rgb2.a - rgb1.a) * p + rgb1.a,
699
+ return {
700
+ r: Math.round(r * 255),
701
+ g: Math.round(g * 255),
702
+ b: Math.round(b * 255),
1283
703
  };
1284
-
1285
- return tinycolor(rgba);
1286
- };
1287
-
1288
- // Readability Functions
1289
- // ---------------------
1290
- // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
1291
-
1292
- // `contrast`
1293
- // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
1294
- tinycolor.readability = function (color1, color2) {
1295
- var c1 = tinycolor(color1);
1296
- var c2 = tinycolor(color2);
1297
- return (
1298
- (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) /
1299
- (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05)
1300
- );
1301
- };
1302
-
1303
- // `isReadable`
1304
- // Ensure that foreground and background color combinations meet WCAG2 guidelines.
1305
- // The third argument is an optional Object.
1306
- // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
1307
- // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
1308
- // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
1309
-
1310
- // *Example*
1311
- // tinycolor.isReadable("#000", "#111") => false
1312
- // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
1313
- tinycolor.isReadable = function (color1, color2, wcag2) {
1314
- var readability = tinycolor.readability(color1, color2);
1315
- var wcag2Parms, out;
1316
-
1317
- out = false;
1318
-
1319
- wcag2Parms = validateWCAG2Parms(wcag2);
1320
- switch (wcag2Parms.level + wcag2Parms.size) {
1321
- case "AAsmall":
1322
- case "AAAlarge":
1323
- out = readability >= 4.5;
1324
- break;
1325
- case "AAlarge":
1326
- out = readability >= 3;
1327
- break;
1328
- case "AAAsmall":
1329
- out = readability >= 7;
1330
- break;
1331
- }
1332
- return out;
1333
- };
1334
-
1335
- // `mostReadable`
1336
- // Given a base color and a list of possible foreground or background
1337
- // colors for that base, returns the most readable color.
1338
- // Optionally returns Black or White if the most readable color is unreadable.
1339
- // *Example*
1340
- // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
1341
- // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
1342
- // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
1343
- // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
1344
- tinycolor.mostReadable = function (baseColor, colorList, args) {
1345
- var bestColor = null;
1346
- var bestScore = 0;
1347
- var readability;
1348
- var includeFallbackColors, level, size;
1349
- args = args || {};
1350
- includeFallbackColors = args.includeFallbackColors;
1351
- level = args.level;
1352
- size = args.size;
1353
-
1354
- for (var i = 0; i < colorList.length; i++) {
1355
- readability = tinycolor.readability(baseColor, colorList[i]);
1356
- if (readability > bestScore) {
1357
- bestScore = readability;
1358
- bestColor = tinycolor(colorList[i]);
1359
- }
1360
- }
1361
-
1362
- if (
1363
- tinycolor.isReadable(baseColor, bestColor, {
1364
- level: level,
1365
- size: size,
1366
- }) ||
1367
- !includeFallbackColors
1368
- ) {
1369
- return bestColor;
1370
- } else {
1371
- args.includeFallbackColors = false;
1372
- return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
1373
- }
1374
- };
1375
-
1376
- // Big List of Colors
1377
- // ------------------
1378
- // <https://www.w3.org/TR/css-color-4/#named-colors>
1379
- var names = (tinycolor.names = {
1380
- aliceblue: "f0f8ff",
1381
- antiquewhite: "faebd7",
1382
- aqua: "0ff",
1383
- aquamarine: "7fffd4",
1384
- azure: "f0ffff",
1385
- beige: "f5f5dc",
1386
- bisque: "ffe4c4",
1387
- black: "000",
1388
- blanchedalmond: "ffebcd",
1389
- blue: "00f",
1390
- blueviolet: "8a2be2",
1391
- brown: "a52a2a",
1392
- burlywood: "deb887",
1393
- burntsienna: "ea7e5d",
1394
- cadetblue: "5f9ea0",
1395
- chartreuse: "7fff00",
1396
- chocolate: "d2691e",
1397
- coral: "ff7f50",
1398
- cornflowerblue: "6495ed",
1399
- cornsilk: "fff8dc",
1400
- crimson: "dc143c",
1401
- cyan: "0ff",
1402
- darkblue: "00008b",
1403
- darkcyan: "008b8b",
1404
- darkgoldenrod: "b8860b",
1405
- darkgray: "a9a9a9",
1406
- darkgreen: "006400",
1407
- darkgrey: "a9a9a9",
1408
- darkkhaki: "bdb76b",
1409
- darkmagenta: "8b008b",
1410
- darkolivegreen: "556b2f",
1411
- darkorange: "ff8c00",
1412
- darkorchid: "9932cc",
1413
- darkred: "8b0000",
1414
- darksalmon: "e9967a",
1415
- darkseagreen: "8fbc8f",
1416
- darkslateblue: "483d8b",
1417
- darkslategray: "2f4f4f",
1418
- darkslategrey: "2f4f4f",
1419
- darkturquoise: "00ced1",
1420
- darkviolet: "9400d3",
1421
- deeppink: "ff1493",
1422
- deepskyblue: "00bfff",
1423
- dimgray: "696969",
1424
- dimgrey: "696969",
1425
- dodgerblue: "1e90ff",
1426
- firebrick: "b22222",
1427
- floralwhite: "fffaf0",
1428
- forestgreen: "228b22",
1429
- fuchsia: "f0f",
1430
- gainsboro: "dcdcdc",
1431
- ghostwhite: "f8f8ff",
1432
- gold: "ffd700",
1433
- goldenrod: "daa520",
1434
- gray: "808080",
1435
- green: "008000",
1436
- greenyellow: "adff2f",
1437
- grey: "808080",
1438
- honeydew: "f0fff0",
1439
- hotpink: "ff69b4",
1440
- indianred: "cd5c5c",
1441
- indigo: "4b0082",
1442
- ivory: "fffff0",
1443
- khaki: "f0e68c",
1444
- lavender: "e6e6fa",
1445
- lavenderblush: "fff0f5",
1446
- lawngreen: "7cfc00",
1447
- lemonchiffon: "fffacd",
1448
- lightblue: "add8e6",
1449
- lightcoral: "f08080",
1450
- lightcyan: "e0ffff",
1451
- lightgoldenrodyellow: "fafad2",
1452
- lightgray: "d3d3d3",
1453
- lightgreen: "90ee90",
1454
- lightgrey: "d3d3d3",
1455
- lightpink: "ffb6c1",
1456
- lightsalmon: "ffa07a",
1457
- lightseagreen: "20b2aa",
1458
- lightskyblue: "87cefa",
1459
- lightslategray: "789",
1460
- lightslategrey: "789",
1461
- lightsteelblue: "b0c4de",
1462
- lightyellow: "ffffe0",
1463
- lime: "0f0",
1464
- limegreen: "32cd32",
1465
- linen: "faf0e6",
1466
- magenta: "f0f",
1467
- maroon: "800000",
1468
- mediumaquamarine: "66cdaa",
1469
- mediumblue: "0000cd",
1470
- mediumorchid: "ba55d3",
1471
- mediumpurple: "9370db",
1472
- mediumseagreen: "3cb371",
1473
- mediumslateblue: "7b68ee",
1474
- mediumspringgreen: "00fa9a",
1475
- mediumturquoise: "48d1cc",
1476
- mediumvioletred: "c71585",
1477
- midnightblue: "191970",
1478
- mintcream: "f5fffa",
1479
- mistyrose: "ffe4e1",
1480
- moccasin: "ffe4b5",
1481
- navajowhite: "ffdead",
1482
- navy: "000080",
1483
- oldlace: "fdf5e6",
1484
- olive: "808000",
1485
- olivedrab: "6b8e23",
1486
- orange: "ffa500",
1487
- orangered: "ff4500",
1488
- orchid: "da70d6",
1489
- palegoldenrod: "eee8aa",
1490
- palegreen: "98fb98",
1491
- paleturquoise: "afeeee",
1492
- palevioletred: "db7093",
1493
- papayawhip: "ffefd5",
1494
- peachpuff: "ffdab9",
1495
- peru: "cd853f",
1496
- pink: "ffc0cb",
1497
- plum: "dda0dd",
1498
- powderblue: "b0e0e6",
1499
- purple: "800080",
1500
- rebeccapurple: "663399",
1501
- red: "f00",
1502
- rosybrown: "bc8f8f",
1503
- royalblue: "4169e1",
1504
- saddlebrown: "8b4513",
1505
- salmon: "fa8072",
1506
- sandybrown: "f4a460",
1507
- seagreen: "2e8b57",
1508
- seashell: "fff5ee",
1509
- sienna: "a0522d",
1510
- silver: "c0c0c0",
1511
- skyblue: "87ceeb",
1512
- slateblue: "6a5acd",
1513
- slategray: "708090",
1514
- slategrey: "708090",
1515
- snow: "fffafa",
1516
- springgreen: "00ff7f",
1517
- steelblue: "4682b4",
1518
- tan: "d2b48c",
1519
- teal: "008080",
1520
- thistle: "d8bfd8",
1521
- tomato: "ff6347",
1522
- turquoise: "40e0d0",
1523
- violet: "ee82ee",
1524
- wheat: "f5deb3",
1525
- white: "fff",
1526
- whitesmoke: "f5f5f5",
1527
- yellow: "ff0",
1528
- yellowgreen: "9acd32",
1529
- });
1530
-
1531
- // Make it easy to access colors via `hexNames[hex]`
1532
- var hexNames = (tinycolor.hexNames = flip(names));
1533
-
1534
- // Utilities
1535
- // ---------
1536
-
1537
- // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
1538
- function flip(o) {
1539
- var flipped = {};
1540
- for (var i in o) {
1541
- if (o.hasOwnProperty(i)) {
1542
- flipped[o[i]] = i;
1543
- }
1544
- }
1545
- return flipped;
1546
704
  }
1547
-
1548
- // Return a valid alpha value [0,1] with all invalid values being set to 1
1549
- function boundAlpha(a) {
1550
- a = parseFloat(a);
1551
-
1552
- if (isNaN(a) || a < 0 || a > 1) {
1553
- a = 1;
1554
- }
1555
-
1556
- return a;
1557
- }
1558
-
1559
- // Take input from [0, n] and return it as [0, 1]
1560
- function bound01(n, max) {
1561
- if (isOnePointZero(n)) n = "100%";
1562
-
1563
- var processPercent = isPercentage(n);
1564
- n = Math.min(max, Math.max(0, parseFloat(n)));
1565
-
1566
- // Automatically convert percentage into number
1567
- if (processPercent) {
1568
- n = parseInt(n * max, 10) / 100;
1569
- }
1570
-
1571
- // Handle floating point rounding errors
1572
- if (Math.abs(n - max) < 0.000001) {
1573
- return 1;
1574
- }
1575
-
1576
- // Convert into [0, 1] range if it isn't already
1577
- return (n % max) / parseFloat(max);
1578
- }
1579
-
1580
- // Force a number between 0 and 1
1581
- function clamp01(val) {
1582
- return Math.min(1, Math.max(0, val));
1583
- }
1584
-
1585
- // Parse a base-16 hex value into a base-10 integer
1586
- function parseIntFromHex(val) {
1587
- return parseInt(val, 16);
705
+ /**
706
+ * Calculate the perceived brightness of a color using the YIQ formula.
707
+ * This matches tinycolor2's brightness calculation.
708
+ *
709
+ * @param {number} r - Red (0-255).
710
+ * @param {number} g - Green (0-255).
711
+ * @param {number} b - Blue (0-255).
712
+ * @returns {number} Brightness value (0-255).
713
+ */
714
+ static getBrightness(r, g, b) {
715
+ return (r * 299 + g * 587 + b * 114) / 1000;
1588
716
  }
1589
-
1590
- // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
1591
- // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
1592
- function isOnePointZero(n) {
1593
- return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
717
+ // ==================== Public Instance Methods ====================
718
+ /**
719
+ * Check if the color is dark (brightness < 128).
720
+ *
721
+ * @returns {boolean} True if the color is considered dark.
722
+ */
723
+ isDark() {
724
+ return TinyColorPolyfill.getBrightness(this._r, this._g, this._b) < 128;
1594
725
  }
1595
-
1596
- // Check to see if string passed in is a percentage
1597
- function isPercentage(n) {
1598
- return typeof n === "string" && n.indexOf("%") != -1;
726
+ /**
727
+ * Check if the color is light (brightness >= 128).
728
+ *
729
+ * @returns {boolean} True if the color is considered light.
730
+ */
731
+ isLight() {
732
+ return !this.isDark();
1599
733
  }
1600
-
1601
- // Force a hex value to have 2 characters
1602
- function pad2(c) {
1603
- return c.length == 1 ? "0" + c : "" + c;
734
+ /**
735
+ * Create a copy of this color.
736
+ *
737
+ * @returns {TinyColorPolyfill} A new TinyColorPolyfill instance with the same values.
738
+ */
739
+ clone() {
740
+ const cloned = new TinyColorPolyfill({
741
+ r: this._r,
742
+ g: this._g,
743
+ b: this._b,
744
+ a: this._a,
745
+ });
746
+ return cloned;
1604
747
  }
1605
-
1606
- // Replace a decimal with it's percentage value
1607
- function convertToPercentage(n) {
1608
- if (n <= 1) {
1609
- n = n * 100 + "%";
1610
- }
1611
-
1612
- return n;
748
+ /**
749
+ * Lighten the color by a given amount.
750
+ * Note: tinycolor2 accepts negative values to darken.
751
+ *
752
+ * @param {number} amount - The amount to lighten (0-100). Negative values darken.
753
+ * @returns {TinyColorPolyfill} This instance for chaining.
754
+ */
755
+ lighten(amount = 10) {
756
+ const hsl = TinyColorPolyfill.rgbToHsl(this._r, this._g, this._b);
757
+ hsl.l = TinyColorPolyfill.clamp(hsl.l + amount / 100, 0, 1);
758
+ const rgb = TinyColorPolyfill.hslToRgb(hsl.h, hsl.s, hsl.l);
759
+ this._r = rgb.r;
760
+ this._g = rgb.g;
761
+ this._b = rgb.b;
762
+ return this;
1613
763
  }
1614
-
1615
- // Converts a decimal to a hex value
1616
- function convertDecimalToHex(d) {
1617
- return Math.round(parseFloat(d) * 255).toString(16);
764
+ /**
765
+ * Darken the color by a given amount.
766
+ *
767
+ * @param {number} amount - The amount to darken (0-100).
768
+ * @returns {TinyColorPolyfill} This instance for chaining.
769
+ */
770
+ darken(amount = 10) {
771
+ return this.lighten(-amount);
1618
772
  }
1619
- // Converts a hex value to a decimal
1620
- function convertHexToDecimal(h) {
1621
- return parseIntFromHex(h) / 255;
773
+ /**
774
+ * Set the alpha (opacity) of the color.
775
+ *
776
+ * @param {number} alpha - The alpha value (0-1).
777
+ * @returns {TinyColorPolyfill} This instance for chaining.
778
+ */
779
+ setAlpha(alpha) {
780
+ this._a = TinyColorPolyfill.clamp(alpha, 0, 1);
781
+ return this;
1622
782
  }
1623
-
1624
- var matchers = (function () {
1625
- // <http://www.w3.org/TR/css3-values/#integers>
1626
- var CSS_INTEGER = "[-\\+]?\\d+%?";
1627
-
1628
- // <http://www.w3.org/TR/css3-values/#number-value>
1629
- var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
1630
-
1631
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
1632
- var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
1633
-
1634
- // Actual matching.
1635
- // Parentheses and commas are optional, but not required.
1636
- // Whitespace can take the place of commas or opening paren
1637
- var PERMISSIVE_MATCH3 =
1638
- "[\\s|\\(]+(" +
1639
- CSS_UNIT +
1640
- ")[,|\\s]+(" +
1641
- CSS_UNIT +
1642
- ")[,|\\s]+(" +
1643
- CSS_UNIT +
1644
- ")\\s*\\)?";
1645
- var PERMISSIVE_MATCH4 =
1646
- "[\\s|\\(]+(" +
1647
- CSS_UNIT +
1648
- ")[,|\\s]+(" +
1649
- CSS_UNIT +
1650
- ")[,|\\s]+(" +
1651
- CSS_UNIT +
1652
- ")[,|\\s]+(" +
1653
- CSS_UNIT +
1654
- ")\\s*\\)?";
1655
-
783
+ /**
784
+ * Get the RGBA representation of the color.
785
+ *
786
+ * @returns {RgbaValue} The RGBA values.
787
+ */
788
+ toRgb() {
1656
789
  return {
1657
- CSS_UNIT: new RegExp(CSS_UNIT),
1658
- rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
1659
- rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
1660
- hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
1661
- hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
1662
- hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
1663
- hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
1664
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1665
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
1666
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
1667
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
790
+ r: this._r,
791
+ g: this._g,
792
+ b: this._b,
793
+ a: this._a,
1668
794
  };
1669
- })();
1670
-
1671
- // `isValidCSSUnit`
1672
- // Take in a single string / number and check to see if it looks like a CSS unit
1673
- // (see `matchers` above for definition).
1674
- function isValidCSSUnit(color) {
1675
- return !!matchers.CSS_UNIT.exec(color);
1676
795
  }
1677
-
1678
- // `stringInputToObject`
1679
- // Permissive string parsing. Take in a number of formats, and output an object
1680
- // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
1681
- function stringInputToObject(color) {
1682
- color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
1683
- var named = false;
1684
- if (names[color]) {
1685
- color = names[color];
1686
- named = true;
1687
- } else if (color == "transparent") {
1688
- return { r: 0, g: 0, b: 0, a: 0, format: "name" };
1689
- }
1690
-
1691
- // Try to match string input using regular expressions.
1692
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
1693
- // Just return an object and let the conversion functions handle that.
1694
- // This way the result will be the same whether the tinycolor is initialized with string or object.
1695
- var match;
1696
- if ((match = matchers.rgb.exec(color))) {
1697
- return { r: match[1], g: match[2], b: match[3] };
1698
- }
1699
- if ((match = matchers.rgba.exec(color))) {
1700
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
1701
- }
1702
- if ((match = matchers.hsl.exec(color))) {
1703
- return { h: match[1], s: match[2], l: match[3] };
1704
- }
1705
- if ((match = matchers.hsla.exec(color))) {
1706
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
1707
- }
1708
- if ((match = matchers.hsv.exec(color))) {
1709
- return { h: match[1], s: match[2], v: match[3] };
1710
- }
1711
- if ((match = matchers.hsva.exec(color))) {
1712
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
1713
- }
1714
- if ((match = matchers.hex8.exec(color))) {
1715
- return {
1716
- r: parseIntFromHex(match[1]),
1717
- g: parseIntFromHex(match[2]),
1718
- b: parseIntFromHex(match[3]),
1719
- a: convertHexToDecimal(match[4]),
1720
- format: named ? "name" : "hex8",
1721
- };
1722
- }
1723
- if ((match = matchers.hex6.exec(color))) {
1724
- return {
1725
- r: parseIntFromHex(match[1]),
1726
- g: parseIntFromHex(match[2]),
1727
- b: parseIntFromHex(match[3]),
1728
- format: named ? "name" : "hex",
1729
- };
1730
- }
1731
- if ((match = matchers.hex4.exec(color))) {
1732
- return {
1733
- r: parseIntFromHex(match[1] + "" + match[1]),
1734
- g: parseIntFromHex(match[2] + "" + match[2]),
1735
- b: parseIntFromHex(match[3] + "" + match[3]),
1736
- a: convertHexToDecimal(match[4] + "" + match[4]),
1737
- format: named ? "name" : "hex8",
1738
- };
1739
- }
1740
- if ((match = matchers.hex3.exec(color))) {
1741
- return {
1742
- r: parseIntFromHex(match[1] + "" + match[1]),
1743
- g: parseIntFromHex(match[2] + "" + match[2]),
1744
- b: parseIntFromHex(match[3] + "" + match[3]),
1745
- format: named ? "name" : "hex",
1746
- };
1747
- }
1748
-
1749
- return false;
1750
- }
1751
-
1752
- function validateWCAG2Parms(parms) {
1753
- // return valid WCAG2 parms for isReadable.
1754
- // If input parms are invalid, return {"level":"AA", "size":"small"}
1755
- var level, size;
1756
- parms = parms || { level: "AA", size: "small" };
1757
- level = (parms.level || "AA").toUpperCase();
1758
- size = (parms.size || "small").toLowerCase();
1759
- if (level !== "AA" && level !== "AAA") {
1760
- level = "AA";
1761
- }
1762
- if (size !== "small" && size !== "large") {
1763
- size = "small";
1764
- }
1765
- return { level: level, size: size };
1766
- }
1767
-
1768
- return tinycolor;
1769
-
1770
- }));
1771
- });
796
+ }
797
+ /**
798
+ * Factory function to create a TinyColorPolyfill instance.
799
+ * This provides API compatibility with tinycolor2's default export.
800
+ *
801
+ * @param {string | RgbaValue} color - The color to parse.
802
+ * @returns {TinyColorPolyfill} A new TinyColorPolyfill instance.
803
+ */
804
+ function tinycolor(color) {
805
+ return new TinyColorPolyfill(color);
806
+ }
1772
807
 
1773
808
  const formatValue$2 = (tinyColor) => {
1774
809
  if (!tinyColor) {
@@ -2986,16 +2021,17 @@ class ColorSchemaOverridingController {
2986
2021
  * @param {OverrideColor[]} overrideThemes Parsed custom override colors
2987
2022
  */
2988
2023
  applyTheme(overrideThemes) {
2989
- this.getOverrideThemeContainer().innerHTML = `
2990
- :root {
2991
- \t\t${overrideThemes
2024
+ const styleString = `
2025
+ :root {
2026
+ \t\t${overrideThemes
2992
2027
  .filter((item) => {
2993
2028
  return !!item.value;
2994
2029
  })
2995
2030
  .map((item) => `--v-${item.name}: ${item.value};`)
2996
2031
  .join('\n\t\t')}
2997
- }
2998
- `;
2032
+ }
2033
+ `;
2034
+ this.getOverrideThemeContainer().innerHTML = index.htmlSanitizer.sanitize(styleString, index.styleSanitizeStrategy);
2999
2035
  }
3000
2036
  /* eslint-disable no-restricted-globals */
3001
2037
  /**
@@ -3335,9 +2371,10 @@ class BrandStyleController extends StyleControllerAbstract {
3335
2371
  generateThemeStyle() {
3336
2372
  this.tokens = Object.assign(LightModeColorTokens, LightModeBorderTokens, LightModeShadowTokens);
3337
2373
  const keys = Object.keys(this.tokens);
3338
- this.getStyleContainer(this.themeStyleContainerKey).innerHTML = `
2374
+ const styleString = `
3339
2375
  :root {
3340
2376
  \t\t${keys.map((key) => `--v-${key}: ${this.tokens[key]};`).join('\n\t\t')}}`;
2377
+ this.getStyleContainer(this.themeStyleContainerKey).innerHTML = index.htmlSanitizer.sanitize(styleString, index.styleSanitizeStrategy);
3341
2378
  }
3342
2379
  /**
3343
2380
  * Determines whether the observer should accept changes.
@@ -3370,7 +2407,7 @@ class InternalThemeManager {
3370
2407
  * It removes all the custom override theme styles from the DOM
3371
2408
  */
3372
2409
  reset() {
3373
- VegaColorSchemaOverridingController.getOverrideThemeContainer().innerHTML = '';
2410
+ VegaColorSchemaOverridingController.getOverrideThemeContainer().innerHTML = index.htmlSanitizer.sanitize('', index.emptySanitizeStrategy);
3374
2411
  }
3375
2412
  /* eslint-disable no-restricted-globals */
3376
2413
  /**
@@ -3466,9 +2503,10 @@ class DarkModeStyleController extends StyleControllerAbstract {
3466
2503
  const oldTokens = Object.assign(DarkModeColorTokens, DarkModeBorderTokens, DarkModeRingTokens, DarkModeShadowTokens);
3467
2504
  this.darkModeColorAllTokens = Object.assign(VegaInternalThemeManager.getBranding() === 'heartland' ? oldTokens : newBrandTokens, CustomDarkModeColorTokens, this.dynamicCustomDarkModeColor);
3468
2505
  const keys = Object.keys(this.darkModeColorAllTokens);
3469
- this.getStyleContainer(this.themeStyleContainerKey).innerHTML = `
2506
+ const styleString = `
3470
2507
  html.dark {
3471
2508
  \t\t${keys.map((key) => `--v-${key}: ${this.darkModeColorAllTokens[key]};`).join('\n\t\t')}}`;
2509
+ this.getStyleContainer(this.themeStyleContainerKey).innerHTML = index.htmlSanitizer.sanitize(styleString, index.styleSanitizeStrategy);
3472
2510
  }
3473
2511
  /**
3474
2512
  * Determines whether the observer should accept changes.