@globalpayments/vega 2.87.0 → 2.88.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.
- package/dist/cjs/action-color-accessibility-validator-15fa91e4.js +1817 -0
- package/dist/cjs/{app-globals-885090b1.js → app-globals-6fbbcb2f.js} +16 -7
- package/dist/cjs/{child-nodes-event-prevent-slimmer-b7498e5a.js → child-nodes-event-prevent-slimmer-01930b4e.js} +1 -1
- package/dist/cjs/{code-block-15411c14.js → code-block-00fee034.js} +31 -13
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-5218e4b3.js → component-value-history-controller-slimmer.abstract-066645b3.js} +25 -5
- package/dist/cjs/{content-state-a69d99b4.js → content-state-d4f54659.js} +66 -54
- package/dist/cjs/{dark-mode-style-controller-bd765afb.js → dark-mode-style-controller-ed481250.js} +41 -2
- package/dist/cjs/{date-required-rule-d65727c5.js → date-required-rule-4cea8fc8.js} +1 -1
- package/dist/cjs/{design-token-3bc36220.js → design-token-ad9f413c.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-f86e6811.js → element-appender-slimmer-d04aa177.js} +2 -2
- package/dist/cjs/{event-emit-slimmer-73c42d7e.js → event-emit-slimmer-5fd6e54a.js} +1 -1
- package/dist/cjs/{form-field-controller-slimmer-44091874.js → form-field-controller-slimmer-23d112bd.js} +1 -1
- package/dist/cjs/{image-annotation-action-aad07357.js → image-annotation-action-bcf2a1b4.js} +4 -4
- package/dist/cjs/index-58ea899e.js +4 -0
- package/dist/cjs/index.cjs.js +27 -17
- package/dist/cjs/{inject-keyboard-manager-d06b337e.js → inject-keyboard-manager-acaf1530.js} +1 -1
- package/dist/cjs/{internal-translation-controller-f0da24b2.js → internal-translation-controller-a1250419.js} +8 -0
- package/dist/cjs/{internal-vega-event-manager-063c17cb.js → internal-vega-event-manager-c515cf5e.js} +2 -2
- package/dist/cjs/{keyboard-manager-1e045791.js → keyboard-manager-6821709a.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-861d991f.js → keyboard-manager-slimmer-74528545.js} +1 -1
- package/dist/cjs/loader.cjs.js +13 -12
- package/dist/cjs/{month-view-generator-8ed9818e.js → month-view-generator-61578283.js} +1 -1
- package/dist/cjs/{public-rules-c7726702.js → public-rules-d2fbbbf5.js} +8 -8
- package/dist/cjs/{range-d6fb50a4.js → range-e797475c.js} +1 -1
- package/dist/cjs/replace-selected-text-action-a098523f.js +20 -0
- package/dist/cjs/{responsive-format-facade-9647775d.js → responsive-format-facade-bf330592.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-a1a070ce.js → rich-text-editor-required-rule-ba9d42fa.js} +1 -1
- package/dist/cjs/{split-cell-operation-39b19943.js → split-cell-operation-91ee6894.js} +79 -16
- package/dist/cjs/{state-border-formatter-1a483a9b.js → state-border-formatter-fd194e53.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-2aec209d.js → string-format-strategy.abstract-af9fc35e.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-e061bd10.js → string-input-formatter-slimmer-a3fb1292.js} +1 -1
- package/dist/cjs/{string-mask-strategy-4bc07c00.js → string-mask-strategy-2054f3fb.js} +2 -2
- package/dist/cjs/{style-formatter-263d5eb6.js → style-formatter-7d60fb70.js} +2 -2
- package/dist/cjs/{time-required-rule-f9a7e897.js → time-required-rule-ba450bbd.js} +1 -1
- package/dist/cjs/{token-extension-927062b9.js → token-extension-8b69f7e1.js} +1136 -26
- package/dist/cjs/{translation-slimmer-a4a7f0eb.js → translation-slimmer-aee3fb1c.js} +1 -1
- package/dist/cjs/{type-guard-c1195e50.js → type-guard-424efe26.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-22f3e6cf.js → valid-credit-card-number-rule-6bd5834c.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +22 -15
- package/dist/cjs/vega-app-footer.cjs.entry.js +1 -1
- package/dist/cjs/vega-app-header-button.cjs.entry.js +9 -9
- package/dist/cjs/vega-banner.cjs.entry.js +3 -3
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-brand-logo.cjs.entry.js +1 -1
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-circle.cjs.entry.js +9 -9
- package/dist/cjs/vega-button-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-button-link.cjs.entry.js +4 -4
- package/dist/cjs/vega-button.cjs.entry.js +7 -7
- package/dist/cjs/vega-calendar_4.cjs.entry.js +10 -10
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +6 -6
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-chip.cjs.entry.js +9 -9
- package/dist/cjs/vega-code-block.cjs.entry.js +16 -15
- package/dist/cjs/vega-color-picker.cjs.entry.js +5 -5
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +7 -7
- package/dist/cjs/vega-color-swatch.cjs.entry.js +5 -5
- package/dist/cjs/vega-combo-box.cjs.entry.js +23 -10
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +327 -267
- package/dist/cjs/vega-dialog_2.cjs.entry.js +7 -7
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +11 -11
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/{vega-event-id-f95480b7.js → vega-event-id-39dedd17.js} +2 -0
- package/dist/cjs/vega-field-label.cjs.entry.js +22 -5
- package/dist/cjs/vega-file-uploader.cjs.entry.js +20 -7
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-flex.cjs.entry.js +6 -6
- package/dist/cjs/vega-font.cjs.entry.js +5 -5
- package/dist/cjs/vega-form.cjs.entry.js +7 -7
- package/dist/cjs/vega-grid.cjs.entry.js +5 -5
- package/dist/cjs/vega-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +10 -10
- package/dist/cjs/vega-input-numeric.cjs.entry.js +9 -9
- package/dist/cjs/vega-input-passcode.cjs.entry.js +23 -10
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +22 -9
- package/dist/cjs/vega-input-range.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-select.cjs.entry.js +9 -9
- package/dist/cjs/vega-input.cjs.entry.js +23 -10
- package/dist/cjs/vega-item-toggle.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +11 -11
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination.cjs.entry.js +8 -8
- package/dist/cjs/vega-popover_2.cjs.entry.js +11 -11
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-radio_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +7 -7
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +289 -193
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +400 -0
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +12 -12
- package/dist/cjs/vega-section-title.cjs.entry.js +3 -2
- package/dist/cjs/vega-segment-control.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +6 -6
- package/dist/cjs/vega-signature-capture.cjs.entry.js +10 -10
- package/dist/cjs/vega-stepper.cjs.entry.js +6 -6
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-table_11.cjs.entry.js +8 -8
- package/dist/cjs/vega-textarea.cjs.entry.js +17 -7
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +13 -13
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +5 -5
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega.cjs.js +13 -12
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/vega-accordion/slimmers/vega-accordion-renderer.js +12 -5
- package/dist/collection/components/vega-accordion/vega-accordion.css +23 -0
- package/dist/collection/components/vega-accordion/vega-accordion.js +28 -0
- package/dist/collection/components/vega-box/vega-box.js +3 -3
- package/dist/collection/components/vega-code-block/slimmers/renderers/vega-code-block-copy-button-renderer.js +2 -2
- package/dist/collection/components/vega-code-block/vega-code-block.js +4 -0
- package/dist/collection/components/vega-combo-box/slimmers/renderers/vega-combo-box-renderer.js +4 -1
- package/dist/collection/components/vega-combo-box/vega-combo-box.js +34 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-size-controller.js +46 -0
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.js +8 -4
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.js +3 -3
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +0 -3
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +67 -6
- package/dist/collection/components/vega-field-label/vega-field-label.css +37 -0
- package/dist/collection/components/vega-field-label/vega-field-label.js +40 -0
- package/dist/collection/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-renderer.js +4 -1
- package/dist/collection/components/vega-file-uploader/vega-file-uploader.js +34 -0
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-renderer.js +4 -1
- package/dist/collection/components/vega-input/vega-input.js +34 -0
- package/dist/collection/components/vega-input-passcode/slimmers/renderers/vega-input-passcode-renderer.js +4 -1
- package/dist/collection/components/vega-input-passcode/vega-input-passcode.js +34 -0
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/vega-input-phone-number-renderer.js +4 -1
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/assets/redo.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/assets/undo.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy.abstract.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-node-content-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/annotations/annotation-style.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/block.abstract.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/code-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/html-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/image-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/list-item-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/blocks/text-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/code-block/code-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/filter-styles-strategy-registry.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-heading-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/list-block/list-title-item-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/predicate.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-block/paragraph-filter-styles-strategy.js +1 -2
- package/dist/collection/components/vega-rich-text-editor/dto/filter-styles-strategies/text-node/title-heading-node-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/code-block-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/image-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/node.abstract.js +5 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/dto/setup.js +29 -29
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +105 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +50 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/function-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/function-extension.js +4 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/action-handler-strategies/block-update-line-height-strategy.js +18 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/actions/line-height-annotation-action.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/annotations/line-height-annotation.js +61 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/assets/line-height.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/constants.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-annotation-handler.js +41 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-filter-styles-strategy.js +41 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-from-json-handler.js +65 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-extension.js +44 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.js +131 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/arrow-characters.js +24 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/currency-characters.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/default-categories.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/latin-characters.js +130 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/mathematical-characters.js +46 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/constants/text-characters.js +29 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-extension.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-icon.js +3 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/special-characters-toolbar-button-renderer.js +184 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/types.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/constants.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/controllers/special-characters-panel-keyboard-controller.js +85 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/renderers/special-characters-panel-renderer.js +210 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.css +66 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.js +174 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-cell-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/annotation-handler/table-head-cell-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-body-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/dto/table-row-block.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-block/table-block-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-caption/table-caption-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/filter-styles-strategies/table-cell/table-cell-filter-styles-strategy.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/table/table-extension.js +4 -4
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-extension.js +5 -2
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/type.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/helpers/extension-context-manager.js +8 -2
- package/dist/collection/components/vega-rich-text-editor/public-api.js +4 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/bold-annotaion-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/code-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/color-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.js +3 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-alt-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/image-size-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/indent-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/inline-html-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/italic-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/link-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/strike-through-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-align-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/text-style-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/underline-annotation-handler.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/history-controller.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/state-entity-rendering-registry.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/redo-toolbar-button-slimmer.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/undo-toolbar-button-slimmer.js +36 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +4 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +44 -0
- package/dist/collection/components/vega-section-title/slimmers/renderers/vega-section-title-renderer.js +1 -1
- package/dist/collection/components/vega-section-title/vega-section-title.js +2 -1
- package/dist/collection/components/vega-textarea/vega-textarea.js +35 -1
- package/dist/collection/constants/runtime-metrics-payload-definition/public-api/ThemeManager/runtime-metrics-payload-definition.js +30 -10
- package/dist/collection/constants/ui.js +1 -0
- package/dist/collection/global/scripts/before-vega-load.js +13 -0
- package/dist/collection/helpers/event-manager/event-id/component-event-id-map.js +2 -2
- package/dist/collection/helpers/event-manager/event-id/vega-event-id.js +1 -0
- package/dist/collection/helpers/slimmers/component-value-history-controller-slimmer.abstract.js +22 -2
- package/dist/collection/helpers/theme/controllers/action-color-accessibility-validator.js +34 -0
- package/dist/collection/helpers/theme/internal-theme-manager.js +39 -2
- package/dist/collection/helpers/theme/theme-manager.js +33 -2
- package/dist/collection/helpers/translation/locales/en.js +8 -0
- package/dist/esm/action-color-accessibility-validator-3d8efb64.js +1815 -0
- package/dist/esm/{app-globals-be458779.js → app-globals-98c3d676.js} +16 -7
- package/dist/esm/{child-nodes-event-prevent-slimmer-0a406a71.js → child-nodes-event-prevent-slimmer-2f823df2.js} +1 -1
- package/dist/esm/{code-block-ff52d912.js → code-block-6261a99d.js} +32 -14
- package/dist/esm/{component-value-history-controller-slimmer.abstract-ad5f29cd.js → component-value-history-controller-slimmer.abstract-07488472.js} +25 -5
- package/dist/esm/{content-state-6fccd284.js → content-state-9bf85e00.js} +66 -54
- package/dist/esm/{dark-mode-style-controller-e9a6b097.js → dark-mode-style-controller-fcda24ec.js} +40 -3
- package/dist/esm/{date-required-rule-70324452.js → date-required-rule-281aab50.js} +1 -1
- package/dist/esm/{design-token-0e6fb2c4.js → design-token-b7ce7ed4.js} +3 -3
- package/dist/esm/{element-appender-slimmer-afe5a638.js → element-appender-slimmer-3926470f.js} +2 -2
- package/dist/esm/{event-emit-slimmer-697ad0b7.js → event-emit-slimmer-0990037c.js} +1 -1
- package/dist/esm/{form-field-controller-slimmer-9e70a18d.js → form-field-controller-slimmer-24aca6c4.js} +1 -1
- package/dist/esm/{image-annotation-action-245eaa54.js → image-annotation-action-dadda36f.js} +4 -4
- package/dist/esm/index-090d31ca.js +4 -0
- package/dist/esm/index.js +18 -17
- package/dist/esm/{inject-keyboard-manager-05d5db90.js → inject-keyboard-manager-6317d1b3.js} +1 -1
- package/dist/esm/{internal-translation-controller-d8217d93.js → internal-translation-controller-0b9589d0.js} +8 -0
- package/dist/esm/{internal-vega-event-manager-1ac5ee9a.js → internal-vega-event-manager-dc4c3a37.js} +2 -2
- package/dist/esm/{keyboard-manager-26e2fc32.js → keyboard-manager-69761aa6.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-012a9a9b.js → keyboard-manager-slimmer-c2d038f0.js} +1 -1
- package/dist/esm/loader.js +13 -12
- package/dist/esm/{month-view-generator-918f1f88.js → month-view-generator-4c1ee949.js} +1 -1
- package/dist/esm/{public-rules-22320bdf.js → public-rules-da28b413.js} +8 -8
- package/dist/esm/{range-76f8e7dd.js → range-342cbce9.js} +1 -1
- package/dist/esm/replace-selected-text-action-a45bee4b.js +18 -0
- package/dist/esm/{responsive-format-facade-2a1d6398.js → responsive-format-facade-3ca1422d.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-6eb90840.js → rich-text-editor-required-rule-46d0bc5b.js} +1 -1
- package/dist/esm/{split-cell-operation-7652e813.js → split-cell-operation-1d114aa3.js} +79 -16
- package/dist/esm/{state-border-formatter-a243f3fc.js → state-border-formatter-3ebc76a4.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-f6625ed7.js → string-format-strategy.abstract-95d691e1.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-e801bd7e.js → string-input-formatter-slimmer-e18d202c.js} +1 -1
- package/dist/esm/{string-mask-strategy-53cb9b33.js → string-mask-strategy-43d846ac.js} +2 -2
- package/dist/esm/{style-formatter-a622a045.js → style-formatter-197e2fd3.js} +2 -2
- package/dist/esm/{time-required-rule-2fd8df50.js → time-required-rule-78d8ecf1.js} +1 -1
- package/dist/esm/{token-extension-5838c71b.js → token-extension-30011dc4.js} +1128 -27
- package/dist/esm/{translation-slimmer-32353a1c.js → translation-slimmer-49903fc8.js} +1 -1
- package/dist/esm/{type-guard-ed1004cc.js → type-guard-b18807dc.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-7c9d6808.js → valid-credit-card-number-rule-fe1c8a9c.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +22 -15
- package/dist/esm/vega-app-footer.entry.js +1 -1
- package/dist/esm/vega-app-header-button.entry.js +9 -9
- package/dist/esm/vega-banner.entry.js +3 -3
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-brand-logo.entry.js +1 -1
- package/dist/esm/vega-breadcrumb.entry.js +4 -4
- package/dist/esm/vega-button-circle.entry.js +9 -9
- package/dist/esm/vega-button-group_2.entry.js +4 -4
- package/dist/esm/vega-button-link.entry.js +4 -4
- package/dist/esm/vega-button.entry.js +7 -7
- package/dist/esm/vega-calendar_4.entry.js +10 -10
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +6 -6
- package/dist/esm/vega-checkbox_2.entry.js +6 -6
- package/dist/esm/vega-chip.entry.js +9 -9
- package/dist/esm/vega-code-block.entry.js +16 -15
- package/dist/esm/vega-color-picker.entry.js +5 -5
- package/dist/esm/vega-color-swatch-picker.entry.js +7 -7
- package/dist/esm/vega-color-swatch.entry.js +5 -5
- package/dist/esm/vega-combo-box.entry.js +23 -10
- package/dist/esm/vega-date-picker_2.entry.js +327 -267
- package/dist/esm/vega-dialog_2.entry.js +7 -7
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +11 -11
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/{vega-event-id-578c6c6d.js → vega-event-id-20494454.js} +2 -1
- package/dist/esm/vega-field-label.entry.js +22 -5
- package/dist/esm/vega-file-uploader.entry.js +20 -7
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-form.entry.js +7 -7
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +10 -10
- package/dist/esm/vega-input-credit-card.entry.js +10 -10
- package/dist/esm/vega-input-numeric.entry.js +9 -9
- package/dist/esm/vega-input-passcode.entry.js +23 -10
- package/dist/esm/vega-input-phone-number.entry.js +22 -9
- package/dist/esm/vega-input-range.entry.js +7 -7
- package/dist/esm/vega-input-select.entry.js +9 -9
- package/dist/esm/vega-input.entry.js +23 -10
- package/dist/esm/vega-item-toggle.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +11 -11
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-page-notification_2.entry.js +1 -1
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +3 -3
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +3 -3
- package/dist/esm/vega-pagination.entry.js +8 -8
- package/dist/esm/vega-popover_2.entry.js +11 -11
- package/dist/esm/vega-progress-tracker_2.entry.js +6 -6
- package/dist/esm/vega-radio_2.entry.js +9 -9
- package/dist/esm/vega-rich-text-content.entry.js +7 -7
- package/dist/esm/vega-rich-text-editor_4.entry.js +285 -189
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +396 -0
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +12 -12
- package/dist/esm/vega-section-title.entry.js +3 -2
- package/dist/esm/vega-segment-control.entry.js +3 -3
- package/dist/esm/vega-selection-chip_2.entry.js +8 -8
- package/dist/esm/vega-selection-tile_2.entry.js +6 -6
- package/dist/esm/vega-sidenav_3.entry.js +6 -6
- package/dist/esm/vega-signature-capture.entry.js +10 -10
- package/dist/esm/vega-stepper.entry.js +6 -6
- package/dist/esm/vega-tab-group_2.entry.js +4 -4
- package/dist/esm/vega-table_11.entry.js +8 -8
- package/dist/esm/vega-textarea.entry.js +17 -7
- package/dist/esm/vega-time-picker_2.entry.js +13 -13
- package/dist/esm/vega-toggle-switch.entry.js +5 -5
- package/dist/esm/vega-tooltip_2.entry.js +6 -6
- package/dist/esm/vega.js +13 -12
- package/dist/sri/vega-sri-manifest.json +363 -351
- package/dist/types/components/vega-accordion/slimmers/vega-accordion-renderer.d.ts +1 -0
- package/dist/types/components/vega-accordion/vega-accordion.d.ts +14 -0
- package/dist/types/components/vega-code-block/vega-code-block.d.ts +1 -0
- package/dist/types/components/vega-combo-box/slimmers/renderers/vega-combo-box-renderer.d.ts +1 -0
- package/dist/types/components/vega-combo-box/vega-combo-box.d.ts +10 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/controllers/vega-date-picker-calendar-size-controller.d.ts +20 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-header-render.d.ts +2 -1
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-calendar-year-month-switcher-renderer.d.ts +1 -1
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +0 -1
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +22 -2
- package/dist/types/components/vega-field-label/vega-field-label.d.ts +12 -0
- package/dist/types/components/vega-file-uploader/slimmers/renderers/vega-file-uploader-renderer.d.ts +1 -0
- package/dist/types/components/vega-file-uploader/vega-file-uploader.d.ts +10 -0
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-renderer.d.ts +1 -0
- package/dist/types/components/vega-input/vega-input.d.ts +10 -0
- package/dist/types/components/vega-input-passcode/slimmers/renderers/vega-input-passcode-renderer.d.ts +1 -0
- package/dist/types/components/vega-input-passcode/vega-input-passcode.d.ts +10 -0
- package/dist/types/components/vega-input-phone-number/slimmers/renderers/vega-input-phone-number-renderer.d.ts +1 -0
- package/dist/types/components/vega-input-phone-number/vega-input-phone-number.d.ts +10 -0
- package/dist/types/components/vega-rich-text-editor/assets/redo.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/assets/undo.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/dto/annotations/annotation-style.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/code-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/html-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/image-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/list-item-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/blocks/text-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/code-block-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/image-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/node.abstract.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +31 -0
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/function-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/dto/logic-control-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/functions/function-extension.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/action-handler-strategies/block-update-line-height-strategy.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/actions/line-height-annotation-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/annotations/line-height-annotation.d.ts +46 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/assets/line-height.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/constants.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-annotation-handler.d.ts +23 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-filter-styles-strategy.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/element-to-dto-strategies/line-height-from-json-handler.d.ts +17 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/line-height-extension.d.ts +19 -0
- package/dist/types/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.d.ts +44 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/arrow-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/currency-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/default-categories.d.ts +7 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/latin-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/mathematical-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/constants/text-characters.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-extension.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-icon.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/special-characters-toolbar-button-renderer.d.ts +83 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/types.d.ts +20 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/constants.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/controllers/special-characters-panel-keyboard-controller.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/slimmers/renderers/special-characters-panel-renderer.d.ts +66 -0
- package/dist/types/components/vega-rich-text-editor/extensions/special-characters/vega-rich-text-special-characters-panel/vega-rich-text-special-characters-panel.d.ts +58 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-body-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-caption-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-cell-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-head-cell-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/table/dto/table-row-block.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/extensions/type.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/helpers/extension-context-manager.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +5 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/annotation-handler/html-element-to-annotation-generator.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +3 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/redo-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/undo-toolbar-button-slimmer.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +14 -0
- package/dist/types/components/vega-textarea/vega-textarea.d.ts +10 -0
- package/dist/types/components.d.ts +169 -5
- package/dist/types/constants/ui.d.ts +1 -1
- package/dist/types/helpers/event-manager/event-id/vega-event-id.d.ts +1 -0
- package/dist/types/helpers/slimmers/component-value-history-controller-slimmer.abstract.d.ts +13 -0
- package/dist/types/helpers/theme/controllers/action-color-accessibility-validator.d.ts +10 -0
- package/dist/types/helpers/theme/internal-theme-manager.d.ts +28 -1
- package/dist/types/helpers/theme/theme-manager.d.ts +24 -1
- package/dist/types/helpers/theme/theme.d.ts +8 -0
- package/dist/types/helpers/translation/interface.d.ts +10 -1
- package/dist/types/types/components.type.d.ts +11 -10
- package/dist/types/types/public-api.d.ts +1 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/checker.d.ts +177 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/color-math.d.ts +125 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/contrast-check-strategy.d.ts +38 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/search.d.ts +58 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/token-checks.d.ts +122 -0
- package/dist/types/vega-color-token-contrast-checker/src/check/token-checks.generated.d.ts +2 -0
- package/dist/types/vega-color-token-contrast-checker/src/index.d.ts +2 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-636d890e.entry.js → p-01f617ee.entry.js} +1 -1
- package/dist/vega/{p-fdb97cb7.entry.js → p-03b32939.entry.js} +1 -1
- package/dist/vega/{p-2927b7a1.js → p-05dc6718.js} +1 -1
- package/dist/vega/{p-72e2a587.js → p-0b2ca33b.js} +1 -1
- package/dist/vega/p-0c460945.js +1 -0
- package/dist/vega/{p-d286da1d.entry.js → p-0d248322.entry.js} +1 -1
- package/dist/vega/{p-2b2fefc6.js → p-0d3830f1.js} +1 -1
- package/dist/vega/{p-c45acdc3.entry.js → p-0dafd071.entry.js} +1 -1
- package/dist/vega/{p-a67d52ce.entry.js → p-0edf9c6e.entry.js} +1 -1
- package/dist/vega/{p-a03341d8.entry.js → p-1385da31.entry.js} +1 -1
- package/dist/vega/{p-d1a6e126.entry.js → p-18d1d404.entry.js} +1 -1
- package/dist/vega/{p-aa8f4713.entry.js → p-1d752c37.entry.js} +1 -1
- package/dist/vega/p-1f563387.js +1 -0
- package/dist/vega/{p-e85497ec.entry.js → p-296c90bd.entry.js} +1 -1
- package/dist/vega/p-30f76962.js +3 -0
- package/dist/vega/p-3186995a.entry.js +1 -0
- package/dist/vega/p-3312e3dd.js +1 -0
- package/dist/vega/{p-a0dd08b1.js → p-36e46c4f.js} +1 -1
- package/dist/vega/p-36f3dd19.entry.js +1 -0
- package/dist/vega/{p-d5aad9f0.entry.js → p-3ab50c06.entry.js} +1 -1
- package/dist/vega/{p-31ebace1.js → p-3d6568cc.js} +1 -1
- package/dist/vega/{p-19df2831.entry.js → p-3e2e4b00.entry.js} +1 -1
- package/dist/vega/{p-ff5208f5.entry.js → p-416e89b0.entry.js} +1 -1
- package/dist/vega/{p-79bb216e.entry.js → p-4914a5f8.entry.js} +1 -1
- package/dist/vega/{p-ac26924d.entry.js → p-4f53b45d.entry.js} +1 -1
- package/dist/vega/p-50958342.js +1 -0
- package/dist/vega/{p-2d694684.js → p-518e0a24.js} +1 -1
- package/dist/vega/p-540bd78a.entry.js +1 -0
- package/dist/vega/p-5424e837.js +1 -0
- package/dist/vega/p-54ed506c.entry.js +1 -0
- package/dist/vega/{p-7e7e2f85.entry.js → p-5a960f83.entry.js} +1 -1
- package/dist/vega/{p-879d3cc9.entry.js → p-5c1a4fd7.entry.js} +1 -1
- package/dist/vega/{p-5b43a303.entry.js → p-5c8522eb.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-0b41b49a.entry.js → p-6205288e.entry.js} +1 -1
- package/dist/vega/{p-04a65b3f.js → p-6629a68b.js} +1 -1
- package/dist/vega/p-696d7b8f.js +1 -0
- package/dist/vega/{p-931dac8c.entry.js → p-6ab23e89.entry.js} +1 -1
- package/dist/vega/{p-154cc614.js → p-6bd37d32.js} +1 -1
- package/dist/vega/{p-ce034372.entry.js → p-6be01c6b.entry.js} +1 -1
- package/dist/vega/{p-294cff20.entry.js → p-70e0c3eb.entry.js} +1 -1
- package/dist/vega/{p-4a9c8ec0.entry.js → p-7168ef16.entry.js} +1 -1
- package/dist/vega/{p-ab04eff6.js → p-7292ac20.js} +1 -1
- package/dist/vega/p-7348a091.entry.js +1 -0
- package/dist/vega/{p-19adf714.js → p-788ada42.js} +1 -1
- package/dist/vega/p-7cd8d054.entry.js +1 -0
- package/dist/vega/{p-bee5dfb0.entry.js → p-7dcc0b23.entry.js} +1 -1
- package/dist/vega/{p-189d36ec.js → p-81d55efd.js} +1 -1
- package/dist/vega/{p-8077b117.js → p-8ee917b4.js} +1 -1
- package/dist/vega/{p-52645382.entry.js → p-92468c30.entry.js} +1 -1
- package/dist/vega/{p-3a3720c7.entry.js → p-92710213.entry.js} +1 -1
- package/dist/vega/{p-e8de9535.js → p-9c48e4e5.js} +1 -1
- package/dist/vega/{p-891815d6.js → p-9f03856e.js} +1 -1
- package/dist/vega/{p-7ffe8081.entry.js → p-a0dd5273.entry.js} +1 -1
- package/dist/vega/p-a0fa5ccc.entry.js +1 -0
- package/dist/vega/{p-4a954d9d.entry.js → p-a32ad1ac.entry.js} +1 -1
- package/dist/vega/{p-01a54c29.entry.js → p-a36d4199.entry.js} +1 -1
- package/dist/vega/{p-d97974be.entry.js → p-a53e1a60.entry.js} +1 -1
- package/dist/vega/{p-d4262f06.entry.js → p-a73d8915.entry.js} +1 -1
- package/dist/vega/{p-07225567.entry.js → p-a87bc75a.entry.js} +1 -1
- package/dist/vega/{p-09076646.js → p-abfe46ca.js} +1 -1
- package/dist/vega/p-ad815280.js +1 -0
- package/dist/vega/p-b0fb5099.entry.js +1 -0
- package/dist/vega/{p-d05915af.entry.js → p-b218141f.entry.js} +1 -1
- package/dist/vega/{p-e7c930d9.entry.js → p-b2a0d104.entry.js} +1 -1
- package/dist/vega/{p-3bf3c8bb.entry.js → p-b31802b3.entry.js} +1 -1
- package/dist/vega/{p-255a7387.entry.js → p-b3e97e2f.entry.js} +1 -1
- package/dist/vega/{p-15b4f1ce.entry.js → p-b519b9ab.entry.js} +1 -1
- package/dist/vega/{p-8aee6b74.js → p-b565a6a5.js} +1 -1
- package/dist/vega/{p-2e0bdc53.entry.js → p-b5a3de00.entry.js} +1 -1
- package/dist/vega/p-b5d00d38.entry.js +1 -0
- package/dist/vega/p-b72d7b57.entry.js +1 -0
- package/dist/vega/{p-f5ae99b4.entry.js → p-b7f30f68.entry.js} +1 -1
- package/dist/vega/p-b857a661.js +1 -0
- package/dist/vega/{p-d9d4bdbf.entry.js → p-ba4f23d8.entry.js} +1 -1
- package/dist/vega/{p-5df7ab03.entry.js → p-c0c13993.entry.js} +1 -1
- package/dist/vega/p-c4675cd2.entry.js +1 -0
- package/dist/vega/p-c51e3b9e.js +1 -0
- package/dist/vega/{p-bd47d8a7.entry.js → p-c6201e76.entry.js} +1 -1
- package/dist/vega/p-c84aa55a.js +1 -0
- package/dist/vega/{p-858ec529.js → p-c93dfe23.js} +1 -1
- package/dist/vega/p-cacec680.js +1 -0
- package/dist/vega/{p-186df871.entry.js → p-cd382652.entry.js} +1 -1
- package/dist/vega/{p-49341532.entry.js → p-cdd3af89.entry.js} +1 -1
- package/dist/vega/{p-ec663f00.entry.js → p-ce8a0aa6.entry.js} +1 -1
- package/dist/vega/{p-648be36d.entry.js → p-cf5c6172.entry.js} +1 -1
- package/dist/vega/{p-0a322971.entry.js → p-d1641644.entry.js} +1 -1
- package/dist/vega/p-d2237b95.entry.js +1 -0
- package/dist/vega/{p-76075a1c.entry.js → p-d24892d6.entry.js} +1 -1
- package/dist/vega/p-d25ca0c3.entry.js +1 -0
- package/dist/vega/{p-b69755c7.entry.js → p-d8591207.entry.js} +1 -1
- package/dist/vega/p-da42fde0.js +1 -0
- package/dist/vega/{p-aa4e9a4b.entry.js → p-dc0f7ef1.entry.js} +1 -1
- package/dist/vega/{p-70ae9157.entry.js → p-dcd3b421.entry.js} +1 -1
- package/dist/vega/{p-c19132c9.entry.js → p-df4f9264.entry.js} +1 -1
- package/dist/vega/p-e5726df7.entry.js +1 -0
- package/dist/vega/{p-4c91b13d.js → p-e7fb7eee.js} +1 -1
- package/dist/vega/{p-98dad153.entry.js → p-ea4b5520.entry.js} +1 -1
- package/dist/vega/p-ecbead18.entry.js +1 -0
- package/dist/vega/{p-b02b985d.js → p-f0d70de3.js} +1 -1
- package/dist/vega/{p-78ba7ca9.js → p-f7ad9349.js} +1 -1
- package/dist/vega/{p-a6565e02.js → p-fdf6f368.js} +1 -1
- package/dist/vega/{p-0a261b66.js → p-fea75b87.js} +1 -1
- package/dist/vega/{p-296c5e52.js → p-ffda64ac.js} +1 -1
- package/dist/vega/{p-74a1a82a.entry.js → p-ffe8a826.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +3 -2
- package/dist/vega/p-042933f1.js +0 -1
- package/dist/vega/p-0d97dcb9.js +0 -1
- package/dist/vega/p-1da42a63.entry.js +0 -1
- package/dist/vega/p-281fa1e0.js +0 -1
- package/dist/vega/p-32a0f887.js +0 -1
- package/dist/vega/p-4a6f241d.entry.js +0 -1
- package/dist/vega/p-4dd02704.js +0 -1
- package/dist/vega/p-50fb936f.entry.js +0 -1
- package/dist/vega/p-612808ce.entry.js +0 -1
- package/dist/vega/p-6399b5ed.js +0 -1
- package/dist/vega/p-686e0b6b.entry.js +0 -1
- package/dist/vega/p-6d4faebc.js +0 -1
- package/dist/vega/p-88e56a47.entry.js +0 -1
- package/dist/vega/p-8d36afcc.entry.js +0 -1
- package/dist/vega/p-979a5e91.entry.js +0 -1
- package/dist/vega/p-a2b8d49d.js +0 -1
- package/dist/vega/p-ab4c307b.js +0 -1
- package/dist/vega/p-ce2d9efe.entry.js +0 -1
- package/dist/vega/p-e46a23fc.entry.js +0 -1
- package/dist/vega/p-e8ea3b16.js +0 -3
- package/dist/vega/p-ea0e922f.entry.js +0 -1
- package/dist/vega/p-ec2333f7.entry.js +0 -1
- package/dist/vega/p-ed2b0e01.entry.js +0 -1
- package/dist/vega/p-ef13b346.js +0 -1
- package/dist/vega/p-fe220f3a.entry.js +0 -1
|
@@ -0,0 +1,1815 @@
|
|
|
1
|
+
import { L as LightModeColorTokens, b as VegaColorSchemaOverridingController } from './dark-mode-style-controller-fcda24ec.js';
|
|
2
|
+
import './static-subject-title-52f93124.js';
|
|
3
|
+
import './change-manager-6a7eb88c.js';
|
|
4
|
+
import './global-slimmer-registry-17c4efd4.js';
|
|
5
|
+
import './observer-3959f9dd.js';
|
|
6
|
+
import './tinycolor-polyfill-7be0eb93.js';
|
|
7
|
+
import './vega-nonce-manager-497e5eb5.js';
|
|
8
|
+
import './try-get-document-bef0f526.js';
|
|
9
|
+
import './index-3b327f29.js';
|
|
10
|
+
|
|
11
|
+
// Self-contained hex-color validation: this package is consumed by vega-stencil
|
|
12
|
+
// (which has its own `isValidHexColor` in `utils/ui.ts`), but we cannot import
|
|
13
|
+
// across the package boundary. Pattern matches vega-stencil's exactly.
|
|
14
|
+
const HEX_COLOR_PATTERN = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
15
|
+
/** Matches `rgb(r, g, b)` with integer channel values 0–255. */
|
|
16
|
+
const RGB_PATTERN = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i;
|
|
17
|
+
/** Matches `rgba(r, g, b, a)` with integer channels 0–255 and alpha 0–1. */
|
|
18
|
+
const RGBA_PATTERN = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([01]?\.?\d*)\s*\)$/i;
|
|
19
|
+
/** Returns true if the string is a valid 3- or 6-digit hex color (with optional `#`). */
|
|
20
|
+
function isValidHexColor(hex) {
|
|
21
|
+
return HEX_COLOR_PATTERN.test(hex);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns true if the string is a valid color in any supported format:
|
|
25
|
+
* hex (3/6 digits), rgb(), or rgba().
|
|
26
|
+
*/
|
|
27
|
+
function isValidColor(color) {
|
|
28
|
+
if (isValidHexColor(color))
|
|
29
|
+
return true;
|
|
30
|
+
const rgbMatch = color.match(RGB_PATTERN);
|
|
31
|
+
if (rgbMatch) {
|
|
32
|
+
return isValidRgbChannels(+rgbMatch[1], +rgbMatch[2], +rgbMatch[3]);
|
|
33
|
+
}
|
|
34
|
+
const rgbaMatch = color.match(RGBA_PATTERN);
|
|
35
|
+
if (rgbaMatch) {
|
|
36
|
+
return isValidRgbChannels(+rgbaMatch[1], +rgbaMatch[2], +rgbaMatch[3]) &&
|
|
37
|
+
+rgbaMatch[4] >= 0 && +rgbaMatch[4] <= 1;
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
/** Check that each channel is an integer in 0–255 range. */
|
|
42
|
+
function isValidRgbChannels(r, g, b) {
|
|
43
|
+
return r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* sRGB linearization constants per IEC 61966-2-1
|
|
47
|
+
*
|
|
48
|
+
* Threshold on companded (sRGB) channel value (0–1) below which the linear form is used.
|
|
49
|
+
* Note: WCAG 2.0/2.1 reference uses 0.03928 (pre-amendment IEC 61966-2-1). The 2001
|
|
50
|
+
* amendment updated to 0.04045; difference is negligible (<0.3% of sRGB gamut).
|
|
51
|
+
*/
|
|
52
|
+
const SRGB_THRESHOLD = 0.03928;
|
|
53
|
+
/** Equivalent threshold on linearized channel value (0–1) — used for the inverse transform. */
|
|
54
|
+
const SRGB_LINEAR_THRESHOLD = 0.0031308;
|
|
55
|
+
const SRGB_LINEAR_FACTOR = 12.92;
|
|
56
|
+
const SRGB_GAMMA_OFFSET = 0.055;
|
|
57
|
+
const SRGB_GAMMA_DIVISOR = 1.055;
|
|
58
|
+
const SRGB_GAMMA_EXPONENT = 2.4;
|
|
59
|
+
/** ITU-R BT.709 luminance coefficients */
|
|
60
|
+
const LUMINANCE_R = 0.2126;
|
|
61
|
+
const LUMINANCE_G = 0.7152;
|
|
62
|
+
const LUMINANCE_B = 0.0722;
|
|
63
|
+
/** WCAG contrast ratio offset */
|
|
64
|
+
const CONTRAST_OFFSET = 0.05;
|
|
65
|
+
const MAX_RGB = 255;
|
|
66
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
67
|
+
// sRGB ↔ linear
|
|
68
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
69
|
+
/**
|
|
70
|
+
* Convert a companded sRGB channel value (0–1) to its linear-light equivalent.
|
|
71
|
+
*
|
|
72
|
+
* @param {number} c - Companded sRGB channel value (0–1).
|
|
73
|
+
* @returns {number} Linearized channel value.
|
|
74
|
+
*/
|
|
75
|
+
function srgbChannelToLinear(c) {
|
|
76
|
+
return c <= SRGB_THRESHOLD
|
|
77
|
+
? c / SRGB_LINEAR_FACTOR
|
|
78
|
+
: ((c + SRGB_GAMMA_OFFSET) / SRGB_GAMMA_DIVISOR) ** SRGB_GAMMA_EXPONENT;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Convert a linear-light channel value (0–1) to its companded sRGB equivalent.
|
|
82
|
+
*
|
|
83
|
+
* @param {number} c - Linear channel value (0–1).
|
|
84
|
+
* @returns {number} Companded sRGB channel value.
|
|
85
|
+
*/
|
|
86
|
+
function linearChannelToSrgb(c) {
|
|
87
|
+
return c <= SRGB_LINEAR_THRESHOLD
|
|
88
|
+
? SRGB_LINEAR_FACTOR * c
|
|
89
|
+
: SRGB_GAMMA_DIVISOR * c ** (1 / SRGB_GAMMA_EXPONENT) - SRGB_GAMMA_OFFSET;
|
|
90
|
+
}
|
|
91
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
92
|
+
// WCAG luminance / contrast
|
|
93
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
94
|
+
/**
|
|
95
|
+
* Calculate the relative luminance of a color per WCAG 2.0.
|
|
96
|
+
*
|
|
97
|
+
* @param {RgbColor} color - RGB color to compute luminance for.
|
|
98
|
+
* @returns {number} Relative luminance value.
|
|
99
|
+
* @see https://www.w3.org/TR/WCAG20/#relativeluminancedef
|
|
100
|
+
*/
|
|
101
|
+
function getRelativeLuminance(color) {
|
|
102
|
+
const r = srgbChannelToLinear(color.r / MAX_RGB);
|
|
103
|
+
const g = srgbChannelToLinear(color.g / MAX_RGB);
|
|
104
|
+
const b = srgbChannelToLinear(color.b / MAX_RGB);
|
|
105
|
+
return LUMINANCE_R * r + LUMINANCE_G * g + LUMINANCE_B * b;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Calculate the contrast ratio between two colors per WCAG 2.0. The operation is
|
|
109
|
+
* symmetric, so callers don't need to sort the arguments.
|
|
110
|
+
*
|
|
111
|
+
* @param {RgbColor} a - First color.
|
|
112
|
+
* @param {RgbColor} b - Second color.
|
|
113
|
+
* @returns {number} WCAG contrast ratio.
|
|
114
|
+
* @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef
|
|
115
|
+
*/
|
|
116
|
+
function getContrastRatio(a, b) {
|
|
117
|
+
const la = getRelativeLuminance(a);
|
|
118
|
+
const lb = getRelativeLuminance(b);
|
|
119
|
+
const lighter = Math.max(la, lb);
|
|
120
|
+
const darker = Math.min(la, lb);
|
|
121
|
+
return (lighter + CONTRAST_OFFSET) / (darker + CONTRAST_OFFSET);
|
|
122
|
+
}
|
|
123
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
124
|
+
// Compositing & format helpers
|
|
125
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
126
|
+
/**
|
|
127
|
+
* Composite a semi-transparent foreground color over an opaque background using the
|
|
128
|
+
* standard alpha compositing formula.
|
|
129
|
+
*
|
|
130
|
+
* @param {RgbColor} fg - Foreground color.
|
|
131
|
+
* @param {number} fgAlpha - Foreground alpha (0–1).
|
|
132
|
+
* @param {RgbColor} bg - Background color.
|
|
133
|
+
* @returns {RgbColor} Composited opaque color.
|
|
134
|
+
*/
|
|
135
|
+
function alphaComposite(fg, fgAlpha, bg) {
|
|
136
|
+
return {
|
|
137
|
+
r: Math.round(fg.r * fgAlpha + bg.r * (1 - fgAlpha)),
|
|
138
|
+
g: Math.round(fg.g * fgAlpha + bg.g * (1 - fgAlpha)),
|
|
139
|
+
b: Math.round(fg.b * fgAlpha + bg.b * (1 - fgAlpha)),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Convert an RGB color to its hex string representation.
|
|
144
|
+
*
|
|
145
|
+
* @param {RgbColor} color - RGB color to convert.
|
|
146
|
+
* @returns {string} Hex color string with leading `#`.
|
|
147
|
+
*/
|
|
148
|
+
function rgbToHex(color) {
|
|
149
|
+
/**
|
|
150
|
+
* Convert a single channel to a two-digit hex string.
|
|
151
|
+
*
|
|
152
|
+
* @param {number} n - Channel value (0–255).
|
|
153
|
+
* @returns {string} Two-digit hex string.
|
|
154
|
+
*/
|
|
155
|
+
const toHex = (n) => n.toString(16).padStart(2, '0');
|
|
156
|
+
return `#${toHex(color.r)}${toHex(color.g)}${toHex(color.b)}`;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Parse a 3- or 6-char hex string into an RGB triplet.
|
|
160
|
+
*
|
|
161
|
+
* Throws on malformed input rather than returning a silently-NaN-poisoned color — a bad
|
|
162
|
+
* hex here is a programmer error (invalid `actionColor` on `VegaThemeOverrideColors`) and
|
|
163
|
+
* a fail-fast surface is easier to debug than garbage-propagating contrast ratios.
|
|
164
|
+
*
|
|
165
|
+
* @param {string} hex - Hex color string (3 or 6 digits, optional `#` prefix).
|
|
166
|
+
* @returns {RgbColor} Parsed RGB triplet.
|
|
167
|
+
*/
|
|
168
|
+
function hexToRgb(hex) {
|
|
169
|
+
if (!isValidHexColor(hex)) {
|
|
170
|
+
throw new Error(`Invalid hex color: "${hex}". Expected 3- or 6-digit hex with optional leading #.`);
|
|
171
|
+
}
|
|
172
|
+
const cleaned = hex.replace(/^#/, '');
|
|
173
|
+
const full = cleaned.length === 3
|
|
174
|
+
? cleaned[0] + cleaned[0] + cleaned[1] + cleaned[1] + cleaned[2] + cleaned[2]
|
|
175
|
+
: cleaned;
|
|
176
|
+
return {
|
|
177
|
+
r: parseInt(full.substring(0, 2), 16),
|
|
178
|
+
g: parseInt(full.substring(2, 4), 16),
|
|
179
|
+
b: parseInt(full.substring(4, 6), 16),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Parse any supported color format (hex, rgb(), rgba()) into an RGB triplet.
|
|
184
|
+
*
|
|
185
|
+
* Throws on malformed input. Alpha from rgba() is discarded — actionColor is opaque.
|
|
186
|
+
*
|
|
187
|
+
* @param {string} color - Color string in hex, rgb(), or rgba() format.
|
|
188
|
+
* @returns {RgbColor} Parsed RGB triplet.
|
|
189
|
+
*/
|
|
190
|
+
function parseColorToRgb(color) {
|
|
191
|
+
if (isValidHexColor(color)) {
|
|
192
|
+
return hexToRgb(color);
|
|
193
|
+
}
|
|
194
|
+
const rgbMatch = color.match(RGB_PATTERN);
|
|
195
|
+
if (rgbMatch && isValidRgbChannels(+rgbMatch[1], +rgbMatch[2], +rgbMatch[3])) {
|
|
196
|
+
return { r: +rgbMatch[1], g: +rgbMatch[2], b: +rgbMatch[3] };
|
|
197
|
+
}
|
|
198
|
+
const rgbaMatch = color.match(RGBA_PATTERN);
|
|
199
|
+
if (rgbaMatch && isValidRgbChannels(+rgbaMatch[1], +rgbaMatch[2], +rgbaMatch[3])) {
|
|
200
|
+
return { r: +rgbaMatch[1], g: +rgbaMatch[2], b: +rgbaMatch[3] };
|
|
201
|
+
}
|
|
202
|
+
throw new Error(`Invalid color: "${color}". Expected hex, rgb(), or rgba() format.`);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Format a token value back to the `r g b / a` shape consumed by the theme layer.
|
|
206
|
+
*
|
|
207
|
+
* @param {RgbColor} rgb - RGB color.
|
|
208
|
+
* @param {number} alpha - Alpha value (0–1).
|
|
209
|
+
* @returns {string} Formatted token value string.
|
|
210
|
+
*/
|
|
211
|
+
function formatTokenValue(rgb, alpha) {
|
|
212
|
+
// Round to 2 decimals — matches tinycolor's output precision and keeps CSS var readable.
|
|
213
|
+
const a = Math.round(alpha * 100) / 100;
|
|
214
|
+
return `${rgb.r} ${rgb.g} ${rgb.b} / ${a}`;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Inverse of {@link formatTokenValue}. Returns `null` on unparseable input.
|
|
218
|
+
*
|
|
219
|
+
* @param {string} value - Token value string in `r g b / a` format.
|
|
220
|
+
* @returns {ParsedTokenValue | null} Parsed result or null.
|
|
221
|
+
*/
|
|
222
|
+
function parseTokenValue(value) {
|
|
223
|
+
const match = value.match(/^\s*(\d+)\s+(\d+)\s+(\d+)\s*\/\s*([\d.]+)\s*$/);
|
|
224
|
+
if (!match) {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
rgb: {
|
|
229
|
+
r: parseInt(match[1], 10),
|
|
230
|
+
g: parseInt(match[2], 10),
|
|
231
|
+
b: parseInt(match[3], 10),
|
|
232
|
+
},
|
|
233
|
+
a: parseFloat(match[4]),
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
237
|
+
// OKLab / OKLCH conversions
|
|
238
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
239
|
+
/**
|
|
240
|
+
* Convert an RGB color to its OKLab representation.
|
|
241
|
+
*
|
|
242
|
+
* @param {RgbColor} rgb - RGB color to convert.
|
|
243
|
+
* @returns {OklabColor} OKLab color.
|
|
244
|
+
*/
|
|
245
|
+
function rgbToOklab(rgb) {
|
|
246
|
+
const r = srgbChannelToLinear(rgb.r / MAX_RGB);
|
|
247
|
+
const g = srgbChannelToLinear(rgb.g / MAX_RGB);
|
|
248
|
+
const b = srgbChannelToLinear(rgb.b / MAX_RGB);
|
|
249
|
+
const l_ = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
|
|
250
|
+
const m_ = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
|
|
251
|
+
const s_ = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
|
|
252
|
+
return {
|
|
253
|
+
L: 0.2104542553 * l_ + 0.793617785 * m_ - 0.0040720468 * s_,
|
|
254
|
+
a: 1.9779984951 * l_ - 2.428592205 * m_ + 0.4505937099 * s_,
|
|
255
|
+
b: 0.0259040371 * l_ + 0.7827717662 * m_ - 0.808675766 * s_,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Convert an OKLab color to its RGB representation.
|
|
260
|
+
*
|
|
261
|
+
* @param {OklabColor} lab - OKLab color to convert.
|
|
262
|
+
* @returns {RgbColor} RGB color.
|
|
263
|
+
*/
|
|
264
|
+
function oklabToRgb(lab) {
|
|
265
|
+
const l_ = lab.L + 0.3963377774 * lab.a + 0.2158037573 * lab.b;
|
|
266
|
+
const m_ = lab.L - 0.1055613458 * lab.a - 0.0638541728 * lab.b;
|
|
267
|
+
const s_ = lab.L - 0.0894841775 * lab.a - 1.291485548 * lab.b;
|
|
268
|
+
const l = l_ ** 3;
|
|
269
|
+
const m = m_ ** 3;
|
|
270
|
+
const s = s_ ** 3;
|
|
271
|
+
const rLinear = 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s;
|
|
272
|
+
const gLinear = -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s;
|
|
273
|
+
const bLinear = -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s;
|
|
274
|
+
/**
|
|
275
|
+
* Clamp and round a linear-light channel to a byte (0–255).
|
|
276
|
+
*
|
|
277
|
+
* @param {number} linear - Linear-light channel value.
|
|
278
|
+
* @returns {number} Clamped byte value (0–255).
|
|
279
|
+
*/
|
|
280
|
+
const toByte = (linear) => Math.max(0, Math.min(MAX_RGB, Math.round(linearChannelToSrgb(linear) * MAX_RGB)));
|
|
281
|
+
return { r: toByte(rLinear), g: toByte(gLinear), b: toByte(bLinear) };
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Convert an OKLab color to its OKLCH (cylindrical) representation.
|
|
285
|
+
*
|
|
286
|
+
* @param {OklabColor} lab - OKLab color to convert.
|
|
287
|
+
* @returns {OklchColor} OKLCH color.
|
|
288
|
+
*/
|
|
289
|
+
function oklabToOklch(lab) {
|
|
290
|
+
return {
|
|
291
|
+
L: lab.L,
|
|
292
|
+
C: Math.sqrt(lab.a * lab.a + lab.b * lab.b),
|
|
293
|
+
h: (Math.atan2(lab.b, lab.a) * 180) / Math.PI,
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Convert an OKLCH color to its OKLab (Cartesian) representation.
|
|
298
|
+
*
|
|
299
|
+
* @param {OklchColor} lch - OKLCH color to convert.
|
|
300
|
+
* @returns {OklabColor} OKLab color.
|
|
301
|
+
*/
|
|
302
|
+
function oklchToOklab(lch) {
|
|
303
|
+
const hRad = (lch.h * Math.PI) / 180;
|
|
304
|
+
return {
|
|
305
|
+
L: lch.L,
|
|
306
|
+
a: lch.C * Math.cos(hRad),
|
|
307
|
+
b: lch.C * Math.sin(hRad),
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Perceptual color distance in OKLab (Euclidean ΔE, since OKLab is designed to be uniform).
|
|
312
|
+
*
|
|
313
|
+
* @param {OklabColor} a - First OKLab color.
|
|
314
|
+
* @param {OklabColor} b - Second OKLab color.
|
|
315
|
+
* @returns {number} Euclidean distance in OKLab space.
|
|
316
|
+
*/
|
|
317
|
+
function oklabDeltaE(a, b) {
|
|
318
|
+
const dL = a.L - b.L;
|
|
319
|
+
const deltaA = a.a - b.a;
|
|
320
|
+
const db = a.b - b.b;
|
|
321
|
+
return Math.sqrt(dL * dL + deltaA * deltaA + db * db);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Light mode bg-primary ({@link LightModeColorTokens}'s `bg-primary` = `252, 252, 252, 1`).
|
|
326
|
+
* Duplicated here to avoid a circular dependency with `token-checks.ts`, which imports from
|
|
327
|
+
* this file. Must stay in sync with `LIGHT_BG_PRIMARY` in `token-checks.ts`.
|
|
328
|
+
*/
|
|
329
|
+
const LIGHT_BG_PRIMARY = { r: 252, g: 252, b: 252 };
|
|
330
|
+
/**
|
|
331
|
+
* Resolve a surface to its effective opaque foreground color via alpha compositing.
|
|
332
|
+
*
|
|
333
|
+
* @param {ContextSurface} surface - Surface to resolve.
|
|
334
|
+
* @param {RgbColor} bg - Background color for alpha compositing.
|
|
335
|
+
* @returns {RgbColor} Effective foreground RGB.
|
|
336
|
+
*/
|
|
337
|
+
function effectiveFgRgb$1(surface, bg) {
|
|
338
|
+
return surface.a < 1 ? alphaComposite(surface.rgb, surface.a, bg) : surface.rgb;
|
|
339
|
+
}
|
|
340
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
341
|
+
// WCAG AA thresholds
|
|
342
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
343
|
+
/** WCAG 2.1 AA minimum contrast ratio for normal-size text. */
|
|
344
|
+
const WCAG_AA_NORMAL_TEXT = 4.5;
|
|
345
|
+
/** WCAG 2.1 AA minimum contrast ratio for UI components and large text. */
|
|
346
|
+
const WCAG_AA_NON_TEXT_CONTRAST = 3;
|
|
347
|
+
/**
|
|
348
|
+
* Abstract strategy for computing the rendered fg/bg pair from a token and its paired surface.
|
|
349
|
+
* Each subclass implements the compositing logic specific to its WCAG check category.
|
|
350
|
+
*/
|
|
351
|
+
class ContrastCheckStrategy {
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Token is a background; paired text sits on top.
|
|
355
|
+
* Contrast is measured between the composited background and the effective foreground text.
|
|
356
|
+
*/
|
|
357
|
+
class BgTextStrategy extends ContrastCheckStrategy {
|
|
358
|
+
constructor() {
|
|
359
|
+
super(...arguments);
|
|
360
|
+
this.requiredRatio = WCAG_AA_NORMAL_TEXT;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Compute fg/bg: token is background, paired text on top.
|
|
364
|
+
*
|
|
365
|
+
* @param {ParsedTokenValue} token - Background token value.
|
|
366
|
+
* @param {ContextSurface} paired - Foreground text surface.
|
|
367
|
+
* @returns {FgBgPair} Rendered foreground and background.
|
|
368
|
+
*/
|
|
369
|
+
computeFgBg(token, paired) {
|
|
370
|
+
const bg = token.a < 1 ? alphaComposite(token.rgb, token.a, LIGHT_BG_PRIMARY) : token.rgb;
|
|
371
|
+
const fg = effectiveFgRgb$1(paired, bg);
|
|
372
|
+
return { fg, bg };
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Token is foreground text; paired surface is the background behind it.
|
|
377
|
+
* Contrast is measured between the composited text color and its background.
|
|
378
|
+
*/
|
|
379
|
+
class TextBgStrategy extends ContrastCheckStrategy {
|
|
380
|
+
constructor() {
|
|
381
|
+
super(...arguments);
|
|
382
|
+
this.requiredRatio = WCAG_AA_NORMAL_TEXT;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Compute fg/bg: token is foreground text, paired surface behind.
|
|
386
|
+
*
|
|
387
|
+
* @param {ParsedTokenValue} token - Foreground text token value.
|
|
388
|
+
* @param {ContextSurface} paired - Background surface.
|
|
389
|
+
* @returns {FgBgPair} Rendered foreground and background.
|
|
390
|
+
*/
|
|
391
|
+
computeFgBg(token, paired) {
|
|
392
|
+
const pairedBg = paired.a < 1 ? alphaComposite(paired.rgb, paired.a, LIGHT_BG_PRIMARY) : paired.rgb;
|
|
393
|
+
const fg = token.a < 1 ? alphaComposite(token.rgb, token.a, pairedBg) : token.rgb;
|
|
394
|
+
return { fg, bg: pairedBg };
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Token is a UI component (border, ring); `compositedOn` may override the composite surface.
|
|
399
|
+
* For box-shadow rings that paint outside an element (on the page background) but are compared
|
|
400
|
+
* against the element's fill, `compositedOn` ensures the alpha composite uses the correct surface.
|
|
401
|
+
*/
|
|
402
|
+
class NonTextContrastStrategy extends ContrastCheckStrategy {
|
|
403
|
+
constructor() {
|
|
404
|
+
super(...arguments);
|
|
405
|
+
this.requiredRatio = WCAG_AA_NON_TEXT_CONTRAST;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Compute fg/bg: token is UI component, optional composite surface override.
|
|
409
|
+
*
|
|
410
|
+
* @param {ParsedTokenValue} token - UI component token value.
|
|
411
|
+
* @param {ContextSurface} paired - Adjacent surface for contrast.
|
|
412
|
+
* @param {ContextSurface | undefined} compositedOn - Override composite surface.
|
|
413
|
+
* @returns {FgBgPair} Rendered foreground and background.
|
|
414
|
+
*/
|
|
415
|
+
computeFgBg(token, paired, compositedOn) {
|
|
416
|
+
const pairedBg = paired.a < 1 ? alphaComposite(paired.rgb, paired.a, LIGHT_BG_PRIMARY) : paired.rgb;
|
|
417
|
+
let compositeSurface = pairedBg;
|
|
418
|
+
if (compositedOn && token.a < 1) {
|
|
419
|
+
compositeSurface =
|
|
420
|
+
compositedOn.a < 1
|
|
421
|
+
? alphaComposite(compositedOn.rgb, compositedOn.a, LIGHT_BG_PRIMARY)
|
|
422
|
+
: compositedOn.rgb;
|
|
423
|
+
}
|
|
424
|
+
const fg = token.a < 1 ? alphaComposite(token.rgb, token.a, compositeSurface) : token.rgb;
|
|
425
|
+
return { fg, bg: pairedBg };
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
/** Strategy registry — maps check type to its strategy instance. */
|
|
429
|
+
const STRATEGY_MAP = {
|
|
430
|
+
'bg-text': new BgTextStrategy(),
|
|
431
|
+
'text-bg': new TextBgStrategy(),
|
|
432
|
+
'non-text-contrast': new NonTextContrastStrategy(),
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
436
|
+
// Fixed paired-surface table — built by the consumer from a design-token map
|
|
437
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
438
|
+
/**
|
|
439
|
+
* Names of the static design tokens that have no `overrideGetter` — the surfaces every
|
|
440
|
+
* actionColor-derived token may be paired with. Source-of-truth for which static tokens
|
|
441
|
+
* the checker must know about. Kept here (not in the consumer) so adding new pair targets
|
|
442
|
+
* is a one-line change in this package.
|
|
443
|
+
*
|
|
444
|
+
* Each entry's real SCSS consumer is documented in the catalogue's inline comment.
|
|
445
|
+
* `bg-action-tertiary` is α=0 (fully transparent) — composites collapse to `bg-primary`.
|
|
446
|
+
*/
|
|
447
|
+
const FIXED_PAIRED_SURFACE_TOKENS = [
|
|
448
|
+
'text-on-action',
|
|
449
|
+
'text-primary',
|
|
450
|
+
'text-secondary',
|
|
451
|
+
'text-inverted-primary',
|
|
452
|
+
'text-inverted-secondary',
|
|
453
|
+
'bg-primary',
|
|
454
|
+
'bg-page',
|
|
455
|
+
'bg-secondary',
|
|
456
|
+
'bg-tertiary',
|
|
457
|
+
'bg-quaternary',
|
|
458
|
+
'bg-action-secondary',
|
|
459
|
+
'bg-action-tertiary',
|
|
460
|
+
'bg-action-tertiary-hover',
|
|
461
|
+
'bg-tile',
|
|
462
|
+
'bg-tile-hover',
|
|
463
|
+
'bg-tile-selected',
|
|
464
|
+
'bg-tile-selected-hover',
|
|
465
|
+
'bg-transparent',
|
|
466
|
+
'bg-danger',
|
|
467
|
+
'bg-divider-secondary',
|
|
468
|
+
'bg-table-row-hover',
|
|
469
|
+
'bg-toggle-switch',
|
|
470
|
+
'bg-status-error',
|
|
471
|
+
'bg-status-info',
|
|
472
|
+
'bg-status-success',
|
|
473
|
+
'bg-status-warning',
|
|
474
|
+
'bg-table-header',
|
|
475
|
+
'bg-segment-control',
|
|
476
|
+
'bg-action-tertiary-active',
|
|
477
|
+
'bg-chip-active',
|
|
478
|
+
'bg-chip-hover',
|
|
479
|
+
'bg-segment-hover',
|
|
480
|
+
'bg-toggle-switch-hover',
|
|
481
|
+
'bg-danger-tertiary-active',
|
|
482
|
+
'bg-danger-tertiary-hover',
|
|
483
|
+
];
|
|
484
|
+
/**
|
|
485
|
+
* Parse the comma-separated `r, g, b, a` shape used by the generated `*-color-tokens.ts` files.
|
|
486
|
+
*
|
|
487
|
+
* @param {string} value - Comma-separated string in `"r, g, b, a"` format (e.g. `"252, 252, 254, 0.9"`).
|
|
488
|
+
* @returns {ContextSurface} Parsed {@link ContextSurface} with `rgb` and `a` fields.
|
|
489
|
+
* @throws {Error} If the string has fewer than 4 parts or contains non-numeric values.
|
|
490
|
+
*/
|
|
491
|
+
function parseCommaTokenValue(value) {
|
|
492
|
+
const parts = value.split(',').map((s) => parseFloat(s.trim()));
|
|
493
|
+
if (parts.length < 4 || parts.some(isNaN)) {
|
|
494
|
+
throw new Error(`Malformed token value: "${value}". Expected "r, g, b, a" format.`);
|
|
495
|
+
}
|
|
496
|
+
const [r, g, b, a] = parts;
|
|
497
|
+
return { rgb: { r, g, b }, a };
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Build the fixed paired-surface table from the consumer's static design-token map.
|
|
501
|
+
*
|
|
502
|
+
* @param {Record<string, string>} designTokens - Source design tokens (token name → "r, g, b, a").
|
|
503
|
+
* @returns {Readonly<Record<string, ContextSurface>>} Frozen table for the checker.
|
|
504
|
+
*/
|
|
505
|
+
function buildFixedPairedSurfaces(designTokens) {
|
|
506
|
+
const out = {};
|
|
507
|
+
for (const name of FIXED_PAIRED_SURFACE_TOKENS) {
|
|
508
|
+
const raw = designTokens[name];
|
|
509
|
+
if (raw === undefined) {
|
|
510
|
+
throw new Error(`buildFixedPairedSurfaces: missing required design token "${name}" in the supplied map.`);
|
|
511
|
+
}
|
|
512
|
+
out[name] = parseCommaTokenValue(raw);
|
|
513
|
+
}
|
|
514
|
+
return Object.freeze(out);
|
|
515
|
+
}
|
|
516
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
517
|
+
// Pure surface / contrast helpers (parameterized on fixed-surface table)
|
|
518
|
+
// ────────────────────────────────────────────────────────────────────────────────
|
|
519
|
+
/**
|
|
520
|
+
* Resolve a `pairedWith` name to its rendered {@link ContextSurface}.
|
|
521
|
+
*
|
|
522
|
+
* Lookup order:
|
|
523
|
+
* 1. **`tokenMap` (actionColor-derived)** — covers every token that has an
|
|
524
|
+
* `overrideGetter` and therefore depends on `actionColor`.
|
|
525
|
+
* 2. **`fixedSurfaces`** — covers the static design tokens that have no `overrideGetter`.
|
|
526
|
+
*
|
|
527
|
+
* @param {string} pairedWith - Token name to resolve.
|
|
528
|
+
* @param {Map<string, string>} tokenMap - Resolved token map for dynamic lookups.
|
|
529
|
+
* @param {Readonly<Record<string, ContextSurface>>} fixedSurfaces - Static surface table.
|
|
530
|
+
* @returns {ContextSurface | undefined} Resolved surface, or undefined if not found.
|
|
531
|
+
*/
|
|
532
|
+
function resolvePairedSurface(pairedWith, tokenMap, fixedSurfaces) {
|
|
533
|
+
const dynamicValue = tokenMap.get(pairedWith);
|
|
534
|
+
if (dynamicValue) {
|
|
535
|
+
const parsed = parseTokenValue(dynamicValue);
|
|
536
|
+
if (parsed) {
|
|
537
|
+
return { rgb: parsed.rgb, a: parsed.a };
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return fixedSurfaces[pairedWith];
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Resolve a paired surface to its rendered foreground RGB when it sits on top of `bg`.
|
|
544
|
+
* For opaque surfaces this is a no-op; for `text-on-action` (α<1) it performs the alpha
|
|
545
|
+
* composite the browser does at paint time, so the contrast ratio we compute matches
|
|
546
|
+
* what axe / Chrome DevTools see.
|
|
547
|
+
*
|
|
548
|
+
* @param {ContextSurface} surface - Surface to resolve.
|
|
549
|
+
* @param {RgbColor} bg - Background color for alpha compositing.
|
|
550
|
+
* @returns {RgbColor} Effective foreground RGB.
|
|
551
|
+
*/
|
|
552
|
+
function effectiveFgRgb(surface, bg) {
|
|
553
|
+
return surface.a < 1 ? alphaComposite(surface.rgb, surface.a, bg) : surface.rgb;
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Return the WCAG AA required contrast ratio for a check type.
|
|
557
|
+
*
|
|
558
|
+
* @param {TokenCheckConfig['type']} type - Check type.
|
|
559
|
+
* @returns {number} Required contrast ratio.
|
|
560
|
+
*/
|
|
561
|
+
function requiredRatioFor(type) {
|
|
562
|
+
return type === 'non-text-contrast' ? WCAG_AA_NON_TEXT_CONTRAST : WCAG_AA_NORMAL_TEXT;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Compute the contrast ratio + rendered colors for a single token check under a given
|
|
566
|
+
* `actionColor`. Returns null when the token has no override value, the value can't be
|
|
567
|
+
* parsed, or the paired surface fails to resolve (catalogue typo).
|
|
568
|
+
*
|
|
569
|
+
* @param {TokenCheckConfig} checkConfig - Token check configuration.
|
|
570
|
+
* @param {Map<string, string>} tokenMap - Resolved token map for surface lookups.
|
|
571
|
+
* @param {Readonly<Record<string, ContextSurface>>} fixedSurfaces - Static surface table.
|
|
572
|
+
* @returns {ContrastResult | null} Contrast result or null.
|
|
573
|
+
*/
|
|
574
|
+
function computeTokenContrast(checkConfig, tokenMap, fixedSurfaces) {
|
|
575
|
+
const tokenValue = tokenMap.get(checkConfig.tokenName);
|
|
576
|
+
if (!tokenValue) {
|
|
577
|
+
return null;
|
|
578
|
+
}
|
|
579
|
+
const parsed = parseTokenValue(tokenValue);
|
|
580
|
+
if (!parsed) {
|
|
581
|
+
return null;
|
|
582
|
+
}
|
|
583
|
+
const paired = resolvePairedSurface(checkConfig.pairedWith, tokenMap, fixedSurfaces);
|
|
584
|
+
if (!paired) {
|
|
585
|
+
return null;
|
|
586
|
+
}
|
|
587
|
+
const compositedOn = checkConfig.compositedOn
|
|
588
|
+
? resolvePairedSurface(checkConfig.compositedOn, tokenMap, fixedSurfaces)
|
|
589
|
+
: undefined;
|
|
590
|
+
const strategy = STRATEGY_MAP[checkConfig.type];
|
|
591
|
+
const { fg, bg } = strategy.computeFgBg(parsed, paired, compositedOn);
|
|
592
|
+
const contrastRatio = Math.round(getContrastRatio(fg, bg) * 100) / 100;
|
|
593
|
+
return { fg, bg, contrastRatio };
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Search engine for finding perceptually-closest feasible colors in OKLCH space and
|
|
598
|
+
* resolving minimum-alpha / RGB-shift fixes for WCAG contrast requirements.
|
|
599
|
+
*
|
|
600
|
+
* The constructor takes the static `fixedSurfaces` table and the `bg-primary` RGB used
|
|
601
|
+
* as the underlying composite surface for semi-transparent paint. Both come from the
|
|
602
|
+
* design-token map supplied by the consumer.
|
|
603
|
+
*/
|
|
604
|
+
class ColorSearchEngine {
|
|
605
|
+
constructor(fixedSurfaces) {
|
|
606
|
+
this.fixedSurfaces = fixedSurfaces;
|
|
607
|
+
const bgPrimary = fixedSurfaces['bg-primary'];
|
|
608
|
+
if (!bgPrimary) {
|
|
609
|
+
throw new Error('ColorSearchEngine: fixedSurfaces is missing required key "bg-primary".');
|
|
610
|
+
}
|
|
611
|
+
this.lightBgPrimary = bgPrimary.rgb;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Find the closest feasible color (by OKLab ΔE) within a (hue ± 5°, chroma × 0.6–1.4) grid.
|
|
615
|
+
*
|
|
616
|
+
* @param {RgbColor} origin - Starting RGB color to search from.
|
|
617
|
+
* @param {Function} isFeasible - Predicate returning true if a candidate RGB meets constraints.
|
|
618
|
+
* @param {boolean} assumeMonotone - `true`: binary search on L (fast, monotone predicate required);
|
|
619
|
+
* `false`: linear scan on L (handles internal-band feasibility).
|
|
620
|
+
* @returns {RgbColor | undefined} Closest feasible RGB, or `undefined` if none found in envelope.
|
|
621
|
+
*/
|
|
622
|
+
searchClosestFeasibleInOklch(origin, isFeasible, assumeMonotone = true) {
|
|
623
|
+
const originalLab = rgbToOklab(origin);
|
|
624
|
+
const { L: L0, C: C0, h: H0 } = oklabToOklch(originalLab);
|
|
625
|
+
/**
|
|
626
|
+
* Try a candidate OKLCH point and return its RGB + perceptual distance if feasible.
|
|
627
|
+
*
|
|
628
|
+
* @param {OklchColor} lch - Candidate OKLCH color.
|
|
629
|
+
* @returns {{ rgb: RgbColor; deltaE: number } | undefined} Result or undefined.
|
|
630
|
+
*/
|
|
631
|
+
const tryCandidate = (lch) => {
|
|
632
|
+
const rgb = oklabToRgb(oklchToOklab(lch));
|
|
633
|
+
if (!isFeasible(rgb))
|
|
634
|
+
return undefined;
|
|
635
|
+
return { rgb, deltaE: oklabDeltaE(originalLab, rgbToOklab(rgb)) };
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* Binary search on L axis from both endpoints inward (monotone assumption).
|
|
639
|
+
*
|
|
640
|
+
* @param {number} C - Chroma value.
|
|
641
|
+
* @param {number} h - Hue angle in degrees.
|
|
642
|
+
* @returns {{ rgb: RgbColor; deltaE: number } | undefined} Best candidate or undefined.
|
|
643
|
+
*/
|
|
644
|
+
const searchLAxisMonotone = (C, h) => {
|
|
645
|
+
const atL0 = tryCandidate({ L: L0, C, h });
|
|
646
|
+
if (atL0)
|
|
647
|
+
return atL0;
|
|
648
|
+
let best;
|
|
649
|
+
// Search darker direction: [0, L₀]
|
|
650
|
+
const darkEnd = tryCandidate({ L: 0, C, h });
|
|
651
|
+
if (darkEnd) {
|
|
652
|
+
best = darkEnd;
|
|
653
|
+
let lo = 0;
|
|
654
|
+
let hi = L0;
|
|
655
|
+
for (let i = 0; i < ColorSearchEngine.SUGGESTION_SEARCH_ITERATIONS; i++) {
|
|
656
|
+
const mid = (lo + hi) / 2;
|
|
657
|
+
const midResult = tryCandidate({
|
|
658
|
+
L: mid,
|
|
659
|
+
C,
|
|
660
|
+
h,
|
|
661
|
+
});
|
|
662
|
+
if (midResult) {
|
|
663
|
+
lo = mid;
|
|
664
|
+
best = midResult;
|
|
665
|
+
}
|
|
666
|
+
else {
|
|
667
|
+
hi = mid;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
// Search lighter direction: [L₀, 1]
|
|
672
|
+
const lightEnd = tryCandidate({ L: 1, C, h });
|
|
673
|
+
if (lightEnd) {
|
|
674
|
+
let lightBest = lightEnd;
|
|
675
|
+
let lo = L0;
|
|
676
|
+
let hi = 1;
|
|
677
|
+
for (let i = 0; i < ColorSearchEngine.SUGGESTION_SEARCH_ITERATIONS; i++) {
|
|
678
|
+
const mid = (lo + hi) / 2;
|
|
679
|
+
const midResult = tryCandidate({
|
|
680
|
+
L: mid,
|
|
681
|
+
C,
|
|
682
|
+
h,
|
|
683
|
+
});
|
|
684
|
+
if (midResult) {
|
|
685
|
+
hi = mid;
|
|
686
|
+
lightBest = midResult;
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
lo = mid;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
if (!best || lightBest.deltaE < best.deltaE) {
|
|
693
|
+
best = lightBest;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
return best;
|
|
697
|
+
};
|
|
698
|
+
/**
|
|
699
|
+
* Linear scan on L ∈ [0,1]; handles non-monotone feasibility regions.
|
|
700
|
+
*
|
|
701
|
+
* @param {number} C - Chroma value.
|
|
702
|
+
* @param {number} h - Hue angle in degrees.
|
|
703
|
+
* @returns {{ rgb: RgbColor; deltaE: number } | undefined} Best candidate or undefined.
|
|
704
|
+
*/
|
|
705
|
+
const searchLAxisLinear = (C, h) => {
|
|
706
|
+
let best;
|
|
707
|
+
for (let i = 0; i <= ColorSearchEngine.L_SCAN_STEPS; i++) {
|
|
708
|
+
const L = i / ColorSearchEngine.L_SCAN_STEPS;
|
|
709
|
+
const result = tryCandidate({ L, C, h });
|
|
710
|
+
if (result && (!best || result.deltaE < best.deltaE)) {
|
|
711
|
+
best = result;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
return best;
|
|
715
|
+
};
|
|
716
|
+
const searchLAxis = assumeMonotone ? searchLAxisMonotone : searchLAxisLinear;
|
|
717
|
+
let bestRgb;
|
|
718
|
+
let bestDeltaE = Infinity;
|
|
719
|
+
/**
|
|
720
|
+
* Update best candidate if the new one has a smaller perceptual distance.
|
|
721
|
+
*
|
|
722
|
+
* @param {{ rgb: RgbColor; deltaE: number } | undefined} candidate - Candidate to consider.
|
|
723
|
+
*/
|
|
724
|
+
const consider = (candidate) => {
|
|
725
|
+
if (candidate && candidate.deltaE < bestDeltaE) {
|
|
726
|
+
bestDeltaE = candidate.deltaE;
|
|
727
|
+
bestRgb = candidate.rgb;
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
if (C0 < ColorSearchEngine.ACHROMATIC_CHROMA_EPSILON) {
|
|
731
|
+
consider(searchLAxis(0, 0));
|
|
732
|
+
return bestRgb;
|
|
733
|
+
}
|
|
734
|
+
for (const hueOffset of ColorSearchEngine.SUGGESTION_HUE_OFFSETS_DEG) {
|
|
735
|
+
const h = H0 + hueOffset;
|
|
736
|
+
for (const cScale of ColorSearchEngine.SUGGESTION_CHROMA_SCALES) {
|
|
737
|
+
const C = Math.max(0, C0 * cScale);
|
|
738
|
+
consider(searchLAxis(C, h));
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
return bestRgb;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Binary-search for the minimum alpha that makes composite contrast ≥ threshold.
|
|
745
|
+
* Result is ceil-rounded to 2 decimals. Returns `undefined` if α=1.0 still fails.
|
|
746
|
+
*
|
|
747
|
+
* @param {RgbColor} rgb - Token's base RGB color.
|
|
748
|
+
* @param {number} currentAlpha - Current alpha (lower bound for search).
|
|
749
|
+
* @param {TokenCheckConfig} checkConfig - Token check configuration (pairing, type, compositedOn).
|
|
750
|
+
* @param {number} threshold - Required WCAG contrast ratio.
|
|
751
|
+
* @param {Map<string, string>} tokenMap - Resolved token map for surface lookups.
|
|
752
|
+
* @returns {number | undefined} Minimum alpha (ceil-rounded), or `undefined` if infeasible.
|
|
753
|
+
*/
|
|
754
|
+
findMinimumAlphaForContrast(rgb, currentAlpha, checkConfig, threshold, tokenMap) {
|
|
755
|
+
const paired = resolvePairedSurface(checkConfig.pairedWith, tokenMap, this.fixedSurfaces);
|
|
756
|
+
if (!paired) {
|
|
757
|
+
return undefined;
|
|
758
|
+
}
|
|
759
|
+
const lightBgPrimary = this.lightBgPrimary;
|
|
760
|
+
const fixedSurfaces = this.fixedSurfaces;
|
|
761
|
+
/**
|
|
762
|
+
* Compute contrast at a given alpha for binary search.
|
|
763
|
+
*
|
|
764
|
+
* @param {number} alpha - Alpha value to test.
|
|
765
|
+
* @returns {number} WCAG contrast ratio at the given alpha.
|
|
766
|
+
*/
|
|
767
|
+
const contrastAt = (alpha) => {
|
|
768
|
+
if (checkConfig.type === 'bg-text') {
|
|
769
|
+
const bg = alpha < 1 ? alphaComposite(rgb, alpha, lightBgPrimary) : rgb;
|
|
770
|
+
return getContrastRatio(effectiveFgRgb(paired, bg), bg);
|
|
771
|
+
}
|
|
772
|
+
// Composite paired surface onto bg-primary if semi-transparent.
|
|
773
|
+
const pairedBg = paired.a < 1 ? alphaComposite(paired.rgb, paired.a, lightBgPrimary) : paired.rgb;
|
|
774
|
+
// compositedOn: fg composites onto a different surface, contrast still vs pairedBg.
|
|
775
|
+
let compositeSurface = pairedBg;
|
|
776
|
+
if (checkConfig.compositedOn) {
|
|
777
|
+
const overrideSurface = resolvePairedSurface(checkConfig.compositedOn, tokenMap, fixedSurfaces);
|
|
778
|
+
if (overrideSurface) {
|
|
779
|
+
compositeSurface =
|
|
780
|
+
overrideSurface.a < 1
|
|
781
|
+
? alphaComposite(overrideSurface.rgb, overrideSurface.a, lightBgPrimary)
|
|
782
|
+
: overrideSurface.rgb;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
const fg = alpha < 1 ? alphaComposite(rgb, alpha, compositeSurface) : rgb;
|
|
786
|
+
return getContrastRatio(fg, pairedBg);
|
|
787
|
+
};
|
|
788
|
+
if (contrastAt(1) < threshold) {
|
|
789
|
+
return undefined;
|
|
790
|
+
}
|
|
791
|
+
let lo = currentAlpha;
|
|
792
|
+
let hi = 1;
|
|
793
|
+
for (let i = 0; i < ColorSearchEngine.ALPHA_ASCENT_ITERATIONS; i++) {
|
|
794
|
+
const mid = (lo + hi) / 2;
|
|
795
|
+
if (contrastAt(mid) >= threshold) {
|
|
796
|
+
hi = mid;
|
|
797
|
+
}
|
|
798
|
+
else {
|
|
799
|
+
lo = mid;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
return Math.min(1, Math.ceil(hi * 100) / 100);
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Find the closest opaque RGB (by OKLab ΔE) satisfying WCAG threshold against all configs.
|
|
806
|
+
*
|
|
807
|
+
* @param {RgbColor} originalRgb - Starting RGB color.
|
|
808
|
+
* @param {TokenCheckConfig[]} configs - Token check configs (one per paired surface).
|
|
809
|
+
* @param {Map<string, string>} tokenMap - Resolved token map for surface lookups.
|
|
810
|
+
* @returns {RgbColor | undefined} Closest feasible RGB, or `undefined` if none found.
|
|
811
|
+
*/
|
|
812
|
+
findRgbPatchForContrastAll(originalRgb, configs, tokenMap) {
|
|
813
|
+
// Pre-resolve surfaces for the feasibility predicate.
|
|
814
|
+
const surfaces = [];
|
|
815
|
+
for (const config of configs) {
|
|
816
|
+
const paired = resolvePairedSurface(config.pairedWith, tokenMap, this.fixedSurfaces);
|
|
817
|
+
if (!paired)
|
|
818
|
+
continue;
|
|
819
|
+
const pairedBg = paired.a < 1 ? alphaComposite(paired.rgb, paired.a, this.lightBgPrimary) : paired.rgb;
|
|
820
|
+
surfaces.push({ bg: pairedBg, threshold: requiredRatioFor(config.type), type: config.type, paired });
|
|
821
|
+
}
|
|
822
|
+
if (surfaces.length === 0) {
|
|
823
|
+
return undefined;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Check if a candidate RGB satisfies all surface constraints.
|
|
827
|
+
*
|
|
828
|
+
* @param {RgbColor} rgb - Candidate RGB color.
|
|
829
|
+
* @returns {boolean} True if all constraints are satisfied.
|
|
830
|
+
*/
|
|
831
|
+
const isFeasible = (rgb) => surfaces.every((s) => s.type === 'bg-text'
|
|
832
|
+
? getContrastRatio(effectiveFgRgb(s.paired, rgb), rgb) >= s.threshold
|
|
833
|
+
: getContrastRatio(rgb, s.bg) >= s.threshold);
|
|
834
|
+
return this.searchClosestFeasibleInOklch(originalRgb, isFeasible, false);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
/** Binary-search iterations on L axis; 10 → ~0.001 precision. */
|
|
838
|
+
ColorSearchEngine.SUGGESTION_SEARCH_ITERATIONS = 10;
|
|
839
|
+
/** Hue offsets (degrees) sampled during search; ±5° preserves brand hue family. */
|
|
840
|
+
ColorSearchEngine.SUGGESTION_HUE_OFFSETS_DEG = [-5, -2.5, 0, 2.5, 5];
|
|
841
|
+
/** Chroma multipliers sampled during search; allows modest saturation drift. */
|
|
842
|
+
ColorSearchEngine.SUGGESTION_CHROMA_SCALES = [0.6, 0.8, 1.0, 1.2, 1.4];
|
|
843
|
+
/** Chroma below which the origin is treated as achromatic (hue/chroma grid skipped). */
|
|
844
|
+
ColorSearchEngine.ACHROMATIC_CHROMA_EPSILON = 0.001;
|
|
845
|
+
/** Uniform L-axis steps for linear scan; 100 → 0.01 precision, enough for narrow bands. */
|
|
846
|
+
ColorSearchEngine.L_SCAN_STEPS = 100;
|
|
847
|
+
/** 2⁻⁷ ≈ 0.008 precision; matches 2-decimal output rounding. */
|
|
848
|
+
ColorSearchEngine.ALPHA_ASCENT_ITERATIONS = 7;
|
|
849
|
+
|
|
850
|
+
// ╔════════════════════════════════════════════════════════════════════════════╗
|
|
851
|
+
// ║ AUTO-GENERATED FILE — DO NOT EDIT BY HAND. ║
|
|
852
|
+
// ║ Source: vega-color-token-contrast-checker/src/generator/ ║
|
|
853
|
+
// ║ Run `yarn prepare:a11y-checks` to regenerate. ║
|
|
854
|
+
// ╚════════════════════════════════════════════════════════════════════════════╝
|
|
855
|
+
const ACTION_COLOR_CHECKS = [
|
|
856
|
+
// consumed by: vega-progress-tracker, vega-time-picker
|
|
857
|
+
{
|
|
858
|
+
tokenName: 'bg-action',
|
|
859
|
+
pairedWith: 'text-inverted-primary',
|
|
860
|
+
type: 'bg-text',
|
|
861
|
+
},
|
|
862
|
+
// consumed by: vega-button, vega-button-circle, vega-calendar, vega-carousel, vega-checkbox, vega-counter-badge, vega-date-picker, vega-progress-tracker, vega-radio, vega-toggle-switch
|
|
863
|
+
{
|
|
864
|
+
tokenName: 'bg-action',
|
|
865
|
+
pairedWith: 'text-on-action',
|
|
866
|
+
type: 'bg-text',
|
|
867
|
+
},
|
|
868
|
+
// consumed by: vega-progress-tracker
|
|
869
|
+
{
|
|
870
|
+
tokenName: 'bg-action-active',
|
|
871
|
+
pairedWith: 'text-inverted-primary',
|
|
872
|
+
type: 'bg-text',
|
|
873
|
+
},
|
|
874
|
+
// consumed by: vega-button, vega-button-circle, vega-calendar, vega-checkbox, vega-date-picker, vega-radio
|
|
875
|
+
{
|
|
876
|
+
tokenName: 'bg-action-active',
|
|
877
|
+
pairedWith: 'text-on-action',
|
|
878
|
+
type: 'bg-text',
|
|
879
|
+
},
|
|
880
|
+
// consumed by: vega-date-picker
|
|
881
|
+
{
|
|
882
|
+
tokenName: 'bg-action-focus',
|
|
883
|
+
pairedWith: 'text-on-action',
|
|
884
|
+
type: 'bg-text',
|
|
885
|
+
},
|
|
886
|
+
// consumed by: vega-progress-tracker
|
|
887
|
+
{
|
|
888
|
+
tokenName: 'bg-action-hover',
|
|
889
|
+
pairedWith: 'text-inverted-primary',
|
|
890
|
+
type: 'bg-text',
|
|
891
|
+
},
|
|
892
|
+
// consumed by: vega-button, vega-button-circle, vega-calendar, vega-checkbox, vega-date-picker, vega-radio, vega-toggle-switch
|
|
893
|
+
{
|
|
894
|
+
tokenName: 'bg-action-hover',
|
|
895
|
+
pairedWith: 'text-on-action',
|
|
896
|
+
type: 'bg-text',
|
|
897
|
+
},
|
|
898
|
+
// consumed by: vega-button, vega-button-circle, vega-button-link
|
|
899
|
+
{
|
|
900
|
+
tokenName: 'bg-action-secondary-active',
|
|
901
|
+
pairedWith: 'text-link-active',
|
|
902
|
+
type: 'bg-text',
|
|
903
|
+
},
|
|
904
|
+
// consumed by: vega-calendar
|
|
905
|
+
{
|
|
906
|
+
tokenName: 'bg-action-secondary-active',
|
|
907
|
+
pairedWith: 'text-primary',
|
|
908
|
+
type: 'bg-text',
|
|
909
|
+
},
|
|
910
|
+
// consumed by: vega-calendar
|
|
911
|
+
{
|
|
912
|
+
tokenName: 'bg-action-secondary-active',
|
|
913
|
+
pairedWith: 'text-secondary',
|
|
914
|
+
type: 'bg-text',
|
|
915
|
+
},
|
|
916
|
+
// consumed by: vega-button, vega-button-circle, vega-button-link
|
|
917
|
+
{
|
|
918
|
+
tokenName: 'bg-action-secondary-hover',
|
|
919
|
+
pairedWith: 'text-link-hover',
|
|
920
|
+
type: 'bg-text',
|
|
921
|
+
},
|
|
922
|
+
// consumed by: vega-calendar
|
|
923
|
+
{
|
|
924
|
+
tokenName: 'bg-action-secondary-hover',
|
|
925
|
+
pairedWith: 'text-primary',
|
|
926
|
+
type: 'bg-text',
|
|
927
|
+
},
|
|
928
|
+
// consumed by: vega-calendar
|
|
929
|
+
{
|
|
930
|
+
tokenName: 'bg-action-secondary-hover',
|
|
931
|
+
pairedWith: 'text-secondary',
|
|
932
|
+
type: 'bg-text',
|
|
933
|
+
},
|
|
934
|
+
// consumed by: vega-date-picker
|
|
935
|
+
{
|
|
936
|
+
tokenName: 'bg-date-picker-range',
|
|
937
|
+
pairedWith: 'text-primary',
|
|
938
|
+
type: 'bg-text',
|
|
939
|
+
},
|
|
940
|
+
// consumed by: vega-nav
|
|
941
|
+
{
|
|
942
|
+
tokenName: 'bg-selected',
|
|
943
|
+
pairedWith: 'text-primary',
|
|
944
|
+
type: 'bg-text',
|
|
945
|
+
},
|
|
946
|
+
// consumed by: vega-table
|
|
947
|
+
{
|
|
948
|
+
tokenName: 'bg-table-selected-row',
|
|
949
|
+
pairedWith: 'text-primary',
|
|
950
|
+
type: 'bg-text',
|
|
951
|
+
},
|
|
952
|
+
// consumed by: vega-app-footer, vega-date-picker, vega-divider, vega-dropdown, vega-nav, vega-tab-group, vega-table, vega-time-picker
|
|
953
|
+
{
|
|
954
|
+
tokenName: 'bg-divider',
|
|
955
|
+
pairedWith: 'bg-primary',
|
|
956
|
+
type: 'non-text-contrast',
|
|
957
|
+
},
|
|
958
|
+
// consumed by: vega-button, vega-button-circle
|
|
959
|
+
{
|
|
960
|
+
tokenName: 'border-color-action',
|
|
961
|
+
pairedWith: 'bg-action-secondary',
|
|
962
|
+
type: 'non-text-contrast',
|
|
963
|
+
},
|
|
964
|
+
// consumed by: vega-button, vega-button-circle, vega-calendar
|
|
965
|
+
{
|
|
966
|
+
tokenName: 'border-color-action',
|
|
967
|
+
pairedWith: 'bg-action-secondary-active',
|
|
968
|
+
type: 'non-text-contrast',
|
|
969
|
+
},
|
|
970
|
+
// consumed by: vega-button, vega-button-circle, vega-calendar
|
|
971
|
+
{
|
|
972
|
+
tokenName: 'border-color-action',
|
|
973
|
+
pairedWith: 'bg-action-secondary-hover',
|
|
974
|
+
type: 'non-text-contrast',
|
|
975
|
+
},
|
|
976
|
+
// consumed by: vega-progress-tracker
|
|
977
|
+
{
|
|
978
|
+
tokenName: 'border-color-action',
|
|
979
|
+
pairedWith: 'bg-action-tertiary',
|
|
980
|
+
type: 'non-text-contrast',
|
|
981
|
+
},
|
|
982
|
+
// consumed by: vega-button-circle
|
|
983
|
+
{
|
|
984
|
+
tokenName: 'border-color-action',
|
|
985
|
+
pairedWith: 'bg-action-tertiary-active',
|
|
986
|
+
type: 'non-text-contrast',
|
|
987
|
+
},
|
|
988
|
+
// consumed by: vega-button-circle
|
|
989
|
+
{
|
|
990
|
+
tokenName: 'border-color-action',
|
|
991
|
+
pairedWith: 'bg-action-tertiary-hover',
|
|
992
|
+
type: 'non-text-contrast',
|
|
993
|
+
},
|
|
994
|
+
// consumed by: vega-chip
|
|
995
|
+
{
|
|
996
|
+
tokenName: 'border-color-action',
|
|
997
|
+
pairedWith: 'bg-chip-active',
|
|
998
|
+
type: 'non-text-contrast',
|
|
999
|
+
},
|
|
1000
|
+
// consumed by: vega-chip
|
|
1001
|
+
{
|
|
1002
|
+
tokenName: 'border-color-action',
|
|
1003
|
+
pairedWith: 'bg-chip-hover',
|
|
1004
|
+
type: 'non-text-contrast',
|
|
1005
|
+
},
|
|
1006
|
+
// consumed by: vega-app-footer, vega-app-header-button, vega-button, vega-button-circle, vega-button-group, vega-button-link, vega-calendar, vega-carousel, vega-checkbox, vega-chip, vega-code-block, vega-color-picker, vega-color-swatch, vega-combo-box, vega-date-picker, vega-dropdown, vega-file-uploader, vega-image-uploader, vega-input, vega-input-range, vega-input-select, vega-nav, vega-pagination, vega-progress-tracker, vega-radio, vega-rich-text-content, vega-rich-text-editor, vega-segment-control, vega-selection-chip, vega-selection-tile, vega-signature-capture, vega-tab-group, vega-textarea, vega-time-picker, vega-toggle-switch
|
|
1007
|
+
{
|
|
1008
|
+
tokenName: 'border-color-action',
|
|
1009
|
+
pairedWith: 'bg-primary',
|
|
1010
|
+
type: 'non-text-contrast',
|
|
1011
|
+
},
|
|
1012
|
+
// consumed by: vega-app-header-button, vega-carousel, vega-rich-text-editor
|
|
1013
|
+
{
|
|
1014
|
+
tokenName: 'border-color-action',
|
|
1015
|
+
pairedWith: 'bg-quaternary',
|
|
1016
|
+
type: 'non-text-contrast',
|
|
1017
|
+
},
|
|
1018
|
+
// consumed by: vega-file-uploader, vega-image-uploader
|
|
1019
|
+
{
|
|
1020
|
+
tokenName: 'border-color-action',
|
|
1021
|
+
pairedWith: 'bg-secondary',
|
|
1022
|
+
type: 'non-text-contrast',
|
|
1023
|
+
},
|
|
1024
|
+
// consumed by: vega-segment-control
|
|
1025
|
+
{
|
|
1026
|
+
tokenName: 'border-color-action',
|
|
1027
|
+
pairedWith: 'bg-segment-control',
|
|
1028
|
+
type: 'non-text-contrast',
|
|
1029
|
+
},
|
|
1030
|
+
// consumed by: vega-segment-control
|
|
1031
|
+
{
|
|
1032
|
+
tokenName: 'border-color-action',
|
|
1033
|
+
pairedWith: 'bg-segment-hover',
|
|
1034
|
+
type: 'non-text-contrast',
|
|
1035
|
+
},
|
|
1036
|
+
// consumed by: vega-nav
|
|
1037
|
+
{
|
|
1038
|
+
tokenName: 'border-color-action',
|
|
1039
|
+
pairedWith: 'bg-selected',
|
|
1040
|
+
type: 'non-text-contrast',
|
|
1041
|
+
},
|
|
1042
|
+
// consumed by: vega-app-header-button, vega-image-uploader, vega-nav
|
|
1043
|
+
{
|
|
1044
|
+
tokenName: 'border-color-action',
|
|
1045
|
+
pairedWith: 'bg-tertiary',
|
|
1046
|
+
type: 'non-text-contrast',
|
|
1047
|
+
},
|
|
1048
|
+
// consumed by: vega-selection-chip, vega-selection-tile
|
|
1049
|
+
{
|
|
1050
|
+
tokenName: 'border-color-action',
|
|
1051
|
+
pairedWith: 'bg-tile',
|
|
1052
|
+
type: 'non-text-contrast',
|
|
1053
|
+
},
|
|
1054
|
+
// consumed by: vega-selection-chip, vega-selection-tile
|
|
1055
|
+
{
|
|
1056
|
+
tokenName: 'border-color-action',
|
|
1057
|
+
pairedWith: 'bg-tile-selected',
|
|
1058
|
+
type: 'non-text-contrast',
|
|
1059
|
+
},
|
|
1060
|
+
// consumed by: vega-toggle-switch
|
|
1061
|
+
{
|
|
1062
|
+
tokenName: 'border-color-action',
|
|
1063
|
+
pairedWith: 'bg-toggle-switch',
|
|
1064
|
+
type: 'non-text-contrast',
|
|
1065
|
+
},
|
|
1066
|
+
// consumed by: vega-toggle-switch
|
|
1067
|
+
{
|
|
1068
|
+
tokenName: 'border-color-action',
|
|
1069
|
+
pairedWith: 'bg-toggle-switch-hover',
|
|
1070
|
+
type: 'non-text-contrast',
|
|
1071
|
+
},
|
|
1072
|
+
// consumed by: vega-progress-tracker
|
|
1073
|
+
{
|
|
1074
|
+
tokenName: 'border-color-action-active',
|
|
1075
|
+
pairedWith: 'bg-action-tertiary',
|
|
1076
|
+
type: 'non-text-contrast',
|
|
1077
|
+
},
|
|
1078
|
+
// consumed by: vega-checkbox, vega-file-uploader, vega-progress-tracker, vega-radio
|
|
1079
|
+
{
|
|
1080
|
+
tokenName: 'border-color-action-active',
|
|
1081
|
+
pairedWith: 'bg-primary',
|
|
1082
|
+
type: 'non-text-contrast',
|
|
1083
|
+
},
|
|
1084
|
+
// consumed by: vega-file-uploader
|
|
1085
|
+
{
|
|
1086
|
+
tokenName: 'border-color-action-active',
|
|
1087
|
+
pairedWith: 'bg-secondary',
|
|
1088
|
+
type: 'non-text-contrast',
|
|
1089
|
+
},
|
|
1090
|
+
// consumed by: vega-progress-tracker
|
|
1091
|
+
{
|
|
1092
|
+
tokenName: 'border-color-action-hover',
|
|
1093
|
+
pairedWith: 'bg-action-tertiary',
|
|
1094
|
+
type: 'non-text-contrast',
|
|
1095
|
+
},
|
|
1096
|
+
// consumed by: vega-progress-tracker
|
|
1097
|
+
{
|
|
1098
|
+
tokenName: 'border-color-action-hover',
|
|
1099
|
+
pairedWith: 'bg-primary',
|
|
1100
|
+
type: 'non-text-contrast',
|
|
1101
|
+
},
|
|
1102
|
+
// consumed by: vega-calendar, vega-date-picker, vega-table, vega-time-picker
|
|
1103
|
+
{
|
|
1104
|
+
tokenName: 'border-color-divider',
|
|
1105
|
+
pairedWith: 'bg-primary',
|
|
1106
|
+
type: 'non-text-contrast',
|
|
1107
|
+
},
|
|
1108
|
+
// consumed by: vega-table
|
|
1109
|
+
{
|
|
1110
|
+
tokenName: 'border-color-divider',
|
|
1111
|
+
pairedWith: 'bg-quaternary',
|
|
1112
|
+
type: 'non-text-contrast',
|
|
1113
|
+
},
|
|
1114
|
+
// consumed by: vega-table
|
|
1115
|
+
{
|
|
1116
|
+
tokenName: 'border-color-divider',
|
|
1117
|
+
pairedWith: 'bg-secondary',
|
|
1118
|
+
type: 'non-text-contrast',
|
|
1119
|
+
},
|
|
1120
|
+
// consumed by: vega-table
|
|
1121
|
+
{
|
|
1122
|
+
tokenName: 'border-color-divider',
|
|
1123
|
+
pairedWith: 'bg-table-header',
|
|
1124
|
+
type: 'non-text-contrast',
|
|
1125
|
+
},
|
|
1126
|
+
// consumed by: vega-table
|
|
1127
|
+
{
|
|
1128
|
+
tokenName: 'border-color-divider',
|
|
1129
|
+
pairedWith: 'bg-table-selected-row',
|
|
1130
|
+
type: 'non-text-contrast',
|
|
1131
|
+
},
|
|
1132
|
+
// consumed by: vega-button-group
|
|
1133
|
+
{
|
|
1134
|
+
tokenName: 'border-color-divider-secondary',
|
|
1135
|
+
pairedWith: 'bg-primary',
|
|
1136
|
+
type: 'non-text-contrast',
|
|
1137
|
+
},
|
|
1138
|
+
// consumed by: vega-image-uploader, vega-input-range, vega-table
|
|
1139
|
+
{
|
|
1140
|
+
tokenName: 'border-color-input-field',
|
|
1141
|
+
pairedWith: 'bg-primary',
|
|
1142
|
+
type: 'non-text-contrast',
|
|
1143
|
+
},
|
|
1144
|
+
// consumed by: vega-table
|
|
1145
|
+
{
|
|
1146
|
+
tokenName: 'border-color-input-field',
|
|
1147
|
+
pairedWith: 'bg-quaternary',
|
|
1148
|
+
type: 'non-text-contrast',
|
|
1149
|
+
},
|
|
1150
|
+
// consumed by: vega-table
|
|
1151
|
+
{
|
|
1152
|
+
tokenName: 'border-color-input-field',
|
|
1153
|
+
pairedWith: 'bg-secondary',
|
|
1154
|
+
type: 'non-text-contrast',
|
|
1155
|
+
},
|
|
1156
|
+
// consumed by: vega-table
|
|
1157
|
+
{
|
|
1158
|
+
tokenName: 'border-color-input-field',
|
|
1159
|
+
pairedWith: 'bg-table-selected-row',
|
|
1160
|
+
type: 'non-text-contrast',
|
|
1161
|
+
},
|
|
1162
|
+
// consumed by: vega-image-uploader
|
|
1163
|
+
{
|
|
1164
|
+
tokenName: 'border-color-input-field',
|
|
1165
|
+
pairedWith: 'bg-tertiary',
|
|
1166
|
+
type: 'non-text-contrast',
|
|
1167
|
+
},
|
|
1168
|
+
// consumed by: vega-app-header-button, vega-color-picker, vega-date-picker, vega-image-uploader, vega-input, vega-input-range, vega-input-select, vega-rich-text-content, vega-rich-text-editor, vega-signature-capture, vega-textarea, vega-time-picker
|
|
1169
|
+
{
|
|
1170
|
+
tokenName: 'border-color-input-field-focus',
|
|
1171
|
+
pairedWith: 'bg-primary',
|
|
1172
|
+
type: 'non-text-contrast',
|
|
1173
|
+
},
|
|
1174
|
+
// consumed by: vega-app-header-button
|
|
1175
|
+
{
|
|
1176
|
+
tokenName: 'border-color-input-field-focus',
|
|
1177
|
+
pairedWith: 'bg-quaternary',
|
|
1178
|
+
type: 'non-text-contrast',
|
|
1179
|
+
},
|
|
1180
|
+
// consumed by: vega-image-uploader
|
|
1181
|
+
{
|
|
1182
|
+
tokenName: 'border-color-input-field-focus',
|
|
1183
|
+
pairedWith: 'bg-secondary',
|
|
1184
|
+
type: 'non-text-contrast',
|
|
1185
|
+
},
|
|
1186
|
+
// consumed by: vega-image-uploader
|
|
1187
|
+
{
|
|
1188
|
+
tokenName: 'border-color-input-field-focus',
|
|
1189
|
+
pairedWith: 'bg-tertiary',
|
|
1190
|
+
type: 'non-text-contrast',
|
|
1191
|
+
},
|
|
1192
|
+
// consumed by: vega-file-uploader, vega-image-uploader
|
|
1193
|
+
{
|
|
1194
|
+
tokenName: 'border-color-input-field-hover',
|
|
1195
|
+
pairedWith: 'bg-primary',
|
|
1196
|
+
type: 'non-text-contrast',
|
|
1197
|
+
},
|
|
1198
|
+
// consumed by: vega-file-uploader, vega-image-uploader
|
|
1199
|
+
{
|
|
1200
|
+
tokenName: 'border-color-input-field-hover',
|
|
1201
|
+
pairedWith: 'bg-secondary',
|
|
1202
|
+
type: 'non-text-contrast',
|
|
1203
|
+
},
|
|
1204
|
+
// consumed by: vega-rich-text-editor
|
|
1205
|
+
{
|
|
1206
|
+
tokenName: 'border-color-tile-selected',
|
|
1207
|
+
pairedWith: 'bg-primary',
|
|
1208
|
+
type: 'non-text-contrast',
|
|
1209
|
+
},
|
|
1210
|
+
// consumed by: vega-calendar
|
|
1211
|
+
{
|
|
1212
|
+
tokenName: 'border-divider',
|
|
1213
|
+
pairedWith: 'bg-primary',
|
|
1214
|
+
type: 'non-text-contrast',
|
|
1215
|
+
},
|
|
1216
|
+
// consumed by: vega-calendar, vega-card, vega-code-block
|
|
1217
|
+
{
|
|
1218
|
+
tokenName: 'border-divider-secondary',
|
|
1219
|
+
pairedWith: 'bg-primary',
|
|
1220
|
+
type: 'non-text-contrast',
|
|
1221
|
+
},
|
|
1222
|
+
// consumed by: vega-code-block
|
|
1223
|
+
{
|
|
1224
|
+
tokenName: 'border-divider-secondary',
|
|
1225
|
+
pairedWith: 'bg-secondary',
|
|
1226
|
+
type: 'non-text-contrast',
|
|
1227
|
+
},
|
|
1228
|
+
// consumed by: vega-checkbox, vega-color-picker, vega-combo-box, vega-date-picker, vega-dropdown, vega-input, vega-input-range, vega-input-select, vega-popover, vega-radio, vega-rich-text-editor, vega-selection-tile, vega-signature-capture, vega-textarea, vega-time-picker
|
|
1229
|
+
{
|
|
1230
|
+
tokenName: 'border-input-field',
|
|
1231
|
+
pairedWith: 'bg-primary',
|
|
1232
|
+
type: 'non-text-contrast',
|
|
1233
|
+
},
|
|
1234
|
+
// consumed by: vega-selection-tile
|
|
1235
|
+
{
|
|
1236
|
+
tokenName: 'border-input-field',
|
|
1237
|
+
pairedWith: 'bg-tile',
|
|
1238
|
+
type: 'non-text-contrast',
|
|
1239
|
+
},
|
|
1240
|
+
// consumed by: vega-combo-box, vega-rich-text-editor, vega-selection-tile, vega-signature-capture, vega-textarea
|
|
1241
|
+
{
|
|
1242
|
+
tokenName: 'border-input-field-focus',
|
|
1243
|
+
pairedWith: 'bg-primary',
|
|
1244
|
+
type: 'non-text-contrast',
|
|
1245
|
+
},
|
|
1246
|
+
// consumed by: vega-rich-text-editor
|
|
1247
|
+
{
|
|
1248
|
+
tokenName: 'border-input-field-focus',
|
|
1249
|
+
pairedWith: 'bg-quaternary',
|
|
1250
|
+
type: 'non-text-contrast',
|
|
1251
|
+
},
|
|
1252
|
+
// consumed by: vega-selection-tile
|
|
1253
|
+
{
|
|
1254
|
+
tokenName: 'border-input-field-focus',
|
|
1255
|
+
pairedWith: 'bg-tile',
|
|
1256
|
+
type: 'non-text-contrast',
|
|
1257
|
+
},
|
|
1258
|
+
// consumed by: vega-date-picker
|
|
1259
|
+
{
|
|
1260
|
+
tokenName: 'border-input-field-hover',
|
|
1261
|
+
pairedWith: 'bg-date-picker-range',
|
|
1262
|
+
type: 'non-text-contrast',
|
|
1263
|
+
},
|
|
1264
|
+
// consumed by: vega-checkbox, vega-color-swatch, vega-combo-box, vega-date-picker, vega-input, vega-input-range, vega-input-select, vega-radio, vega-rich-text-editor, vega-selection-tile, vega-signature-capture, vega-textarea, vega-time-picker
|
|
1265
|
+
{
|
|
1266
|
+
tokenName: 'border-input-field-hover',
|
|
1267
|
+
pairedWith: 'bg-primary',
|
|
1268
|
+
type: 'non-text-contrast',
|
|
1269
|
+
},
|
|
1270
|
+
// consumed by: vega-rich-text-editor
|
|
1271
|
+
{
|
|
1272
|
+
tokenName: 'border-input-field-hover',
|
|
1273
|
+
pairedWith: 'bg-quaternary',
|
|
1274
|
+
type: 'non-text-contrast',
|
|
1275
|
+
},
|
|
1276
|
+
// consumed by: vega-selection-tile
|
|
1277
|
+
{
|
|
1278
|
+
tokenName: 'border-input-field-hover',
|
|
1279
|
+
pairedWith: 'bg-tile-hover',
|
|
1280
|
+
type: 'non-text-contrast',
|
|
1281
|
+
},
|
|
1282
|
+
// consumed by: vega-button, vega-button-circle, vega-button-link
|
|
1283
|
+
{
|
|
1284
|
+
tokenName: 'border-secondary-btn',
|
|
1285
|
+
pairedWith: 'bg-action-secondary',
|
|
1286
|
+
type: 'non-text-contrast',
|
|
1287
|
+
},
|
|
1288
|
+
// consumed by: vega-button-link
|
|
1289
|
+
{
|
|
1290
|
+
tokenName: 'border-secondary-btn',
|
|
1291
|
+
pairedWith: 'bg-action-secondary-hover',
|
|
1292
|
+
type: 'non-text-contrast',
|
|
1293
|
+
},
|
|
1294
|
+
// consumed by: vega-date-picker
|
|
1295
|
+
{
|
|
1296
|
+
tokenName: 'border-secondary-btn',
|
|
1297
|
+
pairedWith: 'bg-date-picker-range',
|
|
1298
|
+
type: 'non-text-contrast',
|
|
1299
|
+
},
|
|
1300
|
+
// consumed by: vega-button, vega-button-circle, vega-button-link, vega-carousel, vega-date-picker, vega-dropdown
|
|
1301
|
+
{
|
|
1302
|
+
tokenName: 'border-secondary-btn',
|
|
1303
|
+
pairedWith: 'bg-primary',
|
|
1304
|
+
type: 'non-text-contrast',
|
|
1305
|
+
},
|
|
1306
|
+
// consumed by: vega-carousel, vega-dropdown
|
|
1307
|
+
{
|
|
1308
|
+
tokenName: 'border-secondary-btn',
|
|
1309
|
+
pairedWith: 'bg-quaternary',
|
|
1310
|
+
type: 'non-text-contrast',
|
|
1311
|
+
},
|
|
1312
|
+
// consumed by: vega-button, vega-button-circle, vega-button-link
|
|
1313
|
+
{
|
|
1314
|
+
tokenName: 'border-secondary-btn-active',
|
|
1315
|
+
pairedWith: 'bg-action-secondary-active',
|
|
1316
|
+
type: 'non-text-contrast',
|
|
1317
|
+
},
|
|
1318
|
+
// consumed by: vega-button, vega-button-circle, vega-button-link
|
|
1319
|
+
{
|
|
1320
|
+
tokenName: 'border-secondary-btn-active',
|
|
1321
|
+
pairedWith: 'bg-primary',
|
|
1322
|
+
type: 'non-text-contrast',
|
|
1323
|
+
},
|
|
1324
|
+
// consumed by: vega-button, vega-button-circle, vega-button-link
|
|
1325
|
+
{
|
|
1326
|
+
tokenName: 'border-secondary-btn-hover',
|
|
1327
|
+
pairedWith: 'bg-action-secondary-hover',
|
|
1328
|
+
type: 'non-text-contrast',
|
|
1329
|
+
},
|
|
1330
|
+
// consumed by: vega-button, vega-button-circle, vega-button-link, vega-carousel
|
|
1331
|
+
{
|
|
1332
|
+
tokenName: 'border-secondary-btn-hover',
|
|
1333
|
+
pairedWith: 'bg-primary',
|
|
1334
|
+
type: 'non-text-contrast',
|
|
1335
|
+
},
|
|
1336
|
+
// consumed by: vega-carousel
|
|
1337
|
+
{
|
|
1338
|
+
tokenName: 'border-secondary-btn-hover',
|
|
1339
|
+
pairedWith: 'bg-quaternary',
|
|
1340
|
+
type: 'non-text-contrast',
|
|
1341
|
+
},
|
|
1342
|
+
// consumed by: vega-selection-chip
|
|
1343
|
+
{
|
|
1344
|
+
tokenName: 'border-tile-focus',
|
|
1345
|
+
pairedWith: 'bg-primary',
|
|
1346
|
+
type: 'non-text-contrast',
|
|
1347
|
+
},
|
|
1348
|
+
// consumed by: vega-selection-chip
|
|
1349
|
+
{
|
|
1350
|
+
tokenName: 'border-tile-focus',
|
|
1351
|
+
pairedWith: 'bg-tile',
|
|
1352
|
+
type: 'non-text-contrast',
|
|
1353
|
+
},
|
|
1354
|
+
// consumed by: vega-selection-chip, vega-selection-tile
|
|
1355
|
+
{
|
|
1356
|
+
tokenName: 'border-tile-selected',
|
|
1357
|
+
pairedWith: 'bg-primary',
|
|
1358
|
+
type: 'non-text-contrast',
|
|
1359
|
+
},
|
|
1360
|
+
// consumed by: vega-selection-chip, vega-selection-tile
|
|
1361
|
+
{
|
|
1362
|
+
tokenName: 'border-tile-selected',
|
|
1363
|
+
pairedWith: 'bg-tile-selected',
|
|
1364
|
+
type: 'non-text-contrast',
|
|
1365
|
+
},
|
|
1366
|
+
// consumed by: vega-selection-chip
|
|
1367
|
+
{
|
|
1368
|
+
tokenName: 'border-tile-selected-focus',
|
|
1369
|
+
pairedWith: 'bg-primary',
|
|
1370
|
+
type: 'non-text-contrast',
|
|
1371
|
+
},
|
|
1372
|
+
// consumed by: vega-selection-chip
|
|
1373
|
+
{
|
|
1374
|
+
tokenName: 'border-tile-selected-focus',
|
|
1375
|
+
pairedWith: 'bg-tile-selected',
|
|
1376
|
+
type: 'non-text-contrast',
|
|
1377
|
+
},
|
|
1378
|
+
// consumed by: vega-selection-chip, vega-selection-tile
|
|
1379
|
+
{
|
|
1380
|
+
tokenName: 'border-tile-selected-hover',
|
|
1381
|
+
pairedWith: 'bg-primary',
|
|
1382
|
+
type: 'non-text-contrast',
|
|
1383
|
+
},
|
|
1384
|
+
// consumed by: vega-selection-chip, vega-selection-tile
|
|
1385
|
+
{
|
|
1386
|
+
tokenName: 'border-tile-selected-hover',
|
|
1387
|
+
pairedWith: 'bg-tile-selected-hover',
|
|
1388
|
+
type: 'non-text-contrast',
|
|
1389
|
+
},
|
|
1390
|
+
// consumed by: vega-progress-tracker
|
|
1391
|
+
{
|
|
1392
|
+
tokenName: 'ring-input-focus',
|
|
1393
|
+
pairedWith: 'bg-action',
|
|
1394
|
+
type: 'non-text-contrast',
|
|
1395
|
+
compositedOn: 'bg-primary',
|
|
1396
|
+
},
|
|
1397
|
+
// consumed by: vega-color-picker, vega-progress-tracker
|
|
1398
|
+
{
|
|
1399
|
+
tokenName: 'ring-input-focus',
|
|
1400
|
+
pairedWith: 'bg-primary',
|
|
1401
|
+
type: 'non-text-contrast',
|
|
1402
|
+
},
|
|
1403
|
+
// consumed by: vega-button, vega-button-circle, vega-button-link
|
|
1404
|
+
{
|
|
1405
|
+
tokenName: 'text-link',
|
|
1406
|
+
pairedWith: 'bg-action-secondary',
|
|
1407
|
+
type: 'text-bg',
|
|
1408
|
+
},
|
|
1409
|
+
// consumed by: vega-progress-tracker
|
|
1410
|
+
{
|
|
1411
|
+
tokenName: 'text-link',
|
|
1412
|
+
pairedWith: 'bg-action-tertiary',
|
|
1413
|
+
type: 'text-bg',
|
|
1414
|
+
},
|
|
1415
|
+
// consumed by: vega-app-footer, vega-breadcrumb, vega-button-group, vega-button-link, vega-calendar, vega-date-picker, vega-dropdown, vega-input-select, vega-item-toggle, vega-pagination, vega-rich-text-content, vega-tab-group
|
|
1416
|
+
{
|
|
1417
|
+
tokenName: 'text-link',
|
|
1418
|
+
pairedWith: 'bg-primary',
|
|
1419
|
+
type: 'text-bg',
|
|
1420
|
+
},
|
|
1421
|
+
// consumed by: vega-app-header-button, vega-dropdown
|
|
1422
|
+
{
|
|
1423
|
+
tokenName: 'text-link',
|
|
1424
|
+
pairedWith: 'bg-quaternary',
|
|
1425
|
+
type: 'text-bg',
|
|
1426
|
+
},
|
|
1427
|
+
// consumed by: vega-image-uploader
|
|
1428
|
+
{
|
|
1429
|
+
tokenName: 'text-link',
|
|
1430
|
+
pairedWith: 'bg-secondary',
|
|
1431
|
+
type: 'text-bg',
|
|
1432
|
+
},
|
|
1433
|
+
// consumed by: vega-image-uploader
|
|
1434
|
+
{
|
|
1435
|
+
tokenName: 'text-link',
|
|
1436
|
+
pairedWith: 'bg-tertiary',
|
|
1437
|
+
type: 'text-bg',
|
|
1438
|
+
},
|
|
1439
|
+
// consumed by: vega-progress-tracker
|
|
1440
|
+
{
|
|
1441
|
+
tokenName: 'text-link-active',
|
|
1442
|
+
pairedWith: 'bg-action-tertiary',
|
|
1443
|
+
type: 'text-bg',
|
|
1444
|
+
},
|
|
1445
|
+
// consumed by: vega-app-footer, vega-button-link, vega-rich-text-content
|
|
1446
|
+
{
|
|
1447
|
+
tokenName: 'text-link-active',
|
|
1448
|
+
pairedWith: 'bg-primary',
|
|
1449
|
+
type: 'text-bg',
|
|
1450
|
+
},
|
|
1451
|
+
// consumed by: vega-app-header-button
|
|
1452
|
+
{
|
|
1453
|
+
tokenName: 'text-link-active',
|
|
1454
|
+
pairedWith: 'bg-quaternary',
|
|
1455
|
+
type: 'text-bg',
|
|
1456
|
+
},
|
|
1457
|
+
// consumed by: vega-file-uploader
|
|
1458
|
+
{
|
|
1459
|
+
tokenName: 'text-link-active',
|
|
1460
|
+
pairedWith: 'bg-secondary',
|
|
1461
|
+
type: 'text-bg',
|
|
1462
|
+
},
|
|
1463
|
+
// consumed by: vega-app-footer, vega-button-link, vega-rich-text-content
|
|
1464
|
+
{
|
|
1465
|
+
tokenName: 'text-link-focus',
|
|
1466
|
+
pairedWith: 'bg-primary',
|
|
1467
|
+
type: 'text-bg',
|
|
1468
|
+
},
|
|
1469
|
+
// consumed by: vega-progress-tracker
|
|
1470
|
+
{
|
|
1471
|
+
tokenName: 'text-link-hover',
|
|
1472
|
+
pairedWith: 'bg-action-tertiary',
|
|
1473
|
+
type: 'text-bg',
|
|
1474
|
+
},
|
|
1475
|
+
// consumed by: vega-app-footer, vega-button-link, vega-dropdown, vega-item-toggle, vega-rich-text-content
|
|
1476
|
+
{
|
|
1477
|
+
tokenName: 'text-link-hover',
|
|
1478
|
+
pairedWith: 'bg-primary',
|
|
1479
|
+
type: 'text-bg',
|
|
1480
|
+
},
|
|
1481
|
+
// consumed by: vega-app-header-button, vega-dropdown
|
|
1482
|
+
{
|
|
1483
|
+
tokenName: 'text-link-hover',
|
|
1484
|
+
pairedWith: 'bg-quaternary',
|
|
1485
|
+
type: 'text-bg',
|
|
1486
|
+
},
|
|
1487
|
+
// consumed by: vega-file-uploader, vega-image-uploader
|
|
1488
|
+
{
|
|
1489
|
+
tokenName: 'text-link-hover',
|
|
1490
|
+
pairedWith: 'bg-secondary',
|
|
1491
|
+
type: 'text-bg',
|
|
1492
|
+
},
|
|
1493
|
+
// consumed by: vega-button-link
|
|
1494
|
+
{
|
|
1495
|
+
tokenName: 'text-link-visited',
|
|
1496
|
+
pairedWith: 'bg-action-secondary',
|
|
1497
|
+
type: 'text-bg',
|
|
1498
|
+
},
|
|
1499
|
+
// consumed by: vega-app-footer, vega-button-link, vega-chip, vega-rich-text-content
|
|
1500
|
+
{
|
|
1501
|
+
tokenName: 'text-link-visited',
|
|
1502
|
+
pairedWith: 'bg-primary',
|
|
1503
|
+
type: 'text-bg',
|
|
1504
|
+
},
|
|
1505
|
+
];
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
* WCAG 2.1 AA contrast checker for `actionColor`-driven theme overrides. Combines
|
|
1509
|
+
* the static token-pair catalogue (generated at build time) with consumer-supplied
|
|
1510
|
+
* design-token values and an override-themes generator, and exposes a single
|
|
1511
|
+
* pre-bound instance ready for `validate(input)` / `computeContrastCapPatches(input)`.
|
|
1512
|
+
*
|
|
1513
|
+
* Stateless against per-call inputs; holds a process-lifetime fixability cache keyed
|
|
1514
|
+
* by `(tokenName, pairedWith, compositedOn)` — that property depends only on the
|
|
1515
|
+
* catalogue and the override formulas, not on the user's input, so it can be probed
|
|
1516
|
+
* once.
|
|
1517
|
+
*
|
|
1518
|
+
* @template TInput Shape of the override-color input. In vega-stencil this is
|
|
1519
|
+
* `VegaThemeOverrideColors`; tests can use a stricter or looser shape.
|
|
1520
|
+
*/
|
|
1521
|
+
class VegaColorTokenContrastChecker {
|
|
1522
|
+
constructor(deps) {
|
|
1523
|
+
this.fixabilityCache = null;
|
|
1524
|
+
this.deps = deps;
|
|
1525
|
+
this.fixedSurfaces = buildFixedPairedSurfaces(deps.fixedSurfaceTokens);
|
|
1526
|
+
this.search = new ColorSearchEngine(this.fixedSurfaces);
|
|
1527
|
+
}
|
|
1528
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
1529
|
+
// Public API
|
|
1530
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
1531
|
+
/**
|
|
1532
|
+
* Build the resolved token map for an input by collapsing
|
|
1533
|
+
* {@link CheckerDeps.generateOverrideThemes} into a `Map<tokenName, value>`,
|
|
1534
|
+
* dropping entries with empty values.
|
|
1535
|
+
*
|
|
1536
|
+
* Public so tests can assert on the materialized map and so the wrapper can
|
|
1537
|
+
* re-export it as a convenience helper.
|
|
1538
|
+
*
|
|
1539
|
+
* @param {TInput} input - Override-color payload.
|
|
1540
|
+
* @returns {Map<string, string>} Token name → CSS `r g b / a` value.
|
|
1541
|
+
*/
|
|
1542
|
+
buildTokenMap(input) {
|
|
1543
|
+
const themes = this.deps.generateOverrideThemes(input);
|
|
1544
|
+
const map = new Map();
|
|
1545
|
+
for (const entry of themes) {
|
|
1546
|
+
if (entry.value) {
|
|
1547
|
+
map.set(entry.name, entry.value);
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
return map;
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Validate overrides against WCAG 2.1 AA (light mode).
|
|
1554
|
+
*
|
|
1555
|
+
* @param {TInput} input - Override-color payload to validate.
|
|
1556
|
+
* @returns {ContrastCheckResult} Accessibility result, including failing details and optional patches.
|
|
1557
|
+
*/
|
|
1558
|
+
validate(input) {
|
|
1559
|
+
if (!VegaColorTokenContrastChecker.isValidActionColor(input)) {
|
|
1560
|
+
return { isAccessible: false, details: [], invalidInput: true, contrastCapPatches: {} };
|
|
1561
|
+
}
|
|
1562
|
+
const tokenMap = this.buildTokenMap(input);
|
|
1563
|
+
const details = this.collectFailures(tokenMap);
|
|
1564
|
+
const contrastCapPatches = this.computeContrastCapPatches(input);
|
|
1565
|
+
const result = {
|
|
1566
|
+
isAccessible: details.length === 0,
|
|
1567
|
+
details,
|
|
1568
|
+
contrastCapPatches,
|
|
1569
|
+
};
|
|
1570
|
+
const actionColor = input.actionColor;
|
|
1571
|
+
if (actionColor) {
|
|
1572
|
+
result.suggestedActionColor = result.isAccessible
|
|
1573
|
+
? actionColor
|
|
1574
|
+
: this.findSuggestedActionColor(input, actionColor);
|
|
1575
|
+
}
|
|
1576
|
+
return result;
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Produce contrast-cap patches for tokens whose formula caps contrast below threshold.
|
|
1580
|
+
*
|
|
1581
|
+
* Two-tier strategy (minimal impact first):
|
|
1582
|
+
* 1. α-ascent: raise alpha to meet contrast (preserves brand hue).
|
|
1583
|
+
* 2. RGB shift: closest opaque color satisfying ALL surfaces (linear scan).
|
|
1584
|
+
*
|
|
1585
|
+
* @param {TInput} input - Override-color payload (must include `actionColor`).
|
|
1586
|
+
* @returns {Record<string, string>} Map of tokenName → patched CSS value; empty if no repair needed.
|
|
1587
|
+
*/
|
|
1588
|
+
computeContrastCapPatches(input) {
|
|
1589
|
+
const patch = {};
|
|
1590
|
+
if (!input.actionColor || !VegaColorTokenContrastChecker.isValidActionColor(input)) {
|
|
1591
|
+
return patch;
|
|
1592
|
+
}
|
|
1593
|
+
const tokenMap = this.buildTokenMap(input);
|
|
1594
|
+
// Group all checks by token; identify tokens needing patch.
|
|
1595
|
+
const allChecksByToken = new Map();
|
|
1596
|
+
const tokensNeedingPatch = new Set();
|
|
1597
|
+
for (const checkConfig of ACTION_COLOR_CHECKS) {
|
|
1598
|
+
const allList = allChecksByToken.get(checkConfig.tokenName);
|
|
1599
|
+
if (allList) {
|
|
1600
|
+
allList.push(checkConfig);
|
|
1601
|
+
}
|
|
1602
|
+
else {
|
|
1603
|
+
allChecksByToken.set(checkConfig.tokenName, [checkConfig]);
|
|
1604
|
+
}
|
|
1605
|
+
if (!this.getFixabilityRecord(checkConfig).fixable) {
|
|
1606
|
+
tokensNeedingPatch.add(checkConfig.tokenName);
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
for (const tokenName of tokensNeedingPatch) {
|
|
1610
|
+
const tokenValue = tokenMap.get(tokenName);
|
|
1611
|
+
if (!tokenValue) {
|
|
1612
|
+
continue;
|
|
1613
|
+
}
|
|
1614
|
+
const parsed = parseTokenValue(tokenValue);
|
|
1615
|
+
if (!parsed) {
|
|
1616
|
+
continue;
|
|
1617
|
+
}
|
|
1618
|
+
// All checks as constraints (not just unfixable) to avoid regressing passing checks.
|
|
1619
|
+
// Safe: tokensNeedingPatch is derived from the same ACTION_COLOR_CHECKS loop that populates allChecksByToken.
|
|
1620
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1621
|
+
const allConfigs = allChecksByToken.get(tokenName);
|
|
1622
|
+
// Tier 1: α-ascent — find minimum α satisfying all checks simultaneously.
|
|
1623
|
+
let strictestAlpha;
|
|
1624
|
+
let tierOneFeasible = true;
|
|
1625
|
+
for (const checkConfig of allConfigs) {
|
|
1626
|
+
const threshold = requiredRatioFor(checkConfig.type);
|
|
1627
|
+
const repairedAlpha = this.search.findMinimumAlphaForContrast(parsed.rgb, parsed.a, checkConfig, threshold, tokenMap);
|
|
1628
|
+
if (repairedAlpha === undefined) {
|
|
1629
|
+
tierOneFeasible = false;
|
|
1630
|
+
break;
|
|
1631
|
+
}
|
|
1632
|
+
if (strictestAlpha === undefined || repairedAlpha > strictestAlpha) {
|
|
1633
|
+
strictestAlpha = repairedAlpha;
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
if (tierOneFeasible && strictestAlpha !== undefined) {
|
|
1637
|
+
// Verify the max α still satisfies all checks jointly.
|
|
1638
|
+
const candidateValue = formatTokenValue(parsed.rgb, strictestAlpha);
|
|
1639
|
+
if (this.verifyCandidateSatisfiesAll(tokenName, candidateValue, allConfigs, tokenMap)) {
|
|
1640
|
+
patch[tokenName] = candidateValue;
|
|
1641
|
+
continue;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
// Tier 2: RGB shift at α=1, satisfying all surfaces (linear scan).
|
|
1645
|
+
const repairedRgb = this.search.findRgbPatchForContrastAll(parsed.rgb, allConfigs, tokenMap);
|
|
1646
|
+
if (repairedRgb !== undefined) {
|
|
1647
|
+
patch[tokenName] = formatTokenValue(repairedRgb, 1);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
return patch;
|
|
1651
|
+
}
|
|
1652
|
+
/**
|
|
1653
|
+
* Compute contrast for a single check using the supplied token map.
|
|
1654
|
+
*
|
|
1655
|
+
* @param {TokenCheckConfig} check - Check configuration.
|
|
1656
|
+
* @param {Map<string, string>} tokenMap - Resolved token map.
|
|
1657
|
+
* @returns {ContrastResult | null} Contrast result or null when token/surface can't be resolved.
|
|
1658
|
+
*/
|
|
1659
|
+
computeTokenContrast(check, tokenMap) {
|
|
1660
|
+
return computeTokenContrast(check, tokenMap, this.fixedSurfaces);
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Resolve a `pairedWith` name to a {@link ContextSurface} using this checker's
|
|
1664
|
+
* static surface table.
|
|
1665
|
+
*
|
|
1666
|
+
* @param {string} pairedWith - Token name to resolve.
|
|
1667
|
+
* @param {Map<string, string>} tokenMap - Resolved token map (dynamic lookup wins).
|
|
1668
|
+
* @returns {ContextSurface | undefined} Resolved surface, or undefined.
|
|
1669
|
+
*/
|
|
1670
|
+
resolvePairedSurface(pairedWith, tokenMap) {
|
|
1671
|
+
return resolvePairedSurface(pairedWith, tokenMap, this.fixedSurfaces);
|
|
1672
|
+
}
|
|
1673
|
+
/**
|
|
1674
|
+
* Get the per-check fixability record (cached over the process lifetime).
|
|
1675
|
+
*
|
|
1676
|
+
* @param {TokenCheckConfig} config - Check configuration.
|
|
1677
|
+
* @returns {FixabilityRecord} `{ fixable, maxContrast }`.
|
|
1678
|
+
*/
|
|
1679
|
+
getFixabilityRecord(config) {
|
|
1680
|
+
var _a;
|
|
1681
|
+
if (!this.fixabilityCache) {
|
|
1682
|
+
this.fixabilityCache = this.buildFixabilityCache();
|
|
1683
|
+
}
|
|
1684
|
+
return ((_a = this.fixabilityCache.get(VegaColorTokenContrastChecker.fixabilityCacheKey(config))) !== null && _a !== void 0 ? _a : {
|
|
1685
|
+
fixable: true,
|
|
1686
|
+
maxContrast: Infinity,
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1689
|
+
/**
|
|
1690
|
+
* Collect failing fixable tokens under the supplied token map.
|
|
1691
|
+
*
|
|
1692
|
+
* @param {Map<string, string>} tokenMap - Resolved token map.
|
|
1693
|
+
* @param {boolean} earlyExit - If true, return after first failure.
|
|
1694
|
+
* @returns {ColorContrastDetail[]} Array of failing token detail entries.
|
|
1695
|
+
*/
|
|
1696
|
+
collectFailures(tokenMap, earlyExit = false) {
|
|
1697
|
+
const failures = [];
|
|
1698
|
+
for (const checkConfig of ACTION_COLOR_CHECKS) {
|
|
1699
|
+
if (!this.getFixabilityRecord(checkConfig).fixable) {
|
|
1700
|
+
continue;
|
|
1701
|
+
}
|
|
1702
|
+
const computed = this.computeTokenContrast(checkConfig, tokenMap);
|
|
1703
|
+
if (!computed) {
|
|
1704
|
+
continue;
|
|
1705
|
+
}
|
|
1706
|
+
const threshold = requiredRatioFor(checkConfig.type);
|
|
1707
|
+
if (computed.contrastRatio >= threshold) {
|
|
1708
|
+
continue;
|
|
1709
|
+
}
|
|
1710
|
+
failures.push({
|
|
1711
|
+
tokenName: checkConfig.tokenName,
|
|
1712
|
+
contrastRatio: computed.contrastRatio,
|
|
1713
|
+
requiredRatio: threshold,
|
|
1714
|
+
});
|
|
1715
|
+
if (earlyExit) {
|
|
1716
|
+
return failures;
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
return failures;
|
|
1720
|
+
}
|
|
1721
|
+
/**
|
|
1722
|
+
* Fast check: all fixable tokens pass contrast under the supplied token map.
|
|
1723
|
+
*
|
|
1724
|
+
* @param {Map<string, string>} tokenMap - Resolved token map.
|
|
1725
|
+
* @returns {boolean} True if all fixable tokens pass.
|
|
1726
|
+
*/
|
|
1727
|
+
isAccessible(tokenMap) {
|
|
1728
|
+
return this.collectFailures(tokenMap, true).length === 0;
|
|
1729
|
+
}
|
|
1730
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
1731
|
+
// Private helpers
|
|
1732
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
1733
|
+
/** Empty `actionColor` is allowed (means "no override"); when present it must be a valid color. */
|
|
1734
|
+
static isValidActionColor(input) {
|
|
1735
|
+
return !input.actionColor || isValidColor(input.actionColor);
|
|
1736
|
+
}
|
|
1737
|
+
/** Produce a new input with a different `actionColor`, preserving every other field. */
|
|
1738
|
+
withActionColor(input, actionColor) {
|
|
1739
|
+
return Object.assign(Object.assign({}, input), { actionColor });
|
|
1740
|
+
}
|
|
1741
|
+
static fixabilityCacheKey(config) {
|
|
1742
|
+
var _a;
|
|
1743
|
+
return `${config.tokenName}|${config.pairedWith}|${(_a = config.compositedOn) !== null && _a !== void 0 ? _a : ''}`;
|
|
1744
|
+
}
|
|
1745
|
+
buildFixabilityCache() {
|
|
1746
|
+
const cache = new Map();
|
|
1747
|
+
// Probe maps depend only on `actionColor`; synthesize a minimal TInput for each
|
|
1748
|
+
// probe via the `withActionColor` helper applied to an empty object. TInput must
|
|
1749
|
+
// extend ActionColorInput, so the only required structural shape is `actionColor`.
|
|
1750
|
+
const baseInput = {};
|
|
1751
|
+
const probeMaps = VegaColorTokenContrastChecker.FIXABILITY_PROBE_COLORS.map((probe) => this.buildTokenMap(this.withActionColor(baseInput, probe)));
|
|
1752
|
+
for (const check of ACTION_COLOR_CHECKS) {
|
|
1753
|
+
let maxContrast = 0;
|
|
1754
|
+
for (const tokenMap of probeMaps) {
|
|
1755
|
+
const computed = this.computeTokenContrast(check, tokenMap);
|
|
1756
|
+
if (computed && computed.contrastRatio > maxContrast) {
|
|
1757
|
+
maxContrast = computed.contrastRatio;
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
const required = requiredRatioFor(check.type);
|
|
1761
|
+
cache.set(VegaColorTokenContrastChecker.fixabilityCacheKey(check), {
|
|
1762
|
+
fixable: maxContrast >= required,
|
|
1763
|
+
maxContrast: Math.round(maxContrast * 100) / 100,
|
|
1764
|
+
});
|
|
1765
|
+
}
|
|
1766
|
+
return cache;
|
|
1767
|
+
}
|
|
1768
|
+
/**
|
|
1769
|
+
* Find the closest accessible actionColor (by OKLab ΔE) within ±5° hue tolerance.
|
|
1770
|
+
*
|
|
1771
|
+
* @param {TInput} input - Current override input.
|
|
1772
|
+
* @param {string} actionColor - Current action color hex (already extracted by validate()).
|
|
1773
|
+
* @returns {string | undefined} Suggested hex, or undefined if none feasible.
|
|
1774
|
+
*/
|
|
1775
|
+
findSuggestedActionColor(input, actionColor) {
|
|
1776
|
+
const suggestedRgb = this.search.searchClosestFeasibleInOklch(parseColorToRgb(actionColor), (rgb) => this.isAccessible(this.buildTokenMap(this.withActionColor(input, rgbToHex(rgb)))));
|
|
1777
|
+
return suggestedRgb === undefined ? undefined : rgbToHex(suggestedRgb);
|
|
1778
|
+
}
|
|
1779
|
+
/** Verify a candidate value passes all checks for a token. */
|
|
1780
|
+
verifyCandidateSatisfiesAll(tokenName, candidateValue, allConfigs, tokenMap) {
|
|
1781
|
+
const patchedMap = new Map(tokenMap);
|
|
1782
|
+
patchedMap.set(tokenName, candidateValue);
|
|
1783
|
+
for (const config of allConfigs) {
|
|
1784
|
+
const threshold = requiredRatioFor(config.type);
|
|
1785
|
+
// Route through `this.computeTokenContrast` (not the free function) so test
|
|
1786
|
+
// suites can intercept the verification phase via a spy on the public method.
|
|
1787
|
+
const result = this.computeTokenContrast(config, patchedMap);
|
|
1788
|
+
if (!result || result.contrastRatio < threshold) {
|
|
1789
|
+
return false;
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
return true;
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
VegaColorTokenContrastChecker.FIXABILITY_PROBE_COLORS = ['#000000', '#808080', '#ffffff'];
|
|
1796
|
+
|
|
1797
|
+
// Thin wrapper around `vega-color-token-contrast-checker/core`. The
|
|
1798
|
+
/**
|
|
1799
|
+
* Process-lifetime singleton: a {@link VegaColorTokenContrastChecker} pre-bound
|
|
1800
|
+
* to vega-stencil's design-token table and override-themes generator. Consumers
|
|
1801
|
+
* call `.validate(overrideColors)` and `.computeContrastCapPatches(overrideColors)`
|
|
1802
|
+
* directly — no per-call configuration needed.
|
|
1803
|
+
*/
|
|
1804
|
+
const vegaAccessibilityValidator = new VegaColorTokenContrastChecker({
|
|
1805
|
+
fixedSurfaceTokens: LightModeColorTokens,
|
|
1806
|
+
/**
|
|
1807
|
+
* Generate override theme arrays from the supplied override colors.
|
|
1808
|
+
*
|
|
1809
|
+
* @param {VegaThemeOverrideColors} overrideColors The override colors input.
|
|
1810
|
+
* @returns {ReturnType<typeof VegaColorSchemaOverridingController.generateOverrideThemes>} The override theme arrays.
|
|
1811
|
+
*/
|
|
1812
|
+
generateOverrideThemes: (overrideColors) => VegaColorSchemaOverridingController.generateOverrideThemes(overrideColors),
|
|
1813
|
+
});
|
|
1814
|
+
|
|
1815
|
+
export { vegaAccessibilityValidator };
|