accessibility-plugin-react 2.10.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -21
- package/dist/index.d.mts +44 -4
- package/dist/index.d.ts +44 -4
- package/dist/index.js +913 -135
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +892 -126
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +82 -0
- package/docs/API.md +3 -3
- package/docs/BUILD_AND_RELEASE_PLAN.md +4 -4
- package/docs/FEATURES.md +4 -3
- package/docs/READING_AIDS.md +139 -0
- package/docs/REGRESSION_AND_PERFORMANCE.md +127 -0
- package/docs/TOOLTIPS.md +102 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// src/styles/tailwind.css
|
|
27
|
-
styleInject('.arap-root {\n --arap-surface: #fff;\n --arap-text: #111827;\n --arap-muted: #475569;\n --arap-border: #cbd5e1;\n --arap-divider: #e2e8f0;\n --arap-accent: #1d4ed8;\n --arap-accent-hover: #1e40af;\n --arap-selected: #eff6ff;\n --arap-control: #f8fafc;\n color-scheme: light;\n font: 15px/1.5 system-ui, sans-serif;\n color: var(--arap-text);\n text-align: left;\n letter-spacing: normal;\n}\n.arap-root *,\n.arap-root *::before,\n.arap-root *::after {\n box-sizing: border-box;\n}\n.arap-root button {\n font: inherit;\n cursor: pointer;\n color: inherit;\n text-transform: none;\n letter-spacing: normal;\n transition: background-color 0.15s, border-color 0.15s;\n}\n.arap-root button:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n.arap-root button:focus-visible,\n.arap-panel:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 3px;\n}\n.arap-root .arap-btn {\n position: fixed;\n z-index: 2147483001;\n bottom: max(16px, env(safe-area-inset-bottom));\n right: max(16px, env(safe-area-inset-right));\n width: 56px;\n height: 56px;\n padding: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 2px solid var(--arap-surface);\n border-radius: 50%;\n background: var(--arap-accent);\n color: #fff;\n box-shadow: 0 4px 12px #0f172a26, 0 10px 24px #0f172a14;\n}\n.arap-root .arap-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-root .arap-btn[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-position=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-panel {\n position: fixed;\n z-index: 2147483000;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n right: max(16px, env(safe-area-inset-right));\n width: min(400px, calc(100vw - 32px));\n max-height: calc(100vh - 120px);\n max-height: calc(100dvh - 120px - env(safe-area-inset-bottom));\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 20px;\n border: 1px solid var(--arap-divider);\n border-radius: 16px;\n background: var(--arap-surface);\n box-shadow: 0 8px 16px #0f172a0d, 0 20px 48px #0f172a1a;\n}\n.arap-root .arap-panel[hidden] {\n display: none !important;\n}\n.arap-root .arap-panel[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-panel[data-position=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-heading {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 8px;\n padding-bottom: 18px;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-heading-copy {\n min-width: 0;\n}\n.arap-heading h2 {\n margin: 0;\n font: 700 22px/1.3 system-ui, sans-serif;\n letter-spacing: -0.025em;\n color: var(--arap-text);\n overflow-wrap: anywhere;\n}\n.arap-description {\n margin: 6px 0 0;\n color: var(--arap-muted);\n font: 14px/1.5 system-ui, sans-serif;\n overflow-wrap: anywhere;\n}\n.arap-heading button {\n flex: none;\n width: 44px;\n height: 44px;\n margin-top: -6px;\n border: 1px solid transparent;\n border-radius: 8px;\n background: transparent;\n color: var(--arap-muted);\n font-size: 28px;\n line-height: 1;\n}\n.arap-heading button:hover {\n background: var(--arap-control);\n border-color: var(--arap-border);\n}\n.arap-feature {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n gap: 10px 12px;\n padding: 18px 0;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-feature:last-child {\n border: 0;\n padding-bottom: 0;\n}\n.arap-label {\n display: flex;\n align-items: center;\n gap: 10px;\n font-weight: 500;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n.arap-icon {\n flex: none;\n width: 22px;\n height: 22px;\n display: inline-block;\n vertical-align: middle;\n}\n.arap-controls {\n display: flex;\n align-items: stretch;\n border: 1px solid var(--arap-border);\n border-radius: 9px;\n overflow: hidden;\n background: var(--arap-control);\n}\n.arap-root .arap-btn-sm {\n flex: none;\n width: 44px;\n height: 44px;\n border: 0;\n border-radius: 0;\n background: transparent;\n font-size: 22px;\n}\n.arap-root .arap-btn-sm:hover:not(:disabled) {\n background: var(--arap-selected);\n color: var(--arap-accent);\n}\n.arap-root .arap-controls button:focus-visible {\n outline-offset: -4px;\n}\n.arap-value {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 56px;\n padding: 0 6px;\n text-align: center;\n font-weight: 600;\n border-inline: 1px solid var(--arap-divider);\n background: var(--arap-surface);\n}\n.arap-segmented {\n grid-column: 1 / -1;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n min-width: 0;\n}\n.arap-root .arap-segment {\n flex: 1 1 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-muted);\n overflow-wrap: anywhere;\n}\n.arap-root .arap-segment:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-root .arap-segment-active {\n background: var(--arap-accent);\n color: #fff;\n border-color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-segment-active:hover {\n background: var(--arap-accent-hover);\n color: #fff;\n}\n.arap-check {\n flex: none;\n font-size: 15px;\n line-height: 1;\n}\n.arap-root .arap-toggle {\n position: relative;\n width: 56px;\n height: 44px;\n padding: 0;\n border: 0;\n border-radius: 10px;\n background: transparent;\n}\n.arap-toggle::before {\n content: "";\n position: absolute;\n inset: 6px 0;\n border: 2px solid #64748b;\n border-radius: 20px;\n background: #e2e8f0;\n}\n.arap-toggle-knob {\n position: absolute;\n top: 10px;\n left: 4px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: #475569;\n pointer-events: none;\n transition: transform 0.15s;\n}\n.arap-toggle-active::before {\n background: var(--arap-accent);\n border-color: var(--arap-accent);\n}\n.arap-toggle-active .arap-toggle-knob {\n transform: translateX(24px);\n background: #fff;\n}\n.arap-toggle-active .arap-toggle-knob::after {\n content: "\\2713";\n display: block;\n color: var(--arap-accent);\n font-size: 16px;\n font-weight: 700;\n line-height: 24px;\n text-align: center;\n}\n.arap-root .arap-toggle:hover::before {\n border-color: var(--arap-accent);\n}\n.arap-feature-reset {\n display: block;\n}\n.arap-root .arap-reset-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 100%;\n min-height: 48px;\n padding: 10px;\n border: 1px solid var(--arap-border);\n border-radius: 10px;\n background: var(--arap-control);\n color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-reset-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n@media (max-width: 380px) {\n .arap-root .arap-panel {\n padding: 16px;\n }\n .arap-heading h2 {\n font-size: 20px;\n }\n .arap-feature-stepper {\n grid-template-columns: minmax(0, 1fr);\n }\n .arap-controls {\n width: 100%;\n }\n .arap-value {\n flex: 1;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .arap-root *,\n .arap-root *::before,\n .arap-root *::after {\n transition: none !important;\n animation: none !important;\n }\n}\n@media (forced-colors: active) {\n .arap-root {\n --arap-surface: Canvas;\n --arap-text: CanvasText;\n --arap-muted: CanvasText;\n --arap-border: ButtonText;\n --arap-divider: ButtonText;\n --arap-accent: Highlight;\n --arap-control: Canvas;\n --arap-selected: Canvas;\n }\n .arap-root button[aria-pressed=true] {\n outline: 2px solid Highlight;\n outline-offset: -4px;\n }\n .arap-root .arap-segment-active {\n color: HighlightText;\n background: Highlight;\n }\n .arap-toggle::before {\n border-color: ButtonText;\n background: Canvas;\n }\n .arap-toggle-knob {\n background: ButtonText;\n }\n .arap-toggle-active .arap-toggle-knob {\n background: Highlight;\n }\n .arap-toggle-active .arap-toggle-knob::after {\n color: HighlightText;\n }\n}\n.arap-root .arap-panel {\n display: flex;\n flex-direction: column;\n overflow: visible;\n}\n.arap-heading {\n flex: none;\n}\n.arap-tools {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 0 3px;\n margin: 0 -3px;\n}\n.arap-tools:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: -3px;\n}\n.arap-quick-actions {\n position: relative;\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n padding-top: 14px;\n margin-top: 8px;\n border-top: 1px solid var(--arap-divider);\n}\n.arap-actions {\n flex: 1;\n min-width: 0;\n}\n.arap-actions:empty {\n display: none;\n}\n.arap-actions .arap-feature-reset {\n padding: 0;\n margin: 0;\n border: 0;\n}\n.arap-root .arap-position-button,\n.arap-root .arap-position-default,\n.arap-root .arap-position-arrows button {\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-accent);\n}\n.arap-root .arap-position-button:hover,\n.arap-root .arap-position-default:hover,\n.arap-root .arap-position-arrows button:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-position-popover {\n position: absolute;\n z-index: 1;\n bottom: calc(100% + 8px);\n left: 0;\n width: 100%;\n max-height: calc(100dvh - 160px);\n overflow: auto;\n padding: 14px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n box-shadow: 0 8px 24px #0f172a26;\n}\n.arap-position-popover[hidden] {\n display: none !important;\n}\n.arap-position-label {\n display: block;\n margin-bottom: 6px;\n font-weight: 600;\n}\n.arap-position-popover select {\n width: 100%;\n min-height: 44px;\n padding: 8px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n font: inherit;\n color: var(--arap-text);\n background: var(--arap-surface);\n}\n.arap-position-popover select:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-position-arrows {\n display: flex;\n justify-content: space-between;\n gap: 6px;\n margin-top: 10px;\n}\n.arap-position-default {\n width: 100%;\n margin-top: 8px;\n}\n.arap-root .arap-btn[data-draggable=true] {\n touch-action: none;\n user-select: none;\n cursor: grab;\n}\n.arap-root .arap-btn[data-dragging=true] {\n cursor: grabbing;\n}\n.arap-root .arap-btn[data-corner$=left],\n.arap-root .arap-panel[data-corner$=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-corner$=right],\n.arap-root .arap-panel[data-corner$=right] {\n left: auto;\n right: max(16px, env(safe-area-inset-right));\n}\n.arap-root .arap-btn[data-corner^=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-btn[data-corner^=bottom] {\n top: auto;\n bottom: max(16px, env(safe-area-inset-bottom));\n}\n.arap-root .arap-panel[data-corner^=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-root .arap-panel[data-corner^=bottom] {\n top: auto;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n}\n.arap-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n.arap-root .arap-skip-actions {\n position: absolute;\n top: 12px;\n left: 20px;\n width: 44px;\n height: 44px;\n clip-path: inset(50%);\n overflow: hidden;\n pointer-events: none;\n}\n.arap-root .arap-skip-actions:focus-visible {\n right: 20px;\n width: auto;\n height: auto;\n min-height: 44px;\n clip-path: none;\n pointer-events: auto;\n z-index: 2;\n padding: 8px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-accent);\n}\n.arap-skip-to-main {\n position: fixed;\n top: 12px;\n left: 16px;\n z-index: 2147483647;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n pointer-events: none;\n font-family: inherit;\n font-size: 0.9375rem;\n font-weight: 600;\n text-decoration: none;\n color: var(--arap-accent, #008060);\n background: var(--arap-surface, #ffffff);\n border-radius: 8px;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n.arap-skip-to-main:focus,\n.arap-skip-to-main:focus-visible {\n width: auto;\n height: auto;\n min-height: 44px;\n margin: 0;\n padding: 10px 18px;\n clip-path: none;\n overflow: visible;\n white-space: normal;\n pointer-events: auto;\n border: 2px solid var(--arap-accent, #008060);\n outline: 3px solid var(--arap-accent, #008060);\n outline-offset: 3px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n@media (forced-colors: active) {\n .arap-skip-to-main {\n background: Canvas;\n color: CanvasText;\n border-color: Highlight;\n }\n .arap-skip-to-main:focus,\n .arap-skip-to-main:focus-visible {\n outline: 3px solid Highlight;\n }\n}\n@media (max-height: 480px) {\n .arap-root .arap-panel {\n top: max(16px, env(safe-area-inset-top)) !important;\n bottom: max(16px, env(safe-area-inset-bottom)) !important;\n max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;\n padding: 8px;\n }\n .arap-heading {\n padding-bottom: 8px;\n }\n .arap-heading h2 {\n font-size: 18px;\n }\n .arap-heading button {\n margin-top: 0;\n }\n .arap-description {\n display: none;\n }\n .arap-quick-actions {\n padding-top: 8px;\n margin-top: 0;\n }\n .arap-root .arap-reset-btn {\n min-height: 44px;\n }\n .arap-root .arap-btn[data-open=true] {\n visibility: hidden;\n }\n .arap-position-popover {\n max-height: calc(100dvh - 96px);\n }\n}\n.arap-statement {\n flex: none;\n padding-top: 10px;\n text-align: center;\n}\n.arap-statement-link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 44px;\n padding: 6px 12px;\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 4px;\n font-size: 14px;\n font-weight: 500;\n border-radius: 8px;\n}\n.arap-statement-link:hover {\n color: var(--arap-accent-hover);\n background: var(--arap-selected);\n}\n.arap-statement-link:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-credits {\n display: flex;\n flex: none;\n flex-direction: column;\n gap: 2px;\n padding-top: 8px;\n color: var(--arap-muted);\n text-align: center;\n font-size: 11px;\n line-height: 1.4;\n}\n.arap-credits a {\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.arap-credits a:hover {\n color: var(--arap-accent-hover);\n}\n.arap-credits a:focus-visible {\n outline: 2px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-root .arap-btn[data-large-controls=true] {\n width: 64px;\n height: 64px;\n min-width: 48px;\n min-height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] {\n width: min(440px, calc(100vw - 32px));\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-heading button {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 32px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-btn-sm {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 24px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-value {\n min-width: 64px;\n font-size: 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-segment {\n min-width: 48px;\n min-height: 48px;\n padding: 10px 14px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle {\n width: 64px;\n height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle::before {\n inset: 8px 0;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-knob {\n top: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-active .arap-toggle-knob {\n transform: translateX(28px);\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-reset-btn {\n min-height: 52px;\n font-size: 16px;\n padding: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-button,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-default,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-arrows button {\n min-width: 48px;\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-popover select {\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-statement-link {\n min-height: 48px;\n font-size: 15px;\n padding: 10px 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-skip-actions {\n min-width: 48px;\n min-height: 48px;\n}\n.arap-feature-card {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 12px;\n}\n.arap-card-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-card-title {\n font-weight: 600;\n font-size: 15px;\n color: var(--arap-text);\n}\n.arap-card-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-status-badge {\n display: inline-flex;\n align-items: center;\n padding: 2px 8px;\n border-radius: 9999px;\n font-size: 11px;\n font-weight: 600;\n background: var(--arap-control);\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-card-alert {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 10px 12px;\n border-radius: 8px;\n font-size: 13px;\n line-height: 1.4;\n}\n.arap-alert-icon {\n flex: none;\n font-size: 16px;\n line-height: 1;\n}\n.arap-card-error {\n background: #fef2f2;\n border: 1px solid #fecaca;\n color: #991b1b;\n}\n.arap-card-unavailable {\n background: #f8fafc;\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n}\n.arap-card-permission {\n background: #fffbeb;\n border: 1px solid #fde68a;\n color: #92400e;\n}\n.arap-permission-content {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-permission-btn {\n align-self: flex-start;\n padding: 4px 10px;\n border: 1px solid #d97706;\n border-radius: 6px;\n background: #f59e0b;\n color: #fff;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n.arap-permission-btn:hover {\n background: #d97706;\n}\n.arap-card-content {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.arap-choice-group {\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: 100%;\n}\n.arap-choice-group-title {\n font-size: 12px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-choice-badge {\n font-size: 11px;\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--arap-divider);\n color: var(--arap-muted);\n}\n.arap-segment-active .arap-choice-badge {\n background: rgba(255, 255, 255, 0.25);\n color: #fff;\n}\n.arap-stepper-control-wrapper {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 100%;\n}\n.arap-slider-container {\n display: flex;\n align-items: center;\n padding: 4px 0;\n}\n.arap-slider {\n width: 100%;\n accent-color: var(--arap-accent);\n cursor: pointer;\n}\n.arap-search-count {\n padding: 6px 0;\n font-size: 12px;\n font-weight: 500;\n color: var(--arap-muted);\n}\n.arap-empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 24px 16px;\n gap: 8px;\n}\n.arap-empty-icon {\n font-size: 32px;\n}\n.arap-empty-title {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-empty-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n}\n.arap-empty-btn,\n.arap-retry-btn {\n margin-top: 6px;\n padding: 8px 16px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n font-weight: 500;\n font-size: 13px;\n color: var(--arap-text);\n cursor: pointer;\n}\n.arap-empty-btn:hover,\n.arap-retry-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n color: var(--arap-accent);\n}\n.arap-profile-card {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 16px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n transition: border-color 0.15s, box-shadow 0.15s;\n}\n.arap-profile-card-active {\n border-color: var(--arap-accent);\n background: var(--arap-selected);\n box-shadow: 0 0 0 1px var(--arap-accent);\n}\n.arap-profile-header {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.arap-profile-title-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-profile-title {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-profile-active-badge {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-accent);\n background: #dbeafe;\n padding: 2px 8px;\n border-radius: 9999px;\n}\n.arap-profile-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-profile-affected {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-profile-affected-label {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-profile-chips {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n.arap-profile-chip {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px;\n border-radius: 6px;\n background: var(--arap-control);\n border: 1px solid var(--arap-divider);\n font-size: 12px;\n color: var(--arap-text);\n}\n.arap-profile-actions {\n display: flex;\n gap: 8px;\n margin-top: 4px;\n}\n.arap-profile-apply-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-accent);\n color: #fff;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-apply-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-profile-revert-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-muted);\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-revert-btn:hover {\n background: var(--arap-control);\n color: var(--arap-text);\n border-color: var(--arap-text);\n}\n.arap-notice {\n grid-column: 1 / -1;\n margin-top: 6px;\n padding: 8px 12px;\n border-radius: 8px;\n font-size: 12px;\n line-height: 1.45;\n background: #fefce8;\n border: 1px solid #fef08a;\n color: #854d0e;\n}\n.arap-notice-warning {\n background: #fffbeb;\n border-color: #fde68a;\n color: #92400e;\n}\n');
|
|
27
|
+
styleInject('.arap-root {\n --arap-surface: #fff;\n --arap-text: #111827;\n --arap-muted: #475569;\n --arap-border: #cbd5e1;\n --arap-divider: #e2e8f0;\n --arap-accent: #1d4ed8;\n --arap-accent-hover: #1e40af;\n --arap-selected: #eff6ff;\n --arap-control: #f8fafc;\n color-scheme: light;\n font: 15px/1.5 system-ui, sans-serif;\n color: var(--arap-text);\n text-align: left;\n letter-spacing: normal;\n}\n.arap-root *,\n.arap-root *::before,\n.arap-root *::after {\n box-sizing: border-box;\n}\n.arap-root button {\n font: inherit;\n cursor: pointer;\n color: inherit;\n text-transform: none;\n letter-spacing: normal;\n transition: background-color 0.15s, border-color 0.15s;\n}\n.arap-root button:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n.arap-root button:focus-visible,\n.arap-panel:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 3px;\n}\n.arap-root .arap-btn {\n position: fixed;\n z-index: 2147483001;\n bottom: max(16px, env(safe-area-inset-bottom));\n right: max(16px, env(safe-area-inset-right));\n width: 56px;\n height: 56px;\n padding: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 2px solid var(--arap-surface);\n border-radius: 50%;\n background: var(--arap-accent);\n color: #fff;\n box-shadow: 0 4px 12px #0f172a26, 0 10px 24px #0f172a14;\n}\n.arap-root .arap-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-root .arap-btn[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-position=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-panel {\n position: fixed;\n z-index: 2147483000;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n right: max(16px, env(safe-area-inset-right));\n width: min(400px, calc(100vw - 32px));\n max-height: calc(100vh - 120px);\n max-height: calc(100dvh - 120px - env(safe-area-inset-bottom));\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 20px;\n border: 1px solid var(--arap-divider);\n border-radius: 16px;\n background: var(--arap-surface);\n box-shadow: 0 8px 16px #0f172a0d, 0 20px 48px #0f172a1a;\n}\n.arap-root .arap-panel[hidden] {\n display: none !important;\n}\n.arap-root .arap-panel[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-panel[data-position=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-heading {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 8px;\n padding-bottom: 18px;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-heading-copy {\n min-width: 0;\n}\n.arap-heading h2 {\n margin: 0;\n font: 700 22px/1.3 system-ui, sans-serif;\n letter-spacing: -0.025em;\n color: var(--arap-text);\n overflow-wrap: anywhere;\n}\n.arap-description {\n margin: 6px 0 0;\n color: var(--arap-muted);\n font: 14px/1.5 system-ui, sans-serif;\n overflow-wrap: anywhere;\n}\n.arap-heading button {\n flex: none;\n width: 44px;\n height: 44px;\n margin-top: -6px;\n border: 1px solid transparent;\n border-radius: 8px;\n background: transparent;\n color: var(--arap-muted);\n font-size: 28px;\n line-height: 1;\n}\n.arap-heading button:hover {\n background: var(--arap-control);\n border-color: var(--arap-border);\n}\n.arap-feature {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n gap: 10px 12px;\n padding: 18px 0;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-feature:last-child {\n border: 0;\n padding-bottom: 0;\n}\n.arap-label {\n display: flex;\n align-items: center;\n gap: 10px;\n font-weight: 500;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n.arap-icon {\n flex: none;\n width: 22px;\n height: 22px;\n display: inline-block;\n vertical-align: middle;\n}\n.arap-controls {\n display: flex;\n align-items: stretch;\n border: 1px solid var(--arap-border);\n border-radius: 9px;\n overflow: hidden;\n background: var(--arap-control);\n}\n.arap-root .arap-btn-sm {\n flex: none;\n width: 44px;\n height: 44px;\n border: 0;\n border-radius: 0;\n background: transparent;\n font-size: 22px;\n}\n.arap-root .arap-btn-sm:hover:not(:disabled) {\n background: var(--arap-selected);\n color: var(--arap-accent);\n}\n.arap-root .arap-controls button:focus-visible {\n outline-offset: -4px;\n}\n.arap-value {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 56px;\n padding: 0 6px;\n text-align: center;\n font-weight: 600;\n border-inline: 1px solid var(--arap-divider);\n background: var(--arap-surface);\n}\n.arap-segmented {\n grid-column: 1 / -1;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n min-width: 0;\n}\n.arap-root .arap-segment {\n flex: 1 1 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-muted);\n overflow-wrap: anywhere;\n}\n.arap-root .arap-segment:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-root .arap-segment-active {\n background: var(--arap-accent);\n color: #fff;\n border-color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-segment-active:hover {\n background: var(--arap-accent-hover);\n color: #fff;\n}\n.arap-check {\n flex: none;\n font-size: 15px;\n line-height: 1;\n}\n.arap-root .arap-toggle {\n position: relative;\n width: 56px;\n height: 44px;\n padding: 0;\n border: 0;\n border-radius: 10px;\n background: transparent;\n}\n.arap-toggle::before {\n content: "";\n position: absolute;\n inset: 6px 0;\n border: 2px solid #64748b;\n border-radius: 20px;\n background: #e2e8f0;\n}\n.arap-toggle-knob {\n position: absolute;\n top: 10px;\n left: 4px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: #475569;\n pointer-events: none;\n transition: transform 0.15s;\n}\n.arap-toggle-active::before {\n background: var(--arap-accent);\n border-color: var(--arap-accent);\n}\n.arap-toggle-active .arap-toggle-knob {\n transform: translateX(24px);\n background: #fff;\n}\n.arap-toggle-active .arap-toggle-knob::after {\n content: "\\2713";\n display: block;\n color: var(--arap-accent);\n font-size: 16px;\n font-weight: 700;\n line-height: 24px;\n text-align: center;\n}\n.arap-root .arap-toggle:hover::before {\n border-color: var(--arap-accent);\n}\n.arap-feature-reset {\n display: block;\n}\n.arap-root .arap-reset-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 100%;\n min-height: 48px;\n padding: 10px;\n border: 1px solid var(--arap-border);\n border-radius: 10px;\n background: var(--arap-control);\n color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-reset-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n@media (max-width: 380px) {\n .arap-root .arap-panel {\n padding: 16px;\n }\n .arap-heading h2 {\n font-size: 20px;\n }\n .arap-feature-stepper {\n grid-template-columns: minmax(0, 1fr);\n }\n .arap-controls {\n width: 100%;\n }\n .arap-value {\n flex: 1;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .arap-root *,\n .arap-root *::before,\n .arap-root *::after {\n transition: none !important;\n animation: none !important;\n }\n}\n@media (forced-colors: active) {\n .arap-root {\n --arap-surface: Canvas;\n --arap-text: CanvasText;\n --arap-muted: CanvasText;\n --arap-border: ButtonText;\n --arap-divider: ButtonText;\n --arap-accent: Highlight;\n --arap-control: Canvas;\n --arap-selected: Canvas;\n }\n .arap-root button[aria-pressed=true] {\n outline: 2px solid Highlight;\n outline-offset: -4px;\n }\n .arap-root .arap-segment-active {\n color: HighlightText;\n background: Highlight;\n }\n .arap-toggle::before {\n border-color: ButtonText;\n background: Canvas;\n }\n .arap-toggle-knob {\n background: ButtonText;\n }\n .arap-toggle-active .arap-toggle-knob {\n background: Highlight;\n }\n .arap-toggle-active .arap-toggle-knob::after {\n color: HighlightText;\n }\n}\n.arap-root .arap-panel {\n display: flex;\n flex-direction: column;\n overflow: visible;\n}\n.arap-heading {\n flex: none;\n}\n.arap-tools {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 0 3px;\n margin: 0 -3px;\n}\n.arap-tools:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: -3px;\n}\n.arap-quick-actions {\n position: relative;\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n padding-top: 14px;\n margin-top: 8px;\n border-top: 1px solid var(--arap-divider);\n}\n.arap-actions {\n flex: 1;\n min-width: 0;\n}\n.arap-actions:empty {\n display: none;\n}\n.arap-actions .arap-feature-reset {\n padding: 0;\n margin: 0;\n border: 0;\n}\n.arap-root .arap-position-button,\n.arap-root .arap-position-default,\n.arap-root .arap-position-arrows button {\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-accent);\n}\n.arap-root .arap-position-button:hover,\n.arap-root .arap-position-default:hover,\n.arap-root .arap-position-arrows button:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-position-popover {\n position: absolute;\n z-index: 1;\n bottom: calc(100% + 8px);\n left: 0;\n width: 100%;\n max-height: calc(100dvh - 160px);\n overflow: auto;\n padding: 14px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n box-shadow: 0 8px 24px #0f172a26;\n}\n.arap-position-popover[hidden] {\n display: none !important;\n}\n.arap-position-label {\n display: block;\n margin-bottom: 6px;\n font-weight: 600;\n}\n.arap-position-popover select {\n width: 100%;\n min-height: 44px;\n padding: 8px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n font: inherit;\n color: var(--arap-text);\n background: var(--arap-surface);\n}\n.arap-position-popover select:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-position-arrows {\n display: flex;\n justify-content: space-between;\n gap: 6px;\n margin-top: 10px;\n}\n.arap-position-default {\n width: 100%;\n margin-top: 8px;\n}\n.arap-root .arap-btn[data-draggable=true] {\n touch-action: none;\n user-select: none;\n cursor: grab;\n}\n.arap-root .arap-btn[data-dragging=true] {\n cursor: grabbing;\n}\n.arap-root .arap-btn[data-corner$=left],\n.arap-root .arap-panel[data-corner$=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-corner$=right],\n.arap-root .arap-panel[data-corner$=right] {\n left: auto;\n right: max(16px, env(safe-area-inset-right));\n}\n.arap-root .arap-btn[data-corner^=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-btn[data-corner^=bottom] {\n top: auto;\n bottom: max(16px, env(safe-area-inset-bottom));\n}\n.arap-root .arap-panel[data-corner^=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-root .arap-panel[data-corner^=bottom] {\n top: auto;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n}\n.arap-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n.arap-root .arap-skip-actions {\n position: absolute;\n top: 12px;\n left: 20px;\n width: 44px;\n height: 44px;\n clip-path: inset(50%);\n overflow: hidden;\n pointer-events: none;\n}\n.arap-root .arap-skip-actions:focus-visible {\n right: 20px;\n width: auto;\n height: auto;\n min-height: 44px;\n clip-path: none;\n pointer-events: auto;\n z-index: 2;\n padding: 8px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-accent);\n}\n.arap-skip-to-main {\n position: fixed;\n top: 12px;\n left: 16px;\n z-index: 2147483647;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n pointer-events: none;\n font-family: inherit;\n font-size: 0.9375rem;\n font-weight: 600;\n text-decoration: none;\n color: var(--arap-accent, #008060);\n background: var(--arap-surface, #ffffff);\n border-radius: 8px;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n.arap-skip-to-main:focus,\n.arap-skip-to-main:focus-visible {\n width: auto;\n height: auto;\n min-height: 44px;\n margin: 0;\n padding: 10px 18px;\n clip-path: none;\n overflow: visible;\n white-space: normal;\n pointer-events: auto;\n border: 2px solid var(--arap-accent, #008060);\n outline: 3px solid var(--arap-accent, #008060);\n outline-offset: 3px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n@media (forced-colors: active) {\n .arap-skip-to-main {\n background: Canvas;\n color: CanvasText;\n border-color: Highlight;\n }\n .arap-skip-to-main:focus,\n .arap-skip-to-main:focus-visible {\n outline: 3px solid Highlight;\n }\n}\n@media (max-height: 480px) {\n .arap-root .arap-panel {\n top: max(16px, env(safe-area-inset-top)) !important;\n bottom: max(16px, env(safe-area-inset-bottom)) !important;\n max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;\n padding: 8px;\n }\n .arap-heading {\n padding-bottom: 8px;\n }\n .arap-heading h2 {\n font-size: 18px;\n }\n .arap-heading button {\n margin-top: 0;\n }\n .arap-description {\n display: none;\n }\n .arap-quick-actions {\n padding-top: 8px;\n margin-top: 0;\n }\n .arap-root .arap-reset-btn {\n min-height: 44px;\n }\n .arap-root .arap-btn[data-open=true] {\n visibility: hidden;\n }\n .arap-position-popover {\n max-height: calc(100dvh - 96px);\n }\n}\n.arap-statement {\n flex: none;\n padding-top: 10px;\n text-align: center;\n}\n.arap-statement-link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 44px;\n padding: 6px 12px;\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 4px;\n font-size: 14px;\n font-weight: 500;\n border-radius: 8px;\n}\n.arap-statement-link:hover {\n color: var(--arap-accent-hover);\n background: var(--arap-selected);\n}\n.arap-statement-link:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-credits {\n display: flex;\n flex: none;\n flex-direction: column;\n gap: 2px;\n padding-top: 8px;\n color: var(--arap-muted);\n text-align: center;\n font-size: 11px;\n line-height: 1.4;\n}\n.arap-credits a {\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.arap-credits a:hover {\n color: var(--arap-accent-hover);\n}\n.arap-credits a:focus-visible {\n outline: 2px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-root .arap-btn[data-large-controls=true] {\n width: 64px;\n height: 64px;\n min-width: 48px;\n min-height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] {\n width: min(440px, calc(100vw - 32px));\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-heading button {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 32px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-btn-sm {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 24px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-value {\n min-width: 64px;\n font-size: 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-segment {\n min-width: 48px;\n min-height: 48px;\n padding: 10px 14px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle {\n width: 64px;\n height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle::before {\n inset: 8px 0;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-knob {\n top: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-active .arap-toggle-knob {\n transform: translateX(28px);\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-reset-btn {\n min-height: 52px;\n font-size: 16px;\n padding: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-button,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-default,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-arrows button {\n min-width: 48px;\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-popover select {\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-statement-link {\n min-height: 48px;\n font-size: 15px;\n padding: 10px 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-skip-actions {\n min-width: 48px;\n min-height: 48px;\n}\n.arap-feature-card {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 12px;\n}\n.arap-card-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-card-title {\n font-weight: 600;\n font-size: 15px;\n color: var(--arap-text);\n}\n.arap-card-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-status-badge {\n display: inline-flex;\n align-items: center;\n padding: 2px 8px;\n border-radius: 9999px;\n font-size: 11px;\n font-weight: 600;\n background: var(--arap-control);\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-card-alert {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 10px 12px;\n border-radius: 8px;\n font-size: 13px;\n line-height: 1.4;\n}\n.arap-alert-icon {\n flex: none;\n font-size: 16px;\n line-height: 1;\n}\n.arap-card-error {\n background: #fef2f2;\n border: 1px solid #fecaca;\n color: #991b1b;\n}\n.arap-card-unavailable {\n background: #f8fafc;\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n}\n.arap-card-permission {\n background: #fffbeb;\n border: 1px solid #fde68a;\n color: #92400e;\n}\n.arap-permission-content {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-permission-btn {\n align-self: flex-start;\n padding: 4px 10px;\n border: 1px solid #d97706;\n border-radius: 6px;\n background: #f59e0b;\n color: #fff;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n.arap-permission-btn:hover {\n background: #d97706;\n}\n.arap-card-content {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.arap-choice-group {\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: 100%;\n}\n.arap-choice-group-title {\n font-size: 12px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-choice-badge {\n font-size: 11px;\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--arap-divider);\n color: var(--arap-muted);\n}\n.arap-segment-active .arap-choice-badge {\n background: rgba(255, 255, 255, 0.25);\n color: #fff;\n}\n.arap-stepper-control-wrapper {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 100%;\n}\n.arap-slider-container {\n display: flex;\n align-items: center;\n padding: 4px 0;\n}\n.arap-slider {\n width: 100%;\n accent-color: var(--arap-accent);\n cursor: pointer;\n}\n.arap-search-count {\n padding: 6px 0;\n font-size: 12px;\n font-weight: 500;\n color: var(--arap-muted);\n}\n.arap-empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 24px 16px;\n gap: 8px;\n}\n.arap-empty-icon {\n font-size: 32px;\n}\n.arap-empty-title {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-empty-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n}\n.arap-empty-btn,\n.arap-retry-btn {\n margin-top: 6px;\n padding: 8px 16px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n font-weight: 500;\n font-size: 13px;\n color: var(--arap-text);\n cursor: pointer;\n}\n.arap-empty-btn:hover,\n.arap-retry-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n color: var(--arap-accent);\n}\n.arap-profile-card {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 16px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n transition: border-color 0.15s, box-shadow 0.15s;\n}\n.arap-profile-card-active {\n border-color: var(--arap-accent);\n background: var(--arap-selected);\n box-shadow: 0 0 0 1px var(--arap-accent);\n}\n.arap-profile-header {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.arap-profile-title-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-profile-title {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-profile-active-badge {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-accent);\n background: #dbeafe;\n padding: 2px 8px;\n border-radius: 9999px;\n}\n.arap-profile-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-profile-affected {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-profile-affected-label {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-profile-chips {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n.arap-profile-chip {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px;\n border-radius: 6px;\n background: var(--arap-control);\n border: 1px solid var(--arap-divider);\n font-size: 12px;\n color: var(--arap-text);\n}\n.arap-profile-actions {\n display: flex;\n gap: 8px;\n margin-top: 4px;\n}\n.arap-profile-apply-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-accent);\n color: #fff;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-apply-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-profile-revert-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-muted);\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-revert-btn:hover {\n background: var(--arap-control);\n color: var(--arap-text);\n border-color: var(--arap-text);\n}\n.arap-notice {\n grid-column: 1 / -1;\n margin-top: 6px;\n padding: 8px 12px;\n border-radius: 8px;\n font-size: 12px;\n line-height: 1.45;\n background: #fefce8;\n border: 1px solid #fef08a;\n color: #854d0e;\n}\n.arap-notice-warning {\n background: #fffbeb;\n border-color: #fde68a;\n color: #92400e;\n}\n.arap-reading-mask {\n position: fixed !important;\n left: 0 !important;\n right: 0 !important;\n pointer-events: none !important;\n user-select: none !important;\n -webkit-user-select: none !important;\n touch-action: none !important;\n z-index: 2147482999 !important;\n}\n.arap-reading-guide {\n position: fixed !important;\n left: 0 !important;\n right: 0 !important;\n pointer-events: none !important;\n user-select: none !important;\n -webkit-user-select: none !important;\n touch-action: none !important;\n z-index: 2147482999 !important;\n}\n.arap-feature-expandable {\n flex-direction: column !important;\n align-items: stretch !important;\n}\n.arap-accessible-tooltip {\n position: fixed !important;\n z-index: 2147483646 !important;\n max-width: 320px !important;\n min-width: 48px !important;\n box-sizing: border-box !important;\n padding: 6px 12px !important;\n background: #0f172a !important;\n color: #ffffff !important;\n font-family:\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n sans-serif !important;\n font-size: 13px !important;\n line-height: 1.4 !important;\n font-weight: 500 !important;\n border-radius: 6px !important;\n box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.15) !important;\n pointer-events: auto !important;\n word-break: break-word !important;\n white-space: normal !important;\n opacity: 0 !important;\n visibility: hidden !important;\n transition: opacity 120ms ease, transform 120ms ease !important;\n transform: translateY(2px) !important;\n}\n.arap-accessible-tooltip[data-visible=true] {\n opacity: 1 !important;\n visibility: visible !important;\n transform: translateY(0) !important;\n}\n.arap-accessible-tooltip[data-placement=top] {\n transform: translateY(-2px) !important;\n}\n.arap-accessible-tooltip[data-placement=top][data-visible=true] {\n transform: translateY(0) !important;\n}\n@media (forced-colors: active) {\n .arap-accessible-tooltip {\n background: Canvas !important;\n color: CanvasText !important;\n border: 2px solid Highlight !important;\n box-shadow: none !important;\n }\n}\n');
|
|
28
28
|
|
|
29
29
|
// src/core/AccessibilityPlugin.tsx
|
|
30
30
|
import {
|
|
@@ -337,17 +337,30 @@ for (const key of [
|
|
|
337
337
|
"hideImages",
|
|
338
338
|
"hideVideos",
|
|
339
339
|
"bigCursor",
|
|
340
|
-
"readingMask",
|
|
341
340
|
"readingGuide",
|
|
342
341
|
"highlightFocus",
|
|
343
342
|
"focusHighlight",
|
|
344
|
-
"reduceMotion"
|
|
343
|
+
"reduceMotion",
|
|
344
|
+
"tooltips",
|
|
345
|
+
"accessibleTooltips"
|
|
345
346
|
]) {
|
|
346
347
|
builtins[key] = {
|
|
347
348
|
defaultValue: false,
|
|
348
349
|
validate: (v) => typeof v === "boolean"
|
|
349
350
|
};
|
|
350
351
|
}
|
|
352
|
+
var DEFAULT_READING_MASK_HEIGHT = 100;
|
|
353
|
+
var MIN_READING_MASK_HEIGHT = 40;
|
|
354
|
+
var MAX_READING_MASK_HEIGHT = 400;
|
|
355
|
+
var READING_MASK_HEIGHT_PRESETS = [60, 100, 160, 240];
|
|
356
|
+
builtins.readingMask = {
|
|
357
|
+
defaultValue: false,
|
|
358
|
+
validate: (v) => typeof v === "boolean" || typeof v === "number" && v >= MIN_READING_MASK_HEIGHT && v <= MAX_READING_MASK_HEIGHT
|
|
359
|
+
};
|
|
360
|
+
builtins.readingMaskHeight = {
|
|
361
|
+
defaultValue: DEFAULT_READING_MASK_HEIGHT,
|
|
362
|
+
validate: (v) => typeof v === "number" && v >= MIN_READING_MASK_HEIGHT && v <= MAX_READING_MASK_HEIGHT
|
|
363
|
+
};
|
|
351
364
|
function validValue(key, value, fallback, validate) {
|
|
352
365
|
if (builtins[key]) return builtins[key].validate(value);
|
|
353
366
|
if (validate) {
|
|
@@ -405,6 +418,30 @@ function subscribeReducedMotion(callback) {
|
|
|
405
418
|
};
|
|
406
419
|
}
|
|
407
420
|
}
|
|
421
|
+
function hasFinePointer() {
|
|
422
|
+
if (typeof window === "undefined" || !window.matchMedia) return true;
|
|
423
|
+
try {
|
|
424
|
+
const fine = window.matchMedia("(pointer: fine)");
|
|
425
|
+
if (fine.matches) return true;
|
|
426
|
+
const coarse = window.matchMedia("(pointer: coarse)");
|
|
427
|
+
if (coarse.matches && !fine.matches) return false;
|
|
428
|
+
return true;
|
|
429
|
+
} catch {
|
|
430
|
+
return true;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
function subscribeFinePointer(callback) {
|
|
434
|
+
if (typeof window === "undefined" || !window.matchMedia) return () => {
|
|
435
|
+
};
|
|
436
|
+
try {
|
|
437
|
+
const mql = window.matchMedia("(pointer: fine)");
|
|
438
|
+
mql.addEventListener("change", callback);
|
|
439
|
+
return () => mql.removeEventListener("change", callback);
|
|
440
|
+
} catch {
|
|
441
|
+
return () => {
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
}
|
|
408
445
|
var CONTRAST_PALETTES = {
|
|
409
446
|
light: {
|
|
410
447
|
text: "#0f172a",
|
|
@@ -1223,8 +1260,12 @@ function applyPage(values) {
|
|
|
1223
1260
|
}
|
|
1224
1261
|
});
|
|
1225
1262
|
}
|
|
1263
|
+
const isFinePointer = hasFinePointer();
|
|
1264
|
+
if (values.bigCursor && isFinePointer) {
|
|
1265
|
+
set(document.body, "cursor", cursor);
|
|
1266
|
+
}
|
|
1226
1267
|
for (const el of elements) {
|
|
1227
|
-
if (values.bigCursor) set(el, "cursor", cursor);
|
|
1268
|
+
if (values.bigCursor && isFinePointer) set(el, "cursor", cursor);
|
|
1228
1269
|
if (values.hideImages) {
|
|
1229
1270
|
if (isEligibleDecorativeImage(el)) {
|
|
1230
1271
|
set(el, "visibility", "hidden");
|
|
@@ -1279,7 +1320,20 @@ function applyPage(values) {
|
|
|
1279
1320
|
for (const restore of undo.reverse()) restore();
|
|
1280
1321
|
};
|
|
1281
1322
|
}
|
|
1282
|
-
function
|
|
1323
|
+
function nudgeReadingAid(feature, delta) {
|
|
1324
|
+
if (typeof document !== "undefined") {
|
|
1325
|
+
try {
|
|
1326
|
+
document.dispatchEvent(
|
|
1327
|
+
new CustomEvent("arap:nudge-reading-aid", {
|
|
1328
|
+
detail: { feature, delta }
|
|
1329
|
+
})
|
|
1330
|
+
);
|
|
1331
|
+
} catch {
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
function readingAid(mask, height = 100, onDisable) {
|
|
1336
|
+
const featureKey = mask ? "readingMask" : "readingGuide";
|
|
1283
1337
|
const existing = document.body.querySelectorAll(
|
|
1284
1338
|
mask ? ".arap-reading-mask" : ".arap-reading-guide"
|
|
1285
1339
|
);
|
|
@@ -1288,27 +1342,114 @@ function readingAid(mask) {
|
|
|
1288
1342
|
el.dataset.arapUi = "";
|
|
1289
1343
|
el.className = mask ? "arap-reading-mask" : "arap-reading-guide";
|
|
1290
1344
|
el.setAttribute("aria-hidden", "true");
|
|
1291
|
-
|
|
1345
|
+
const aidHeight = mask ? Math.max(40, Math.min(400, height)) : 4;
|
|
1346
|
+
const halfHeight = mask ? aidHeight / 2 : 0;
|
|
1347
|
+
el.style.cssText = `position:fixed;left:0;right:0;top:50%;height:${aidHeight}px;pointer-events:none;z-index:2147482999;${mask ? "background:transparent;box-shadow:0 0 0 200vmax rgba(0,0,0,.65)" : "background:#2563eb;border:1px solid white"}`;
|
|
1348
|
+
el.style.setProperty("pointer-events", "none", "important");
|
|
1349
|
+
el.style.setProperty("user-select", "none", "important");
|
|
1350
|
+
el.style.setProperty("-webkit-user-select", "none", "important");
|
|
1351
|
+
el.style.setProperty("touch-action", "none", "important");
|
|
1292
1352
|
document.body.appendChild(el);
|
|
1353
|
+
let currentY = typeof window !== "undefined" && window.innerHeight ? window.innerHeight / 2 : 300;
|
|
1354
|
+
let trackedFocusEl = null;
|
|
1355
|
+
const clampY = (y) => {
|
|
1356
|
+
const vh = typeof window !== "undefined" && window.innerHeight ? window.innerHeight : 600;
|
|
1357
|
+
return Math.max(halfHeight, Math.min(vh - halfHeight, y));
|
|
1358
|
+
};
|
|
1293
1359
|
const move = (y) => {
|
|
1294
|
-
|
|
1360
|
+
currentY = clampY(y);
|
|
1361
|
+
el.style.top = `${Math.max(0, currentY - halfHeight)}px`;
|
|
1362
|
+
};
|
|
1363
|
+
move(currentY);
|
|
1364
|
+
const pointer = (event) => {
|
|
1365
|
+
if (typeof event.clientY === "number" && !isNaN(event.clientY)) {
|
|
1366
|
+
trackedFocusEl = null;
|
|
1367
|
+
move(event.clientY);
|
|
1368
|
+
}
|
|
1369
|
+
};
|
|
1370
|
+
const touch = (event) => {
|
|
1371
|
+
if (event.touches && event.touches.length > 0) {
|
|
1372
|
+
trackedFocusEl = null;
|
|
1373
|
+
move(event.touches[0].clientY);
|
|
1374
|
+
}
|
|
1295
1375
|
};
|
|
1296
|
-
const pointer = (event) => move(event.clientY);
|
|
1297
1376
|
const focus = (event) => {
|
|
1298
1377
|
if (event.target instanceof HTMLElement && !event.target.closest("[data-arap-ui]")) {
|
|
1378
|
+
trackedFocusEl = event.target;
|
|
1299
1379
|
const rect = event.target.getBoundingClientRect();
|
|
1300
1380
|
move(rect.top + rect.height / 2);
|
|
1301
1381
|
}
|
|
1302
1382
|
};
|
|
1383
|
+
const scroll = () => {
|
|
1384
|
+
if (trackedFocusEl && document.contains(trackedFocusEl)) {
|
|
1385
|
+
const rect = trackedFocusEl.getBoundingClientRect();
|
|
1386
|
+
move(rect.top + rect.height / 2);
|
|
1387
|
+
}
|
|
1388
|
+
};
|
|
1389
|
+
const keydown = (event) => {
|
|
1390
|
+
if (event.key === "Escape") {
|
|
1391
|
+
if (document.activeElement && document.activeElement.closest("[data-arap-ui]")) {
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1394
|
+
event.preventDefault();
|
|
1395
|
+
try {
|
|
1396
|
+
document.dispatchEvent(
|
|
1397
|
+
new CustomEvent("arap:disable-feature", { detail: featureKey })
|
|
1398
|
+
);
|
|
1399
|
+
} catch {
|
|
1400
|
+
}
|
|
1401
|
+
onDisable?.(featureKey);
|
|
1402
|
+
el.remove();
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
if (event.altKey && (event.key === "ArrowUp" || event.key === "ArrowDown")) {
|
|
1406
|
+
event.preventDefault();
|
|
1407
|
+
const delta = event.key === "ArrowUp" ? -30 : 30;
|
|
1408
|
+
move(currentY + delta);
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1411
|
+
const nudge = (event) => {
|
|
1412
|
+
const custom = event;
|
|
1413
|
+
if (custom.detail && custom.detail.feature === featureKey) {
|
|
1414
|
+
move(currentY + (custom.detail.delta || 0));
|
|
1415
|
+
}
|
|
1416
|
+
};
|
|
1417
|
+
const viewport = () => {
|
|
1418
|
+
move(currentY);
|
|
1419
|
+
};
|
|
1303
1420
|
document.addEventListener("pointermove", pointer, { passive: true });
|
|
1421
|
+
document.addEventListener("mousemove", pointer, { passive: true });
|
|
1422
|
+
document.addEventListener("touchmove", touch, { passive: true });
|
|
1423
|
+
document.addEventListener("touchstart", touch, { passive: true });
|
|
1304
1424
|
document.addEventListener("focusin", focus);
|
|
1425
|
+
document.addEventListener("arap:nudge-reading-aid", nudge);
|
|
1426
|
+
document.addEventListener("keydown", keydown);
|
|
1427
|
+
window.addEventListener("scroll", scroll, { passive: true });
|
|
1428
|
+
window.addEventListener("resize", viewport, { passive: true });
|
|
1429
|
+
window.addEventListener("keydown", keydown);
|
|
1430
|
+
if (typeof window !== "undefined" && window.visualViewport) {
|
|
1431
|
+
window.visualViewport.addEventListener("resize", viewport);
|
|
1432
|
+
window.visualViewport.addEventListener("scroll", viewport);
|
|
1433
|
+
}
|
|
1305
1434
|
return () => {
|
|
1306
1435
|
document.removeEventListener("pointermove", pointer);
|
|
1436
|
+
document.removeEventListener("mousemove", pointer);
|
|
1437
|
+
document.removeEventListener("touchmove", touch);
|
|
1438
|
+
document.removeEventListener("touchstart", touch);
|
|
1307
1439
|
document.removeEventListener("focusin", focus);
|
|
1440
|
+
document.removeEventListener("arap:nudge-reading-aid", nudge);
|
|
1441
|
+
document.removeEventListener("keydown", keydown);
|
|
1442
|
+
window.removeEventListener("scroll", scroll);
|
|
1443
|
+
window.removeEventListener("resize", viewport);
|
|
1444
|
+
window.removeEventListener("keydown", keydown);
|
|
1445
|
+
if (typeof window !== "undefined" && window.visualViewport) {
|
|
1446
|
+
window.visualViewport.removeEventListener("resize", viewport);
|
|
1447
|
+
window.visualViewport.removeEventListener("scroll", viewport);
|
|
1448
|
+
}
|
|
1308
1449
|
el.remove();
|
|
1309
1450
|
};
|
|
1310
1451
|
}
|
|
1311
|
-
function useBuiltinEffects(values) {
|
|
1452
|
+
function useBuiltinEffects(values, onDisable) {
|
|
1312
1453
|
useEffect(() => {
|
|
1313
1454
|
if (!Object.entries(values).some(
|
|
1314
1455
|
([key, value]) => key in builtins && value !== builtins[key].defaultValue
|
|
@@ -1347,14 +1488,283 @@ function useBuiltinEffects(values) {
|
|
|
1347
1488
|
undo();
|
|
1348
1489
|
};
|
|
1349
1490
|
}, [values]);
|
|
1350
|
-
useEffect(
|
|
1351
|
-
(
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1491
|
+
useEffect(() => {
|
|
1492
|
+
if (!values.readingMask) return;
|
|
1493
|
+
const height = typeof values.readingMaskHeight === "number" ? values.readingMaskHeight : typeof values.readingMask === "number" ? values.readingMask : 100;
|
|
1494
|
+
return readingAid(true, height, onDisable);
|
|
1495
|
+
}, [values.readingMask, values.readingMaskHeight, onDisable]);
|
|
1496
|
+
useEffect(() => {
|
|
1497
|
+
if (!values.readingGuide) return;
|
|
1498
|
+
return readingAid(false, 4, onDisable);
|
|
1499
|
+
}, [values.readingGuide, onDisable]);
|
|
1500
|
+
useEffect(() => {
|
|
1501
|
+
if (!values.tooltips && !values.accessibleTooltips) return;
|
|
1502
|
+
return enableAccessibleTooltips();
|
|
1503
|
+
}, [values.tooltips, values.accessibleTooltips]);
|
|
1504
|
+
}
|
|
1505
|
+
var SENSITIVE_AUTOCOMPLETE_PATTERN = /password|credit-card|cc-|card-|security-code|cvc|cvv|one-time-code/i;
|
|
1506
|
+
function getAuthoredDescription(element) {
|
|
1507
|
+
if (!(element instanceof HTMLElement || element instanceof SVGElement)) {
|
|
1508
|
+
return null;
|
|
1509
|
+
}
|
|
1510
|
+
if (element.closest("[data-arap-ui]")) {
|
|
1511
|
+
return null;
|
|
1512
|
+
}
|
|
1513
|
+
if (element.matches("script, style, link, meta, noscript, template")) {
|
|
1514
|
+
return null;
|
|
1515
|
+
}
|
|
1516
|
+
if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement || element instanceof HTMLSelectElement) {
|
|
1517
|
+
if (element instanceof HTMLInputElement && element.type === "password") {
|
|
1518
|
+
return null;
|
|
1519
|
+
}
|
|
1520
|
+
const ac = element.getAttribute("autocomplete");
|
|
1521
|
+
if (ac && SENSITIVE_AUTOCOMPLETE_PATTERN.test(ac)) {
|
|
1522
|
+
return null;
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
if (element.getAttribute("data-sensitive") === "true") {
|
|
1526
|
+
return null;
|
|
1527
|
+
}
|
|
1528
|
+
if (element.getAttribute("aria-hidden") === "true" || element.getAttribute("role") === "presentation" || element.getAttribute("role") === "none") {
|
|
1529
|
+
return null;
|
|
1530
|
+
}
|
|
1531
|
+
const ariaDesc = element.getAttribute("aria-description")?.trim();
|
|
1532
|
+
let describedByText = "";
|
|
1533
|
+
const describedBy = element.getAttribute("aria-describedby");
|
|
1534
|
+
if (describedBy) {
|
|
1535
|
+
const ids = describedBy.trim().split(/\s+/);
|
|
1536
|
+
const parts = [];
|
|
1537
|
+
for (const id of ids) {
|
|
1538
|
+
const target = document.getElementById(id);
|
|
1539
|
+
if (target) {
|
|
1540
|
+
const text = target.textContent?.trim();
|
|
1541
|
+
if (text) parts.push(text);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
if (parts.length > 0) {
|
|
1545
|
+
describedByText = parts.join(" ");
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
const explicitDesc = ariaDesc || describedByText || null;
|
|
1549
|
+
const ariaLabel = element.getAttribute("aria-label")?.trim() || null;
|
|
1550
|
+
const visibleText = (element.textContent || "").trim();
|
|
1551
|
+
const alt = element instanceof HTMLImageElement || element instanceof HTMLAreaElement || element instanceof HTMLInputElement && element.type === "image" ? element.getAttribute("alt")?.trim() || null : null;
|
|
1552
|
+
const title = element.getAttribute("title")?.trim() || null;
|
|
1553
|
+
if (explicitDesc) {
|
|
1554
|
+
if (ariaLabel && ariaLabel.toLowerCase() !== visibleText.toLowerCase() && ariaLabel.toLowerCase() !== explicitDesc.toLowerCase()) {
|
|
1555
|
+
return `${ariaLabel} \u2014 ${explicitDesc}`;
|
|
1556
|
+
}
|
|
1557
|
+
if (explicitDesc.toLowerCase() !== visibleText.toLowerCase()) {
|
|
1558
|
+
return explicitDesc;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
if (ariaLabel && ariaLabel.toLowerCase() !== visibleText.toLowerCase()) {
|
|
1562
|
+
return ariaLabel;
|
|
1563
|
+
}
|
|
1564
|
+
if (alt && alt !== "") {
|
|
1565
|
+
return alt;
|
|
1566
|
+
}
|
|
1567
|
+
if (title && title.toLowerCase() !== visibleText.toLowerCase()) {
|
|
1568
|
+
return title;
|
|
1569
|
+
}
|
|
1570
|
+
return null;
|
|
1571
|
+
}
|
|
1572
|
+
function positionTooltip(tooltip, target) {
|
|
1573
|
+
const rect = target.getBoundingClientRect();
|
|
1574
|
+
const tooltipRect = tooltip.getBoundingClientRect();
|
|
1575
|
+
const tooltipWidth = tooltipRect.width || tooltip.offsetWidth || 180;
|
|
1576
|
+
const tooltipHeight = tooltipRect.height || tooltip.offsetHeight || 32;
|
|
1577
|
+
const gap = 8;
|
|
1578
|
+
const vw = typeof window !== "undefined" && window.innerWidth || document.documentElement.clientWidth || 800;
|
|
1579
|
+
const vh = typeof window !== "undefined" && window.innerHeight || document.documentElement.clientHeight || 600;
|
|
1580
|
+
let placement = "top";
|
|
1581
|
+
let top = rect.top - tooltipHeight - gap;
|
|
1582
|
+
if (top < gap) {
|
|
1583
|
+
top = rect.bottom + gap;
|
|
1584
|
+
placement = "bottom";
|
|
1585
|
+
}
|
|
1586
|
+
if (top + tooltipHeight > vh - gap) {
|
|
1587
|
+
top = Math.max(gap, vh - tooltipHeight - gap);
|
|
1588
|
+
}
|
|
1589
|
+
let left = rect.left + (rect.width - tooltipWidth) / 2;
|
|
1590
|
+
left = Math.max(gap, Math.min(vw - tooltipWidth - gap, left));
|
|
1591
|
+
tooltip.style.top = `${Math.round(top)}px`;
|
|
1592
|
+
tooltip.style.left = `${Math.round(left)}px`;
|
|
1593
|
+
tooltip.setAttribute("data-placement", placement);
|
|
1594
|
+
}
|
|
1595
|
+
function enableAccessibleTooltips() {
|
|
1596
|
+
if (typeof document === "undefined") return () => {
|
|
1597
|
+
};
|
|
1598
|
+
let tooltipEl = document.createElement("div");
|
|
1599
|
+
tooltipEl.className = "arap-accessible-tooltip";
|
|
1600
|
+
tooltipEl.setAttribute("role", "presentation");
|
|
1601
|
+
tooltipEl.setAttribute("aria-hidden", "true");
|
|
1602
|
+
tooltipEl.setAttribute("data-arap-ui", "true");
|
|
1603
|
+
document.body.appendChild(tooltipEl);
|
|
1604
|
+
let activeTarget = null;
|
|
1605
|
+
let dismissedTarget = null;
|
|
1606
|
+
let hideTimeout = null;
|
|
1607
|
+
let isPointerOverTooltip = false;
|
|
1608
|
+
function show(target, text) {
|
|
1609
|
+
if (hideTimeout) {
|
|
1610
|
+
clearTimeout(hideTimeout);
|
|
1611
|
+
hideTimeout = null;
|
|
1612
|
+
}
|
|
1613
|
+
activeTarget = target;
|
|
1614
|
+
if (!tooltipEl || !document.body.contains(tooltipEl)) {
|
|
1615
|
+
tooltipEl = document.createElement("div");
|
|
1616
|
+
tooltipEl.className = "arap-accessible-tooltip";
|
|
1617
|
+
tooltipEl.setAttribute("role", "presentation");
|
|
1618
|
+
tooltipEl.setAttribute("aria-hidden", "true");
|
|
1619
|
+
tooltipEl.setAttribute("data-arap-ui", "true");
|
|
1620
|
+
document.body.appendChild(tooltipEl);
|
|
1621
|
+
}
|
|
1622
|
+
tooltipEl.textContent = text;
|
|
1623
|
+
tooltipEl.setAttribute("data-visible", "true");
|
|
1624
|
+
positionTooltip(tooltipEl, target);
|
|
1625
|
+
}
|
|
1626
|
+
function hide(immediate = false) {
|
|
1627
|
+
if (hideTimeout) {
|
|
1628
|
+
clearTimeout(hideTimeout);
|
|
1629
|
+
hideTimeout = null;
|
|
1630
|
+
}
|
|
1631
|
+
const doHide = () => {
|
|
1632
|
+
if (isPointerOverTooltip) return;
|
|
1633
|
+
if (tooltipEl) {
|
|
1634
|
+
tooltipEl.removeAttribute("data-visible");
|
|
1635
|
+
tooltipEl.style.top = "-9999px";
|
|
1636
|
+
tooltipEl.style.left = "-9999px";
|
|
1637
|
+
}
|
|
1638
|
+
activeTarget = null;
|
|
1639
|
+
};
|
|
1640
|
+
if (immediate) {
|
|
1641
|
+
doHide();
|
|
1642
|
+
} else {
|
|
1643
|
+
hideTimeout = setTimeout(doHide, 100);
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
function findTargetWithDescription(node) {
|
|
1647
|
+
if (!(node instanceof Element)) return null;
|
|
1648
|
+
if (node.closest("[data-arap-ui]")) return null;
|
|
1649
|
+
let curr = node;
|
|
1650
|
+
while (curr && curr !== document.body && curr !== document.documentElement) {
|
|
1651
|
+
const desc = getAuthoredDescription(curr);
|
|
1652
|
+
if (desc) return { element: curr, text: desc };
|
|
1653
|
+
curr = curr.parentElement;
|
|
1654
|
+
}
|
|
1655
|
+
return null;
|
|
1656
|
+
}
|
|
1657
|
+
const handlePointerOver = (event) => {
|
|
1658
|
+
if (tooltipEl && (event.target === tooltipEl || tooltipEl.contains(event.target))) {
|
|
1659
|
+
isPointerOverTooltip = true;
|
|
1660
|
+
if (hideTimeout) {
|
|
1661
|
+
clearTimeout(hideTimeout);
|
|
1662
|
+
hideTimeout = null;
|
|
1663
|
+
}
|
|
1664
|
+
return;
|
|
1665
|
+
}
|
|
1666
|
+
const match = findTargetWithDescription(event.target);
|
|
1667
|
+
if (!match) {
|
|
1668
|
+
if (activeTarget && !isPointerOverTooltip) {
|
|
1669
|
+
hide();
|
|
1670
|
+
}
|
|
1671
|
+
return;
|
|
1672
|
+
}
|
|
1673
|
+
if (match.element === dismissedTarget) {
|
|
1674
|
+
return;
|
|
1675
|
+
}
|
|
1676
|
+
if (match.element === activeTarget) {
|
|
1677
|
+
if (hideTimeout) {
|
|
1678
|
+
clearTimeout(hideTimeout);
|
|
1679
|
+
hideTimeout = null;
|
|
1680
|
+
}
|
|
1681
|
+
return;
|
|
1682
|
+
}
|
|
1683
|
+
show(match.element, match.text);
|
|
1684
|
+
};
|
|
1685
|
+
const handlePointerOut = (event) => {
|
|
1686
|
+
if (dismissedTarget === event.target) {
|
|
1687
|
+
dismissedTarget = null;
|
|
1688
|
+
}
|
|
1689
|
+
if (tooltipEl && (event.target === tooltipEl || tooltipEl.contains(event.target))) {
|
|
1690
|
+
isPointerOverTooltip = false;
|
|
1691
|
+
const related = event.relatedTarget;
|
|
1692
|
+
if (activeTarget && (activeTarget === related || activeTarget.contains(related))) {
|
|
1693
|
+
return;
|
|
1694
|
+
}
|
|
1695
|
+
hide();
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1698
|
+
const match = findTargetWithDescription(event.target);
|
|
1699
|
+
if (match && match.element === activeTarget) {
|
|
1700
|
+
const related = event.relatedTarget;
|
|
1701
|
+
if (tooltipEl && (related === tooltipEl || tooltipEl.contains(related))) {
|
|
1702
|
+
return;
|
|
1703
|
+
}
|
|
1704
|
+
hide();
|
|
1705
|
+
}
|
|
1706
|
+
};
|
|
1707
|
+
const handleFocusIn = (event) => {
|
|
1708
|
+
const match = findTargetWithDescription(event.target);
|
|
1709
|
+
if (!match) {
|
|
1710
|
+
hide(true);
|
|
1711
|
+
return;
|
|
1712
|
+
}
|
|
1713
|
+
if (match.element === dismissedTarget) {
|
|
1714
|
+
return;
|
|
1715
|
+
}
|
|
1716
|
+
show(match.element, match.text);
|
|
1717
|
+
};
|
|
1718
|
+
const handleFocusOut = (event) => {
|
|
1719
|
+
if (dismissedTarget === event.target) {
|
|
1720
|
+
dismissedTarget = null;
|
|
1721
|
+
}
|
|
1722
|
+
if (activeTarget && activeTarget === event.target) {
|
|
1723
|
+
hide(true);
|
|
1724
|
+
}
|
|
1725
|
+
};
|
|
1726
|
+
const handleKeyDown = (event) => {
|
|
1727
|
+
if (event.key === "Escape" && activeTarget) {
|
|
1728
|
+
dismissedTarget = activeTarget;
|
|
1729
|
+
hide(true);
|
|
1730
|
+
}
|
|
1731
|
+
};
|
|
1732
|
+
const handleReposition = () => {
|
|
1733
|
+
if (activeTarget && tooltipEl && tooltipEl.getAttribute("data-visible") === "true") {
|
|
1734
|
+
if (!document.contains(activeTarget)) {
|
|
1735
|
+
hide(true);
|
|
1736
|
+
return;
|
|
1737
|
+
}
|
|
1738
|
+
positionTooltip(tooltipEl, activeTarget);
|
|
1739
|
+
}
|
|
1740
|
+
};
|
|
1741
|
+
document.addEventListener("pointerover", handlePointerOver, {
|
|
1742
|
+
passive: true
|
|
1743
|
+
});
|
|
1744
|
+
document.addEventListener("mouseover", handlePointerOver, { passive: true });
|
|
1745
|
+
document.addEventListener("pointerout", handlePointerOut, { passive: true });
|
|
1746
|
+
document.addEventListener("mouseout", handlePointerOut, { passive: true });
|
|
1747
|
+
document.addEventListener("focusin", handleFocusIn);
|
|
1748
|
+
document.addEventListener("focusout", handleFocusOut);
|
|
1749
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1750
|
+
window.addEventListener("scroll", handleReposition, { passive: true });
|
|
1751
|
+
window.addEventListener("resize", handleReposition, { passive: true });
|
|
1752
|
+
return () => {
|
|
1753
|
+
if (hideTimeout) clearTimeout(hideTimeout);
|
|
1754
|
+
document.removeEventListener("pointerover", handlePointerOver);
|
|
1755
|
+
document.removeEventListener("mouseover", handlePointerOver);
|
|
1756
|
+
document.removeEventListener("pointerout", handlePointerOut);
|
|
1757
|
+
document.removeEventListener("mouseout", handlePointerOut);
|
|
1758
|
+
document.removeEventListener("focusin", handleFocusIn);
|
|
1759
|
+
document.removeEventListener("focusout", handleFocusOut);
|
|
1760
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
1761
|
+
window.removeEventListener("scroll", handleReposition);
|
|
1762
|
+
window.removeEventListener("resize", handleReposition);
|
|
1763
|
+
if (tooltipEl) {
|
|
1764
|
+
tooltipEl.remove();
|
|
1765
|
+
tooltipEl = null;
|
|
1766
|
+
}
|
|
1767
|
+
};
|
|
1358
1768
|
}
|
|
1359
1769
|
function CustomEffect({
|
|
1360
1770
|
definition,
|
|
@@ -1480,7 +1890,23 @@ function AccessibilityPlugin({
|
|
|
1480
1890
|
),
|
|
1481
1891
|
[definitions, getFeatureState]
|
|
1482
1892
|
);
|
|
1483
|
-
|
|
1893
|
+
const handleDisable = useCallback2(
|
|
1894
|
+
(key) => {
|
|
1895
|
+
setFeatureState(key, builtins[key]?.defaultValue ?? false);
|
|
1896
|
+
},
|
|
1897
|
+
[setFeatureState]
|
|
1898
|
+
);
|
|
1899
|
+
useEffect2(() => {
|
|
1900
|
+
const handler = (event) => {
|
|
1901
|
+
const custom = event;
|
|
1902
|
+
if (custom.detail && (custom.detail in builtins || custom.detail === "readingMask" || custom.detail === "readingGuide")) {
|
|
1903
|
+
handleDisable(custom.detail);
|
|
1904
|
+
}
|
|
1905
|
+
};
|
|
1906
|
+
document.addEventListener("arap:disable-feature", handler);
|
|
1907
|
+
return () => document.removeEventListener("arap:disable-feature", handler);
|
|
1908
|
+
}, [handleDisable]);
|
|
1909
|
+
useBuiltinEffects(active, handleDisable);
|
|
1484
1910
|
const value = useMemo(
|
|
1485
1911
|
() => ({
|
|
1486
1912
|
state: { isOpen, features },
|
|
@@ -2563,6 +2989,14 @@ var drawings = {
|
|
|
2563
2989
|
/* @__PURE__ */ jsx7("path", { d: "M3 5h18M3 10h12M3 19h18" }),
|
|
2564
2990
|
/* @__PURE__ */ jsx7("path", { d: "M2 15h20", strokeWidth: "3" })
|
|
2565
2991
|
] }),
|
|
2992
|
+
tooltips: /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
2993
|
+
/* @__PURE__ */ jsx7("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }),
|
|
2994
|
+
/* @__PURE__ */ jsx7("path", { d: "M8 9h8M8 13h5" })
|
|
2995
|
+
] }),
|
|
2996
|
+
accessibleTooltips: /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
2997
|
+
/* @__PURE__ */ jsx7("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }),
|
|
2998
|
+
/* @__PURE__ */ jsx7("path", { d: "M8 9h8M8 13h5" })
|
|
2999
|
+
] }),
|
|
2566
3000
|
reset: /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7("path", { d: "M3 10a9 9 0 1 1 1 7M3 4v6h6" }) })
|
|
2567
3001
|
};
|
|
2568
3002
|
function FeatureIcon({ name }) {
|
|
@@ -3482,18 +3916,38 @@ function HideVideosController() {
|
|
|
3482
3916
|
}
|
|
3483
3917
|
|
|
3484
3918
|
// src/features/BigCursorController.tsx
|
|
3919
|
+
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
3485
3920
|
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3486
3921
|
var FEATURE_KEY17 = "bigCursor";
|
|
3487
3922
|
var DEFAULT_VALUE17 = false;
|
|
3488
|
-
function BigCursorController(
|
|
3923
|
+
function BigCursorController({
|
|
3924
|
+
showCapabilityHint = true
|
|
3925
|
+
} = {}) {
|
|
3489
3926
|
const { value, setValue } = useAccessibility(
|
|
3490
3927
|
FEATURE_KEY17,
|
|
3491
3928
|
DEFAULT_VALUE17
|
|
3492
3929
|
);
|
|
3930
|
+
const [finePointer, setFinePointer] = useState6(
|
|
3931
|
+
() => hasFinePointer()
|
|
3932
|
+
);
|
|
3933
|
+
useEffect6(() => {
|
|
3934
|
+
return subscribeFinePointer(() => {
|
|
3935
|
+
setFinePointer(hasFinePointer());
|
|
3936
|
+
});
|
|
3937
|
+
}, []);
|
|
3493
3938
|
return /* @__PURE__ */ jsxs22("div", { className: "arap-feature", role: "group", "aria-label": "Big Cursor", children: [
|
|
3494
3939
|
/* @__PURE__ */ jsxs22("span", { className: "arap-label", children: [
|
|
3495
3940
|
/* @__PURE__ */ jsx24(FeatureIcon, { name: FEATURE_KEY17 }),
|
|
3496
|
-
/* @__PURE__ */ jsx24("span", { children: "Big Cursor" })
|
|
3941
|
+
/* @__PURE__ */ jsx24("span", { children: "Big Cursor" }),
|
|
3942
|
+
showCapabilityHint && !finePointer && /* @__PURE__ */ jsx24(
|
|
3943
|
+
"span",
|
|
3944
|
+
{
|
|
3945
|
+
className: "arap-badge",
|
|
3946
|
+
style: { fontSize: "0.75rem", opacity: 0.8, marginLeft: "4px" },
|
|
3947
|
+
title: "Custom cursor requires mouse or trackpad pointer hardware",
|
|
3948
|
+
children: "(Mouse)"
|
|
3949
|
+
}
|
|
3950
|
+
)
|
|
3497
3951
|
] }),
|
|
3498
3952
|
/* @__PURE__ */ jsx24(
|
|
3499
3953
|
"button",
|
|
@@ -3512,57 +3966,301 @@ function BigCursorController() {
|
|
|
3512
3966
|
// src/features/ReadingMaskController.tsx
|
|
3513
3967
|
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3514
3968
|
var FEATURE_KEY18 = "readingMask";
|
|
3969
|
+
var HEIGHT_KEY = "readingMaskHeight";
|
|
3515
3970
|
var DEFAULT_VALUE18 = false;
|
|
3516
|
-
|
|
3971
|
+
var DEFAULT_HEIGHT = 100;
|
|
3972
|
+
var MIN_HEIGHT = 40;
|
|
3973
|
+
var MAX_HEIGHT = 300;
|
|
3974
|
+
var STEP_HEIGHT = 20;
|
|
3975
|
+
function ReadingMaskController({
|
|
3976
|
+
minHeight = MIN_HEIGHT,
|
|
3977
|
+
maxHeight = MAX_HEIGHT,
|
|
3978
|
+
step = STEP_HEIGHT
|
|
3979
|
+
} = {}) {
|
|
3517
3980
|
const { value, setValue } = useAccessibility(
|
|
3518
3981
|
FEATURE_KEY18,
|
|
3519
3982
|
DEFAULT_VALUE18
|
|
3520
3983
|
);
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
)
|
|
3537
|
-
|
|
3984
|
+
const { value: height, setValue: setHeight } = useAccessibility(
|
|
3985
|
+
HEIGHT_KEY,
|
|
3986
|
+
DEFAULT_HEIGHT
|
|
3987
|
+
);
|
|
3988
|
+
const currentHeight = typeof height === "number" ? height : DEFAULT_HEIGHT;
|
|
3989
|
+
const handleDecreaseHeight = () => {
|
|
3990
|
+
setHeight(Math.max(minHeight, currentHeight - step));
|
|
3991
|
+
};
|
|
3992
|
+
const handleIncreaseHeight = () => {
|
|
3993
|
+
setHeight(Math.min(maxHeight, currentHeight + step));
|
|
3994
|
+
};
|
|
3995
|
+
const handleNudgeUp = () => {
|
|
3996
|
+
nudgeReadingAid("readingMask", -30);
|
|
3997
|
+
};
|
|
3998
|
+
const handleNudgeDown = () => {
|
|
3999
|
+
nudgeReadingAid("readingMask", 30);
|
|
4000
|
+
};
|
|
4001
|
+
return /* @__PURE__ */ jsxs23(
|
|
4002
|
+
"div",
|
|
4003
|
+
{
|
|
4004
|
+
className: "arap-feature arap-feature-expandable",
|
|
4005
|
+
role: "group",
|
|
4006
|
+
"aria-label": "Reading Mask",
|
|
4007
|
+
children: [
|
|
4008
|
+
/* @__PURE__ */ jsxs23(
|
|
4009
|
+
"div",
|
|
4010
|
+
{
|
|
4011
|
+
className: "arap-feature-header",
|
|
4012
|
+
style: {
|
|
4013
|
+
display: "flex",
|
|
4014
|
+
alignItems: "center",
|
|
4015
|
+
justifyContent: "space-between",
|
|
4016
|
+
width: "100%"
|
|
4017
|
+
},
|
|
4018
|
+
children: [
|
|
4019
|
+
/* @__PURE__ */ jsxs23("span", { className: "arap-label", children: [
|
|
4020
|
+
/* @__PURE__ */ jsx25(FeatureIcon, { name: FEATURE_KEY18 }),
|
|
4021
|
+
/* @__PURE__ */ jsx25("span", { children: "Reading Mask" })
|
|
4022
|
+
] }),
|
|
4023
|
+
/* @__PURE__ */ jsx25(
|
|
4024
|
+
"button",
|
|
4025
|
+
{
|
|
4026
|
+
className: `arap-toggle ${value ? "arap-toggle-active" : ""}`,
|
|
4027
|
+
onClick: () => setValue(!value),
|
|
4028
|
+
"aria-label": "Reading Mask",
|
|
4029
|
+
"aria-pressed": value,
|
|
4030
|
+
type: "button",
|
|
4031
|
+
children: /* @__PURE__ */ jsx25("span", { className: "arap-toggle-knob", "aria-hidden": "true" })
|
|
4032
|
+
}
|
|
4033
|
+
)
|
|
4034
|
+
]
|
|
4035
|
+
}
|
|
4036
|
+
),
|
|
4037
|
+
value && /* @__PURE__ */ jsxs23(
|
|
4038
|
+
"div",
|
|
4039
|
+
{
|
|
4040
|
+
className: "arap-subcontrols",
|
|
4041
|
+
style: {
|
|
4042
|
+
marginTop: "8px",
|
|
4043
|
+
paddingTop: "8px",
|
|
4044
|
+
borderTop: "1px solid var(--arap-divider, #e5e7eb)",
|
|
4045
|
+
display: "flex",
|
|
4046
|
+
flexDirection: "column",
|
|
4047
|
+
gap: "8px",
|
|
4048
|
+
width: "100%"
|
|
4049
|
+
},
|
|
4050
|
+
children: [
|
|
4051
|
+
/* @__PURE__ */ jsxs23(
|
|
4052
|
+
"div",
|
|
4053
|
+
{
|
|
4054
|
+
style: {
|
|
4055
|
+
display: "flex",
|
|
4056
|
+
alignItems: "center",
|
|
4057
|
+
justifyContent: "space-between",
|
|
4058
|
+
width: "100%"
|
|
4059
|
+
},
|
|
4060
|
+
children: [
|
|
4061
|
+
/* @__PURE__ */ jsx25(
|
|
4062
|
+
"span",
|
|
4063
|
+
{
|
|
4064
|
+
style: {
|
|
4065
|
+
fontSize: "0.85rem",
|
|
4066
|
+
color: "var(--arap-muted, #4b5563)"
|
|
4067
|
+
},
|
|
4068
|
+
children: "Window Height"
|
|
4069
|
+
}
|
|
4070
|
+
),
|
|
4071
|
+
/* @__PURE__ */ jsxs23("div", { className: "arap-controls", children: [
|
|
4072
|
+
/* @__PURE__ */ jsx25(
|
|
4073
|
+
"button",
|
|
4074
|
+
{
|
|
4075
|
+
className: "arap-btn-sm",
|
|
4076
|
+
onClick: handleDecreaseHeight,
|
|
4077
|
+
disabled: currentHeight <= minHeight,
|
|
4078
|
+
"aria-label": "Decrease reading mask height",
|
|
4079
|
+
type: "button",
|
|
4080
|
+
children: "\u2212"
|
|
4081
|
+
}
|
|
4082
|
+
),
|
|
4083
|
+
/* @__PURE__ */ jsxs23("output", { className: "arap-value", "aria-live": "polite", children: [
|
|
4084
|
+
currentHeight,
|
|
4085
|
+
"px"
|
|
4086
|
+
] }),
|
|
4087
|
+
/* @__PURE__ */ jsx25(
|
|
4088
|
+
"button",
|
|
4089
|
+
{
|
|
4090
|
+
className: "arap-btn-sm",
|
|
4091
|
+
onClick: handleIncreaseHeight,
|
|
4092
|
+
disabled: currentHeight >= maxHeight,
|
|
4093
|
+
"aria-label": "Increase reading mask height",
|
|
4094
|
+
type: "button",
|
|
4095
|
+
children: "+"
|
|
4096
|
+
}
|
|
4097
|
+
)
|
|
4098
|
+
] })
|
|
4099
|
+
]
|
|
4100
|
+
}
|
|
4101
|
+
),
|
|
4102
|
+
/* @__PURE__ */ jsxs23(
|
|
4103
|
+
"div",
|
|
4104
|
+
{
|
|
4105
|
+
style: {
|
|
4106
|
+
display: "flex",
|
|
4107
|
+
alignItems: "center",
|
|
4108
|
+
justifyContent: "space-between",
|
|
4109
|
+
width: "100%"
|
|
4110
|
+
},
|
|
4111
|
+
children: [
|
|
4112
|
+
/* @__PURE__ */ jsx25(
|
|
4113
|
+
"span",
|
|
4114
|
+
{
|
|
4115
|
+
style: {
|
|
4116
|
+
fontSize: "0.85rem",
|
|
4117
|
+
color: "var(--arap-muted, #4b5563)"
|
|
4118
|
+
},
|
|
4119
|
+
children: "Move Window"
|
|
4120
|
+
}
|
|
4121
|
+
),
|
|
4122
|
+
/* @__PURE__ */ jsxs23("div", { className: "arap-controls", children: [
|
|
4123
|
+
/* @__PURE__ */ jsx25(
|
|
4124
|
+
"button",
|
|
4125
|
+
{
|
|
4126
|
+
className: "arap-btn-sm",
|
|
4127
|
+
onClick: handleNudgeUp,
|
|
4128
|
+
"aria-label": "Move reading mask up",
|
|
4129
|
+
title: "Alt+Up Arrow",
|
|
4130
|
+
type: "button",
|
|
4131
|
+
children: "\u2191"
|
|
4132
|
+
}
|
|
4133
|
+
),
|
|
4134
|
+
/* @__PURE__ */ jsx25(
|
|
4135
|
+
"button",
|
|
4136
|
+
{
|
|
4137
|
+
className: "arap-btn-sm",
|
|
4138
|
+
onClick: handleNudgeDown,
|
|
4139
|
+
"aria-label": "Move reading mask down",
|
|
4140
|
+
title: "Alt+Down Arrow",
|
|
4141
|
+
type: "button",
|
|
4142
|
+
children: "\u2193"
|
|
4143
|
+
}
|
|
4144
|
+
)
|
|
4145
|
+
] })
|
|
4146
|
+
]
|
|
4147
|
+
}
|
|
4148
|
+
)
|
|
4149
|
+
]
|
|
4150
|
+
}
|
|
4151
|
+
)
|
|
4152
|
+
]
|
|
4153
|
+
}
|
|
4154
|
+
);
|
|
3538
4155
|
}
|
|
3539
4156
|
|
|
3540
4157
|
// src/features/ReadingGuideController.tsx
|
|
3541
4158
|
import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3542
4159
|
var FEATURE_KEY19 = "readingGuide";
|
|
3543
4160
|
var DEFAULT_VALUE19 = false;
|
|
3544
|
-
function ReadingGuideController(
|
|
4161
|
+
function ReadingGuideController({
|
|
4162
|
+
nudgeStep = 30
|
|
4163
|
+
} = {}) {
|
|
3545
4164
|
const { value, setValue } = useAccessibility(
|
|
3546
4165
|
FEATURE_KEY19,
|
|
3547
4166
|
DEFAULT_VALUE19
|
|
3548
4167
|
);
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
4168
|
+
const handleNudgeUp = () => {
|
|
4169
|
+
nudgeReadingAid("readingGuide", -nudgeStep);
|
|
4170
|
+
};
|
|
4171
|
+
const handleNudgeDown = () => {
|
|
4172
|
+
nudgeReadingAid("readingGuide", nudgeStep);
|
|
4173
|
+
};
|
|
4174
|
+
return /* @__PURE__ */ jsxs24(
|
|
4175
|
+
"div",
|
|
4176
|
+
{
|
|
4177
|
+
className: "arap-feature arap-feature-expandable",
|
|
4178
|
+
role: "group",
|
|
4179
|
+
"aria-label": "Reading Guide",
|
|
4180
|
+
children: [
|
|
4181
|
+
/* @__PURE__ */ jsxs24(
|
|
4182
|
+
"div",
|
|
4183
|
+
{
|
|
4184
|
+
className: "arap-feature-header",
|
|
4185
|
+
style: {
|
|
4186
|
+
display: "flex",
|
|
4187
|
+
alignItems: "center",
|
|
4188
|
+
justifyContent: "space-between",
|
|
4189
|
+
width: "100%"
|
|
4190
|
+
},
|
|
4191
|
+
children: [
|
|
4192
|
+
/* @__PURE__ */ jsxs24("span", { className: "arap-label", children: [
|
|
4193
|
+
/* @__PURE__ */ jsx26(FeatureIcon, { name: FEATURE_KEY19 }),
|
|
4194
|
+
/* @__PURE__ */ jsx26("span", { children: "Reading Guide" })
|
|
4195
|
+
] }),
|
|
4196
|
+
/* @__PURE__ */ jsx26(
|
|
4197
|
+
"button",
|
|
4198
|
+
{
|
|
4199
|
+
className: `arap-toggle ${value ? "arap-toggle-active" : ""}`,
|
|
4200
|
+
onClick: () => setValue(!value),
|
|
4201
|
+
"aria-label": "Reading Guide",
|
|
4202
|
+
"aria-pressed": value,
|
|
4203
|
+
type: "button",
|
|
4204
|
+
children: /* @__PURE__ */ jsx26("span", { className: "arap-toggle-knob", "aria-hidden": "true" })
|
|
4205
|
+
}
|
|
4206
|
+
)
|
|
4207
|
+
]
|
|
4208
|
+
}
|
|
4209
|
+
),
|
|
4210
|
+
value && /* @__PURE__ */ jsxs24(
|
|
4211
|
+
"div",
|
|
4212
|
+
{
|
|
4213
|
+
className: "arap-subcontrols",
|
|
4214
|
+
style: {
|
|
4215
|
+
marginTop: "8px",
|
|
4216
|
+
paddingTop: "8px",
|
|
4217
|
+
borderTop: "1px solid var(--arap-divider, #e5e7eb)",
|
|
4218
|
+
display: "flex",
|
|
4219
|
+
alignItems: "center",
|
|
4220
|
+
justifyContent: "space-between",
|
|
4221
|
+
width: "100%"
|
|
4222
|
+
},
|
|
4223
|
+
children: [
|
|
4224
|
+
/* @__PURE__ */ jsx26(
|
|
4225
|
+
"span",
|
|
4226
|
+
{
|
|
4227
|
+
style: {
|
|
4228
|
+
fontSize: "0.85rem",
|
|
4229
|
+
color: "var(--arap-muted, #4b5563)"
|
|
4230
|
+
},
|
|
4231
|
+
children: "Move Guide"
|
|
4232
|
+
}
|
|
4233
|
+
),
|
|
4234
|
+
/* @__PURE__ */ jsxs24("div", { className: "arap-controls", children: [
|
|
4235
|
+
/* @__PURE__ */ jsx26(
|
|
4236
|
+
"button",
|
|
4237
|
+
{
|
|
4238
|
+
className: "arap-btn-sm",
|
|
4239
|
+
onClick: handleNudgeUp,
|
|
4240
|
+
"aria-label": "Move reading guide up",
|
|
4241
|
+
title: "Alt+Up Arrow",
|
|
4242
|
+
type: "button",
|
|
4243
|
+
children: "\u2191"
|
|
4244
|
+
}
|
|
4245
|
+
),
|
|
4246
|
+
/* @__PURE__ */ jsx26(
|
|
4247
|
+
"button",
|
|
4248
|
+
{
|
|
4249
|
+
className: "arap-btn-sm",
|
|
4250
|
+
onClick: handleNudgeDown,
|
|
4251
|
+
"aria-label": "Move reading guide down",
|
|
4252
|
+
title: "Alt+Down Arrow",
|
|
4253
|
+
type: "button",
|
|
4254
|
+
children: "\u2193"
|
|
4255
|
+
}
|
|
4256
|
+
)
|
|
4257
|
+
] })
|
|
4258
|
+
]
|
|
4259
|
+
}
|
|
4260
|
+
)
|
|
4261
|
+
]
|
|
4262
|
+
}
|
|
4263
|
+
);
|
|
3566
4264
|
}
|
|
3567
4265
|
|
|
3568
4266
|
// src/features/HighlightFocusController.tsx
|
|
@@ -3629,10 +4327,66 @@ function ReduceMotionController() {
|
|
|
3629
4327
|
] });
|
|
3630
4328
|
}
|
|
3631
4329
|
|
|
4330
|
+
// src/features/TooltipsController.tsx
|
|
4331
|
+
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
4332
|
+
var FEATURE_KEY22 = "tooltips";
|
|
4333
|
+
var DEFAULT_VALUE22 = false;
|
|
4334
|
+
function TooltipsController({
|
|
4335
|
+
className = "",
|
|
4336
|
+
label = "Accessible Tooltips",
|
|
4337
|
+
description = "Show authored alt text and descriptions on hover or focus"
|
|
4338
|
+
}) {
|
|
4339
|
+
const { value, setValue } = useAccessibility(
|
|
4340
|
+
FEATURE_KEY22,
|
|
4341
|
+
DEFAULT_VALUE22
|
|
4342
|
+
);
|
|
4343
|
+
return /* @__PURE__ */ jsxs27(
|
|
4344
|
+
"div",
|
|
4345
|
+
{
|
|
4346
|
+
className: `arap-feature ${className}`,
|
|
4347
|
+
role: "group",
|
|
4348
|
+
"aria-label": label,
|
|
4349
|
+
children: [
|
|
4350
|
+
/* @__PURE__ */ jsxs27("span", { className: "arap-label", children: [
|
|
4351
|
+
/* @__PURE__ */ jsx29(FeatureIcon, { name: FEATURE_KEY22 }),
|
|
4352
|
+
/* @__PURE__ */ jsxs27("span", { children: [
|
|
4353
|
+
/* @__PURE__ */ jsx29("span", { style: { display: "block" }, children: label }),
|
|
4354
|
+
description && /* @__PURE__ */ jsx29(
|
|
4355
|
+
"span",
|
|
4356
|
+
{
|
|
4357
|
+
style: {
|
|
4358
|
+
display: "block",
|
|
4359
|
+
fontSize: "11px",
|
|
4360
|
+
fontWeight: 400,
|
|
4361
|
+
color: "var(--arap-muted, #64748b)",
|
|
4362
|
+
marginTop: "1px"
|
|
4363
|
+
},
|
|
4364
|
+
children: description
|
|
4365
|
+
}
|
|
4366
|
+
)
|
|
4367
|
+
] })
|
|
4368
|
+
] }),
|
|
4369
|
+
/* @__PURE__ */ jsx29(
|
|
4370
|
+
"button",
|
|
4371
|
+
{
|
|
4372
|
+
className: `arap-toggle ${value ? "arap-toggle-active" : ""}`,
|
|
4373
|
+
onClick: () => setValue(!value),
|
|
4374
|
+
"aria-label": label,
|
|
4375
|
+
"aria-pressed": Boolean(value),
|
|
4376
|
+
type: "button",
|
|
4377
|
+
children: /* @__PURE__ */ jsx29("span", { className: "arap-toggle-knob", "aria-hidden": "true" })
|
|
4378
|
+
}
|
|
4379
|
+
)
|
|
4380
|
+
]
|
|
4381
|
+
}
|
|
4382
|
+
);
|
|
4383
|
+
}
|
|
4384
|
+
var AccessibleTooltipsController = TooltipsController;
|
|
4385
|
+
|
|
3632
4386
|
// src/features/ResetController.tsx
|
|
3633
4387
|
import { createPortal as createPortal2 } from "react-dom";
|
|
3634
4388
|
import { useContext as useContext6 } from "react";
|
|
3635
|
-
import { jsx as
|
|
4389
|
+
import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3636
4390
|
function ResetController() {
|
|
3637
4391
|
const ctx = useContext6(AccessibilityContext);
|
|
3638
4392
|
if (!ctx) {
|
|
@@ -3643,15 +4397,15 @@ function ResetController() {
|
|
|
3643
4397
|
const actionHost = useContext6(PanelActionsContext);
|
|
3644
4398
|
const { resetAll } = ctx;
|
|
3645
4399
|
const strings = resolveLocaleStrings(ctx.locale);
|
|
3646
|
-
const button = /* @__PURE__ */
|
|
3647
|
-
/* @__PURE__ */
|
|
4400
|
+
const button = /* @__PURE__ */ jsx30("div", { className: "arap-feature arap-feature-reset", children: /* @__PURE__ */ jsxs28("button", { className: "arap-reset-btn", onClick: resetAll, type: "button", children: [
|
|
4401
|
+
/* @__PURE__ */ jsx30(FeatureIcon, { name: "reset" }),
|
|
3648
4402
|
strings.resetAll
|
|
3649
4403
|
] }) });
|
|
3650
4404
|
return actionHost ? createPortal2(button, actionHost) : button;
|
|
3651
4405
|
}
|
|
3652
4406
|
|
|
3653
4407
|
// src/core/controls/ToggleControl.tsx
|
|
3654
|
-
import { jsx as
|
|
4408
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
3655
4409
|
function ToggleControl({
|
|
3656
4410
|
id,
|
|
3657
4411
|
label,
|
|
@@ -3673,12 +4427,12 @@ function ToggleControl({
|
|
|
3673
4427
|
onChange(!checked);
|
|
3674
4428
|
}
|
|
3675
4429
|
};
|
|
3676
|
-
return /* @__PURE__ */
|
|
4430
|
+
return /* @__PURE__ */ jsx31(
|
|
3677
4431
|
"div",
|
|
3678
4432
|
{
|
|
3679
4433
|
className: `arap-toggle-wrapper ${largeControls ? "arap-large-controls" : ""} ${className}`,
|
|
3680
4434
|
style,
|
|
3681
|
-
children: /* @__PURE__ */
|
|
4435
|
+
children: /* @__PURE__ */ jsx31(
|
|
3682
4436
|
"button",
|
|
3683
4437
|
{
|
|
3684
4438
|
id,
|
|
@@ -3692,7 +4446,7 @@ function ToggleControl({
|
|
|
3692
4446
|
disabled: !isInteractive,
|
|
3693
4447
|
onClick: handleClick,
|
|
3694
4448
|
title: unavailableReason || description || toggleLabel,
|
|
3695
|
-
children: /* @__PURE__ */
|
|
4449
|
+
children: /* @__PURE__ */ jsx31(
|
|
3696
4450
|
"span",
|
|
3697
4451
|
{
|
|
3698
4452
|
className: "arap-toggle-knob",
|
|
@@ -3709,7 +4463,7 @@ function ToggleControl({
|
|
|
3709
4463
|
|
|
3710
4464
|
// src/core/controls/ChoiceControl.tsx
|
|
3711
4465
|
import { useCallback as useCallback4, useMemo as useMemo2, useRef as useRef5 } from "react";
|
|
3712
|
-
import { jsx as
|
|
4466
|
+
import { jsx as jsx32, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3713
4467
|
function ChoiceControl({
|
|
3714
4468
|
id,
|
|
3715
4469
|
label,
|
|
@@ -3765,7 +4519,7 @@ function ChoiceControl({
|
|
|
3765
4519
|
const renderOptionButton = (opt) => {
|
|
3766
4520
|
const isSelected = value === opt.value;
|
|
3767
4521
|
const isOptionDisabled = disabled || Boolean(opt.disabled);
|
|
3768
|
-
return /* @__PURE__ */
|
|
4522
|
+
return /* @__PURE__ */ jsxs29(
|
|
3769
4523
|
"button",
|
|
3770
4524
|
{
|
|
3771
4525
|
type: "button",
|
|
@@ -3779,15 +4533,15 @@ function ChoiceControl({
|
|
|
3779
4533
|
onClick: () => !isOptionDisabled && onChange(opt.value),
|
|
3780
4534
|
title: opt.description,
|
|
3781
4535
|
children: [
|
|
3782
|
-
isSelected && /* @__PURE__ */
|
|
3783
|
-
/* @__PURE__ */
|
|
3784
|
-
opt.badge && /* @__PURE__ */
|
|
4536
|
+
isSelected && /* @__PURE__ */ jsx32("span", { className: "arap-check", "aria-hidden": "true", children: "\u2713" }),
|
|
4537
|
+
/* @__PURE__ */ jsx32("span", { children: opt.label }),
|
|
4538
|
+
opt.badge && /* @__PURE__ */ jsx32("span", { className: "arap-choice-badge", "aria-hidden": "true", children: opt.badge })
|
|
3785
4539
|
]
|
|
3786
4540
|
},
|
|
3787
4541
|
String(opt.value)
|
|
3788
4542
|
);
|
|
3789
4543
|
};
|
|
3790
|
-
return /* @__PURE__ */
|
|
4544
|
+
return /* @__PURE__ */ jsx32(
|
|
3791
4545
|
"div",
|
|
3792
4546
|
{
|
|
3793
4547
|
ref: containerRef,
|
|
@@ -3798,15 +4552,15 @@ function ChoiceControl({
|
|
|
3798
4552
|
className: `arap-choice-control arap-segmented ${largeControls ? "arap-large-controls" : ""} ${className}`,
|
|
3799
4553
|
style,
|
|
3800
4554
|
onKeyDown: handleKeyDown,
|
|
3801
|
-
children: groups ? groups.map((group) => /* @__PURE__ */
|
|
4555
|
+
children: groups ? groups.map((group) => /* @__PURE__ */ jsxs29(
|
|
3802
4556
|
"div",
|
|
3803
4557
|
{
|
|
3804
4558
|
className: "arap-choice-group",
|
|
3805
4559
|
role: "group",
|
|
3806
4560
|
"aria-label": group.label,
|
|
3807
4561
|
children: [
|
|
3808
|
-
/* @__PURE__ */
|
|
3809
|
-
/* @__PURE__ */
|
|
4562
|
+
/* @__PURE__ */ jsx32("span", { className: "arap-choice-group-title", children: group.label }),
|
|
4563
|
+
/* @__PURE__ */ jsx32("div", { className: "arap-segmented", children: group.options.map(renderOptionButton) })
|
|
3810
4564
|
]
|
|
3811
4565
|
},
|
|
3812
4566
|
group.label
|
|
@@ -3816,7 +4570,7 @@ function ChoiceControl({
|
|
|
3816
4570
|
}
|
|
3817
4571
|
|
|
3818
4572
|
// src/core/controls/StepperControl.tsx
|
|
3819
|
-
import { jsx as
|
|
4573
|
+
import { jsx as jsx33, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3820
4574
|
function StepperControl({
|
|
3821
4575
|
id,
|
|
3822
4576
|
label,
|
|
@@ -3846,15 +4600,15 @@ function StepperControl({
|
|
|
3846
4600
|
onChange(Math.min(max, Number((value + step).toFixed(2))));
|
|
3847
4601
|
}
|
|
3848
4602
|
};
|
|
3849
|
-
return /* @__PURE__ */
|
|
4603
|
+
return /* @__PURE__ */ jsxs30(
|
|
3850
4604
|
"div",
|
|
3851
4605
|
{
|
|
3852
4606
|
id,
|
|
3853
4607
|
className: `arap-stepper-control-wrapper ${largeControls ? "arap-large-controls" : ""} ${className}`,
|
|
3854
4608
|
style,
|
|
3855
4609
|
children: [
|
|
3856
|
-
/* @__PURE__ */
|
|
3857
|
-
/* @__PURE__ */
|
|
4610
|
+
/* @__PURE__ */ jsxs30("div", { className: "arap-controls", children: [
|
|
4611
|
+
/* @__PURE__ */ jsx33(
|
|
3858
4612
|
"button",
|
|
3859
4613
|
{
|
|
3860
4614
|
type: "button",
|
|
@@ -3865,8 +4619,8 @@ function StepperControl({
|
|
|
3865
4619
|
children: "\u2212"
|
|
3866
4620
|
}
|
|
3867
4621
|
),
|
|
3868
|
-
/* @__PURE__ */
|
|
3869
|
-
/* @__PURE__ */
|
|
4622
|
+
/* @__PURE__ */ jsx33("output", { className: "arap-value", "aria-live": "polite", children: displayValue }),
|
|
4623
|
+
/* @__PURE__ */ jsx33(
|
|
3870
4624
|
"button",
|
|
3871
4625
|
{
|
|
3872
4626
|
type: "button",
|
|
@@ -3878,7 +4632,7 @@ function StepperControl({
|
|
|
3878
4632
|
}
|
|
3879
4633
|
)
|
|
3880
4634
|
] }),
|
|
3881
|
-
showSlider && /* @__PURE__ */
|
|
4635
|
+
showSlider && /* @__PURE__ */ jsx33("div", { className: "arap-slider-container", children: /* @__PURE__ */ jsx33(
|
|
3882
4636
|
"input",
|
|
3883
4637
|
{
|
|
3884
4638
|
type: "range",
|
|
@@ -3902,7 +4656,7 @@ function StepperControl({
|
|
|
3902
4656
|
}
|
|
3903
4657
|
|
|
3904
4658
|
// src/core/controls/FeatureCard.tsx
|
|
3905
|
-
import { jsx as
|
|
4659
|
+
import { jsx as jsx34, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3906
4660
|
function FeatureCard({
|
|
3907
4661
|
id,
|
|
3908
4662
|
featureKey,
|
|
@@ -3921,7 +4675,7 @@ function FeatureCard({
|
|
|
3921
4675
|
largeControls = false
|
|
3922
4676
|
}) {
|
|
3923
4677
|
const cardTitle = typeof title === "string" ? title : void 0;
|
|
3924
|
-
return /* @__PURE__ */
|
|
4678
|
+
return /* @__PURE__ */ jsxs31(
|
|
3925
4679
|
"div",
|
|
3926
4680
|
{
|
|
3927
4681
|
id,
|
|
@@ -3930,27 +4684,27 @@ function FeatureCard({
|
|
|
3930
4684
|
className: `arap-feature arap-feature-card ${status !== "idle" ? `arap-feature-${status}` : ""} ${largeControls ? "arap-large-controls" : ""} ${className}`,
|
|
3931
4685
|
style,
|
|
3932
4686
|
children: [
|
|
3933
|
-
/* @__PURE__ */
|
|
3934
|
-
/* @__PURE__ */
|
|
3935
|
-
icon ?? (featureKey ? /* @__PURE__ */
|
|
3936
|
-
/* @__PURE__ */
|
|
4687
|
+
/* @__PURE__ */ jsxs31("div", { className: "arap-card-header", children: [
|
|
4688
|
+
/* @__PURE__ */ jsxs31("span", { className: "arap-label", children: [
|
|
4689
|
+
icon ?? (featureKey ? /* @__PURE__ */ jsx34(FeatureIcon, { name: featureKey }) : null),
|
|
4690
|
+
/* @__PURE__ */ jsx34("span", { className: "arap-card-title", children: title })
|
|
3937
4691
|
] }),
|
|
3938
|
-
statusBadge && /* @__PURE__ */
|
|
4692
|
+
statusBadge && /* @__PURE__ */ jsx34("span", { className: "arap-status-badge", "aria-hidden": "true", children: statusBadge })
|
|
3939
4693
|
] }),
|
|
3940
|
-
description && /* @__PURE__ */
|
|
3941
|
-
status === "error" && errorMessage && /* @__PURE__ */
|
|
3942
|
-
/* @__PURE__ */
|
|
3943
|
-
/* @__PURE__ */
|
|
4694
|
+
description && /* @__PURE__ */ jsx34("p", { className: "arap-card-desc", children: description }),
|
|
4695
|
+
status === "error" && errorMessage && /* @__PURE__ */ jsxs31("div", { className: "arap-card-alert arap-card-error", role: "alert", children: [
|
|
4696
|
+
/* @__PURE__ */ jsx34("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
|
|
4697
|
+
/* @__PURE__ */ jsx34("span", { children: errorMessage })
|
|
3944
4698
|
] }),
|
|
3945
|
-
status === "unavailable" && unavailableMessage && /* @__PURE__ */
|
|
3946
|
-
/* @__PURE__ */
|
|
3947
|
-
/* @__PURE__ */
|
|
4699
|
+
status === "unavailable" && unavailableMessage && /* @__PURE__ */ jsxs31("div", { className: "arap-card-alert arap-card-unavailable", role: "status", children: [
|
|
4700
|
+
/* @__PURE__ */ jsx34("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u2139\uFE0F" }),
|
|
4701
|
+
/* @__PURE__ */ jsx34("span", { children: unavailableMessage })
|
|
3948
4702
|
] }),
|
|
3949
|
-
status === "permission-required" && permissionMessage && /* @__PURE__ */
|
|
3950
|
-
/* @__PURE__ */
|
|
3951
|
-
/* @__PURE__ */
|
|
3952
|
-
/* @__PURE__ */
|
|
3953
|
-
onRequestPermission && /* @__PURE__ */
|
|
4703
|
+
status === "permission-required" && permissionMessage && /* @__PURE__ */ jsxs31("div", { className: "arap-card-alert arap-card-permission", role: "status", children: [
|
|
4704
|
+
/* @__PURE__ */ jsx34("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u{1F512}" }),
|
|
4705
|
+
/* @__PURE__ */ jsxs31("div", { className: "arap-permission-content", children: [
|
|
4706
|
+
/* @__PURE__ */ jsx34("span", { children: permissionMessage }),
|
|
4707
|
+
onRequestPermission && /* @__PURE__ */ jsx34(
|
|
3954
4708
|
"button",
|
|
3955
4709
|
{
|
|
3956
4710
|
type: "button",
|
|
@@ -3961,14 +4715,14 @@ function FeatureCard({
|
|
|
3961
4715
|
)
|
|
3962
4716
|
] })
|
|
3963
4717
|
] }),
|
|
3964
|
-
/* @__PURE__ */
|
|
4718
|
+
/* @__PURE__ */ jsx34("div", { className: "arap-card-content", children })
|
|
3965
4719
|
]
|
|
3966
4720
|
}
|
|
3967
4721
|
);
|
|
3968
4722
|
}
|
|
3969
4723
|
|
|
3970
4724
|
// src/core/controls/FeatureStatusState.tsx
|
|
3971
|
-
import { jsx as
|
|
4725
|
+
import { jsx as jsx35, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3972
4726
|
function SearchCount({
|
|
3973
4727
|
totalCount,
|
|
3974
4728
|
matchedCount,
|
|
@@ -3977,7 +4731,7 @@ function SearchCount({
|
|
|
3977
4731
|
style
|
|
3978
4732
|
}) {
|
|
3979
4733
|
const text = query ? `Showing ${matchedCount} of ${totalCount} tools matching "${query}"` : `Showing all ${totalCount} tools`;
|
|
3980
|
-
return /* @__PURE__ */
|
|
4734
|
+
return /* @__PURE__ */ jsx35(
|
|
3981
4735
|
"div",
|
|
3982
4736
|
{
|
|
3983
4737
|
role: "status",
|
|
@@ -3997,17 +4751,17 @@ function EmptyState({
|
|
|
3997
4751
|
className = "",
|
|
3998
4752
|
style
|
|
3999
4753
|
}) {
|
|
4000
|
-
return /* @__PURE__ */
|
|
4754
|
+
return /* @__PURE__ */ jsxs32(
|
|
4001
4755
|
"div",
|
|
4002
4756
|
{
|
|
4003
4757
|
role: "status",
|
|
4004
4758
|
className: `arap-empty-state ${className}`,
|
|
4005
4759
|
style,
|
|
4006
4760
|
children: [
|
|
4007
|
-
/* @__PURE__ */
|
|
4008
|
-
/* @__PURE__ */
|
|
4009
|
-
/* @__PURE__ */
|
|
4010
|
-
onAction && /* @__PURE__ */
|
|
4761
|
+
/* @__PURE__ */ jsx35("div", { className: "arap-empty-icon", "aria-hidden": "true", children: icon ?? "\u{1F50D}" }),
|
|
4762
|
+
/* @__PURE__ */ jsx35("h3", { className: "arap-empty-title", children: title }),
|
|
4763
|
+
/* @__PURE__ */ jsx35("p", { className: "arap-empty-desc", children: description }),
|
|
4764
|
+
onAction && /* @__PURE__ */ jsx35("button", { type: "button", className: "arap-empty-btn", onClick: onAction, children: actionLabel })
|
|
4011
4765
|
]
|
|
4012
4766
|
}
|
|
4013
4767
|
);
|
|
@@ -4020,18 +4774,18 @@ function ErrorState({
|
|
|
4020
4774
|
className = "",
|
|
4021
4775
|
style
|
|
4022
4776
|
}) {
|
|
4023
|
-
return /* @__PURE__ */
|
|
4777
|
+
return /* @__PURE__ */ jsxs32(
|
|
4024
4778
|
"div",
|
|
4025
4779
|
{
|
|
4026
4780
|
role: "alert",
|
|
4027
4781
|
className: `arap-error-state arap-card-alert arap-card-error ${className}`,
|
|
4028
4782
|
style,
|
|
4029
4783
|
children: [
|
|
4030
|
-
/* @__PURE__ */
|
|
4031
|
-
/* @__PURE__ */
|
|
4032
|
-
title && /* @__PURE__ */
|
|
4033
|
-
/* @__PURE__ */
|
|
4034
|
-
onRetry && /* @__PURE__ */
|
|
4784
|
+
/* @__PURE__ */ jsx35("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
|
|
4785
|
+
/* @__PURE__ */ jsxs32("div", { className: "arap-error-content", children: [
|
|
4786
|
+
title && /* @__PURE__ */ jsx35("h4", { className: "arap-error-title", children: title }),
|
|
4787
|
+
/* @__PURE__ */ jsx35("p", { className: "arap-error-message", children: message }),
|
|
4788
|
+
onRetry && /* @__PURE__ */ jsx35("button", { type: "button", className: "arap-retry-btn", onClick: onRetry, children: retryLabel })
|
|
4035
4789
|
] })
|
|
4036
4790
|
]
|
|
4037
4791
|
}
|
|
@@ -4039,7 +4793,7 @@ function ErrorState({
|
|
|
4039
4793
|
}
|
|
4040
4794
|
|
|
4041
4795
|
// src/core/controls/ProfilePreviewCard.tsx
|
|
4042
|
-
import { jsx as
|
|
4796
|
+
import { jsx as jsx36, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4043
4797
|
function ProfilePreviewCard({
|
|
4044
4798
|
profile,
|
|
4045
4799
|
isActive,
|
|
@@ -4089,7 +4843,7 @@ function ProfilePreviewCard({
|
|
|
4089
4843
|
if (val === null || val === void 0) return "Original";
|
|
4090
4844
|
return String(val);
|
|
4091
4845
|
};
|
|
4092
|
-
return /* @__PURE__ */
|
|
4846
|
+
return /* @__PURE__ */ jsxs33(
|
|
4093
4847
|
"div",
|
|
4094
4848
|
{
|
|
4095
4849
|
role: "group",
|
|
@@ -4097,10 +4851,10 @@ function ProfilePreviewCard({
|
|
|
4097
4851
|
className: `arap-profile-card ${isActive ? "arap-profile-card-active" : ""} ${largeControls ? "arap-large-controls" : ""} ${className}`,
|
|
4098
4852
|
style,
|
|
4099
4853
|
children: [
|
|
4100
|
-
/* @__PURE__ */
|
|
4101
|
-
/* @__PURE__ */
|
|
4102
|
-
/* @__PURE__ */
|
|
4103
|
-
isActive && /* @__PURE__ */
|
|
4854
|
+
/* @__PURE__ */ jsxs33("div", { className: "arap-profile-header", children: [
|
|
4855
|
+
/* @__PURE__ */ jsxs33("div", { className: "arap-profile-title-row", children: [
|
|
4856
|
+
/* @__PURE__ */ jsx36("h4", { className: "arap-profile-title", children: profile.label }),
|
|
4857
|
+
isActive && /* @__PURE__ */ jsx36(
|
|
4104
4858
|
"span",
|
|
4105
4859
|
{
|
|
4106
4860
|
className: "arap-profile-active-badge",
|
|
@@ -4109,14 +4863,14 @@ function ProfilePreviewCard({
|
|
|
4109
4863
|
}
|
|
4110
4864
|
)
|
|
4111
4865
|
] }),
|
|
4112
|
-
/* @__PURE__ */
|
|
4866
|
+
/* @__PURE__ */ jsx36("p", { className: "arap-profile-desc", children: profile.description })
|
|
4113
4867
|
] }),
|
|
4114
|
-
/* @__PURE__ */
|
|
4115
|
-
/* @__PURE__ */
|
|
4116
|
-
/* @__PURE__ */
|
|
4868
|
+
/* @__PURE__ */ jsxs33("div", { className: "arap-profile-affected", children: [
|
|
4869
|
+
/* @__PURE__ */ jsx36("span", { className: "arap-profile-affected-label", children: "Affected settings:" }),
|
|
4870
|
+
/* @__PURE__ */ jsx36("div", { className: "arap-profile-chips", children: affectedKeys.map((key) => {
|
|
4117
4871
|
const val = profile.settings[key];
|
|
4118
|
-
return /* @__PURE__ */
|
|
4119
|
-
/* @__PURE__ */
|
|
4872
|
+
return /* @__PURE__ */ jsxs33("span", { className: "arap-profile-chip", children: [
|
|
4873
|
+
/* @__PURE__ */ jsxs33("strong", { children: [
|
|
4120
4874
|
formatKeyName(key),
|
|
4121
4875
|
":"
|
|
4122
4876
|
] }),
|
|
@@ -4125,7 +4879,7 @@ function ProfilePreviewCard({
|
|
|
4125
4879
|
] }, key);
|
|
4126
4880
|
}) })
|
|
4127
4881
|
] }),
|
|
4128
|
-
/* @__PURE__ */
|
|
4882
|
+
/* @__PURE__ */ jsx36("div", { className: "arap-profile-actions", children: isActive ? /* @__PURE__ */ jsx36(
|
|
4129
4883
|
"button",
|
|
4130
4884
|
{
|
|
4131
4885
|
type: "button",
|
|
@@ -4134,7 +4888,7 @@ function ProfilePreviewCard({
|
|
|
4134
4888
|
"aria-label": `Revert ${profile.label} profile`,
|
|
4135
4889
|
children: "Revert to custom settings"
|
|
4136
4890
|
}
|
|
4137
|
-
) : /* @__PURE__ */
|
|
4891
|
+
) : /* @__PURE__ */ jsx36(
|
|
4138
4892
|
"button",
|
|
4139
4893
|
{
|
|
4140
4894
|
type: "button",
|
|
@@ -4153,6 +4907,7 @@ export {
|
|
|
4153
4907
|
AccessibilityContext,
|
|
4154
4908
|
AccessibilityList,
|
|
4155
4909
|
AccessibilityPlugin,
|
|
4910
|
+
AccessibleTooltipsController,
|
|
4156
4911
|
BigCursorController,
|
|
4157
4912
|
CONTRAST_MODES,
|
|
4158
4913
|
CONTRAST_PALETTES,
|
|
@@ -4161,6 +4916,7 @@ export {
|
|
|
4161
4916
|
ContrastController,
|
|
4162
4917
|
ContrastModeController,
|
|
4163
4918
|
DEFAULT_PREFERENCES,
|
|
4919
|
+
DEFAULT_READING_MASK_HEIGHT,
|
|
4164
4920
|
DYSLEXIA_FONT_STACK,
|
|
4165
4921
|
EmptyState,
|
|
4166
4922
|
ErrorState,
|
|
@@ -4182,9 +4938,12 @@ export {
|
|
|
4182
4938
|
LetterSpacingController,
|
|
4183
4939
|
LineHeightController,
|
|
4184
4940
|
LinkHighlightController,
|
|
4941
|
+
MAX_READING_MASK_HEIGHT,
|
|
4942
|
+
MIN_READING_MASK_HEIGHT,
|
|
4185
4943
|
PROFILE_DEFINITIONS,
|
|
4186
4944
|
ParagraphSpacingController,
|
|
4187
4945
|
ProfilePreviewCard,
|
|
4946
|
+
READING_MASK_HEIGHT_PRESETS,
|
|
4188
4947
|
ReadingGuideController,
|
|
4189
4948
|
ReadingMaskController,
|
|
4190
4949
|
ReduceMotionController,
|
|
@@ -4200,11 +4959,15 @@ export {
|
|
|
4200
4959
|
TextAlignController,
|
|
4201
4960
|
TextScaleController,
|
|
4202
4961
|
ToggleControl,
|
|
4962
|
+
TooltipsController,
|
|
4203
4963
|
WordSpacingController,
|
|
4204
4964
|
createInitialPreferencesState,
|
|
4205
4965
|
enLocale,
|
|
4966
|
+
enableAccessibleTooltips,
|
|
4206
4967
|
findMainLandmark,
|
|
4968
|
+
getAuthoredDescription,
|
|
4207
4969
|
getScriptSpacingConstraints,
|
|
4970
|
+
hasFinePointer,
|
|
4208
4971
|
isEligibleDecorativeImage,
|
|
4209
4972
|
isForcedColorsActive,
|
|
4210
4973
|
isFunctionalOrMeaningfulImage,
|
|
@@ -4217,10 +4980,13 @@ export {
|
|
|
4217
4980
|
isRtlLocale,
|
|
4218
4981
|
normalizePreferenceValue,
|
|
4219
4982
|
normalizePreferences,
|
|
4983
|
+
nudgeReadingAid,
|
|
4984
|
+
positionTooltip,
|
|
4220
4985
|
preferencesReducer,
|
|
4221
4986
|
registerLocale,
|
|
4222
4987
|
resolveEffectivePreferences,
|
|
4223
4988
|
resolveLocaleStrings,
|
|
4989
|
+
subscribeFinePointer,
|
|
4224
4990
|
subscribeForcedColors,
|
|
4225
4991
|
subscribeReducedMotion,
|
|
4226
4992
|
useAccessibility
|