accessibility-plugin-react 2.8.0 → 2.9.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 +1 -0
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +212 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -71
- package/dist/index.mjs.map +1 -1
- package/docs/API.md +2 -2
- package/docs/BUILD_AND_RELEASE_PLAN.md +1 -1
- package/docs/FEATURES.md +1 -0
- package/docs/REDUCE_MOTION.md +64 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -59,6 +59,7 @@ __export(index_exports, {
|
|
|
59
59
|
ProfilePreviewCard: () => ProfilePreviewCard,
|
|
60
60
|
ReadingGuideController: () => ReadingGuideController,
|
|
61
61
|
ReadingMaskController: () => ReadingMaskController,
|
|
62
|
+
ReduceMotionController: () => ReduceMotionController,
|
|
62
63
|
ResetController: () => ResetController,
|
|
63
64
|
SaturationController: () => SaturationController,
|
|
64
65
|
SearchCount: () => SearchCount,
|
|
@@ -82,6 +83,7 @@ __export(index_exports, {
|
|
|
82
83
|
isProtectedFromTextAlign: () => isProtectedFromTextAlign,
|
|
83
84
|
isProtectedFromTextScale: () => isProtectedFromTextScale,
|
|
84
85
|
isProtectedFromTextSpacing: () => isProtectedFromTextSpacing,
|
|
86
|
+
isReducedMotionActive: () => isReducedMotionActive,
|
|
85
87
|
isRtlLocale: () => isRtlLocale,
|
|
86
88
|
normalizePreferenceValue: () => normalizePreferenceValue,
|
|
87
89
|
normalizePreferences: () => normalizePreferences,
|
|
@@ -89,6 +91,8 @@ __export(index_exports, {
|
|
|
89
91
|
registerLocale: () => registerLocale,
|
|
90
92
|
resolveEffectivePreferences: () => resolveEffectivePreferences,
|
|
91
93
|
resolveLocaleStrings: () => resolveLocaleStrings,
|
|
94
|
+
subscribeForcedColors: () => subscribeForcedColors,
|
|
95
|
+
subscribeReducedMotion: () => subscribeReducedMotion,
|
|
92
96
|
useAccessibility: () => useAccessibility
|
|
93
97
|
});
|
|
94
98
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -424,7 +428,8 @@ for (const key of [
|
|
|
424
428
|
"readingMask",
|
|
425
429
|
"readingGuide",
|
|
426
430
|
"highlightFocus",
|
|
427
|
-
"focusHighlight"
|
|
431
|
+
"focusHighlight",
|
|
432
|
+
"reduceMotion"
|
|
428
433
|
]) {
|
|
429
434
|
builtins[key] = {
|
|
430
435
|
defaultValue: false,
|
|
@@ -468,6 +473,26 @@ function subscribeForcedColors(callback) {
|
|
|
468
473
|
};
|
|
469
474
|
}
|
|
470
475
|
}
|
|
476
|
+
function isReducedMotionActive() {
|
|
477
|
+
if (typeof window === "undefined" || !window.matchMedia) return false;
|
|
478
|
+
try {
|
|
479
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
480
|
+
} catch {
|
|
481
|
+
return false;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
function subscribeReducedMotion(callback) {
|
|
485
|
+
if (typeof window === "undefined" || !window.matchMedia) return () => {
|
|
486
|
+
};
|
|
487
|
+
try {
|
|
488
|
+
const mql = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
489
|
+
mql.addEventListener("change", callback);
|
|
490
|
+
return () => mql.removeEventListener("change", callback);
|
|
491
|
+
} catch {
|
|
492
|
+
return () => {
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
}
|
|
471
496
|
var CONTRAST_PALETTES = {
|
|
472
497
|
light: {
|
|
473
498
|
text: "#0f172a",
|
|
@@ -1123,6 +1148,71 @@ function applyPage(values) {
|
|
|
1123
1148
|
});
|
|
1124
1149
|
}
|
|
1125
1150
|
}
|
|
1151
|
+
if (values.reduceMotion) {
|
|
1152
|
+
const MOTION_STYLE_ID = "arap-reduce-motion-style";
|
|
1153
|
+
let styleEl = document.getElementById(
|
|
1154
|
+
MOTION_STYLE_ID
|
|
1155
|
+
);
|
|
1156
|
+
if (!styleEl) {
|
|
1157
|
+
styleEl = document.createElement("style");
|
|
1158
|
+
styleEl.id = MOTION_STYLE_ID;
|
|
1159
|
+
styleEl.dataset.arapUi = "";
|
|
1160
|
+
styleEl.textContent = `
|
|
1161
|
+
*:not([data-arap-ui]):not([data-arap-ui] *),
|
|
1162
|
+
*:not([data-arap-ui]):not([data-arap-ui] *)::before,
|
|
1163
|
+
*:not([data-arap-ui]):not([data-arap-ui] *)::after {
|
|
1164
|
+
animation-duration: 0.001ms !important;
|
|
1165
|
+
animation-iteration-count: 1 !important;
|
|
1166
|
+
transition-duration: 0.001ms !important;
|
|
1167
|
+
scroll-behavior: auto !important;
|
|
1168
|
+
}
|
|
1169
|
+
`;
|
|
1170
|
+
document.head.appendChild(styleEl);
|
|
1171
|
+
undo.push(() => {
|
|
1172
|
+
styleEl?.remove();
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
const trackedAnimations = /* @__PURE__ */ new Set();
|
|
1176
|
+
if (typeof document !== "undefined" && typeof document.getAnimations === "function") {
|
|
1177
|
+
try {
|
|
1178
|
+
const animations = document.getAnimations();
|
|
1179
|
+
for (const anim of animations) {
|
|
1180
|
+
const target = anim.effect?.target;
|
|
1181
|
+
if (target instanceof Element && target.closest("[data-arap-ui]")) {
|
|
1182
|
+
continue;
|
|
1183
|
+
}
|
|
1184
|
+
if (anim.playState === "running") {
|
|
1185
|
+
anim.pause();
|
|
1186
|
+
trackedAnimations.add(anim);
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
} catch {
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
if (typeof document !== "undefined") {
|
|
1193
|
+
const mediaList = Array.from(
|
|
1194
|
+
document.querySelectorAll("video, audio")
|
|
1195
|
+
).filter((media) => !media.closest("[data-arap-ui]"));
|
|
1196
|
+
for (const media of mediaList) {
|
|
1197
|
+
if (!media.paused) {
|
|
1198
|
+
try {
|
|
1199
|
+
media.pause();
|
|
1200
|
+
} catch {
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
undo.push(() => {
|
|
1206
|
+
for (const anim of trackedAnimations) {
|
|
1207
|
+
if (anim.playState === "paused") {
|
|
1208
|
+
try {
|
|
1209
|
+
anim.play();
|
|
1210
|
+
} catch {
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1126
1216
|
for (const el of elements) {
|
|
1127
1217
|
if (values.bigCursor) set(el, "cursor", cursor);
|
|
1128
1218
|
if (values.hideImages) {
|
|
@@ -2422,6 +2512,11 @@ var drawings = {
|
|
|
2422
2512
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M4 8V4h4M20 8V4h-4M4 16v4h4M20 16v4h-4" }),
|
|
2423
2513
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("circle", { cx: "12", cy: "12", r: "3" })
|
|
2424
2514
|
] }),
|
|
2515
|
+
reduceMotion: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M3 8h4M3 12h6M3 16h4" }),
|
|
2517
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("rect", { x: "14", y: "6", width: "2", height: "12", rx: "1" }),
|
|
2518
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("rect", { x: "18", y: "6", width: "2", height: "12", rx: "1" })
|
|
2519
|
+
] }),
|
|
2425
2520
|
textAlign: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M3 5h18M3 10h12M3 15h18M3 20h12" }) }),
|
|
2426
2521
|
fontFamily: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M4 7V4h16v3M9 20h6M12 4v16" }) }),
|
|
2427
2522
|
hideImages: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
@@ -3471,29 +3566,64 @@ function HighlightFocusController() {
|
|
|
3471
3566
|
}
|
|
3472
3567
|
var FocusHighlightController = HighlightFocusController;
|
|
3473
3568
|
|
|
3474
|
-
// src/features/
|
|
3475
|
-
var import_react_dom2 = require("react-dom");
|
|
3569
|
+
// src/features/ReduceMotionController.tsx
|
|
3476
3570
|
var import_react14 = require("react");
|
|
3477
3571
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3572
|
+
var FEATURE_KEY21 = "reduceMotion";
|
|
3573
|
+
var DEFAULT_VALUE21 = false;
|
|
3574
|
+
function ReduceMotionController() {
|
|
3575
|
+
const { value, setValue } = useAccessibility(
|
|
3576
|
+
FEATURE_KEY21,
|
|
3577
|
+
DEFAULT_VALUE21
|
|
3578
|
+
);
|
|
3579
|
+
const osReducedMotion = (0, import_react14.useSyncExternalStore)(
|
|
3580
|
+
subscribeReducedMotion,
|
|
3581
|
+
isReducedMotionActive,
|
|
3582
|
+
() => false
|
|
3583
|
+
);
|
|
3584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "arap-feature", role: "group", "aria-label": "Reduce Motion", children: [
|
|
3585
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "arap-label", children: [
|
|
3586
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FeatureIcon, { name: FEATURE_KEY21 }),
|
|
3587
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "Reduce Motion" })
|
|
3588
|
+
] }),
|
|
3589
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3590
|
+
"button",
|
|
3591
|
+
{
|
|
3592
|
+
className: `arap-toggle ${value ? "arap-toggle-active" : ""}`,
|
|
3593
|
+
onClick: () => setValue(!value),
|
|
3594
|
+
"aria-label": "Reduce Motion",
|
|
3595
|
+
"aria-pressed": Boolean(value),
|
|
3596
|
+
type: "button",
|
|
3597
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "arap-toggle-knob", "aria-hidden": "true" })
|
|
3598
|
+
}
|
|
3599
|
+
),
|
|
3600
|
+
osReducedMotion && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "arap-notice", role: "status", "aria-live": "polite", children: "Operating system prefers-reduced-motion is active." })
|
|
3601
|
+
] });
|
|
3602
|
+
}
|
|
3603
|
+
|
|
3604
|
+
// src/features/ResetController.tsx
|
|
3605
|
+
var import_react_dom2 = require("react-dom");
|
|
3606
|
+
var import_react15 = require("react");
|
|
3607
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3478
3608
|
function ResetController() {
|
|
3479
|
-
const ctx = (0,
|
|
3609
|
+
const ctx = (0, import_react15.useContext)(AccessibilityContext);
|
|
3480
3610
|
if (!ctx) {
|
|
3481
3611
|
throw new Error(
|
|
3482
3612
|
"ResetController must be used within an <AccessibilityPlugin> provider."
|
|
3483
3613
|
);
|
|
3484
3614
|
}
|
|
3485
|
-
const actionHost = (0,
|
|
3615
|
+
const actionHost = (0, import_react15.useContext)(PanelActionsContext);
|
|
3486
3616
|
const { resetAll } = ctx;
|
|
3487
3617
|
const strings = resolveLocaleStrings(ctx.locale);
|
|
3488
|
-
const button = /* @__PURE__ */ (0,
|
|
3489
|
-
/* @__PURE__ */ (0,
|
|
3618
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "arap-feature arap-feature-reset", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { className: "arap-reset-btn", onClick: resetAll, type: "button", children: [
|
|
3619
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FeatureIcon, { name: "reset" }),
|
|
3490
3620
|
strings.resetAll
|
|
3491
3621
|
] }) });
|
|
3492
3622
|
return actionHost ? (0, import_react_dom2.createPortal)(button, actionHost) : button;
|
|
3493
3623
|
}
|
|
3494
3624
|
|
|
3495
3625
|
// src/core/controls/ToggleControl.tsx
|
|
3496
|
-
var
|
|
3626
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3497
3627
|
function ToggleControl({
|
|
3498
3628
|
id,
|
|
3499
3629
|
label,
|
|
@@ -3515,12 +3645,12 @@ function ToggleControl({
|
|
|
3515
3645
|
onChange(!checked);
|
|
3516
3646
|
}
|
|
3517
3647
|
};
|
|
3518
|
-
return /* @__PURE__ */ (0,
|
|
3648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3519
3649
|
"div",
|
|
3520
3650
|
{
|
|
3521
3651
|
className: `arap-toggle-wrapper ${largeControls ? "arap-large-controls" : ""} ${className}`,
|
|
3522
3652
|
style,
|
|
3523
|
-
children: /* @__PURE__ */ (0,
|
|
3653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3524
3654
|
"button",
|
|
3525
3655
|
{
|
|
3526
3656
|
id,
|
|
@@ -3534,7 +3664,7 @@ function ToggleControl({
|
|
|
3534
3664
|
disabled: !isInteractive,
|
|
3535
3665
|
onClick: handleClick,
|
|
3536
3666
|
title: unavailableReason || description || toggleLabel,
|
|
3537
|
-
children: /* @__PURE__ */ (0,
|
|
3667
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3538
3668
|
"span",
|
|
3539
3669
|
{
|
|
3540
3670
|
className: "arap-toggle-knob",
|
|
@@ -3550,8 +3680,8 @@ function ToggleControl({
|
|
|
3550
3680
|
}
|
|
3551
3681
|
|
|
3552
3682
|
// src/core/controls/ChoiceControl.tsx
|
|
3553
|
-
var
|
|
3554
|
-
var
|
|
3683
|
+
var import_react16 = require("react");
|
|
3684
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3555
3685
|
function ChoiceControl({
|
|
3556
3686
|
id,
|
|
3557
3687
|
label,
|
|
@@ -3565,12 +3695,12 @@ function ChoiceControl({
|
|
|
3565
3695
|
style,
|
|
3566
3696
|
orientation = "horizontal"
|
|
3567
3697
|
}) {
|
|
3568
|
-
const containerRef = (0,
|
|
3569
|
-
const allOptions = (0,
|
|
3698
|
+
const containerRef = (0, import_react16.useRef)(null);
|
|
3699
|
+
const allOptions = (0, import_react16.useMemo)(
|
|
3570
3700
|
() => groups ? groups.flatMap((g) => g.options) : options || [],
|
|
3571
3701
|
[groups, options]
|
|
3572
3702
|
);
|
|
3573
|
-
const handleKeyDown = (0,
|
|
3703
|
+
const handleKeyDown = (0, import_react16.useCallback)(
|
|
3574
3704
|
(e) => {
|
|
3575
3705
|
if (disabled || allOptions.length === 0) return;
|
|
3576
3706
|
const enabledOptions = allOptions.filter((opt) => !opt.disabled);
|
|
@@ -3607,7 +3737,7 @@ function ChoiceControl({
|
|
|
3607
3737
|
const renderOptionButton = (opt) => {
|
|
3608
3738
|
const isSelected = value === opt.value;
|
|
3609
3739
|
const isOptionDisabled = disabled || Boolean(opt.disabled);
|
|
3610
|
-
return /* @__PURE__ */ (0,
|
|
3740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3611
3741
|
"button",
|
|
3612
3742
|
{
|
|
3613
3743
|
type: "button",
|
|
@@ -3621,15 +3751,15 @@ function ChoiceControl({
|
|
|
3621
3751
|
onClick: () => !isOptionDisabled && onChange(opt.value),
|
|
3622
3752
|
title: opt.description,
|
|
3623
3753
|
children: [
|
|
3624
|
-
isSelected && /* @__PURE__ */ (0,
|
|
3625
|
-
/* @__PURE__ */ (0,
|
|
3626
|
-
opt.badge && /* @__PURE__ */ (0,
|
|
3754
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "arap-check", "aria-hidden": "true", children: "\u2713" }),
|
|
3755
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: opt.label }),
|
|
3756
|
+
opt.badge && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "arap-choice-badge", "aria-hidden": "true", children: opt.badge })
|
|
3627
3757
|
]
|
|
3628
3758
|
},
|
|
3629
3759
|
String(opt.value)
|
|
3630
3760
|
);
|
|
3631
3761
|
};
|
|
3632
|
-
return /* @__PURE__ */ (0,
|
|
3762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3633
3763
|
"div",
|
|
3634
3764
|
{
|
|
3635
3765
|
ref: containerRef,
|
|
@@ -3640,15 +3770,15 @@ function ChoiceControl({
|
|
|
3640
3770
|
className: `arap-choice-control arap-segmented ${largeControls ? "arap-large-controls" : ""} ${className}`,
|
|
3641
3771
|
style,
|
|
3642
3772
|
onKeyDown: handleKeyDown,
|
|
3643
|
-
children: groups ? groups.map((group) => /* @__PURE__ */ (0,
|
|
3773
|
+
children: groups ? groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3644
3774
|
"div",
|
|
3645
3775
|
{
|
|
3646
3776
|
className: "arap-choice-group",
|
|
3647
3777
|
role: "group",
|
|
3648
3778
|
"aria-label": group.label,
|
|
3649
3779
|
children: [
|
|
3650
|
-
/* @__PURE__ */ (0,
|
|
3651
|
-
/* @__PURE__ */ (0,
|
|
3780
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "arap-choice-group-title", children: group.label }),
|
|
3781
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "arap-segmented", children: group.options.map(renderOptionButton) })
|
|
3652
3782
|
]
|
|
3653
3783
|
},
|
|
3654
3784
|
group.label
|
|
@@ -3658,7 +3788,7 @@ function ChoiceControl({
|
|
|
3658
3788
|
}
|
|
3659
3789
|
|
|
3660
3790
|
// src/core/controls/StepperControl.tsx
|
|
3661
|
-
var
|
|
3791
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3662
3792
|
function StepperControl({
|
|
3663
3793
|
id,
|
|
3664
3794
|
label,
|
|
@@ -3688,15 +3818,15 @@ function StepperControl({
|
|
|
3688
3818
|
onChange(Math.min(max, Number((value + step).toFixed(2))));
|
|
3689
3819
|
}
|
|
3690
3820
|
};
|
|
3691
|
-
return /* @__PURE__ */ (0,
|
|
3821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3692
3822
|
"div",
|
|
3693
3823
|
{
|
|
3694
3824
|
id,
|
|
3695
3825
|
className: `arap-stepper-control-wrapper ${largeControls ? "arap-large-controls" : ""} ${className}`,
|
|
3696
3826
|
style,
|
|
3697
3827
|
children: [
|
|
3698
|
-
/* @__PURE__ */ (0,
|
|
3699
|
-
/* @__PURE__ */ (0,
|
|
3828
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "arap-controls", children: [
|
|
3829
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3700
3830
|
"button",
|
|
3701
3831
|
{
|
|
3702
3832
|
type: "button",
|
|
@@ -3707,8 +3837,8 @@ function StepperControl({
|
|
|
3707
3837
|
children: "\u2212"
|
|
3708
3838
|
}
|
|
3709
3839
|
),
|
|
3710
|
-
/* @__PURE__ */ (0,
|
|
3711
|
-
/* @__PURE__ */ (0,
|
|
3840
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("output", { className: "arap-value", "aria-live": "polite", children: displayValue }),
|
|
3841
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3712
3842
|
"button",
|
|
3713
3843
|
{
|
|
3714
3844
|
type: "button",
|
|
@@ -3720,7 +3850,7 @@ function StepperControl({
|
|
|
3720
3850
|
}
|
|
3721
3851
|
)
|
|
3722
3852
|
] }),
|
|
3723
|
-
showSlider && /* @__PURE__ */ (0,
|
|
3853
|
+
showSlider && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "arap-slider-container", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3724
3854
|
"input",
|
|
3725
3855
|
{
|
|
3726
3856
|
type: "range",
|
|
@@ -3744,7 +3874,7 @@ function StepperControl({
|
|
|
3744
3874
|
}
|
|
3745
3875
|
|
|
3746
3876
|
// src/core/controls/FeatureCard.tsx
|
|
3747
|
-
var
|
|
3877
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3748
3878
|
function FeatureCard({
|
|
3749
3879
|
id,
|
|
3750
3880
|
featureKey,
|
|
@@ -3763,7 +3893,7 @@ function FeatureCard({
|
|
|
3763
3893
|
largeControls = false
|
|
3764
3894
|
}) {
|
|
3765
3895
|
const cardTitle = typeof title === "string" ? title : void 0;
|
|
3766
|
-
return /* @__PURE__ */ (0,
|
|
3896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3767
3897
|
"div",
|
|
3768
3898
|
{
|
|
3769
3899
|
id,
|
|
@@ -3772,27 +3902,27 @@ function FeatureCard({
|
|
|
3772
3902
|
className: `arap-feature arap-feature-card ${status !== "idle" ? `arap-feature-${status}` : ""} ${largeControls ? "arap-large-controls" : ""} ${className}`,
|
|
3773
3903
|
style,
|
|
3774
3904
|
children: [
|
|
3775
|
-
/* @__PURE__ */ (0,
|
|
3776
|
-
/* @__PURE__ */ (0,
|
|
3777
|
-
icon ?? (featureKey ? /* @__PURE__ */ (0,
|
|
3778
|
-
/* @__PURE__ */ (0,
|
|
3905
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "arap-card-header", children: [
|
|
3906
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "arap-label", children: [
|
|
3907
|
+
icon ?? (featureKey ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FeatureIcon, { name: featureKey }) : null),
|
|
3908
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "arap-card-title", children: title })
|
|
3779
3909
|
] }),
|
|
3780
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
3910
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "arap-status-badge", "aria-hidden": "true", children: statusBadge })
|
|
3781
3911
|
] }),
|
|
3782
|
-
description && /* @__PURE__ */ (0,
|
|
3783
|
-
status === "error" && errorMessage && /* @__PURE__ */ (0,
|
|
3784
|
-
/* @__PURE__ */ (0,
|
|
3785
|
-
/* @__PURE__ */ (0,
|
|
3912
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "arap-card-desc", children: description }),
|
|
3913
|
+
status === "error" && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "arap-card-alert arap-card-error", role: "alert", children: [
|
|
3914
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
|
|
3915
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: errorMessage })
|
|
3786
3916
|
] }),
|
|
3787
|
-
status === "unavailable" && unavailableMessage && /* @__PURE__ */ (0,
|
|
3788
|
-
/* @__PURE__ */ (0,
|
|
3789
|
-
/* @__PURE__ */ (0,
|
|
3917
|
+
status === "unavailable" && unavailableMessage && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "arap-card-alert arap-card-unavailable", role: "status", children: [
|
|
3918
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u2139\uFE0F" }),
|
|
3919
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: unavailableMessage })
|
|
3790
3920
|
] }),
|
|
3791
|
-
status === "permission-required" && permissionMessage && /* @__PURE__ */ (0,
|
|
3792
|
-
/* @__PURE__ */ (0,
|
|
3793
|
-
/* @__PURE__ */ (0,
|
|
3794
|
-
/* @__PURE__ */ (0,
|
|
3795
|
-
onRequestPermission && /* @__PURE__ */ (0,
|
|
3921
|
+
status === "permission-required" && permissionMessage && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "arap-card-alert arap-card-permission", role: "status", children: [
|
|
3922
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u{1F512}" }),
|
|
3923
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "arap-permission-content", children: [
|
|
3924
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: permissionMessage }),
|
|
3925
|
+
onRequestPermission && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3796
3926
|
"button",
|
|
3797
3927
|
{
|
|
3798
3928
|
type: "button",
|
|
@@ -3803,14 +3933,14 @@ function FeatureCard({
|
|
|
3803
3933
|
)
|
|
3804
3934
|
] })
|
|
3805
3935
|
] }),
|
|
3806
|
-
/* @__PURE__ */ (0,
|
|
3936
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "arap-card-content", children })
|
|
3807
3937
|
]
|
|
3808
3938
|
}
|
|
3809
3939
|
);
|
|
3810
3940
|
}
|
|
3811
3941
|
|
|
3812
3942
|
// src/core/controls/FeatureStatusState.tsx
|
|
3813
|
-
var
|
|
3943
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3814
3944
|
function SearchCount({
|
|
3815
3945
|
totalCount,
|
|
3816
3946
|
matchedCount,
|
|
@@ -3819,7 +3949,7 @@ function SearchCount({
|
|
|
3819
3949
|
style
|
|
3820
3950
|
}) {
|
|
3821
3951
|
const text = query ? `Showing ${matchedCount} of ${totalCount} tools matching "${query}"` : `Showing all ${totalCount} tools`;
|
|
3822
|
-
return /* @__PURE__ */ (0,
|
|
3952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3823
3953
|
"div",
|
|
3824
3954
|
{
|
|
3825
3955
|
role: "status",
|
|
@@ -3839,17 +3969,17 @@ function EmptyState({
|
|
|
3839
3969
|
className = "",
|
|
3840
3970
|
style
|
|
3841
3971
|
}) {
|
|
3842
|
-
return /* @__PURE__ */ (0,
|
|
3972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
3843
3973
|
"div",
|
|
3844
3974
|
{
|
|
3845
3975
|
role: "status",
|
|
3846
3976
|
className: `arap-empty-state ${className}`,
|
|
3847
3977
|
style,
|
|
3848
3978
|
children: [
|
|
3849
|
-
/* @__PURE__ */ (0,
|
|
3850
|
-
/* @__PURE__ */ (0,
|
|
3851
|
-
/* @__PURE__ */ (0,
|
|
3852
|
-
onAction && /* @__PURE__ */ (0,
|
|
3979
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "arap-empty-icon", "aria-hidden": "true", children: icon ?? "\u{1F50D}" }),
|
|
3980
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h3", { className: "arap-empty-title", children: title }),
|
|
3981
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "arap-empty-desc", children: description }),
|
|
3982
|
+
onAction && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", className: "arap-empty-btn", onClick: onAction, children: actionLabel })
|
|
3853
3983
|
]
|
|
3854
3984
|
}
|
|
3855
3985
|
);
|
|
@@ -3862,18 +3992,18 @@ function ErrorState({
|
|
|
3862
3992
|
className = "",
|
|
3863
3993
|
style
|
|
3864
3994
|
}) {
|
|
3865
|
-
return /* @__PURE__ */ (0,
|
|
3995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
3866
3996
|
"div",
|
|
3867
3997
|
{
|
|
3868
3998
|
role: "alert",
|
|
3869
3999
|
className: `arap-error-state arap-card-alert arap-card-error ${className}`,
|
|
3870
4000
|
style,
|
|
3871
4001
|
children: [
|
|
3872
|
-
/* @__PURE__ */ (0,
|
|
3873
|
-
/* @__PURE__ */ (0,
|
|
3874
|
-
title && /* @__PURE__ */ (0,
|
|
3875
|
-
/* @__PURE__ */ (0,
|
|
3876
|
-
onRetry && /* @__PURE__ */ (0,
|
|
4002
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
|
|
4003
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "arap-error-content", children: [
|
|
4004
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h4", { className: "arap-error-title", children: title }),
|
|
4005
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "arap-error-message", children: message }),
|
|
4006
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", className: "arap-retry-btn", onClick: onRetry, children: retryLabel })
|
|
3877
4007
|
] })
|
|
3878
4008
|
]
|
|
3879
4009
|
}
|
|
@@ -3881,7 +4011,7 @@ function ErrorState({
|
|
|
3881
4011
|
}
|
|
3882
4012
|
|
|
3883
4013
|
// src/core/controls/ProfilePreviewCard.tsx
|
|
3884
|
-
var
|
|
4014
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3885
4015
|
function ProfilePreviewCard({
|
|
3886
4016
|
profile,
|
|
3887
4017
|
isActive,
|
|
@@ -3931,7 +4061,7 @@ function ProfilePreviewCard({
|
|
|
3931
4061
|
if (val === null || val === void 0) return "Original";
|
|
3932
4062
|
return String(val);
|
|
3933
4063
|
};
|
|
3934
|
-
return /* @__PURE__ */ (0,
|
|
4064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
3935
4065
|
"div",
|
|
3936
4066
|
{
|
|
3937
4067
|
role: "group",
|
|
@@ -3939,10 +4069,10 @@ function ProfilePreviewCard({
|
|
|
3939
4069
|
className: `arap-profile-card ${isActive ? "arap-profile-card-active" : ""} ${largeControls ? "arap-large-controls" : ""} ${className}`,
|
|
3940
4070
|
style,
|
|
3941
4071
|
children: [
|
|
3942
|
-
/* @__PURE__ */ (0,
|
|
3943
|
-
/* @__PURE__ */ (0,
|
|
3944
|
-
/* @__PURE__ */ (0,
|
|
3945
|
-
isActive && /* @__PURE__ */ (0,
|
|
4072
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "arap-profile-header", children: [
|
|
4073
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "arap-profile-title-row", children: [
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h4", { className: "arap-profile-title", children: profile.label }),
|
|
4075
|
+
isActive && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3946
4076
|
"span",
|
|
3947
4077
|
{
|
|
3948
4078
|
className: "arap-profile-active-badge",
|
|
@@ -3951,14 +4081,14 @@ function ProfilePreviewCard({
|
|
|
3951
4081
|
}
|
|
3952
4082
|
)
|
|
3953
4083
|
] }),
|
|
3954
|
-
/* @__PURE__ */ (0,
|
|
4084
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "arap-profile-desc", children: profile.description })
|
|
3955
4085
|
] }),
|
|
3956
|
-
/* @__PURE__ */ (0,
|
|
3957
|
-
/* @__PURE__ */ (0,
|
|
3958
|
-
/* @__PURE__ */ (0,
|
|
4086
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "arap-profile-affected", children: [
|
|
4087
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "arap-profile-affected-label", children: "Affected settings:" }),
|
|
4088
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "arap-profile-chips", children: affectedKeys.map((key) => {
|
|
3959
4089
|
const val = profile.settings[key];
|
|
3960
|
-
return /* @__PURE__ */ (0,
|
|
3961
|
-
/* @__PURE__ */ (0,
|
|
4090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "arap-profile-chip", children: [
|
|
4091
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("strong", { children: [
|
|
3962
4092
|
formatKeyName(key),
|
|
3963
4093
|
":"
|
|
3964
4094
|
] }),
|
|
@@ -3967,7 +4097,7 @@ function ProfilePreviewCard({
|
|
|
3967
4097
|
] }, key);
|
|
3968
4098
|
}) })
|
|
3969
4099
|
] }),
|
|
3970
|
-
/* @__PURE__ */ (0,
|
|
4100
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "arap-profile-actions", children: isActive ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3971
4101
|
"button",
|
|
3972
4102
|
{
|
|
3973
4103
|
type: "button",
|
|
@@ -3976,7 +4106,7 @@ function ProfilePreviewCard({
|
|
|
3976
4106
|
"aria-label": `Revert ${profile.label} profile`,
|
|
3977
4107
|
children: "Revert to custom settings"
|
|
3978
4108
|
}
|
|
3979
|
-
) : /* @__PURE__ */ (0,
|
|
4109
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3980
4110
|
"button",
|
|
3981
4111
|
{
|
|
3982
4112
|
type: "button",
|
|
@@ -4029,6 +4159,7 @@ function ProfilePreviewCard({
|
|
|
4029
4159
|
ProfilePreviewCard,
|
|
4030
4160
|
ReadingGuideController,
|
|
4031
4161
|
ReadingMaskController,
|
|
4162
|
+
ReduceMotionController,
|
|
4032
4163
|
ResetController,
|
|
4033
4164
|
SaturationController,
|
|
4034
4165
|
SearchCount,
|
|
@@ -4052,6 +4183,7 @@ function ProfilePreviewCard({
|
|
|
4052
4183
|
isProtectedFromTextAlign,
|
|
4053
4184
|
isProtectedFromTextScale,
|
|
4054
4185
|
isProtectedFromTextSpacing,
|
|
4186
|
+
isReducedMotionActive,
|
|
4055
4187
|
isRtlLocale,
|
|
4056
4188
|
normalizePreferenceValue,
|
|
4057
4189
|
normalizePreferences,
|
|
@@ -4059,6 +4191,8 @@ function ProfilePreviewCard({
|
|
|
4059
4191
|
registerLocale,
|
|
4060
4192
|
resolveEffectivePreferences,
|
|
4061
4193
|
resolveLocaleStrings,
|
|
4194
|
+
subscribeForcedColors,
|
|
4195
|
+
subscribeReducedMotion,
|
|
4062
4196
|
useAccessibility
|
|
4063
4197
|
});
|
|
4064
4198
|
//# sourceMappingURL=index.js.map
|