Skip to content

Commit 58f29f9

Browse files
RoyalPineapplejohnnewman-squaresoroushsqclaude
authored
refactor: Migrate Accessibility Infrastructure from Market Design System (#593)
# Migrate Accessibility Infrastructure from Market Design System ## Overview This PR migrates accessibility infrastructure components from the market design system into the Blueprint repository, consolidating accessibility tooling for Blueprint consumers. ## Changes ### New Module: `BlueprintUIAccessibilityCore` - Created new Swift package target for accessibility infrastructure - Migrated accessibility composition and deferral patterns from market design system - Added localization support for 12 locales (en, es, fr, ca, ja, pt variants) - Included test coverage for accessibility features ### Key Components - **AccessibilityComposition**: Combines multiple accessibility elements into unified experiences - **AccessibilityDeferral**: Enables content inheritance patterns for form fields and containers - **AccessibilitySetter**: Element wrapper for applying accessibility properties with composition - **Localized strings infrastructure** with extraction tooling - **Extensions and utilities** for accessibility traits and custom actions ### BlueprintUICommonControls Updates - **Reorganized accessibility files** into dedicated `Accessibility/` directory - **Added AccessibilityCombine**: Element wrapper that uses the new composition infrastructure - **Added AccessibilityModifiers**: Convenience methods that leverage the new core functionality - **Updated existing accessibility elements** to integrate with the new module - **Maintained backwards compatibility** for all existing accessibility APIs ### Dependencies Updated - Modified `BlueprintUICommonControls` to depend on `BlueprintUIAccessibilityCore` - Updated `Package.swift` to include the new accessibility core target - Enhanced build configuration with resource handling for localized strings ### Developer Tooling - Added string extraction script (`Scripts/extract_english_strings.sh`) - Included comprehensive documentation in `BlueprintUIAccessibilityCore/README.md` - Updated project configuration for Xcode and Tuist ## Files Modified ### New Module Structure ``` BlueprintUIAccessibilityCore/ ├── README.md ├── Sources/ │ ├── AccessibilityComposition.swift │ ├── AccessibilityDeferral.swift │ ├── AccessibilitySetter.swift │ ├── LocalizedStrings.swift │ └── Extensions/ │ ├── AccessibilityTraits+Extensions.swift │ ├── Array+Extensions.swift │ ├── Optional+Extensions.swift │ └── UIAccessibilityCustomAction+Extensions.swift ├── Tests/ │ └── AccessibilityCompositionTests.swift └── Resources/ (12 localization directories) ``` ### BlueprintUICommonControls Changes ``` BlueprintUICommonControls/Sources/Accessibility/ ├── AccessibilityBlocker.swift (moved) ├── AccessibilityContainer.swift (moved) ├── AccessibilityElement.swift (moved) ├── AccessibilityFocus.swift (moved) ├── AccessibilityLargeContentViewer.swift (moved) ├── AccessibilityCombine.swift (new) └── AccessibilityModifiers.swift (new) ``` ## Rationale - Consolidates accessibility tooling previously distributed across repositories - Makes accessibility patterns available to all Blueprint consumers - Improves maintainability through centralized infrastructure - Enables consistent testing and documentation ## Testing - All existing tests continue to pass - Localization strings validated - Module dependencies verified ## Breaking Changes None. This change is additive and does not affect existing Blueprint functionality. --------- Co-authored-by: johnnewman-square <[email protected]> Co-authored-by: Soroush Khanlou <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent a378ea7 commit 58f29f9

35 files changed

+3223
-4
lines changed

BlueprintUIAccessibilityCore/README.md

Lines changed: 413 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* A label for accessibility custom content that indicates that an associated string is an error message. */
2+
"accessibility_error_label" = "Error";
3+
4+
/* The default accessibility label for '-' button in Stepper. This button should decrease the value of the stepper. */
5+
"stepper_decrement" = "Redueix";
6+
7+
/* The default accessibility label for '+' button in Stepper. This button should increase the value of the stepper. */
8+
"stepper_increase" = "Incrementa";
9+
10+
/* Accessibility label describing a checkbox that is neither checked nor unchecked, but 'mixed' - it displays a dash instead of a check. */
11+
"toggle_mixed" = "Combinat";
12+
13+
/* Accessibility label describing a checkbox or switch that is unchecked or off */
14+
"toggle_off" = "Desactivat";
15+
16+
/* Accessibility label describing a checkbox or switch that is checked or on. */
17+
"toggle_on" = "Activat";
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* A label for accessibility custom content that indicates that an associated string is an error message. */
2+
"accessibility_error_label" = "Error";
3+
4+
/* The default accessibility label for '-' button in Stepper. This button should decrease the value of the stepper. */
5+
"stepper_decrement" = "Decrement";
6+
7+
/* The default accessibility label for '+' button in Stepper. This button should increase the value of the stepper. */
8+
"stepper_increase" = "Increment";
9+
10+
/* Accessibility label describing a checkbox that is neither checked nor unchecked, but 'mixed' - it displays a dash instead of a check. */
11+
"toggle_mixed" = "Mixed";
12+
13+
/* Accessibility label describing a checkbox or switch that is unchecked or off */
14+
"toggle_off" = "Off";
15+
16+
/* Accessibility label describing a checkbox or switch that is checked or on. */
17+
"toggle_on" = "On";
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* A label for accessibility custom content that indicates that an associated string is an error message. */
2+
"accessibility_error_label" = "Error";
3+
4+
/* The default accessibility label for '-' button in Stepper. This button should decrease the value of the stepper. */
5+
"stepper_decrement" = "Decrement";
6+
7+
/* The default accessibility label for '+' button in Stepper. This button should increase the value of the stepper. */
8+
"stepper_increase" = "Increment";
9+
10+
/* Accessibility label describing a checkbox that is neither checked nor unchecked, but 'mixed' - it displays a dash instead of a check. */
11+
"toggle_mixed" = "Mixed";
12+
13+
/* Accessibility label describing a checkbox or switch that is unchecked or off */
14+
"toggle_off" = "Off";
15+
16+
/* Accessibility label describing a checkbox or switch that is checked or on. */
17+
"toggle_on" = "On";
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* A label for accessibility custom content that indicates that an associated string is an error message. */
2+
"accessibility_error_label" = "Error";
3+
4+
/* The default accessibility label for '-' button in Stepper. This button should decrease the value of the stepper. */
5+
"stepper_decrement" = "Decrement";
6+
7+
/* The default accessibility label for '+' button in Stepper. This button should increase the value of the stepper. */
8+
"stepper_increase" = "Increment";
9+
10+
/* Accessibility label describing a checkbox that is neither checked nor unchecked, but 'mixed' - it displays a dash instead of a check. */
11+
"toggle_mixed" = "Mixed";
12+
13+
/* Accessibility label describing a checkbox or switch that is unchecked or off */
14+
"toggle_off" = "Off";
15+
16+
/* Accessibility label describing a checkbox or switch that is checked or on. */
17+
"toggle_on" = "On";
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* A label for accessibility custom content that indicates that an associated string is an error message. */
2+
"accessibility_error_label" = "Error";
3+
4+
/* The default accessibility label for '-' button in Stepper. This button should decrease the value of the stepper. */
5+
"stepper_decrement" = "Decrement";
6+
7+
/* The default accessibility label for '+' button in Stepper. This button should increase the value of the stepper. */
8+
"stepper_increase" = "Increment";
9+
10+
/* Accessibility label describing a checkbox that is neither checked nor unchecked, but 'mixed' - it displays a dash instead of a check. */
11+
"toggle_mixed" = "Mixed";
12+
13+
/* Accessibility label describing a checkbox or switch that is unchecked or off */
14+
"toggle_off" = "Off";
15+
16+
/* Accessibility label describing a checkbox or switch that is checked or on. */
17+
"toggle_on" = "On";
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* A label for accessibility custom content that indicates that an associated string is an error message. */
2+
"accessibility_error_label" = "Error";
3+
4+
/* Accessibility action to decrement a value */
5+
"Decrement" = "Decrement";
6+
7+
/* Accessibility action to increment a value */
8+
"Increment" = "Increment";
9+
10+
/* Accessibility value for a toggle button in a mixed state */
11+
"Mixed" = "Mixed";
12+
13+
/* Accessibility value for a toggle button in the off state */
14+
"Off" = "Off";
15+
16+
/* Accessibility value for a toggle button in the on state */
17+
"On" = "On";
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* A label for accessibility custom content that indicates that an associated string is an error message. */
2+
"accessibility_error_label" = "Error";
3+
4+
/* The default accessibility label for '-' button in Stepper. This button should decrease the value of the stepper. */
5+
"stepper_decrement" = "Disminuir";
6+
7+
/* The default accessibility label for '+' button in Stepper. This button should increase the value of the stepper. */
8+
"stepper_increase" = "Aumentar";
9+
10+
/* Accessibility label describing a checkbox that is neither checked nor unchecked, but 'mixed' - it displays a dash instead of a check. */
11+
"toggle_mixed" = "Combinación";
12+
13+
/* Accessibility label describing a checkbox or switch that is unchecked or off */
14+
"toggle_off" = "Desactivada";
15+
16+
/* Accessibility label describing a checkbox or switch that is checked or on. */
17+
"toggle_on" = "Activada";
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* A label for accessibility custom content that indicates that an associated string is an error message. */
2+
"accessibility_error_label" = "Error";
3+
4+
/* The default accessibility label for '-' button in Stepper. This button should decrease the value of the stepper. */
5+
"stepper_decrement" = "Disminución";
6+
7+
/* The default accessibility label for '+' button in Stepper. This button should increase the value of the stepper. */
8+
"stepper_increase" = "Aumento";
9+
10+
/* Accessibility label describing a checkbox that is neither checked nor unchecked, but 'mixed' - it displays a dash instead of a check. */
11+
"toggle_mixed" = "Combinado";
12+
13+
/* Accessibility label describing a checkbox or switch that is unchecked or off */
14+
"toggle_off" = "Desactivado";
15+
16+
/* Accessibility label describing a checkbox or switch that is checked or on. */
17+
"toggle_on" = "Activado";
18+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* A label for accessibility custom content that indicates that an associated string is an error message. */
2+
"accessibility_error_label" = "Erreur";
3+
4+
/* The default accessibility label for '-' button in Stepper. This button should decrease the value of the stepper. */
5+
"stepper_decrement" = "Diminution";
6+
7+
/* The default accessibility label for '+' button in Stepper. This button should increase the value of the stepper. */
8+
"stepper_increase" = "Augmentation";
9+
10+
/* Accessibility label describing a checkbox that is neither checked nor unchecked, but 'mixed' - it displays a dash instead of a check. */
11+
"toggle_mixed" = "Mixte";
12+
13+
/* Accessibility label describing a checkbox or switch that is unchecked or off */
14+
"toggle_off" = "Désactivé";
15+
16+
/* Accessibility label describing a checkbox or switch that is checked or on. */
17+
"toggle_on" = "Activé";
18+

0 commit comments

Comments
 (0)