diff --git a/.claude/skills b/.claude/skills new file mode 120000 index 000000000..e5da19da9 --- /dev/null +++ b/.claude/skills @@ -0,0 +1 @@ +../.opencode/skills \ No newline at end of file diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000..a3ed2dfbb --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,270 @@ +# OUDS Flutter - GitHub Copilot Instructions + +This file provides guidance to GitHub Copilot when working on this repository. +It covers contributor and maintainer guidelines: code formatting, architecture, build process, best practices, accessibility, development requirements, build commands and review guidelines. + +## Skills + +Load the appropriate skill before acting on the related task: + +| Task | Skill to load | +|------|---------------| +| Ask about or explain OUDS-specific terms (Tokenator, token, raw token, semantic token, component token, theme, …) | `ouds-flutter-vocabulary` | +| Write or review Dart / Flutter code that uses OUDS components, themes or tokens | `ouds-flutter-framework-usage` | +| Translate a Figma token name or token family into its Dart equivalent | `ouds-flutter-figma-to-dart` | +| Migrate code between OUDS Flutter versions, adopt OUDS from native or custom Flutter components, or remove deprecated APIs | `ouds-flutter-migration-guide` | +| Implement or review accessibility (Semantics, screen readers, text scale, high-contrast, orientation) | `ouds-flutter-accessibility` | + +Skills are located in `skills//SKILL.md` (treat this folder as the source of truth; keep the copies under `.claude/skills/` and `.opencode/skills/` in sync). +## 1. Code formatting + +The source code is written in Dart and formatted with `dart format`. Linting is configured via `analysis_options.yaml` in each package using `package:flutter_lints/flutter.yaml`. + +Before any commit, run: +```bash +dart format . +flutter analyze --no-pub +``` + +No `// ignore:` suppression is allowed unless strictly justified with an explanatory comment on the same line. + +## 2. Architecture details + +The repository is a multi-package Flutter workspace managed with `pub` (native Dart workspace, `pubspec.yaml` at root). + +### 2.1 Packages + +#### `ouds_core` + +Contains all reusable UI components (widgets) provided by OUDS Flutter: buttons, switches, checkboxes, chips, tags, links, badges, navigation bars, top bars, form inputs, etc. + +- Components are located in `ouds_core/lib/components//` +- Each component class is prefixed with `Ouds` (e.g. `OudsButton`, `OudsTag`) +- Every component reads visual values exclusively through the active theme tokens +- Current component areas also include `alert/`, `bottom_sheet/`, `country_selector/`, `divider/`, `link/`, `navigation/`, `pin_code_input/`, `top_bar/`, and form inputs such as `ouds_phone_number_input.dart` and `password_input/ouds_password_input.dart` +- `ouds_core` also contains reusable module screens under `ouds_core/lib/modules/` (currently `module-about/` and `module-more/`) + +#### `ouds_theme_contract` + +Defines the `OudsThemeContract` abstract interface, the `OudsTheme` `InheritedModel` widget, semantic token abstractions and component token interfaces. + +> ⚠️ Token interface files in this package are **generated by Tokenator** (Figma → Dart). Do not edit them manually. + +#### `ouds_theme_orange` + +Implements `OudsThemeContract` for all Orange brand products. Provides `OrangeTheme`. + +#### `ouds_theme_orange_compact` + +Implements `OudsThemeContract` for Orange products with tighter space and size constraints. Provides `OrangeCompactTheme`. + +#### `ouds_theme_sosh` + +Implements `OudsThemeContract` for all Sosh brand products. Provides `SoshTheme`. + +#### `ouds_theme_wireframe` + +Implements `OudsThemeContract` for prototyping and mockups. Provides `WireframeTheme`. + +#### `ouds_global_raw_tokens` + +Contains raw design token values (colors as hex, spacing as floats, typography sizes, etc.). + +> ⚠️ All files in this package are **generated by Tokenator** (Figma → Dart). Never edit them manually. + +#### `ouds_accessibility_plugin` + +Native plugin (Android + iOS) providing platform-level accessibility features: high-contrast detection, system font scale. Used internally by `OudsCheckbox`, `OudsSwitch`, `OudsRadioButton`. + +#### `app` + +Demo application "Design System Toolbox" showcasing all components and tokens interactively. Every component must have a corresponding demo screen registered in `app/lib/ui/components/components.dart`. + +### 2.2 Architecture guidelines + +- Flutter / Material 3 is the default UI paradigm — embrace its declarative and reactive nature +- When creating a new component, try to match the equivalent Material 3 widget API as closely as possible +- Avoid unnecessary abstractions and over-engineering +- Focus on simplicity, clarity, and idiomatic Dart +- Organize by component — keep related code together +- Use extensions to organise large files +- Follow [Effective Dart](https://dart.dev/guides/language/effective-dart) naming conventions consistently +- Use `sealed class` for exhaustive type modelling (e.g. `OudsIconStatus`) +- Prefer `StatelessWidget` unless state is strictly necessary +- Use `const` constructors wherever possible + +## 3. Build verification process ⚠️ CRITICAL + +**IMPORTANT**: When editing code, you MUST: +1. Format the sources: `dart format .` +2. Run static analysis: `flutter analyze --no-pub` +3. Fix **all** errors and warnings before proceeding +4. Run tests in every modified package: `flutter test` +5. Check for dead code and remove unused imports, variables and methods + +## 4. Best practices + +### 4.1 DO + +- Write documentation in dartdoc format (`///`) for all public APIs, with at least one minimal code example +- Use Dart's type system for safety — prefer strong types, avoid `dynamic` +- Use `public` only when truly needed — prefer private (`_`) visibility +- Apply **Clean Code, DRY, SOLID** and **TDD** principles +- Use `const` constructors everywhere possible +- Use `StatelessWidget` when state is not needed +- Use `sealed class` / `enum` for exhaustive type modelling +- Split large widgets into smaller private sub-widgets or methods +- Use `final` fields in all widget classes +- Use `static` for utility methods that do not need instance context +- If a third-party dependency is added or updated, document it in `THIRD_PARTY.md` +- Use `OudsTheme.of(context)` to read all colors, spacing, typography and component tokens +- Use `OudsLocalizations.of(context)` or app localizations for user-facing strings + - When introducing breaking changes or API modifications, update `MIGRATION.md` at the root of the repository and `skills/ouds-flutter-migration-guide/SKILL.md` accordingly + +### 4.2 DON'T + +- Add abstraction layers without clear benefit +- Use `dynamic` or `Object` unless strictly necessary +- Perform heavy computation inside `build()` — move it to `initState`, a provider, or `compute()` +- Call `setState` from `initState` — use `addPostFrameCallback` if needed +- Mix business logic with UI code +- Use `print()` — use `debugPrint` or a proper logging package +- Hardcode colors, dimensions, or strings — always use tokens and localizations +- Edit or create token files in `ouds_global_raw_tokens`, `ouds_theme_contract`, `ouds_theme_orange`, `ouds_theme_orange_compact`, `ouds_theme_sosh`, or `ouds_theme_wireframe` +- Create a root barrel file for `ouds_core` — this repository imports components directly from `package:ouds_core/components/...` + +## 5. Accessibility basics 🔴 MANDATORY + +Everything is available on [Orange accessibility guidelines](https://a11y-guidelines.orange.com/fr/mobile/). + +> Load the **`ouds-flutter-accessibility`** skill for the full reference with code examples, Semantics patterns, high-contrast, TalkBack/VoiceOver and the complete testing checklist. + +### 5.1 Components + +- Wrap the root interactive element in a `Semantics` widget with appropriate flags (`button`, `checked`, `toggled`, `label`, `hint`, `value`) +- Use `ExcludeSemantics` on purely decorative children +- Use `MergeSemantics` to group related elements into a single focusable node when needed +- Always provide a `semanticsLabel` parameter on components whose meaning is conveyed by color alone (e.g. `OudsBadge`) +- Use `OudsLocalizations.of(context)` for all default accessibility strings — never hardcode them + +### 5.2 Display + +- Never lock text size — use OUDS typography tokens; never override `MediaQuery.textScalerOf` +- Do not lock the app in portrait mode — support landscape orientation +- Support high-contrast mode via `ouds_accessibility_plugin` +- Test with TalkBack (Android) and VoiceOver (iOS) + +## 6. Development requirements + +- **Flutter**: `>= 3.35.0` +- **Dart**: `>= 3.9.0` +- **Minimum Android SDK**: API 21 (Android 5.0) +- **Minimum iOS**: 13.0 +- **Android Studio** or **Xcode** for platform builds +- A physical device or simulator/emulator for full accessibility testing (TalkBack on Android, VoiceOver on iOS) + +## 7. Building commands + +### 7.1 Install dependencies + +```bash +flutter pub get +(cd ouds_core && dart pub get) +(cd app && flutter pub get) +``` + +If you modify ARB files in `app/lib/l10n/` or `ouds_core/lib/l10n/`, regenerate the generated localization files in the corresponding package: + +```bash +(cd app && flutter gen-l10n) +(cd ouds_core && flutter gen-l10n) +``` + +### 7.2 Run tests + +Run tests in each modified package that currently has a `test/` directory: + +```bash +(cd app && flutter test) +(cd ouds_core && flutter test) +(cd ouds_global_raw_tokens && flutter test) +(cd ouds_theme_contract && flutter test) +(cd ouds_theme_orange && flutter test) +(cd ouds_theme_sosh && flutter test) +(cd ouds_theme_wireframe && flutter test) +``` + +At the time of writing, `ouds_theme_orange_compact` and `ouds_accessibility_plugin` do not contain a `test/` directory. + +### 7.3 Run static analysis + +```bash +flutter analyze --no-pub +``` + +### 7.4 Format the sources + +```bash +dart format . +``` + +### 7.5 Build documentation + +```bash +cd ouds_core && dart doc +``` + +## 8. Review guidelines + +- [ ] Sources are formatted — `dart format .` produces no diff +- [ ] `flutter analyze --no-pub` passes with zero errors and warnings +- [ ] All tests pass — `flutter test` in every modified package +- [ ] No dead code — leave a comment identifying any element that seems unused +- [ ] Documentation builds without error — `dart doc` in `ouds_core` produces no error +- [ ] No secrets or credentials committed (Gitleaks scan via `.github/workflows/gitleaks.yml`) +- [ ] No function is too long or too complex — keep cyclomatic complexity low, split if needed +- [ ] All commits are signed-off (DCO applied) by their authors +- [ ] All new public APIs have dartdoc comments (`///`) with at least one code example +- [ ] All new interactive widgets use `Semantics` with appropriate flags +- [ ] No hardcoded colors, dimensions, or strings — tokens and localizations are used +- [ ] Component tested visually with all 4 themes (Orange, Orange Compact, Sosh, Wireframe) +- [ ] Component tested in light **and** dark mode +- [ ] Demo screen added or updated in `app/lib/ui/components//` +- [ ] Demo screen registered in `app/lib/ui/components/components.dart` +- [ ] Commit message follows [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, `doc:`, `chore:`, `test:`) +- [ ] `MIGRATION.md` updated if any public API has changed or been deprecated +- [ ] `skills/ouds-flutter-migration-guide/SKILL.md` updated to reflect any new migration steps + +## 9. Agent response optimization 🚀 + +When using GitHub Copilot for code reviews, refactoring, or documentation updates, minimize token consumption: + +### Key principles + +- **Batch operations**: Combine multiple file edits into single calls; parallelize `grep_search` and `file_search` +- **Skip verbose narrative**: Avoid acknowledgments and filler ("Sounds good!", "Let me now..."); use single-line summaries +- **Compress output**: Use tables/checklists instead of prose; reference line numbers instead of repeating content +- **Front-load context**: Gather all research upfront before proposing changes; use `run_subagent` for large searches +- **Minimize reads**: Read files once with adequate ranges; use search filters to avoid irrelevant files + +### Response template (optimized) + +``` +**[Action summary — 1 line]** + +### Changes +[Table or checklist of modifications] + +### Verification +[Brief grep/status check results] +``` + +**Target**: 150–300 tokens per response (50–60% reduction vs. standard approach). + +### When to delegate to subagent + +Use `run_subagent` when: +- Search scope involves 50+ files +- Result set would exceed 500 tokens +- Task requires multiple sequential searches + diff --git a/.github/workflows/dartdoc-gh-pages.yml b/.github/workflows/dartdoc-gh-pages.yml index 7cf5c0eec..5e36c2b1b 100644 --- a/.github/workflows/dartdoc-gh-pages.yml +++ b/.github/workflows/dartdoc-gh-pages.yml @@ -100,6 +100,7 @@ jobs: uses: ./.github/actions/setup - name: Setup Pages + if: github.event_name != 'pull_request' uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 - name: Setup Ruby diff --git a/.opencode/skills b/.opencode/skills new file mode 120000 index 000000000..42c5394a1 --- /dev/null +++ b/.opencode/skills @@ -0,0 +1 @@ +../skills \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..92edaa57e --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,52 @@ +| Property | Value | +|----------------|----------------------------| +| type | ai-agent-guide | +| framework | OUDS-Flutter | +| language | Dart | +| ui-framework | Flutter / Material 3 | +| platforms | Android, iOS | +| min-sdk | Android API 21 / iOS 13 | + +# OUDS Flutter - AI Agent Guide + +OUDS (Orange Unified Design System) is a multi-package Flutter workspace providing design tokens, themes and Material 3 components for Orange Group products. +The demo application is called "Design System Toolbox". +The project is open source (MIT) at https://github.com/Orange-OpenSource/ouds-flutter. +Target platforms: Android API 21+, iOS 13+. Language: Dart 3.9+ / Flutter 3.35+. + +## Skills + +Load skills on demand for detailed guidance: + +- **`ouds-flutter-vocabulary`** — glossary of OUDS Flutter-specific terms (Tokenator, token types, theme, …) +- **`ouds-flutter-framework-usage`** — full OUDS Flutter usage reference: imports, themes, tokens, localizations, all components with code examples +- **`ouds-flutter-figma-to-dart`** — how to derive Dart naming and token layer from Figma token families for the OUDS Flutter project (raw, semantic and component tokens) +- **`ouds-flutter-migration-guide`** — adopt OUDS Flutter from native Flutter or custom components, migrate between OUDS Flutter versions, before/after mappings +- **`ouds-flutter-accessibility`** — OUDS Flutter Semantics patterns, text scale, high-contrast, TalkBack / VoiceOver, orientation and full testing checklist + +## Key files + +| File | Purpose | +|------|---------| +| `.github/copilot-instructions.md` | Architecture, build commands, best practices, accessibility, review checklist | +| `pubspec.yaml` | Workspace manifest — lists all packages | +| `ouds_core/lib/components/` | All OUDS widgets (`OudsButton`, `OudsTag`, …) | +| `ouds_theme_contract/lib/` | Abstract token interfaces — generated by Tokenator, never edit manually | +| `app/lib/ui/components/components.dart` | Demo screen registry — register every new component here | +| `MIGRATION.md` | Public API change log — update for every breaking change or deprecation | + +## Critical rules + +- Always load the **`ouds-flutter-vocabulary`** skill before discussing tokens or themes. +- Always load the **`ouds-flutter-framework-usage`** skill before writing or reviewing code that uses OUDS components or tokens. +- Always load the **`ouds-flutter-figma-to-dart`** skill when asked to find or map a Figma token name to its Dart equivalent. +- Always load the **`ouds-flutter-migration-guide`** skill when asked to migrate code, adopt OUDS in an existing app, replace native/custom Flutter components with OUDS equivalents, or remove deprecated APIs. +- Always load the **`ouds-flutter-accessibility`** skill when asked about Semantics, screen readers, TalkBack, VoiceOver, text scale, high-contrast or orientation. +- Before committing: `dart format .` → `flutter analyze --no-pub` → fix all errors → `flutter test` in every modified package (see `.github/copilot-instructions.md §7`). +- **Never** create or edit token files in `ouds_global_raw_tokens`, `ouds_theme_contract`, `ouds_theme_orange`, `ouds_theme_orange_compact`, `ouds_theme_sosh`, or `ouds_theme_wireframe` — all content is generated by Tokenator. +- **Never** create a root barrel file for `ouds_core` — import components directly (e.g. `package:ouds_core/components/button/ouds_button.dart`). +- When introducing a breaking change or deprecation: update **both** `MIGRATION.md` **and** `skills/ouds-flutter-migration-guide/SKILL.md`. +- Use `OudsTheme.of(context)` for all colors, spacing, typography and component tokens — never hardcode values. +- Use `OudsLocalizations.of(context)` for all user-facing and accessibility strings — never hardcode them. +- Prefix all OUDS widgets with `Ouds` (e.g. `OudsButton`, `OudsTag`). +- Every new interactive widget must wrap its root element in a `Semantics` widget with appropriate flags (`button`, `checked`, `toggled`, `label`, `hint`, `value`). diff --git a/MIGRATION.md b/MIGRATION.md index 30b00f7fa..36c3e04fe 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,11 +1,101 @@ # Migration Guide +- [v1.3.1 → v2.0.0](#v131--v200) - [v1.3.0 → v1.3.1](#v130--v131) - [v1.2.0 → v1.3.0](#v120--v130) - [v1.1.x → v1.2.0](#v11x--v120) - [v1.0.0 → v1.1.1](#v100--v111) - [Support](#support) +## v1.3.1 → v2.0.0 + +### Overview + +This is a **major release** introducing rich text support across multiple components, significant design version updates, major token updates (v2.4.0 and v2.5.0), and an updated icon library (v1.6). It also brings improvements to the `Tab Bar`, `Toolbar Top`, `Badge`, `Tag`, `Input Tag`, `Text Input`, `Password Input`, `Phone Number Input`, `Filter Chip`, and `Suggestion Chip` components. + +### Before You Begin + +#### Prerequisites + +- Use version 1.3.1 or older + +### Breaking Changes + +#### 1. Rich text (Markdown) support in multiple components + +Several components have been updated to support Markdown formatting in their label/content parameters. The `label` (or equivalent text parameter) still accepts a plain `String`, but now also renders Markdown syntax (bold, italic, links, etc.). + +**Affected components**: `OudsAlertMessage`, `OudsSwitch`, `OudsRadioButton`, `OudsCheckbox`, `OudsTextInput`, `OudsPinCodeInput`, `OudsPhoneNumberInput` + +**Impact**: Low (additive — existing plain strings continue to work as before) + +**Required Action**: +- No action required (backward compatible) +- Optionally use Markdown syntax in labels to add bold, italic, or link formatting + +**Reason for Change**: Provide richer content support across input and control components + +#### 2. Token breaking changes — v2.4.0 and v2.5.0 + +Design tokens have been updated to versions 2.4.0 and 2.5.0. These major token updates may rename or restructure token keys. + +**Impact**: Medium (only if overriding tokens directly in a custom theme) + +**Required Action**: +- If you override tokens in a custom theme, audit your overrides against the new token names +- Rebuild and check for compilation errors related to missing or renamed token properties + +**Reason for Change**: Align with latest design system token specification + +#### 3. Icon library update — v1.6 + +The OUDS icon library has been updated to version 1.6. Some icon names or asset paths may have changed. + +**Impact**: Medium (if using icon constants from the library) + +**Required Action**: +- Review any icon constants or asset paths you reference directly +- Update to the new icon names from v1.6 if you receive compilation errors or missing asset warnings + +### Component Design Version Updates + +Several components have been updated to align with new design specification versions. These changes are primarily visual and do not require code changes unless you override component tokens in a custom theme. + +**Impact**: Low–Medium (visual changes; verify rendering after upgrading) + +**Required Action**: +- Verify the visual appearance and accessibility behaviour of each updated component after upgrading +- If you override component tokens in a custom theme, check that your overrides are still valid + +| Component | New Design Version | +|-----------|--------------------| +| `OudsTextInput` | v1.4 | +| `OudsPasswordInput` | v1.3 | +| `OudsFilterChip` / `OudsSuggestionChip` | v1.4 | +| `OudsBadge` (icon variant) | v1.3.0 | +| `OudsPhoneNumberInput` | v1.3 | +| `OudsTag` | v1.5 | +| `OudsInputTag` | v1.2 | + +### Component Updates (Non-breaking) + +| Component | Change | +|-----------|--------| +| Tab Bar | Updated selected tab indicator animation | +| Toolbar Top | Badge support added in trailing actions | +| Bottom Bar | Fixed inconsistent accessible order and zoom overlap | +| Password Input | Fixed label truncation when zoom is applied | +| Filter Chip | Fixed keyboard/Switch Access focus issue | +| Phone Number Input | Added interaction hint for accessibility | +| Input Tag | Fixed button role for accessibility | + +### Compatibility + +- **Backward Compatibility**: No (breaking changes in token API, icon API, and component label parameters) +- **v1.3.1 Support**: Ended with this release + +--- + > **Note**: v1.3.1 is a maintenance release with bug fixes and improvements. No migration is required. ## v1.3.0 → v1.3.1 diff --git a/NOTICE.txt b/NOTICE.txt index f1bca1d3c..8f02f43b6 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -12,9 +12,6 @@ Any use or displaying shall constitute an infringement under intellectual proper ouds-flutter/app/assets/about_privacy_policy.md ouds-flutter/app/assets/about_legal_information.md -# common - component -ouds-flutter/app/assets/common/component/il_top_app_bar_avatar.jpg - # Illustration ouds-flutter/app/assets/illustration/token/il_tokens_color.svg ouds-flutter/app/assets/illustration/token/il_tokens_color_dark.svg @@ -28,6 +25,7 @@ ouds-flutter/app/assets/illustration/token/il_tokens_typography.svg ouds-flutter/app/assets/illustration/token/il_tokens_typography_dark.svg ouds-flutter/app/assets/illustration/token/il_tokens_border.svg ouds-flutter/app/assets/illustration/token/il_tokens_border_dark.svg +ouds-flutter/app/assets/illustration/component/il_top_app_bar_avatar.jpg # Communication - Assistance ouds-flutter/app/assets/orange/communication/assistance/tips-and-tricks.svg @@ -92,6 +90,7 @@ ouds-flutter/app/assets/orange_compact/functional/navigation/filters.svg ## OUDS / Themes / Orange ouds_theme_orange/assets/communication/accessibility/accessibility-vision.svg ouds_theme_orange/assets/communication/security-and-safety/lock.svg +ouds_theme_orange/assets/component/alert/error-fill.svg ouds_theme_orange/assets/component/alert/important-fill.svg ouds_theme_orange/assets/component/alert/info-fill.svg ouds_theme_orange/assets/component/alert/tick-confirmation-fill.svg @@ -121,6 +120,11 @@ ouds_theme_orange/assets/functional/social-and-engagement/heart-empty.svg ouds_theme_orange/assets/functional/settings-and-tools/hide.svg ouds_theme_orange/assets/functional/navigation/menu.svg ouds_theme_orange/assets/component/bullet-list/bullet-level-0.svg +ouds_theme_orange/assets/component/badge-icon/warning-external-shape.svg +ouds_theme_orange/assets/component/badge-icon/warning-internal-shape.svg +ouds_theme_orange/assets/component/badge-icon/error-fill.svg +ouds_theme_orange/assets/component/badge-icon/info-fill.svg +ouds_theme_orange/assets/component/badge-icon/tick-confirmation-fill.svg ouds_theme_orange/fonts/Roboto-Black.ttf @@ -137,6 +141,7 @@ ouds_theme_orange/fonts/SF-Pro-Display-Black-Thin.ttf ## OUDS / Themes / Orange Compact ouds_theme_orange_compact/assets/communication/accessibility/accessibility-vision.svg ouds_theme_orange_compact/assets/communication/security-and-safety/lock.svg +ouds_theme_orange_compact/assets/component/alert/error-fill.svg ouds_theme_orange_compact/assets/component/alert/important-fill.svg ouds_theme_orange_compact/assets/component/alert/info-fill.svg ouds_theme_orange_compact/assets/component/alert/tick-confirmation-fill.svg @@ -167,6 +172,12 @@ ouds_theme_orange_compact/assets/functional/social-and-engagement/heart-empty.sv ouds_theme_orange_compact/assets/functional/settings-and-tools/hide.svg ouds_theme_orange_compact/assets/functional/navigation/menu.svg ouds_theme_orange_compact/assets/component/bullet-list/bullet-level-0.svg +ouds_theme_orange_compact/assets/component/badge-icon/warning-external-shape.svg +ouds_theme_orange_compact/assets/component/badge-icon/warning-internal-shape.svg +ouds_theme_orange_compact/assets/component/badge-icon/error-fill.svg +ouds_theme_orange_compact/assets/component/badge-icon/info-fill.svg +ouds_theme_orange_compact/assets/component/badge-icon/tick-confirmation-fill.svg + ouds_theme_orange_compact/fonts/Roboto-Black.ttf ouds_theme_orange_compact/fonts/Roboto-Bold.ttf @@ -182,6 +193,7 @@ ouds_theme_orange_compact/fonts/SF-Pro-Display-Black-Thin.ttf ## OUDS / Themes / Sosh ouds_theme_orange/assets/communication/accessibility/accessibility-vision.svg ouds_theme_sosh/assets/communication/security-and-safety/lock.svg +ouds_theme_sosh/assets/component/alert/error-fill.svg ouds_theme_sosh/assets/component/alert/important-fill.svg ouds_theme_sosh/assets/component/alert/info-fill.svg ouds_theme_sosh/assets/component/alert/tick-confirmation-fill.svg @@ -211,6 +223,12 @@ ouds_theme_sosh/assets/functional/social-and-engagement/heart-empty.svg ouds_theme_sosh/assets/functional/settings-and-tools/hide.svg ouds_theme_sosh/assets/functional/navigation/menu.svg ouds_theme_sosh/assets/component/bullet-list/bullet-level-0.svg +ouds_theme_sosh/assets/component/badge-icon/warning-external-shape.svg +ouds_theme_sosh/assets/component/badge-icon/warning-internal-shape.svg +ouds_theme_sosh/assets/component/badge-icon/error-fill.svg +ouds_theme_sosh/assets/component/badge-icon/info-fill.svg +ouds_theme_sosh/assets/component/badge-icon/tick-confirmation-fill.svg + ouds_theme_sosh/fonts/Sosh-Black.ttf ouds_theme_sosh/fonts/Sosh-Bold.ttf @@ -221,6 +239,7 @@ ouds_theme_sosh/fonts/Sosh-Thin.ttf ## OUDS / Themes / Wireframe ouds_theme_orange/assets/communication/accessibility/accessibility-vision.svg ouds_theme_wireframe/assets/communication/security-and-safety/lock.svg +ouds_theme_wireframe/assets/component/alert/error-fill.svg ouds_theme_wireframe/assets/component/alert/important-fill.svg ouds_theme_wireframe/assets/component/alert/info-fill.svg ouds_theme_wireframe/assets/component/alert/tick-confirmation-fill.svg @@ -249,6 +268,12 @@ ouds_theme_wireframe/assets/component/tag/close.svg ouds_theme_wireframe/assets/functional/social-and-engagement/heart-empty.svg ouds_theme_wireframe/assets/functional/settings-and-tools/hide.svg ouds_theme_wireframe/assets/functional/navigation/menu.svg +ouds_theme_wireframe/assets/component/badge-icon/warning-external-shape.svg +ouds_theme_wireframe/assets/component/badge-icon/warning-internal-shape.svg +ouds_theme_wireframe/assets/component/badge-icon/error-fill.svg +ouds_theme_wireframe/assets/component/badge-icon/info-fill.svg +ouds_theme_wireframe/assets/component/badge-icon/tick-confirmation-fill.svg + ouds_theme_wireframe/fonts/ShantellSans-Bold.ttf ouds_theme_wireframe/fonts/ShantellSans-BoldItalic.ttf diff --git a/app/CHANGELOG.md b/app/CHANGELOG.md index 31b415efc..bfa4b3900 100644 --- a/app/CHANGELOG.md +++ b/app/CHANGELOG.md @@ -4,11 +4,48 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop) +## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/2.0.0...develop) ### Added ### Changed ### Fixed +## [2.0.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...2.0.0) - 2026-06-19 +### Added +- Add agents.md with skills to project ([#668](https://github.com/Orange-OpenSource/ouds-flutter/issues/668)) + +### Changed +- [Library] Remove deprecated code and API ([#820](https://github.com/Orange-OpenSource/ouds-flutter/issues/820)) +- [Library] update `Pin code input` component to v1.3 ([#691](https://github.com/Orange-OpenSource/ouds-flutter/issues/691)) +- [Library] `tab bar component`, update the animation of the `selected tab indicator` ([#633](https://github.com/Orange-OpenSource/ouds-flutter/issues/633)) +- [DemoApp][Library] Update `ToolBar Top`, with Badge in Trailing Actions ([#642](https://github.com/Orange-OpenSource/ouds-flutter/issues/642)) +- [DemoApp][Library] update `alert message`, `switch`, `radio`, `checkbox`, `text input`, `pin code input`, `phone number input`, components to use rich text ([#782](https://github.com/Orange-OpenSource/ouds-flutter/issues/782)) +- [Library] Update text input component to v1.4 ([#692](https://github.com/Orange-OpenSource/ouds-flutter/issues/692)) +- [Library] update `Password input` component to v1.3 ([#689](https://github.com/Orange-OpenSource/ouds-flutter/issues/689)) +- [Library] `filter chip` and `suggestion chip` component update to v1.4 ([#688](https://github.com/Orange-OpenSource/ouds-flutter/issues/688)) +- [DemoApp][Library] update `badge icon` component to 1.3.0 ([#680](https://github.com/Orange-OpenSource/ouds-flutter/issues/680)) +- [Library] update library icons to use the one from v1.6 ([#661](https://github.com/Orange-OpenSource/ouds-flutter/issues/661)) +- [Library] deps downgrade dartdoc from to 8.3.3 to fix meta version ([#786](https://github.com/Orange-OpenSource/ouds-flutter/issues/786)) +- [DemoApp] deps update dependency github.com/apple/swift-protobuf to 1.38.0 ([#773](https://github.com/Orange-OpenSource/ouds-flutter/issues/773)) +- [Library] deps update dependency bump dartdoc to 9.0.4 ([#780](https://github.com/Orange-OpenSource/ouds-flutter/issues/780)) +- [Library] update `Phone number input` component to v1.3 ([#690](https://github.com/Orange-OpenSource/ouds-flutter/issues/690)) +- [Library] update `tag` component to v1.5 ([#694](https://github.com/Orange-OpenSource/ouds-flutter/issues/694)) +- [Library] update `input tag` component to v1.2 ([#695](https://github.com/Orange-OpenSource/ouds-flutter/issues/695)) +- [DemoApp][Library] update tokens 2.5.0 ([#778](https://github.com/Orange-OpenSource/ouds-flutter/issues/778)) +- [DemoApp][Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) + +### Fixed +- [Library] `Pin code input` Issue with Delete Functionality in the PIN Field ([#791](https://github.com/Orange-OpenSource/ouds-flutter/issues/791)) +- [Library] `Pin code input` glitch when typing on keyboard ([#776](https://github.com/Orange-OpenSource/ouds-flutter/issues/776)) +- [Library] `Pin code input` Focus should not move automatically to the next field ([#649](https://github.com/Orange-OpenSource/ouds-flutter/issues/649)) +- [Library] `Pin code input` Remove the hint on the group of digits ([#628](https://github.com/Orange-OpenSource/ouds-flutter/issues/628)) +- [DemoApp][Library] `Bottom Bar` Inconsistent order of the accessible ([#625](https://github.com/Orange-OpenSource/ouds-flutter/issues/625)) +- [Library] `Bottom Bar` Overlap when zoom is activated ([#627](https://github.com/Orange-OpenSource/ouds-flutter/issues/627)) +- [DemoApp] Update pubspec icons 1.6 ([#794](https://github.com/Orange-OpenSource/ouds-flutter/issues/794)) +- [Library] `Password input` Label is truncated when zoom is applied ([#600](https://github.com/Orange-OpenSource/ouds-flutter/issues/600)) +- [Library] `Filter chip` is not reached by keyboard focus or Switch Access focus ([#474](https://github.com/Orange-OpenSource/ouds-flutter/issues/474)) +- [Library] `Phone number input` Add a hint to explain how to interact with fields ([#571](https://github.com/Orange-OpenSource/ouds-flutter/issues/571)) +- [Library] `input tag` the whole component should have the role button ([#481](https://github.com/Orange-OpenSource/ouds-flutter/issues/481)) + ## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 ### Added ### Changed diff --git a/app/android/build.gradle b/app/android/build.gradle index d704c08f2..968ef42b3 100644 --- a/app/android/build.gradle +++ b/app/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '2.1.0' + ext.kotlin_version = '2.2.20' repositories { google() mavenCentral() diff --git a/app/android/settings.gradle b/app/android/settings.gradle index 11a7a9cf9..86b9d4c7e 100644 --- a/app/android/settings.gradle +++ b/app/android/settings.gradle @@ -19,7 +19,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version '8.9.1' apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false + id "org.jetbrains.kotlin.android" version "2.2.20" apply false } include ":app" diff --git a/app/assets/illustration/component/il_top_app_bar_avatar.jpg b/app/assets/illustration/component/il_top_app_bar_avatar.jpg new file mode 100644 index 000000000..3c9aa51ce Binary files /dev/null and b/app/assets/illustration/component/il_top_app_bar_avatar.jpg differ diff --git a/app/ios/Podfile.lock b/app/ios/Podfile.lock index a4c50d01e..2790e361f 100644 --- a/app/ios/Podfile.lock +++ b/app/ios/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - app_settings (5.1.1): + - app_settings (6.1.2): - Flutter - Flutter (1.0.0) - package_info_plus (0.4.5): @@ -36,12 +36,12 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/webview_flutter_wkwebview/darwin" SPEC CHECKSUMS: - app_settings: 58017cd26b604ae98c3e65acbdd8ba173703cc82 + app_settings: 0341ec6daa4f0c50f5a421bf0ad7c36084db6e90 Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 - package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4 - path_provider_foundation: 0b743cbb62d8e47eab856f09262bb8c1ddcfe6ba - url_launcher_ios: bb13df5870e8c4234ca12609d04010a21be43dfa - webview_flutter_wkwebview: 29eb20d43355b48fe7d07113835b9128f84e3af4 + package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499 + path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880 + url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b + webview_flutter_wkwebview: 8ebf4fded22593026f7dbff1fbff31ea98573c8d PODFILE CHECKSUM: 4f1c12611da7338d21589c0b2ecd6bd20b109694 diff --git a/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7b7290f1a..3affbc5e8 100644 --- a/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -114,8 +114,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf.git", "state" : { - "revision" : "ebc7251dd5b37f627c93698e4374084d98409633", - "version" : "1.28.2" + "revision" : "f6506eaa86ed2e01cb0ae14a75035b7fdbf0918f", + "version" : "1.38.0" } } ], diff --git a/app/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/app/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7b7290f1a..3affbc5e8 100644 --- a/app/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/app/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -114,8 +114,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf.git", "state" : { - "revision" : "ebc7251dd5b37f627c93698e4374084d98409633", - "version" : "1.28.2" + "revision" : "f6506eaa86ed2e01cb0ae14a75035b7fdbf0918f", + "version" : "1.38.0" } } ], diff --git a/app/lib/l10n/gen/ouds_flutter_app_localizations.dart b/app/lib/l10n/gen/ouds_flutter_app_localizations.dart index 5fdfa3847..a72cf9960 100644 --- a/app/lib/l10n/gen/ouds_flutter_app_localizations.dart +++ b/app/lib/l10n/gen/ouds_flutter_app_localizations.dart @@ -1314,6 +1314,18 @@ abstract class AppLocalizations { /// **'Last item badge'** String get app_components_navigationBar_lastItemBadge_label; + /// No description provided for @app_components_navigationBar_badge_count_a11y. + /// + /// In en, this message translates to: + /// **'{count, plural, =1 {1 unread notification} other {{count} unread notifications}}'** + String app_components_navigationBar_badge_count_a11y(int count); + + /// No description provided for @app_components_navigationBar_badge_dot_a11y. + /// + /// In en, this message translates to: + /// **'Unread notification'** + String get app_components_navigationBar_badge_dot_a11y; + /// No description provided for @app_components_topAppBar_label. /// /// In en, this message translates to: diff --git a/app/lib/l10n/gen/ouds_flutter_app_localizations_ar.dart b/app/lib/l10n/gen/ouds_flutter_app_localizations_ar.dart index a903745ff..d2d1cc23f 100644 --- a/app/lib/l10n/gen/ouds_flutter_app_localizations_ar.dart +++ b/app/lib/l10n/gen/ouds_flutter_app_localizations_ar.dart @@ -689,6 +689,24 @@ class AppLocalizationsAr extends AppLocalizations { String get app_components_navigationBar_lastItemBadge_label => 'Last item badge'; + @override + String app_components_navigationBar_badge_count_a11y(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: '$count إشعار غير مقروء', + many: '$count إشعارًا غير مقروء', + few: '$count إشعارات غير مقروءة', + two: 'إشعاران غير مقروءين', + one: 'إشعار واحد غير مقروء', + zero: 'لا توجد إشعارات غير مقروءة', + ); + return '$_temp0'; + } + + @override + String get app_components_navigationBar_badge_dot_a11y => 'إشعار غير مقروء'; + @override String get app_components_topAppBar_label => 'Top bar'; diff --git a/app/lib/l10n/gen/ouds_flutter_app_localizations_en.dart b/app/lib/l10n/gen/ouds_flutter_app_localizations_en.dart index 42e5ed21f..ecefb48a7 100644 --- a/app/lib/l10n/gen/ouds_flutter_app_localizations_en.dart +++ b/app/lib/l10n/gen/ouds_flutter_app_localizations_en.dart @@ -689,6 +689,21 @@ class AppLocalizationsEn extends AppLocalizations { String get app_components_navigationBar_lastItemBadge_label => 'Last item badge'; + @override + String app_components_navigationBar_badge_count_a11y(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: '$count unread notifications', + one: '1 unread notification', + ); + return '$_temp0'; + } + + @override + String get app_components_navigationBar_badge_dot_a11y => + 'Unread notification'; + @override String get app_components_topAppBar_label => 'Top bar'; diff --git a/app/lib/l10n/gen/ouds_flutter_app_localizations_fr.dart b/app/lib/l10n/gen/ouds_flutter_app_localizations_fr.dart index d58b3bfcd..4ad50307f 100644 --- a/app/lib/l10n/gen/ouds_flutter_app_localizations_fr.dart +++ b/app/lib/l10n/gen/ouds_flutter_app_localizations_fr.dart @@ -693,6 +693,21 @@ class AppLocalizationsFr extends AppLocalizations { String get app_components_navigationBar_lastItemBadge_label => 'Last item badge'; + @override + String app_components_navigationBar_badge_count_a11y(int count) { + String _temp0 = intl.Intl.pluralLogic( + count, + locale: localeName, + other: '$count notifications non lues', + one: '1 notification non lue', + ); + return '$_temp0'; + } + + @override + String get app_components_navigationBar_badge_dot_a11y => + 'Notification non lue'; + @override String get app_components_topAppBar_label => 'Top bar'; diff --git a/app/lib/l10n/ouds_flutter_ar.arb b/app/lib/l10n/ouds_flutter_ar.arb index 8bfc71e3d..fa42dad13 100644 --- a/app/lib/l10n/ouds_flutter_ar.arb +++ b/app/lib/l10n/ouds_flutter_ar.arb @@ -125,6 +125,15 @@ "@_components_navigation_bar": {}, "app_components_navigationBar_description_text": "Bottom bars يوفر الوصول إلى الوجهات الرئيسية للتطبيق باستخدام 3 إلى 5 علامات تبويب دائمة. يتم تمثيل كل وجهة بواسطة أيقونة وعلامة نصية اختيارية.", + "app_components_navigationBar_badge_count_a11y": "{count, plural, zero {لا توجد إشعارات غير مقروءة} one {إشعار واحد غير مقروء} two {إشعاران غير مقروءين} few {{count} إشعارات غير مقروءة} many {{count} إشعارًا غير مقروء} other {{count} إشعار غير مقروء}}", + "@app_components_navigationBar_badge_count_a11y": { + "placeholders": { + "count": { + "type": "int" + } + } + }, + "app_components_navigationBar_badge_dot_a11y": "إشعار غير مقروء", "@_components_topAppBar": {}, "app_components_topAppBar_description_text": "Top bar هو مكون موجه من الأعلى يعرض عنوان الشاشة ويوفر الوصول إلى الإجراءات الرئيسية وعناصر التنقل.", diff --git a/app/lib/l10n/ouds_flutter_en.arb b/app/lib/l10n/ouds_flutter_en.arb index 7f8a66996..b941df3d2 100644 --- a/app/lib/l10n/ouds_flutter_en.arb +++ b/app/lib/l10n/ouds_flutter_en.arb @@ -294,6 +294,15 @@ "app_components_navigationBar_description_text": "The Bottom bar provides access to an app’s primary destinations using 3 to 5 persistent tabs. Each destination is represented by an icon and optionally a text label.", "app_components_navigationBar_itemCount_label": "Item count", "app_components_navigationBar_lastItemBadge_label": "Last item badge", + "app_components_navigationBar_badge_count_a11y": "{count, plural, =1 {1 unread notification} other {{count} unread notifications}}", + "@app_components_navigationBar_badge_count_a11y": { + "placeholders": { + "count": { + "type": "int" + } + } + }, + "app_components_navigationBar_badge_dot_a11y": "Unread notification", "@_components_topAppBar": {}, "app_components_topAppBar_label": "Top bar", diff --git a/app/lib/l10n/ouds_flutter_fr.arb b/app/lib/l10n/ouds_flutter_fr.arb index 5dc3dba4d..84b07225f 100644 --- a/app/lib/l10n/ouds_flutter_fr.arb +++ b/app/lib/l10n/ouds_flutter_fr.arb @@ -122,6 +122,15 @@ "@_components_navigation_bar": {}, "app_components_navigationBar_description_text": "Une Bottom bar (ou barre inférieure) permet d'accéder aux principales destinations d'une application grâce à 3 à 5 onglets permanents. Chaque destination est représentée par une icône et, éventuellement, par un libellé textuel.", + "app_components_navigationBar_badge_count_a11y": "{count, plural, =1 {1 notification non lue} other {{count} notifications non lues}}", + "@app_components_navigationBar_badge_count_a11y": { + "placeholders": { + "count": { + "type": "int" + } + } + }, + "app_components_navigationBar_badge_dot_a11y": "Notification non lue", "@_components_topAppBar": {}, "app_components_topAppBar_description_text": "L'app bar (ou barre d'application) est un composant situé en haut de l'ecran qui affiche le titre et donne accès aux actions principales et aux éléments de navigation.", diff --git a/app/lib/ui/components/alert/alert_message_demo_screen.dart b/app/lib/ui/components/alert/alert_message_demo_screen.dart index 4027b6f59..bfd43c7ca 100644 --- a/app/lib/ui/components/alert/alert_message_demo_screen.dart +++ b/app/lib/ui/components/alert/alert_message_demo_screen.dart @@ -36,6 +36,7 @@ import 'package:ouds_flutter_demo/ui/utilities/sheets_bottom/ouds_sheets_bottom. import 'package:ouds_theme_contract/ouds_component_version.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; /// Screen for the [OudsAlertMessage] component demo. class AlertMessageDemoScreen extends StatefulWidget { @@ -157,6 +158,9 @@ class _AlertMessageDemoState extends State<_AlertMessageDemo> { ), ), onClose: customizationState.hasCloseButton ? () {} : null, + onDescriptionLinkTapped: (link) async { + await launchUrl(Uri.parse(link)); + }, ), ); } diff --git a/app/lib/ui/components/badge/badge_customization.dart b/app/lib/ui/components/badge/badge_customization.dart index 378b21876..bda64b375 100644 --- a/app/lib/ui/components/badge/badge_customization.dart +++ b/app/lib/ui/components/badge/badge_customization.dart @@ -91,9 +91,7 @@ class BadgeCustomizationState final isSmallSize = selectedState == BadgeEnumSize.xsmall || selectedState == BadgeEnumSize.small; - final isTypeTrigger = - selectedType == BadgeEnumType.icon || - selectedType == BadgeEnumType.count; + final isTypeTrigger = selectedType == BadgeEnumType.count; if (isSmallSize && isTypeTrigger) { selectedState = BadgeEnumSize.medium; @@ -101,9 +99,7 @@ class BadgeCustomizationState } bool isSizeDisabled(BadgeEnumSize size) { - final isTypeTrigger = - selectedType == BadgeEnumType.icon || - selectedType == BadgeEnumType.count; + final isTypeTrigger = selectedType == BadgeEnumType.count; if (isTypeTrigger && (size == BadgeEnumSize.xsmall || size == BadgeEnumSize.small)) { return true; diff --git a/app/lib/ui/components/badge/badge_demo_screen.dart b/app/lib/ui/components/badge/badge_demo_screen.dart index b325b7dbf..e237ed491 100644 --- a/app/lib/ui/components/badge/badge_demo_screen.dart +++ b/app/lib/ui/components/badge/badge_demo_screen.dart @@ -105,10 +105,25 @@ class _Body extends StatefulWidget { class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { + final customizationState = BadgeCustomization.of(context)!; ThemeController? themeController = Provider.of( context, listen: false, ); + + //after update of badge component, each variant of badge component have his only version, + // so we need to retrieve the version based on the selected type + String getVersion() { + switch (customizationState.selectedType) { + case BadgeEnumType.standard: + return OudsComponentVersion.badge; + case BadgeEnumType.count: + return OudsComponentVersion.badgeCount; + case BadgeEnumType.icon: + return OudsComponentVersion.badgeIcon; + } + } + return DetailScreenDescription( description: context.l10n.app_components_badge_description_text, widget: Column( @@ -120,7 +135,9 @@ class _BodyState extends State<_Body> { .fixedMedium, ), Code(code: BadgeCodeGenerator.updateCode(context)), - ReferenceDesignVersionComponent(version: OudsComponentVersion.badge), + //after update of badge component, each variant of badge component have his only version, + // so we need to retrieve the version based on the selected type + ReferenceDesignVersionComponent(version: getVersion()), ], ), ); @@ -280,7 +297,6 @@ class _CustomizationContentState extends State<_CustomizationContent> { onSelected: (selectedOption) { setState(() { bool isTypeTrigger = - customizationState.selectedType == BadgeEnumType.icon || customizationState.selectedType == BadgeEnumType.count; bool isSizeTrigger = selectedOption == BadgeEnumSize.xsmall || diff --git a/app/lib/ui/components/chip/chip_filter_demo_sreen.dart b/app/lib/ui/components/chip/chip_filter_demo_sreen.dart index aa4b79962..618875245 100644 --- a/app/lib/ui/components/chip/chip_filter_demo_sreen.dart +++ b/app/lib/ui/components/chip/chip_filter_demo_sreen.dart @@ -37,7 +37,7 @@ import 'package:provider/provider.dart'; class ChipFilterDemoScreen extends StatefulWidget { final String? previousPageTitle; - const ChipFilterDemoScreen({super.key,this.previousPageTitle}); + const ChipFilterDemoScreen({super.key, this.previousPageTitle}); @override State createState() => _ChipFilterDemoScreenState(); @@ -59,7 +59,11 @@ class _ChipFilterDemoScreenState extends State { child: ChipCustomization( key: _scaffoldKey, child: Padding( - padding: EdgeInsets.only(bottom: defaultTargetPlatform == TargetPlatform.android ? MediaQuery.of(context).viewPadding.bottom : OudsTheme.of(context).spaceScheme(context).paddingBlockNone), + padding: EdgeInsets.only( + bottom: defaultTargetPlatform == TargetPlatform.android + ? MediaQuery.of(context).viewPadding.bottom + : OudsTheme.of(context).spaceScheme(context).paddingBlockNone, + ), child: Scaffold( bottomSheet: OudsSheetsBottom( onExpansionChanged: _onExpansionChanged, @@ -70,7 +74,8 @@ class _ChipFilterDemoScreenState extends State { appBar: MainAppBar( title: context.l10n.app_components_filterChip_label, showBackButton: true, - previousPageTitle: widget.previousPageTitle,), + previousPageTitle: widget.previousPageTitle, + ), body: ExcludeSemantics( excluding: !_isBottomSheetExpanded, child: _Body(), @@ -93,19 +98,24 @@ class _Body extends StatefulWidget { class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { - ThemeController? themeController = Provider.of(context, listen: false); + ThemeController? themeController = Provider.of( + context, + listen: false, + ); return DetailScreenDescription( description: context.l10n.app_components_chip_filterChip_description_text, widget: Column( children: [ _ChipFilterDemo(), - SizedBox(height: themeController.currentTheme.spaceScheme(context).fixedMedium), - Code( - code: ChipFilterCodeGenerator.updateCode(context), + SizedBox( + height: themeController.currentTheme + .spaceScheme(context) + .fixedMedium, ), + Code(code: ChipFilterCodeGenerator.updateCode(context)), ReferenceDesignVersionComponent( - version: OudsComponentVersion.chip, - ) + version: OudsComponentVersion.filterChip, + ), ], ), ); @@ -134,18 +144,20 @@ class _ChipFilterDemoState extends State<_ChipFilterDemo> { return LightDarkBox( child: OudsFilterChip( - label: ChipCustomizationUtils.getText(customizationState), - avatar: ChipCustomizationUtils.getIcon(customizationState, themeController!), - selected: customizationState?.hasSelected, - onSelected: customizationState?.hasEnabled == true - ? (newValue) { - setState( - () { - customizationState?.hasSelected = newValue; - }, - ); - } - : null), + label: ChipCustomizationUtils.getText(customizationState), + avatar: ChipCustomizationUtils.getIcon( + customizationState, + themeController!, + ), + selected: customizationState?.hasSelected, + onSelected: customizationState?.hasEnabled == true + ? (newValue) { + setState(() { + customizationState?.hasSelected = newValue; + }); + } + : null, + ), ); } } @@ -176,7 +188,9 @@ class _CustomizationContentState extends State<_CustomizationContent> { @override Widget build(BuildContext context) { - final ChipCustomizationState? customizationState = ChipCustomization.of(context); + final ChipCustomizationState? customizationState = ChipCustomization.of( + context, + ); return CustomizableSection( children: [ @@ -212,7 +226,7 @@ class _CustomizationContentState extends State<_CustomizationContent> { text: customizationState.labelText, focusNode: labelFocus, fieldType: FieldType.label, - ) + ), ], ); } diff --git a/app/lib/ui/components/chip/chip_suggestion_demo_screen.dart b/app/lib/ui/components/chip/chip_suggestion_demo_screen.dart index 2956cf8fc..fe285a826 100644 --- a/app/lib/ui/components/chip/chip_suggestion_demo_screen.dart +++ b/app/lib/ui/components/chip/chip_suggestion_demo_screen.dart @@ -113,7 +113,9 @@ class _BodyState extends State<_Body> { .fixedMedium, ), Code(code: ChipSuggestionCodeGenerator.updateCode(context)), - ReferenceDesignVersionComponent(version: OudsComponentVersion.chip), + ReferenceDesignVersionComponent( + version: OudsComponentVersion.suggestionChip, + ), ], ), ); diff --git a/app/lib/ui/components/components.dart b/app/lib/ui/components/components.dart index 9e98f0036..cb6229da8 100644 --- a/app/lib/ui/components/components.dart +++ b/app/lib/ui/components/components.dart @@ -157,6 +157,7 @@ List components(BuildContext context) { onDestinationSelected: (index) {}, translucent: true, destinations: NavigationBarCustomizationUtils.buildItems( + context: context, themeController: themeController, ), ), diff --git a/app/lib/ui/components/navigation/navigation_bar_customization_utils.dart b/app/lib/ui/components/navigation/navigation_bar_customization_utils.dart index 219209401..dc60273fe 100644 --- a/app/lib/ui/components/navigation/navigation_bar_customization_utils.dart +++ b/app/lib/ui/components/navigation/navigation_bar_customization_utils.dart @@ -10,7 +10,9 @@ * // Software description: Flutter library of reusable graphical components * // */ +import 'package:flutter/widgets.dart'; import 'package:ouds_core/components/navigation/ouds_navigation_bar_item.dart'; +import 'package:ouds_flutter_demo/l10n/gen/ouds_flutter_app_localizations.dart'; import 'package:ouds_flutter_demo/ui/components/navigation/navigation_bar_customization.dart'; import 'package:ouds_flutter_demo/ui/components/navigation/navigation_bar_enum.dart'; import 'package:ouds_flutter_demo/ui/theme/theme_controller.dart'; @@ -23,39 +25,54 @@ class NavigationBarCustomizationUtils { /// Returns an optional navigation bar item badge based on the selected badge type /// (count badge, standard badge, or none). - static OudsNavigationBarItemBadge? getItemBadge(NavigationBarCustomizationState customizationState) { + static OudsNavigationBarItemBadge? getItemBadge( + NavigationBarCustomizationState customizationState, + BuildContext context, + ) { + final l10n = AppLocalizations.of(context)!; + return customizationState.selectedItemBadge == ItemBadge.count - ? OudsNavigationBarItemBadge(contentDescription: "$itemBadgeCount notification unread", count: itemBadgeCount) + ? OudsNavigationBarItemBadge( + contentDescription: l10n + .app_components_navigationBar_badge_count_a11y(itemBadgeCount), + count: itemBadgeCount, + ) : customizationState.selectedItemBadge == ItemBadge.dot - ? OudsNavigationBarItemBadge(contentDescription: "notification unread") - : null; + ? OudsNavigationBarItemBadge( + contentDescription: + l10n.app_components_navigationBar_badge_dot_a11y, + ) + : null; } /// Generates a list of consecutive item count values from [minItemCount] to [maxItemCount] (inclusive). - static final itemCountOptions = List.generate(maxItemCount - minItemCount + 1, (index) => minItemCount + index); + static final itemCountOptions = List.generate( + maxItemCount - minItemCount + 1, + (index) => minItemCount + index, + ); /// Builds a shared list of navigation bar items based on the current /// customization state and theme. static List buildItems({ required ThemeController themeController, + required BuildContext context, NavigationBarCustomizationState? customizationState, int itemCount = minItemCount, }) { final safeItemCount = itemCount.clamp(minItemCount, maxItemCount); - return List.generate( - safeItemCount, - (index) { - final isLastItem = index == safeItemCount - 1; + return List.generate(safeItemCount, (index) { + final isLastItem = index == safeItemCount - 1; - return OudsNavigationBarItem( - icon: AppAssets.icons.functionalSocialAndEngagementHeartEmpty( - themeController, - ), - label: 'Label', //'item ${index + 1}', - badge: (isLastItem && customizationState != null) ? getItemBadge(customizationState) : null, - ); - }, - ); + return OudsNavigationBarItem( + icon: AppAssets.icons.functionalSocialAndEngagementHeartEmpty( + themeController, + ), + label: 'Label', //'item ${index + 1}', + badge: (isLastItem && customizationState != null) + ? getItemBadge(customizationState, context) + : null, + ); + }); } } diff --git a/app/lib/ui/components/navigation/navigation_bar_demo_screen.dart b/app/lib/ui/components/navigation/navigation_bar_demo_screen.dart index fc365b2af..9b03c3965 100644 --- a/app/lib/ui/components/navigation/navigation_bar_demo_screen.dart +++ b/app/lib/ui/components/navigation/navigation_bar_demo_screen.dart @@ -36,10 +36,15 @@ import 'package:provider/provider.dart'; class NavigationBarDemoScreen extends StatefulWidget { final bool indeterminate; final String? previousPageTitle; - const NavigationBarDemoScreen({super.key, this.indeterminate = false,this.previousPageTitle}); // Default value set to false + const NavigationBarDemoScreen({ + super.key, + this.indeterminate = false, + this.previousPageTitle, + }); // Default value set to false @override - State createState() => _NavigationBarDemoScreenState(); + State createState() => + _NavigationBarDemoScreenState(); } class _NavigationBarDemoScreenState extends State { @@ -56,7 +61,11 @@ class _NavigationBarDemoScreenState extends State { Widget build(BuildContext context) { return NavigationBarCustomization( child: Padding( - padding: EdgeInsets.only(bottom: defaultTargetPlatform == TargetPlatform.android ? MediaQuery.of(context).viewPadding.bottom : OudsTheme.of(context).spaceScheme(context).paddingBlockNone), + padding: EdgeInsets.only( + bottom: defaultTargetPlatform == TargetPlatform.android + ? MediaQuery.of(context).viewPadding.bottom + : OudsTheme.of(context).spaceScheme(context).paddingBlockNone, + ), child: Scaffold( bottomSheet: OudsSheetsBottom( onExpansionChanged: _onExpansionChanged, @@ -65,9 +74,9 @@ class _NavigationBarDemoScreenState extends State { ), key: _scaffoldKey, appBar: MainAppBar( - showBackButton: true, - title: context.l10n.app_components_navigationBar_label, - previousPageTitle: widget.previousPageTitle, + showBackButton: true, + title: context.l10n.app_components_navigationBar_label, + previousPageTitle: widget.previousPageTitle, ), body: SafeArea( child: ExcludeSemantics( @@ -89,21 +98,24 @@ class _Body extends StatefulWidget { class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { - ThemeController? themeController = Provider.of(context, listen: false); + ThemeController? themeController = Provider.of( + context, + listen: false, + ); return DetailScreenDescription( description: context.l10n.app_components_navigationBar_description_text, widget: Column( children: [ _NavigationBarDemo(), - SizedBox(height: themeController.currentTheme.spaceScheme(context).fixedMedium), - Code( - code: NavigationBarCodeGenerator.updateCode( - context, - ), + SizedBox( + height: themeController.currentTheme + .spaceScheme(context) + .fixedMedium, ), + Code(code: NavigationBarCodeGenerator.updateCode(context)), ReferenceDesignVersionComponent( - version: OudsComponentVersion.bar, - ) + version: OudsComponentVersion.navigationBar, + ), ], ), ); @@ -135,6 +147,7 @@ class _NavigationBarDemoState extends State<_NavigationBarDemo> { customizationState = NavigationBarCustomization.of(context); themeController = Provider.of(context, listen: true); final items = NavigationBarCustomizationUtils.buildItems( + context: context, themeController: themeController!, customizationState: customizationState!, itemCount: customizationState!.itemSelected, @@ -176,7 +189,8 @@ class _CustomizationContentState extends State<_CustomizationContent> { @override Widget build(BuildContext context) { - final NavigationBarCustomizationState? customizationState = NavigationBarCustomization.of(context); + final NavigationBarCustomizationState? customizationState = + NavigationBarCustomization.of(context); var badgeType = customizationState!.itemBadgeState.list; return CustomizableSection( children: [ diff --git a/app/lib/ui/components/pin_code_input/pin_code_input_demo_screen.dart b/app/lib/ui/components/pin_code_input/pin_code_input_demo_screen.dart index ff7af4398..08a69c32c 100644 --- a/app/lib/ui/components/pin_code_input/pin_code_input_demo_screen.dart +++ b/app/lib/ui/components/pin_code_input/pin_code_input_demo_screen.dart @@ -36,7 +36,7 @@ import 'package:provider/provider.dart'; class PinCodeInputDemoScreen extends StatefulWidget { final String? previousPageTitle; - const PinCodeInputDemoScreen({super.key,this.previousPageTitle}); + const PinCodeInputDemoScreen({super.key, this.previousPageTitle}); @override State createState() => _PinCodeInputDemoScreenState(); @@ -58,13 +58,17 @@ class _PinCodeInputDemoScreenState extends State { child: PinCodeInputCustomization( key: _scaffoldKey, child: Padding( - padding: EdgeInsets.only(bottom: defaultTargetPlatform == TargetPlatform.android ? MediaQuery.of(context).viewPadding.bottom : OudsTheme.of(context).spaceScheme(context).paddingBlockNone), + padding: EdgeInsets.only( + bottom: defaultTargetPlatform == TargetPlatform.android + ? MediaQuery.of(context).viewPadding.bottom + : OudsTheme.of(context).spaceScheme(context).paddingBlockNone, + ), child: Scaffold( extendBodyBehindAppBar: true, appBar: MainAppBar( - showBackButton: true, - title: context.l10n.app_components_pinCodeInput_label, - previousPageTitle: widget.previousPageTitle, + showBackButton: true, + title: context.l10n.app_components_pinCodeInput_label, + previousPageTitle: widget.previousPageTitle, ), bottomSheet: OudsSheetsBottom( onExpansionChanged: _onExpansionChanged, @@ -92,17 +96,24 @@ class _Body extends StatefulWidget { class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { - final themeController = Provider.of(context, listen: false); + final themeController = Provider.of( + context, + listen: false, + ); return DetailScreenDescription( description: context.l10n.app_components_pinCodeInput_description_text, widget: Column( children: [ const _PinCodeInputDemo(), - SizedBox(height: themeController.currentTheme.spaceScheme(context).fixedMedium), - Code( - code: PinCodeInputCodeGenerator.updateCode(context), + SizedBox( + height: themeController.currentTheme + .spaceScheme(context) + .fixedMedium, + ), + Code(code: PinCodeInputCodeGenerator.updateCode(context)), + ReferenceDesignVersionComponent( + version: OudsComponentVersion.pinCodeInput, ), - ReferenceDesignVersionComponent(version: OudsComponentVersion.pinCodeInput), ], ), ); @@ -118,7 +129,18 @@ class _PinCodeInputDemo extends StatefulWidget { class _PinCodeInputDemoState extends State<_PinCodeInputDemo> { List controllers = []; - late int pinCodeLength; + OudsPinCodeInputLength? _currentLength; + + /// Initialises (or reinitialises) the controller list whenever the PIN + /// length changes. Previous controllers are disposed before recreation. + void _syncControllers(OudsPinCodeInputLength length) { + if (_currentLength == length) return; + for (final c in controllers) { + c.dispose(); + } + _currentLength = length; + controllers = List.generate(length.digits, (_) => TextEditingController()); + } @override void dispose() { @@ -131,31 +153,57 @@ class _PinCodeInputDemoState extends State<_PinCodeInputDemo> { @override Widget build(BuildContext context) { final customizationState = PinCodeInputCustomization.of(context)!; - for (int i = 0; i < PinCodeInputCustomizationUtils.getLength(customizationState.selectedPinCodeLength as Object).digits; i++) { - controllers.add(TextEditingController()); - } + final getLength = PinCodeInputCustomizationUtils.getLength( + customizationState.selectedPinCodeLength as Object, + ); - final getLength = PinCodeInputCustomizationUtils.getLength(customizationState.selectedPinCodeLength as Object); + _syncControllers(getLength); return LightDarkBox( hasConstrainedMaxWidthOption: true, child: OudsPinCodeInput( controllers: controllers, - helperText: customizationState.hasHelperText && customizationState.pinCodeHelperText.isNotEmpty ? PinCodeInputCustomizationUtils.getPinCodeHelperText(customizationState) : null, + helperText: + customizationState.hasHelperText && + customizationState.pinCodeHelperText.isNotEmpty + ? PinCodeInputCustomizationUtils.getPinCodeHelperText( + customizationState, + ) + : null, length: getLength, - errorText: customizationState.hasError ? PinCodeInputCustomizationUtils.getPinCodeErrorText(customizationState) : null, + errorText: customizationState.hasError + ? PinCodeInputCustomizationUtils.getPinCodeErrorText( + customizationState, + ) + : null, digitInputDecoration: OudsDigitInputDecoration( - hintText: PinCodeInputCustomizationUtils.getPinCodePlaceholderText(customizationState), + hintText: PinCodeInputCustomizationUtils.getPinCodePlaceholderText( + customizationState, + ), hiddenPassword: customizationState.hasHiddenPassword, isOutlined: customizationState.hasOutlined, - constrainedMaxWidth: customizationState.hasConstrainedMaxWidth ? true : false, - keyboardType: PinCodeInputCustomizationUtils.getKeyboardType(customizationState.selectedKeyboardType), + constrainedMaxWidth: customizationState.hasConstrainedMaxWidth + ? true + : false, + keyboardType: PinCodeInputCustomizationUtils.getKeyboardType( + customizationState.selectedKeyboardType, + ), ), onEditingComplete: (value) async { - final errorLabel = context.l10n.app_components_pinCodeInput_error_label; - final verificationErrorLabel = context.l10n.app_components_pinCodeInput_verification_error_label; + final errorLabel = + context.l10n.app_components_pinCodeInput_error_label; + final verificationErrorLabel = + context.l10n.app_components_pinCodeInput_verification_error_label; await _handleCompleted( - context, value, PinCodeInputCustomizationUtils.getLength(customizationState.selectedPinCodeLength as Object).digits, customizationState, errorLabel, verificationErrorLabel); + context, + value, + PinCodeInputCustomizationUtils.getLength( + customizationState.selectedPinCodeLength as Object, + ).digits, + customizationState, + errorLabel, + verificationErrorLabel, + ); }, onChanged: (value) { if (value.isEmpty || value.length < getLength.digits) { @@ -169,10 +217,19 @@ class _PinCodeInputDemoState extends State<_PinCodeInputDemo> { Future _fakeVerify(String code) async { await Future.delayed(Duration(milliseconds: 300)); - return code == "1234" || code == "123456" || code == "12345678"; // demo logic + return code == "1234" || + code == "123456" || + code == "12345678"; // demo logic } - Future _handleCompleted(BuildContext context, String value, int digitLength, PinCodeInputCustomizationState customizationState, String errorLabel, String verificationErrorLabel) async { + Future _handleCompleted( + BuildContext context, + String value, + int digitLength, + PinCodeInputCustomizationState customizationState, + String errorLabel, + String verificationErrorLabel, + ) async { final isValid = await _fakeVerify(value); String errorText = ""; @@ -231,11 +288,15 @@ class _CustomizationContentState extends State<_CustomizationContent> { CustomizableSwitch( title: context.l10n.app_components_common_error_label, value: customizationState.hasError, - onChanged: customizationState.hasHelperText && !customizationState.hasError + onChanged: + customizationState.hasHelperText && !customizationState.hasError ? null : (value) { customizationState.hasError = value; - value ? customizationState.pinCodeErrorText = context.l10n.app_components_pinCodeInput_error_label : customizationState.pinCodeErrorText = ""; + value + ? customizationState.pinCodeErrorText = + context.l10n.app_components_pinCodeInput_error_label + : customizationState.pinCodeErrorText = ""; }, ), CustomizableSwitch( @@ -248,14 +309,15 @@ class _CustomizationContentState extends State<_CustomizationContent> { }, ), Visibility( - visible: customizationState.hasHelperText, - child: CustomizableTextField( - fieldEnable: !customizationState.hasError, - title: context.l10n.app_components_common_helperText_label, - text: customizationState.pinCodeHelperText, - focusNode: helperFocus, - fieldType: FieldType.helper, - )), + visible: customizationState.hasHelperText, + child: CustomizableTextField( + fieldEnable: !customizationState.hasError, + title: context.l10n.app_components_common_helperText_label, + text: customizationState.pinCodeHelperText, + focusNode: helperFocus, + fieldType: FieldType.helper, + ), + ), CustomizableSwitch( title: context.l10n.app_components_pinCodeInput_hidden_password_label, value: customizationState.hasHiddenPassword, diff --git a/app/lib/ui/components/tag/input_tag_demo_screen.dart b/app/lib/ui/components/tag/input_tag_demo_screen.dart index b5ad60db6..e36b70f1b 100644 --- a/app/lib/ui/components/tag/input_tag_demo_screen.dart +++ b/app/lib/ui/components/tag/input_tag_demo_screen.dart @@ -33,7 +33,7 @@ import 'package:provider/provider.dart'; class InputTagDemoScreen extends StatefulWidget { final String? previousPageTitle; - const InputTagDemoScreen({super.key,this.previousPageTitle}); + const InputTagDemoScreen({super.key, this.previousPageTitle}); @override State createState() => _InputTagDemoScreenState(); @@ -53,7 +53,11 @@ class _InputTagDemoScreenState extends State { Widget build(BuildContext context) { return TagCustomization( child: Padding( - padding: EdgeInsets.only(bottom: defaultTargetPlatform == TargetPlatform.android ? MediaQuery.of(context).viewPadding.bottom : OudsTheme.of(context).spaceScheme(context).paddingBlockNone), + padding: EdgeInsets.only( + bottom: defaultTargetPlatform == TargetPlatform.android + ? MediaQuery.of(context).viewPadding.bottom + : OudsTheme.of(context).spaceScheme(context).paddingBlockNone, + ), child: Scaffold( bottomSheet: OudsSheetsBottom( onExpansionChanged: _onExpansionChanged, @@ -63,11 +67,14 @@ class _InputTagDemoScreenState extends State { key: _scaffoldKey, extendBodyBehindAppBar: true, appBar: MainAppBar( - showBackButton: true, - title: context.l10n.app_components_tag_inputTag_label, - previousPageTitle: widget.previousPageTitle, + showBackButton: true, + title: context.l10n.app_components_tag_inputTag_label, + previousPageTitle: widget.previousPageTitle, + ), + body: ExcludeSemantics( + excluding: !_isBottomSheetExpanded, + child: _Body(), ), - body: ExcludeSemantics(excluding: !_isBottomSheetExpanded, child: _Body()), ), ), ); @@ -85,19 +92,24 @@ class _Body extends StatefulWidget { class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { - ThemeController? themeController = Provider.of(context, listen: false); + ThemeController? themeController = Provider.of( + context, + listen: false, + ); return DetailScreenDescription( description: context.l10n.app_components_inputTag_description_text, widget: Column( children: [ _InputTagDemo(), - SizedBox(height: themeController.currentTheme.spaceScheme(context).fixedMedium), - Code( - code: InputTagCodeGenerator.updateCode(context), + SizedBox( + height: themeController.currentTheme + .spaceScheme(context) + .fixedMedium, ), + Code(code: InputTagCodeGenerator.updateCode(context)), ReferenceDesignVersionComponent( - version: OudsComponentVersion.tag, - ) + version: OudsComponentVersion.inputTag, + ), ], ), ); @@ -146,7 +158,9 @@ class _CustomizationContentState extends State<_CustomizationContent> { @override Widget build(BuildContext context) { - final TagCustomizationState? customizationState = TagCustomization.of(context); + final TagCustomizationState? customizationState = TagCustomization.of( + context, + ); final labelFocus = FocusNode(); return CustomizableSection( @@ -163,8 +177,8 @@ class _CustomizationContentState extends State<_CustomizationContent> { text: customizationState.labelText, focusNode: labelFocus, fieldType: FieldType.label, - ) + ), ], ); } -} \ No newline at end of file +} diff --git a/app/lib/ui/components/top_bar/toolbar_top_customization_utils.dart b/app/lib/ui/components/top_bar/toolbar_top_customization_utils.dart index 2d0ddf4ca..59f829655 100644 --- a/app/lib/ui/components/top_bar/toolbar_top_customization_utils.dart +++ b/app/lib/ui/components/top_bar/toolbar_top_customization_utils.dart @@ -1,4 +1,3 @@ - // // Software Name: OUDS Flutter // SPDX-FileCopyrightText: Copyright (c) Orange SA @@ -15,11 +14,11 @@ import 'package:flutter/cupertino.dart'; import 'package:ouds_core/components/top_bar/ouds_top_bar_action_config.dart'; import 'package:ouds_flutter_demo/l10n/app_localizations.dart'; import 'package:ouds_flutter_demo/ui/components/top_bar/top_bar_customization.dart'; +import 'package:ouds_flutter_demo/ui/components/top_bar/top_bar_customization_utils.dart'; import 'package:ouds_flutter_demo/ui/components/top_bar/top_bar_enum.dart'; import 'package:ouds_flutter_demo/ui/theme/theme_controller.dart'; import 'package:ouds_flutter_demo/ui/utilities/app_assets.dart'; - /// Utility class to map tag customization options to corresponding OudsToolbarTop attributes. /// /// This class provides static methods to convert customization enums into the appropriate @@ -28,9 +27,9 @@ import 'package:ouds_flutter_demo/ui/utilities/app_assets.dart'; /// user-selected options into code that is used for TopAppBar customization and rendering. class ToolbarTopCustomizationUtils { - /// Minimum number of actions allowed for the Cupertino style of OudsTopBar component. static const int minActionCount = 1; + /// Maximum number of actions allowed for the Cupertino style of OudsTopBar component. static const int maxActionCount = 3; @@ -38,38 +37,41 @@ class ToolbarTopCustomizationUtils { /// to [maxActionCount] (inclusive). static final cupertinoActionCountOptions = List.generate( maxActionCount - (minActionCount - 1), - (index) => minActionCount + index, + (index) => minActionCount + index, ); - static List getLimitedActionsCount(BuildContext context){ + static List getLimitedActionsCount(BuildContext context) { int maxActionsIndex = maxActionCount + 1; return cupertinoActionCountOptions.take(maxActionsIndex).toList(); } static List? getDisabledLeadingActionCountOptions( - TopBarCustomizationState? customizationState) { + TopBarCustomizationState? customizationState, + ) { //disable all options if selected type is none if (customizationState?.selectedLeadingActionType == ToolbarTopActionTypeEnum.none) { - return List.generate(maxActionCount+1, (i) => i); + return List.generate(maxActionCount + 1, (i) => i); } //if selected type is different to back no option to disable if (customizationState?.selectedLeadingActionType != - ToolbarTopActionTypeEnum.back ) { + ToolbarTopActionTypeEnum.back) { return null; } //disable all options > 1 if selected type is back - return List.generate(maxActionCount+1, (i) => i) - .where((value) => value > 1) - .toList(); + return List.generate( + maxActionCount + 1, + (i) => i, + ).where((value) => value > 1).toList(); } static List? getDisabledTrailingActionCountOptions( - TopBarCustomizationState? customizationState) { + TopBarCustomizationState? customizationState, + ) { //disable all options if selected type is none if (customizationState?.selectedTrailingActionType == ToolbarTopActionTypeEnum.none) { - return List.generate(maxActionCount+1, (i) => i); + return List.generate(maxActionCount + 1, (i) => i); } return null; } @@ -86,26 +88,39 @@ class ToolbarTopCustomizationUtils { ThemeController? themeController, required TopBarCustomizationState customizationState, required bool isLeadingActions, - }){ + }) { final safeActionCount = isLeadingActions - ? customizationState.selectedLeadingActionCount.clamp(minActionCount, maxActionCount) - : customizationState.selectedTrailingActionCount.clamp(minActionCount, maxActionCount); - - return List.generate( - safeActionCount, - (index) { - return _getCupertinoActionConfig(context, customizationState,themeController,isLeadingActions); - }, - ); + ? customizationState.selectedLeadingActionCount.clamp( + minActionCount, + maxActionCount, + ) + : customizationState.selectedTrailingActionCount.clamp( + minActionCount, + maxActionCount, + ); + + return List.generate(safeActionCount, (index) { + final isLastItem = index == safeActionCount - 1; + + return _getCupertinoActionConfig( + context, + customizationState, + themeController, + isLeadingActions, + isLastItem, + safeActionCount, + ); + }); } static OudsTopBarActionConfig _getCupertinoActionConfig( - BuildContext context, - TopBarCustomizationState? customizationState, - ThemeController? themeController, - bool isLeadingAction - ){ - + BuildContext context, + TopBarCustomizationState? customizationState, + ThemeController? themeController, + bool isLeadingAction, + bool isLastItem, + int actionCount, + ) { // Handle null state gracefully to avoid runtime errors. if (customizationState == null || themeController == null) { return OudsTopBarActionConfig.none(); @@ -120,19 +135,25 @@ class ToolbarTopCustomizationUtils { switch (actionType) { case ToolbarTopActionTypeEnum.text: return OudsTopBarActionConfig.text( - actionLabel: context.l10n.app_components_common_label_label, // Provide only the relevant parameter. + actionLabel: context + .l10n + .app_components_common_label_label, // Provide only the relevant parameter. onActionPressed: customizationState.hasEnabled == true ? () {} : null, ); case ToolbarTopActionTypeEnum.icon: + final isBadgeEligible = actionCount == 1 || isLastItem; return OudsTopBarActionConfig.icon( // Provide a relevant icon. icon: AppAssets.icons.assistanceTipsAndTricks(themeController), contentDescription: context.l10n.app_components_common_action_a11y, onActionPressed: customizationState.hasEnabled == true ? () {} : null, + badge: !isLeadingAction && isBadgeEligible + ? TopBarCustomizationUtils.getActionBadge(customizationState) + : null, ); case ToolbarTopActionTypeEnum.back: - // The .back() factory handles its own icon and behavior. + // The .back() factory handles its own icon and behavior. return OudsTopBarActionConfig.back( previousPageTitle: customizationState.previousPageTitleText, onActionPressed: () { @@ -146,4 +167,4 @@ class ToolbarTopCustomizationUtils { return OudsTopBarActionConfig.none(); } } -} \ No newline at end of file +} diff --git a/app/lib/ui/components/top_bar/top_appbar_customization_utils.dart b/app/lib/ui/components/top_bar/top_appbar_customization_utils.dart index ac7aa9acb..ac2de0ccf 100644 --- a/app/lib/ui/components/top_bar/top_appbar_customization_utils.dart +++ b/app/lib/ui/components/top_bar/top_appbar_customization_utils.dart @@ -1,4 +1,3 @@ - // // Software Name: OUDS Flutter // SPDX-FileCopyrightText: Copyright (c) Orange SA @@ -12,11 +11,12 @@ // import 'package:flutter/material.dart'; -import 'package:ouds_core/components/top_bar/ouds_top_bar.dart'; import 'package:ouds_core/components/top_bar/ouds_top_appbar.dart'; +import 'package:ouds_core/components/top_bar/ouds_top_bar.dart'; import 'package:ouds_core/components/top_bar/ouds_top_bar_action_config.dart'; import 'package:ouds_flutter_demo/l10n/app_localizations.dart'; import 'package:ouds_flutter_demo/ui/components/top_bar/top_bar_customization.dart'; +import 'package:ouds_flutter_demo/ui/components/top_bar/top_bar_customization_utils.dart'; import 'package:ouds_flutter_demo/ui/components/top_bar/top_bar_enum.dart'; import 'package:ouds_flutter_demo/ui/theme/theme_controller.dart'; import 'package:ouds_flutter_demo/ui/utilities/app_assets.dart'; @@ -29,11 +29,12 @@ import 'package:ouds_flutter_demo/ui/utilities/app_assets.dart'; /// user-selected options into code that is used for top bar customization and rendering. class TopAppBarCustomizationUtils { - /// Minimum number of actions allowed for the Material style TopBar component. static const int minActionCount = 0; + /// Maximum number of actions allowed for the Material style TopBar component. static const int maxActionCount = 3; + /// Maximum title line count for Material style TopBar in medium and large sizes. static const int maxLinesCount = 4; @@ -43,7 +44,6 @@ class TopAppBarCustomizationUtils { /// is displayed with a single line of content. static const int minHeightMediumSize = 112; - /// The default height when the medium variant is displayed with two lines of content. static const int minHeightMediumSizeTwoLines = 128; @@ -56,23 +56,21 @@ class TopAppBarCustomizationUtils { /// to [maxActionCount] (inclusive). static final actionCountOptions = List.generate( maxActionCount - (minActionCount - 1), - (index) => minActionCount + index, + (index) => minActionCount + index, ); /// Generates a list of consecutive item count values from one to [maxLinesCount] . static final maxLinesOptions = List.generate( maxLinesCount, - (index) => index + 1, + (index) => index + 1, ); - - /// Determines the icon to display based on the selected layout. static OudsTopBarActionConfig getNavigationIcon( - BuildContext context, - ThemeController themeController, - NavigationIconTypeEnum icon) { - + BuildContext context, + ThemeController themeController, + NavigationIconTypeEnum icon, + ) { // A switch statement directly maps the enum to the correct factory constructor. switch (icon) { case NavigationIconTypeEnum.back: @@ -101,7 +99,7 @@ class TopAppBarCustomizationUtils { }, ); case NavigationIconTypeEnum.custom: - // The .custom() factory is used for developer-defined icons. + // The .custom() factory is used for developer-defined icons. return OudsTopBarActionConfig.custom( // The asset path is now passed directly to the factory. icon: AppAssets.icons.assistanceTipsAndTricks(themeController), @@ -109,7 +107,7 @@ class TopAppBarCustomizationUtils { onActionPressed: () {}, ); case NavigationIconTypeEnum.none: - // The .none() factory creates a configuration for no action. + // The .none() factory creates a configuration for no action. return OudsTopBarActionConfig.none(); } } @@ -119,19 +117,22 @@ class TopAppBarCustomizationUtils { required TopBarCustomizationState customizationState, required ThemeController themeController, int actionCount = minActionCount, - }){ - final safeActionCount = actionCount.clamp(minActionCount,maxActionCount); + }) { + final safeActionCount = actionCount.clamp(minActionCount, maxActionCount); List actions = []; - actions = List.generate( - safeActionCount, - (index) { - final isLastItem = index == safeActionCount - 1; - return _getActionConfig(context,themeController, customizationState, isLastItem); - }, - ); + actions = List.generate(safeActionCount, (index) { + final isLastItem = index == safeActionCount - 1; + return _getActionConfig( + context, + themeController, + customizationState, + isLastItem, + ); + }); actions.add(_getAvatarActionConfig(context, customizationState)); return actions; } + /// Maps the action avatar type enum to `OudsTopAppBarActionAvatar`. static OudsTopAppBarActionAvatar getActionAvatar(Object actionAvatar) { return actionAvatar == ActionAvatarEnum.monogram @@ -140,27 +141,20 @@ class TopAppBarCustomizationUtils { } /// Retrieves the char to display based on the current customization state. - static String? getMonogramText( - TopBarCustomizationState customizationState) { + static String? getMonogramText(TopBarCustomizationState customizationState) { return customizationState.selectedActionAvatar == ActionAvatarEnum.monogram ? customizationState.actionAvatarMonogramText : "A"; } - /// Retrieves the count to display based on the current customization state. - static OudsTopAppBarActionBadge? getActionBadge(TopBarCustomizationState customizationState) { - return customizationState.selectedIconBadge == ActionIconBadgeEnum.count - ? OudsTopAppBarActionBadge(count: "1", contentDescription: 'one unread notification') - : customizationState.selectedIconBadge == ActionIconBadgeEnum.dot - ? OudsTopAppBarActionBadge(contentDescription: 'Notification') - : null; - } - /// Calculates the expanded header height based on the customization state. - static double getExpandedHeaderValue(TopBarCustomizationState customizationState) { + static double getExpandedHeaderValue( + TopBarCustomizationState customizationState, + ) { // Determine the default header height based on the selected size - double headerValue = customizationState.selectedSize == TopBarSizeEnum.medium - ? OudsTopAppBar.getPreferredSize(size:OudsTopBarSize.medium).height + double headerValue = + customizationState.selectedSize == TopBarSizeEnum.medium + ? OudsTopAppBar.getPreferredSize(size: OudsTopBarSize.medium).height : customizationState.selectedSize == TopBarSizeEnum.large ? OudsTopAppBar.getPreferredSize(size: OudsTopBarSize.large).height : OudsTopAppBar.getPreferredSize().height; @@ -168,23 +162,26 @@ class TopAppBarCustomizationUtils { // Initialize cleanedInput with a default value String cleanedInput = minHeightMediumSize.toString(); // If the expandedHeightText is not empty, clean it by removing non-numeric characters - if(customizationState.expandedHeightText.isNotEmpty){ - cleanedInput = customizationState.expandedHeightText.replaceAll(RegExp(r'[^0-9.]'), ''); + if (customizationState.expandedHeightText.isNotEmpty) { + cleanedInput = customizationState.expandedHeightText.replaceAll( + RegExp(r'[^0-9.]'), + '', + ); } // If the selected size is small, return the default header height - if(customizationState.selectedSize == TopBarSizeEnum.small){ + if (customizationState.selectedSize == TopBarSizeEnum.small) { return headerValue; } // If size is medium and expandedHeightText is provided and greater than default, return it - else if(customizationState.selectedSize == TopBarSizeEnum.medium - && customizationState.expandedHeightText.isNotEmpty - && double.parse(cleanedInput) > headerValue){ + else if (customizationState.selectedSize == TopBarSizeEnum.medium && + customizationState.expandedHeightText.isNotEmpty && + double.parse(cleanedInput) > headerValue) { return double.parse(cleanedInput); } // If size is large and expandedHeightText is provided and greater than default, return it - else if(customizationState.selectedSize == TopBarSizeEnum.large - && customizationState.expandedHeightText.isNotEmpty - && double.parse(cleanedInput) > headerValue){ + else if (customizationState.selectedSize == TopBarSizeEnum.large && + customizationState.expandedHeightText.isNotEmpty && + double.parse(cleanedInput) > headerValue) { return double.parse(cleanedInput); } // Otherwise, return the default header height @@ -194,18 +191,19 @@ class TopAppBarCustomizationUtils { } /// Retrieves the title line count of TopAppBar. - static int getTitleLineCountValue(TopBarCustomizationState customizationState) { + static int getTitleLineCountValue( + TopBarCustomizationState customizationState, + ) { return customizationState.maxLinesSelected; } /// Retrieves the configuration for a simple icon action . static OudsTopBarActionConfig _getActionConfig( - BuildContext context, - ThemeController themeController, - TopBarCustomizationState? customizationState, - bool isLastItem - ){ - + BuildContext context, + ThemeController themeController, + TopBarCustomizationState? customizationState, + bool isLastItem, + ) { // Use the .icon() factory for clarity and type-safety. return OudsTopBarActionConfig.icon( // The factory requires an icon. Provide a default for the demo. @@ -214,7 +212,7 @@ class TopAppBarCustomizationUtils { onActionPressed: () {}, // The badge logic remains the same. badge: (customizationState?.actionSelected == 1 || isLastItem) - ? TopAppBarCustomizationUtils.getActionBadge(customizationState!) + ? TopBarCustomizationUtils.getActionBadge(customizationState!) : null, ); } @@ -222,18 +220,21 @@ class TopAppBarCustomizationUtils { /// Retrieves an avatar action configuration for the TopAppBar. /// The content of the avatar can either be an image or a single letter monogram. static OudsTopBarActionConfig _getAvatarActionConfig( - BuildContext context, - TopBarCustomizationState customizationState){ - + BuildContext context, + TopBarCustomizationState customizationState, + ) { return OudsTopBarActionConfig.avatar( - avatarConfig: OudsTopAppBarAvatarConfig( - image: customizationState.selectedActionAvatar == ActionAvatarEnum.image - ? AppAssets.images.ilTopAppBarAvatar : null, - monogram : customizationState.selectedActionAvatar == ActionAvatarEnum.monogram - ? customizationState.actionAvatarMonogramText : null, - ), - contentDescription: context.l10n.app_components_common_action_a11y, - onActionPressed: () {} + avatarConfig: OudsTopAppBarAvatarConfig( + image: customizationState.selectedActionAvatar == ActionAvatarEnum.image + ? AppAssets.images.ilTopAppBarAvatar + : null, + monogram: + customizationState.selectedActionAvatar == ActionAvatarEnum.monogram + ? customizationState.actionAvatarMonogramText + : null, + ), + contentDescription: context.l10n.app_components_common_action_a11y, + onActionPressed: () {}, ); } @@ -245,19 +246,16 @@ class TopAppBarCustomizationUtils { /// For any other size, it returns an empty string as this value is not needed /// and the corresponding text field in the customization panel will be disabled. static String getExpandedHeightHelperText( - BuildContext context, - TopBarCustomizationState state){ - - if(state.selectedSize == TopBarSizeEnum.medium){ + BuildContext context, + TopBarCustomizationState state, + ) { + if (state.selectedSize == TopBarSizeEnum.medium) { return context.l10n.app_components_topAppBar_mediumHelperTextHeight_label; - } - else if(state.selectedSize == TopBarSizeEnum.large){ + } else if (state.selectedSize == TopBarSizeEnum.large) { return context.l10n.app_components_topAppBar_largeHelperTextHeight_label; - } - else{ + } else { return ""; } - } /// Validates the expanded height input based on the selected [TopBarSizeEnum]. @@ -268,29 +266,28 @@ class TopAppBarCustomizationUtils { /// - At least [minHeightLargeSize] for [TopBarSizeEnum.large] /// Returns null if the input is valid or empty. static String? getExpandedHeightErrorText( - BuildContext context, - TopBarCustomizationState state, - ){ - - if(state.expandedHeightText.isNotEmpty){ - int height = int.parse(state.expandedHeightText.replaceAll(RegExp(r'[^0-9]'), '')); - - if(state.selectedSize == TopBarSizeEnum.medium - && (height < minHeightMediumSize)){ + BuildContext context, + TopBarCustomizationState state, + ) { + if (state.expandedHeightText.isNotEmpty) { + int height = int.parse( + state.expandedHeightText.replaceAll(RegExp(r'[^0-9]'), ''), + ); + + if (state.selectedSize == TopBarSizeEnum.medium && + (height < minHeightMediumSize)) { return context.l10n.app_components_topAppBar_mediumErrorMessage_label; - } - - else if( state.selectedSize == TopBarSizeEnum.large && (height < minHeightLargeSize)){ + } else if (state.selectedSize == TopBarSizeEnum.large && + (height < minHeightLargeSize)) { return context.l10n.app_components_topAppBar_largeErrorMessage_label; } } return null; - } /// Returns the list of max lines options to disable based on the selected TopAppBar size - static List? getMaxLiensDisabledOptions(TopBarCustomizationState state){ + static List? getMaxLiensDisabledOptions(TopBarCustomizationState state) { final list = TopAppBarCustomizationUtils.maxLinesOptions.toList(); final lastTwoValues = list.sublist(list.length - 2); @@ -301,7 +298,6 @@ class TopAppBarCustomizationUtils { : null; } - /// Returns the expanded height of the Top Bar as a string /// based on the current customization state. /// @@ -314,23 +310,23 @@ class TopAppBarCustomizationUtils { /// - Medium + 2 lines → [minHeightMediumSizeTwoLines] /// - Large → [minHeightLargeSize] /// - Otherwise → empty string - static String setExpandedHeight(TopBarCustomizationState state){ - return state.selectedSize == TopBarSizeEnum.medium - && state.maxLinesSelected == 2 + static String setExpandedHeight(TopBarCustomizationState state) { + return state.selectedSize == TopBarSizeEnum.medium && + state.maxLinesSelected == 2 ? minHeightMediumSizeTwoLines.toString() - : state.selectedSize == TopBarSizeEnum.medium - && state.maxLinesSelected == 1 + : state.selectedSize == TopBarSizeEnum.medium && + state.maxLinesSelected == 1 ? minHeightMediumSize.toString() : state.selectedSize == TopBarSizeEnum.large - ? minHeightLargeSize.toString() + ? minHeightLargeSize.toString() : ""; } - static OudsTopAppBarConfig getMaterialConfig(TopBarCustomizationState state){ + static OudsTopAppBarConfig getMaterialConfig(TopBarCustomizationState state) { return OudsTopAppBarConfig( - centerTitle: state.hasCentredAligned, + centerTitle: state.hasCentredAligned, expandedHeight: getExpandedHeaderValue(state), - titleMaxLines : getTitleLineCountValue(state), + titleMaxLines: getTitleLineCountValue(state), showAvatar: state.showAvatar, ); } diff --git a/app/lib/ui/components/top_bar/top_bar_code_generator.dart b/app/lib/ui/components/top_bar/top_bar_code_generator.dart index 909c80b14..c82797325 100644 --- a/app/lib/ui/components/top_bar/top_bar_code_generator.dart +++ b/app/lib/ui/components/top_bar/top_bar_code_generator.dart @@ -28,6 +28,7 @@ class TopBarCodeGenerator { static String title(TopBarCustomizationState customizationState) { return '''title: "${customizationState.titleText}"'''; } + /// Generates the code for the previous title property based on the customization state static String previousPageTitle(TopBarCustomizationState customizationState) { return '''previousPageTitle: "${customizationState.previousPageTitleText}"'''; @@ -65,17 +66,18 @@ class TopBarCodeGenerator { actionConfigCode = 'OudsTopBarActionConfig.back(onActionPressed: (){})'; break; case NavigationIconTypeEnum.close: - actionConfigCode = 'OudsTopBarActionConfig.close(onActionPressed: (){})'; + actionConfigCode = + 'OudsTopBarActionConfig.close(onActionPressed: (){})'; break; case NavigationIconTypeEnum.menu: actionConfigCode = 'OudsTopBarActionConfig.menu(onActionPressed: (){})'; break; case NavigationIconTypeEnum.custom: actionConfigCode = - '''OudsTopBarActionConfig.custom(icon: "assets/tips-and-tricks.svg", onActionPressed: (){})'''; + '''OudsTopBarActionConfig.custom(icon: "assets/tips-and-tricks.svg", onActionPressed: (){})'''; break; case NavigationIconTypeEnum.none: - actionConfigCode = '''OudsTopBarActionConfig.none()'''; + actionConfigCode = '''OudsTopBarActionConfig.none()'''; break; } return '''leadingActions: [ @@ -84,7 +86,9 @@ class TopBarCodeGenerator { } /// Generates the avatar configuration code, combining avatar icon and monogram - static String getAvatarConfigCode(TopBarCustomizationState customizationState) { + static String getAvatarConfigCode( + TopBarCustomizationState customizationState, + ) { return '''avatarConfig: OudsTopAppBarAvatarConfig( ${avatarIconCode(customizationState)}, ${monogramText(customizationState)}, @@ -93,15 +97,15 @@ class TopBarCodeGenerator { /// Generates the code for app bar actions, including avatar and other actions static String? getAppBarActionsCode( - TopBarCustomizationState customizationState) { + TopBarCustomizationState customizationState, + ) { final List configs = []; // Generate code for standard icon actions final int actionCount = customizationState.actionSelected; if (actionCount > 0) { - configs.addAll(List.generate( - actionCount, - (index) { + configs.addAll( + List.generate(actionCount, (index) { final isBadgeEligible = (actionCount == 1) || (index == actionCount - 1); return '''OudsTopBarActionConfig.icon( @@ -109,13 +113,14 @@ class TopBarCodeGenerator { badge: ${isBadgeEligible ? getActionBadgeCode(customizationState) : null}, onActionPressed: (){} )'''; - }, - )); + }), + ); } // Generate code for the avatar action if enabled if (customizationState.showAvatar) { - final avatarCode = '''OudsTopBarActionConfig.avatar( + final avatarCode = + '''OudsTopBarActionConfig.avatar( ${getAvatarConfigCode(customizationState)}, onActionPressed: (){} )'''; @@ -133,14 +138,15 @@ class TopBarCodeGenerator { /// Returns the badge code based on the selected icon badge type static String? getActionBadgeCode( - TopBarCustomizationState customizationState) { + TopBarCustomizationState customizationState, + ) { return customizationState.selectedIconBadge == ActionIconBadgeEnum.count - ? '''OudsTopAppBarActionBadge( + ? '''OudsTopBarActionBadge( count: "1", contentDescription: 'one unread notification' )''' : customizationState.selectedIconBadge == ActionIconBadgeEnum.dot - ? '''OudsTopAppBarActionBadge( + ? '''OudsTopBarActionBadge( contentDescription: 'Notification' )''' : null; @@ -163,8 +169,9 @@ class TopBarCodeGenerator { // Main method to generate the full code for the TopAppBar based on the customization state static String updateCode(BuildContext context) { - final TopBarCustomizationState? customizationState = - TopBarCustomization.of(context); + final TopBarCustomizationState? customizationState = TopBarCustomization.of( + context, + ); if (customizationState == null) { return '// Waiting for customization state...'; @@ -185,15 +192,17 @@ class TopBarCodeGenerator { // else material code generator final materialConfigCode = _generateMaterialConfigCode(customizationState); - final List params = [ - getSize(customizationState), - title(customizationState), - leadingActions(customizationState), - getAppBarActionsCode(customizationState), - materialConfigCode, - ].where((e) => e != null && e.toString().trim().isNotEmpty) - .cast() - .toList(); + final List params = + [ + getSize(customizationState), + title(customizationState), + leadingActions(customizationState), + getAppBarActionsCode(customizationState), + materialConfigCode, + ] + .where((e) => e != null && e.toString().trim().isNotEmpty) + .cast() + .toList(); return """OudsTopBar( ${params.join(',\n ')} @@ -202,7 +211,8 @@ class TopBarCodeGenerator { /// Generates the code for the materialConfig parameter. static String? _generateMaterialConfigCode( - TopBarCustomizationState customizationState) { + TopBarCustomizationState customizationState, + ) { final List configLines = [ titleMaxLines(customizationState), expandedHeight(customizationState), @@ -222,7 +232,9 @@ class TopBarCodeGenerator { /// Generates the code for toolbar top actions static String? actionsCode( - TopBarCustomizationState customizationState, bool isLeadingActions) { + TopBarCustomizationState customizationState, + bool isLeadingActions, + ) { final actionType = isLeadingActions ? customizationState.selectedLeadingActionType : customizationState.selectedTrailingActionType; @@ -235,33 +247,28 @@ class TopBarCodeGenerator { return null; } - String actionConfigCode; - switch (actionType) { - case ToolbarTopActionTypeEnum.text: - actionConfigCode = - '''OudsTopBarActionConfig.text(actionLabel: "Label", onActionPressed: (){})'''; - break; - case ToolbarTopActionTypeEnum.icon: - actionConfigCode = - '''OudsTopBarActionConfig.icon( + final List configs = List.generate(safeActionCount, (index) { + switch (actionType) { + case ToolbarTopActionTypeEnum.text: + return '''OudsTopBarActionConfig.text(actionLabel: "Label", onActionPressed: (){})'''; + case ToolbarTopActionTypeEnum.icon: + final isBadgeEligible = + (safeActionCount == 1) || (index == safeActionCount - 1); + return '''OudsTopBarActionConfig.icon( icon: "assets/functional-social-and-engagement-heart-empty.svg", + badge: ${!isLeadingActions && isBadgeEligible ? getActionBadgeCode(customizationState) : null}, onActionPressed: (){})'''; - break; - case ToolbarTopActionTypeEnum.back: - actionConfigCode = """OudsTopBarActionConfig.back( + case ToolbarTopActionTypeEnum.back: + return """OudsTopBarActionConfig.back( ${previousPageTitle(customizationState)}, onActionPressed: (){})"""; - break; - case ToolbarTopActionTypeEnum.none: - actionConfigCode = ''; - break; - } - - final List configs = - List.generate(safeActionCount, (index) => actionConfigCode); + case ToolbarTopActionTypeEnum.none: + return ''; + } + }); return '''${isLeadingActions ? 'leadingActions' : 'trailingActions'}: [ ${configs.join(',\n ')} ]'''; } -} \ No newline at end of file +} diff --git a/app/lib/ui/components/top_bar/top_bar_customization_utils.dart b/app/lib/ui/components/top_bar/top_bar_customization_utils.dart index d777e6247..cefe4d1be 100644 --- a/app/lib/ui/components/top_bar/top_bar_customization_utils.dart +++ b/app/lib/ui/components/top_bar/top_bar_customization_utils.dart @@ -1,4 +1,3 @@ - // // Software Name: OUDS Flutter // SPDX-FileCopyrightText: Copyright (c) Orange SA @@ -22,7 +21,6 @@ import 'package:ouds_flutter_demo/ui/theme/theme_controller.dart'; /// Utility class for building and managing OudsTopBar actions and sizes. class TopBarCustomizationUtils { - /// Builds a list of actions for the top bar based on the provided context, /// customization state, and desired action count. /// @@ -35,9 +33,8 @@ class TopBarCustomizationUtils { required TopBarCustomizationState customizationState, required bool isLeadingActions, ThemeController? themeController, - //int actionCount = TopAppBarCustomizationUtils.minActionCount, }) { - if(Theme.of(context).platform == TargetPlatform.iOS){ + if (Theme.of(context).platform == TargetPlatform.iOS) { return ToolbarTopCustomizationUtils.buildCupertinoActionsList( context: context, themeController: themeController, @@ -46,20 +43,22 @@ class TopBarCustomizationUtils { ); } //android leading action support only one action (icon) - if(isLeadingActions){ + if (isLeadingActions) { return [ - TopAppBarCustomizationUtils - .getNavigationIcon(context, - themeController!, - customizationState.selectedIconType) + TopAppBarCustomizationUtils.getNavigationIcon( + context, + themeController!, + customizationState.selectedIconType, + ), ]; } return TopAppBarCustomizationUtils.getMaterialActions( - context: context, - themeController: themeController!, - customizationState: customizationState, - actionCount: customizationState.actionSelected); + context: context, + themeController: themeController!, + customizationState: customizationState, + actionCount: customizationState.actionSelected, + ); } /// Maps the top app bar size type enum to `OudsBarTopSize`. @@ -73,4 +72,18 @@ class TopBarCustomizationUtils { return OudsTopBarSize.small; } } -} \ No newline at end of file + + /// Retrieves the count to display based on the current customization state. + static OudsTopBarActionBadge? getActionBadge( + TopBarCustomizationState customizationState, + ) { + return customizationState.selectedIconBadge == ActionIconBadgeEnum.count + ? OudsTopBarActionBadge( + count: "1", + contentDescription: 'one unread notification', + ) + : customizationState.selectedIconBadge == ActionIconBadgeEnum.dot + ? OudsTopBarActionBadge(contentDescription: 'Notification') + : null; + } +} diff --git a/app/lib/ui/components/top_bar/top_bar_demo_screen.dart b/app/lib/ui/components/top_bar/top_bar_demo_screen.dart index 6eff8c721..b2c6268a9 100644 --- a/app/lib/ui/components/top_bar/top_bar_demo_screen.dart +++ b/app/lib/ui/components/top_bar/top_bar_demo_screen.dart @@ -1,4 +1,3 @@ - /* * // Software Name: OUDS Flutter * // SPDX-FileCopyrightText: Copyright (c) Orange SA @@ -14,8 +13,8 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:ouds_core/components/top_bar/ouds_top_bar.dart'; import 'package:ouds_core/components/top_bar/ouds_top_appbar.dart'; +import 'package:ouds_core/components/top_bar/ouds_top_bar.dart'; import 'package:ouds_core/components/top_bar/ouds_top_bar_action_config.dart'; import 'package:ouds_flutter_demo/l10n/app_localizations.dart'; import 'package:ouds_flutter_demo/main_app_bar.dart'; @@ -26,8 +25,10 @@ import 'package:ouds_flutter_demo/ui/components/top_bar/top_bar_customization.da import 'package:ouds_flutter_demo/ui/components/top_bar/top_bar_customization_utils.dart'; import 'package:ouds_flutter_demo/ui/components/top_bar/top_bar_enum.dart'; import 'package:ouds_flutter_demo/ui/theme/theme_controller.dart'; +import 'package:ouds_flutter_demo/ui/utilities/code.dart'; import 'package:ouds_flutter_demo/ui/utilities/customizable/customizable_chips.dart'; import 'package:ouds_flutter_demo/ui/utilities/customizable/customizable_section.dart'; +import 'package:ouds_flutter_demo/ui/utilities/customizable/customizable_switch.dart'; import 'package:ouds_flutter_demo/ui/utilities/customizable/customizable_textfield.dart'; import 'package:ouds_flutter_demo/ui/utilities/detail_screen_header.dart'; import 'package:ouds_flutter_demo/ui/utilities/dismiss_keyboard.dart'; @@ -37,13 +38,14 @@ import 'package:ouds_flutter_demo/ui/utilities/sheets_bottom/ouds_sheets_bottom. import 'package:ouds_theme_contract/ouds_component_version.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; import 'package:provider/provider.dart'; -import 'package:ouds_flutter_demo/ui/utilities/customizable/customizable_switch.dart'; -import 'package:ouds_flutter_demo/ui/utilities/code.dart'; /// This screen displays an appBar demo and allows customization of appBar properties class TopBarDemoScreen extends StatefulWidget { final String? previousPageTitle; - const TopBarDemoScreen({super.key,this.previousPageTitle}); // Default value set to false + const TopBarDemoScreen({ + super.key, + this.previousPageTitle, + }); // Default value set to false @override State createState() => _TopBarDemoScreenState(); @@ -61,19 +63,16 @@ class _TopBarDemoScreenState extends State { @override Widget build(BuildContext context) { - return DismissKeyboard( - child: TopBarCustomization( - child: child(context) - ), - ); + return DismissKeyboard(child: TopBarCustomization(child: child(context))); } - Widget child(BuildContext context){ - + Widget child(BuildContext context) { return Padding( - padding: EdgeInsets.only(bottom: defaultTargetPlatform == TargetPlatform.android - ? MediaQuery.of(context).viewPadding.bottom - : OudsTheme.of(context).spaceScheme(context).paddingBlockNone), + padding: EdgeInsets.only( + bottom: defaultTargetPlatform == TargetPlatform.android + ? MediaQuery.of(context).viewPadding.bottom + : OudsTheme.of(context).spaceScheme(context).paddingBlockNone, + ), child: Scaffold( bottomSheet: OudsSheetsBottom( onExpansionChanged: _onExpansionChanged, @@ -107,19 +106,22 @@ class _Body extends StatefulWidget { class _BodyState extends State<_Body> { @override Widget build(BuildContext context) { - ThemeController? themeController = Provider.of(context, listen: false); + ThemeController? themeController = Provider.of( + context, + listen: false, + ); return DetailScreenDescription( description: context.l10n.app_components_topAppBar_description_text, widget: Column( children: [ _TopBarDemo(), - SizedBox(height: themeController.currentTheme.spaceScheme(context).fixedMedium), - Code( - code: TopBarCodeGenerator.updateCode(context), + SizedBox( + height: themeController.currentTheme + .spaceScheme(context) + .fixedMedium, ), - ReferenceDesignVersionComponent( - version: OudsComponentVersion.bar, - ) + Code(code: TopBarCodeGenerator.updateCode(context)), + ReferenceDesignVersionComponent(version: OudsComponentVersion.appBar), ], ), ); @@ -149,22 +151,22 @@ class _TopBarDemoState extends State<_TopBarDemo> { final barTop = OudsTopBar( size: TopBarCustomizationUtils.getSize(customizationState!.selectedSize), - leadingActions: TopBarCustomizationUtils - .buildActions( + leadingActions: TopBarCustomizationUtils.buildActions( context: context, customizationState: customizationState!, themeController: themeController, isLeadingActions: true, ), title: customizationState?.titleText, - trailingActions: TopBarCustomizationUtils - .buildActions( + trailingActions: TopBarCustomizationUtils.buildActions( context: context, customizationState: customizationState!, themeController: themeController, isLeadingActions: false, ), - materialConfig: TopAppBarCustomizationUtils.getMaterialConfig(customizationState!) + materialConfig: TopAppBarCustomizationUtils.getMaterialConfig( + customizationState!, + ), ); return LightDarkBox( @@ -177,11 +179,7 @@ class _TopBarDemoState extends State<_TopBarDemo> { } // Helper method to reduce duplication - Widget _wrapWithSizedBox( - BuildContext context, - Widget child, - double height, - ) { + Widget _wrapWithSizedBox(BuildContext context, Widget child, double height) { return Theme.of(context).platform == TargetPlatform.android ? SizedBox(height: height, child: child) : child; @@ -193,11 +191,13 @@ class _TopAppBarCustomizationContent extends StatefulWidget { const _TopAppBarCustomizationContent(); @override - State<_TopAppBarCustomizationContent> createState() => _TopAppBarCustomizationContentState(); + State<_TopAppBarCustomizationContent> createState() => + _TopAppBarCustomizationContentState(); } /// This state class handles the customization options for the TopAppBar -class _TopAppBarCustomizationContentState extends State<_TopAppBarCustomizationContent> { +class _TopAppBarCustomizationContentState + extends State<_TopAppBarCustomizationContent> { late final FocusNode titleFocus; late final FocusNode headerFocus; late final FocusNode lineCountFocus; @@ -223,7 +223,9 @@ class _TopAppBarCustomizationContentState extends State<_TopAppBarCustomizationC @override Widget build(BuildContext context) { - final TopBarCustomizationState? customizationState = TopBarCustomization.of(context); + final TopBarCustomizationState? customizationState = TopBarCustomization.of( + context, + ); var navigationIconType = customizationState!.iconTypeState.list; var size = customizationState.sizeState.list; var actionIconBadgeType = customizationState.actionIconBadgeState.list; @@ -240,8 +242,10 @@ class _TopAppBarCustomizationContentState extends State<_TopAppBarCustomizationC setState(() { customizationState.selectedSize = selectedOption; customizationState.maxLinesSelected = 1; - customizationState.expandedHeightText = TopAppBarCustomizationUtils - .setExpandedHeight(customizationState); + customizationState.expandedHeightText = + TopAppBarCustomizationUtils.setExpandedHeight( + customizationState, + ); }); }, ), @@ -250,10 +254,11 @@ class _TopAppBarCustomizationContentState extends State<_TopAppBarCustomizationC value: customizationState.hasCentredAligned, onChanged: customizationState.selectedSize == TopBarSizeEnum.small ? (value) { - setState(() { - customizationState.hasCentredAligned = value; - }); - } : null, + setState(() { + customizationState.hasCentredAligned = value; + }); + } + : null, ), CustomizableChips( title: NavigationIconTypeEnum.enumName(context), @@ -280,22 +285,32 @@ class _TopAppBarCustomizationContentState extends State<_TopAppBarCustomizationC onSelected: (selectedOption) { setState(() { customizationState.maxLinesSelected = selectedOption; - customizationState.expandedHeightText = TopAppBarCustomizationUtils - .setExpandedHeight(customizationState); + customizationState.expandedHeightText = + TopAppBarCustomizationUtils.setExpandedHeight( + customizationState, + ); }); }, - disabledOptions: TopAppBarCustomizationUtils.getMaxLiensDisabledOptions(customizationState) + disabledOptions: + TopAppBarCustomizationUtils.getMaxLiensDisabledOptions( + customizationState, + ), ), CustomizableTextField( title: context.l10n.app_components_topAppBar_expandedHeight_label, text: customizationState.expandedHeightText, - helperText: TopAppBarCustomizationUtils - .getExpandedHeightHelperText(context, customizationState), + helperText: TopAppBarCustomizationUtils.getExpandedHeightHelperText( + context, + customizationState, + ), focusNode: headerFocus, fieldType: FieldType.customHeight, keyboardType: TextInputType.number, fieldEnable: customizationState.selectedSize != TopBarSizeEnum.small, - errorText: TopAppBarCustomizationUtils.getExpandedHeightErrorText(context,customizationState), + errorText: TopAppBarCustomizationUtils.getExpandedHeightErrorText( + context, + customizationState, + ), ), CustomizableChips( title: context.l10n.app_components_common_trailingActionCount_label, @@ -316,15 +331,15 @@ class _TopAppBarCustomizationContentState extends State<_TopAppBarCustomizationC onSelected: customizationState.actionSelected == 0 ? null : (selectedOption) { - setState(() { - customizationState.selectedIconBadge = selectedOption; - }); - }, + setState(() { + customizationState.selectedIconBadge = selectedOption; + }); + }, ), CustomizableSwitch( title: context.l10n.app_components_topAppBar_showAvatar_label, value: customizationState.showAvatar, - onChanged: (value) { + onChanged: (value) { setState(() { customizationState.showAvatar = value; }); @@ -338,16 +353,23 @@ class _TopAppBarCustomizationContentState extends State<_TopAppBarCustomizationC onSelected: !customizationState.showAvatar ? null : (selectedOption) { - setState(() { - customizationState.selectedActionAvatar = selectedOption; - customizationState.actionAvatarMonogramText = TopAppBarCustomizationUtils.getMonogramText(customizationState); - }); - } , + setState(() { + customizationState.selectedActionAvatar = selectedOption; + customizationState.actionAvatarMonogramText = + TopAppBarCustomizationUtils.getMonogramText( + customizationState, + ); + }); + }, ), CustomizableTextField( - fieldEnable: TopAppBarCustomizationUtils - .getActionAvatar(customizationState.selectedActionAvatar) == OudsTopAppBarActionAvatar.monogram, - title: context.l10n.app_components_topAppBar_actionAvatarMonogram_label, + fieldEnable: + TopAppBarCustomizationUtils.getActionAvatar( + customizationState.selectedActionAvatar, + ) == + OudsTopAppBarActionAvatar.monogram, + title: + context.l10n.app_components_topAppBar_actionAvatarMonogram_label, text: customizationState.actionAvatarMonogramText ?? "A", focusNode: monogramFocus, fieldType: FieldType.monogram, @@ -363,11 +385,13 @@ class _ToolBarTopCustomizationContent extends StatefulWidget { const _ToolBarTopCustomizationContent(); @override - State<_ToolBarTopCustomizationContent> createState() => _ToolbarTopCustomizationContentState(); + State<_ToolBarTopCustomizationContent> createState() => + _ToolbarTopCustomizationContentState(); } /// This state class handles the customization options for the TopNavigationBar -class _ToolbarTopCustomizationContentState extends State<_ToolBarTopCustomizationContent> { +class _ToolbarTopCustomizationContentState + extends State<_ToolBarTopCustomizationContent> { late final FocusNode titleFocus; late final FocusNode leadingFocus; late final FocusNode trailingFocus; @@ -393,7 +417,9 @@ class _ToolbarTopCustomizationContentState extends State<_ToolBarTopCustomizatio @override Widget build(BuildContext context) { - final TopBarCustomizationState? customizationState = TopBarCustomization.of(context); + final TopBarCustomizationState? customizationState = TopBarCustomization.of( + context, + ); var navigationActionType = customizationState!.leadingActionTypeState.list; var trailingActionType = customizationState.trailingActionTypeState.list; final sizeOptions = customizationState.sizeState.list @@ -413,9 +439,9 @@ class _ToolbarTopCustomizationContentState extends State<_ToolBarTopCustomizatio }, ), CustomizableSwitch( - title: context.l10n.app_components_toolbarTop_actionEnabled_label, - value: customizationState.hasEnabled, - onChanged: (value) => customizationState.hasEnabled = value + title: context.l10n.app_components_toolbarTop_actionEnabled_label, + value: customizationState.hasEnabled, + onChanged: (value) => customizationState.hasEnabled = value, ), CustomizableChips( title: ToolbarTopActionTypeEnum.enumName(context), @@ -425,18 +451,23 @@ class _ToolbarTopCustomizationContentState extends State<_ToolBarTopCustomizatio onSelected: (selectedOption) { setState(() { customizationState.selectedLeadingActionType = selectedOption; - if(selectedOption == ToolbarTopActionTypeEnum.back){ - customizationState.selectedLeadingActionCount = ToolbarTopCustomizationUtils.minActionCount; + if (selectedOption == ToolbarTopActionTypeEnum.back) { + customizationState.selectedLeadingActionCount = + ToolbarTopCustomizationUtils.minActionCount; } }); }, ), CustomizableChips( - title: context.l10n.app_components_toolbarTop_leadingActionCount_label, + title: + context.l10n.app_components_toolbarTop_leadingActionCount_label, options: ToolbarTopCustomizationUtils.getLimitedActionsCount(context), selectedOption: customizationState.selectedLeadingActionCount, getText: (option) => option.toString(), - disabledOptions: ToolbarTopCustomizationUtils.getDisabledLeadingActionCountOptions(customizationState), + disabledOptions: + ToolbarTopCustomizationUtils.getDisabledLeadingActionCountOptions( + customizationState, + ), onSelected: (selectedOption) { setState(() { customizationState.selectedLeadingActionCount = selectedOption; @@ -444,7 +475,8 @@ class _ToolbarTopCustomizationContentState extends State<_ToolBarTopCustomizatio }, ), CustomizableChips( - title: context.l10n.app_components_toolbarTop_trailingActionType_label, + title: + context.l10n.app_components_toolbarTop_trailingActionType_label, options: trailingActionType, selectedOption: customizationState.selectedTrailingActionType, getText: (option) => option.stringValue(context), @@ -459,14 +491,29 @@ class _ToolbarTopCustomizationContentState extends State<_ToolBarTopCustomizatio options: ToolbarTopCustomizationUtils.getLimitedActionsCount(context), selectedOption: customizationState.selectedTrailingActionCount, getText: (option) => option.toString(), - disabledOptions: ToolbarTopCustomizationUtils - .getDisabledTrailingActionCountOptions(customizationState), + disabledOptions: + ToolbarTopCustomizationUtils.getDisabledTrailingActionCountOptions( + customizationState, + ), onSelected: (selectedOption) { setState(() { customizationState.selectedTrailingActionCount = selectedOption; }); }, ), + CustomizableChips( + title: ActionIconBadgeEnum.enumName(context), + options: customizationState.actionIconBadgeState.list, + selectedOption: customizationState.selectedIconBadge, + getText: (option) => option.stringValue(context), + onSelected: customizationState.actionSelected == 0 + ? null + : (selectedOption) { + setState(() { + customizationState.selectedIconBadge = selectedOption; + }); + }, + ), CustomizableTextField( title: context.l10n.app_components_common_title_label, text: customizationState.titleText, diff --git a/app/lib/ui/tokens/color/color_tokens_model.dart b/app/lib/ui/tokens/color/color_tokens_model.dart index 526ffc437..ef0563db9 100644 --- a/app/lib/ui/tokens/color/color_tokens_model.dart +++ b/app/lib/ui/tokens/color/color_tokens_model.dart @@ -12,122 +12,424 @@ class ColorTokensModel { Map> get all => _groups; - factory ColorTokensModel.fromTheme(BuildContext context, OudsThemeContract theme) { + factory ColorTokensModel.fromTheme( + BuildContext context, + OudsThemeContract theme, + ) { return ColorTokensModel({ context.l10n.app_tokens_color_action_label: [ - ColorTokenItem(name: 'actionDisabled', value: theme.colorScheme(context).actionDisabled), - ColorTokenItem(name: 'actionEnabled', value: theme.colorScheme(context).actionEnabled), - ColorTokenItem(name: 'actionFocus', value: theme.colorScheme(context).actionFocus), - ColorTokenItem(name: 'actionHighlighted', value: theme.colorScheme(context).actionHighlighted), - ColorTokenItem(name: 'actionHover', value: theme.colorScheme(context).actionHover), - ColorTokenItem(name: 'actionLoading', value: theme.colorScheme(context).actionLoading), - ColorTokenItem(name: 'actionNegativeEnabled', value: theme.colorScheme(context).actionNegativeEnabled), - ColorTokenItem(name: 'actionNegativeFocus', value: theme.colorScheme(context).actionNegativeFocus), - ColorTokenItem(name: 'actionNegativeHover', value: theme.colorScheme(context).actionNegativeHover), - ColorTokenItem(name: 'actionNegativeLoading', value: theme.colorScheme(context).actionNegativeLoading), - ColorTokenItem(name: 'actionNegativePressed', value: theme.colorScheme(context).actionNegativePressed), - ColorTokenItem(name: 'actionPressed', value: theme.colorScheme(context).actionPressed), - ColorTokenItem(name: 'actionReadOnlyPrimary', value: theme.colorScheme(context).actionReadOnlyPrimary), - ColorTokenItem(name: 'actionReadOnlySecondary', value: theme.colorScheme(context).actionReadOnlySecondary), - ColorTokenItem(name: 'actionSelected', value: theme.colorScheme(context).actionSelected), - ColorTokenItem(name: 'actionSupportDisabled ', value: theme.colorScheme(context).actionSupportDisabled), - ColorTokenItem(name: 'actionSupportEnabled', value: theme.colorScheme(context).actionSupportEnabled), - ColorTokenItem(name: 'actionSupportFocus', value: theme.colorScheme(context).actionSupportFocus), - ColorTokenItem(name: 'actionSupportHover', value: theme.colorScheme(context).actionSupportHover), - ColorTokenItem(name: 'actionSupportLoading', value: theme.colorScheme(context).actionSupportLoading), - ColorTokenItem(name: 'actionSupportPressed', value: theme.colorScheme(context).actionSupportPressed), - ColorTokenItem(name: 'actionVisited', value: theme.colorScheme(context).actionVisited), - ColorTokenItem(name: 'actionAccent', value: theme.colorScheme(context).actionIosAccent), + ColorTokenItem( + name: 'actionDisabled', + value: theme.colorScheme(context).actionDisabled, + ), + ColorTokenItem( + name: 'actionEnabled', + value: theme.colorScheme(context).actionEnabled, + ), + ColorTokenItem( + name: 'actionFocus', + value: theme.colorScheme(context).actionFocus, + ), + ColorTokenItem( + name: 'actionHighlighted', + value: theme.colorScheme(context).actionHighlighted, + ), + ColorTokenItem( + name: 'actionHover', + value: theme.colorScheme(context).actionHover, + ), + ColorTokenItem( + name: 'actionLoading', + value: theme.colorScheme(context).actionLoading, + ), + ColorTokenItem( + name: 'actionNegativeEnabled', + value: theme.colorScheme(context).actionNegativeEnabled, + ), + ColorTokenItem( + name: 'actionNegativeFocus', + value: theme.colorScheme(context).actionNegativeFocus, + ), + ColorTokenItem( + name: 'actionNegativeHover', + value: theme.colorScheme(context).actionNegativeHover, + ), + ColorTokenItem( + name: 'actionNegativeLoading', + value: theme.colorScheme(context).actionNegativeLoading, + ), + ColorTokenItem( + name: 'actionNegativePressed', + value: theme.colorScheme(context).actionNegativePressed, + ), + ColorTokenItem( + name: 'actionPressed', + value: theme.colorScheme(context).actionPressed, + ), + ColorTokenItem( + name: 'actionReadOnlyPrimary', + value: theme.colorScheme(context).actionReadOnlyPrimary, + ), + ColorTokenItem( + name: 'actionReadOnlySecondary', + value: theme.colorScheme(context).actionReadOnlySecondary, + ), + ColorTokenItem( + name: 'actionSelected', + value: theme.colorScheme(context).actionSelected, + ), + ColorTokenItem( + name: 'actionSupportDisabled ', + value: theme.colorScheme(context).actionSupportDisabled, + ), + ColorTokenItem( + name: 'actionSupportEnabled', + value: theme.colorScheme(context).actionSupportEnabled, + ), + ColorTokenItem( + name: 'actionSupportFocus', + value: theme.colorScheme(context).actionSupportFocus, + ), + ColorTokenItem( + name: 'actionSupportHover', + value: theme.colorScheme(context).actionSupportHover, + ), + ColorTokenItem( + name: 'actionSupportLoading', + value: theme.colorScheme(context).actionSupportLoading, + ), + ColorTokenItem( + name: 'actionSupportPressed', + value: theme.colorScheme(context).actionSupportPressed, + ), + ColorTokenItem( + name: 'actionVisited', + value: theme.colorScheme(context).actionVisited, + ), ], context.l10n.app_tokens_color_always_label: [ - ColorTokenItem(name: 'alwaysBlack', value: theme.colorScheme(context).alwaysBlack), - ColorTokenItem(name: 'alwaysOnBlack', value: theme.colorScheme(context).alwaysOnBlack), - ColorTokenItem(name: 'alwaysOnWhite', value: theme.colorScheme(context).alwaysOnWhite), - ColorTokenItem(name: 'alwaysWhite', value: theme.colorScheme(context).alwaysWhite), + ColorTokenItem( + name: 'alwaysBlack', + value: theme.colorScheme(context).alwaysBlack, + ), + ColorTokenItem( + name: 'alwaysOnBlack', + value: theme.colorScheme(context).alwaysOnBlack, + ), + ColorTokenItem( + name: 'alwaysOnWhite', + value: theme.colorScheme(context).alwaysOnWhite, + ), + ColorTokenItem( + name: 'alwaysWhite', + value: theme.colorScheme(context).alwaysWhite, + ), ], context.l10n.app_tokens_color_background_label: [ - ColorTokenItem(name: 'bgInverseHigh', value: theme.colorScheme(context).bgInverseHigh), - ColorTokenItem(name: 'bgInverseLow', value: theme.colorScheme(context).bgInverseLow), - ColorTokenItem(name: 'bgPrimary', value: theme.colorScheme(context).bgPrimary), - ColorTokenItem(name: 'bgSecondary', value: theme.colorScheme(context).bgSecondary), - ColorTokenItem(name: 'bgTertiary', value: theme.colorScheme(context).bgTertiary), + ColorTokenItem( + name: 'bgInverseHigh', + value: theme.colorScheme(context).bgInverseHigh, + ), + ColorTokenItem( + name: 'bgInverseLow', + value: theme.colorScheme(context).bgInverseLow, + ), + ColorTokenItem( + name: 'bgPrimary', + value: theme.colorScheme(context).bgPrimary, + ), + ColorTokenItem( + name: 'bgSecondary', + value: theme.colorScheme(context).bgSecondary, + ), + ColorTokenItem( + name: 'bgTertiary', + value: theme.colorScheme(context).bgTertiary, + ), ], context.l10n.app_tokens_color_border_label: [ - ColorTokenItem(name: 'borderBrandPrimary', value: theme.colorScheme(context).borderBrandPrimary), - ColorTokenItem(name: 'borderBrandSecondary', value: theme.colorScheme(context).borderBrandSecondary), - ColorTokenItem(name: 'borderBrandTertiary', value: theme.colorScheme(context).borderBrandTertiary), - ColorTokenItem(name: 'borderDefault', value: theme.colorScheme(context).borderDefault), - ColorTokenItem(name: 'borderEmphasized', value: theme.colorScheme(context).borderEmphasized), - ColorTokenItem(name: 'borderFocus', value: theme.colorScheme(context).borderFocus), - ColorTokenItem(name: 'borderFocusInset', value: theme.colorScheme(context).borderFocusInset), - ColorTokenItem(name: 'borderMuted', value: theme.colorScheme(context).borderMuted), - ColorTokenItem(name: 'borderOnBrandPrimary', value: theme.colorScheme(context).borderOnBrandPrimary), - ColorTokenItem(name: 'borderOnBrandSecondary', value: theme.colorScheme(context).borderOnBrandSecondary), - ColorTokenItem(name: 'borderOnBrandTertiary', value: theme.colorScheme(context).borderOnBrandTertiary), - ColorTokenItem(name: 'borderMinimal', value: theme.colorScheme(context).borderMinimal), - ColorTokenItem(name: 'borderStatusAccent', value: theme.colorScheme(context).borderStatusAccent), - ColorTokenItem(name: 'borderStatusInfo', value: theme.colorScheme(context).borderStatusInfo), - ColorTokenItem(name: 'borderStatusNegative', value: theme.colorScheme(context).borderStatusNegative), - ColorTokenItem(name: 'borderStatusPositive', value: theme.colorScheme(context).borderStatusPositive), - ColorTokenItem(name: 'borderStatusWarning', value: theme.colorScheme(context).borderStatusWarning), + ColorTokenItem( + name: 'borderBrandPrimary', + value: theme.colorScheme(context).borderBrandPrimary, + ), + ColorTokenItem( + name: 'borderBrandSecondary', + value: theme.colorScheme(context).borderBrandSecondary, + ), + ColorTokenItem( + name: 'borderBrandTertiary', + value: theme.colorScheme(context).borderBrandTertiary, + ), + ColorTokenItem( + name: 'borderDefault', + value: theme.colorScheme(context).borderDefault, + ), + ColorTokenItem( + name: 'borderEmphasized', + value: theme.colorScheme(context).borderEmphasized, + ), + ColorTokenItem( + name: 'borderFocus', + value: theme.colorScheme(context).borderFocus, + ), + ColorTokenItem( + name: 'borderFocusInset', + value: theme.colorScheme(context).borderFocusInset, + ), + ColorTokenItem( + name: 'borderMuted', + value: theme.colorScheme(context).borderMuted, + ), + ColorTokenItem( + name: 'borderOnBrandPrimary', + value: theme.colorScheme(context).borderOnBrandPrimary, + ), + ColorTokenItem( + name: 'borderOnBrandSecondary', + value: theme.colorScheme(context).borderOnBrandSecondary, + ), + ColorTokenItem( + name: 'borderOnBrandTertiary', + value: theme.colorScheme(context).borderOnBrandTertiary, + ), + ColorTokenItem( + name: 'borderMinimal', + value: theme.colorScheme(context).borderMinimal, + ), + ColorTokenItem( + name: 'borderStatusAccent', + value: theme.colorScheme(context).borderStatusAccent, + ), + ColorTokenItem( + name: 'borderStatusInfo', + value: theme.colorScheme(context).borderStatusInfo, + ), + ColorTokenItem( + name: 'borderStatusNegative', + value: theme.colorScheme(context).borderStatusNegative, + ), + ColorTokenItem( + name: 'borderStatusPositive', + value: theme.colorScheme(context).borderStatusPositive, + ), + ColorTokenItem( + name: 'borderStatusWarning', + value: theme.colorScheme(context).borderStatusWarning, + ), ], context.l10n.app_tokens_color_content_label: [ - ColorTokenItem(name: 'contentBrandPrimary', value: theme.colorScheme(context).contentBrandPrimary), - ColorTokenItem(name: 'contentBrandSecondary', value: theme.colorScheme(context).contentBrandSecondary), - ColorTokenItem(name: 'contentBrandTertiary', value: theme.colorScheme(context).contentBrandTertiary), - ColorTokenItem(name: 'contentDefault', value: theme.colorScheme(context).contentDefault), - ColorTokenItem(name: 'contentDisabled', value: theme.colorScheme(context).contentDisabled), - ColorTokenItem(name: 'contentInverse', value: theme.colorScheme(context).contentInverse), - ColorTokenItem(name: 'contentMuted', value: theme.colorScheme(context).contentMuted), - ColorTokenItem(name: 'contentOnActionDisabled', value: theme.colorScheme(context).contentOnActionDisabled), - ColorTokenItem(name: 'contentOnActionEnabled', value: theme.colorScheme(context).contentOnActionEnabled), - ColorTokenItem(name: 'contentOnActionFocus', value: theme.colorScheme(context).contentOnActionFocus), - ColorTokenItem(name: 'contentOnActionHighlighted', value: theme.colorScheme(context).contentOnActionHighlighted), - ColorTokenItem(name: 'contentOnActionHover', value: theme.colorScheme(context).contentOnActionHover), - ColorTokenItem(name: 'contentOnActionLoading', value: theme.colorScheme(context).contentOnActionLoading), - ColorTokenItem(name: 'contentOnActionPressed', value: theme.colorScheme(context).contentOnActionPressed), - ColorTokenItem(name: 'contentOnActionSelected', value: theme.colorScheme(context).contentOnActionSelected), - ColorTokenItem(name: 'contentOnBrandPrimary', value: theme.colorScheme(context).contentOnBrandPrimary), - ColorTokenItem(name: 'contentOnBrandSecondary', value: theme.colorScheme(context).contentOnBrandSecondary), - ColorTokenItem(name: 'contentOnBrandTertiary', value: theme.colorScheme(context).contentOnBrandTertiary), - ColorTokenItem(name: 'contentOnStatusPositiveEmphasized', value: theme.colorScheme(context).contentOnStatusPositiveEmphasized), - ColorTokenItem(name: 'contentOnStatusInfoEmphasized', value: theme.colorScheme(context).contentOnStatusInfoEmphasized), - ColorTokenItem(name: 'contentOnStatusInfoMuted', value: theme.colorScheme(context).contentOnStatusInfoMuted), - ColorTokenItem(name: 'contentOnStatusNegativeEmphasized', value: theme.colorScheme(context).contentOnStatusNegativeEmphasized), - ColorTokenItem(name: 'contentOnStatusNegativeMuted', value: theme.colorScheme(context).contentOnStatusNegativeMuted), - ColorTokenItem(name: 'contentOnStatusAccentEmphasized', value: theme.colorScheme(context).contentOnStatusAccentEmphasized), - ColorTokenItem(name: 'contentOnStatusAccentMuted', value: theme.colorScheme(context).contentOnStatusAccentMuted), - ColorTokenItem(name: 'contentStatusAccent', value: theme.colorScheme(context).contentStatusAccent), - ColorTokenItem(name: 'contentStatusInfo', value: theme.colorScheme(context).contentStatusInfo), - ColorTokenItem(name: 'contentStatusNegative', value: theme.colorScheme(context).contentStatusNegative), - ColorTokenItem(name: 'contentStatusPositive', value: theme.colorScheme(context).contentStatusPositive), - ColorTokenItem(name: 'contentStatusWarning', value: theme.colorScheme(context).contentStatusWarning), + ColorTokenItem( + name: 'contentBrandPrimary', + value: theme.colorScheme(context).contentBrandPrimary, + ), + ColorTokenItem( + name: 'contentBrandSecondary', + value: theme.colorScheme(context).contentBrandSecondary, + ), + ColorTokenItem( + name: 'contentBrandTertiary', + value: theme.colorScheme(context).contentBrandTertiary, + ), + ColorTokenItem( + name: 'contentDefault', + value: theme.colorScheme(context).contentDefault, + ), + ColorTokenItem( + name: 'contentDisabled', + value: theme.colorScheme(context).contentDisabled, + ), + ColorTokenItem( + name: 'contentInverse', + value: theme.colorScheme(context).contentInverse, + ), + ColorTokenItem( + name: 'contentMuted', + value: theme.colorScheme(context).contentMuted, + ), + ColorTokenItem( + name: 'contentOnActionDisabled', + value: theme.colorScheme(context).contentOnActionDisabled, + ), + ColorTokenItem( + name: 'contentOnActionEnabled', + value: theme.colorScheme(context).contentOnActionEnabled, + ), + ColorTokenItem( + name: 'contentOnActionFocus', + value: theme.colorScheme(context).contentOnActionFocus, + ), + ColorTokenItem( + name: 'contentOnActionHighlighted', + value: theme.colorScheme(context).contentOnActionHighlighted, + ), + ColorTokenItem( + name: 'contentOnActionHover', + value: theme.colorScheme(context).contentOnActionHover, + ), + ColorTokenItem( + name: 'contentOnActionLoading', + value: theme.colorScheme(context).contentOnActionLoading, + ), + ColorTokenItem( + name: 'contentOnActionPressed', + value: theme.colorScheme(context).contentOnActionPressed, + ), + ColorTokenItem( + name: 'contentOnActionSelected', + value: theme.colorScheme(context).contentOnActionSelected, + ), + ColorTokenItem( + name: 'contentOnBrandPrimary', + value: theme.colorScheme(context).contentOnBrandPrimary, + ), + ColorTokenItem( + name: 'contentOnBrandSecondary', + value: theme.colorScheme(context).contentOnBrandSecondary, + ), + ColorTokenItem( + name: 'contentOnBrandTertiary', + value: theme.colorScheme(context).contentOnBrandTertiary, + ), + ColorTokenItem( + name: 'contentOnStatusPositiveEmphasized', + value: theme.colorScheme(context).contentOnStatusPositiveEmphasized, + ), + ColorTokenItem( + name: 'contentOnStatusInfoEmphasized', + value: theme.colorScheme(context).contentOnStatusInfoEmphasized, + ), + ColorTokenItem( + name: 'contentOnStatusInfoMuted', + value: theme.colorScheme(context).contentOnStatusInfoMuted, + ), + ColorTokenItem( + name: 'contentOnStatusNegativeEmphasized', + value: theme.colorScheme(context).contentOnStatusNegativeEmphasized, + ), + ColorTokenItem( + name: 'contentOnStatusNegativeMuted', + value: theme.colorScheme(context).contentOnStatusNegativeMuted, + ), + ColorTokenItem( + name: 'contentOnStatusAccentEmphasized', + value: theme.colorScheme(context).contentOnStatusAccentEmphasized, + ), + ColorTokenItem( + name: 'contentOnStatusAccentMuted', + value: theme.colorScheme(context).contentOnStatusAccentMuted, + ), + ColorTokenItem( + name: 'contentStatusAccent', + value: theme.colorScheme(context).contentStatusAccent, + ), + ColorTokenItem( + name: 'contentStatusInfo', + value: theme.colorScheme(context).contentStatusInfo, + ), + ColorTokenItem( + name: 'contentStatusNegative', + value: theme.colorScheme(context).contentStatusNegative, + ), + ColorTokenItem( + name: 'contentStatusPositive', + value: theme.colorScheme(context).contentStatusPositive, + ), + ColorTokenItem( + name: 'contentStatusWarning', + value: theme.colorScheme(context).contentStatusWarning, + ), ], context.l10n.app_tokens_color_overlay_label: [ - ColorTokenItem(name: 'overlayDropdown', value: theme.colorScheme(context).overlayDropdown), - ColorTokenItem(name: 'overlayTooltip', value: theme.colorScheme(context).overlayTooltip), - ColorTokenItem(name: 'overlayDrag', value: theme.colorScheme(context).overlayDrag), - ColorTokenItem(name: 'overlayModal', value: theme.colorScheme(context).overlayModal), + ColorTokenItem( + name: 'overlayDropdown', + value: theme.colorScheme(context).overlayDropdown, + ), + ColorTokenItem( + name: 'overlayTooltip', + value: theme.colorScheme(context).overlayTooltip, + ), + ColorTokenItem( + name: 'overlayDrag', + value: theme.colorScheme(context).overlayDrag, + ), + ColorTokenItem( + name: 'overlayModal', + value: theme.colorScheme(context).overlayModal, + ), ], context.l10n.app_tokens_color_surface_label: [ - ColorTokenItem(name: 'surfaceBrandPrimary', value: theme.colorScheme(context).surfaceBrandPrimary), - ColorTokenItem(name: 'surfaceBrandSecondary', value: theme.colorScheme(context).surfaceBrandSecondary), - ColorTokenItem(name: 'surfaceBrandTertiary', value: theme.colorScheme(context).surfaceBrandTertiary), - ColorTokenItem(name: 'surfaceInverseHigh', value: theme.colorScheme(context).surfaceInverseHigh), - ColorTokenItem(name: 'surfaceInverseLow', value: theme.colorScheme(context).surfaceInverseLow), - ColorTokenItem(name: 'surfacePrimary', value: theme.colorScheme(context).surfacePrimary), - ColorTokenItem(name: 'surfaceSecondary', value: theme.colorScheme(context).surfaceSecondary), - ColorTokenItem(name: 'surfaceTertiary', value: theme.colorScheme(context).surfaceTertiary), - ColorTokenItem(name: 'surfaceStatusAccentEmphasized', value: theme.colorScheme(context).surfaceStatusAccentEmphasized), - ColorTokenItem(name: 'surfaceStatusAccentMuted', value: theme.colorScheme(context).surfaceStatusAccentMuted), - ColorTokenItem(name: 'surfaceStatusInfoEmphasized', value: theme.colorScheme(context).surfaceStatusInfoEmphasized), - ColorTokenItem(name: 'surfaceStatusInfoMuted', value: theme.colorScheme(context).surfaceStatusInfoMuted), - ColorTokenItem(name: 'surfaceStatusNegativeEmphasized', value: theme.colorScheme(context).surfaceStatusNegativeEmphasized), - ColorTokenItem(name: 'surfaceStatusNegativeMuted', value: theme.colorScheme(context).surfaceStatusNegativeMuted), - ColorTokenItem(name: 'surfaceStatusPositiveEmphasized', value: theme.colorScheme(context).surfaceStatusPositiveEmphasized), - ColorTokenItem(name: 'surfaceStatusPositiveMuted', value: theme.colorScheme(context).surfaceStatusPositiveMuted), - ColorTokenItem(name: 'surfaceStatusWarningEmphasized', value: theme.colorScheme(context).surfaceStatusWarningEmphasized), - ColorTokenItem(name: 'surfaceStatusWarningMuted', value: theme.colorScheme(context).surfaceStatusWarningMuted), + ColorTokenItem( + name: 'surfaceBrandPrimary', + value: theme.colorScheme(context).surfaceBrandPrimary, + ), + ColorTokenItem( + name: 'surfaceBrandSecondary', + value: theme.colorScheme(context).surfaceBrandSecondary, + ), + ColorTokenItem( + name: 'surfaceBrandTertiary', + value: theme.colorScheme(context).surfaceBrandTertiary, + ), + ColorTokenItem( + name: 'surfaceInverseHigh', + value: theme.colorScheme(context).surfaceInverseHigh, + ), + ColorTokenItem( + name: 'surfaceInverseLow', + value: theme.colorScheme(context).surfaceInverseLow, + ), + ColorTokenItem( + name: 'surfacePrimary', + value: theme.colorScheme(context).surfacePrimary, + ), + ColorTokenItem( + name: 'surfaceSecondary', + value: theme.colorScheme(context).surfaceSecondary, + ), + ColorTokenItem( + name: 'surfaceTertiary', + value: theme.colorScheme(context).surfaceTertiary, + ), + ColorTokenItem( + name: 'surfaceStatusAccentEmphasized', + value: theme.colorScheme(context).surfaceStatusAccentEmphasized, + ), + ColorTokenItem( + name: 'surfaceStatusAccentMuted', + value: theme.colorScheme(context).surfaceStatusAccentMuted, + ), + ColorTokenItem( + name: 'surfaceStatusInfoEmphasized', + value: theme.colorScheme(context).surfaceStatusInfoEmphasized, + ), + ColorTokenItem( + name: 'surfaceStatusInfoMuted', + value: theme.colorScheme(context).surfaceStatusInfoMuted, + ), + ColorTokenItem( + name: 'surfaceStatusNegativeEmphasized', + value: theme.colorScheme(context).surfaceStatusNegativeEmphasized, + ), + ColorTokenItem( + name: 'surfaceStatusNegativeMuted', + value: theme.colorScheme(context).surfaceStatusNegativeMuted, + ), + ColorTokenItem( + name: 'surfaceStatusPositiveEmphasized', + value: theme.colorScheme(context).surfaceStatusPositiveEmphasized, + ), + ColorTokenItem( + name: 'surfaceStatusPositiveMuted', + value: theme.colorScheme(context).surfaceStatusPositiveMuted, + ), + ColorTokenItem( + name: 'surfaceStatusWarningEmphasized', + value: theme.colorScheme(context).surfaceStatusWarningEmphasized, + ), + ColorTokenItem( + name: 'surfaceStatusWarningMuted', + value: theme.colorScheme(context).surfaceStatusWarningMuted, + ), ], }); } diff --git a/app/lib/ui/utilities/app_assets.dart b/app/lib/ui/utilities/app_assets.dart index 135d9c73e..11336413e 100644 --- a/app/lib/ui/utilities/app_assets.dart +++ b/app/lib/ui/utilities/app_assets.dart @@ -26,45 +26,77 @@ class _Images { /// Tokens final String ilTokensColor = 'assets/illustration/token/il_tokens_color.svg'; - final String ilTokensColorDark = 'assets/illustration/token/il_tokens_color_dark.svg'; + final String ilTokensColorDark = + 'assets/illustration/token/il_tokens_color_dark.svg'; - final String ilTokensElevation = 'assets/illustration/token/il_tokens_elevation.svg'; - final String ilTokensElevationDark = 'assets/illustration/token/il_tokens_elevation_dark.svg'; + final String ilTokensElevation = + 'assets/illustration/token/il_tokens_elevation.svg'; + final String ilTokensElevationDark = + 'assets/illustration/token/il_tokens_elevation_dark.svg'; - final String ilTokensOpacity = 'assets/illustration/token/il_tokens_opacity.svg'; - final String ilTokensOpacityDark = 'assets/illustration/token/il_tokens_opacity_dark.svg'; + final String ilTokensOpacity = + 'assets/illustration/token/il_tokens_opacity.svg'; + final String ilTokensOpacityDark = + 'assets/illustration/token/il_tokens_opacity_dark.svg'; final String ilUnion = 'assets/illustration/token/il_union.svg'; final String ilUnionDark = 'assets/illustration/token/il_union_dark.svg'; - final String ilTypography = 'assets/illustration/token/il_tokens_typography.svg'; - final String ilTypographyDark = 'assets/illustration/token/il_tokens_typography_dark.svg'; + final String ilTypography = + 'assets/illustration/token/il_tokens_typography.svg'; + final String ilTypographyDark = + 'assets/illustration/token/il_tokens_typography_dark.svg'; final String ilTokenBorder = 'assets/illustration/token/il_tokens_border.svg'; - final String ilTokenBorderDark = 'assets/illustration/token/il_tokens_border_dark.svg'; + final String ilTokenBorderDark = + 'assets/illustration/token/il_tokens_border_dark.svg'; // Components - final String ilTopAppBarAvatar = 'assets/common/component/il_top_app_bar_avatar.jpg'; - + final String ilTopAppBarAvatar = + 'assets/illustration/component/il_top_app_bar_avatar.jpg'; } class _Icons { const _Icons(); - String deviceSmartphone(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}communication/device/device-smartphone.svg'; - String functionalSocialAndEngagementContact(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}functional/social-and-engagement/contact.svg'; - String functionalSocialAndEngagementHeartEmpty(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}functional/social-and-engagement/heart-empty.svg'; - String functionalActionsDelete(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}functional/actions/delete.svg'; - String functionalActionsCopy(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}functional/actions/copy.svg'; - String functionalSettingsAndToolsUiLightMode(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}functional/settings-and-tools/ui-light-mode.svg'; - String functionalSettingsAndToolsUiDarkMode(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}functional/settings-and-tools/ui-dark-mode.svg'; - String functionalSettingsAndToolsThemeSystem(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}functional/settings-and-tools/theme-system.svg'; - String functionalStatusAndIndicatorsInfo(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}functional/status-and-indicators/info-fill.svg'; - String assistanceTipsAndTricks(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}communication/assistance/tips-and-tricks.svg'; - String functionalNavigationFilters(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}functional/navigation/filters.svg'; - String designTheme(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}communication/design/theme.svg'; - String designComponentAtom(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}communication/design/component-atom.svg'; - String designToken(ThemeController themeController) => '${themeController.getAssetsPath(themeController)}communication/design/design-token.svg'; + String deviceSmartphone(ThemeController themeController) => + '${themeController.getAssetsPath(themeController)}communication/device/device-smartphone.svg'; + String functionalSocialAndEngagementContact( + ThemeController themeController, + ) => + '${themeController.getAssetsPath(themeController)}functional/social-and-engagement/contact.svg'; + String functionalSocialAndEngagementHeartEmpty( + ThemeController themeController, + ) => + '${themeController.getAssetsPath(themeController)}functional/social-and-engagement/heart-empty.svg'; + String functionalActionsDelete(ThemeController themeController) => + '${themeController.getAssetsPath(themeController)}functional/actions/delete.svg'; + String functionalActionsCopy(ThemeController themeController) => + '${themeController.getAssetsPath(themeController)}functional/actions/copy.svg'; + String functionalSettingsAndToolsUiLightMode( + ThemeController themeController, + ) => + '${themeController.getAssetsPath(themeController)}functional/settings-and-tools/ui-light-mode.svg'; + String functionalSettingsAndToolsUiDarkMode( + ThemeController themeController, + ) => + '${themeController.getAssetsPath(themeController)}functional/settings-and-tools/ui-dark-mode.svg'; + String functionalSettingsAndToolsThemeSystem( + ThemeController themeController, + ) => + '${themeController.getAssetsPath(themeController)}functional/settings-and-tools/theme-system.svg'; + String functionalStatusAndIndicatorsInfo(ThemeController themeController) => + '${themeController.getAssetsPath(themeController)}functional/status-and-indicators/info-fill.svg'; + String assistanceTipsAndTricks(ThemeController themeController) => + '${themeController.getAssetsPath(themeController)}communication/assistance/tips-and-tricks.svg'; + String functionalNavigationFilters(ThemeController themeController) => + '${themeController.getAssetsPath(themeController)}functional/navigation/filters.svg'; + String designTheme(ThemeController themeController) => + '${themeController.getAssetsPath(themeController)}communication/design/theme.svg'; + String designComponentAtom(ThemeController themeController) => + '${themeController.getAssetsPath(themeController)}communication/design/component-atom.svg'; + String designToken(ThemeController themeController) => + '${themeController.getAssetsPath(themeController)}communication/design/design-token.svg'; } class _Fonts { diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 8bf83b3a0..f4fc9c62d 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -17,7 +17,7 @@ homepage: https://flutter.unified-design-system.orange.com # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.3.1+120 +version: 2.0.0+120 environment: sdk: ^3.9.0 @@ -52,23 +52,23 @@ dependencies: # URL Lancher. url_launcher: ^6.0.3 # Core - ouds_core: ^1.3.1 + ouds_core: ^2.0.0 # Global raw token - ouds_global_raw_tokens: ^1.3.1 + ouds_global_raw_tokens: ^2.0.0 # Orange Theme contract - ouds_theme_contract: ^1.3.1 + ouds_theme_contract: ^2.0.0 # Orange Theme - ouds_theme_orange: ^1.3.1 + ouds_theme_orange: ^2.0.0 # Orange Compact Theme - ouds_theme_orange_compact: ^1.3.1 + ouds_theme_orange_compact: ^2.0.0 # Sosh Theme - ouds_theme_sosh: ^1.3.1 + ouds_theme_sosh: ^2.0.0 # Wireframe Theme - ouds_theme_wireframe: ^1.3.1 + ouds_theme_wireframe: ^2.0.0 package_info_plus: ^8.3.1 # App Settings - app_settings: ^6.1.1 + app_settings: ^7.0.0 dev_dependencies: flutter_test: @@ -96,6 +96,7 @@ flutter: assets: - assets/ - assets/illustration/token/ + - assets/illustration/component/ - ./CHANGELOG.md - assets/orange/ - assets/orange/functional/ @@ -140,8 +141,6 @@ flutter: - assets/wireframe/communication/device/ - assets/wireframe/communication/assistance/ - - assets/common/component/ - fonts: - family: RobotoMono fonts: diff --git a/ouds_core/CHANGELOG.md b/ouds_core/CHANGELOG.md index c2d8a53be..397e1aa25 100644 --- a/ouds_core/CHANGELOG.md +++ b/ouds_core/CHANGELOG.md @@ -4,11 +4,44 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop) +## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/2.0.0...develop) ### Added ### Changed ### Fixed +## [2.0.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...2.0.0) - 2026-06-19 +### Added +### Changed +- [Library] Remove deprecated code and API ([#820](https://github.com/Orange-OpenSource/ouds-flutter/issues/820)) +- [Library] update `Pin code input` component to v1.3 ([#691](https://github.com/Orange-OpenSource/ouds-flutter/issues/691)) +- [Library] `tab bar component`, update the animation of the `selected tab indicator` ([#633](https://github.com/Orange-OpenSource/ouds-flutter/issues/633)) +- [Library] Update `ToolBar Top`, with Badge in Trailing Actions ([#642](https://github.com/Orange-OpenSource/ouds-flutter/issues/642)) +- [Library] update `alert message`, `switch`, `radio`, `checkbox`, `text input`, `pin code input`, `phone number input`, components to use rich text ([#782](https://github.com/Orange-OpenSource/ouds-flutter/issues/782)) +- [Library] Update text input component to v1.4 ([#692](https://github.com/Orange-OpenSource/ouds-flutter/issues/692)) +- [Library] update `Password input` component to v1.3 ([#689](https://github.com/Orange-OpenSource/ouds-flutter/issues/689)) +- [Library] `filter chip` and `suggestion chip` component update to v1.4 ([#688](https://github.com/Orange-OpenSource/ouds-flutter/issues/688)) +- [Library] update `badge` icon component to 1.3.0 ([#680](https://github.com/Orange-OpenSource/ouds-flutter/issues/680)) +- [Library] update library icons to use the one from v1.6 ([#661](https://github.com/Orange-OpenSource/ouds-flutter/issues/661)) +- [Library] deps downgrade dartdoc from to 8.3.3 to fix meta version ([#786](https://github.com/Orange-OpenSource/ouds-flutter/issues/786)) +- [Library] deps update dependency bump dartdoc to 9.0.4 ([#780](https://github.com/Orange-OpenSource/ouds-flutter/issues/780)) +- [Library] update `Phone number input` component to v1.3 ([#690](https://github.com/Orange-OpenSource/ouds-flutter/issues/690)) +- [Library] update `tag` component to v1.5 ([#694](https://github.com/Orange-OpenSource/ouds-flutter/issues/694)) +- [Library] update `input tag` component to v1.2 ([#695](https://github.com/Orange-OpenSource/ouds-flutter/issues/695)) +- [Library] update tokens 2.5.0 ([#778](https://github.com/Orange-OpenSource/ouds-flutter/issues/778)) +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) + +### Fixed +- [Library] `Pin code input` Issue with Delete Functionality in the PIN Field ([#791](https://github.com/Orange-OpenSource/ouds-flutter/issues/791)) +- [Library] `Pin code input` glitch when typing on keyboard ([#776](https://github.com/Orange-OpenSource/ouds-flutter/issues/776)) +- [Library] `Pin code input` Focus should not move automatically to the next field ([#649](https://github.com/Orange-OpenSource/ouds-flutter/issues/649)) +- [Library] `Pin code input` Remove the hint on the group of digits ([#628](https://github.com/Orange-OpenSource/ouds-flutter/issues/628)) +- [Library] `Bottom Bar` Inconsistent order of the accessible ([#625](https://github.com/Orange-OpenSource/ouds-flutter/issues/625)) +- [Library] `Bottom Bar` Overlap when zoom is activated ([#627](https://github.com/Orange-OpenSource/ouds-flutter/issues/627)) +- [Library] `Password input` Label is truncated when zoom is applied ([#600](https://github.com/Orange-OpenSource/ouds-flutter/issues/600)) +- [Library] `Filter chip` is not reached by keyboard focus or Switch Access focus ([#474](https://github.com/Orange-OpenSource/ouds-flutter/issues/474)) +- [Library] `Phone number input` Add a hint to explain how to interact with fields ([#571](https://github.com/Orange-OpenSource/ouds-flutter/issues/571)) +- [Library] `input tag` the whole component should have the role button ([#481](https://github.com/Orange-OpenSource/ouds-flutter/issues/481)) + ## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 ### Added ### Changed diff --git a/ouds_core/README.md b/ouds_core/README.md index e544ea5f0..b2006495e 100644 --- a/ouds_core/README.md +++ b/ouds_core/README.md @@ -32,7 +32,7 @@ It is intended to replace internal frameworks and the previous [ODS](https://git ## Tokens version -- **OUDS core token version**: 1.9.0. +- **OUDS core token version**: 1.10.0. ## Other OUDS Libraries @@ -56,15 +56,31 @@ It is intended to replace internal frameworks and the previous [ODS](https://git Alert Message - 1.1.0 + 1.1.1 + + + App Bar + 1.0.0 Badge 1.2.0 - Bar - 1.0.0 + Badge Count + 1.2.0 + + + Badge Icon + 1.3.0 + + + Bottom Sheet + 0.0.0 + + + Bullet List + 1.1.0 Button @@ -74,49 +90,61 @@ It is intended to replace internal frameworks and the previous [ODS](https://git Checkbox 2.4.0 - - Chip - 1.3.0 - Divider 1.0.0 + + Filter Chip + 1.4.0 + Inline Alert 1.0.0 + + Input Tag + 1.2.0 + Link 2.2.0 + + Navigation Bar + 1.0.0 + Password Input - 1.2.0 + 1.3.0 Phone Number Input - 1.2.0 + 1.3.0 Pin Code Input - 1.2.0 + 1.3.0 Radio Button 1.4.0 + + Suggestion Chip + 1.4.0 + Switch 1.5.0 Tag - 1.4.0 + 1.5.0 Text Input - 1.3.0 + 1.4.0 @@ -146,17 +174,17 @@ It is intended to replace internal frameworks and the previous [ODS](https://git ```yaml # Core - ouds_core: ^1.3.1 + ouds_core: ^2.0.0 # Orange Theme contract - ouds_theme_contract: ^1.3.1 + ouds_theme_contract: ^2.0.0 # Orange Theme - ouds_theme_orange: ^1.3.1 + ouds_theme_orange: ^2.0.0 # Orange Theme Compact - ouds_theme_orange_compact: ^1.3.1 + ouds_theme_orange_compact: ^2.0.0 # Sosh Theme - ouds_theme_sosh: ^1.3.1 + ouds_theme_sosh: ^2.0.0 # Wireframe Theme - ouds_theme_wireframe: ^1.3.1 + ouds_theme_wireframe: ^2.0.0 dependency_overrides: intl: ^0.20.2 @@ -166,7 +194,7 @@ dependency_overrides: ### Localization -To set up localization for the `ouds_core` library, you need to set the `OudsLocalizations.delegate` in the `localizationsDelegates` properties of the `MaterialApp`. +To set up localization for the `ouds_core` library, you need to set the `OudsLocalizations.delegate` in the `localizationsDelegates` properties of the `MaterialApp`. ### Implementation @@ -188,7 +216,7 @@ To set up localization for the `ouds_core` library, you need to set the `OudsLoc }, ); ``` -### Custom Implementation +### Custom Implementation To customize the Orange theme (e.g., apply rounded corners or adjust spacing), wrap the `OudsTheme` with `OudsThemeConfigModel`. @@ -309,4 +337,4 @@ this SDK does not require any device permission to work. ## Copyright and license Code released under the [MIT License](https://github.com/Orange-OpenSource/ouds-flutter/blob/develop/LICENSE). -For images and other assets, please [refer to the NOTICE.txt](https://github.com/Orange-OpenSource/ouds-flutter/blob/develop/NOTICE.txt). +For images and other assets, please [refer to the NOTICE.txt](https://github.com/Orange-OpenSource/ouds-flutter/blob/develop/NOTICE.txt). \ No newline at end of file diff --git a/ouds_core/lib/components/alert/ouds_alert_message.dart b/ouds_core/lib/components/alert/ouds_alert_message.dart index f4a532909..86d05921a 100644 --- a/ouds_core/lib/components/alert/ouds_alert_message.dart +++ b/ouds_core/lib/components/alert/ouds_alert_message.dart @@ -24,6 +24,7 @@ import 'package:ouds_core/components/common/OudsBorder.dart'; import 'package:ouds_core/components/common/ouds_icon_status.dart'; import 'package:ouds_core/components/link/ouds_link.dart'; import 'package:ouds_core/components/utilities/app_assets.dart'; +import 'package:ouds_core/components/utilities/markdown_span_builder.dart'; import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; @@ -84,24 +85,43 @@ class OudsAlertMessageActionLayout { /// - [label]: Label displayed in the alert message. Main message that should be short, clear, and readable at a glance. /// - [status]: The status of the alert message. Its background color and its icon color are based on this status. /// There are two types of statuses: -/// - Non-functional statuses [Neutral] or [Accent] used for informational or decorative alert messages. They +/// - Non-functional statuses [Neutral] or [Accent] used for informational or decorative alert messages. They /// provide context or highlight content without implying a specific state, system event, or user action. These alerts are not tied to UX patterns such as /// success, error, or warning, and may use contextual or brand-related icons to enhance recognition or storytelling. -/// - Functional statuses communicate specific system statuses, results, or user feedback: [Positive], [Warning], +/// - Functional statuses communicate specific system statuses, results, or user feedback: [Positive], [Warning], /// [Negative], [Info]. /// Each variant conveys a clear semantic meaning and must always be paired with its dedicated functional icon to ensure clarity and accessibility. /// Use functional alerts to inform user about state changes, confirmations, or issues that are directly connected to system logic or user actions. These /// messages carry functional meaning and help guide user response or acknowledgment. -/// - [description]: Optional supplementary text in an alert message. Use only when additional detail or guidance is needed beyond the label. It should remain -/// short, clear and scannable, helping the user to understand what happened and what he can do next. +/// +/// - [description]: Optional supplementary text displayed below the alert label. Use it only when additional context, guidance or next steps are needed. +/// The content should remain concise, clear and easy to scan. +/// Supports lightweight markdown rich text formatting: +/// - Strong text using `**bold**`, +/// - Underline bold text using `__**underline bold**__`, +/// - Hyperlinks using `[link](https://example.com)` +/// +/// - [onDescriptionLinkTapped]: Callback invoked when a link in the description is tapped. The URL of the link is passed as an argument. +/// The caller is responsible for handling link opening behavior +/// (for example with `url_launcher` or an in-app WebView). +/// +/// Example: +/// ```dart +/// onDescriptionLinkTapped: (link) async { +/// await launchUrl(Uri.parse(link)); +/// }, +/// ``` +/// /// - [onClose]: Callback invoked when the close button is clicked. If `null`, the close button is not displayed and the alert message remains visible until /// the context changes (e.g., the issue is resolved, the screen is refreshed). Otherwise, the alert message is dismissable and includes a close button, /// allowing the user to dismiss it when he has acknowledged the message. /// Some alerts must remain visible to ensure user is aware of important information; others can be closed to reduce visual clutter. /// - [actionLayout]: An optional action link to be displayed in the alert message. It can be used to trigger an action. -/// - [bulletList]: An optional list of bullet points to be displayed in the alert message following the label or the optional [description]. -/// Add this list when you need to highlight multiple points, such as service features, plan details, or next steps. Each bullet should be short and written -/// as a clear phrase or fragment — avoid long sentences or complex structures. +/// - [bulletList]: An optional list of bullet points displayed below the label or the optional [description]. +/// Use this list to highlight multiple items such as service features, plan details or next steps. +/// Each bullet should remain short, clear and easy to scan. Avoid long sentences or complex structures. +/// Supports lightweight inline markdown formatting for text emphasis : +/// - Strong text `**bold**`. /// /// ## Usage Example: /// @@ -121,6 +141,7 @@ class OudsAlertMessage extends StatefulWidget { required this.status, this.description, this.onClose, + this.onDescriptionLinkTapped, this.actionLayout, this.bulletList, }); @@ -137,6 +158,19 @@ class OudsAlertMessage extends StatefulWidget { /// A callback invoked when the close button is clicked. If `null`, the close button is not shown. final VoidCallback? onClose; + /// A callback invoked when a link in the description is tapped. + /// + /// The caller is responsible for handling link opening behavior + /// (for example with `url_launcher` or an in-app WebView). + /// + /// Example: + /// ```dart + /// onDescriptionLinkTapped: (link) async { + /// await launchUrl(Uri.parse(link)); + /// }, + /// ``` + final ValueChanged? onDescriptionLinkTapped; + /// An optional clickable link to trigger an action. final OudsAlertMessageActionLayout? actionLayout; @@ -182,16 +216,7 @@ class _OudsAlertMessageState extends State { // Optional description text. if (widget.description != null && widget.description!.isNotEmpty) ...[ SizedBox(height: alertTokens.spaceRowGap), - Text( - widget.description!, - style: theme.typographyTokens - .typeLabelDefaultMedium(context) - .copyWith( - color: alertMessageStatusModifier.getStatusTextColor( - widget.status, - ), - ), - ), + _buildDescription(context), ], // Optional bullet list. A gap is added only if the list is not empty. if (widget.bulletList != null && @@ -376,6 +401,27 @@ class _OudsAlertMessageState extends State { ); } + /// Builds the description text with support for bold and hyperlinks. + Widget _buildDescription(BuildContext context) { + final theme = OudsTheme.of(context); + final alertMessageStatusModifier = OudsAlertStatusModifier(context); + + final textStyle = theme.typographyTokens + .typeLabelDefaultMedium(context) + .copyWith( + color: alertMessageStatusModifier.getStatusTextColor(widget.status), + ); + + return Text.rich( + MarkdownSpanBuilder.buildRichText( + context, + widget.description ?? '', + baseStyle: textStyle, + onLinkTap: widget.onDescriptionLinkTapped, + ), + ); + } + /// Builds a single bullet list item for the alert message. /// /// This widget creates a row containing a bullet icon and a text label, @@ -387,7 +433,7 @@ class _OudsAlertMessageState extends State { ) { final theme = OudsTheme.of(context); final alertMessageStatusModifier = OudsAlertStatusModifier(context); - final maxTextWidth = theme.sizeScheme(context).maxWidthTypeLabelMedium; + final maxTextWidth = theme.sizeScheme(context).maxWidthLabelMedium; final textScaler = MediaQuery.textScalerOf(context); final double iconContainerWidth = textScaler.scale( theme.sizeScheme(context).iconWithLabelMediumSizeMedium, @@ -436,7 +482,9 @@ class _OudsAlertMessageState extends State { Flexible( child: ConstrainedBox( constraints: BoxConstraints(maxWidth: maxTextWidth), - child: Text(label, style: textStyle), + child: Text.rich( + MarkdownSpanBuilder.buildBoldOnly(label, baseStyle: textStyle), + ), ), ), ], diff --git a/ouds_core/lib/components/alert/ouds_inline_alert.dart b/ouds_core/lib/components/alert/ouds_inline_alert.dart index 4142ae47d..7c4fcab46 100644 --- a/ouds_core/lib/components/alert/ouds_inline_alert.dart +++ b/ouds_core/lib/components/alert/ouds_inline_alert.dart @@ -80,9 +80,7 @@ class _OudsInlineAlertState extends State { Expanded( child: Container( constraints: BoxConstraints( - maxWidth: theme - .sizeSemanticTokens - .maxWidthTypeLabelLargeMobile, // todo maxWidthTypeLabelLarge + maxWidth: theme.sizeScheme(context).maxWidthLabelLarge, ), child: Text( widget.label, diff --git a/ouds_core/lib/components/badge/internal/ouds_badge_size_modifier.dart b/ouds_core/lib/components/badge/internal/ouds_badge_size_modifier.dart index f0f6660c7..561c0d26b 100644 --- a/ouds_core/lib/components/badge/internal/ouds_badge_size_modifier.dart +++ b/ouds_core/lib/components/badge/internal/ouds_badge_size_modifier.dart @@ -15,8 +15,9 @@ library; import 'package:flutter/material.dart'; -import 'package:ouds_theme_contract/ouds_theme.dart'; import 'package:ouds_core/components/badge/ouds_badge.dart'; +import 'package:ouds_core/components/common/ouds_icon_status.dart'; +import 'package:ouds_theme_contract/ouds_theme.dart'; class OudsBadgeSizeModifier { final BuildContext context; @@ -40,4 +41,25 @@ class OudsBadgeSizeModifier { return theme.sizeMedium; } } + + double getBadgeIconOffsetsPadding( + OudsBadgeSize? size, + OudsIconStatus? status, + ) { + final badgeToken = OudsTheme.of(context).componentsTokens(context).badge; + if (!OudsIconStatus.functionalStatuses.contains(status.runtimeType)) { + switch (size) { + case OudsBadgeSize.xsmall: + return badgeToken.spaceInsetXsmall; + case OudsBadgeSize.small: + return badgeToken.spaceInsetSmall; + case OudsBadgeSize.medium: + case OudsBadgeSize.large: + return badgeToken.spaceInsetMediumLarge; + case null: + return badgeToken.sizeMedium; + } + } + return 0.0; + } } diff --git a/ouds_core/lib/components/badge/internal/ouds_badge_status_modifier.dart b/ouds_core/lib/components/badge/internal/ouds_badge_status_modifier.dart index 91e3ca455..821b07078 100644 --- a/ouds_core/lib/components/badge/internal/ouds_badge_status_modifier.dart +++ b/ouds_core/lib/components/badge/internal/ouds_badge_status_modifier.dart @@ -15,7 +15,6 @@ library; import 'package:flutter/material.dart'; -import 'package:ouds_core/components/badge/ouds_badge.dart'; import 'package:ouds_core/components/common/ouds_icon_status.dart'; import 'package:ouds_core/components/utilities/app_assets.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; @@ -27,70 +26,47 @@ class OudsBadgeStatusModifier { OudsBadgeStatusModifier(this.context); /// Returns the background color based on the badge status. - //deprecation remove: The param state will be removed after deprecation - Color? getStatusColor(OudsBadgeStatus? state, OudsIconStatus? status,bool isEnabled) { + Color? getStatusColor(OudsIconStatus? status, bool isEnabled, bool iconType) { final colorTheme = OudsTheme.of(context).colorScheme(context); if (!isEnabled) { - return colorTheme.actionDisabled; + return (iconType && + status is! Warning && + status is! Accent && + status is! Neutral) + ? Colors.transparent + : colorTheme.actionDisabled; } - //deprecation remove: will be removed after deprecation - if(state != null) { - switch (state) { - case OudsBadgeStatus.neutral: - return colorTheme.surfaceInverseHigh; - case OudsBadgeStatus.accent: - return colorTheme.surfaceStatusAccentEmphasized; - case OudsBadgeStatus.positive: - return colorTheme.surfaceStatusPositiveEmphasized; - case OudsBadgeStatus.info: - return colorTheme.surfaceStatusInfoEmphasized; - case OudsBadgeStatus.warning: - return colorTheme.surfaceStatusWarningEmphasized; - case OudsBadgeStatus.negative: - return colorTheme.surfaceStatusNegativeEmphasized; - } - }else{ - if(status != null){ - return switch (status) { - Neutral() => colorTheme.surfaceInverseHigh, - Accent() => colorTheme.surfaceStatusAccentEmphasized, - Positive() => colorTheme.surfaceStatusPositiveEmphasized, - Info() => colorTheme.surfaceStatusInfoEmphasized, - Warning() => colorTheme.surfaceStatusWarningEmphasized, - Negative() => colorTheme.surfaceStatusNegativeEmphasized, - }; - } + + if (iconType && + (status != null && + (OudsIconStatus.functionalStatuses.contains(status.runtimeType)))) { + return colorTheme.opacityTransparent; + } + + if (status != null) { + final iconTokens = OudsTheme.of(context).componentsTokens(context).icon; + + return switch (status) { + Neutral() => colorTheme.surfaceInverseHigh, + Accent() => colorTheme.surfaceStatusAccentEmphasized, + Positive() => colorTheme.surfaceStatusPositiveEmphasized, + Info() => colorTheme.surfaceStatusInfoEmphasized, + Warning() => iconTokens.colorContentStatusWarningExternalShape, + Negative() => colorTheme.surfaceStatusNegativeEmphasized, + }; } return null; } - /// Returns the text and icon color based on the badge status. - //deprecation remove: The param state will be removed after deprecation - Color getStatusTextAndIconColor(OudsBadgeStatus? state, OudsIconStatus? status, bool isEnabled) { + /// Returns the background color based on the badge status. + Color? getTextColor(OudsIconStatus? status, bool isEnabled) { final colorTheme = OudsTheme.of(context).colorScheme(context); if (!isEnabled) { return colorTheme.contentOnActionDisabled; } - - //deprecation remove: will be removed after deprecation - if(state != null) { - switch (state) { - case OudsBadgeStatus.neutral: - return colorTheme.contentInverse; - case OudsBadgeStatus.accent: - return colorTheme.contentOnStatusAccentEmphasized; - case OudsBadgeStatus.positive: - return colorTheme.contentOnStatusPositiveEmphasized; - case OudsBadgeStatus.info: - return colorTheme.contentOnStatusInfoEmphasized; - case OudsBadgeStatus.warning: - return colorTheme.contentOnStatusWarningEmphasized; - case OudsBadgeStatus.negative: - return colorTheme.contentOnStatusNegativeEmphasized; - } - }else if(status != null){ + if (status != null) { return switch (status) { Neutral() => colorTheme.contentInverse, Accent() => colorTheme.contentOnStatusAccentEmphasized, @@ -100,59 +76,65 @@ class OudsBadgeStatusModifier { Negative() => colorTheme.contentOnStatusNegativeEmphasized, }; } + return null; + } + + /// Returns the icon color based on the badge status. + Color getIconColor(OudsIconStatus? status, bool isEnabled) { + final colorTheme = OudsTheme.of(context).colorScheme(context); + + if (!isEnabled) { + if (!OudsIconStatus.functionalStatuses.contains(status.runtimeType)) { + return colorTheme.contentOnActionDisabled; + } else { + return colorTheme.actionDisabled; + } + } + if (status != null) { + final iconTokens = OudsTheme.of(context).componentsTokens(context).icon; + + return switch (status) { + Neutral() => colorTheme.contentInverse, + Accent() => colorTheme.contentOnStatusAccentEmphasized, + Positive() => colorTheme.contentStatusPositive, + Info() => colorTheme.contentStatusInfo, + Warning() => iconTokens.colorContentStatusWarningInternalShape, + Negative() => colorTheme.contentStatusNegative, + }; + } return Colors.black; } /// Return the icon based on badge status - //deprecation remove: The param state will be removed after deprecation - String? getIcon(OudsBadgeStatus? state, OudsIconStatus? status) { - - //deprecation remove: will be removed after deprecation - if(state != null) { - switch (state) { - case OudsBadgeStatus.positive: - return AppAssets.icons.componentAlertTickConfirmationFill; - case OudsBadgeStatus.info: - return AppAssets.icons.componentAlertInformationFill; - case OudsBadgeStatus.warning: - return AppAssets.icons.componentAlertWarningExternalShape; - case OudsBadgeStatus.negative: - return AppAssets.icons.componentAlertImportantFill; - case OudsBadgeStatus.neutral: - case OudsBadgeStatus.accent: - return null; - } - }else{ - // Handle the new 'iconStatus' API - if (status != null) { - return switch (status) { + String? getIcon(OudsIconStatus? status) { + if (status != null) { + return switch (status) { // For those statuses, the icon is fixed and defined here. - Positive() => AppAssets.icons.componentAlertTickConfirmationFill, - Info() => AppAssets.icons.componentAlertInformationFill, - Warning() => AppAssets.icons.componentAlertWarningExternalShape, - Negative() => AppAssets.icons.componentAlertImportantFill, + Positive() => AppAssets.icons.badgeIconTickConfirmationFill, + Info() => AppAssets.icons.badgeIconInfoFill, + Warning() => null, + Negative() => AppAssets.icons.badgeIconErrorFill, // For the other Accent and Neutral the icon should be defined by user - _ => null - }; - } + _ => null, + }; } return null; } /// Retrieve the asset name defined by user in iconStatus - String? getAssetsName(OudsIconStatus? status){ + String? getAssetsName(OudsIconStatus? status) { if (status == null) { return null; } // Extract the 'icon' property only from Neutral and Accent types. return switch (status) { - // If the type is Neutral or Accent, extract the 'icon' value into the 'assets' variable and return it. + // If the type is Neutral or Accent, extract the 'icon' value into the 'assets' variable and return it. Neutral(icon: final assets) => assets, Accent(icon: final assets) => assets, - // For all other status types (Positive, Info, etc.), return null - // as their icons are fixed and not user-defined. + // For all other status types (Positive, Info, etc.), return null + // as their icons are fixed and not user-defined. _ => null, }; } diff --git a/ouds_core/lib/components/badge/ouds_badge.dart b/ouds_core/lib/components/badge/ouds_badge.dart index bf37f668d..53249e372 100644 --- a/ouds_core/lib/components/badge/ouds_badge.dart +++ b/ouds_core/lib/components/badge/ouds_badge.dart @@ -19,53 +19,15 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:ouds_core/components/badge/internal/ouds_badge_size_modifier.dart'; import 'package:ouds_core/components/badge/internal/ouds_badge_status_modifier.dart'; import 'package:ouds_core/components/common/ouds_icon_status.dart'; +import 'package:ouds_core/components/utilities/app_assets.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; /// @nodoc /// this is an internal enum should not be exposed to the user -enum _OudsBadgeType { - icon, - count, - standard, -} - -/// The [OudsBadgeStatus] enum defines the visual importance of the badge within the UI. -@Deprecated('use OudsIconStatus subclasses (Neutral, Accent, Positive, Info, Warning, Negative). This type will be removed in the next major release.') -enum OudsBadgeStatus { - negative, - accent, - positive, - info, - warning, - neutral, -} - -/// @nodoc -// deprecation remove : this enum is added only to support the deprecated enum and will be removed after deprecation -extension OudsBadgeStatusConverter on OudsBadgeStatus { - /// Converts this simple status enum to the corresponding [OudsIconStatus] class instance. - /// - /// Note: For `Neutral` and `Accent`, this conversion does not carry over any - /// custom icon information, as the base enum does not store it. - OudsIconStatus toIconStatus() { - return switch (this) { - OudsBadgeStatus.neutral => Neutral(), - OudsBadgeStatus.accent => Accent(), - OudsBadgeStatus.positive => Positive(), - OudsBadgeStatus.warning => Warning(), - OudsBadgeStatus.negative => Negative(), - OudsBadgeStatus.info => Info(), - }; - } -} +enum _OudsBadgeType { icon, count, standard } /// The [OudsBadgeSize] enum defines the size of the badge within the UI. -enum OudsBadgeSize { - xsmall, - small, - medium, - large; -} +enum OudsBadgeSize { xsmall, small, medium, large } /// [OUDS Badge design guidelines](https://r.orange.fr/r/S-ouds-doc-badge) /// @@ -91,33 +53,8 @@ enum OudsBadgeSize { /// * `OudsBadge.icon`: Displays an icon within the badge. The icon is only /// visible for `medium` and `large` sizes. /// -/// This API replaces the previous generic constructor and deprecated status model. -/// -/// --- -/// ## Migration overview -/// -/// ### 1) Use named constructors -/// Replace the deprecated default constructor: -/// - `OudsBadge(...)` -/// with one of: -/// - `OudsBadge.standard(...)` -/// - `OudsBadge.count(...)` -/// - `OudsBadge.icon(...)` -/// -/// ### 2) Replace `OudsBadgeStatus` with `OudsIconStatus` -/// `OudsBadgeStatus` is deprecated and will be removed. -/// Use `OudsIconStatus` subclasses to define badge visual semantics. -/// -/// ### 3) Remove `icon` parameter -/// The `icon` parameter is deprecated and will be removed. -/// Icon selection must now be driven by `status` (`OudsIconStatus`): -/// - Functional statuses (`Positive`, `Info`, `Warning`, `Negative`) provide fixed icons. -/// - Contextual statuses (`Neutral`, `Accent`) can carry a custom icon asset. -/// -/// --- /// ## Status model /// -/// New `status` type: /// - [Neutral] (optional custom icon) /// - [Accent] (optional custom icon) /// - [Positive] (fixed functional icon) @@ -144,7 +81,6 @@ enum OudsBadgeSize { /// - [status] : The badge's status, influencing its color and style (e.g., negative, positive, warning). **Used by `OudsBadge.standard` and `OudsBadge.count`**. /// - [size] : The size of the badge, such as medium, large, etc., to fit various visual needs. /// - [label] : An optional text to display inside the badge, often used for numbers or status texts. **Used by `OudsBadge.count`** -/// - [icon] : An optional SVG asset name to display an icon within the badge, complementing or replacing the label. /// - [status] : The status of the badge. The background color of the badge and the icon color are based on this status. **Used by `OudsBadge.icon`** /// There are two types of status: /// - Non-functional statuses: [Neutral] or [Accent] @@ -207,36 +143,14 @@ enum OudsBadgeSize { /// ``` class OudsBadge extends StatefulWidget { - @Deprecated('Use status of type OudsIconStatus instead. This parameter will be removed in a future version.') - final OudsBadgeStatus? _deprecatedStatus; final OudsIconStatus? status; final OudsBadgeSize? size; final String? label; - @Deprecated('icon is now defined by status (OudsIconStatus). Use Accent(icon: ...) or Neutral(icon: ...) for custom icons.') - final String? icon; final Widget? child; final bool enabled; final String? semanticsLabel; final bool? _withIcon; - /// ⚠️ **DEPRECATED:** Use [OudsBadge.standard], [OudsBadge.icon], or [OudsBadge.count] constructors instead. - @Deprecated('Use named constructors for clarity: OudsBadge.standard() for standard type, OudsBadge.icon() for icon type, or OudsBadge.count() for count type.' - ' This constructor will be removed in a future version.') - const OudsBadge({ - super.key, - OudsBadgeStatus? status, - this.size = OudsBadgeSize.medium, - this.label, - @Deprecated( - 'icon is now defined by status (OudsIconStatus). Use Accent(icon: ...) or Neutral(icon: ...) for custom icons.') - this.icon, - this.child, - this.enabled = true, - this.semanticsLabel, - }) : _deprecatedStatus = status, - status = null, - _withIcon = null; - const OudsBadge.icon({ super.key, this.size = OudsBadgeSize.medium, @@ -245,10 +159,8 @@ class OudsBadge extends StatefulWidget { this.semanticsLabel, this.status, bool withIcon = true, - }) : label = null, - icon = null, - _deprecatedStatus = null, - _withIcon = withIcon; + }) : label = null, + _withIcon = withIcon; const OudsBadge.standard({ super.key, @@ -257,10 +169,8 @@ class OudsBadge extends StatefulWidget { this.enabled = true, this.semanticsLabel, this.status, - }) : label = null, - icon = null, - _deprecatedStatus = null, - _withIcon = false; + }) : label = null, + _withIcon = false; const OudsBadge.count({ super.key, @@ -270,18 +180,13 @@ class OudsBadge extends StatefulWidget { this.enabled = true, this.semanticsLabel, this.status, - }) : icon = null, - _deprecatedStatus = null, - _withIcon = false; + }) : _withIcon = false; @override State createState() => _OudsBadgeState(); } class _OudsBadgeState extends State { - OudsIconStatus? get _effectiveStatus => - widget.status ?? widget._deprecatedStatus?.toIconStatus(); - @override Widget build(BuildContext context) { Widget? badgeLabel; @@ -289,7 +194,7 @@ class _OudsBadgeState extends State { final badgeSizeModifier = OudsBadgeSizeModifier(context); final badge = OudsTheme.of(context).componentsTokens(context).badge; // Check for the icon property - final hasIcon = switch (_effectiveStatus) { + final hasIcon = switch (widget.status) { // If it's a Neutral or Accent type, check if its icon property is not null Neutral(icon: final assets) => assets != null, Accent(icon: final assets) => assets != null, @@ -304,8 +209,7 @@ class _OudsBadgeState extends State { badgeLabel = const SizedBox.shrink(); break; case _OudsBadgeType.icon: - //the param icon will be removed after deprecation - badgeLabel = _buildBadgeWithIcon(context, widget.icon); + badgeLabel = _buildBadgeWithIcon(context); break; case _OudsBadgeType.count: badgeLabel = _buildBadgeWithNumber(context); @@ -315,15 +219,21 @@ class _OudsBadgeState extends State { final scaledSize = textScaler.scale(badgeSizeModifier.getSize(widget.size)); return Container( - width: type == _OudsBadgeType.count || type == _OudsBadgeType.standard ? null : scaledSize, - height: type == _OudsBadgeType.count || type == _OudsBadgeType.standard ? null : scaledSize, + width: type == _OudsBadgeType.count || type == _OudsBadgeType.standard + ? null + : scaledSize, + height: type == _OudsBadgeType.count || type == _OudsBadgeType.standard + ? null + : scaledSize, constraints: BoxConstraints( minHeight: scaledSize, minWidth: scaledSize, - maxHeight: type == _OudsBadgeType.count || type == _OudsBadgeType.standard + maxHeight: + type == _OudsBadgeType.count || type == _OudsBadgeType.standard ? double.infinity : scaledSize, - maxWidth: type == _OudsBadgeType.count || type == _OudsBadgeType.standard + maxWidth: + type == _OudsBadgeType.count || type == _OudsBadgeType.standard ? double.infinity : scaledSize, ), @@ -336,29 +246,38 @@ class _OudsBadgeState extends State { alignment: widget.size == OudsBadgeSize.large ? AlignmentDirectional(5, -1.5) : widget.size == OudsBadgeSize.medium - ? AlignmentDirectional(2, -1.3) - : null, - padding: widget.size == OudsBadgeSize.large - ? EdgeInsets.only( - left: badge.spaceInset, right: badge.spaceInset) + ? AlignmentDirectional(2, -1.3) : null, + backgroundColor: badgeStatusModifier.getStatusColor( - widget._deprecatedStatus, _effectiveStatus, widget.enabled), + widget.status, + widget.enabled, + false, + ), child: widget.child, ) : Badge( - padding: widget.icon != null || hasIcon - ? EdgeInsets.only( - left: badge.spaceInset, right: badge.spaceInset) + padding: _OudsBadgeType.icon == type && hasIcon + ? EdgeInsetsDirectional.all( + badgeSizeModifier.getBadgeIconOffsetsPadding( + widget.size, + widget.status, + ), + ) : widget.size == OudsBadgeSize.large - ? EdgeInsets.only( - left: badge.spacePaddingInlineLarge, - right: badge.spacePaddingInlineLarge) - : EdgeInsets.only( - left: badge.spacePaddingInlineMedium, - right: badge.spacePaddingInlineMedium), + ? EdgeInsetsDirectional.only( + start: badge.spacePaddingInlineLarge, + end: badge.spacePaddingInlineLarge, + ) + : EdgeInsetsDirectional.only( + start: badge.spacePaddingInlineMedium, + end: badge.spacePaddingInlineMedium, + ), backgroundColor: badgeStatusModifier.getStatusColor( - widget._deprecatedStatus, _effectiveStatus, widget.enabled), + widget.status, + widget.enabled, + _OudsBadgeType.icon == type, + ), label: badgeLabel, child: widget.child, ), @@ -378,19 +297,21 @@ class _OudsBadgeState extends State { _formattedLabel(), style: widget.size == OudsBadgeSize.large ? theme.typographyTokens - .typeLabelDefaultMedium(context) - .copyWith( - color: badgeStatusModifier.getStatusTextAndIconColor( - widget._deprecatedStatus, - _effectiveStatus, - widget.enabled)) + .typeLabelDefaultMedium(context) + .copyWith( + color: badgeStatusModifier.getTextColor( + widget.status, + widget.enabled, + ), + ) : theme.typographyTokens - .typeLabelDefaultSmall(context) - .copyWith( - color: badgeStatusModifier.getStatusTextAndIconColor( - widget._deprecatedStatus, - _effectiveStatus, - widget.enabled)), + .typeLabelDefaultSmall(context) + .copyWith( + color: badgeStatusModifier.getTextColor( + widget.status, + widget.enabled, + ), + ), textAlign: TextAlign.center, ), ) @@ -398,39 +319,81 @@ class _OudsBadgeState extends State { } /// Static method to build icon from asset name - //deprecation remove: The param assetName will be removed after deprecation - Widget _buildBadgeWithIcon(BuildContext context, String? assetName) { + Widget _buildBadgeWithIcon(BuildContext context) { final badgeStatusModifier = OudsBadgeStatusModifier(context); // This gets the fixed icon for Positive, Negative, etc. - final fixedIcon = - badgeStatusModifier.getIcon(widget._deprecatedStatus, _effectiveStatus); + final fixedIcon = badgeStatusModifier.getIcon(widget.status); // This correctly gets the user-defined icon for Neutral and Accent - final userDefinedIcon = badgeStatusModifier.getAssetsName(_effectiveStatus); + final userDefinedIcon = badgeStatusModifier.getAssetsName(widget.status); // The logic correctly prioritizes which icon to use. - // The deprecated `assetName` is also included for backward compatibility. - final iconPath = fixedIcon ?? assetName ?? userDefinedIcon ?? ""; + final iconPath = fixedIcon ?? userDefinedIcon ?? ""; - // this condition is two eliminate the text when we are in XSmall or Small - return widget.size == OudsBadgeSize.large || - widget.size == OudsBadgeSize.medium - ? SizedBox.expand( - child: SvgPicture.asset( - excludeFromSemantics: true, - iconPath, - fit: BoxFit.contain, - package: - fixedIcon != null ? OudsTheme.of(context).packageName : null, - colorFilter: ColorFilter.mode( - badgeStatusModifier.getStatusTextAndIconColor( - widget._deprecatedStatus, _effectiveStatus, widget.enabled), - BlendMode.srcIn, + if (widget.status is Warning) { + final iconTokens = OudsTheme.of(context).componentsTokens(context).icon; + + return widget.enabled + ? Stack( + alignment: Alignment.center, + children: [ + // Background shape + SizedBox.expand( + child: SvgPicture.asset( + excludeFromSemantics: true, + fit: BoxFit.contain, + AppAssets.icons.badgeIconWarningExternalShape, + colorFilter: ColorFilter.mode( + iconTokens.colorContentStatusWarningExternalShape, + BlendMode.srcIn, + ), + package: OudsTheme.of(context).packageName, + ), + ), + // Foreground shape + SizedBox.expand( + child: SvgPicture.asset( + excludeFromSemantics: true, + fit: BoxFit.contain, + AppAssets.icons.badgeIconWarningInternalShape, + colorFilter: ColorFilter.mode( + iconTokens.colorContentStatusWarningInternalShape, + BlendMode.srcIn, + ), + package: OudsTheme.of(context).packageName, + ), + ), + ], + ) + : SizedBox.expand( + child: SvgPicture.asset( + excludeFromSemantics: true, + AppAssets.icons.badgeIconWarningInternalShape, + fit: BoxFit.contain, + package: OudsTheme.of(context).packageName, + colorFilter: ColorFilter.mode( + OudsTheme.of( + context, + ).colorScheme(context).contentOnActionDisabled, + BlendMode.srcIn, + ), ), - ), - ) - : Container(); + ); + } + + return SizedBox.expand( + child: SvgPicture.asset( + excludeFromSemantics: true, + iconPath, + fit: BoxFit.contain, + package: fixedIcon != null ? OudsTheme.of(context).packageName : null, + colorFilter: ColorFilter.mode( + badgeStatusModifier.getIconColor(widget.status, widget.enabled), + BlendMode.srcIn, + ), + ), + ); } /// Formats a numeric label, replacing values >= 100 with "+99" @@ -460,10 +423,11 @@ class _OudsBadgeState extends State { /// - [_OudsBadgeType.standard]: when neither icon nor label applies (fallback case). _OudsBadgeType get type { final isMediumOrLarge = - widget.size == OudsBadgeSize.medium || widget.size == OudsBadgeSize.large; + widget.size == OudsBadgeSize.medium || + widget.size == OudsBadgeSize.large; // Check for the icon property - final hasIcon = switch (_effectiveStatus) { + final hasIcon = switch (widget.status) { // If it's a Neutral or Accent type, check if its icon property is not null Neutral(icon: final assets) => assets != null, Accent(icon: final assets) => assets != null, @@ -473,8 +437,7 @@ class _OudsBadgeState extends State { null => false, }; - if (widget.icon != null || - (widget.icon == null && hasIcon && widget._withIcon == true)) { + if (hasIcon && widget._withIcon == true) { return _OudsBadgeType.icon; } else if (widget.label != null && isMediumOrLarge) { return _OudsBadgeType.count; diff --git a/ouds_core/lib/components/button/internal/ouds_button_utils.dart b/ouds_core/lib/components/button/internal/ouds_button_utils.dart index 448c0ea50..e5d522482 100644 --- a/ouds_core/lib/components/button/internal/ouds_button_utils.dart +++ b/ouds_core/lib/components/button/internal/ouds_button_utils.dart @@ -12,83 +12,104 @@ /// @nodoc library; + import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:ouds_core/components/badge/ouds_badge.dart'; -import 'package:ouds_core/components/button/ouds_button.dart'; import 'package:ouds_core/components/button/internal/ouds_button_control_state.dart'; import 'package:ouds_core/components/button/internal/ouds_button_icon_modifier.dart'; import 'package:ouds_core/components/button/internal/ouds_button_style_modifier.dart'; -import 'package:ouds_core/components/top_bar/ouds_top_appbar.dart'; +import 'package:ouds_core/components/button/ouds_button.dart'; +import 'package:ouds_core/components/common/ouds_icon_status.dart'; +import 'package:ouds_core/components/top_bar/ouds_top_bar.dart'; +import 'package:ouds_core/components/utilities/badge_border_utils.dart'; /// Builds an icon button with optional badge, wrapped with semantics for accessibility. /// /// This widget creates an IconButton styled according to the provided layout, appearance, /// and control state. It also integrates badge display if provided. /// - Widget buildIconBadgeButton( - BuildContext context, - OudsButtonLayout layout, - OudsButtonAppearance appearance, - OudsButtonControlState buttonState, - Function()? onPressed, - String? icon, - OudsTopAppBarActionBadge? badge, - String? package - ){ - - return MergeSemantics( - child: Semantics( - child: IconButton( - style: OudsButtonStyleModifier.buildButtonStyle( - context, appearance: appearance, layout: layout, buttonState: buttonState), - onPressed: onPressed , - icon: _buildIconWithBadge( - context, icon!, appearance, layout, - buttonState,badge, package), +Widget buildIconBadgeButton( + BuildContext context, + OudsButtonLayout layout, + OudsButtonAppearance appearance, + OudsButtonControlState buttonState, + Function()? onPressed, + String? icon, + OudsTopBarActionBadge? badge, + String? package, +) { + return MergeSemantics( + child: Semantics( + child: IconButton( + style: OudsButtonStyleModifier.buildButtonStyle( + context, + appearance: appearance, + layout: layout, + buttonState: buttonState, + ), + onPressed: onPressed, + icon: _buildIconWithBadge( + context, + icon!, + appearance, + layout, + buttonState, + badge, + package, ), ), - ); - } + ), + ); +} /// Builds an icon widget with an optional badge overlay. /// /// This function creates an SVG icon with specified size and color based on the control state /// and appearance. If a badge is provided, it overlays the icon with the badge. /// - Widget _buildIconWithBadge( - BuildContext context, - String assetName, - final OudsButtonAppearance appearance, - final OudsButtonLayout layout, - final OudsButtonControlState buttonState, - OudsTopAppBarActionBadge? badge, - String? package - ) { - - final widgetIcon = SvgPicture.asset( - excludeFromSemantics: true, - package: package, - assetName, - fit: BoxFit.contain, - matchTextDirection: true, - width: OudsButtonIconModifier.getIconSize(context, layout), - height: OudsButtonIconModifier.getIconSize(context, layout), - colorFilter: ColorFilter.mode( - OudsButtonIconModifier.getIconColor(context, buttonState, appearance), - BlendMode.srcIn, - ), - ); - - // Wrap icon with badge if provided - return badge != null - ? OudsBadge( - semanticsLabel: badge.contentDescription, - label: badge.count.toString(), - status: OudsBadgeStatus.negative, - size: badge.hasCount ? OudsBadgeSize.medium : OudsBadgeSize.xsmall, - child: widgetIcon - ) - : widgetIcon; +Widget _buildIconWithBadge( + BuildContext context, + String assetName, + final OudsButtonAppearance appearance, + final OudsButtonLayout layout, + final OudsButtonControlState buttonState, + OudsTopBarActionBadge? badge, + String? package, +) { + final widgetIcon = SvgPicture.asset( + excludeFromSemantics: true, + package: package, + assetName, + fit: BoxFit.contain, + matchTextDirection: true, + width: OudsButtonIconModifier.getIconSize(context, layout), + height: OudsButtonIconModifier.getIconSize(context, layout), + colorFilter: ColorFilter.mode( + OudsButtonIconModifier.getIconColor(context, buttonState, appearance), + BlendMode.srcIn, + ), + ); - } \ No newline at end of file + // Wrap icon with badge if provided + return badge != null + ? buildBadgeWithBorder( + context: context, + hasCount: badge.hasCount, + child: badge.hasCount + ? OudsBadge.count( + semanticsLabel: badge.contentDescription, + label: badge.count.toString(), + status: Negative(), + size: OudsBadgeSize.medium, + child: widgetIcon, + ) + : OudsBadge.standard( + semanticsLabel: badge.contentDescription, + status: Negative(), + size: OudsBadgeSize.xsmall, + child: widgetIcon, + ), + ) + : widgetIcon; +} diff --git a/ouds_core/lib/components/button/ouds_button.dart b/ouds_core/lib/components/button/ouds_button.dart index 419e96a9c..3685c7a86 100644 --- a/ouds_core/lib/components/button/ouds_button.dart +++ b/ouds_core/lib/components/button/ouds_button.dart @@ -23,7 +23,7 @@ import 'package:ouds_core/components/button/internal/ouds_button_loading_modifie import 'package:ouds_core/components/button/internal/ouds_button_style_modifier.dart'; import 'package:ouds_core/components/button/internal/ouds_button_utils.dart'; import 'package:ouds_core/components/common/OudsBorder.dart'; -import 'package:ouds_core/components/top_bar/ouds_top_appbar.dart'; +import 'package:ouds_core/components/top_bar/ouds_top_bar.dart'; import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; @@ -156,7 +156,7 @@ class OudsButton extends StatefulWidget { @internal Widget buildIconButtonWithBadge( BuildContext context, - OudsTopAppBarActionBadge? badge, + OudsTopBarActionBadge? badge, OudsButtonControlState buttonState, ) { return buildIconBadgeButton( diff --git a/ouds_core/lib/components/checkbox/ouds_checkbox_item.dart b/ouds_core/lib/components/checkbox/ouds_checkbox_item.dart index f2070e650..303973379 100644 --- a/ouds_core/lib/components/checkbox/ouds_checkbox_item.dart +++ b/ouds_core/lib/components/checkbox/ouds_checkbox_item.dart @@ -53,6 +53,9 @@ import 'package:ouds_core/components/control/ouds_control_item.dart'; /// - [constrainedMaxWidth]: When `true`, the item width is constrained to a maximum value defined by the design system. /// When `false`, no specific width constraint is applied, allowing the component to size itself or follow external modifiers. /// Defaults to `false`. +/// - [errorText]: Text shown below the checkbox item indicating an error state. Supports only strong text formatting using `**bold**`. +/// Rich text is supported only for error messages. +/// /// /// ### You can use [OudsCheckboxItem] component in your project, customizing parameters as needed : /// diff --git a/ouds_core/lib/components/chip/ouds_filter_chip.dart b/ouds_core/lib/components/chip/ouds_filter_chip.dart index 02869719b..c462e205a 100644 --- a/ouds_core/lib/components/chip/ouds_filter_chip.dart +++ b/ouds_core/lib/components/chip/ouds_filter_chip.dart @@ -12,6 +12,7 @@ /// {@category Chip} library; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_svg/svg.dart'; @@ -38,7 +39,7 @@ enum OudsChipStyle { defaultStyle, selected } /// /// [OUDS Chip design guidelines](https://r.orange.fr/r/S-ouds-doc-filter-chip) /// -/// **Reference design version : 1.3.0** +/// **Reference design version : 1.4.0** /// /// Filter chip is a UI element that allows to select or deselect an option within a series, and is commonly used to capture filtering decisions. /// Filter chip allows to filter content by being selected or deselected. It can be toggled "On" or "Off" to refine displayed results, @@ -219,110 +220,150 @@ class _OudsFilterChipState extends State { final borderTokens = OudsTheme.of(context).borderTokens; final l10n = OudsLocalizations.of(context); final enabled = widget.onSelected != null; - String semanticsLabel = - '${widget.selected == true ? l10n?.core_common_selected_a11y : l10n?.core_common_unselected_a11y},' - ' ${widget.label ?? ""}, ' - '${enabled && widget.selected == true - ? l10n?.core_filterChip_hint_unselected_a11y - : enabled && widget.selected == false - ? l10n?.core_filterChip_hint_selected_a11y - : ''}'; + + String? accessibilityHint; + + if (defaultTargetPlatform == TargetPlatform.iOS) { + accessibilityHint = enabled && widget.selected == true + ? l10n?.core_filterChip_hint_unselected_a11y + : enabled && widget.selected == false + ? l10n?.core_filterChip_hint_selected_a11y + : null; + } return Semantics( button: true, enabled: enabled, - label: semanticsLabel, - child: ExcludeSemantics( - child: Material( - color: Colors.transparent, - child: Container( - constraints: BoxConstraints( - minHeight: chipToken.sizeMinHeightInteractiveArea, - ), - child: InkWell( - focusNode: _focusNode, - canRequestFocus: isDisabled, - onTap: () { - updateSelectedData(); - }, - splashColor: Colors.transparent, - highlightColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - onHover: (hovering) { - setState(() { - if (!isDisabled) { - _isHovered = hovering; - } - }); - }, - onHighlightChanged: (highlighted) { - setState(() { - if (!isDisabled) { - _isSelected = highlighted; - _isPressed = highlighted; - } - }); - }, - child: Stack( - clipBehavior: Clip.none, - alignment: Alignment.center, - children: [ - // Border exterior - if (_isFocused) - Positioned( - top: borderTokens.widthFocus / 2, - bottom: borderTokens.widthFocus / 2, - left: -borderTokens.widthFocus / 2, - right: -borderTokens.widthFocus / 2, - child: Container( + label: widget.label, + selected: widget.selected, + hint: accessibilityHint, + child: Material( + color: Colors.transparent, + child: Container( + constraints: BoxConstraints( + minHeight: chipToken.sizeMinHeightInteractiveArea, + ), + child: InkWell( + focusNode: _focusNode, + onTap: isDisabled + ? null + : () { + updateSelectedData(); + }, + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + onHover: (hovering) { + setState(() { + if (!isDisabled) { + _isHovered = hovering; + } + }); + }, + onHighlightChanged: (highlighted) { + setState(() { + if (!isDisabled) { + _isSelected = highlighted; + _isPressed = highlighted; + } + }); + }, + child: _isFocused + ? Stack( + clipBehavior: Clip.none, + alignment: Alignment.center, + children: [ + // Border exterior + if (_isFocused) + Positioned( + top: borderTokens.widthFocus / 2, + bottom: borderTokens.widthFocus / 2, + left: -borderTokens.widthFocus / 2, + right: -borderTokens.widthFocus / 2, + child: Container( + decoration: BoxDecoration( + border: OudsBorder().borderAll( + color: OudsTheme.of( + context, + ).colorScheme(context).borderFocus, + width: borderTokens.widthFocus, + ), + borderRadius: BorderRadius.circular( + OudsTheme.of(context) + .componentsTokens(context) + .chip + .borderRadius + + OudsTheme.of( + context, + ).borderTokens.widthFocus, + ), + ), + ), + ), + + // Border interior + content + Container( decoration: BoxDecoration( border: OudsBorder().borderAll( - color: OudsTheme.of( - context, - ).colorScheme(context).borderFocus, - width: borderTokens.widthFocus, + color: _isFocused + ? OudsTheme.of( + context, + ).colorScheme(context).borderFocusInset + : Colors.transparent, + width: borderTokens.widthFocusInset, ), borderRadius: BorderRadius.circular( OudsTheme.of( - context, - ).componentsTokens(context).chip.borderRadius + - OudsTheme.of(context).borderTokens.widthFocus, + context, + ).componentsTokens(context).chip.borderRadius, ), ), + child: _buildLayout( + context, + chipBorderModifier, + chipIconColorModifier, + chipBgColorModifier, + chipTextColorModifier, + chipState, + isDisabled, + ), ), - ), - - // Border interior + content - Container( - decoration: BoxDecoration( - border: OudsBorder().borderAll( - color: _isFocused - ? OudsTheme.of( - context, - ).colorScheme(context).borderFocusInset - : Colors.transparent, - width: borderTokens.widthFocusInset, - ), - borderRadius: BorderRadius.circular( - OudsTheme.of( + ], + ) + : Stack( + clipBehavior: Clip.none, + alignment: Alignment.center, + children: [ + // Border interior + content + Container( + decoration: BoxDecoration( + border: OudsBorder().borderAll( + color: _isFocused + ? OudsTheme.of( + context, + ).colorScheme(context).borderFocusInset + : Colors.transparent, + width: borderTokens.widthFocusInset, + ), + borderRadius: BorderRadius.circular( + OudsTheme.of( + context, + ).componentsTokens(context).chip.borderRadius, + ), + ), + child: _buildLayout( context, - ).componentsTokens(context).chip.borderRadius, + chipBorderModifier, + chipIconColorModifier, + chipBgColorModifier, + chipTextColorModifier, + chipState, + isDisabled, + ), ), - ), - child: _buildLayout( - context, - chipBorderModifier, - chipIconColorModifier, - chipBgColorModifier, - chipTextColorModifier, - chipState, - isDisabled, - ), + ], ), - ], - ), - ), ), ), ), @@ -395,8 +436,12 @@ class _OudsFilterChipState extends State { AppAssets.icons.componentChipTick, package: OudsTheme.of(context).packageName, fit: BoxFit.contain, - width: chipToken.sizeIcon, - height: chipToken.sizeIcon, + width: MediaQuery.textScalerOf( + context, + ).scale(chipToken.sizeIcon), + height: MediaQuery.textScalerOf( + context, + ).scale(chipToken.sizeIcon), colorFilter: ColorFilter.mode( chipIconColorModifier.getTickColor( chipState, @@ -486,8 +531,12 @@ class _OudsFilterChipState extends State { child: SvgPicture.asset( AppAssets.icons.componentChipTick, package: OudsTheme.of(context).packageName, - width: chipToken.sizeIcon, - height: chipToken.sizeIcon, + width: MediaQuery.textScalerOf( + context, + ).scale(chipToken.sizeIcon), + height: MediaQuery.textScalerOf( + context, + ).scale(chipToken.sizeIcon), fit: BoxFit.contain, colorFilter: ColorFilter.mode( chipIconColorModifier.getTickColor( @@ -595,8 +644,12 @@ class _OudsFilterChipState extends State { if (widget.selected!) ...[ ExcludeSemantics( child: SvgPicture.asset( - width: chipToken.sizeIcon, - height: chipToken.sizeIcon, + width: MediaQuery.textScalerOf( + context, + ).scale(chipToken.sizeIcon), + height: MediaQuery.textScalerOf( + context, + ).scale(chipToken.sizeIcon), AppAssets.icons.componentChipTick, package: OudsTheme.of(context).packageName, fit: BoxFit.contain, diff --git a/ouds_core/lib/components/chip/ouds_suggestion_chip.dart b/ouds_core/lib/components/chip/ouds_suggestion_chip.dart index 457e4b5e6..f86992e2d 100644 --- a/ouds_core/lib/components/chip/ouds_suggestion_chip.dart +++ b/ouds_core/lib/components/chip/ouds_suggestion_chip.dart @@ -36,7 +36,7 @@ enum OudsChipStyle { defaultStyle, selected } /// /// [OUDS Chip design guidelines](https://r.orange.fr/r/S-ouds-doc-suggestion-chip) /// -/// **Reference design version : 1.3.0** +/// **Reference design version : 1.4.0** /// /// Suggestion chip is a UI element that allows to present recommended or predictive options /// based on user’s input or context, and is commonly used to capture filtering decisions. diff --git a/ouds_core/lib/components/circular_progress_indicator/ouds_circular_progress_indicator.dart b/ouds_core/lib/components/circular_progress_indicator/ouds_circular_progress_indicator.dart new file mode 100644 index 000000000..2a940f5e7 --- /dev/null +++ b/ouds_core/lib/components/circular_progress_indicator/ouds_circular_progress_indicator.dart @@ -0,0 +1,55 @@ +// Software Name: OUDS Flutter +// SPDX-FileCopyrightText: Copyright (c) Orange SA +// SPDX-License-Identifier: MIT +// +// This software is distributed under the MIT license, +// the text of which is available at https://opensource.org/license/MIT/ +// or see the "LICENSE" file for more details. +// +// Software description: Flutter library of reusable graphical components +// + +/// @nodoc +library; + +import 'package:flutter/material.dart'; +import 'package:ouds_theme_contract/ouds_theme.dart'; + +/// A temporary circular progress indicator component +/// used internally by several public components like text input. +class OudsCircularProgressIndicator extends StatelessWidget { + const OudsCircularProgressIndicator({ + super.key, + required this.color, + this.progress, + }); + + final Color color; + + /// If null => indeterminate loader + /// If not null => determinate loader + final double? progress; + + @override + Widget build(BuildContext context) { + final baseSize = OudsTheme.of( + context, + ).componentsTokens(context).button.sizeLoader; + + const double baseStrokeWidth = 3; + + return ExcludeSemantics( + child: SizedBox( + width: baseSize, + height: baseSize, + child: CircularProgressIndicator( + value: progress, + strokeWidth: baseStrokeWidth, + strokeCap: StrokeCap.square, + backgroundColor: Colors.transparent, + valueColor: AlwaysStoppedAnimation(color), + ), + ), + ); + } +} diff --git a/ouds_core/lib/components/common/ouds_icon_status.dart b/ouds_core/lib/components/common/ouds_icon_status.dart index f7e3f01b9..862a6d9da 100644 --- a/ouds_core/lib/components/common/ouds_icon_status.dart +++ b/ouds_core/lib/components/common/ouds_icon_status.dart @@ -59,9 +59,25 @@ import 'package:ouds_core/components/badge/ouds_badge.dart'; /// ``` /// sealed class OudsIconStatus { - const OudsIconStatus(); + /// A static list containing the types of all functional statuses. + /// + /// This can be used to easily check if a given status instance belongs + /// to the functional category (Positive, Info, Warning, Negative). + /// + /// ### Example + /// ```dart + /// final myStatus = Positive(); + /// final isFunctional = OudsIconStatus.functionalStatuses.contains(myStatus.runtimeType); + /// // isFunctional will be true + /// ``` + static const List functionalStatuses = [ + Positive, + Info, + Warning, + Negative, + ]; } /// A status for general-purpose labels where the icon is customizable. @@ -103,4 +119,4 @@ class Warning extends OudsIconStatus {} /// A status that draws attention to errors or critical information. /// /// This status uses a fixed, predefined icon from the design system. -class Negative extends OudsIconStatus {} \ No newline at end of file +class Negative extends OudsIconStatus {} diff --git a/ouds_core/lib/components/control/internal/modifier/ouds_control_indicator.dart b/ouds_core/lib/components/control/internal/modifier/ouds_control_indicator.dart index 9b32ff599..0aa9dee81 100644 --- a/ouds_core/lib/components/control/internal/modifier/ouds_control_indicator.dart +++ b/ouds_core/lib/components/control/internal/modifier/ouds_control_indicator.dart @@ -34,12 +34,17 @@ class OudsControlIndicatorModifier { /// Returns: The size of the indicator as a `double`. double getSizeIndicator(OudsControlItemType type, BuildContext context) { // Check if the type is not switchButton and is radio - if (type != OudsControlItemType.switchButton && type == OudsControlItemType.radio) { + if (type != OudsControlItemType.switchButton && + type == OudsControlItemType.radio) { // Return the size of the radio button indicator - return OudsTheme.of(context).componentsTokens(context).radioButton.sizeIndicator; + return OudsTheme.of( + context, + ).componentsTokens(context).controlItem.sizeControlIndicator; } else { // Return the size of the checkbox indicator - return OudsTheme.of(context).componentsTokens(context).checkbox.sizeIndicator; + return OudsTheme.of( + context, + ).componentsTokens(context).controlItem.sizeControlIndicator; } } } diff --git a/ouds_core/lib/components/control/ouds_control_item.dart b/ouds_core/lib/components/control/ouds_control_item.dart index 7fcc11461..cbadf598e 100644 --- a/ouds_core/lib/components/control/ouds_control_item.dart +++ b/ouds_core/lib/components/control/ouds_control_item.dart @@ -22,13 +22,13 @@ import 'package:ouds_core/components/control/internal/modifier/ouds_control_back import 'package:ouds_core/components/control/internal/modifier/ouds_control_border_modifier.dart'; import 'package:ouds_core/components/control/internal/modifier/ouds_control_indicator.dart'; import 'package:ouds_core/components/control/internal/modifier/ouds_control_text_modifier.dart'; +import 'package:ouds_core/components/control/internal/modifier/ouds_control_tick_modifier.dart'; import 'package:ouds_core/components/control/internal/ouds_control_state.dart'; import 'package:ouds_core/components/divider/ouds_divider.dart'; import 'package:ouds_core/components/utilities/app_assets.dart'; +import 'package:ouds_core/components/utilities/markdown_span_builder.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; -import 'internal/modifier/ouds_control_tick_modifier.dart'; - enum OudsControlItemType { switchButton, checkbox, radio } /// Refactor of controls for [Checkbox], [Switch], and [RadioButton]. @@ -178,7 +178,7 @@ class OudsControlItemState extends State { borderRadius: BorderRadius.circular(borderTokens.radiusNone), ), constraints: BoxConstraints( - minHeight: controlItemTokens.sizeMinHeight, + minHeight: controlItemTokens.sizeMinHeightDefault, minWidth: controlItemTokens.sizeMinWidth, maxWidth: widget.constrainedMaxWidth ? controlItemTokens.sizeMaxWidth @@ -263,18 +263,20 @@ class OudsControlItemState extends State { Padding( padding: EdgeInsetsDirectional.only( start: controlItemTokens.spacePaddingInline, - top: controlItemTokens.spacePaddingBlockTopErrorText, + top: controlItemTokens.spacePaddingBlockTopHelperText, end: controlItemTokens.spacePaddingInline, ), - child: Text( - widget.errorText ?? '', - style: OudsTheme.of(context).typographyTokens - .typeLabelDefaultMedium(context) - .copyWith( - color: controlItemTextModifier.getErrorMessageTextColor( - controlItemState, + child: Text.rich( + MarkdownSpanBuilder.buildBoldOnly( + widget.errorText ?? '', + baseStyle: OudsTheme.of(context).typographyTokens + .typeLabelDefaultMedium(context) + .copyWith( + color: controlItemTextModifier.getErrorMessageTextColor( + controlItemState, + ), ), - ), + ), ), ), ], @@ -470,6 +472,9 @@ class OudsControlItemState extends State { maxHeight: OudsTheme.of( context, ).componentsTokens(context).controlItem.sizeMaxHeightAssetsContainer, + minHeight: OudsTheme.of( + context, + ).componentsTokens(context).controlItem.sizeIcon, ), alignment: Alignment.center, child: SizedBox( diff --git a/ouds_core/lib/components/form_input/internal/ouds_form_input_decoration.dart b/ouds_core/lib/components/form_input/internal/ouds_form_input_decoration.dart index 3d6ccbe7c..1f9325ca2 100644 --- a/ouds_core/lib/components/form_input/internal/ouds_form_input_decoration.dart +++ b/ouds_core/lib/components/form_input/internal/ouds_form_input_decoration.dart @@ -10,7 +10,8 @@ * // Software description: Flutter library of reusable graphical components * // */ -/// @nodoc +/// {@category Text input} +/// {@category Phone number input} library; import 'dart:ui'; @@ -43,7 +44,7 @@ class OudsInputDecoration extends OudsFormInputDecoration { }); } -/// Configuration for decorating the [OudsformInput] widget. +/// Configuration for decorating the [OudsTextField] and [OudsPhoneNumberInput] widgets. /// /// Provides properties to customize labels, hints, icons, helper and error texts, /// loading states, and styling. @@ -52,8 +53,9 @@ class OudsInputDecoration extends OudsFormInputDecoration { /// /// - [labelText]: The main label text displayed above or inside the input field. /// -/// - [helperText]: Additional information displayed below the input, -/// often used to guide or assist the user. +/// - [helperText]: Additional information displayed below the input, often used to guide or assist the user. +/// Supports strong text formatting using `**bold**`. +/// Hyperlinks are not supported in helper text. Use the dedicated helper link component instead. /// /// - [hintText]: A short placeholder or hint shown inside the input when empty, /// describing the expected input. @@ -72,6 +74,7 @@ class OudsInputDecoration extends OudsFormInputDecoration { /// - [suffix]: A string displayed after the user's input, often used for units or context. /// /// - [errorText]: Text shown below the input indicating an error state or invalid input. +/// Supports strong text formatting using `**bold**`. /// /// - [loader]: When true, displays a loading indicator inside the input. /// diff --git a/ouds_core/lib/components/form_input/ouds_phone_number_input.dart b/ouds_core/lib/components/form_input/ouds_phone_number_input.dart index 197def7bb..cf083472d 100644 --- a/ouds_core/lib/components/form_input/ouds_phone_number_input.dart +++ b/ouds_core/lib/components/form_input/ouds_phone_number_input.dart @@ -28,7 +28,7 @@ import 'package:ouds_core/components/form_input/internal/modifier/ouds_form_inpu import 'package:ouds_core/components/form_input/internal/ouds_form_input_control_state.dart'; import 'package:ouds_core/components/form_input/internal/ouds_form_input_decoration.dart'; import 'package:ouds_core/components/utilities/app_assets.dart'; -import 'package:ouds_core/components/utilities/input_utils.dart'; +import 'package:ouds_core/components/utilities/markdown_span_builder.dart'; import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; import 'package:ouds_theme_contract/ouds_theme_contract.dart'; @@ -36,7 +36,7 @@ import 'package:ouds_theme_contract/theme/tokens/components/ouds_textInput_token /// [OUDS Text Input Design Guidelines](https://r.orange.fr/r/S-ouds-doc-phone-number-input) /// -/// **Reference design version : 1.3.0** +/// **Reference design version : 1.3.1** /// /// Phone number Input is a UI element that allows to capture and validate telephone numbers, in international format. /// Phone number Input integrates a country selector, allowing users to choose their country and automatically apply the corresponding dialing code (such as +33 for France). @@ -99,7 +99,7 @@ class OudsPhoneNumberInput extends StatefulWidget { final bool? enabled; final bool? readOnly; final TextInputType? keyboardType; - CountrySelector? countrySelector; + final CountrySelector? countrySelector; final OudsInputDecoration decoration; final void Function(String)? onEditingComplete; @@ -158,7 +158,7 @@ class _OudsPhoneNumberInputState extends State { final phoneUtil = PhoneNumberUtil.instance; int? maxLength; - /// Digits tapés par l'utilisateur + /// Digits tapped by user @override void initState() { super.initState(); @@ -260,15 +260,16 @@ class _OudsPhoneNumberInputState extends State { // Check if the input is currently showing an error final isError = widget.decoration.errorText != null; - final l10n = OudsLocalizations.of(context); - String? formattedNumber = ""; String limitedDigits = ""; + final l10n = OudsLocalizations.of(context); + //needed for accessibility final contentText = widget.controller?.text ?? ""; - final prefixText = contentText.isNotEmpty - ? "${(widget.countrySelector != null) ? widget.countrySelector?.selectedCountry?.prefix : widget.decoration.prefix ?? ""}" + + final suffixText = contentText.isNotEmpty + ? ", ${widget.decoration.suffix ?? ""}" : ""; final helperText = isError ? widget.decoration.errorText ?? "" @@ -282,23 +283,32 @@ class _OudsPhoneNumberInputState extends State { : isReadOnly ? l10n?.core_common_disabled_a11y ?? "" : ""; + final hintLabel = contentText.isEmpty + ? widget.decoration.hintText ?? "" + : ""; + + final prefixCountry = (widget.countrySelector != null) + ? widget.countrySelector?.selectedCountry?.prefix + : widget.decoration.prefix; + + final prefixSemantics = contentText.isNotEmpty ? prefixCountry : ""; // Build Semantics value final semanticsValue = [ - l10n?.core_phoneNumberInput_a11y, - prefixText, + l10n?.core_textInput_trait_a11y, + widget.decoration.labelText, + prefixSemantics, contentText, + suffixText, helperText, statusLabel, - contentText.isEmpty && !_isFocused ? l10n?.core_common_hint_a11y : null, + hintLabel, ].where((s) => s != null && s.isNotEmpty).join(", "); return Semantics( - label: l10n?.core_phoneNumberInput_a11y, + label: semanticsValue, + hint: l10n?.core_common_hint_a11y, value: isError ? l10n?.core_common_error_a11y : null, - //hint: widget.decoration.hintText ?? "", // if we want to display value in a11Y activate hint - focused: effectiveFocusNode != null, - focusable: true, child: ConstrainedBox( constraints: BoxConstraints( minWidth: textInput.sizeMinWidth, @@ -353,43 +363,20 @@ class _OudsPhoneNumberInputState extends State { /// Center block: main text input Flexible( fit: FlexFit.loose, - child: widget.readOnly == true - ? IgnorePointer( - child: Semantics( - label: semanticsValue, - focused: effectiveFocusNode != null, - focusable: true, - child: _buildTextField( - inputTextTextModifier, - state, - isError, - effectiveFocusNode, - theme, - context, - textInput, - effectiveIsFocused, - formattedNumber, - limitedDigits, - ), - ), - ) - : Semantics( - label: semanticsValue, - focused: effectiveFocusNode != null, - focusable: true, - child: _buildTextField( - inputTextTextModifier, - state, - isError, - effectiveFocusNode, - theme, - context, - textInput, - effectiveIsFocused, - formattedNumber, - limitedDigits, - ), - ), + child: ExcludeSemantics( + child: _buildTextField( + inputTextTextModifier, + state, + isError, + effectiveFocusNode, + theme, + context, + textInput, + effectiveIsFocused, + formattedNumber, + limitedDigits, + ), + ), ), /// Right block: suffix icon container @@ -446,7 +433,7 @@ class _OudsPhoneNumberInputState extends State { /// - Displays label text if provided, with height constraints and style. /// - Shows hint text if provided or if formattedNumber is available, styled accordingly. /// - Adds a prefix widget if prefix or country selector is present, styled appropriately. - /// - Ensures the text field is dense for compact layout. + /// - Ensures the text field is dense for a compact layout. TextField _buildTextField( OudsFormFieldsTextColorModifier inputTextTextModifier, OudsFormFieldsControlState state, @@ -465,11 +452,12 @@ class _OudsPhoneNumberInputState extends State { focusNode: effectiveFocusNode, keyboardType: widget.keyboardType, style: theme.typographyTokens - .typeLabelDefaultLarge(context) + .typeLabelModerateLarge(context) .copyWith( color: inputTextTextModifier.getTextLabelColor(state, isError), ), enabled: widget.enabled, + readOnly: widget.readOnly ?? false, inputFormatters: [ FilteringTextInputFormatter.digitsOnly, MaxDigitsFormatter( @@ -522,29 +510,13 @@ class _OudsPhoneNumberInputState extends State { // Label text widget, shown if labelText is provided label: widget.decoration.labelText != null - ? Container( - constraints: BoxConstraints( - maxHeight: textInput.sizeLabelMaxHeight, - ), - child: ExcludeSemantics( - child: Text( - maxLines: InputUtils.getLabelMaxLines( - hintText: widget.decoration.hintText, - controller: widget.controller, - isFocused: effectiveIsFocused, + ? Text( + widget.decoration.labelText ?? "", + style: theme.typographyTokens + .typeLabelDefaultLarge(context) + .copyWith( + color: inputTextTextModifier.getTextColor(state, isError), ), - overflow: TextOverflow.ellipsis, - widget.decoration.labelText ?? "", - style: theme.typographyTokens - .typeLabelDefaultLarge(context) - .copyWith( - color: inputTextTextModifier.getTextColor( - state, - isError, - ), - ), - ), - ), ) : null, @@ -725,19 +697,22 @@ class _OudsPhoneNumberInputState extends State { if (prefixToDisplay == null || prefixToDisplay.isEmpty) { return const SizedBox.shrink(); } - return Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - prefixToDisplay, - style: theme.typographyTokens - .typeLabelDefaultLarge(context) - .copyWith( - color: inputTextTextModifier.getSuffixPrefixTextColor(state), - ), - ), - SizedBox(width: textInput.spaceColumnGapInlineText), - ], + return ExcludeSemantics( + excluding: (widget.controller?.text ?? "").isEmpty, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + prefixToDisplay, + style: theme.typographyTokens + .typeLabelDefaultLarge(context) + .copyWith( + color: inputTextTextModifier.getSuffixPrefixTextColor(state), + ), + ), + SizedBox(width: textInput.spaceColumnGapInlineText), + ], + ), ); } @@ -776,13 +751,15 @@ class _OudsPhoneNumberInputState extends State { left: textInput.spacePaddingInlineDefault, right: textInput.spacePaddingInlineDefault, ), - child: Text( - text, - style: theme.typographyTokens - .typeLabelDefaultMedium(context) - .copyWith( - color: inputTextTextModifier.getHelperTextColor(state, isError), - ), + child: Text.rich( + MarkdownSpanBuilder.buildBoldOnly( + text, + baseStyle: theme.typographyTokens + .typeLabelDefaultMedium(context) + .copyWith( + color: inputTextTextModifier.getHelperTextColor(state, isError), + ), + ), ), ); } diff --git a/ouds_core/lib/components/form_input/ouds_text_input.dart b/ouds_core/lib/components/form_input/ouds_text_input.dart index f309eac24..6ea1e045d 100644 --- a/ouds_core/lib/components/form_input/ouds_text_input.dart +++ b/ouds_core/lib/components/form_input/ouds_text_input.dart @@ -15,6 +15,7 @@ library; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:ouds_core/components/button/ouds_button.dart'; +import 'package:ouds_core/components/circular_progress_indicator/ouds_circular_progress_indicator.dart'; import 'package:ouds_core/components/form_input/internal/modifier/ouds_form_input_background_modifier.dart'; import 'package:ouds_core/components/form_input/internal/modifier/ouds_form_input_border_modifier.dart'; import 'package:ouds_core/components/form_input/internal/modifier/ouds_form_input_foreground_modifier.dart'; @@ -24,6 +25,7 @@ import 'package:ouds_core/components/form_input/internal/ouds_form_input_decorat import 'package:ouds_core/components/link/ouds_link.dart'; import 'package:ouds_core/components/utilities/app_assets.dart'; import 'package:ouds_core/components/utilities/input_utils.dart'; +import 'package:ouds_core/components/utilities/markdown_span_builder.dart'; import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; import 'package:ouds_theme_contract/ouds_theme_contract.dart'; @@ -31,7 +33,7 @@ import 'package:ouds_theme_contract/theme/tokens/components/ouds_textInput_token /// [OUDS Text Input Design Guidelines](https://r.orange.fr/r/S-ouds-doc-text-input) /// -/// **Reference design version : 1.3.0** +/// **Reference design version : 1.4.0** /// /// Text input is a UI element that allows to enter, edit, or select single-line textual data. Text input is one of the most fundamental form elements used /// to capture user input such as names, emails, passwords, or search queries. It provides a visual and interactive affordance for text entry @@ -258,6 +260,9 @@ class _OudsTextInputState extends State { final hintLabel = contentText.isEmpty ? widget.decoration.hintText ?? "" : ""; + final loadingLabel = widget.decoration.loader == true + ? l10n?.core_common_loading_a11y + : ''; // Build Semantics value final semanticsValue = [ @@ -269,11 +274,12 @@ class _OudsTextInputState extends State { helperText, statusLabel, hintLabel, + loadingLabel, ].where((s) => s != null && s.isNotEmpty).join(", "); return Semantics( label: semanticsValue, - hint: l10n?.core_common_hint_a11y, + hint: widget.decoration.loader == true ? '' : l10n?.core_common_hint_a11y, value: isError ? l10n?.core_common_error_a11y : null, focused: effectiveFocusNode != null, focusable: true, @@ -493,7 +499,7 @@ class _OudsTextInputState extends State { controller: widget.controller, keyboardType: widget.keyboardType, style: theme.typographyTokens - .typeLabelDefaultLarge(context) + .typeLabelModerateLarge(context) .copyWith(color: inputTextTextModifier.getTextColor(state, isError)), enabled: widget.enabled, readOnly: widget.readOnly ?? false, @@ -524,7 +530,7 @@ class _OudsTextInputState extends State { border: InputBorder.none, // Label text widget, shown if labelText is provided label: widget.decoration.labelText != null - ? ConstrainedBox( + ? Container( constraints: BoxConstraints( maxHeight: textInput.sizeLabelMaxHeight, ), @@ -616,11 +622,12 @@ class _OudsTextInputState extends State { ), ), ), + SizedBox(width: textInput.spacePaddingInlineDefault), ], ) : null, isDense: true, - contentPadding: EdgeInsets.zero, + contentPadding: EdgeInsetsGeometry.zero, ), ); } @@ -660,13 +667,15 @@ class _OudsTextInputState extends State { left: textInput.spacePaddingInlineDefault, right: textInput.spacePaddingInlineDefault, ), - child: Text( - text, - style: theme.typographyTokens - .typeLabelDefaultMedium(context) - .copyWith( - color: inputTextTextModifier.getHelperTextColor(state, isError), - ), + child: Text.rich( + MarkdownSpanBuilder.buildBoldOnly( + text, + baseStyle: theme.typographyTokens + .typeLabelDefaultMedium(context) + .copyWith( + color: inputTextTextModifier.getHelperTextColor(state, isError), + ), + ), ), ); } @@ -680,8 +689,7 @@ class _OudsTextInputState extends State { /// Cases handled: /// /// 1. **Loader active** (`loader == true`): - /// - Displays a minimal hierarchy [OudsButton] in loading style. - /// - Uses `suffixIcon` if provided; otherwise, reserves space with an empty 24×24 box. + /// - Displays a circular loading indicator. /// /// 2. **Suffix icon provided** (`suffixIcon != null`): /// - Displays the suffix icon inside a minimal hierarchy [OudsButton]. @@ -703,6 +711,7 @@ class _OudsTextInputState extends State { ) { final theme = OudsTheme.of(context); final textInput = theme.componentsTokens(context).textInput; + final buttonTokens = theme.componentsTokens(context).button; final inputTextForegroundModifier = OudsFormFieldsForegroundColorModifier( context, ); @@ -715,15 +724,17 @@ class _OudsTextInputState extends State { SizedBox(width: textInput.spaceColumnGapDefault), ConstrainedBox( constraints: BoxConstraints( - minHeight: 0, - maxHeight: double.infinity, + minWidth: buttonTokens.sizeMinWidth, + minHeight: buttonTokens.sizeMinHeight, + maxHeight: buttonTokens.sizeMaxHeightIconOnly, ), - child: OudsButton( - icon: AppAssets.icons.functionalSocialAndEngagementHeartEmpty, - package: OudsTheme.of(context).packageName, - appearance: OudsButtonAppearance.minimal, - loader: Loader(progress: null), - onPressed: () {}, + child: Padding( + padding: EdgeInsetsGeometry.all(buttonTokens.spaceInsetIconOnly), + child: Center( + child: OudsCircularProgressIndicator( + color: theme.colorScheme(context).contentDefault, + ), + ), ), ), ], @@ -736,6 +747,7 @@ class _OudsTextInputState extends State { mainAxisSize: MainAxisSize.min, children: [ if (widget.decoration.errorText != null) ...[ + SizedBox(width: textInput.spaceColumnGapDefault), SvgPicture.asset( excludeFromSemantics: true, AppAssets.icons.componentAlertImportantFill, diff --git a/ouds_core/lib/components/form_input/password_input/ouds_password_input.dart b/ouds_core/lib/components/form_input/password_input/ouds_password_input.dart index 1bbdd7c02..4bbf0cb7e 100644 --- a/ouds_core/lib/components/form_input/password_input/ouds_password_input.dart +++ b/ouds_core/lib/components/form_input/password_input/ouds_password_input.dart @@ -22,7 +22,7 @@ import 'package:ouds_core/components/form_input/internal/modifier/ouds_form_inpu import 'package:ouds_core/components/form_input/internal/ouds_form_input_control_state.dart'; import 'package:ouds_core/components/form_input/password_input/ouds_password_input_decoration.dart'; import 'package:ouds_core/components/utilities/app_assets.dart'; -import 'package:ouds_core/components/utilities/input_utils.dart'; +import 'package:ouds_core/components/utilities/markdown_span_builder.dart'; import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; import 'package:ouds_theme_contract/ouds_theme_contract.dart'; @@ -242,64 +242,51 @@ class _OudsPasswordInputState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: textInput.sizeMinHeight, - child: DecoratedBox( - decoration: BoxDecoration( - // Background color based on current state and error presence - color: inputTextBackgroundModifier.getBackgroundColor( - state, - isError, - widget.decoration.outlined, - ), - - /// Bottom border styling; full border if style is not default - border: inputTextBorderModifier.getBorder( - state, - isError, - widget.decoration.outlined, - ), - - // Border radius if enabled in theme configuration - borderRadius: inputTextBorderModifier.getBorderRadius(context), + DecoratedBox( + decoration: BoxDecoration( + // Background color based on current state and error presence + color: inputTextBackgroundModifier.getBackgroundColor( + state, + isError, + widget.decoration.outlined, + ), + + /// Bottom border styling; full border if style is not default + border: inputTextBorderModifier.getBorder( + state, + isError, + widget.decoration.outlined, ), - child: Padding( - padding: EdgeInsetsGeometry.directional( - start: textInput.spacePaddingInlineDefault, - end: textInput.spacePaddingInlineTrailingAction, - top: textInput.spacePaddingBlockDefault, - bottom: textInput.spacePaddingBlockDefault, - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - /// Left block: prefix icon container - Container( - alignment: Alignment.center, - child: _buildPrefixIcon(context, state), - ), - /// Center block: main text input - Flexible( - fit: FlexFit.loose, - child: Semantics( - hint: helperText, - child: - widget.readOnly == true || - (widget.decoration.loader == true && _isTyping) - ? IgnorePointer( - child: _buildTextField( - inputTextTextModifier, - state, - isError, - effectiveFocusNode, - theme, - context, - textInput, - effectiveIsFocused, - ), - ) - : _buildTextField( + // Border radius if enabled in theme configuration + borderRadius: inputTextBorderModifier.getBorderRadius(context), + ), + child: Padding( + padding: EdgeInsetsGeometry.directional( + start: textInput.spacePaddingInlineDefault, + end: textInput.spacePaddingInlineTrailingAction, + top: textInput.spacePaddingBlockDefault, + bottom: textInput.spacePaddingBlockDefault, + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + /// Left block: prefix icon container + Container( + alignment: Alignment.center, + child: _buildPrefixIcon(context, state), + ), + + /// Center block: main text input + Flexible( + fit: FlexFit.loose, + child: Semantics( + hint: helperText, + child: + widget.readOnly == true || + (widget.decoration.loader == true && _isTyping) + ? IgnorePointer( + child: _buildTextField( inputTextTextModifier, state, isError, @@ -309,16 +296,26 @@ class _OudsPasswordInputState extends State { textInput, effectiveIsFocused, ), - ), + ) + : _buildTextField( + inputTextTextModifier, + state, + isError, + effectiveFocusNode, + theme, + context, + textInput, + effectiveIsFocused, + ), ), + ), - /// spacing between center container et suffic icon container - SizedBox(width: textInput.spaceColumnGapDefault), + /// spacing between center container et suffic icon container + SizedBox(width: textInput.spaceColumnGapDefault), - /// Right block: suffix icon container - _buildSuffixIcon(context, state), - ], - ), + /// Right block: suffix icon container + _buildSuffixIcon(context, state), + ], ), ), ), @@ -377,7 +374,7 @@ class _OudsPasswordInputState extends State { controller: widget.controller, keyboardType: widget.keyboardType, style: theme.typographyTokens - .typeLabelDefaultLarge(context) + .typeLabelModerateLarge(context) .copyWith( color: inputTextTextModifier.getTextLabelColor(state, isError), ), @@ -412,27 +409,14 @@ class _OudsPasswordInputState extends State { // Label text widget, shown if labelText is provided label: widget.decoration.labelText != null - ? Container( - constraints: BoxConstraints( - maxHeight: textInput.sizeLabelMaxHeight, - ), - child: Text( - maxLines: InputUtils.getLabelMaxLines( - hintText: widget.decoration.hintText, - controller: widget.controller, - isFocused: effectiveIsFocused, - ), - overflow: TextOverflow.ellipsis, - widget.decoration.labelText ?? "", - style: theme.typographyTokens - .typeLabelDefaultLarge(context) - .copyWith( - color: inputTextTextModifier.getTextColor( - state, - isError, - ), - ), - ), + ? Text( + widget.decoration.labelText ?? "", + overflow: TextOverflow.ellipsis, + style: theme.typographyTokens + .typeLabelDefaultLarge(context) + .copyWith( + color: inputTextTextModifier.getTextColor(state, isError), + ), ) : null, @@ -446,9 +430,8 @@ class _OudsPasswordInputState extends State { // Hint text widget, shown if hintText is provided hint: widget.decoration.hintText != null ? Text( - maxLines: 1, - overflow: TextOverflow.ellipsis, widget.decoration.hintText!, + overflow: TextOverflow.ellipsis, style: theme.typographyTokens .typeLabelDefaultLarge(context) .copyWith( @@ -524,13 +507,15 @@ class _OudsPasswordInputState extends State { left: textInput.spacePaddingInlineDefault, right: textInput.spacePaddingInlineDefault, ), - child: Text( - text, - style: theme.typographyTokens - .typeLabelDefaultMedium(context) - .copyWith( - color: inputTextTextModifier.getHelperTextColor(state, isError), - ), + child: Text.rich( + MarkdownSpanBuilder.buildBoldOnly( + text, + baseStyle: theme.typographyTokens + .typeLabelDefaultMedium(context) + .copyWith( + color: inputTextTextModifier.getHelperTextColor(state, isError), + ), + ), ), ); } diff --git a/ouds_core/lib/components/form_input/password_input/ouds_password_input_decoration.dart b/ouds_core/lib/components/form_input/password_input/ouds_password_input_decoration.dart index 26374a86f..238cca7a9 100644 --- a/ouds_core/lib/components/form_input/password_input/ouds_password_input_decoration.dart +++ b/ouds_core/lib/components/form_input/password_input/ouds_password_input_decoration.dart @@ -11,10 +11,10 @@ * // */ -/// @nodoc +/// {@category Password input} library; -/// Configuration for decorating the [OudsTextInput] widget. +/// Configuration for decorating the [OudsPasswordInput] widget. /// /// Provides properties to customize labels, hints, icons, helper and error texts, /// loading states, and styling. diff --git a/ouds_core/lib/components/navigation/internal/ouds_navigation_bar_a11y.dart b/ouds_core/lib/components/navigation/internal/ouds_navigation_bar_a11y.dart new file mode 100644 index 000000000..826eb1981 --- /dev/null +++ b/ouds_core/lib/components/navigation/internal/ouds_navigation_bar_a11y.dart @@ -0,0 +1,82 @@ +/* + * // Software Name: OUDS Flutter + * // SPDX-FileCopyrightText: Copyright (c) Orange SA + * // SPDX-License-Identifier: MIT + * // + * // This software is distributed under the MIT license, + * // the text of which is available at https://opensource.org/license/MIT/ + * // or see the "LICENSE" file for more details. + * // + * // Software description: Flutter library of reusable graphical components + * // + */ +/// @nodoc +library; + +import 'package:flutter/material.dart'; +import 'package:ouds_core/components/navigation/ouds_navigation_bar_item.dart'; + +// --- Text-scale cap ---------------------------------------------------------- +/// Maximum text-scale factor applied inside navigation bar items. +/// +/// Capped at 160 % to prevent icon/label/badge overlap at large accessibility +/// text sizes on iOS. +const double kNavBarMaxTextScale = 1.6; + +/// Returns a [TextScaler] capped at [kNavBarMaxTextScale]. +/// +/// Apply via a [MediaQuery] override so all descendants (labels, badges, +/// border ring) automatically respect the cap. +/// +/// ```dart +/// MediaQuery( +/// data: MediaQuery.of(context).copyWith( +/// textScaler: clampNavBarTextScaler(context), +/// ), +/// child: child, +/// ) +/// ``` +TextScaler clampNavBarTextScaler(BuildContext context) => + MediaQuery.textScalerOf(context).clamp(maxScaleFactor: kNavBarMaxTextScale); + +// --- Semantic label helpers -------------------------------------------------- + +/// Accessibility helper for OUDS navigation bar items. +/// +/// Builds the semantic labels announced by TalkBack (Android) and +/// VoiceOver (iOS) for each navigation destination. +/// +/// ### TalkBack reading order +/// +/// On Android with a badge, TalkBack announces: +/// +/// ``` +/// "Label, 1 notification, Tab 2 of 3" +/// ``` +/// +/// This relies on a `Semantics` node with the badge description placed **below** +/// `NavigationDestination` in the item's `Column`. Material's `IndexedSemantics` +/// appends the positional info automatically. +/// +/// > **Important**: the badge `Semantics` child must use `SizedBox(height: 1)`, +/// > not `SizedBox.shrink()`. A 0×0 rect causes Flutter to mark the node +/// > invisible and TalkBack will silently skip it. +/// +/// ```dart +/// OudsNavigationBarA11y.buildTabSemanticLabel('Home', badge); +/// // → 'Home' (no badge) +/// // → 'Home, 3 messages' (with badge) +/// ``` +abstract final class OudsNavigationBarA11y { + /// Builds the semantic label for a navigation tab. + /// + /// Returns [label] alone when [badge] is `null`, or + /// `"label, badge description"` when a badge is present. + static String buildTabSemanticLabel( + String label, + OudsNavigationBarItemBadge? badge, + ) { + if (badge == null) return label; + return '$label, ${badge.contentDescription}'; + } +} diff --git a/ouds_core/lib/components/navigation/internal/ouds_navigation_bar_indicator_animation.dart b/ouds_core/lib/components/navigation/internal/ouds_navigation_bar_indicator_animation.dart new file mode 100644 index 000000000..d557fe29c --- /dev/null +++ b/ouds_core/lib/components/navigation/internal/ouds_navigation_bar_indicator_animation.dart @@ -0,0 +1,220 @@ +/* + * // Software Name: OUDS Flutter + * // SPDX-FileCopyrightText: Copyright (c) Orange SA + * // SPDX-License-Identifier: MIT + * // + * // This software is distributed under the MIT license, + * // the text of which is available at https://opensource.org/license/MIT/ + * // or see the "LICENSE" file for more details. + * // + * // Software description: Flutter library of reusable graphical components + * // + */ + +/// @nodoc +library; + +import 'package:flutter/material.dart'; +import 'package:ouds_theme_contract/theme/tokens/components/ouds_bar_tokens.dart'; + +/// A custom painter for drawing an animated navigation bar indicator. +/// +/// The indicator expands from the center of the tab outwards to its edges, +/// creating a smooth animation effect when a tab becomes selected. +class _OudsIndicatorPainter extends CustomPainter { + /// The animation value (0.0 to 1.0) controlling the expansion from center. + final double animationValue; + + /// The color of the indicator line. + final Color color; + + /// The height (thickness) of the indicator line. + final double thickness; + + /// The width of the tab (used to determine expansion limits). + final double tabWidth; + + /// The border radius of the indicator. + final double borderRadius; + + _OudsIndicatorPainter({ + required this.animationValue, + required this.color, + required this.thickness, + required this.tabWidth, + required this.borderRadius, + }); + + @override + void paint(Canvas canvas, Size size) { + /// Calculate the expansion: starts from center and expands to edges + final centerX = tabWidth / 2; + final maxExpansion = tabWidth / 2; + final currentExpansion = maxExpansion * animationValue; + + /// Starting point (left edge) and ending point (right edge) of the indicator + final startX = centerX - currentExpansion; + final endX = centerX + currentExpansion; + final rectWidth = endX - startX; + + /// Only draw if width is positive + if (rectWidth > 0) { + final rect = Rect.fromLTWH(startX, 0, rectWidth, thickness); + final rrect = RRect.fromRectAndRadius( + rect, + Radius.circular(borderRadius), + ); + + final paint = Paint() + ..color = color + ..style = PaintingStyle.fill; + + canvas.drawRRect(rrect, paint); + } + } + + @override + bool shouldRepaint(covariant _OudsIndicatorPainter oldDelegate) { + return oldDelegate.animationValue != animationValue || + oldDelegate.color != color || + oldDelegate.thickness != thickness || + oldDelegate.tabWidth != tabWidth || + oldDelegate.borderRadius != borderRadius; + } +} + +/// A widget that renders an animated indicator with expansion from center animation. +/// +/// Supports an optional [externalController] to allow the parent widget to +/// control the animation lifecycle. This is required on iOS where +/// [CupertinoTabBar] rebuilds items from scratch on each tap, preventing +/// [didUpdateWidget] from being called. +class OudsAnimatedIndicator extends StatefulWidget { + /// Whether the indicator should be visible and animated. + final bool isSelected; + + /// The color of the indicator. + final Color color; + + /// The height (thickness) of the indicator line. + final double thickness; + + /// The width of the tab containing this indicator. + final double tabWidth; + + /// The border radius of the indicator. + final double borderRadius; + + /// The duration of the animation. + final Duration animationDuration; + + /// Optional external [AnimationController] managed by the parent widget. + /// + /// When provided, the widget uses this controller instead of creating its own. + /// This is necessary on iOS to survive tab rebuilds. + final AnimationController? externalController; + + const OudsAnimatedIndicator({ + super.key, + required this.isSelected, + required this.color, + required this.thickness, + required this.tabWidth, + required this.borderRadius, + this.animationDuration = const Duration(milliseconds: 240), + this.externalController, //240 Optional external controller for iOS + }); + + @override + State createState() => _OudsAnimatedIndicatorState(); +} + +class _OudsAnimatedIndicatorState extends State + with SingleTickerProviderStateMixin { + AnimationController? _internalController; + + /// Use external controller if provided, otherwise fallback to internal + AnimationController get _controller => + widget.externalController ?? _internalController!; + + @override + void initState() { + super.initState(); + + /// Only create internal controller if no external one is provided (Android) + if (widget.externalController == null) { + _internalController = AnimationController( + duration: widget.animationDuration, + vsync: this, + ); + + /// Animate from 0 to 1 on first render if selected (Android) + if (widget.isSelected) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (mounted) { + _internalController?.animateTo( + 1.0, + duration: widget.animationDuration, + curve: Curves.easeInOut, + ); + } + }); + } else { + _internalController?.value = 0.0; + } + } + } + + @override + void didUpdateWidget(covariant OudsAnimatedIndicator oldWidget) { + super.didUpdateWidget(oldWidget); + + /// Only handle animation here for Android (internal controller) + /// iOS animations are driven by the external controller in OudsTabBar + if (widget.externalController == null && + widget.isSelected != oldWidget.isSelected) { + _controller.animateTo( + widget.isSelected ? 1.0 : 0.0, + duration: widget.animationDuration, + curve: Curves.easeInOut, + ); + } + } + + @override + void dispose() { + /// Only dispose internal controller, never the external one + _internalController?.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return SizedBox( + height: widget.thickness, + width: widget.tabWidth, + child: AnimatedBuilder( + animation: _controller, + builder: (context, child) { + return CustomPaint( + painter: _OudsIndicatorPainter( + animationValue: _controller.value, + color: widget.color, + thickness: widget.thickness, + tabWidth: widget.tabWidth, + borderRadius: widget.borderRadius, + ), + ); + }, + ), + ); + } +} + +/// Extension to easily access indicator animation properties from bar tokens. +extension OudsBarTokensIndicatorExtension on OudsBarTokens { + /// Gets the animation duration for the indicator. + Duration getIndicatorAnimationDuration() { + return const Duration(milliseconds: 240); + } +} diff --git a/ouds_core/lib/components/navigation/internal/ouds_navigation_bar_status_modifier.dart b/ouds_core/lib/components/navigation/internal/ouds_navigation_bar_status_modifier.dart index 7413660c1..9e87df827 100644 --- a/ouds_core/lib/components/navigation/internal/ouds_navigation_bar_status_modifier.dart +++ b/ouds_core/lib/components/navigation/internal/ouds_navigation_bar_status_modifier.dart @@ -26,21 +26,32 @@ class OudsNavigationBarStatusModifier { /// Returns the content color (icon and label) for a navigation destination, /// based on its interaction [state] and whether it is [isSelected]. - Color getTextIconItemColor(OudsNavigationBarControlState state, [bool isSelected = false]) { + Color getTextIconItemColor( + OudsNavigationBarControlState state, [ + bool isSelected = false, + ]) { final barTheme = OudsTheme.of(context).componentsTokens(context).bar; + final colorTokens = OudsTheme.of(context).colorScheme(context).colorTokens; + switch (state) { case OudsNavigationBarControlState.enabled: return isSelected ? barTheme.colorContentSelectedEnabled : ThemeUtils.isDarkTheme(context) == false - ? barTheme.colorContentUnselectedEnabledLight - : barTheme.colorContentUnselectedEnabledDark; + ? colorTokens.contentColorTokens.contentMutedLight + : colorTokens.contentColorTokens.contentMutedDark; case OudsNavigationBarControlState.hovered: - return isSelected ? barTheme.colorContentSelectedHover : barTheme.colorContentUnselectedHover; + return isSelected + ? barTheme.colorContentSelectedHover + : barTheme.colorContentUnselectedHover; case OudsNavigationBarControlState.focused: - return isSelected ? barTheme.colorContentSelectedFocus : barTheme.colorContentUnselectedFocus; + return isSelected + ? barTheme.colorContentSelectedFocus + : barTheme.colorContentUnselectedFocus; case OudsNavigationBarControlState.pressed: - return isSelected ? barTheme.colorContentSelectedPressed : barTheme.colorContentUnselectedPressed; + return isSelected + ? barTheme.colorContentSelectedPressed + : barTheme.colorContentUnselectedPressed; } } @@ -49,18 +60,29 @@ class OudsNavigationBarStatusModifier { /// /// Note: in Material 3, `indicatorColor` paints the selected indicator behind the destination, /// while `overlayColor` is the transient pressed/hovered/focused overlay shown during interactions. - Color getMaterialIndicatorBarColor(OudsNavigationBarControlState state, [bool isSelected = false]) { + Color getMaterialIndicatorBarColor( + OudsNavigationBarControlState state, [ + bool isSelected = false, + ]) { final barTheme = OudsTheme.of(context).componentsTokens(context).bar; final oudsTheme = OudsTheme.of(context); switch (state) { case OudsNavigationBarControlState.enabled: - return isSelected ? barTheme.colorActiveIndicatorAndroidSelectedEnabled : oudsTheme.colorScheme(context).opacityTransparent; + return isSelected + ? barTheme.colorCurrentIndicatorAndroidSelectedEnabled + : barTheme.colorCurrentIndicatorAndroidUnselectedDisabled; case OudsNavigationBarControlState.hovered: - return isSelected ? barTheme.colorActiveIndicatorAndroidSelectedHover : barTheme.colorActiveIndicatorAndroidUnselectedHover; + return isSelected + ? barTheme.colorCurrentIndicatorAndroidSelectedHover + : barTheme.colorCurrentIndicatorAndroidUnselectedHover; case OudsNavigationBarControlState.focused: - return isSelected ? barTheme.colorActiveIndicatorAndroidSelectedFocus : barTheme.colorActiveIndicatorAndroidUnselectedFocus; + return isSelected + ? barTheme.colorCurrentIndicatorAndroidSelectedFocus + : barTheme.colorCurrentIndicatorAndroidUnselectedFocus; case OudsNavigationBarControlState.pressed: - return isSelected ? barTheme.colorActiveIndicatorAndroidSelectedPressed : barTheme.colorActiveIndicatorAndroidUnselectedPressed; + return isSelected + ? barTheme.colorCurrentIndicatorAndroidSelectedPressed + : barTheme.colorCurrentIndicatorAndroidUnselectedPressed; } } @@ -70,13 +92,21 @@ class OudsNavigationBarStatusModifier { final barTheme = OudsTheme.of(context).componentsTokens(context).bar; switch (state) { case OudsNavigationBarControlState.enabled: - return barTheme.colorActiveIndicatorCustomSelectedEnabled.withValues(alpha: barTheme.opacityActiveIndicatorCustom); + return barTheme.colorCurrentIndicatorCustomSelectedEnabled.withValues( + alpha: barTheme.opacityCurrentIndicatorCustom, + ); case OudsNavigationBarControlState.hovered: - return barTheme.colorActiveIndicatorCustomSelectedHover.withValues(alpha: barTheme.opacityActiveIndicatorCustom); + return barTheme.colorCurrentIndicatorCustomSelectedHover.withValues( + alpha: barTheme.opacityCurrentIndicatorCustom, + ); case OudsNavigationBarControlState.focused: - return barTheme.colorActiveIndicatorCustomSelectedFocus.withValues(alpha: barTheme.opacityActiveIndicatorCustom); + return barTheme.colorCurrentIndicatorCustomSelectedFocus.withValues( + alpha: barTheme.opacityCurrentIndicatorCustom, + ); case OudsNavigationBarControlState.pressed: - return barTheme.colorActiveIndicatorCustomSelectedPressed.withValues(alpha: barTheme.opacityActiveIndicatorCustom); + return barTheme.colorCurrentIndicatorCustomSelectedPressed.withValues( + alpha: barTheme.opacityCurrentIndicatorCustom, + ); } } } diff --git a/ouds_core/lib/components/navigation/ouds_navigation_bar.dart b/ouds_core/lib/components/navigation/ouds_navigation_bar.dart index 6db78d747..d80fa739c 100644 --- a/ouds_core/lib/components/navigation/ouds_navigation_bar.dart +++ b/ouds_core/lib/components/navigation/ouds_navigation_bar.dart @@ -126,7 +126,10 @@ class _OudsNavigationBarState extends State { @override void initState() { super.initState(); - _selectedIndex = widget.selectedIndex.clamp(0, widget.destinations.length - 1); + _selectedIndex = widget.selectedIndex.clamp( + 0, + widget.destinations.length - 1, + ); } /// Updates the selected index if [currentIndex] changes. @@ -134,16 +137,28 @@ class _OudsNavigationBarState extends State { void didUpdateWidget(covariant OudsNavigationBar oldWidget) { super.didUpdateWidget(oldWidget); if (widget.selectedIndex != oldWidget.selectedIndex) { - _selectedIndex = widget.selectedIndex.clamp(0, widget.destinations.length - 1); + _selectedIndex = widget.selectedIndex.clamp( + 0, + widget.destinations.length - 1, + ); } } /// Builds the navigation bar with dynamic label and icon colors and a custom indicator shape. @override Widget build(BuildContext context) { - final interactionModelHover = OudsInheritedInteractionModel.of(context, InteractionAspect.hover); - final interactionModelPressed = OudsInheritedInteractionModel.of(context, InteractionAspect.pressed); - final interactionModelFocused = OudsInheritedInteractionModel.of(context, InteractionAspect.focused); + final interactionModelHover = OudsInheritedInteractionModel.of( + context, + InteractionAspect.hover, + ); + final interactionModelPressed = OudsInheritedInteractionModel.of( + context, + InteractionAspect.pressed, + ); + final interactionModelFocused = OudsInheritedInteractionModel.of( + context, + InteractionAspect.focused, + ); final isHovered = interactionModelHover?.state.isHovered ?? false; final isPressed = interactionModelPressed?.state.isPressed ?? false; @@ -158,8 +173,12 @@ class _OudsNavigationBarState extends State { final barControlState = barStateDeterminer.determineControlState(); final navigationBarModifier = OudsNavigationBarStatusModifier(context); - final navigationBarBgModifier = OudsNavigationBarBackgroundColorModifier(context); - final navigationBarBorderModifier = OudsNavigationBarBorderModifier(context); + final navigationBarBgModifier = OudsNavigationBarBackgroundColorModifier( + context, + ); + final navigationBarBorderModifier = OudsNavigationBarBorderModifier( + context, + ); final safeIndex = _selectedIndex.clamp(0, widget.destinations.length - 1); @@ -180,28 +199,43 @@ class _OudsNavigationBarState extends State { ), // `overlayColor` is the transient ink overlay used for interaction feedback (pressed/hovered/focused), // resolved per destination via `WidgetState`. - overlayColor: WidgetStateProperty.resolveWith( - (states) { - final isSelected = states.contains(WidgetState.selected); - return navigationBarModifier.getMaterialIndicatorBarColor(barControlState, isSelected); - }, + overlayColor: WidgetStateProperty.resolveWith((states) { + final isSelected = states.contains(WidgetState.selected); + return navigationBarModifier.getMaterialIndicatorBarColor( + barControlState, + isSelected, + ); + }), + backgroundColor: navigationBarBgModifier.getBackgroundColor( + widget.translucent, ), - backgroundColor: navigationBarBgModifier.getBackgroundColor(widget.translucent), // Label text style resolved per destination via `WidgetState` (at minimum selected/unselected). - labelTextStyle: WidgetStateProperty.resolveWith( - (states) { - final isSelected = states.contains(WidgetState.selected); - return OudsTheme.of(context).typographyTokens.typeLabelDefaultMedium(context).copyWith( - color: navigationBarModifier.getTextIconItemColor(barControlState, isSelected), - ); - }, - ), + labelTextStyle: WidgetStateProperty.resolveWith(( + states, + ) { + final isSelected = states.contains(WidgetState.selected); + return TextStyle( + color: navigationBarModifier.getTextIconItemColor( + barControlState, + isSelected, + ), + overflow: TextOverflow.ellipsis, + fontFamily: OudsTheme.of(context).fontFamily, + ).copyWith(fontSize: 12); + }), destinations: List.generate( widget.destinations.length, (index) => widget.destinations[index].toNavigationDestination( context, barControlState, isSelected: index == safeIndex, + index: index, + total: widget.destinations.length, + onTap: () { + if (index == safeIndex) return; + setState(() => _selectedIndex = index); + widget.onDestinationSelected?.call(index); + }, ), ), onDestinationSelected: (index) { diff --git a/ouds_core/lib/components/navigation/ouds_navigation_bar_item.dart b/ouds_core/lib/components/navigation/ouds_navigation_bar_item.dart index 84dfebd0e..f9fd34391 100644 --- a/ouds_core/lib/components/navigation/ouds_navigation_bar_item.dart +++ b/ouds_core/lib/components/navigation/ouds_navigation_bar_item.dart @@ -17,44 +17,28 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:ouds_core/components/badge/ouds_badge.dart'; import 'package:ouds_core/components/common/ouds_icon_status.dart'; +import 'package:ouds_core/components/navigation/internal/ouds_navigation_bar_a11y.dart'; +import 'package:ouds_core/components/navigation/internal/ouds_navigation_bar_indicator_animation.dart'; import 'package:ouds_core/components/navigation/internal/ouds_navigation_bar_state.dart'; import 'package:ouds_core/components/navigation/internal/ouds_navigation_bar_status_modifier.dart'; +import 'package:ouds_core/components/utilities/badge_border_utils.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; import 'package:ouds_theme_contract/theme/tokens/components/ouds_bar_tokens.dart'; +/// A single destination in an OUDS bottom navigation component. /// -/// An OUDS navigation bar item. +/// Used by [OudsNavigationBar] (Material/Android) and [OudsTabBar] (iOS). +/// Each item has an icon, a label, and an optional badge. Visual appearance +/// adapts to the [OudsNavigationBarControlState] (enabled/hovered/pressed/focused). /// -/// An [OudsNavigationBarItem] represents a single destination displayed in an -/// OUDS bottom navigation component (e.g. [OudsNavigationBar] on Material, or -/// [OudsTabBar] on iOS). -/// -/// Each item consists of an icon, a label, and optionally a badge. -/// Visual appearance can vary depending on selection and the resolved -/// [OudsNavigationBarControlState] (enabled/hovered/pressed/focused). -/// -/// ### Parameters: -/// - [icon]: Asset path of the SVG icon to display. -/// - [label]: Text label of the item. -/// - [badge]: Optional [OudsNavigationBarItemBadge] displayed over the icon. -/// -/// ### Example usage: /// ```dart -/// OudsNavigationBarItem( -/// icon: 'assets/home.svg', -/// label: 'Home', -/// ); -/// ``` +/// OudsNavigationBarItem(icon: 'assets/home.svg', label: 'Home'); /// -/// With a badge: -/// ```dart +/// // With badge: /// OudsNavigationBarItem( /// icon: 'assets/home.svg', /// label: 'Home', -/// badge: OudsNavigationBarItemBadge( -/// contentDescription: 'Notifications', -/// count: 3, -/// ), +/// badge: OudsNavigationBarItemBadge(contentDescription: 'Notifications', count: 3), /// ); /// ``` class OudsNavigationBarItem { @@ -99,42 +83,56 @@ class OudsNavigationBarItem { excludeFromSemantics: true, assetName, fit: BoxFit.contain, - height: 26, //sizeIcon.iconDecorativeExtraSmall, - width: 26, //sizeIcon.iconDecorativeExtraSmall, + height: 26, + width: 26, colorFilter: ColorFilter.mode( - modifier.getTextIconItemColor( - controlState, - isSelected, - ), + modifier.getTextIconItemColor(controlState, isSelected), BlendMode.srcIn, ), ); - return badge != null - ? OudsBadge.count( - semanticsLabel: badge.contentDescription, - label: badge.count.toString(), - status: Negative(), - size: badge.hasCount ? OudsBadgeSize.medium : OudsBadgeSize.xsmall, - child: widgetIcon, - ) - : widgetIcon; + if (badge == null) return widgetIcon; + + return buildBadgeWithBorder( + context: context, + hasCount: badge.hasCount, + child: OudsBadge.count( + // The badge semantic label is handled by the parent Semantics node + // in toNavigationDestination to control the TalkBack reading order. + semanticsLabel: null, + label: badge.count.toString(), + status: Negative(), + size: badge.hasCount ? OudsBadgeSize.medium : OudsBadgeSize.xsmall, + child: widgetIcon, + ), + ); } - /// Builds the top indicator shown above the icon when the destination is selected. - Container _buildTopIndicatorBar(BuildContext context, OudsBarTokens bar, bool isSelected, OudsNavigationBarControlState controlState) { - final navigationBarStatusModifier = OudsNavigationBarStatusModifier(context); + /// Builds the top indicator shown above the icon. + /// + /// [index] is used to generate a unique [ValueKey] per item. + /// [externalController] is optional and used on iOS to survive tab rebuilds. + Widget _buildTopIndicatorBar( + BuildContext context, + OudsBarTokens bar, + bool isSelected, + OudsNavigationBarControlState controlState, + int index, { + AnimationController? externalController, // Optional for iOS + }) { + final navigationBarStatusModifier = OudsNavigationBarStatusModifier( + context, + ); - return Container( - height: bar.sizeHeightActiveIndicatorCustom, // thickness of the bar - width: bar.sizeWidthActiveIndicatorCustomTop, // width of the bar (adjust) - decoration: BoxDecoration( - color: isSelected ? navigationBarStatusModifier.getIndicatorBarColor(controlState) : Colors.transparent, - borderRadius: BorderRadius.horizontal( - left: Radius.circular(bar.borderRadiusActiveIndicatorCustomTop), - right: Radius.circular(bar.borderRadiusActiveIndicatorCustomTop), - ), - ), + return OudsAnimatedIndicator( + key: ValueKey('indicator_$index'), + isSelected: isSelected, + color: navigationBarStatusModifier.getIndicatorBarColor(controlState), + thickness: bar.sizeHeightCurrentIndicatorCustom, + tabWidth: bar.sizeWidthCurrentIndicatorCustomTop, + borderRadius: bar.borderRadiusCurrentIndicatorCustomTop, + animationDuration: const Duration(milliseconds: 300), + externalController: externalController, // Pass external controller ); } @@ -148,26 +146,66 @@ class OudsNavigationBarItem { /// - [controlState] drives icon/top-indicator colors according to the current /// OUDS navigation control state. /// - [isSelected] indicates whether this destination is currently selected. + /// - [index] zero-based position of this item in the navigation bar. + /// - [total] total number of destinations in the navigation bar. Column toNavigationDestination( BuildContext context, OudsNavigationBarControlState controlState, { required bool isSelected, + required int index, + required int total, + VoidCallback? onTap, }) { final modifier = OudsNavigationBarStatusModifier(context); final bar = OudsTheme.of(context).componentsTokens(context).bar; + // Builds the full TalkBack label: "Label[, badge], Tab X of Y" + final localizations = MaterialLocalizations.of(context); + final contentLabel = OudsNavigationBarA11y.buildTabSemanticLabel( + label, + badge, + ); + final fullSemanticLabel = + '$contentLabel, ${localizations.tabLabel(tabIndex: index + 1, tabCount: total)}'; + return Column( mainAxisSize: MainAxisSize.min, children: [ - // Top active indicator bar (optional visual indicator for selection) - _buildTopIndicatorBar(context, bar, isSelected, controlState), + // Android: no external controller, uses internal animation + _buildTopIndicatorBar(context, bar, isSelected, controlState, index), Flexible( - child: NavigationDestination( - label: label, - icon: _buildBadgeIconNavigationDestination(context, icon, modifier, controlState, badge, isSelected: isSelected), - selectedIcon: _buildBadgeIconNavigationDestination(context, icon, modifier, controlState, badge, isSelected: isSelected), + child: Semantics( + // Override NavigationDestination's internal semantics to enforce + // the correct reading order: "Label[, badge], Tab X of Y". + // onTap restores the activation action lost by ExcludeSemantics. + label: fullSemanticLabel, + selected: isSelected, + onTap: onTap, + child: ExcludeSemantics( + // Suppresses NavigationDestination's own semantic nodes, + // which would otherwise produce a wrong TalkBack reading order. + child: NavigationDestination( + label: label, + icon: _buildBadgeIconNavigationDestination( + context, + icon, + modifier, + controlState, + badge, + isSelected: isSelected, + ), + selectedIcon: _buildBadgeIconNavigationDestination( + context, + icon, + modifier, + controlState, + badge, + isSelected: isSelected, + ), + ), + ), ), - ) + ), ], ); } @@ -178,21 +216,49 @@ class OudsNavigationBarItem { /// [CupertinoTabBar] (iOS-style tab bar) and therefore expects a list of /// [BottomNavigationBarItem]. /// + /// Semantics for VoiceOver are intentionally **not** set here. + /// They are managed at the [OudsTabBar] level via a [Stack] overlay of + /// transparent [Semantics] widgets positioned over each tab item, so that + /// VoiceOver sees exactly one node per tab announcing: + /// "Label[, badge], Tab X of Y". + /// /// - [context] : BuildContext to access theme and layout. - /// - [controlState] to drive icon/top-indicator colors, + /// - [controlState] to drive icon/top-indicator colors. /// - [isSelected] for the destination selection state. - /// + /// - [index] zero-based position of this item in the tab bar. + /// - [externalController] optional [AnimationController] managed by the + /// parent [OudsTabBar] to survive tab rebuilds on iOS. BottomNavigationBarItem toBottomNavigationBarItem( BuildContext context, OudsNavigationBarControlState controlState, { required bool isSelected, + required int index, + AnimationController? externalController, }) { final modifier = OudsNavigationBarStatusModifier(context); + // Build the raw icon widget. + // All semantics are suppressed here — VoiceOver nodes are managed by + // the OudsTabBar Stack overlay to guarantee a single node per tab. + final iconWidget = ExcludeSemantics( + child: _buildBadgeIconBottomNavigationBarItem( + context, + icon, + modifier, + controlState, + badge, + isSelected: isSelected, + index: index, + externalController: externalController, + ), + ); + return BottomNavigationBarItem( + // Keep the real label for visual display under the icon. label: label, - icon: _buildBadgeIconBottomNavigationBarItem(context, icon, modifier, controlState, badge, isSelected: isSelected), - activeIcon: _buildBadgeIconBottomNavigationBarItem(context, icon, modifier, controlState, badge, isSelected: isSelected), + // All semantics suppressed — managed by OudsTabBar Stack overlay. + icon: iconWidget, + activeIcon: iconWidget, ); } @@ -218,63 +284,62 @@ class OudsNavigationBarItem { OudsNavigationBarControlState controlState, final OudsNavigationBarItemBadge? badge, { required bool isSelected, + required int index, + AnimationController? externalController, // Optional for iOS }) { final bar = OudsTheme.of(context).componentsTokens(context).bar; final widgetIcon = SvgPicture.asset( excludeFromSemantics: true, assetName, fit: BoxFit.contain, - height: 26, //sizeIcon.iconDecorativeExtraSmall, - width: 26, //sizeIcon.iconDecorativeExtraSmall, + height: 26, + width: 26, colorFilter: ColorFilter.mode( - modifier.getTextIconItemColor( - controlState, - isSelected, - ), + modifier.getTextIconItemColor(controlState, isSelected), BlendMode.srcIn, ), ); - return badge != null - ? Column( - children: [ - _buildTopIndicatorBar(context, bar, isSelected, controlState), - SizedBox( - height: 2, - ), - OudsBadge.count( - semanticsLabel: badge.contentDescription, + final children = [ + // iOS: pass external controller to survive rebuilds + _buildTopIndicatorBar( + context, + bar, + isSelected, + controlState, + index, + externalController: externalController, + ), + const SizedBox(height: 2), + badge != null + ? buildBadgeWithBorder( + context: context, + hasCount: badge.hasCount, + child: OudsBadge.count( + // All semantics suppressed — managed by OudsTabBar Stack overlay. + semanticsLabel: null, label: badge.count.toString(), status: Negative(), - size: badge.hasCount ? OudsBadgeSize.medium : OudsBadgeSize.xsmall, + size: badge.hasCount + ? OudsBadgeSize.medium + : OudsBadgeSize.xsmall, child: widgetIcon, ), - ], - ) - : Column( - children: [ - _buildTopIndicatorBar(context, bar, isSelected, controlState), - SizedBox( - height: 2, - ), - widgetIcon, - ], - ); + ) + : widgetIcon, + ]; + + return Column(children: children); } } -/// Represents an optional badge attached to a navigation item. +/// An optional badge attached to a navigation item. /// -/// Parameters: -/// - [contentDescription] : Semantic description for accessibility. -/// - [count] : Optional integer to display as badge count. +/// [contentDescription] is the semantic text announced by screen readers. +/// [count] is the optional numeric value displayed inside the badge. /// -/// Example usage: /// ```dart -/// OudsNavigationBarItemBadge( -/// contentDescription: 'Unread messages', -/// count: 5, -/// ); +/// OudsNavigationBarItemBadge(contentDescription: 'Unread messages', count: 5); /// ``` class OudsNavigationBarItemBadge { diff --git a/ouds_core/lib/components/navigation/ouds_tab_bar.dart b/ouds_core/lib/components/navigation/ouds_tab_bar.dart index e4da0117a..34f38e79c 100644 --- a/ouds_core/lib/components/navigation/ouds_tab_bar.dart +++ b/ouds_core/lib/components/navigation/ouds_tab_bar.dart @@ -16,6 +16,7 @@ library; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:ouds_core/components/control/internal/interaction/ouds_inherited_interaction_model.dart'; +import 'package:ouds_core/components/navigation/internal/ouds_navigation_bar_a11y.dart'; import 'package:ouds_core/components/navigation/internal/ouds_navigation_bar_background_modifier.dart'; import 'package:ouds_core/components/navigation/internal/ouds_navigation_bar_border_modifier.dart'; import 'package:ouds_core/components/navigation/internal/ouds_navigation_bar_state.dart'; @@ -85,7 +86,6 @@ import 'package:ouds_theme_contract/ouds_theme.dart'; /// ], /// selectedIndex: 0, /// translucent: false, -/// , /// onDestinationSelected: (index) { /// print('Selected item: $index'); /// }, @@ -104,7 +104,7 @@ class OudsTabBar extends StatefulWidget { /// Callback invoked when a navigation item is tapped. final ValueChanged? onTap; - /// Creates an OUDS Navigation Bar with configurable items, transparency, and callbacks. + /// Creates an OUDS Tab Bar with configurable items, transparency, and callbacks. const OudsTabBar({ super.key, required this.items, @@ -117,14 +117,30 @@ class OudsTabBar extends StatefulWidget { State createState() => _OudsTabBarState(); } -class _OudsTabBarState extends State { +class _OudsTabBarState extends State with TickerProviderStateMixin { + // TickerProviderStateMixin for multiple controllers + int _selectedIndex = 0; - /// Initializes the selected index from the widget's [currentIndex]. + /// One AnimationController per tab, managed by the parent to survive rebuilds. + late List _indicatorControllers; + @override void initState() { super.initState(); _selectedIndex = widget.currentIndex.clamp(0, widget.items.length - 1); + + /// Create one controller per tab with correct initial value. + _indicatorControllers = List.generate( + widget.items.length, + (index) => AnimationController( + duration: const Duration(milliseconds: 300), + vsync: this, + value: index == _selectedIndex + ? 1.0 + : 0.0, // No animation on first render + ), + ); } /// Updates the selected index if [currentIndex] changes. @@ -132,15 +148,56 @@ class _OudsTabBarState extends State { void didUpdateWidget(covariant OudsTabBar oldWidget) { super.didUpdateWidget(oldWidget); if (widget.currentIndex != oldWidget.currentIndex) { - _selectedIndex = widget.currentIndex.clamp(0, widget.items.length - 1); + _animateToIndex(widget.currentIndex.clamp(0, widget.items.length - 1)); + } + } + + /// Animates the indicator from the old selected tab to the new one. + void _animateToIndex(int newIndex) { + if (newIndex == _selectedIndex) return; + + // Animate out the previously selected tab + _indicatorControllers[_selectedIndex].animateTo( + 0.0, + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + ); + + // Animate in the newly selected tab + _indicatorControllers[newIndex].animateTo( + 1.0, + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + ); + + setState(() { + _selectedIndex = newIndex; + }); + } + + @override + void dispose() { + // Dispose all controllers + for (final controller in _indicatorControllers) { + controller.dispose(); } + super.dispose(); } @override Widget build(BuildContext context) { - final interactionModelHover = OudsInheritedInteractionModel.of(context, InteractionAspect.hover); - final interactionModelPressed = OudsInheritedInteractionModel.of(context, InteractionAspect.pressed); - final interactionModelFocused = OudsInheritedInteractionModel.of(context, InteractionAspect.focused); + final interactionModelHover = OudsInheritedInteractionModel.of( + context, + InteractionAspect.hover, + ); + final interactionModelPressed = OudsInheritedInteractionModel.of( + context, + InteractionAspect.pressed, + ); + final interactionModelFocused = OudsInheritedInteractionModel.of( + context, + InteractionAspect.focused, + ); final isHovered = interactionModelHover?.state.isHovered ?? false; final isPressed = interactionModelPressed?.state.isPressed ?? false; @@ -155,44 +212,124 @@ class _OudsTabBarState extends State { final barControlState = barStateDeterminer.determineControlState(); final navigationBarModifier = OudsNavigationBarStatusModifier(context); - final navigationBarBgModifier = OudsNavigationBarBackgroundColorModifier(context); - final navigationBarBorderModifier = OudsNavigationBarBorderModifier(context); + final navigationBarBgModifier = OudsNavigationBarBackgroundColorModifier( + context, + ); + final navigationBarBorderModifier = OudsNavigationBarBorderModifier( + context, + ); final safeIndex = _selectedIndex.clamp(0, widget.items.length - 1); + final total = widget.items.length; // Get the existing Cupertino theme to avoid overwriting other styles. final existingCupertinoTheme = CupertinoTheme.of(context); - return CupertinoTheme( - data: existingCupertinoTheme.copyWith( - textTheme: existingCupertinoTheme.textTheme.copyWith( - tabLabelTextStyle: OudsTheme.of(context).typographyTokens.typeBodyModerateMedium(context).copyWith( - fontSize: 10 - ), // Apply the custom text style. + // Pre-compute full VoiceOver labels for each tab. + // "Label[, badge], Tab X of Y" + final localizations = MaterialLocalizations.of(context); + final semanticLabels = List.generate(total, (index) { + final contentLabel = OudsNavigationBarA11y.buildTabSemanticLabel( + widget.items[index].label, + widget.items[index].badge, + ); + return '$contentLabel, ${localizations.tabLabel(tabIndex: index + 1, tabCount: total)}'; + }); + + // Cap text scale at 160 % to prevent icon / label / badge overlap at very + // large accessibility text sizes on iOS. + return MediaQuery( + data: MediaQuery.of( + context, + ).copyWith(textScaler: clampNavBarTextScaler(context)), + child: CupertinoTheme( + data: existingCupertinoTheme.copyWith( + textTheme: existingCupertinoTheme.textTheme.copyWith( + tabLabelTextStyle: TextStyle( + overflow: TextOverflow.ellipsis, + fontFamily: OudsTheme.of(context).fontFamily, + ).copyWith(fontSize: 10, fontWeight: FontWeight.w500), + ), ), - ), - child: ClipRect( - child: BackdropFilter( - filter: navigationBarBorderModifier.getBlurNavigationBar(), - child: CupertinoTabBar( - currentIndex: safeIndex, - activeColor: navigationBarModifier.getTextIconItemColor(barControlState, true), - inactiveColor: navigationBarModifier.getTextIconItemColor(barControlState, false), - border: navigationBarBorderModifier.getBorderNavigationBar(), - backgroundColor: navigationBarBgModifier.getBackgroundColor(widget.translucent), - items: List.generate( - widget.items.length, - (index) => widget.items[index].toBottomNavigationBarItem( - context, - barControlState, - isSelected: index == safeIndex, - ), + child: ClipRect( + child: BackdropFilter( + filter: navigationBarBorderModifier.getBlurNavigationBar(), + // Stack overlays transparent Semantics widgets on top of the + // CupertinoTabBar to provide a single VoiceOver node per tab. + // + // Why a Stack overlay? + // CupertinoTabBar creates its own semantic nodes (icon + label + // as separate nodes). There is no public API to suppress or + // replace them from outside. By wrapping the whole bar in an + // ExcludeSemantics and overlaying our own Semantics nodes, we + // guarantee VoiceOver sees exactly one node per tab with the + // correct label: "Label[, badge], Tab X of Y". + child: Stack( + children: [ + // Layer 1 — visual tab bar with all native semantics suppressed. + ExcludeSemantics( + child: CupertinoTabBar( + currentIndex: safeIndex, + activeColor: navigationBarModifier.getTextIconItemColor( + barControlState, + true, + ), + inactiveColor: navigationBarModifier.getTextIconItemColor( + barControlState, + false, + ), + border: navigationBarBorderModifier + .getBorderNavigationBar(), + backgroundColor: navigationBarBgModifier.getBackgroundColor( + widget.translucent, + ), + items: List.generate( + total, + (index) => widget.items[index].toBottomNavigationBarItem( + context, + barControlState, + isSelected: index == safeIndex, + index: index, + // Pass the external controller for iOS animation + externalController: _indicatorControllers[index], + ), + ), + onTap: (index) { + if (index == safeIndex) return; + _animateToIndex(index); // Trigger animation from parent + widget.onTap?.call(index); + }, + ), + ), + // Layer 2 — transparent Semantics overlay, one node per tab. + // + // Each node covers 1/N of the bar width and the full bar height. + // It is fully transparent (no visual output) and provides the + // single VoiceOver focus point for its tab. + Positioned.fill( + child: Row( + children: List.generate(total, (index) { + return Expanded( + child: Semantics( + // Full VoiceOver label: "Label[, badge], Tab X of Y". + label: semanticLabels[index], + // Marks the tab as selected for VoiceOver. + selected: index == safeIndex, + // Provides the tap/activation action for VoiceOver. + onTap: () { + if (index == safeIndex) return; + _animateToIndex(index); + widget.onTap?.call(index); + }, + // Transparent container — purely semantic, no visual output. + child: const SizedBox.expand(), + ), + ); + }), + ), + ), + ], ), - onTap: (index) { - if (index == safeIndex) return; - setState(() => _selectedIndex = index); - widget.onTap?.call(index); - }, ), ), ), diff --git a/ouds_core/lib/components/pin_code_input/digit_input/ouds_digit_input.dart b/ouds_core/lib/components/pin_code_input/digit_input/ouds_digit_input.dart index 6ac5a984d..6a338016f 100644 --- a/ouds_core/lib/components/pin_code_input/digit_input/ouds_digit_input.dart +++ b/ouds_core/lib/components/pin_code_input/digit_input/ouds_digit_input.dart @@ -10,10 +10,10 @@ * // Software description: Flutter library of reusable graphical components * // */ -/// @nodoc +/// {@category PIN code input} +library; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:ouds_core/components/form_input/internal/modifier/ouds_form_input_border_modifier.dart'; import 'package:ouds_core/components/pin_code_input/internal/modifier/ouds_pin_code_input_background_modifier.dart'; import 'package:ouds_core/components/pin_code_input/internal/modifier/ouds_pin_code_input_border_modifier.dart'; @@ -24,27 +24,20 @@ import 'package:ouds_theme_contract/ouds_theme.dart'; /// [OUDS Pin Code Input guidelines](https://unified-design-system.orange.com/472794e18/p/9767bc-pin-code-input-v1) /// -/// Configuration for decorating the [OudsDigitInput] widget. -/// -/// Provides properties to customize hints, error status, hidden password and styling. +/// Visual decoration configuration for each digit cell in an [OudsPinCodeInput]. /// /// Parameters: -/// -/// - [hintText]: A short placeholder or hint shown inside the input when empty. -/// -/// - [hiddenPassword]: Controls whether the characters entered in the pin code input should be displayed as plain text or hidden. -/// -/// - [isOutlined]: A boolean value that defines the visual style of the Pin Code Input. -/// Set to `false` for the default filled style used in standard form pages, -/// or `true` for the outlined variant, which provides a lighter appearance suitable for contextual or secondary use. -/// - [constrainedMaxWidth]: When `true`, the item width is constrained to a maximum value defined by the design system. -/// When `false`, no specific width constraint is applied, allowing the component to size itself or follow external modifiers. -/// Defaults to `false`. -/// - [keyboardType]: Soft keyboard requested when a digit cell is focused. Defaults to [OudsPinCodeInputKeyboardType.numeric]. -/// Use [OudsPinCodeInputKeyboardType.alphanumeric] to allow letters in addition to digits. +/// - [hintText]: Placeholder shown in an empty, unfocused cell (e.g. `"-"`). +/// - [hiddenPassword]: When `true` (default), filled cells show `●` instead of +/// the actual character. +/// - [isOutlined]: `false` (default) for a filled style, `true` for outlined. +/// - [constrainedMaxWidth]: When `true`, cells are capped to the design-token +/// maximum width. Defaults to `false`. +/// - [keyboardType]: Keyboard variant for the cells. Defaults to +/// [OudsPinCodeInputKeyboardType.numeric]. /// class OudsDigitInputDecoration { - final String? hintText; //placeholder + final String? hintText; final bool hiddenPassword; final bool isOutlined; final bool constrainedMaxWidth; @@ -59,213 +52,230 @@ class OudsDigitInputDecoration { }); } -// TODO: Add documentation URL once it is available +/// A purely visual widget that renders a single digit cell of a PIN code input. /// -/// A Digit Input refers to a single input box that accepts exactly one numeric character (0–9). -/// In the context of a PIN code or OTP, multiple digit inputs are placed side by side, -/// each holding one digit, to form the complete code. -/// -/// Parameters: -/// - [index]: The index of this digit input within the PIN code sequence. -/// - [isError]: The Error status indicates that the user input does not meet validation rules or expected formatting. -/// It provides immediate visual feedback, typically through a red border, error icon, and a clear, accessible error message positioned below the input -/// - [digitInputDecoration]: Defines the decoration of each digit input box [OudsDigitInputDecoration] -/// - [controller]: Controller for managing the text value of this digit. -/// - [focusNode]: Focus node to manage keyboard focus for this digit input. -/// - [isHovered]: Whether the digit input is currently hovered. -/// - [onChanged]: Callback triggered when the digit value changes. Provides the new value and the index of this digit. +/// Keyboard input is handled entirely by the parent [OudsPinCodeInput] via a +/// single hidden [TextField]; [displayValue] is simply passed down for rendering. /// +/// ## Visual states /// -/// ## You can use [OudsDigitInput] like this : +/// | Condition | Content shown | +/// |---|---| +/// | Not focused, empty | Hint placeholder | +/// | Not focused, filled | Value (`●` when `hiddenPassword` is `true`) | +/// | Focused, empty | Blinking cursor | +/// | Focused, filled — normal mode | Blinking cursor only | +/// | Focused, filled — accessibility mode | Value **+** blinking cursor | /// -/// This is the default style of the component. +/// The last row applies when [isAccessibilityActive] is `true`, giving +/// assistive-technology users a clear indicator that the cell is selected even +/// after it has been filled. /// +/// ## Example /// /// ```dart +/// // Typically created by OudsPinCodeInput — shown here for illustration. /// OudsDigitInput( -/// index: index, -/// isError: true, -/// hiddenPassword: widget.hiddenPassword, -/// digitInputDecoration: OudsDigitInputDecoration( -/// hintText: widget.hintText, -/// style: widget.style, -/// roundedCorner: widget.roundedCorner -/// ), -/// focusNode: _focusNodes[index], -/// isHovered: _isHovered[index], -/// controller: widget.controllers[index], -/// onChanged: (value, index) {}, -/// ) +/// index: 0, +/// isFocused: true, +/// displayValue: '3', +/// isAccessibilityActive: false, +/// digitInputDecoration: OudsDigitInputDecoration( +/// hintText: '-', +/// hiddenPassword: true, +/// ), +/// ) /// ``` /// +/// Parameters: +/// - [index]: Zero-based position of this cell in the PIN sequence. +/// - [isError]: When `true`, the cell adopts the error visual style. +/// - [isFocused]: Whether this cell is the currently active position. +/// - [displayValue]: Character to display; empty string when the cell is empty. +/// - [digitInputDecoration]: Decoration options (hint, masking, style, …). +/// class OudsDigitInput extends StatefulWidget { final int index; - late final bool isError; + final bool isError; final OudsDigitInputDecoration? digitInputDecoration; - final TextEditingController? controller; - final FocusNode? focusNode; - late final bool isHovered; - final void Function(String, int)? onChanged; - final OudsPinCodeInputLength length; - final VoidCallback? onBackspaceOnEmpty; - final VoidCallback? onPasteRequested; + final bool isFocused; + final String displayValue; - OudsDigitInput({ + const OudsDigitInput({ super.key, required this.index, this.isError = false, this.digitInputDecoration, - this.controller, - this.focusNode, - this.isHovered = false, - this.onChanged, - this.length = OudsPinCodeInputLength.six, - this.onBackspaceOnEmpty, - this.onPasteRequested, + this.isFocused = false, + this.displayValue = '', }); @override State createState() => _OudsDigitInputState(); } -class _OudsDigitInputState extends State { +class _OudsDigitInputState extends State + with SingleTickerProviderStateMixin { bool _isHovered = false; - late final FocusNode _keyboardFocusNode; + + /// Drives the blinking cursor animation (530 ms, repeating). + late final AnimationController _cursorBlink; @override void initState() { super.initState(); - _keyboardFocusNode = FocusNode(skipTraversal: true); // focus technique uniquement pour clavier + _cursorBlink = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 530), + ); + // Start blinking immediately if the cell is already focused. + if (widget.isFocused) { + _cursorBlink.repeat(reverse: true); + } + } + + @override + void didUpdateWidget(OudsDigitInput oldWidget) { + super.didUpdateWidget(oldWidget); + // Sync cursor animation with focus state. + if (widget.isFocused && !_cursorBlink.isAnimating) { + _cursorBlink.repeat(reverse: true); + } else if (!widget.isFocused && _cursorBlink.isAnimating) { + _cursorBlink.stop(); + _cursorBlink.value = 0; + } } @override void dispose() { - _keyboardFocusNode.dispose(); + _cursorBlink.dispose(); super.dispose(); } @override Widget build(BuildContext context) { - final pinCodeToken = OudsTheme.of(context).componentsTokens(context).pinCodeInput; - final textInputToken = OudsTheme.of(context).componentsTokens(context).textInput; - final pinCodeInputBackgroundModifier = OudsPinCodeInputBackgroundColorModifier(context); - final pinCodeInputBorderModifier = OudsPinCodeInputBorderModifier(context); - final textInputBorderModifier = OudsFormFieldsBorderModifier(context); - final pinCodeInputTextModifier = OudsPinCodeInputTextColorModifier(context); + final pinCodeToken = OudsTheme.of( + context, + ).componentsTokens(context).pinCodeInput; + final textInputToken = OudsTheme.of( + context, + ).componentsTokens(context).textInput; + final backgroundModifier = OudsPinCodeInputBackgroundColorModifier(context); + final borderModifier = OudsPinCodeInputBorderModifier(context); + final formBorderModifier = OudsFormFieldsBorderModifier(context); final theme = OudsTheme.of(context); - final isFocused = widget.focusNode?.hasFocus; + final cursorColorModifier = OudsPinCodeInputTextColorModifier(context); + + final isOutlined = widget.digitInputDecoration?.isOutlined ?? false; + final hiddenPassword = widget.digitInputDecoration?.hiddenPassword ?? true; final state = OudsPinCodeInputControlStateDeterminer( - isFocused: isFocused!, + isFocused: widget.isFocused, isHovered: _isHovered, ).determineControlState(); + // Show hint only when the cell is empty and not focused. + final showHint = widget.displayValue.isEmpty && !widget.isFocused; + + // Mask filled value with a bullet when hiddenPassword is enabled. + final displayText = widget.displayValue.isNotEmpty + ? (hiddenPassword ? '●' : widget.displayValue) + : ''; + + // Show cursor whenever the cell is focused. + final showCursor = widget.isFocused; + + // show value + cursor together on a focused filled + // cell + final showValueWithCursor = showCursor && widget.displayValue.isNotEmpty; + final cursorColor = cursorColorModifier.getPinCodeCursorColor( + widget.isError, + ); + final cursorHeight = theme.fontTokens.lineHeightLabelLarge; + + // Builds the animated blinking cursor. + Widget buildCursor() => AnimatedBuilder( + animation: _cursorBlink, + builder: (context, _) => Opacity( + opacity: _cursorBlink.value, + child: Container(width: 2, height: cursorHeight, color: cursorColor), + ), + ); + return ExcludeSemantics( - child: InkWell( - onHover: (hovering) { - if (!mounted) return; - setState(() { - _isHovered = hovering; - }); + child: MouseRegion( + onEnter: (_) { + if (mounted) setState(() => _isHovered = true); + }, + onExit: (_) { + if (mounted) setState(() => _isHovered = false); }, child: Container( height: textInputToken.sizeMinHeight, - constraints: BoxConstraints( - maxWidth: pinCodeToken.sizeMaxWidth, - minWidth: pinCodeToken.sizeMinWidth), - decoration: BoxDecoration( - color: pinCodeInputBackgroundModifier.getPinCodeBackgroundColor(state, widget.isError, widget.digitInputDecoration!.isOutlined), - border: pinCodeInputBorderModifier.getPinCodeBorder(state, widget.isError, widget.digitInputDecoration!.isOutlined), - borderRadius: textInputBorderModifier.getBorderRadius(context), + constraints: BoxConstraints( + maxWidth: pinCodeToken.sizeMaxWidth, + minWidth: pinCodeToken.sizeMinWidth, + ), + decoration: BoxDecoration( + color: backgroundModifier.getPinCodeBackgroundColor( + state, + widget.isError, + isOutlined, + ), + border: borderModifier.getPinCodeBorder( + state, + widget.isError, + isOutlined, ), - child: Center( - child: KeyboardListener( - focusNode: _keyboardFocusNode, - onKeyEvent: (KeyEvent event) { - if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.backspace) { - final text = widget.controller?.text ?? ''; - if (text.isEmpty && widget.index > 0) { - widget.onBackspaceOnEmpty?.call(); - } - } - }, - child: TextField( - cursorHeight: theme.fontTokens.lineHeightLabelLarge, - obscureText: widget.digitInputDecoration!.hiddenPassword, - obscuringCharacter: "●", - style: theme.typographyTokens.typeLabelDefaultLarge(context).copyWith( - color: theme.colorScheme(context).contentDefault, + borderRadius: formBorderModifier.getBorderRadius(context), + ), + child: Center( + child: showValueWithCursor + // Accessibility + focused + filled: value and cursor side-by-side. + ? Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + displayText, + style: theme.typographyTokens + .typeLabelDefaultLarge(context) + .copyWith( + color: theme.colorScheme(context).contentDefault, + ), + textAlign: TextAlign.center, + maxLines: 1, ), - cursorColor: pinCodeInputTextModifier.getPinCodeCursorColor(widget.isError), - controller: widget.controller, - focusNode: widget.focusNode, - keyboardType: widget.digitInputDecoration!.keyboardType == OudsPinCodeInputKeyboardType.numeric - ? TextInputType.number - : TextInputType.text, - inputFormatters: [ - // Let a full pasted code arrive intact in one cell so the - // parent's `_distributeCode` can spread it. Without this, - // Flutter's default `maxLength` behaviour would clip. - LengthLimitingTextInputFormatter(widget.length.digits), - if (widget.digitInputDecoration!.keyboardType == - OudsPinCodeInputKeyboardType.numeric) - FilteringTextInputFormatter.digitsOnly, - ], - // Long-press paste bypasses the TextField entirely: we - // rebuild the platform toolbar but swap the Paste action - // for the parent's clipboard-direct handler. - contextMenuBuilder: widget.onPasteRequested == null - ? null - : (context, editableTextState) { - final items = editableTextState - .contextMenuButtonItems - .map((item) { - if (item.type == - ContextMenuButtonType.paste) { - return ContextMenuButtonItem( - type: ContextMenuButtonType.paste, - onPressed: () { - editableTextState.hideToolbar(); - widget.onPasteRequested!(); - }, - ); - } - return item; - }) - .toList(); - return AdaptiveTextSelectionToolbar.buttonItems( - anchors: editableTextState.contextMenuAnchors, - buttonItems: items, - ); - }, - textAlign: TextAlign.center, - maxLines: 1, - buildCounter: (_, {required currentLength, required isFocused, required maxLength}) => null, // to hide the counter - decoration: InputDecoration( - border: InputBorder.none, - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - contentPadding: EdgeInsets.zero, - counterText: '', - hintText: widget.digitInputDecoration?.hintText, - hintStyle: theme.typographyTokens.typeLabelDefaultLarge(context).copyWith( + buildCursor(), + ], + ) + // Focused: cursor only. + : showCursor + ? buildCursor() + // Not focused, empty: hint placeholder. + : showHint && widget.digitInputDecoration?.hintText != null + ? Text( + widget.digitInputDecoration!.hintText!, + style: theme.typographyTokens + .typeLabelDefaultLarge(context) + .copyWith( color: theme.colorScheme(context).contentMuted, - ), // remove internal padding + ), + textAlign: TextAlign.center, + maxLines: 1, + ) + // Not focused, filled: masked or plain value. + : Text( + displayText, + style: theme.typographyTokens + .typeLabelDefaultLarge(context) + .copyWith( + color: theme.colorScheme(context).contentDefault, + ), + textAlign: TextAlign.center, + maxLines: 1, ), - onChanged: (value) { - widget.onChanged!(value, widget.index); - setState(() {}); - }, - onTap: () { - //cursor should be always at the end of digit input - final text = widget.controller?.text; - widget.controller?.selection = TextSelection.fromPosition( - TextPosition(offset: text!.length), - ); - }, - ), - ), - ), + ), ), ), ); diff --git a/ouds_core/lib/components/pin_code_input/ouds_pin_code_input.dart b/ouds_core/lib/components/pin_code_input/ouds_pin_code_input.dart index 6386ad23f..b5b470228 100644 --- a/ouds_core/lib/components/pin_code_input/ouds_pin_code_input.dart +++ b/ouds_core/lib/components/pin_code_input/ouds_pin_code_input.dart @@ -14,18 +14,20 @@ library; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:ouds_core/components/pin_code_input/digit_input/ouds_digit_input.dart'; import 'package:ouds_core/components/pin_code_input/internal/modifier/ouds_pin_code_input_text_color_modifier.dart'; import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; -/// The [OudsPinCodeInputLength] defines the length of OudsPinCodeInput. +/// Number of digit cells in an [OudsPinCodeInput]: [four], [six] or [eight]. enum OudsPinCodeInputLength { four, six, eight; + /// Returns the actual number of digits for this variant. int get digits { switch (this) { case OudsPinCodeInputLength.four: @@ -40,12 +42,10 @@ enum OudsPinCodeInputLength { const OudsPinCodeInputLength(); } -/// The [OudsPinCodeInputKeyboardType] defines which soft keyboard the digit cells request. +/// Keyboard variant used by [OudsPinCodeInput]. /// -/// - [numeric]: numeric keyboard (digits 0–9 only). Non-digit input is filtered out, including paste. -/// - [alphanumeric]: standard text keyboard. Any character is accepted. -/// -/// Defaults to [numeric] to match the historical PIN behavior. +/// - [numeric]: digits-only keyboard; non-digit input is stripped automatically. +/// - [alphanumeric]: standard keyboard; any character is accepted. enum OudsPinCodeInputKeyboardType { numeric, alphanumeric; @@ -55,59 +55,61 @@ enum OudsPinCodeInputKeyboardType { /// [OUDS PIN Code Input Design Guidelines](https://r.orange.fr/r/S-ouds-doc-pin-code-input) /// -/// **Reference design version : 1.2.0** +/// **Reference design version : 1.3.0** /// -/// PIN code input is a UI element that allows to capture short, fixed-length numeric codes, -/// typically for authentication or confirmation purposes, such as a four, -/// six or height-digit personal identification number (PIN). +/// A fixed-length PIN code input composed of individual digit cells, typically +/// used for authentication or confirmation flows. /// -/// It is often presented as a series of individual input fields or boxes, each representing a single digit, -/// to enhance readability and encourage accurate input. +/// ## Architecture /// -/// This component must support smooth keyboard navigation (automatic focus shift, backspace handling), -/// secure input masking if needed. It is commonly used in sensitive flows like login, verification, -/// or transaction confirmation. +/// A single invisible [TextField] captures all keyboard input and holds the +/// full PIN string, keeping the soft keyboard open and stable across all cell +/// transitions. The visual cells ([OudsDigitInput]) are purely decorative. /// -/// Parameters: +/// ## Accessibility /// -/// - [length]: Defines the fixed number of digits required for the PIN code , Example [OudsPinCodeInputLength.six.value] -/// - [helperText] Supporting text conveys additional information about the input field, such as how it will be used. -/// eg. 'Enter the 4-digit code sent to your phone.'. -/// - [errorText]: Text shown below the input indicating an error state or invalid input. -/// - [controllers]: List of controllers managing the text of each digit input field. -/// - [onEditingComplete]: Callback triggered when the PIN input is completely filled. -/// Provides the concatenated PIN value as a string. -/// - [onChanged]: Callback triggered when the pin code value changes. Provides the new value of the pin code input. -/// - [digitInputDecoration]: Defines the decoration of each digit input box [OudsDigitInputDecoration] +/// When any platform accessibility feature is active (screen reader, bold text, +/// high contrast, reduced motion, …) the component switches to an +/// accessibility-friendly mode: +/// - **No automatic focus advance** — the user moves to the next cell manually. +/// - **Cell-by-cell deletion** — backspace clears only the selected cell. +/// - **Live regions disabled** — prevents the screen reader from jumping to +/// cells whose content changed after a keystroke. /// -/// ### You can use [OudsPinCodeInput] component in your project, customizing parameters as needed : +/// ## Example /// /// ```dart /// OudsPinCodeInput( -/// controllers: controllers, -/// helperText: "Please enter the 4-digit code sent to your phone.", -/// style: OudsTextInputStyle.defaultStyle, -/// length: OudsPinCodeInputLength.four, +/// length: OudsPinCodeInputLength.six, +/// helperText: 'Enter your 6-digit code', /// digitInputDecoration: OudsDigitInputDecoration( -/// hintText : "-", -/// roundedCorner: true, -/// style: OudsTextInputStyle.defaultStyle -/// ), -/// onEditingComplete: (value){}, -/// onChanged: (value){}, -/// ); +/// hintText: '-', +/// hiddenPassword: true, +/// ), +/// onChanged: (value) => print('Current PIN: $value'), +/// onEditingComplete: (value) => print('PIN complete: $value'), +/// ) /// ``` /// +/// Parameters: +/// - [length]: Number of digit cells. Defaults to [OudsPinCodeInputLength.six]. +/// - [helperText]: Supporting text shown below the input. +/// - [errorText]: Error message shown below the input; also sets the error state. +/// - [controllers]: Optional per-cell controllers for reading individual values. +/// - [onEditingComplete]: Called with the full PIN when all cells are filled. +/// - [onChanged]: Called with the current PIN on every keystroke. +/// - [digitInputDecoration]: Visual and keyboard configuration for the cells. +/// class OudsPinCodeInput extends StatefulWidget { final OudsPinCodeInputLength length; final String? helperText; - late String? errorText; + final String? errorText; final List? controllers; final void Function(String)? onEditingComplete; final void Function(String)? onChanged; final OudsDigitInputDecoration digitInputDecoration; - OudsPinCodeInput({ + const OudsPinCodeInput({ super.key, this.length = OudsPinCodeInputLength.six, this.helperText, @@ -122,73 +124,279 @@ class OudsPinCodeInput extends StatefulWidget { State createState() => _OudsPinCodeInputState(); } -class _OudsPinCodeInputState extends State { - final List _focusNodes = []; - late List _isHovered; - int currentIndex = 0; +class _OudsPinCodeInputState extends State + with WidgetsBindingObserver { + /// Holds the full PIN string typed by the user. + /// A single controller is shared across all cells so the soft keyboard + /// never resets between cell transitions. + late final TextEditingController _hiddenController; + + /// Focus node attached to the hidden [TextField]. + late final FocusNode _hiddenFocusNode; + + /// Whether the hidden [TextField] currently has keyboard focus. + bool _hasFocus = false; + + /// `true` once the user has typed at least one character. bool _hasEdited = false; - bool hasAnyFocus = false; - bool? _previousHasFocus; + + // Flag to prevent re-entrant updates when syncing from external controllers. + bool _updatingFromExternal = false; + + // ─── Lifecycle ─────────────────────────────────────────────────────────── @override void initState() { super.initState(); - _isHovered = List.filled(widget.length.digits, false); // init hover states - for (int i = 0; i < widget.length.digits; i++) { - final focusNode = FocusNode(); - focusNode.addListener(() => _handleFocusChange(focusNode, i)); - _focusNodes.add(focusNode); - } - FocusManager.instance.addListener(_onGlobalFocusChange); + WidgetsBinding.instance.addObserver(this); + + // Pre-fill the hidden controller if individual controllers were provided. + final initial = widget.controllers?.map((c) => c.text).join() ?? ''; + _hiddenController = TextEditingController(text: initial); + _hiddenFocusNode = FocusNode(); + _hiddenFocusNode.addListener(_onFocusChange); + _hiddenController.addListener(_onHiddenControllerChanged); + // Listen to external controllers so this instance stays in sync when + // another instance (e.g. the dark-mode box in LightDarkBox) updates them. + _addExternalControllerListeners(widget.controllers); } @override void didUpdateWidget(OudsPinCodeInput oldWidget) { super.didUpdateWidget(oldWidget); - - if (oldWidget.length.digits != widget.length.digits) { - for (final node in _focusNodes) { - node.dispose(); - } - _focusNodes.clear(); - - for (int i = 0; i < widget.length.digits; i++) { - final focusNode = FocusNode(); - focusNode.addListener(() { - if (!mounted) return; - if (focusNode.hasFocus) { - setState(() { - currentIndex = i; - }); - } - }); - _focusNodes.add(focusNode); - _isHovered = List.filled(widget.length.digits, false); - } + // Trim stored text if the number of cells decreases at runtime. + if (oldWidget.length != widget.length) { + final text = _hiddenController.text.characters + .take(widget.length.digits) + .toString(); + _hiddenController.value = TextEditingValue( + text: text, + selection: TextSelection.collapsed(offset: text.length), + ); + } + // Update external controller listeners when the list reference changes. + if (oldWidget.controllers != widget.controllers) { + _removeExternalControllerListeners(oldWidget.controllers); + _addExternalControllerListeners(widget.controllers); } } @override void dispose() { + WidgetsBinding.instance.removeObserver(this); + _hiddenFocusNode.removeListener(_onFocusChange); + _hiddenController.removeListener(_onHiddenControllerChanged); + _removeExternalControllerListeners(widget.controllers); + _hiddenController.dispose(); + _hiddenFocusNode.dispose(); + super.dispose(); + } + + // ─── Focus ─────────────────────────────────────────────────────────────── + + void _onFocusChange() { if (!mounted) return; - FocusManager.instance.removeListener(_onGlobalFocusChange); - for (final node in _focusNodes) { - node.removeListener( - () => _handleFocusChange(node, _focusNodes.indexOf(node)), + setState(() => _hasFocus = _hiddenFocusNode.hasFocus); + } + + // ─── External controller sync ───────────────────────────────────────────── + + void _addExternalControllerListeners(List? list) { + list?.forEach((c) => c.addListener(_onExternalControllerChanged)); + } + + void _removeExternalControllerListeners(List? list) { + list?.forEach((c) => c.removeListener(_onExternalControllerChanged)); + } + + /// Called when an external per-cell controller changes from outside + /// (e.g. a sibling instance updating shared controllers in LightDarkBox). + /// Rebuilds the internal hidden controller to stay in sync. + void _onExternalControllerChanged() { + if (!mounted || _updatingFromExternal) return; + final newText = widget.controllers?.map((c) => c.text).join() ?? ''; + if (newText != _hiddenController.text) { + _updatingFromExternal = true; + _hiddenController.value = TextEditingValue( + text: newText, + selection: TextSelection.collapsed(offset: newText.length), ); - node.dispose(); + _updatingFromExternal = false; } - super.dispose(); } - void _handleFocusChange(FocusNode focusNode, int index) { - if (focusNode.hasFocus) { - setState(() { - currentIndex = index; + // ─── Input handling ────────────────────────────────────────────────────── + + /// Central listener called on every change to [_hiddenController]. + /// + /// 1. **Sanitise** — strip non-digits (numeric mode) and truncate to max length. + /// 2. **Accessibility deletion** — redirect native backspace to remove only + /// the character at [_voiceOverActiveIndex] instead of the last char. + /// 3. **Accessibility overflow guard** — cap input to the active cell so a + /// typed character cannot silently fill the next cell. + /// 4. **Sync individual controllers** — keep per-cell controllers up to date. + /// 5. **Completion** — unfocus and fire [widget.onEditingComplete] when all + /// cells are filled (skipped in accessibility mode). + void _onHiddenControllerChanged() { + if (!mounted) return; + + final raw = _hiddenController.text; + final totalDigits = widget.length.digits; + + // Step 1 — Sanitise input. + final sanitized = + widget.digitInputDecoration.keyboardType == + OudsPinCodeInputKeyboardType.numeric + ? raw.replaceAll(RegExp(r'\D'), '') + : raw; + final trimmed = sanitized.characters.take(totalDigits).toString(); + + // If sanitisation changed the text, rewrite the controller and let the + // listener fire again with the clean value. + if (raw != trimmed) { + _hiddenController.value = TextEditingValue( + text: trimmed, + selection: TextSelection.collapsed(offset: trimmed.length), + ); + return; + } + + // Step 4 — Sync per-cell controllers. + final controllers = widget.controllers; + if (controllers != null) { + for (int i = 0; i < totalDigits; i++) { + final char = i < trimmed.length ? trimmed[i] : ''; + if (controllers[i].text != char) { + controllers[i].value = TextEditingValue( + text: char, + selection: TextSelection.collapsed(offset: char.length), + ); + } + } + } + + if (!_hasEdited && trimmed.isNotEmpty) _hasEdited = true; + + setState(() {}); + widget.onChanged?.call(trimmed); + + //when focus moves to the next field, the new focused input shall be vocalized to inform the user + if (_hiddenFocusNode.hasFocus && trimmed.length < totalDigits) { + Future.delayed(const Duration(milliseconds: 100), () { + if (!mounted) return; + + final nextIndex = _activeIndex + 1; + + SemanticsService.announce( + OudsLocalizations.of( + context, + )?.core_pinCodeInput_digitPosition_a11y(nextIndex, totalDigits) ?? + '', + Directionality.of(context), + ); }); } + // Step 5 — Completion. + // In normal mode, unfocus when the last cell is filled so the keyboard + // dismisses automatically. In accessibility mode we intentionally keep + // focus so the assistive technology can continue reading the filled cells. + if (trimmed.length == totalDigits) { + _hiddenFocusNode.unfocus(); + widget.onEditingComplete?.call(trimmed); + } + } + + // ─── Paste ─────────────────────────────────────────────────────────────── + + /// Reads text from the clipboard and populates all cells at once. + /// Triggered by a long-press on the cell row. + Future _pasteFromClipboard() async { + try { + final data = await Clipboard.getData( + Clipboard.kTextPlain, + ).timeout(const Duration(seconds: 2), onTimeout: () => null); + if (!mounted) return; + final text = data?.text; + if (text == null || text.isEmpty) return; + + final totalDigits = widget.length.digits; + final sanitized = + widget.digitInputDecoration.keyboardType == + OudsPinCodeInputKeyboardType.numeric + ? text.replaceAll(RegExp(r'\D'), '') + : text; + final trimmed = sanitized.characters.take(totalDigits).toString(); + + _hiddenController.value = TextEditingValue( + text: trimmed, + selection: TextSelection.collapsed(offset: trimmed.length), + ); + _hiddenFocusNode.requestFocus(); + } catch (_) {} + } + + // ─── Helpers ───────────────────────────────────────────────────────────── + + /// Index of the cell that shows the focused border and blinking cursor. + /// + int get _activeIndex { + final len = _hiddenController.text.length; + return len.clamp(0, widget.length.digits - 1); + } + + /// Returns the hint placeholder for [index], or `null` if the cell is + /// filled or currently active. + String? _hintText(int index) { + final hint = widget.digitInputDecoration.hintText; + if (hint == null) return null; + final char = index < _hiddenController.text.length + ? _hiddenController.text[index] + : ''; + if (char.isNotEmpty) return null; + if (_hasFocus && index == _activeIndex) return null; + return hint; + } + + /// Returns a localized accessibility label for a PIN input position. + /// + /// Converts the zero-based [index] into a human-readable ordinal position + /// (for example: "1st", "2nd", "3rd" in English or "1er", "2ème" in French) + /// according to the current locale. + /// + /// This label is used by screen readers to announce each PIN cell position + /// more clearly and avoid confusion between the field position and its value. + String getDigitPositionLabel(BuildContext context, int index) { + final l10n = OudsLocalizations.of(context)!; + final position = index + 1; + + String ordinal; + + switch (Localizations.localeOf(context).languageCode) { + case 'fr': + ordinal = position == 1 ? '${position}er' : '${position}ème'; + break; + + case 'en': + if (position % 10 == 1 && position != 11) { + ordinal = '${position}st'; + } else if (position % 10 == 2 && position != 12) { + ordinal = '${position}nd'; + } else if (position % 10 == 3 && position != 13) { + ordinal = '${position}rd'; + } else { + ordinal = '${position}th'; + } + break; + + default: + ordinal = '$position'; + } + + return l10n.core_pinCodeInput_digitCode_label_a11y(ordinal); } + // ─── Build ─────────────────────────────────────────────────────────────── + @override Widget build(BuildContext context) { final pinCodeToken = OudsTheme.of( @@ -203,13 +411,12 @@ class _OudsPinCodeInputState extends State { widget.errorText != null || (widget.errorText != null && widget.errorText!.isEmpty); final l10n = OudsLocalizations.of(context); - final hintSemanticText = - "${widget.errorText != null && isError - ? widget.errorText! - : widget.helperText != null - ? widget.helperText! - : ''}" - " , ${l10n?.core_common_hint_a11y}"; + final hintSemanticText = widget.errorText != null && isError + ? widget.errorText! + : widget.helperText != null + ? widget.helperText! + : ''; + final currentText = _hiddenController.text; return Container( constraints: BoxConstraints( @@ -224,58 +431,98 @@ class _OudsPinCodeInputState extends State { ? MainAxisAlignment.start : MainAxisAlignment.center, children: [ - Semantics( - hint: hintSemanticText, - label: isError - ? l10n?.core_common_error_a11y - : l10n?.core_pinCodeInput_pinCode_label_a11y(digitsCount), - child: Row( - mainAxisAlignment: widget.digitInputDecoration.constrainedMaxWidth - ? MainAxisAlignment.start - : MainAxisAlignment.center, - spacing: widget.length == OudsPinCodeInputLength.eight - ? 6 - : pinCodeToken.spaceColumnGapDigitInput, - children: List.generate(digitsCount, (index) { - return Flexible( - fit: FlexFit.loose, - child: Semantics( - liveRegion: true, - label: - "${l10n?.core_pinCodeInput_digitCode_label_a11y(index + 1)}, " - "${!widget.digitInputDecoration.hiddenPassword && widget.controllers != null ? widget.controllers![index].text : ''}, " - "${l10n?.core_pinCodeInput_trait_a11y}", - child: OudsDigitInput( - index: index, - isError: isError, - length: widget.length, - digitInputDecoration: OudsDigitInputDecoration( - hintText: _hintText(index), - hiddenPassword: - widget.digitInputDecoration.hiddenPassword, - isOutlined: widget.digitInputDecoration.isOutlined, - keyboardType: widget.digitInputDecoration.keyboardType, + // ── Hidden TextField ───────────────────────────────────────────── + // A single invisible input widget (opacity 0, height 1) that holds + // the entire PIN string. Keeping a single focused TextField alive + // for the whole input session prevents the soft keyboard from + // closing and reopening between cells. + ExcludeSemantics( + child: Opacity( + opacity: 0.0, + child: SizedBox( + height: 1, + child: TextField( + controller: _hiddenController, + focusNode: _hiddenFocusNode, + showCursor: false, + enableInteractiveSelection: false, + keyboardType: + widget.digitInputDecoration.keyboardType == + OudsPinCodeInputKeyboardType.numeric + ? TextInputType.number + : TextInputType.text, + inputFormatters: [ + LengthLimitingTextInputFormatter(widget.length.digits), + if (widget.digitInputDecoration.keyboardType == + OudsPinCodeInputKeyboardType.numeric) + FilteringTextInputFormatter.digitsOnly, + ], + textInputAction: TextInputAction.done, + decoration: const InputDecoration.collapsed(hintText: null), + ), + ), + ), + ), + + // ── Visual cell row ────────────────────────────────────────────── + // A GestureDetector wraps the entire row so a tap anywhere opens the + // keyboard. Long-press triggers clipboard paste. + GestureDetector( + onTap: () => _hiddenFocusNode.requestFocus(), + onLongPress: _pasteFromClipboard, + child: Semantics( + hint: hintSemanticText, + label: isError + ? l10n?.core_common_error_a11y + : l10n?.core_pinCodeInput_pinCode_label_a11y(digitsCount), + child: Row( + mainAxisAlignment: + widget.digitInputDecoration.constrainedMaxWidth + ? MainAxisAlignment.start + : MainAxisAlignment.center, + spacing: widget.length == OudsPinCodeInputLength.eight + ? 6 + : pinCodeToken.spaceColumnGapDigitInput, + children: List.generate(digitsCount, (index) { + final char = index < currentText.length + ? currentText[index] + : ''; + // True when this cell should show the active border/cursor. + final isActive = _hasFocus && index == _activeIndex; + return Flexible( + fit: FlexFit.loose, + child: Semantics( + // Disable live regions in accessibility mode to prevent + // the screen reader from jumping to cells whose content + // changed after a keystroke. + liveRegion: true, + hint: l10n?.core_common_hint_a11y, + label: + "${getDigitPositionLabel(context, index)}, " + "${!widget.digitInputDecoration.hiddenPassword && widget.controllers != null ? widget.controllers![index].text : ''}, " + "${l10n?.core_pinCodeInput_trait_a11y}", + child: OudsDigitInput( + index: index, + isError: isError, + isFocused: isActive, + displayValue: char, + digitInputDecoration: OudsDigitInputDecoration( + hintText: _hintText(index), + hiddenPassword: + widget.digitInputDecoration.hiddenPassword, + isOutlined: widget.digitInputDecoration.isOutlined, + keyboardType: + widget.digitInputDecoration.keyboardType, + ), ), - focusNode: _focusNodes[index], - isHovered: _isHovered[index], - controller: widget.controllers?[index], - onChanged: (value, index) { - _handleDigitInput(value, index); - if (!_hasEdited) { - setState(() { - _hasEdited = - true; // The user has interacted with the PIN at least once - }); - } - }, - onBackspaceOnEmpty: () => _handleBackspaceOnEmpty(index), - onPasteRequested: _pasteFromClipboard, ), - ), - ); - }), + ); + }), + ), ), ), + + // ── Helper / error text ────────────────────────────────────────── if (widget.helperText != null || (widget.errorText != null && isError)) ...[ Container( @@ -315,269 +562,4 @@ class _OudsPinCodeInputState extends State { ), ); } - - // Handles keyboard-path input from a single cell. Any multi-grapheme value - // (soft-keyboard paste suggestion, Cmd+V, OTP autofill) is routed to the - // single distribution method `_distributeCode`. Single characters are - // written atomically and focus advances or retreats. Long-press paste is - // handled entirely outside this method via `_pasteFromClipboard` wired - // through each cell's `contextMenuBuilder`. - void _handleDigitInput(String value, int index) { - WidgetsBinding.instance.addPostFrameCallback((_) { - if (!mounted) return; - - final totalDigits = widget.length.digits; - final controllers = widget.controllers; - if (controllers == null) return; - if (controllers.length < totalDigits || - _focusNodes.length < totalDigits) { - return; - } - - final sanitized = widget.digitInputDecoration.keyboardType == - OudsPinCodeInputKeyboardType.numeric - ? value.replaceAll(RegExp(r'\D'), '') - : value; - final chars = sanitized.characters.toList(); - - // Multi-grapheme arrival → treat as paste, redistribute. - if (chars.length > 1) { - _distributeCode(value); - return; - } - - final effective = chars.isEmpty ? '' : chars.first; - if (controllers[index].text != effective) { - controllers[index].value = TextEditingValue( - text: effective, - selection: TextSelection.collapsed(offset: effective.length), - ); - } - - final code = _currentCode(); - _emitChanged(code); - - if (effective.isEmpty) { - _requestFocusOnPreviousField(index); - return; - } - - _requestFocusOnNextFieldOrComplete( - index: index, - totalDigits: totalDigits, - code: code, - ); - }); - } - - /// Builds the current PIN value by concatenating all digit controllers. - String _currentCode() { - final controllers = widget.controllers; - if (controllers == null) return ''; - return controllers.map((c) => c.text).join(); - } - - /// Emits onChanged with the provided code, or with the current PIN when omitted. - void _emitChanged([String? code]) { - widget.onChanged?.call(code ?? _currentCode()); - } - - /// Moves focus to the previous digit field when the index is valid. - void _requestFocusOnPreviousField(int index) { - if (index <= 0) return; - final previousIndex = index - 1; - if (previousIndex >= _focusNodes.length) return; - _focusNodes[previousIndex].requestFocus(); - } - - /// Returns the previous index when both controller and focus node bounds are valid. - /// Returns null when there is no previous field or when collections are inconsistent. - int? _validPreviousIndex(int index) { - final controllers = widget.controllers; - if (controllers == null || index <= 0) return null; - - final previousIndex = index - 1; - if (previousIndex >= controllers.length || - previousIndex >= _focusNodes.length) { - return null; - } - return previousIndex; - } - - /// Moves focus forward when possible, or completes editing on the last filled field. - void _requestFocusOnNextFieldOrComplete({ - required int index, - required int totalDigits, - required String code, - }) { - if (index < totalDigits - 1) { - _focusNodes[index + 1].requestFocus(); - return; - } - - if (code.length == totalDigits) { - _focusNodes[index].unfocus(); - widget.onEditingComplete?.call(code); - } - } - - // ───────────────────────── paste pipeline ───────────────────────── - // Three small methods, single responsibility each: - // - // _safeReadClipboard – reads the system clipboard with a hard 2 s - // timeout; returns null on null/error/timeout. - // _pasteFromClipboard – entrypoint wired to each cell's context-menu - // "Paste" action; sole long-press paste path. - // _distributeCode – the ONLY place that writes to the cells. Takes - // a raw string, sanitises, truncates to PIN - // length, fills every cell (clearing trailing - // ones), updates focus, and fires callbacks. - // - // The keyboard path (`_handleDigitInput`) also delegates to - // `_distributeCode` whenever it sees a multi-grapheme value, so all paste - // flows converge on one implementation. - - Future _safeReadClipboard() async { - try { - final data = await Clipboard.getData(Clipboard.kTextPlain).timeout( - const Duration(seconds: 2), - onTimeout: () => null, - ); - return data?.text; - } catch (_) { - return null; - } - } - - Future _pasteFromClipboard() async { - final text = await _safeReadClipboard(); - if (!mounted) return; - if (text == null || text.isEmpty) return; - _distributeCode(text); - } - - void _distributeCode(String raw) { - final totalDigits = widget.length.digits; - final controllers = widget.controllers; - if (controllers == null) return; - if (controllers.length < totalDigits || - _focusNodes.length < totalDigits) { - return; - } - - final sanitized = widget.digitInputDecoration.keyboardType == - OudsPinCodeInputKeyboardType.numeric - ? raw.replaceAll(RegExp(r'\D'), '') - : raw; - if (sanitized.isEmpty) return; - - final digits = sanitized.characters.take(totalDigits).toList(); - final filledCount = digits.length; - - // Write every cell — atomic `value =` (sets text + selection in one go) - // and explicit empty for cells beyond the pasted range, so a shorter - // paste cannot leave stale digits behind. - for (int i = 0; i < totalDigits; i++) { - final text = i < filledCount ? digits[i] : ''; - controllers[i].value = TextEditingValue( - text: text, - selection: TextSelection.collapsed(offset: text.length), - ); - } - - if (!_hasEdited) { - _hasEdited = true; - } - - final code = _currentCode(); - _emitChanged(code); - - if (code.characters.length == totalDigits) { - for (final node in _focusNodes) { - node.unfocus(); - } - widget.onEditingComplete?.call(code); - } else { - final nextIndex = filledCount.clamp(0, totalDigits - 1).toInt(); - _focusNodes[nextIndex].requestFocus(); - } - } - - // Called when the user presses backspace on an already-empty digit cell. - // Clears the previous cell's content AND moves focus there in a single step, - // so deletion feels instant instead of requiring two key presses. - void _handleBackspaceOnEmpty(int index) { - final controllers = widget.controllers; - if (controllers == null) return; - final previousIndex = _validPreviousIndex(index); - if (previousIndex == null) return; - - final previousController = controllers[previousIndex]; - final wasNonEmpty = previousController.text.isNotEmpty; - - previousController.clear(); - _requestFocusOnPreviousField(index); - - if (wasNonEmpty) { - _emitChanged(); - } - } - - // This method is called whenever the global focus changes, using a FocusManager listener. - // It updates the internal `hasAnyFocus` state to reflect whether any of the PIN input fields currently have focus. - // - // - If the focus state has not changed since the last check, the method returns immediately. - // - Otherwise, it updates the `_previousHasFocus` to the new state. - // - If all fields have lost focus (`hasAnyFocus == false`) and the user has interacted with the PIN (`_hasEdited`), - // it triggers the `onEditingComplete` callback with the current PIN code. - // - If any field still has focus (`hasAnyFocus == true`), it triggers the `onChanged` callback with the current PIN code. - // - // This ensures that the component reacts only to real focus changes, and that the PIN validation - // or change callbacks are called at the appropriate time. - void _onGlobalFocusChange() { - setState(() { - hasAnyFocus = _focusNodes.any((f) => f.hasFocus); - }); - - if (_previousHasFocus == hasAnyFocus) return; - - _previousHasFocus = hasAnyFocus; - final code = _currentCode(); - - if (!hasAnyFocus && - _hasEdited && - code.characters.length == widget.length.digits) { - widget.onEditingComplete?.call(code); - } else if (hasAnyFocus) { - widget.onChanged?.call(code); - } - } - - String? _hintText(int index) { - final hint = widget.digitInputDecoration.hintText; - if (hint == null) return null; - - final hasFocus = _focusNodes[index].hasFocus; - final text = widget.controllers?[index].text; - - // Special case: all fields are empty, user has already edited, and cursor is invisible - final isPinCompletelyEmpty = widget.controllers?.every( - (c) => c.text.isEmpty, - ); - if (isPinCompletelyEmpty != null && - isPinCompletelyEmpty && - hasFocus && - _hasEdited) { - return hint; - } - - // No hint if the field is focused (cursor visible) - if (hasFocus) return null; - - // Show hint if the field is empty - if (text != null && text.isEmpty) return hint; - - // Otherwise, no hint - return null; - } } diff --git a/ouds_core/lib/components/radio_button/ouds_radio_button.dart b/ouds_core/lib/components/radio_button/ouds_radio_button.dart index 14083f3e6..f50f200c3 100644 --- a/ouds_core/lib/components/radio_button/ouds_radio_button.dart +++ b/ouds_core/lib/components/radio_button/ouds_radio_button.dart @@ -198,8 +198,8 @@ class OudsRadioButtonState extends State> { ), child: Center( child: SizedBox( - width: radioButton.sizeIndicator, - height: radioButton.sizeIndicator, + width: controlItem.sizeControlIndicator, + height: controlItem.sizeControlIndicator, child: Stack( fit: StackFit.expand, children: [ diff --git a/ouds_core/lib/components/radio_button/ouds_radio_button_item.dart b/ouds_core/lib/components/radio_button/ouds_radio_button_item.dart index a592d937a..64442b6be 100644 --- a/ouds_core/lib/components/radio_button/ouds_radio_button_item.dart +++ b/ouds_core/lib/components/radio_button/ouds_radio_button_item.dart @@ -51,6 +51,8 @@ import 'package:ouds_core/components/radio_button/ouds_radio_button.dart'; /// - [constrainedMaxWidth]: When `true`, the item width is constrained to a maximum value defined by the design system. /// When `false`, no specific width constraint is applied, allowing the component to size itself or follow external modifiers. /// Defaults to `false`. +/// - [errorText]: Text shown below the radio button item indicating an error state. Supports only strong text formatting using `**bold**`. +/// Rich text is supported only for error messages. /// /// /// ### You can use [OudsRadioButtonItem] component in your project, customizing parameters as needed : diff --git a/ouds_core/lib/components/switch/ouds_switch_item.dart b/ouds_core/lib/components/switch/ouds_switch_item.dart index d8c3b1255..4bd65ff61 100644 --- a/ouds_core/lib/components/switch/ouds_switch_item.dart +++ b/ouds_core/lib/components/switch/ouds_switch_item.dart @@ -45,6 +45,8 @@ import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; /// - [constrainedMaxWidth]: When `true`, the item width is constrained to a maximum value defined by the design system. /// When `false`, no specific width constraint is applied, allowing the component to size itself or follow external modifiers. /// Defaults to `false`. +/// - [errorText]: Text shown below the switch item indicating an error state. Supports only strong text formatting using `**bold**`. +/// Rich text is supported only for error messages. /// /// /// ### You can use [OudsSwitchItem] component in your project, customizing parameters as needed : diff --git a/ouds_core/lib/components/tag/internal/ouds_tag_status_modifier.dart b/ouds_core/lib/components/tag/internal/ouds_tag_status_modifier.dart index 1750cf650..2b38f63ee 100644 --- a/ouds_core/lib/components/tag/internal/ouds_tag_status_modifier.dart +++ b/ouds_core/lib/components/tag/internal/ouds_tag_status_modifier.dart @@ -27,8 +27,11 @@ class OudsTagStatusModifier { OudsTagStatusModifier(this.context); /// Returns the background color based on the tag status. - //deprecation remove: The param state will be removed after deprecation - Color? getStatusColor(OudsTagStatus? state, OudsIconStatus? iconStatus, OudsTagAppearance? appearance, bool isEnabled) { + Color? getStatusColor( + OudsIconStatus? iconStatus, + OudsTagAppearance? appearance, + bool isEnabled, + ) { final isEmphasized = appearance == OudsTagAppearance.emphasized; final colorTheme = OudsTheme.of(context).colorScheme(context); @@ -36,31 +39,14 @@ class OudsTagStatusModifier { return colorTheme.actionDisabled; } - //deprecation remove: will be removed after deprecation - if(state != null){ - switch (state) { - case OudsTagStatus.neutral: - return _getNeutralStatusColor(isEmphasized,colorTheme); - case OudsTagStatus.accent: - return _getAccentStatusColor(isEmphasized,colorTheme); - case OudsTagStatus.positive: - return _getPositiveStatusColor(isEmphasized,colorTheme); - case OudsTagStatus.info: - return _getInfoStatusColor(isEmphasized,colorTheme); - case OudsTagStatus.warning: - return _getWarningStatusColor(isEmphasized,colorTheme); - case OudsTagStatus.negative: - return _getNegativeStatusColor(isEmphasized,colorTheme); - } - } - else if(iconStatus != null){ + if (iconStatus != null) { return switch (iconStatus) { - Neutral() => _getNeutralStatusColor(isEmphasized,colorTheme), - Accent() => _getAccentStatusColor(isEmphasized,colorTheme), - Positive() => _getPositiveStatusColor(isEmphasized,colorTheme), - Info() => _getInfoStatusColor(isEmphasized,colorTheme), - Warning() => _getWarningStatusColor(isEmphasized,colorTheme), - Negative() => _getNegativeStatusColor(isEmphasized,colorTheme), + Neutral() => _getNeutralStatusColor(isEmphasized, colorTheme), + Accent() => _getAccentStatusColor(isEmphasized, colorTheme), + Positive() => _getPositiveStatusColor(isEmphasized, colorTheme), + Info() => _getInfoStatusColor(isEmphasized, colorTheme), + Warning() => _getWarningStatusColor(isEmphasized, colorTheme), + Negative() => _getNegativeStatusColor(isEmphasized, colorTheme), }; } @@ -68,51 +54,54 @@ class OudsTagStatusModifier { } /// Returns the background color for the **neutral** status. - Color _getNeutralStatusColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getNeutralStatusColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.surfaceInverseHigh : colorTheme.surfaceSecondary; } /// Returns the background color for the **accent** status. - Color _getAccentStatusColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getAccentStatusColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.surfaceStatusAccentEmphasized : colorTheme.surfaceStatusAccentMuted; } /// Returns the background color for the **positive** status. - Color _getPositiveStatusColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getPositiveStatusColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.surfaceStatusPositiveEmphasized : colorTheme.surfaceStatusPositiveMuted; } /// Returns the background color for the **info** status. - Color _getInfoStatusColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getInfoStatusColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.surfaceStatusInfoEmphasized : colorTheme.surfaceStatusInfoMuted; } /// Returns the background color for the **warning** status. - Color _getWarningStatusColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getWarningStatusColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.surfaceStatusWarningEmphasized : colorTheme.surfaceStatusWarningMuted; } /// Returns the background color for the **negative** status. - Color _getNegativeStatusColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getNegativeStatusColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.surfaceStatusNegativeEmphasized : colorTheme.surfaceStatusNegativeMuted; } - /// Returns the text color based on the tag status. - //deprecation remove: The param state will be removed after deprecation - Color? getStatusTextColor(OudsTagStatus? state, OudsIconStatus? status, OudsTagAppearance appearance, bool isLoading, bool isEnabled) { + Color? getStatusTextColor( + OudsIconStatus? status, + OudsTagAppearance appearance, + bool isLoading, + bool isEnabled, + ) { final isEmphasized = appearance == OudsTagAppearance.emphasized; final colorTheme = OudsTheme.of(context).colorScheme(context); @@ -123,30 +112,14 @@ class OudsTagStatusModifier { return colorTheme.contentOnActionDisabled; } - //deprecation remove: will be removed after deprecation - if(state != null) { - switch (state) { - case OudsTagStatus.neutral: - return _getNeutralTextColor(isEmphasized,colorTheme); - case OudsTagStatus.accent: - return _getAccentTextColor(isEmphasized,colorTheme); - case OudsTagStatus.positive: - return _getPositiveTextColor(isEmphasized,colorTheme); - case OudsTagStatus.info: - return _getInfoTextColor(isEmphasized,colorTheme); - case OudsTagStatus.warning: - return _getWarningTextColor(isEmphasized,colorTheme); - case OudsTagStatus.negative: - return _getNegativeTextColor(isEmphasized,colorTheme); - } - } else if(status != null){ + if (status != null) { return switch (status) { - Neutral() => _getNeutralTextColor(isEmphasized,colorTheme), - Accent() => _getAccentTextColor(isEmphasized,colorTheme), - Positive() => _getPositiveTextColor(isEmphasized,colorTheme), - Info() => _getInfoTextColor(isEmphasized,colorTheme), - Warning() => _getWarningTextColor(isEmphasized,colorTheme), - Negative() => _getNegativeTextColor(isEmphasized,colorTheme), + Neutral() => _getNeutralTextColor(isEmphasized, colorTheme), + Accent() => _getAccentTextColor(isEmphasized, colorTheme), + Positive() => _getPositiveTextColor(isEmphasized, colorTheme), + Info() => _getInfoTextColor(isEmphasized, colorTheme), + Warning() => _getWarningTextColor(isEmphasized, colorTheme), + Negative() => _getNegativeTextColor(isEmphasized, colorTheme), }; } @@ -154,81 +127,65 @@ class OudsTagStatusModifier { } /// Returns the text color for the **neutral** status. - Color _getNeutralTextColor(bool isEmphasized, OudsColorScheme colorTheme){ - return isEmphasized - ? colorTheme.contentInverse - : colorTheme.contentDefault; + Color _getNeutralTextColor(bool isEmphasized, OudsColorScheme colorTheme) { + return isEmphasized ? colorTheme.contentInverse : colorTheme.contentDefault; } /// Returns the text color for the **accent** status. - Color _getAccentTextColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getAccentTextColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.contentOnStatusAccentEmphasized : colorTheme.contentOnStatusAccentMuted; } /// Returns the text color for the **positive** status. - Color _getPositiveTextColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getPositiveTextColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.contentOnStatusPositiveEmphasized : colorTheme.contentOnStatusPositiveMuted; } /// Returns the text color for the **info** status. - Color _getInfoTextColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getInfoTextColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.contentOnStatusInfoEmphasized : colorTheme.contentOnStatusInfoMuted; } /// Returns the text color for the **warning** status. - Color _getWarningTextColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getWarningTextColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.contentOnStatusWarningEmphasized : colorTheme.contentOnStatusWarningMuted; } /// Returns the text color for the **negative** status. - Color _getNegativeTextColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getNegativeTextColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.contentOnStatusNegativeEmphasized : colorTheme.contentOnStatusNegativeMuted; } /// Return the icon color based on tag status - //deprecation remove: The param state will be removed after deprecation - Color getStatusIconColor(OudsTagStatus? state, OudsIconStatus? iconStatus, OudsTagAppearance appearance, bool isEnabled) { + Color getStatusIconColor( + OudsIconStatus? iconStatus, + OudsTagAppearance appearance, + bool isEnabled, + ) { final isEmphasized = appearance == OudsTagAppearance.emphasized; final colorTheme = OudsTheme.of(context).colorScheme(context); if (!isEnabled) { return colorTheme.contentOnActionDisabled; } - - //deprecation remove: will be removed after deprecation - if(state != null) { - switch (state) { - case OudsTagStatus.neutral: - return _getNeutralIconColor(isEmphasized,colorTheme); - case OudsTagStatus.accent: - return _getAccentIconColor(isEmphasized,colorTheme); - case OudsTagStatus.positive: - return _getPositiveIconColor(isEmphasized,colorTheme); - case OudsTagStatus.info: - return _getInfoIconColor(isEmphasized,colorTheme); - case OudsTagStatus.warning: - return _getWarningIconColor(isEmphasized,colorTheme); - case OudsTagStatus.negative: - return _getNegativeIconColor(isEmphasized,colorTheme); - } - }else if(iconStatus != null){ + if (iconStatus != null) { return switch (iconStatus) { - Neutral() => _getNeutralIconColor(isEmphasized,colorTheme), - Accent() => _getAccentIconColor(isEmphasized,colorTheme), - Positive() => _getPositiveIconColor(isEmphasized,colorTheme), - Info() => _getInfoIconColor(isEmphasized,colorTheme), - Warning() => _getWarningIconColor(isEmphasized,colorTheme), - Negative() => _getNegativeIconColor(isEmphasized,colorTheme), + Neutral() => _getNeutralIconColor(isEmphasized, colorTheme), + Accent() => _getAccentIconColor(isEmphasized, colorTheme), + Positive() => _getPositiveIconColor(isEmphasized, colorTheme), + Info() => _getInfoIconColor(isEmphasized, colorTheme), + Warning() => _getWarningIconColor(isEmphasized, colorTheme), + Negative() => _getNegativeIconColor(isEmphasized, colorTheme), }; } @@ -236,79 +193,57 @@ class OudsTagStatusModifier { } /// Returns the icon color for the **neutral** status. - Color _getNeutralIconColor(bool isEmphasized, OudsColorScheme colorTheme){ - return isEmphasized - ? colorTheme.contentInverse - : colorTheme.contentDefault; + Color _getNeutralIconColor(bool isEmphasized, OudsColorScheme colorTheme) { + return isEmphasized ? colorTheme.contentInverse : colorTheme.contentDefault; } /// Returns the icon color for the **accent** status. - Color _getAccentIconColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getAccentIconColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.contentOnStatusAccentEmphasized : colorTheme.contentStatusAccent; } /// Returns the icon color for the **positive** status. - Color _getPositiveIconColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getPositiveIconColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.contentOnStatusPositiveEmphasized : colorTheme.contentStatusPositive; } /// Returns the icon color for the **info** status. - Color _getInfoIconColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getInfoIconColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.contentOnStatusInfoEmphasized : colorTheme.contentStatusInfo; } /// Returns the icon color for the **warning** status. - Color _getWarningIconColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getWarningIconColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.contentOnStatusWarningEmphasized : colorTheme.contentStatusWarning; } /// Returns the icon color for the **negative** status. - Color _getNegativeIconColor(bool isEmphasized, OudsColorScheme colorTheme){ + Color _getNegativeIconColor(bool isEmphasized, OudsColorScheme colorTheme) { return isEmphasized ? colorTheme.contentOnStatusNegativeEmphasized : colorTheme.contentStatusNegative; } /// Return the icon based on tag status - //deprecation remove: The param state will be removed after deprecation - String? getStatusIcon(OudsTagStatus? state, OudsIconStatus? iconStatus) { - - //deprecation remove: will be removed after deprecation - if(state != null){ - switch (state) { - case OudsTagStatus.positive: - return AppAssets.icons.componentAlertTickConfirmationFill; - case OudsTagStatus.info: - return AppAssets.icons.componentAlertInformationFill; - case OudsTagStatus.warning: - return AppAssets.icons.componentAlertWarningExternalShape; - case OudsTagStatus.negative: - return AppAssets.icons.componentAlertImportantFill; - case OudsTagStatus.neutral: - case OudsTagStatus.accent: - return null; - } - }else - // Handle the new 'iconStatus' API + String? getStatusIcon(OudsIconStatus? iconStatus) { if (iconStatus != null) { return switch (iconStatus) { - - // For those statuses, the icon is fixed and defined here. + // For those statuses, the icon is fixed and defined here. Positive() => AppAssets.icons.componentAlertTickConfirmationFill, Info() => AppAssets.icons.componentAlertInformationFill, Warning() => AppAssets.icons.componentAlertWarningExternalShape, Negative() => AppAssets.icons.componentAlertImportantFill, - // For the other Accent and Neutral the icon should be defined by user - _ => null + // For the other Accent and Neutral the icon should be defined by user + _ => null, }; } return null; @@ -322,11 +257,11 @@ class OudsTagStatusModifier { // Extract the 'icon' property only from Neutral and Accent types. return switch (iconStatus) { - // If the type is Neutral or Accent, extract the 'icon' value into the 'assets' variable and return it. + // If the type is Neutral or Accent, extract the 'icon' value into the 'assets' variable and return it. Neutral(icon: final assets) => assets, Accent(icon: final assets) => assets, - // For all other status types (Positive, Info, etc.), return null - // as their icons are fixed and not user-defined. + // For all other status types (Positive, Info, etc.), return null + // as their icons are fixed and not user-defined. _ => null, }; } diff --git a/ouds_core/lib/components/tag/internal/ouds_tag_text_style_modifier.dart b/ouds_core/lib/components/tag/internal/ouds_tag_text_style_modifier.dart index c779a81a6..25ca39c1d 100644 --- a/ouds_core/lib/components/tag/internal/ouds_tag_text_style_modifier.dart +++ b/ouds_core/lib/components/tag/internal/ouds_tag_text_style_modifier.dart @@ -26,22 +26,28 @@ class OudsTagStyleModifier { OudsTagStyleModifier(this.context); /// Returns the text style based on tag state for tag text - //deprecation remove: The param state will be removed after deprecation TextStyle buildTagTextStyle({ required OudsTagAppearance appearance, - OudsTagStatus? state, - OudsIconStatus? status, - OudsTagSize? size, - bool isLoading = false, - bool isEnabled = false + OudsIconStatus? status, + OudsTagSize? size, + bool isLoading = false, + bool isEnabled = false, }) { return size == OudsTagSize.defaultSize - ? OudsTheme.of(context).typographyTokens.typeLabelStrongMedium(context).copyWith( - color: OudsTagStatusModifier(context).getStatusTextColor(state, status, appearance,isLoading, isEnabled), - ) - : OudsTheme.of(context).typographyTokens.typeLabelModerateSmall(context).copyWith( - color: OudsTagStatusModifier(context).getStatusTextColor(state, status, appearance,isLoading, isEnabled), - ); + ? OudsTheme.of(context).typographyTokens + .typeLabelStrongMedium(context) + .copyWith( + color: OudsTagStatusModifier( + context, + ).getStatusTextColor(status, appearance, isLoading, isEnabled), + ) + : OudsTheme.of(context).typographyTokens + .typeLabelModerateSmall(context) + .copyWith( + color: OudsTagStatusModifier( + context, + ).getStatusTextColor(status, appearance, isLoading, isEnabled), + ); } /// Returns the text color based on tag state for tag input diff --git a/ouds_core/lib/components/tag/ouds_input_tag.dart b/ouds_core/lib/components/tag/ouds_input_tag.dart index b8597d743..27167dbfa 100644 --- a/ouds_core/lib/components/tag/ouds_input_tag.dart +++ b/ouds_core/lib/components/tag/ouds_input_tag.dart @@ -30,7 +30,7 @@ import 'internal/ouds_tag_control_state.dart'; /// /// [OUDS Input Tag Design Guidelines](https://r.orange.fr/r/S-ouds-doc-input-tag) /// -/// **Reference design version : 1.4.0** +/// **Reference design version : 1.2.0** /// /// Input tag is a UI element that allows to enter multiple values, each represented as a tag. /// As users type and submit values (usually by pressing enter, comma, or tab), @@ -58,11 +58,7 @@ class OudsInputTag extends StatefulWidget { final String label; final VoidCallback? onPressed; - const OudsInputTag({ - super.key, - required this.label, - this.onPressed, - }); + const OudsInputTag({super.key, required this.label, this.onPressed}); @override State createState() => _OudsInputTagState(); @@ -93,117 +89,158 @@ class _OudsInputTagState extends State { } void _handleFocusChange(bool focus) { - if (widget.onPressed == null) _isFocused = false; // Ignore focus changes if disabled + if (widget.onPressed == null) + _isFocused = false; // Ignore focus changes if disabled setState(() => _isFocused = focus); } @override Widget build(BuildContext context) { final isDisabled = widget.onPressed == null; - final interactionModelHover = OudsInheritedInteractionModel.of(context, InteractionAspect.hover); - final interactionModelPressed = OudsInheritedInteractionModel.of(context, InteractionAspect.pressed); + final interactionModelHover = OudsInheritedInteractionModel.of( + context, + InteractionAspect.hover, + ); + final interactionModelPressed = OudsInheritedInteractionModel.of( + context, + InteractionAspect.pressed, + ); final isHovered = interactionModelHover?.state.isHovered ?? false; final isPressed = interactionModelPressed?.state.isPressed ?? false; - final tagStateDeterminer = OudsTagControlStateDeterminer(enabled: !isDisabled, isPressed: isPressed || _isPressed, isHovered: isHovered || _isHovered, isFocused: _isFocused); + final tagStateDeterminer = OudsTagControlStateDeterminer( + enabled: !isDisabled, + isPressed: isPressed || _isPressed, + isHovered: isHovered || _isHovered, + isFocused: _isFocused, + ); final tagState = tagStateDeterminer.determineControlState(); final tagBorderModifier = OudsInputTagControlBorderModifier(context); final tagTextColorModifier = OudsTagStyleModifier(context); - final tagBackgroundColorModifier = OudsInputTagControlBackgroundColorModifier(context); + final tagBackgroundColorModifier = + OudsInputTagControlBackgroundColorModifier(context); - return Visibility(visible: isVisible, child: _buildInputTag(context, tagBorderModifier, tagTextColorModifier, tagBackgroundColorModifier, tagState, isDisabled)); + return Visibility( + visible: isVisible, + child: _buildInputTag( + context, + tagBorderModifier, + tagTextColorModifier, + tagBackgroundColorModifier, + tagState, + isDisabled, + ), + ); } - Widget _buildInputTag(BuildContext context, OudsInputTagControlBorderModifier tagBorderModifier, OudsTagStyleModifier tagTextColorModifier, - OudsInputTagControlBackgroundColorModifier tagBgColorModifier, OudsTagControlState tagState, bool isDisabled) { + Widget _buildInputTag( + BuildContext context, + OudsInputTagControlBorderModifier tagBorderModifier, + OudsTagStyleModifier tagTextColorModifier, + OudsInputTagControlBackgroundColorModifier tagBgColorModifier, + OudsTagControlState tagState, + bool isDisabled, + ) { final tagToken = OudsTheme.of(context).componentsTokens(context).tag; - final inputTagToken = OudsTheme.of(context).componentsTokens(context).inputTag; + final inputTagToken = OudsTheme.of( + context, + ).componentsTokens(context).inputTag; final borderTokens = OudsTheme.of(context).borderTokens; final l10n = OudsLocalizations.of(context); - return Semantics( - enabled: !isDisabled, - label: l10n?.core_tag_tag_input_role_a11y, - container: true, - button: true, - child: Material( - color: Colors.transparent, - child: Container( - constraints: BoxConstraints( - minHeight: tagToken.sizeMinHeightInteractiveArea, - ), - child: InkWell( - onTap: () { - if (widget.onPressed != null) { - widget.onPressed!.call(); - SemanticsService.announce(l10n?.core_tag_tag_input_removed_a11y(widget.label) ?? '', TextDirection.ltr); - } - }, - focusNode: _focusNode, - canRequestFocus: !isDisabled, - splashColor: Colors.transparent, - highlightColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - onHover: (hovering) { - setState(() { - if (!isDisabled) { - _isHovered = hovering; - } - }); - }, - onHighlightChanged: (highlighted) { - setState(() { - if (!isDisabled) { - _isPressed = highlighted; + return MergeSemantics( + child: Semantics( + enabled: !isDisabled, + container: true, + button: true, + child: Material( + color: Colors.transparent, + child: Container( + constraints: BoxConstraints( + minHeight: tagToken.sizeMinHeightInteractiveArea, + ), + child: InkWell( + onTap: () { + if (widget.onPressed != null) { + widget.onPressed!.call(); + SemanticsService.announce( + l10n?.core_tag_tag_input_removed_a11y(widget.label) ?? '', + TextDirection.ltr, + ); } - }); - }, - child: Stack( - clipBehavior: Clip.none, - alignment: Alignment.center, - children: [ - if (_isFocused) - Positioned( - top: borderTokens.widthFocus / 2, - bottom: borderTokens.widthFocus / 2, - left: -borderTokens.widthFocus / 2, + }, + focusNode: _focusNode, + canRequestFocus: !isDisabled, + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + onHover: (hovering) { + setState(() { + if (!isDisabled) { + _isHovered = hovering; + } + }); + }, + onHighlightChanged: (highlighted) { + setState(() { + if (!isDisabled) { + _isPressed = highlighted; + } + }); + }, + child: Stack( + clipBehavior: Clip.none, + alignment: Alignment.center, + children: [ + if (_isFocused) + Positioned( + top: borderTokens.widthFocus / 2, + bottom: borderTokens.widthFocus / 2, + left: -borderTokens.widthFocus / 2, - /// to be changed to enhancement the focus. - right: -borderTokens.widthFocus / 2, + /// to be changed to enhancement the focus. + right: -borderTokens.widthFocus / 2, - /// to be changed to enhancement the focus. - child: Container( - decoration: BoxDecoration( - border: OudsBorder().borderAll( - color: OudsTheme.of(context).colorScheme(context).borderFocus, - width: borderTokens.widthFocus, - ), - borderRadius: BorderRadius.circular( - tagToken.borderRadius + borderTokens.widthFocus, + /// to be changed to enhancement the focus. + child: Container( + decoration: BoxDecoration( + border: OudsBorder().borderAll( + color: OudsTheme.of( + context, + ).colorScheme(context).borderFocus, + width: borderTokens.widthFocus, + ), + borderRadius: BorderRadius.circular( + tagToken.borderRadius + borderTokens.widthFocus, + ), ), ), ), - ), - Container( - decoration: BoxDecoration( - border: OudsBorder().borderAll( - color: _isFocused ? OudsTheme.of(context).colorScheme(context).borderFocusInset : Colors.transparent, - width: inputTagToken.borderWidthDefaultInteraction, + Container( + decoration: BoxDecoration( + border: OudsBorder().borderAll( + color: _isFocused + ? OudsTheme.of( + context, + ).colorScheme(context).borderFocusInset + : Colors.transparent, + width: inputTagToken.borderWidthDefaultInteraction, + ), + borderRadius: BorderRadius.circular( + tagToken.borderRadius, + ), ), - borderRadius: BorderRadius.circular( - tagToken.borderRadius, + child: _buildLayout( + context, + tagBorderModifier, + tagTextColorModifier, + tagBgColorModifier, + tagState, + isDisabled, ), ), - child: _buildLayout( - context, - tagBorderModifier, - tagTextColorModifier, - tagBgColorModifier, - tagState, - isDisabled, - ), - ), - ], + ], + ), ), ), ), @@ -211,8 +248,14 @@ class _OudsInputTagState extends State { ); } - Widget _buildLayout(BuildContext context, OudsInputTagControlBorderModifier tagBorderModifier, OudsTagStyleModifier tagTextColorModifier, - OudsInputTagControlBackgroundColorModifier tagBgColorModifier, OudsTagControlState tagState, bool isDisabled) { + Widget _buildLayout( + BuildContext context, + OudsInputTagControlBorderModifier tagBorderModifier, + OudsTagStyleModifier tagTextColorModifier, + OudsInputTagControlBackgroundColorModifier tagBgColorModifier, + OudsTagControlState tagState, + bool isDisabled, + ) { final tagToken = OudsTheme.of(context).componentsTokens(context).tag; final typographyTokens = OudsTheme.of(context).typographyTokens; @@ -222,18 +265,14 @@ class _OudsInputTagState extends State { child: Container( decoration: BoxDecoration( border: tagBorderModifier.getBorder(tagState), - borderRadius: BorderRadius.circular( - tagToken.borderRadius, - ), + borderRadius: BorderRadius.circular(tagToken.borderRadius), ), ), ), // Content (e.g., Row with icon and label)... ClipRRect( - borderRadius: BorderRadius.circular( - tagToken.borderRadius, - ), + borderRadius: BorderRadius.circular(tagToken.borderRadius), child: Container( color: tagBgColorModifier.getBackgroundColor(tagState), padding: EdgeInsetsDirectional.only( @@ -248,16 +287,22 @@ class _OudsInputTagState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Flexible( - child: Text(widget.label, - textAlign: TextAlign.center, - style: typographyTokens.typeLabelStrongMedium(context).copyWith( - color: tagTextColorModifier.getTextColor(tagState), - )), + child: Text( + widget.label, + textAlign: TextAlign.center, + style: typographyTokens + .typeLabelModerateMedium(context) + .copyWith( + color: tagTextColorModifier.getTextColor(tagState), + ), + ), ), SizedBox(width: tagToken.spaceColumnGapDefault), Semantics( container: true, - label: OudsLocalizations.of(context)?.core_inputTag_delete_a11y, + label: OudsLocalizations.of( + context, + )?.core_inputTag_delete_a11y, button: true, child: SvgPicture.asset( excludeFromSemantics: true, @@ -267,7 +312,9 @@ class _OudsInputTagState extends State { package: OudsTheme.of(context).packageName, fit: BoxFit.contain, colorFilter: ColorFilter.mode( - OudsInputTagControlIconColorModifier(context).getIconColor(tagState)!, + OudsInputTagControlIconColorModifier( + context, + ).getIconColor(tagState)!, BlendMode.srcIn, ), ), diff --git a/ouds_core/lib/components/tag/ouds_tag.dart b/ouds_core/lib/components/tag/ouds_tag.dart index 792671b97..a0104019b 100644 --- a/ouds_core/lib/components/tag/ouds_tag.dart +++ b/ouds_core/lib/components/tag/ouds_tag.dart @@ -19,64 +19,25 @@ import 'package:ouds_core/components/tag/internal/ouds_tag_border_modifier.dart' import 'package:ouds_core/components/tag/internal/ouds_tag_size_modifier.dart'; import 'package:ouds_core/components/tag/internal/ouds_tag_status_modifier.dart'; import 'package:ouds_core/components/tag/internal/ouds_tag_text_style_modifier.dart'; +import 'package:ouds_core/components/utilities/app_assets.dart'; import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; - ///The [OudsTagLayout] defines the layout of the tag’s content. /// /// This enum controls whether the tag displays text, an icon, a bullet or loader -enum OudsTagLayout { - textOnly, - textAndBullet, - textAndIcon, -} - -/// Enum representing the state of the tag control. -@Deprecated('Use OudsIconStatus instead. This enum will be removed in a future version.') -enum OudsTagStatus { - neutral, - accent, - positive, - info, - warning, - negative, -} -/// @nodoc -// deprecation remove : this enum is added only to support the deprecated enum and will be removed after deprecation -extension OudsTagStatusConverter on OudsTagStatus { - /// Converts this simple status enum to the corresponding [OudsIconStatus] class instance. - /// - /// Note: For `Neutral` and `Accent`, this conversion does not carry over any - /// custom icon information, as the base enum does not store it. - OudsIconStatus toIconStatus() { - return switch (this) { - OudsTagStatus.neutral => Neutral(), - OudsTagStatus.accent => Accent(), - OudsTagStatus.positive => Positive(), - OudsTagStatus.warning => Warning(), - OudsTagStatus.negative => Negative(), - OudsTagStatus.info => Info(), - }; - } -} +enum OudsTagLayout { textOnly, textAndBullet, textAndIcon } /// The [OudsTagSize] defines the tag's visual size. -enum OudsTagSize { - defaultSize, - small; -} +enum OudsTagSize { defaultSize, small } /// The [OudsTagAppearance] enum defines the visual importance of the tag within the UI. -enum OudsTagAppearance { - emphasized, - muted; -} +enum OudsTagAppearance { emphasized, muted } /// /// [OUDS Tag Design Guidelines](https://r.orange.fr/r/S-ouds-doc-tag) /// -/// **Reference design version : 1.4.0** +/// **Reference design version : 1.5.0** /// /// Tag is a UI element that allows to display short info like a label, keyword, or category. Tag helps users quickly find, group, or understand content. /// @@ -91,39 +52,13 @@ enum OudsTagAppearance { /// * `OudsTag.bullet`: A tag that includes a bullet point next to the text. /// * `OudsTag.icon`: A tag that displays an icon next to the text. /// -/// This API replaces the previous generic constructor and deprecated status model. -/// -/// --- -/// ### Migrating from the Deprecated API -/// -/// The generic `OudsTag()` constructor, the [status] parameter of type [OudsTagStatus], -/// and the [icon] parameter are now deprecated and will be removed in a future -/// version. Please migrate to the new named constructors and the [status] -/// parameter of type [OudsIconStatus] for a more robust and consolidated API. -/// -/// --- -/// ## Migration overview -/// -/// ### 1) Use named constructors -/// Replace the generic `OudsTag()` -/// constructor with `OudsTag.text()`, `OudsTag.icon()`, or `OudsTag.bullet()` -/// based on your needs. -/// -/// ### 2) Replace `OudsTagStatus` with `OudsIconStatus` -/// Replace the old `OudsTagStatus` enum -/// with the new `OudsIconStatus` classes (e.g., `OudsTagStatus.positive` -/// becomes `Positive()`). -/// -/// ### 3) Remove `icon` parameter -/// The `icon` parameter is deprecated and will be removed. -/// Icon selection must now be driven by `status` (`OudsIconStatus`): +/// Icon selection is driven by `status` (`OudsIconStatus`): /// - Functional statuses (`Positive`, `Info`, `Warning`, `Negative`) provide fixed icons. /// - Contextual statuses (`Neutral`, `Accent`) can carry a custom icon asset. /// /// --- /// ## Status model /// -/// New `status` type: /// - [Neutral] (optional custom icon) /// - [Accent] (optional custom icon) /// - [Positive] (fixed functional icon) @@ -154,27 +89,6 @@ enum OudsTagAppearance { /// /// ### Usage Example /// -/// **Migration Example:** -/// -/// **Before (Deprecated API):** -/// ```dart -/// // Simple tag -/// OudsTag( -/// label: 'Old Tag', -/// status: OudsTagStatus.accent, -/// size: OudsTagSize.small, -/// ); -/// -/// // Tag with a custom icon -/// OudsTag( -/// label: 'Custom', -/// layout: OudsTagLayout.textAndIcon, -/// status: OudsTagStatus.neutral, -/// icon: 'assets/custom_icon.svg', -/// ); -/// ``` -/// -/// **After (Modern API):** /// ```dart /// // Simple tag /// OudsTag.text( @@ -198,110 +112,54 @@ enum OudsTagAppearance { class OudsTag extends StatefulWidget { final String label; final bool enabled; - @Deprecated('Use status of type OudsIconStatus instead. This parameter will be removed in a future version.') - final OudsTagStatus? _deprecatedStatus; final OudsTagSize? size; final OudsTagAppearance appearance; - @Deprecated('icon is now defined by status (OudsIconStatus). Use Accent(icon: ...) or Neutral(icon: ...) for custom icons.') - final String? icon; final OudsTagLayout layout; final bool loading; final OudsIconStatus? status; final bool roundedCorners; - /// ⚠️ **DEPRECATED:** Use [OudsTag.text], [OudsTag.icon], or [OudsTag.bullet] constructors instead. - @Deprecated('Use named constructors for clarity: OudsTag.text() for text only type, OudsTag.icon() for text and icon type, or OudsTag.bullet() for text and bullet type.' - ' This constructor will be removed in a future version.') - const OudsTag( - {super.key, - required this.label, - this.enabled = true, - @Deprecated('Use iconStatus instead. This parameter will be removed in a future version.') - final OudsTagStatus? status, - this.appearance = OudsTagAppearance.emphasized, - this.size = OudsTagSize.defaultSize, - @Deprecated('icon is now defined by status (OudsIconStatus). Use Accent(icon: ...) or Neutral(icon: ...) for custom icons.') - this.icon, - this.layout = OudsTagLayout.textOnly, - this.loading = false, - this.roundedCorners = true, - }) : _deprecatedStatus = status, - status = null; - - const OudsTag.text( - {super.key, - required this.label, - this.enabled = true, - required this.status, - this.appearance = OudsTagAppearance.emphasized, - this.size = OudsTagSize.defaultSize, - this.layout = OudsTagLayout.textOnly, - this.loading = false, - this.roundedCorners = true, - }) : icon = null, - _deprecatedStatus = null; + const OudsTag.text({ + super.key, + required this.label, + this.enabled = true, + required this.status, + this.appearance = OudsTagAppearance.emphasized, + this.size = OudsTagSize.defaultSize, + this.layout = OudsTagLayout.textOnly, + this.loading = false, + this.roundedCorners = true, + }); - const OudsTag.bullet( - {super.key, - required this.label, - this.enabled = true, - required this.status, - this.appearance = OudsTagAppearance.emphasized, - this.size = OudsTagSize.defaultSize, - this.layout = OudsTagLayout.textAndBullet, - this.loading = false, - this.roundedCorners = true, - }) : icon = null, - _deprecatedStatus = null; + const OudsTag.bullet({ + super.key, + required this.label, + this.enabled = true, + required this.status, + this.appearance = OudsTagAppearance.emphasized, + this.size = OudsTagSize.defaultSize, + this.layout = OudsTagLayout.textAndBullet, + this.loading = false, + this.roundedCorners = true, + }); - const OudsTag.icon( - {super.key, - required this.label, - this.enabled = true, - required this.status, - this.appearance = OudsTagAppearance.emphasized, - this.size = OudsTagSize.defaultSize, - this.layout = OudsTagLayout.textAndIcon, - this.loading = false, - this.roundedCorners = true, - }) : icon = null, - _deprecatedStatus = null; - - //deprecation remove: The param state will be removed after deprecation - static Widget buildIcon( - BuildContext context, - String? assetName, - OudsTagStatus? state, - OudsIconStatus? status, - OudsTagAppearance hierarchy, - bool isEnabled) { - final statusModifier = OudsTagStatusModifier(context); - - //get the asset name from status for neutral and accent status (icon defined by user) - final assetIconName = statusModifier.getAssetsName(status); - final icon = statusModifier.getStatusIcon(state, status); - - return SvgPicture.asset( - excludeFromSemantics: true, - icon ?? assetName ?? assetIconName ?? "", - package: icon != null ? OudsTheme.of(context).packageName : null, - fit: BoxFit.contain, - colorFilter: ColorFilter.mode( - statusModifier.getStatusIconColor(state,status, hierarchy, isEnabled), - BlendMode.srcIn, - ), - ); - } + const OudsTag.icon({ + super.key, + required this.label, + this.enabled = true, + required this.status, + this.appearance = OudsTagAppearance.emphasized, + this.size = OudsTagSize.defaultSize, + this.layout = OudsTagLayout.textAndIcon, + this.loading = false, + this.roundedCorners = true, + }); @override State createState() => _OudsTagState(); } class _OudsTagState extends State { - - OudsIconStatus? get _effectiveStatus => - widget.status ?? widget._deprecatedStatus?.toIconStatus(); - @override void initState() { super.initState(); @@ -315,27 +173,120 @@ class _OudsTagState extends State { final l10n = OudsLocalizations.of(context); return Semantics( - label: widget.loading ? "${l10n?.core_common_loading_a11y}, ${widget.label}" : widget.label, + label: widget.loading + ? "${l10n?.core_common_loading_a11y}, ${widget.label}" + : widget.label, enabled: widget.enabled, child: Material( color: Colors.transparent, - child: ExcludeSemantics(child: _buildTag(context, tagStatusModifier, tagSizeModifier, tagStyleModifier)), + child: ExcludeSemantics( + child: _buildTag( + context, + tagStatusModifier, + tagSizeModifier, + tagStyleModifier, + ), + ), ), ); } - Widget _buildTag(BuildContext context, OudsTagStatusModifier tagStatusModifier, OudsTagSizeModifier tagSizeModifier, tagStyleModifier) { + Widget _buildTag( + BuildContext context, + OudsTagStatusModifier tagStatusModifier, + OudsTagSizeModifier tagSizeModifier, + tagStyleModifier, + ) { if (widget.loading) { - return _buildTagTextAndLoader(context, tagStatusModifier, tagSizeModifier, tagStyleModifier); + return _buildTagTextAndLoader( + context, + tagStatusModifier, + tagSizeModifier, + tagStyleModifier, + ); } return switch (widget.layout) { - OudsTagLayout.textOnly => _buildTagTextOnly(context, tagStatusModifier, tagSizeModifier, tagStyleModifier), - OudsTagLayout.textAndBullet => _buildTagTextAndBullet(context, tagStatusModifier, tagSizeModifier, tagStyleModifier), - OudsTagLayout.textAndIcon => _buildTagTextAndIcon(context, tagStatusModifier, tagSizeModifier, tagStyleModifier), + OudsTagLayout.textOnly => _buildTagTextOnly( + context, + tagStatusModifier, + tagSizeModifier, + tagStyleModifier, + ), + OudsTagLayout.textAndBullet => _buildTagTextAndBullet( + context, + tagStatusModifier, + tagSizeModifier, + tagStyleModifier, + ), + OudsTagLayout.textAndIcon => _buildTagTextAndIcon( + context, + tagStatusModifier, + tagSizeModifier, + tagStyleModifier, + ), }; } + Widget _buildIcon( + BuildContext context, + OudsIconStatus? status, + OudsTagAppearance hierarchy, + bool isEnabled, + ) { + final statusModifier = OudsTagStatusModifier(context); + + //get the asset name from status for neutral and accent status (icon defined by user) + final assetIconName = statusModifier.getAssetsName(status); + final icon = statusModifier.getStatusIcon(status); + + if (hierarchy == OudsTagAppearance.muted && status is Warning) { + final iconTokens = OudsTheme.of(context).componentsTokens(context).icon; + + return Stack( + alignment: Alignment.center, + children: [ + // Background shape + SizedBox.expand( + child: SvgPicture.asset( + excludeFromSemantics: true, + fit: BoxFit.contain, + AppAssets.icons.componentAlertWarningExternalShape, + colorFilter: ColorFilter.mode( + iconTokens.colorContentStatusWarningExternalShape, + BlendMode.srcIn, + ), + package: OudsTheme.of(context).packageName, + ), + ), + // Foreground shape + SizedBox.expand( + child: SvgPicture.asset( + excludeFromSemantics: true, + fit: BoxFit.contain, + AppAssets.icons.componentAlertWarningInternalShape, + colorFilter: ColorFilter.mode( + iconTokens.colorContentStatusWarningInternalShape, + BlendMode.srcIn, + ), + package: OudsTheme.of(context).packageName, + ), + ), + ], + ); + } + return SvgPicture.asset( + excludeFromSemantics: true, + icon ?? assetIconName ?? "", + package: icon != null ? OudsTheme.of(context).packageName : null, + fit: BoxFit.contain, + colorFilter: ColorFilter.mode( + statusModifier.getStatusIconColor(status, hierarchy, isEnabled), + BlendMode.srcIn, + ), + ); + } + Widget _buildTagTextAndLoader( BuildContext context, OudsTagStatusModifier tagStatusModifier, @@ -343,82 +294,130 @@ class _OudsTagState extends State { OudsTagStyleModifier tagStyleModifier, ) { final minWidthAndHeight = tagSizeModifier.getMinWidthAndHeight(widget.size); - final widthAndHeightAssetsContainer = tagSizeModifier.getAssetsSize(widget.size); + final widthAndHeightAssetsContainer = tagSizeModifier.getAssetsSize( + widget.size, + ); return Container( decoration: BoxDecoration( - borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), + borderRadius: OudsTagControlBorderModifier.getBorderRadius( + context, + widget.roundedCorners, + ), color: OudsTheme.of(context).colorScheme(context).surfaceSecondary, ), - constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, minWidth: minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0), + constraints: BoxConstraints( + minHeight: minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, + minWidth: minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0, + ), padding: tagSizeModifier.getPadding(widget.size, true), child: Row( mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( - width: widthAndHeightAssetsContainer[OudsTagDimensions.width.name], - height: widthAndHeightAssetsContainer[OudsTagDimensions.height.name], + width: MediaQuery.textScalerOf(context).scale( + widthAndHeightAssetsContainer[OudsTagDimensions.width.name] ?? + 0.0, + ), + height: MediaQuery.textScalerOf(context).scale( + widthAndHeightAssetsContainer[OudsTagDimensions.height.name] ?? + 0.0, + ), child: Semantics( child: CircularProgressIndicator( padding: tagSizeModifier.getLoadingAssetsPadding(widget.size), - color: OudsTheme.of(context).colorScheme(context).contentDefault, - strokeWidth: OudsTheme.of(context).spaceScheme(context).scaledThreeExtraSmall, + color: OudsTheme.of( + context, + ).colorScheme(context).contentDefault, + strokeWidth: MediaQuery.textScalerOf(context).scale( + OudsTheme.of( + context, + ).spaceScheme(context).scaledThreeExtraSmall, + ), ), ), ), SizedBox(width: tagSizeModifier.getSizeColumnGap(widget.size)), Flexible( - child: - Text(widget.label, - textAlign: TextAlign.center, - style: tagStyleModifier.buildTagTextStyle( - appearance: widget.appearance, - state: widget._deprecatedStatus, - status: _effectiveStatus, - size: widget.size ?? OudsTagSize.defaultSize, - isLoading: widget.loading, - isEnabled: widget.enabled)), + child: Text( + widget.label, + textAlign: TextAlign.center, + style: tagStyleModifier.buildTagTextStyle( + appearance: widget.appearance, + status: widget.status, + size: widget.size ?? OudsTagSize.defaultSize, + isLoading: widget.loading, + isEnabled: widget.enabled, + ), + ), ), ], ), ); } - Widget _buildTagTextAndIcon(BuildContext context, OudsTagStatusModifier tagStatusModifier, OudsTagSizeModifier tagSizeModifier, OudsTagStyleModifier tagStyleModifier) { + Widget _buildTagTextAndIcon( + BuildContext context, + OudsTagStatusModifier tagStatusModifier, + OudsTagSizeModifier tagSizeModifier, + OudsTagStyleModifier tagStyleModifier, + ) { final minWidthAndHeight = tagSizeModifier.getMinWidthAndHeight(widget.size); - final widthAndHeightAssetsContainer = tagSizeModifier.getAssetsSize(widget.size); + final widthAndHeightAssetsContainer = tagSizeModifier.getAssetsSize( + widget.size, + ); return Container( decoration: BoxDecoration( - borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), - color: tagStatusModifier.getStatusColor(widget._deprecatedStatus,_effectiveStatus, widget.appearance, widget.enabled), + borderRadius: OudsTagControlBorderModifier.getBorderRadius( + context, + widget.roundedCorners, + ), + color: tagStatusModifier.getStatusColor( + widget.status, + widget.appearance, + widget.enabled, + ), + ), + constraints: BoxConstraints( + minHeight: minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, + minWidth: minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0, ), - constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, minWidth: minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0), padding: tagSizeModifier.getPadding(widget.size, true), child: Row( mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - padding: tagSizeModifier.getAssetsPadding(widget.size, OudsTagLayout.textAndIcon), - width: widthAndHeightAssetsContainer[OudsTagDimensions.width.name], - height: widthAndHeightAssetsContainer[OudsTagDimensions.height.name], - child: OudsTag.buildIcon( - context, widget.icon, widget._deprecatedStatus,_effectiveStatus, - widget.appearance, widget.enabled), - ), - SizedBox( - width: tagSizeModifier.getSizeColumnGap(widget.size), + padding: tagSizeModifier.getAssetsPadding( + widget.size, + OudsTagLayout.textAndIcon, + ), + width: MediaQuery.textScalerOf(context).scale( + widthAndHeightAssetsContainer[OudsTagDimensions.width.name] ?? 00, + ), + height: MediaQuery.textScalerOf(context).scale( + widthAndHeightAssetsContainer[OudsTagDimensions.height.name] ?? + 00, + ), + child: _buildIcon( + context, + widget.status, + widget.appearance, + widget.enabled, + ), ), + SizedBox(width: tagSizeModifier.getSizeColumnGap(widget.size)), Flexible( child: Text( widget.label, textAlign: TextAlign.center, style: tagStyleModifier.buildTagTextStyle( - appearance: widget.appearance, state: widget._deprecatedStatus, - status: _effectiveStatus, size: widget.size, isEnabled: widget.enabled), + appearance: widget.appearance, + status: widget.status, + size: widget.size, + isEnabled: widget.enabled, + ), ), ), ], @@ -426,69 +425,115 @@ class _OudsTagState extends State { ); } - Widget _buildTagTextAndBullet(BuildContext context, OudsTagStatusModifier tagStatusModifier, OudsTagSizeModifier tagSizeModifier, OudsTagStyleModifier tagStyleModifier) { + Widget _buildTagTextAndBullet( + BuildContext context, + OudsTagStatusModifier tagStatusModifier, + OudsTagSizeModifier tagSizeModifier, + OudsTagStyleModifier tagStyleModifier, + ) { final tagToken = OudsTheme.of(context).componentsTokens(context).tag; final minWidthAndHeight = tagSizeModifier.getMinWidthAndHeight(widget.size); - final widthAndHeightAssetsContainer = tagSizeModifier.getAssetsSize(widget.size); + final widthAndHeightAssetsContainer = tagSizeModifier.getAssetsSize( + widget.size, + ); return Container( decoration: BoxDecoration( - borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), - color: tagStatusModifier.getStatusColor(widget._deprecatedStatus, _effectiveStatus, widget.appearance, widget.enabled), + borderRadius: OudsTagControlBorderModifier.getBorderRadius( + context, + widget.roundedCorners, + ), + color: tagStatusModifier.getStatusColor( + widget.status, + widget.appearance, + widget.enabled, + ), + ), + constraints: BoxConstraints( + minHeight: minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, + minWidth: minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0, ), - constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, minWidth: minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0), padding: tagSizeModifier.getPadding(widget.size, true), child: Row( mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - padding: tagSizeModifier.getAssetsPadding(widget.size, OudsTagLayout.textAndBullet), - width: widthAndHeightAssetsContainer[OudsTagDimensions.width.name], - height: widthAndHeightAssetsContainer[OudsTagDimensions.height.name], + padding: tagSizeModifier.getAssetsPadding( + widget.size, + OudsTagLayout.textAndBullet, + ), + width: MediaQuery.textScalerOf(context).scale( + widthAndHeightAssetsContainer[OudsTagDimensions.width.name] ?? 0, + ), + height: MediaQuery.textScalerOf(context).scale( + widthAndHeightAssetsContainer[OudsTagDimensions.height.name] ?? 0, + ), child: Container( width: 10, height: 10, decoration: BoxDecoration( color: tagStatusModifier.getStatusIconColor( - widget._deprecatedStatus, _effectiveStatus, - widget.appearance, widget.enabled), + widget.status, + widget.appearance, + widget.enabled, + ), shape: BoxShape.circle, ), ), ), SizedBox( - width: widget.size == OudsTagSize.small ? tagToken.spaceColumnGapSmall : tagToken.spaceColumnGapDefault, + width: widget.size == OudsTagSize.small + ? tagToken.spaceColumnGapSmall + : tagToken.spaceColumnGapDefault, ), Flexible( child: Text( - widget.label, textAlign: TextAlign.center, - style: tagStyleModifier.buildTagTextStyle( - appearance: widget.appearance, state: widget._deprecatedStatus, - status: _effectiveStatus, size: widget.size, - isEnabled: widget.enabled)), + widget.label, + textAlign: TextAlign.center, + style: tagStyleModifier.buildTagTextStyle( + appearance: widget.appearance, + status: widget.status, + size: widget.size, + isEnabled: widget.enabled, + ), + ), ), ], ), ); } - Widget _buildTagTextOnly(BuildContext context, OudsTagStatusModifier tagStatusModifier, OudsTagSizeModifier tagSizeModifier, OudsTagStyleModifier tagStyleModifier) { + Widget _buildTagTextOnly( + BuildContext context, + OudsTagStatusModifier tagStatusModifier, + OudsTagSizeModifier tagSizeModifier, + OudsTagStyleModifier tagStyleModifier, + ) { final minWidthAndHeight = tagSizeModifier.getMinWidthAndHeight(widget.size); return Semantics( child: Stack( children: [ ClipRRect( - borderRadius: OudsTagControlBorderModifier.getBorderRadius(context,widget.roundedCorners), + borderRadius: OudsTagControlBorderModifier.getBorderRadius( + context, + widget.roundedCorners, + ), child: Container( - constraints: BoxConstraints(minHeight: minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, minWidth: minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0), - color: tagStatusModifier.getStatusColor(widget._deprecatedStatus, - _effectiveStatus, widget.appearance, widget.enabled), + constraints: BoxConstraints( + minHeight: + minWidthAndHeight[OudsTagDimensions.height.name] ?? 0.0, + minWidth: + minWidthAndHeight[OudsTagDimensions.width.name] ?? 0.0, + ), + color: tagStatusModifier.getStatusColor( + widget.status, + widget.appearance, + widget.enabled, + ), padding: tagSizeModifier.getPadding(widget.size, false), child: Row( mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Flexible( @@ -496,8 +541,11 @@ class _OudsTagState extends State { widget.label, textAlign: TextAlign.center, style: tagStyleModifier.buildTagTextStyle( - appearance: widget.appearance, state: widget._deprecatedStatus, - status: _effectiveStatus, size: widget.size, isEnabled: widget.enabled), + appearance: widget.appearance, + status: widget.status, + size: widget.size, + isEnabled: widget.enabled, + ), ), ), ], diff --git a/ouds_core/lib/components/top_bar/ouds_top_appbar.dart b/ouds_core/lib/components/top_bar/ouds_top_appbar.dart index 10eea0923..9b549bd13 100644 --- a/ouds_core/lib/components/top_bar/ouds_top_appbar.dart +++ b/ouds_core/lib/components/top_bar/ouds_top_appbar.dart @@ -1,4 +1,3 @@ - /* * // Software Name: OUDS Flutter * // SPDX-FileCopyrightText: Copyright (c) Orange SA @@ -17,19 +16,16 @@ library; import 'package:flutter/material.dart'; +import 'package:ouds_core/components/button/internal/ouds_button_control_state.dart'; +import 'package:ouds_core/components/button/ouds_button.dart'; import 'package:ouds_core/components/top_bar/internal/ouds_top_bar_style_modifier.dart'; import 'package:ouds_core/components/top_bar/internal/ouds_topappbar_actions_modifier.dart'; import 'package:ouds_core/components/top_bar/ouds_top_bar.dart'; import 'package:ouds_core/components/top_bar/ouds_top_bar_action_config.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; -import 'package:ouds_core/components/badge/ouds_badge.dart'; -import 'package:ouds_core/components/button/ouds_button.dart'; -import 'package:ouds_core/components/button/internal/ouds_button_control_state.dart'; /// Defines the avatar type for an avatar action. -enum OudsTopAppBarActionAvatar { - image, monogram -} +enum OudsTopAppBarActionAvatar { image, monogram } /// The [SliverAppBar.toolbarHeight] value defined in [SliverAppBar.medium] for medium app bar const double _mediumHeight = 112; @@ -113,7 +109,7 @@ const double _largeHeight = 152; /// ) /// ``` -class OudsTopAppBar extends StatefulWidget implements PreferredSizeWidget{ +class OudsTopAppBar extends StatefulWidget implements PreferredSizeWidget { final OudsTopBarSize size; final String? title; final List? leadingActions; @@ -125,7 +121,8 @@ class OudsTopAppBar extends StatefulWidget implements PreferredSizeWidget{ final bool showAvatar; final String? icon; - const OudsTopAppBar({super.key, + const OudsTopAppBar({ + super.key, this.size = OudsTopBarSize.small, this.leadingActions, this.title, @@ -135,13 +132,13 @@ class OudsTopAppBar extends StatefulWidget implements PreferredSizeWidget{ this.expandedHeight, this.titleMaxLines = 1, this.showAvatar = false, - this.icon - }) ; + this.icon, + }); @override - State createState() =>_OudsTopAppBarState(); + State createState() => _OudsTopAppBarState(); -// Helper method to calculate the preferred height based on the AppBar size + // Helper method to calculate the preferred height based on the AppBar size static double getHeight(OudsTopBarSize size, double? expandedHeight) { if (size == OudsTopBarSize.medium) { // Use expandedHeight if provided and greater than or equal to _mediumHeight; @@ -170,35 +167,39 @@ class OudsTopAppBar extends StatefulWidget implements PreferredSizeWidget{ } } -class _OudsTopAppBarState extends State{ +class _OudsTopAppBarState extends State { @override PreferredSizeWidget build(BuildContext context) { final topAppBarActionsModifier = OudsTopAppBarActionsModifier(); final topAppBarBackgroundColorModifier = OudsTopBarStyleModifier(context); final trailingActions = widget.trailingActions != null - ? List.generate( - widget.trailingActions!.length, - (index) => widget.trailingActions![index] - .buildTopAppbarTrailingAction(context,widget.showAvatar) - ) : null; + ? List.generate( + widget.trailingActions!.length, + (index) => widget.trailingActions![index] + .buildTopAppbarTrailingAction(context, widget.showAvatar), + ) + : null; - switch (widget.size){ + switch (widget.size) { case OudsTopBarSize.small: return _buildSmallTopAppBar( - topAppBarActionsModifier, - topAppBarBackgroundColorModifier, - trailingActions); + topAppBarActionsModifier, + topAppBarBackgroundColorModifier, + trailingActions, + ); case OudsTopBarSize.medium: return _buildMediumTopAppBar( - topAppBarActionsModifier, - topAppBarBackgroundColorModifier, - trailingActions); + topAppBarActionsModifier, + topAppBarBackgroundColorModifier, + trailingActions, + ); case OudsTopBarSize.large: return _buildLargeTopAppBar( - topAppBarActionsModifier, - topAppBarBackgroundColorModifier, - trailingActions); + topAppBarActionsModifier, + topAppBarBackgroundColorModifier, + trailingActions, + ); } } @@ -207,38 +208,43 @@ class _OudsTopAppBarState extends State{ /// This method creates a [PreferredSize] widget that contains a styled [AppBar] /// with optional leading and action widgets, background blur effect, and border decoration. PreferredSize _buildSmallTopAppBar( - OudsTopAppBarActionsModifier actionsModifier, - OudsTopBarStyleModifier styleModifier, - List? trailingActions - ){ - final backgroundColor = styleModifier.getBackgroundColor(widget.translucent); + OudsTopAppBarActionsModifier actionsModifier, + OudsTopBarStyleModifier styleModifier, + List? trailingActions, + ) { + final backgroundColor = styleModifier.getBackgroundColor( + widget.translucent, + ); return PreferredSize( preferredSize: Size.fromHeight(widget.preferredSize.height), child: ClipRect( - child: BackdropFilter(filter: styleModifier.getBlurEffect(), + child: BackdropFilter( + filter: styleModifier.getBlurEffect(), child: Container( - decoration: BoxDecoration( - border: styleModifier.getBorder(), - ), + decoration: BoxDecoration(border: styleModifier.getBorder()), child: AppBar( centerTitle: widget.centerTitle, title: Text( - widget.title ?? "", - maxLines: 1, - style: TextStyle( - color: OudsTheme.of(context).colorScheme(context).contentDefault, - overflow: TextOverflow.ellipsis, - fontFamily: OudsTheme.of(context).fontFamily, - ) + widget.title ?? "", + maxLines: 1, + style: TextStyle( + color: OudsTheme.of( + context, + ).colorScheme(context).contentDefault, + overflow: TextOverflow.ellipsis, + fontFamily: OudsTheme.of(context).fontFamily, + ), ), automaticallyImplyLeading: false, leading: actionsModifier.getLeadingIconButton( - context, widget.leadingActions?.first), + context, + widget.leadingActions?.first, + ), actions: trailingActions, backgroundColor: backgroundColor, ), ), - ) , + ), ), ); } @@ -249,25 +255,27 @@ class _OudsTopAppBarState extends State{ /// with a [SliverAppBar] that supports expanded height, custom title, leading widget, /// actions, and styling options such as background blur and border decoration. PreferredSize _buildMediumTopAppBar( - OudsTopAppBarActionsModifier actionsModifier, - OudsTopBarStyleModifier styleModifier, - List? trailingActions - ) { + OudsTopAppBarActionsModifier actionsModifier, + OudsTopBarStyleModifier styleModifier, + List? trailingActions, + ) { final backgroundColor = styleModifier.getBackgroundColor( - widget.translucent); + widget.translucent, + ); // Determine the height: if expandedHeight is null or less than _mediumHeight, // use _mediumHeight; otherwise, use expandedHeight entered by user - final height = (widget.expandedHeight == null || widget.expandedHeight! < _mediumHeight) + final height = + (widget.expandedHeight == null || + widget.expandedHeight! < _mediumHeight) ? _mediumHeight : widget.expandedHeight!; return PreferredSize( preferredSize: Size.fromHeight(height), child: ClipRect( - child: BackdropFilter(filter: styleModifier.getBlurEffect(), + child: BackdropFilter( + filter: styleModifier.getBlurEffect(), child: Container( - decoration: BoxDecoration( - border: styleModifier.getBorder(), - ), + decoration: BoxDecoration(border: styleModifier.getBorder()), child: CustomScrollView( slivers: [ SliverAppBar.medium( @@ -275,15 +283,12 @@ class _OudsTopAppBarState extends State{ title: Text( widget.title ?? "", style: TextStyle( - color: OudsTheme - .of(context) - .colorScheme(context) - .contentDefault, - fontFamily: Theme - .of(context) - .appBarTheme - .titleTextStyle - ?.fontFamily, + color: OudsTheme.of( + context, + ).colorScheme(context).contentDefault, + fontFamily: Theme.of( + context, + ).appBarTheme.titleTextStyle?.fontFamily, ), maxLines: widget.titleMaxLines, softWrap: true, @@ -292,15 +297,22 @@ class _OudsTopAppBarState extends State{ automaticallyImplyLeading: false, leading: widget.leadingActions?.isNotEmpty == true ? actionsModifier.getLeadingIconButton( - context, widget.leadingActions!.first) + context, + widget.leadingActions!.first, + ) : null, actions: trailingActions != null ? actionsModifier - .getTrailingActionList(context, widget.trailingActions,trailingActions) - ?.map((action) => Center(child: action)).toList() + .getTrailingActionList( + context, + widget.trailingActions, + trailingActions, + ) + ?.map((action) => Center(child: action)) + .toList() : null, backgroundColor: backgroundColor, - ) + ), ], ), ), @@ -315,58 +327,70 @@ class _OudsTopAppBarState extends State{ /// with a [SliverAppBar] configured for large display, supporting expanded height, /// custom title, leading widget, actions, and styling options such as background blur and border decoration. PreferredSize _buildLargeTopAppBar( - OudsTopAppBarActionsModifier actionsModifier, - OudsTopBarStyleModifier styleModifier, - List? trailingActions - ) { - final backgroundColor = styleModifier.getBackgroundColor(widget.translucent); + OudsTopAppBarActionsModifier actionsModifier, + OudsTopBarStyleModifier styleModifier, + List? trailingActions, + ) { + final backgroundColor = styleModifier.getBackgroundColor( + widget.translucent, + ); // Determine the height: if expandedHeight is null or less than _largeHeight, // use _largeHeight; otherwise, use expandedHeight entered by user - final height = (widget.expandedHeight == null || widget.expandedHeight! < _largeHeight) + final height = + (widget.expandedHeight == null || widget.expandedHeight! < _largeHeight) ? _largeHeight : widget.expandedHeight!; - return PreferredSize( - preferredSize: Size.fromHeight(height), - child: ClipRect( - child: BackdropFilter(filter: styleModifier.getBlurEffect(), - child: Container( - decoration: BoxDecoration( - border: styleModifier.getBorder(), - ), - child: CustomScrollView( - slivers: [ - SliverAppBar.large( - expandedHeight: height, - title: Text( - widget.title ?? "", - style: TextStyle( - color: OudsTheme.of(context).colorScheme(context).contentDefault, - fontFamily: Theme.of(context).appBarTheme.titleTextStyle?.fontFamily, - ), - maxLines: widget.titleMaxLines, - softWrap: true, - overflow: TextOverflow.ellipsis, + return PreferredSize( + preferredSize: Size.fromHeight(height), + child: ClipRect( + child: BackdropFilter( + filter: styleModifier.getBlurEffect(), + child: Container( + decoration: BoxDecoration(border: styleModifier.getBorder()), + child: CustomScrollView( + slivers: [ + SliverAppBar.large( + expandedHeight: height, + title: Text( + widget.title ?? "", + style: TextStyle( + color: OudsTheme.of( + context, + ).colorScheme(context).contentDefault, + fontFamily: Theme.of( + context, + ).appBarTheme.titleTextStyle?.fontFamily, ), - automaticallyImplyLeading: false, - leading: actionsModifier.getLeadingIconButton( - context, widget.leadingActions!.first,), - actions: trailingActions != null - ? actionsModifier - .getTrailingActionList(context,widget.trailingActions,trailingActions) - ?.map((action) => Center(child: action)).toList() - : null, - backgroundColor: backgroundColor, + maxLines: widget.titleMaxLines, + softWrap: true, + overflow: TextOverflow.ellipsis, ), - ], - ), + automaticallyImplyLeading: false, + leading: actionsModifier.getLeadingIconButton( + context, + widget.leadingActions!.first, + ), + actions: trailingActions != null + ? actionsModifier + .getTrailingActionList( + context, + widget.trailingActions, + trailingActions, + ) + ?.map((action) => Center(child: action)) + .toList() + : null, + backgroundColor: backgroundColor, + ), + ], ), ), - ) + ), + ), ); } } - /// Configuration class for the Avatar component within the [OudsTopAppBar]. /// /// This class defines the visual and accessibility properties of an avatar, @@ -393,7 +417,7 @@ class OudsTopAppBarAvatarConfig { this.monogram, this.contentDescription, this.monogramBackgroundColor, - this.monogramColor + this.monogramColor, }); } @@ -410,15 +434,10 @@ class OudsTopAppBarAvatarConfig { /// - The widget handles tap events and updates its visual state accordingly. class BadgeIconButton extends StatefulWidget { final String? icon; - final OudsTopAppBarActionBadge? badge; + final OudsTopBarActionBadge? badge; final VoidCallback? onPressed; - const BadgeIconButton({ - super.key, - this.icon, - this.badge, - this.onPressed, - }); + const BadgeIconButton({super.key, this.icon, this.badge, this.onPressed}); @override State createState() => _BadgeIconButtonState(); @@ -430,7 +449,6 @@ class _BadgeIconButtonState extends State { @override Widget build(BuildContext context) { - final buttonStateDeterminer = OudsButtonControlStateDeterminer( enabled: widget.onPressed != null, isPressed: _isPressed, @@ -451,40 +469,9 @@ class _BadgeIconButtonState extends State { appearance: OudsButtonAppearance.minimal, icon: widget.icon, onPressed: widget.onPressed, - ).buildIconButtonWithBadge( - context, - widget.badge, - buttonState, - ), + ).buildIconButtonWithBadge(context, widget.badge, buttonState), ), ), ); } } - -/// A badge in top app bar action -/// -/// * See [OudsBadge] -/// -/// - [contentDescription]: Content description of the badge, needed for accessibility support. -/// - [count]: Optional integer to display as badge count. -/// -/// Example usage: -/// ```dart -/// OudsTopAppBarActionBadge( -/// contentDescription: 'Unread messages', -/// count: 5, -/// ); -/// ``` -/// -class OudsTopAppBarActionBadge { - final String contentDescription; - final String? count; - - const OudsTopAppBarActionBadge({ - required this.contentDescription, - this.count, - }); - - bool get hasCount => count != null; -} diff --git a/ouds_core/lib/components/top_bar/ouds_top_bar.dart b/ouds_core/lib/components/top_bar/ouds_top_bar.dart index a10eb0dd7..5aacab344 100644 --- a/ouds_core/lib/components/top_bar/ouds_top_bar.dart +++ b/ouds_core/lib/components/top_bar/ouds_top_bar.dart @@ -1,4 +1,3 @@ - /* * // Software Name: OUDS Flutter * // SPDX-FileCopyrightText: Copyright (c) Orange SA @@ -36,10 +35,12 @@ typedef OudsAppBar = OudsTopBar; enum OudsTopBarSize { /// A standard-height top bar. small, + /// An expanded-height top bar.(Material only). medium, + /// A larger expanded-height top bar, often used for prominent titles or imagery. - large + large, } /// Defines the type of action to be displayed in an [OudsTopBar]. @@ -171,8 +172,7 @@ enum OudsTopBarActionType { /// * [OudsToolbarTop], the Cupertino (iOS) implementation. /// * [OudsTopBarActionConfig], the configuration object for actions. /// -class OudsTopBar extends StatelessWidget implements PreferredSizeWidget{ - +class OudsTopBar extends StatelessWidget implements PreferredSizeWidget { /// Common parameters final String? title; final bool translucent; @@ -205,12 +205,12 @@ class OudsTopBar extends StatelessWidget implements PreferredSizeWidget{ leadingActions: leadingActions, trailingActions: trailingActions, ); - }else{ + } else { // Material only supports single leading action assert( - leadingActions == null || leadingActions!.length <= 1, - 'Material variant only supports a single leading action. ' - 'Received ${leadingActions?.length} actions.', + leadingActions == null || leadingActions!.length <= 1, + 'Material variant only supports a single leading action. ' + 'Received ${leadingActions?.length} actions.', ); return OudsTopAppBar( title: title, @@ -231,7 +231,10 @@ class OudsTopBar extends StatelessWidget implements PreferredSizeWidget{ @override Size get preferredSize => defaultTargetPlatform == TargetPlatform.iOS ? OudsToolbarTop.getPreferredSize - : OudsTopAppBar.getPreferredSize(size: size,expandedHeight: materialConfig?.expandedHeight); + : OudsTopAppBar.getPreferredSize( + size: size, + expandedHeight: materialConfig?.expandedHeight, + ); /// Returns the preferred size based on the platform: OudsToolbarTop size for iOS, /// OudsTopAppBar size for Android and other platforms. @@ -245,12 +248,16 @@ class OudsTopBar extends StatelessWidget implements PreferredSizeWidget{ /// /// Returns: /// - A [Size] object representing the preferred size. - static Size getPreferredSize({OudsTopBarSize? size, double? expandedHeight}){ - return defaultTargetPlatform == TargetPlatform.iOS + static Size getPreferredSize({OudsTopBarSize? size, double? expandedHeight}) { + return defaultTargetPlatform == TargetPlatform.iOS ? OudsToolbarTop.getPreferredSize - : OudsTopAppBar.getPreferredSize(size: size!,expandedHeight: expandedHeight); + : OudsTopAppBar.getPreferredSize( + size: size!, + expandedHeight: expandedHeight, + ); } } + /// A configuration object for Material-specific properties. /// /// - [centerTitle]: Whether to center the title. Defaults to false. @@ -288,4 +295,28 @@ class OudsTopAppBarConfig { this.titleMaxLines = 1, this.showAvatar = false, }); -} \ No newline at end of file +} + +/// A badge in top bar action +/// +/// * See [OudsBadge] +/// +/// - [contentDescription]: Content description of the badge, needed for accessibility support. +/// - [count]: Optional integer to display as badge count. +/// +/// Example usage: +/// ```dart +/// OudsTopBarActionBadge( +/// contentDescription: 'Unread messages', +/// count: 5, +/// ); +/// ``` +/// +class OudsTopBarActionBadge { + final String contentDescription; + final String? count; + + const OudsTopBarActionBadge({required this.contentDescription, this.count}); + + bool get hasCount => count != null; +} diff --git a/ouds_core/lib/components/top_bar/ouds_top_bar_action_config.dart b/ouds_core/lib/components/top_bar/ouds_top_bar_action_config.dart index 262db08ef..2e9fbf88f 100644 --- a/ouds_core/lib/components/top_bar/ouds_top_bar_action_config.dart +++ b/ouds_core/lib/components/top_bar/ouds_top_bar_action_config.dart @@ -1,4 +1,3 @@ - /* * // Software Name: OUDS Flutter * // SPDX-FileCopyrightText: Copyright (c) Orange SA @@ -13,12 +12,16 @@ */ /// {@category TopBar} library; + import 'package:flutter/cupertino.dart'; import 'package:ouds_core/components/avatar/ouds_avatar.dart'; +import 'package:ouds_core/components/badge/ouds_badge.dart'; +import 'package:ouds_core/components/common/ouds_icon_status.dart'; import 'package:ouds_core/components/top_bar/internal/ouds_toolbar_top_action_modifier.dart'; import 'package:ouds_core/components/top_bar/internal/ouds_toolbar_top_text_style_modifier.dart'; import 'package:ouds_core/components/top_bar/ouds_top_appbar.dart'; import 'package:ouds_core/components/top_bar/ouds_top_bar.dart'; +import 'package:ouds_core/components/utilities/badge_border_utils.dart'; import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; import 'package:ouds_theme_contract/ouds_theme.dart'; import 'package:ouds_theme_contract/ouds_theme_contract.dart'; @@ -36,6 +39,7 @@ import 'package:ouds_theme_contract/ouds_theme_contract.dart'; /// - [contentDescription]: Accessibility description for the action. /// - [widget]: A custom widget to display as the action. This is only used when [type] is [OudsTopBarActionType.widget]. /// - [icon]: Path to custom icon asset. This is used when [type] is [OudsTopBarActionType.icon] or [OudsTopBarActionType.custom]. +/// - [badge]: Configuration for a notification badge. This is used when [type] is [OudsTopBarActionType.icon]. /// /// ### iOS/Cupertino-Only Parameters /// @@ -50,7 +54,6 @@ import 'package:ouds_theme_contract/ouds_theme_contract.dart'; /// /// ### Android/Material-Only Parameters /// -/// - [badge]: Configuration for a notification badge. This is only used on Material when [type] is [OudsTopBarActionType.icon]. /// - [avatarConfig]: Configuration for an avatar. This is only used on Material when [type] is [OudsTopBarActionType.avatar]. /// /// ### Example of usage @@ -96,11 +99,12 @@ import 'package:ouds_theme_contract/ouds_theme_contract.dart'; /// class OudsTopBarActionConfig { ///Common parameters - final OudsTopBarActionType type ; + final OudsTopBarActionType type; final VoidCallback? onActionPressed; final String? contentDescription; final Widget? widget; final String? icon; + final OudsTopBarActionBadge? badge; ///Cupertino-Only Parameters final String? actionLabel; @@ -108,7 +112,6 @@ class OudsTopBarActionConfig { ///Material-Only Parameters final OudsTopAppBarAvatarConfig? avatarConfig; - final OudsTopAppBarActionBadge? badge; /// Private base constructor. const OudsTopBarActionConfig._({ @@ -120,17 +123,15 @@ class OudsTopBarActionConfig { this.avatarConfig, this.actionLabel, this.icon, - this.previousPageTitle + this.previousPageTitle, }); /// Creates a configuration for an icon-based action. - /// - /// The [badge] parameter is only applied on Material and will be ignored on iOS. factory OudsTopBarActionConfig.icon({ required String icon, // Make this non-nullable for clarity VoidCallback? onActionPressed, String? contentDescription, - OudsTopAppBarActionBadge? badge, // Material-only + OudsTopBarActionBadge? badge, }) { return OudsTopBarActionConfig._( type: OudsTopBarActionType.icon, @@ -244,9 +245,7 @@ class OudsTopBarActionConfig { /// Creates a configuration for an empty action, resulting in no visible output. factory OudsTopBarActionConfig.none() { - return OudsTopBarActionConfig._( - type: OudsTopBarActionType.none, - ); + return OudsTopBarActionConfig._(type: OudsTopBarActionType.none); } /// An internal method that builds the widget for this action on the iOS platform. @@ -265,13 +264,11 @@ class OudsTopBarActionConfig { /// **Throws:** /// - [UnimplementedError] if the action [type] is not supported for the iOS platform. - Widget buildToolbarTopAction( - BuildContext context, - bool isLeadingAction) { + Widget buildToolbarTopAction(BuildContext context, bool isLeadingAction) { final ModalRoute? currentRoute = ModalRoute.of(context); switch (type) { - // TEXT ACTION + // TEXT ACTION case OudsTopBarActionType.text: return _CustomCupertinoButton( type: type, @@ -279,7 +276,7 @@ class OudsTopBarActionConfig { actionLabel: actionLabel, isLeadingAction: isLeadingAction, ); - // BACK ACTION (icon + optional label) + // BACK ACTION (icon + optional label) case OudsTopBarActionType.back: return _CustomCupertinoButton( contentDescription: contentDescription, @@ -288,21 +285,44 @@ class OudsTopBarActionConfig { route: currentRoute, type: type, ); - // NO ACTION + // NO ACTION case OudsTopBarActionType.none: return SizedBox.shrink(); - // ICON ACTION + // ICON ACTION case OudsTopBarActionType.icon: + final customCupertinoButton = _CustomCupertinoButton( + contentDescription: contentDescription, + type: type, + onActionPressed: onActionPressed, + icon: icon, + ); return Padding( - padding: EdgeInsetsDirectional.only(start : isLeadingAction ? 16 : 0, end: isLeadingAction ? 0 : 16), - child: _CustomCupertinoButton( - contentDescription: contentDescription, - type: type, - onActionPressed: onActionPressed, - icon: icon - ), + padding: EdgeInsetsDirectional.only( + start: isLeadingAction ? 16 : 0, + end: isLeadingAction ? 0 : 16, + ), + child: badge != null + ? buildBadgeWithBorder( + context: context, + hasCount: badge!.hasCount, + child: badge!.hasCount + ? OudsBadge.count( + semanticsLabel: badge?.contentDescription, + label: badge?.count.toString(), + status: Negative(), + size: OudsBadgeSize.medium, + child: customCupertinoButton, + ) + : OudsBadge.standard( + semanticsLabel: badge?.contentDescription, + status: Negative(), + size: OudsBadgeSize.xsmall, + child: customCupertinoButton, + ), + ) + : customCupertinoButton, ); - // CUSTOM ACTION (fully custom widget) + // CUSTOM ACTION (fully custom widget) case OudsTopBarActionType.widget: return widget ?? SizedBox.shrink(); default: @@ -310,7 +330,6 @@ class OudsTopBarActionConfig { } } - /// An internal method that builds the widget for this action on the Android platform. /// /// This method is called by [OudsTopAppBar] to render the appropriate @@ -330,11 +349,9 @@ class OudsTopBarActionConfig { /// **Throws:** /// - [UnimplementedError] if the action [type] is not supported for the Material platform. /// - Widget buildTopAppbarTrailingAction(BuildContext context,bool showAvatar) { - + Widget buildTopAppbarTrailingAction(BuildContext context, bool showAvatar) { final theme = OudsTheme.of(context); - final iconButtonWithBadge = - MergeSemantics( + final iconButtonWithBadge = MergeSemantics( child: Semantics( label: contentDescription, child: BadgeIconButton( @@ -350,11 +367,10 @@ class OudsTopBarActionConfig { switch (type) { case OudsTopBarActionType.icon: return iconButtonWithBadge; - case OudsTopBarActionType.avatar :{ - return showAvatar - ? _buildAvatar(context,theme) - : SizedBox.shrink(); - } + case OudsTopBarActionType.avatar: + { + return showAvatar ? _buildAvatar(context, theme) : SizedBox.shrink(); + } case OudsTopBarActionType.widget: return widget!; default: @@ -374,11 +390,11 @@ class OudsTopBarActionConfig { child: OudsAvatar( image: avatarConfig?.image, monogramBackgroundColor: - avatarConfig?.monogramBackgroundColor ?? + avatarConfig?.monogramBackgroundColor ?? theme.colorScheme(context).surfaceInverseHigh, monogram: avatarConfig?.monogram, monogramColor: - avatarConfig?.monogramColor ?? + avatarConfig?.monogramColor ?? theme.colorScheme(context).contentOnActionEnabled, onClick: onActionPressed, ), @@ -412,7 +428,11 @@ class _ToolbarTopBackChevron extends StatelessWidget { final VoidCallback? onActionPressed; final bool isPressed; - const _ToolbarTopBackChevron(this.contentDescription, this.onActionPressed,this.isPressed); + const _ToolbarTopBackChevron( + this.contentDescription, + this.onActionPressed, + this.isPressed, + ); @override Widget build(BuildContext context) { @@ -421,21 +441,30 @@ class _ToolbarTopBackChevron extends StatelessWidget { // Builds the back icon using a modifier class, which centralizes icon creation. // The icon's appearance changes based on whether it's enabled or pressed. Widget iconWidget = Semantics( - label: contentDescription - ?? OudsLocalizations.of(context)?.core_topAppBar_backNavigationIcon_a11y, - child: actionModifier.buildBackIcon(onActionPressed != null,isPressed), + label: + contentDescription ?? + OudsLocalizations.of(context)?.core_topAppBar_backNavigationIcon_a11y, + child: actionModifier.buildBackIcon(onActionPressed != null, isPressed), ); // KeyedSubtree gives this part of the widget tree a stable identity, // which can be useful for testing or advanced framework features. - return KeyedSubtree(key: StandardComponentType.backButton.key, child: iconWidget); + return KeyedSubtree( + key: StandardComponentType.backButton.key, + child: iconWidget, + ); } } /// A private widget that displays the title of the previous page next to the /// back chevron, a common pattern in iOS navigation. class _ToolbarTopBackLabel extends StatelessWidget { - const _ToolbarTopBackLabel({required this.specifiedPreviousTitle, required this.route, this.onActionPressed, required this.isPressed}); + const _ToolbarTopBackLabel({ + required this.specifiedPreviousTitle, + required this.route, + this.onActionPressed, + required this.isPressed, + }); final String? specifiedPreviousTitle; final ModalRoute? route; @@ -443,7 +472,11 @@ class _ToolbarTopBackLabel extends StatelessWidget { final bool isPressed; // Builds the Text widget for the previous page's title. - Widget _buildPreviousTitleWidget(BuildContext context, String? previousTitle, Widget? child) { + Widget _buildPreviousTitleWidget( + BuildContext context, + String? previousTitle, + Widget? child, + ) { if (previousTitle == null) { return const SizedBox.shrink(); } @@ -454,7 +487,7 @@ class _ToolbarTopBackLabel extends StatelessWidget { previousTitle, maxLines: 1, overflow: TextOverflow.ellipsis, - style: textStyleModifier.getTextActionStyle(onActionPressed,isPressed), + style: textStyleModifier.getTextActionStyle(onActionPressed, isPressed), ); // If the title is too long, it defaults to the standard "Back" label @@ -463,7 +496,11 @@ class _ToolbarTopBackLabel extends StatelessWidget { textWidget = Text(CupertinoLocalizations.of(context).backButtonLabel); } - return Align(alignment: AlignmentDirectional.centerStart, widthFactor: 1.0, child: textWidget); + return Align( + alignment: AlignmentDirectional.centerStart, + widthFactor: 1.0, + child: textWidget, + ); } @override @@ -474,9 +511,10 @@ class _ToolbarTopBackLabel extends StatelessWidget { } // Otherwise, try to automatically get the title from the previous route // using CupertinoRouteTransitionMixin. - else if (route is CupertinoRouteTransitionMixin && !route!.isFirst) { + else if (route is CupertinoRouteTransitionMixin && + !route!.isFirst) { final CupertinoRouteTransitionMixin cupertinoRoute = - route! as CupertinoRouteTransitionMixin; + route! as CupertinoRouteTransitionMixin; // ValueListenableBuilder ensures the widget rebuilds if the previous // route's title changes. return ValueListenableBuilder( @@ -502,16 +540,16 @@ class _CustomCupertinoButton extends StatefulWidget { final String? actionLabel; final String? icon; - const _CustomCupertinoButton( - { - this.contentDescription, - this.onActionPressed, - this.previousPageTitle, - this.route, - required this.type, - this.isLeadingAction, - this.actionLabel, - this.icon}); + const _CustomCupertinoButton({ + this.contentDescription, + this.onActionPressed, + this.previousPageTitle, + this.route, + required this.type, + this.isLeadingAction, + this.actionLabel, + this.icon, + }); @override State<_CustomCupertinoButton> createState() => _CustomCupertinoButtonState(); @@ -542,34 +580,47 @@ class _CustomCupertinoButtonState extends State<_CustomCupertinoButton> { } /// Builds the appropriate CupertinoButton based on the action type. - Widget _buildButtonByType(BuildContext context, OudsToolbarTopTextStyleModifier textStyleModifier, OudsToolbarTopActionModifier actionModifier) { + Widget _buildButtonByType( + BuildContext context, + OudsToolbarTopTextStyleModifier textStyleModifier, + OudsToolbarTopActionModifier actionModifier, + ) { switch (widget.type) { case OudsTopBarActionType.back: return CupertinoButton( pressedOpacity: 1, // Disable default opacity feedback. - padding: EdgeInsetsDirectional.only(top: 5.0,start: 8), + padding: EdgeInsetsDirectional.only(top: 5.0, start: 8), child: DefaultTextStyle( - // The text style is passed the `_isPressed` state for custom feedback. - style: textStyleModifier.getTextActionStyle(widget.onActionPressed, _isPressed), - child: ConstrainedBox( - constraints: BoxConstraints(minWidth: _kNavBarBackButtonTapWidth), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - _ToolbarTopBackChevron(widget.contentDescription, widget.onActionPressed, _isPressed), - const Padding(padding: EdgeInsetsDirectional.only(start: 2.0)), - Flexible( - child: _ToolbarTopBackLabel( - specifiedPreviousTitle: widget.previousPageTitle, - route: widget.route, - onActionPressed: widget.onActionPressed, - isPressed: _isPressed, - ), + // The text style is passed the `_isPressed` state for custom feedback. + style: textStyleModifier.getTextActionStyle( + widget.onActionPressed, + _isPressed, + ), + child: ConstrainedBox( + constraints: BoxConstraints(minWidth: _kNavBarBackButtonTapWidth), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + _ToolbarTopBackChevron( + widget.contentDescription, + widget.onActionPressed, + _isPressed, + ), + const Padding( + padding: EdgeInsetsDirectional.only(start: 2.0), + ), + Flexible( + child: _ToolbarTopBackLabel( + specifiedPreviousTitle: widget.previousPageTitle, + route: widget.route, + onActionPressed: widget.onActionPressed, + isPressed: _isPressed, ), - ], - ), + ), + ], ), ), + ), onPressed: () { if (widget.onActionPressed != null) { widget.onActionPressed!(); @@ -594,7 +645,10 @@ class _CustomCupertinoButtonState extends State<_CustomCupertinoButton> { maxLines: 1, overflow: TextOverflow.ellipsis, // Style changes based on pressed state. - style: textStyleModifier.getTextActionStyle(widget.onActionPressed, _isPressed), + style: textStyleModifier.getTextActionStyle( + widget.onActionPressed, + _isPressed, + ), ), ); case OudsTopBarActionType.icon: @@ -606,10 +660,14 @@ class _CustomCupertinoButtonState extends State<_CustomCupertinoButton> { child: CupertinoButton( pressedOpacity: 1, minimumSize: Size(26, 26), - padding: EdgeInsetsDirectional.only(top: 5), + padding: EdgeInsetsDirectional.only(top: 0), onPressed: widget.onActionPressed, // The icon's appearance changes based on the pressed state. - child: actionModifier.buildActionIcon(widget.icon, widget.onActionPressed != null, _isPressed), + child: actionModifier.buildActionIcon( + widget.icon, + widget.onActionPressed != null, + _isPressed, + ), ), ), ); @@ -617,4 +675,4 @@ class _CustomCupertinoButtonState extends State<_CustomCupertinoButton> { return SizedBox.shrink(); } } -} \ No newline at end of file +} diff --git a/ouds_core/lib/components/utilities/app_assets.dart b/ouds_core/lib/components/utilities/app_assets.dart index 19e24f485..7eeb60f1f 100644 --- a/ouds_core/lib/components/utilities/app_assets.dart +++ b/ouds_core/lib/components/utilities/app_assets.dart @@ -72,6 +72,15 @@ class _Icons { 'assets/functional/social-and-engagement/heart-empty.svg'; final String functionalNavigationMenu = 'assets/functional/navigation/menu.svg'; + final String badgeIconWarningExternalShape = + 'assets/component/badge-icon/warning-external-shape.svg'; + final String badgeIconWarningInternalShape = + 'assets/component/badge-icon/warning-internal-shape.svg'; + final String badgeIconErrorFill = + 'assets/component/badge-icon/error-fill.svg'; + final String badgeIconInfoFill = 'assets/component/badge-icon/info-fill.svg'; + final String badgeIconTickConfirmationFill = + 'assets/component/badge-icon/tick-confirmation-fill.svg'; } class _Fonts { diff --git a/ouds_core/lib/components/utilities/badge_border_utils.dart b/ouds_core/lib/components/utilities/badge_border_utils.dart new file mode 100644 index 000000000..b5e8a5779 --- /dev/null +++ b/ouds_core/lib/components/utilities/badge_border_utils.dart @@ -0,0 +1,127 @@ +/* + * // Software Name: OUDS Flutter + * // SPDX-FileCopyrightText: Copyright (c) Orange SA + * // SPDX-License-Identifier: MIT + * // + * // This software is distributed under the MIT license, + * // the text of which is available at https://opensource.org/license/MIT/ + * // or see the "LICENSE" file for more details. + * // + * // Software description: Flutter library of reusable graphical components + * // + */ + +/// @nodoc +library; + +import 'package:flutter/material.dart'; +import 'package:ouds_theme_contract/ouds_theme.dart'; + +/// Wraps [child] in a [_BadgeBorderWrapper] that draws a 1-px circular border +/// ring around the [OudsBadge] indicator. +/// +/// The wrapper is a [StatelessWidget] so `badgeRadius` is read from its own +/// [BuildContext] — the same context (and the same clamped [MediaQuery]) that +/// [OudsBadge] uses — preventing a stale-radius gap when the system text scale +/// exceeds the navigation-bar cap (e.g. on iOS at accessibility sizes > 160%). +/// +/// - [hasCount] `true` for a count badge (medium, 16 dp), +/// `false` for a dot badge (xsmall, 8 dp). +Widget buildBadgeWithBorder({ + required BuildContext context, + required Widget child, + required bool hasCount, +}) { + return _BadgeBorderWrapper(hasCount: hasCount, child: child); +} + +class _BadgeBorderWrapper extends StatelessWidget { + const _BadgeBorderWrapper({required this.hasCount, required this.child}); + + final bool hasCount; + final Widget child; + + @override + Widget build(BuildContext context) { + final bar = OudsTheme.of(context).componentsTokens(context).bar; + final badgeTokens = OudsTheme.of(context).componentsTokens(context).badge; + + final badgeRadius = + MediaQuery.textScalerOf( + context, + ).scale(hasCount ? badgeTokens.sizeMedium : badgeTokens.sizeXsmall) / + 2; + + return Stack( + clipBehavior: Clip.none, + children: [ + child, + Positioned.fill( + child: IgnorePointer( + child: CustomPaint( + painter: _BadgeBorderPainter( + badgeRadius: badgeRadius, + hasCount: hasCount, + borderColor: bar.colorBorderBadge, + ), + ), + ), + ), + ], + ); + } +} + +/// Paints the circular border ring around the badge indicator. +/// +/// Centre derived from Flutter Badge's `_RenderBadge.performLayout`: +/// +/// - **Dot** (`!hasCount`): `centre = (W − r, r)` — tracks radius as zoom grows. +/// - **Count** (`hasCount`): `centre = (W − 12 + r, 4)` +/// where `W−12 = (W − largeSize16) + effectiveOffsetX4` is the fixed left edge +/// of the pill, and `r = badgeRadius ≈ pillWidth/2` grows with zoom. +/// +/// Draw radius = `badgeRadius + strokeWidth/2`. +class _BadgeBorderPainter extends CustomPainter { + const _BadgeBorderPainter({ + required this.badgeRadius, + required this.hasCount, + required this.borderColor, + }); + + final double badgeRadius; + final bool hasCount; + final Color borderColor; + + @override + void paint(Canvas canvas, Size size) { + // Dot : Flutter Badge offset=Offset.zero, widthOffset=scaledSmallSize + // → top-left = (W − scaledSmallSize, 0) → centre = (W − r, r) + // + // Count: Flutter Badge effectiveOffset = Offset(4,4) (LTR default + Offset(0,8) fix). + // widthOffset = largeSize = 16 (fixed, unscaled). + // pill left edge = (W − 16) + 4 = W − 12 (constant). + // pill centre X = (W − 12) + pillWidth/2 ≈ (W − 12) + badgeRadius. + // pill centre Y = 4.0 (effectiveOffset.dy; ± pillHeight/2 cancels out). + final double cx = hasCount + ? size.width - 12.0 + badgeRadius + : size.width - badgeRadius; + final double cy = hasCount ? 4.0 : badgeRadius; + + const double strokeWidth = 1.0; + canvas.drawCircle( + Offset(cx, cy), + badgeRadius + strokeWidth / 2, + Paint() + ..color = borderColor + ..style = PaintingStyle.stroke + ..strokeWidth = strokeWidth, + ); + } + + @override + bool shouldRepaint(covariant _BadgeBorderPainter old) => + old.badgeRadius != badgeRadius || + old.hasCount != hasCount || + old.borderColor != borderColor; +} diff --git a/ouds_core/lib/components/utilities/markdown_span_builder.dart b/ouds_core/lib/components/utilities/markdown_span_builder.dart new file mode 100644 index 000000000..dd9f388a2 --- /dev/null +++ b/ouds_core/lib/components/utilities/markdown_span_builder.dart @@ -0,0 +1,198 @@ +/* + * // Software Name: OUDS Flutter + * // SPDX-FileCopyrightText: Copyright (c) Orange SA + * // SPDX-License-Identifier: MIT + * // + * // This software is distributed under the MIT license, + * // the text of which is available at https://opensource.org/license/MIT/ + * // or see the "LICENSE" file for more details. + * // + * // Software description: Flutter library of reusable graphical components + * // + */ + +/// @nodoc +library; + +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:ouds_theme_contract/ouds_theme.dart'; + +/// A lightweight markdown span builder for Flutter `RichText`. +/// +/// Supported syntax: +/// - `**bold**` +/// - `__**underline bold**__` +/// - `[link](https://example.com)` +/// +/// This is not a full markdown parser. It is intended for simple styling +/// and inline links in lightweight text content. +class MarkdownSpanBuilder { + /// Builds an [InlineSpan] from plain text supporting only bold markdown. + /// + /// Supported syntax: + /// - `**bold**` + /// + /// Any text outside markdown markers is preserved as-is. + /// + /// Parameters: + /// - [text]: The source text to parse. + /// - [baseStyle]: The default style applied to all text. + /// + /// Returns: + /// A tree of [InlineSpan] that can be used in `Text.rich` or `RichText`. + static InlineSpan buildBoldOnly(String text, {required TextStyle baseStyle}) { + final spans = []; + + final regex = RegExp(r'(\*\*.*?\*\*)'); + + int currentPosition = 0; + + for (final match in regex.allMatches(text)) { + if (match.start > currentPosition) { + spans.add( + TextSpan( + text: text.substring(currentPosition, match.start), + style: baseStyle, + ), + ); + } + + final matchText = match.group(0)!; + + spans.add( + TextSpan( + text: matchText.substring(2, matchText.length - 2), + style: baseStyle.copyWith(fontWeight: FontWeight.bold), + ), + ); + + currentPosition = match.end; + } + + if (currentPosition < text.length) { + spans.add( + TextSpan(text: text.substring(currentPosition), style: baseStyle), + ); + } + + return TextSpan(style: baseStyle, children: spans); + } + + /// Builds an [InlineSpan] supporting bold text, underline-bold text, and links. + /// + /// Supported syntax: + /// - `**bold**` + /// - `__**underline bold**__` + /// - `[link](https://example.com)` + /// + /// Link text is rendered with an underline style and can trigger [onLinkTap] + /// when tapped. + /// + /// Parameters: + /// - [context]: Used to access theme typography tokens. + /// - [text]: The source text to parse. + /// - [baseStyle]: The default style applied to non-markdown text. + /// - [onLinkTap]: Optional callback invoked when a link is tapped. + /// + /// Returns: + /// A tree of [InlineSpan] that can be used in `Text.rich` or `RichText`. + /// + /// Note: + /// This function only parses and exposes links through [onLinkTap]. + /// The caller is responsible for handling link opening behavior + /// (for example with `url_launcher` or an in-app WebView). + /// + /// Example: + /// onLinkTap: (link) async { + /// await launchUrl(Uri.parse(link)); + /// }, + /// + static InlineSpan buildRichText( + BuildContext context, + String text, { + required TextStyle baseStyle, + void Function(String url)? onLinkTap, + }) { + final theme = OudsTheme.of(context); + final spans = []; + + final regex = RegExp( + r'(__\*\*.*?\*\*__)|' // underline bold + r'(\*\*.*?\*\*)|' // bold + r'(\[.*?\]\(.*?\))', // link + ); + + int currentPosition = 0; + + for (final match in regex.allMatches(text)) { + if (match.start > currentPosition) { + spans.add( + TextSpan( + text: text.substring(currentPosition, match.start), + style: baseStyle, + ), + ); + } + + final matchText = match.group(0)!; + + // Underline + Bold + if (matchText.startsWith('__**')) { + spans.add( + TextSpan( + text: matchText.substring(4, matchText.length - 4), + style: baseStyle.copyWith( + fontWeight: FontWeight.bold, + decoration: TextDecoration.underline, + ), + ), + ); + } + // Bold + else if (matchText.startsWith('**')) { + spans.add( + TextSpan( + text: matchText.substring(2, matchText.length - 2), + style: baseStyle.copyWith(fontWeight: FontWeight.bold), + ), + ); + } + // Link + else if (matchText.startsWith('[')) { + final linkMatch = RegExp(r'\[(.*?)\]\((.*?)\)').firstMatch(matchText); + + if (linkMatch != null) { + final linkText = linkMatch.group(1)!; + final url = linkMatch.group(2)!; + + spans.add( + TextSpan( + text: linkText, + style: theme.typographyTokens + .typeLabelStrongMedium(context) + .copyWith( + decoration: TextDecoration.underline, + color: baseStyle.color, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + onLinkTap?.call(url); + }, + ), + ); + } + } + + currentPosition = match.end; + } + + if (currentPosition < text.length) { + spans.add( + TextSpan(text: text.substring(currentPosition), style: baseStyle), + ); + } + + return TextSpan(style: baseStyle, children: spans); + } +} diff --git a/ouds_core/lib/l10n/gen/ouds_localizations.dart b/ouds_core/lib/l10n/gen/ouds_localizations.dart index 1ddc429b3..442f2dea2 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations.dart @@ -310,7 +310,7 @@ abstract class OudsLocalizations { /// No description provided for @core_pinCodeInput_digitCode_label_a11y. /// /// In en, this message translates to: - /// **'Digit code {current}'** + /// **'{current} digit'** String core_pinCodeInput_digitCode_label_a11y(Object current); /// No description provided for @core_pinCodeInput_pinCode_label_a11y. @@ -331,6 +331,12 @@ abstract class OudsLocalizations { /// **'Error: Invalid code'** String get core_pinCodeInput_error_a11y; + /// No description provided for @core_pinCodeInput_digitPosition_a11y. + /// + /// In en, this message translates to: + /// **'Digit {current} of {total}'** + String core_pinCodeInput_digitPosition_a11y(Object current, Object total); + /// No description provided for @core_topAppBar_backNavigationIcon_a11y. /// /// In en, this message translates to: diff --git a/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart b/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart index 493884627..0c0b73658 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations_ar.dart @@ -118,7 +118,7 @@ class OudsLocalizationsAr extends OudsLocalizations { @override String core_pinCodeInput_digitCode_label_a11y(Object current) { - return 'الرقم $current'; + return 'الخانة $current'; } @override @@ -132,6 +132,11 @@ class OudsLocalizationsAr extends OudsLocalizations { @override String get core_pinCodeInput_error_a11y => 'خطأ: الرمز غير صحيح'; + @override + String core_pinCodeInput_digitPosition_a11y(Object current, Object total) { + return 'الرقم $current من $total'; + } + @override String get core_topAppBar_backNavigationIcon_a11y => 'رجوع'; diff --git a/ouds_core/lib/l10n/gen/ouds_localizations_en.dart b/ouds_core/lib/l10n/gen/ouds_localizations_en.dart index 7c61cde0d..25bbc37b4 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations_en.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations_en.dart @@ -118,7 +118,7 @@ class OudsLocalizationsEn extends OudsLocalizations { @override String core_pinCodeInput_digitCode_label_a11y(Object current) { - return 'Digit code $current'; + return '$current digit'; } @override @@ -132,6 +132,11 @@ class OudsLocalizationsEn extends OudsLocalizations { @override String get core_pinCodeInput_error_a11y => 'Error: Invalid code'; + @override + String core_pinCodeInput_digitPosition_a11y(Object current, Object total) { + return 'Digit $current of $total'; + } + @override String get core_topAppBar_backNavigationIcon_a11y => 'Back'; diff --git a/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart b/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart index da678a3ef..96aef9350 100644 --- a/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart +++ b/ouds_core/lib/l10n/gen/ouds_localizations_fr.dart @@ -120,7 +120,7 @@ class OudsLocalizationsFr extends OudsLocalizations { @override String core_pinCodeInput_digitCode_label_a11y(Object current) { - return 'Code à chiffres $current'; + return '$current chiffre'; } @override @@ -134,6 +134,11 @@ class OudsLocalizationsFr extends OudsLocalizations { @override String get core_pinCodeInput_error_a11y => 'Error: Invalid code'; + @override + String core_pinCodeInput_digitPosition_a11y(Object current, Object total) { + return 'Chiffre $current sur $total'; + } + @override String get core_topAppBar_backNavigationIcon_a11y => 'Retour'; diff --git a/ouds_core/lib/l10n/ouds_flutter_ar.arb b/ouds_core/lib/l10n/ouds_flutter_ar.arb index 0b977e0d6..06482bf18 100644 --- a/ouds_core/lib/l10n/ouds_flutter_ar.arb +++ b/ouds_core/lib/l10n/ouds_flutter_ar.arb @@ -60,10 +60,11 @@ "core_passwordInput_hidePassword_a11y": "إخفاء كلمة المرو", "@_OUDS_PIN_CODE_INPUT": {}, - "core_pinCodeInput_digitCode_label_a11y": "الرقم {current}", + "core_pinCodeInput_digitCode_label_a11y": "الخانة {current}", "core_pinCodeInput_pinCode_label_a11y": "أدخل رمزك المكوّن من {digitsCount} أرقام", "core_pinCodeInput_trait_a11y": "حقل النص", "core_pinCodeInput_error_a11y": "خطأ: الرمز غير صحيح", + "core_pinCodeInput_digitPosition_a11y": "الرقم {current} من {total}", "@_OUDS_TOP_APP_BAR": {}, "core_topAppBar_backNavigationIcon_a11y": "رجوع", diff --git a/ouds_core/lib/l10n/ouds_flutter_en.arb b/ouds_core/lib/l10n/ouds_flutter_en.arb index 0aa1a5a7b..ec0e469d2 100644 --- a/ouds_core/lib/l10n/ouds_flutter_en.arb +++ b/ouds_core/lib/l10n/ouds_flutter_en.arb @@ -59,10 +59,11 @@ "@_OUDS_PIN_CODE_INPUT": {}, - "core_pinCodeInput_digitCode_label_a11y": "Digit code {current}", + "core_pinCodeInput_digitCode_label_a11y": "{current} digit", "core_pinCodeInput_pinCode_label_a11y": "Enter your {digitsCount}-digit code", "core_pinCodeInput_trait_a11y": "EditBox", "core_pinCodeInput_error_a11y": "Error: Invalid code", + "core_pinCodeInput_digitPosition_a11y": "Digit {current} of {total}", "@_OUDS_TOP_APP_BAR": {}, "core_topAppBar_backNavigationIcon_a11y": "Back", diff --git a/ouds_core/lib/l10n/ouds_flutter_fr.arb b/ouds_core/lib/l10n/ouds_flutter_fr.arb index ab5302f12..f352ea576 100644 --- a/ouds_core/lib/l10n/ouds_flutter_fr.arb +++ b/ouds_core/lib/l10n/ouds_flutter_fr.arb @@ -58,11 +58,13 @@ "core_passwordInput_hidePassword_a11y": "Masquer le mot de passe", "@_OUDS_PIN_CODE_INPUT": {}, - "core_pinCodeInput_digitCode_label_a11y": "Code à chiffres {current}", + "core_pinCodeInput_digitCode_label_a11y": "{current} chiffre", "core_pinCodeInput_pinCode_label_a11y": "Entrez votre code à {digitsCount} chiffres", "core_pinCodeInput_trait_a11y": "Champ de saisie", + "core_pinCodeInput_digitPosition_a11y": "Chiffre {current} sur {total}", - "@_OUDS_TOP_APP_BAR": {}, + + "@_OUDS_TOP_APP_BAR": {}, "core_topAppBar_backNavigationIcon_a11y": "Retour", "core_topAppBar_menuNavigationIcon_a11y": "Menu", "core_topAppBar_closeNavigationIcon_a11y": "Fermer", diff --git a/ouds_core/pubspec.yaml b/ouds_core/pubspec.yaml index 965b886e5..376fc53d0 100644 --- a/ouds_core/pubspec.yaml +++ b/ouds_core/pubspec.yaml @@ -1,8 +1,8 @@ name: ouds_core -description: 'Contains the main elements of the OUDS Android library.' -version: 1.3.1 +description: 'Contains the main elements of the OUDS Flutter library.' repository: https://github.com/Orange-OpenSource/ouds-flutter homepage: https://flutter.unified-design-system.orange.com +version: 2.0.0 environment: sdk: ^3.9.0 @@ -20,7 +20,7 @@ dependencies: # Flutter svg flutter_svg: ^2.2.3 # ouds_theme_contract - ouds_theme_contract: ^1.3.1 + ouds_theme_contract: ^2.0.0 # ouds_accessibility_plugin ouds_accessibility_plugin: ^0.2.0 # phone number handling diff --git a/ouds_core/test/components/navigation/ouds_navigation_bar_a11y_test.dart b/ouds_core/test/components/navigation/ouds_navigation_bar_a11y_test.dart new file mode 100644 index 000000000..56bfd3134 --- /dev/null +++ b/ouds_core/test/components/navigation/ouds_navigation_bar_a11y_test.dart @@ -0,0 +1,307 @@ +/* + * // Software Name: OUDS Flutter + * // SPDX-FileCopyrightText: Copyright (c) Orange SA + * // SPDX-License-Identifier: MIT + * // + * // This software is distributed under the MIT license, + * // the text of which is available at https://opensource.org/license/MIT/ + * // or see the "LICENSE" file for more details. + * // + * // Software description: Flutter library of reusable graphical components + * // + */ + +// Accessibility tests for OudsNavigationBar — semantic labels & TalkBack contract. +// +// Coverage: +// 1. [OudsNavigationBarA11y.buildTabSemanticLabel] — pure label-building logic. +// 2. [buildNavItemAccessibleLabel] — backward-compat top-level helper. +// 3. Badge Semantics geometry — non-zero rect required by TalkBack. +// 4. TalkBack reading-order — badge node must be below label node. +// 5. [kNavBarMaxTextScale] constant value. +// +// Expected TalkBack announcement for a badged item: +// +// "Label, 1 notification, Tab 2 of 3" +// ──┬── ───────┬─────── ───────┬── +// │ │ └─ IndexedSemantics (Material, not tested here) +// │ └─ Semantics(label: badge.contentDescription, +// │ container: true, child: SizedBox(height: 1)) +// └─ NavigationDestination(label: 'Label') +// +// ⚠ The badge Semantics child MUST have a non-zero rect — SizedBox.shrink() (0×0) +// causes Flutter to mark the node invisible and TalkBack silently skips it. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:ouds_core/components/navigation/internal/ouds_navigation_bar_a11y.dart'; +import 'package:ouds_core/components/navigation/ouds_navigation_bar_item.dart'; + +// --------------------------------------------------------------------------- +// Test helpers +// --------------------------------------------------------------------------- + +/// Convenience factory for [OudsNavigationBarItemBadge]. +OudsNavigationBarItemBadge _badge({ + String contentDescription = '1 notification', + int? count = 1, +}) => OudsNavigationBarItemBadge( + contentDescription: contentDescription, + count: count, +); + +// --------------------------------------------------------------------------- +// Tests +// --------------------------------------------------------------------------- + +void main() { + // ─── 1. OudsNavigationBarA11y.buildTabSemanticLabel ─────────────────────── + group('OudsNavigationBarA11y.buildTabSemanticLabel', () { + test('returns label only when badge is null', () { + expect( + OudsNavigationBarA11y.buildTabSemanticLabel('Accueil', null), + 'Accueil', + ); + }); + + test('returns "label, badge description" when badge is present', () { + expect( + OudsNavigationBarA11y.buildTabSemanticLabel( + 'Accueil', + _badge(contentDescription: '1 notification'), + ), + 'Accueil, 1 notification', + ); + }); + + test('does not duplicate label when badge description contains label', () { + expect( + OudsNavigationBarA11y.buildTabSemanticLabel( + 'Messages', + _badge(contentDescription: '3 messages'), + ), + 'Messages, 3 messages', + ); + }); + + test('handles empty badge description gracefully', () { + expect( + OudsNavigationBarA11y.buildTabSemanticLabel( + 'Home', + _badge(contentDescription: ''), + ), + 'Home, ', + ); + }); + }); + + // ─── 2. buildNavItemAccessibleLabel ───────── + group('buildNavItemAccessibleLabel', () { + test('returns label when no badge', () { + // ignore: deprecated_member_use + expect( + OudsNavigationBarA11y.buildTabSemanticLabel('Profile', null), + 'Profile', + ); + }); + + test('returns "label, badge" string when badge present', () { + expect( + OudsNavigationBarA11y.buildTabSemanticLabel( + 'Profile', + _badge(contentDescription: '5 alerts'), + ), + 'Profile, 5 alerts', + ); + }); + }); + + // ─── 3. Badge Semantics node — geometry contract ────────────────────────── + // + // TalkBack determines node visibility from its layout rect. + // A rect with width == 0 || height == 0 is flagged isInvisible = true and + // skipped. SizedBox(height: 1) keeps the rect non-empty while remaining + // visually imperceptible. + group('Badge Semantics node — geometry contract', () { + testWidgets( + 'SizedBox(height: 1) renders a non-empty rect inside a NavigationBar-style Column', + (WidgetTester tester) async { + // Mirrors the badge-node placement in toNavigationDestination, + // without introducing an OudsTheme dependency. + await tester.pumpWidget( + MaterialApp( + debugShowCheckedModeBanner: false, + home: Scaffold( + bottomNavigationBar: SizedBox( + height: 80, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const SizedBox(height: 4), // indicator placeholder + const Text('Accueil'), // label placeholder + // Widget under test ↓ + Semantics( + label: '1 notification', + container: true, + child: const SizedBox(height: 1), + ), + ], + ), + ), + ], + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + + final box = tester.renderObject( + find.descendant( + of: find.byWidgetPredicate( + (w) => + w is Semantics && + w.properties.label == '1 notification' && + w.container == true, + ), + matching: find.byType(SizedBox), + ), + ); + + expect( + box.size.height, + greaterThan(0), + reason: + 'height > 0 prevents Flutter from marking the node invisible — TalkBack would skip a 0-height node.', + ); + }, + ); + + testWidgets( + 'Badge Semantics node is discoverable via find.bySemanticsLabel', + (WidgetTester tester) async { + final handle = tester.ensureSemantics(); + + await tester.pumpWidget( + MaterialApp( + debugShowCheckedModeBanner: false, + home: Scaffold( + bottomNavigationBar: SizedBox( + height: 80, + child: MergeSemantics( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Semantics( + label: 'Accueil', + container: true, + child: const SizedBox(height: 24), + ), + Semantics( + label: '1 notification', + container: true, + child: const SizedBox(height: 1), // must be > 0 + ), + ], + ), + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + + expect( + find.bySemanticsLabel('1 notification'), + findsAtLeastNWidgets(1), + reason: + 'Badge Semantics node must appear in the semantic tree for TalkBack to announce it.', + ); + + handle.dispose(); + }, + ); + }); + + // ─── 4. TalkBack reading-order contract ─────────────────────────────────── + // + // TalkBack traverses nodes by layout position (top-to-bottom, left-to-right). + // The badge Semantics node must be placed BELOW NavigationDestination in the + // Column so that rect.top(badge) ≥ rect.top(label), producing the order: + // "Label → badge description → Tab X of Y" + group('TalkBack reading-order contract', () { + testWidgets( + 'Badge Semantics node is positioned below label node (rect.top ≥ label rect.top)', + (WidgetTester tester) async { + final handle = tester.ensureSemantics(); + + await tester.pumpWidget( + MaterialApp( + debugShowCheckedModeBanner: false, + home: Scaffold( + bottomNavigationBar: SizedBox( + height: 80, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // 1. Label node — mirrors NavigationDestination. + Semantics( + label: 'Accueil', + container: true, + child: const SizedBox(height: 24), + ), + // 2. Badge node — placed after label so rect.top is larger, + // guaranteeing TalkBack reads: label → badge → Tab X of Y. + Semantics( + label: '1 notification', + container: true, + child: const SizedBox(height: 1), + ), + ], + ), + ), + ), + ), + ); + await tester.pumpAndSettle(); + + expect(find.bySemanticsLabel('Accueil'), findsAtLeastNWidgets(1)); + expect( + find.bySemanticsLabel('1 notification'), + findsAtLeastNWidgets(1), + reason: + 'A height-0 SizedBox would make the rect empty and prune this node — use SizedBox(height: 1).', + ); + + final labelRect = tester.getRect( + find.bySemanticsLabel('Accueil').first, + ); + final badgeRect = tester.getRect( + find.bySemanticsLabel('1 notification').first, + ); + + expect( + badgeRect.top, + greaterThanOrEqualTo(labelRect.top), + reason: + 'Badge rect.top (${badgeRect.top}) must be ≥ label rect.top (${labelRect.top}) ' + 'to produce the reading order: "Accueil, 1 notification, Tab 2 de 3".', + ); + + handle.dispose(); + }, + ); + }); + + // ─── 5. kNavBarMaxTextScale constant ───────────────────────────────────── + group('kNavBarMaxTextScale', () { + test('is capped at 1.6', () { + expect(kNavBarMaxTextScale, equals(1.6)); + }); + }); +} diff --git a/ouds_core/test/components/navigation/ouds_navigation_bar_indicator_animation_test.dart b/ouds_core/test/components/navigation/ouds_navigation_bar_indicator_animation_test.dart new file mode 100644 index 000000000..92ba809d8 --- /dev/null +++ b/ouds_core/test/components/navigation/ouds_navigation_bar_indicator_animation_test.dart @@ -0,0 +1,221 @@ +/* + * // Software Name: OUDS Flutter + * // SPDX-FileCopyrightText: Copyright (c) Orange SA + * // SPDX-License-Identifier: MIT + * // + * // This software is distributed under the MIT license, + * // the text of which is available at https://opensource.org/license/MIT/ + * // or see the "LICENSE" file for more details. + * // + * // Software description: Flutter library of reusable graphical components + * // + */ + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:ouds_core/components/navigation/internal/ouds_navigation_bar_indicator_animation.dart'; + +void main() { + group('OudsAnimatedIndicator', () { + testWidgets('Indicator displays when selected', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: OudsAnimatedIndicator( + isSelected: true, + color: Colors.orange, + thickness: 4.0, + tabWidth: 100.0, + borderRadius: 2.0, + ), + ), + ), + ); + + // Indicator should be rendered + expect(find.byType(OudsAnimatedIndicator), findsOneWidget); + expect( + find.descendant( + of: find.byType(OudsAnimatedIndicator), + matching: find.byType(CustomPaint), + ), + findsOneWidget, + ); + }); + + testWidgets('Indicator animates from invisible to visible when selected', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: StatefulBuilder( + builder: (context, setState) { + return Column( + children: [ + OudsAnimatedIndicator( + key: ValueKey('indicator'), + isSelected: true, + color: Colors.orange, + thickness: 4.0, + tabWidth: 100.0, + borderRadius: 2.0, + animationDuration: const Duration(milliseconds: 300), + ), + ], + ); + }, + ), + ), + ), + ); + + // Animation should start + expect(find.byType(OudsAnimatedIndicator), findsOneWidget); + expect( + find.descendant( + of: find.byType(OudsAnimatedIndicator), + matching: find.byType(CustomPaint), + ), + findsOneWidget, + ); + + // Move time forward to check animation progresses + await tester.pumpAndSettle(const Duration(milliseconds: 100)); + expect( + find.descendant( + of: find.byType(OudsAnimatedIndicator), + matching: find.byType(CustomPaint), + ), + findsOneWidget, + ); + + // Complete animation + await tester.pumpAndSettle(const Duration(milliseconds: 300)); + expect( + find.descendant( + of: find.byType(OudsAnimatedIndicator), + matching: find.byType(CustomPaint), + ), + findsOneWidget, + ); + }); + + testWidgets('Indicator animates when selection changes', ( + WidgetTester tester, + ) async { + bool isSelected = true; + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: StatefulBuilder( + builder: (context, setState) { + return Column( + children: [ + OudsAnimatedIndicator( + key: ValueKey('indicator'), + isSelected: isSelected, + color: Colors.orange, + thickness: 4.0, + tabWidth: 100.0, + borderRadius: 2.0, + animationDuration: const Duration(milliseconds: 300), + ), + ElevatedButton( + onPressed: () { + setState(() => isSelected = !isSelected); + }, + child: Text('Toggle'), + ), + ], + ); + }, + ), + ), + ), + ); + + expect(find.byType(OudsAnimatedIndicator), findsOneWidget); + + // Tap button to deselect + await tester.tap(find.byType(ElevatedButton)); + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: StatefulBuilder( + builder: (context, setState) { + return Column( + children: [ + OudsAnimatedIndicator( + key: ValueKey('indicator'), + isSelected: false, + color: Colors.orange, + thickness: 4.0, + tabWidth: 100.0, + borderRadius: 2.0, + animationDuration: const Duration(milliseconds: 300), + ), + ElevatedButton(onPressed: () {}, child: Text('Toggle')), + ], + ); + }, + ), + ), + ), + ); + + // Animation should reverse + await tester.pumpAndSettle(const Duration(milliseconds: 300)); + expect(find.byType(OudsAnimatedIndicator), findsOneWidget); + }); + + testWidgets('Multiple indicators expand independently', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: Row( + children: [ + OudsAnimatedIndicator( + key: ValueKey('indicator1'), + isSelected: true, + color: Colors.orange, + thickness: 4.0, + tabWidth: 80.0, + borderRadius: 2.0, + animationDuration: const Duration(milliseconds: 300), + ), + OudsAnimatedIndicator( + key: ValueKey('indicator2'), + isSelected: false, + color: Colors.orange, + thickness: 4.0, + tabWidth: 80.0, + borderRadius: 2.0, + animationDuration: const Duration(milliseconds: 300), + ), + OudsAnimatedIndicator( + key: ValueKey('indicator3'), + isSelected: true, + color: Colors.blue, + thickness: 4.0, + tabWidth: 80.0, + borderRadius: 2.0, + animationDuration: const Duration(milliseconds: 300), + ), + ], + ), + ), + ), + ); + + // All indicators should be rendered + expect(find.byType(OudsAnimatedIndicator), findsWidgets); + expect(find.byType(CustomPaint), findsWidgets); + }); + }); +} diff --git a/ouds_core/test/components/navigation/ouds_navigation_bar_item_test.dart b/ouds_core/test/components/navigation/ouds_navigation_bar_item_test.dart new file mode 100644 index 000000000..4e4e31de8 --- /dev/null +++ b/ouds_core/test/components/navigation/ouds_navigation_bar_item_test.dart @@ -0,0 +1,74 @@ +/* + * // Software Name: OUDS Flutter + * // SPDX-FileCopyrightText: Copyright (c) Orange SA + * // SPDX-License-Identifier: MIT + * // + * // This software is distributed under the MIT license, + * // the text of which is available at https://opensource.org/license/MIT/ + * // or see the "LICENSE" file for more details. + * // + * // Software description: Flutter library of reusable graphical components + * // + */ + +import 'package:flutter_test/flutter_test.dart'; +import 'package:ouds_core/components/navigation/ouds_navigation_bar_item.dart'; + +void main() { + group('OudsNavigationBarItem API', () { + test( + 'OudsNavigationBarItem constructor works with required parameters', + () { + const item = OudsNavigationBarItem( + icon: 'assets/test.svg', + label: 'Test', + ); + + expect(item.icon, 'assets/test.svg'); + expect(item.label, 'Test'); + expect(item.badge, isNull); + }, + ); + + test('OudsNavigationBarItem constructor works with badge', () { + const badge = OudsNavigationBarItemBadge( + contentDescription: 'Test Badge', + count: 5, + ); + + const item = OudsNavigationBarItem( + icon: 'assets/test.svg', + label: 'Test', + badge: badge, + ); + + expect(item.icon, 'assets/test.svg'); + expect(item.label, 'Test'); + expect(item.badge, isNotNull); + expect(item.badge?.contentDescription, 'Test Badge'); + expect(item.badge?.count, 5); + expect(item.badge?.hasCount, isTrue); + }); + + test('OudsNavigationBarItemBadge with no count', () { + const badge = OudsNavigationBarItemBadge( + contentDescription: 'Test Badge', + ); + + expect(badge.contentDescription, 'Test Badge'); + expect(badge.count, isNull); + expect(badge.hasCount, isFalse); + }); + + test('OudsNavigationBarItemBadge with count', () { + const badge = OudsNavigationBarItemBadge( + contentDescription: 'Test Badge', + count: 10, + ); + + expect(badge.contentDescription, 'Test Badge'); + expect(badge.count, 10); + expect(badge.hasCount, isTrue); + }); + }); +} diff --git a/ouds_global_raw_tokens/CHANGELOG.md b/ouds_global_raw_tokens/CHANGELOG.md index db1167f29..cf3a6869a 100644 --- a/ouds_global_raw_tokens/CHANGELOG.md +++ b/ouds_global_raw_tokens/CHANGELOG.md @@ -4,16 +4,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop) +## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/2.0.0...develop) ### Added ### Changed ### Fixed -## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 +## [2.0.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...2.0.0) - 2026-06-19 ### Added ### Changed +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) ### Fixed +## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 + ## [1.3.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.2.0...1.3.0) - 2026-05-08 ## [1.2.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.1.2...1.2.0) - 2026-04-21 diff --git a/ouds_global_raw_tokens/README.md b/ouds_global_raw_tokens/README.md index 41feb73f1..d6e48be73 100644 --- a/ouds_global_raw_tokens/README.md +++ b/ouds_global_raw_tokens/README.md @@ -14,7 +14,7 @@ To use **Ouds Global Raw Tokens**, add it as a dependency in your `pubspec.yaml` ```yaml dependencies: - ouds_global_raw_tokens: ^1.3.1 + ouds_global_raw_tokens: ^2.0.0 ``` ## Additional information diff --git a/ouds_global_raw_tokens/lib/border_raw_tokens.dart b/ouds_global_raw_tokens/lib/border_raw_tokens.dart index 5676ce824..bfee83394 100644 --- a/ouds_global_raw_tokens/lib/border_raw_tokens.dart +++ b/ouds_global_raw_tokens/lib/border_raw_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// OUDS core tokens version 1.9.0 +// OUDS core tokens version 1.10.0 // Generated by Tokenator class BorderRawTokens { diff --git a/ouds_global_raw_tokens/lib/color_raw_tokens.dart b/ouds_global_raw_tokens/lib/color_raw_tokens.dart index 4c43be220..9f3bef76b 100644 --- a/ouds_global_raw_tokens/lib/color_raw_tokens.dart +++ b/ouds_global_raw_tokens/lib/color_raw_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// OUDS core tokens version 1.9.0 +// OUDS core tokens version 1.10.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -109,8 +109,7 @@ class ColorRawTokens { static const colorOpacityBlack960 = Color(0xf5000000); static const colorOpacityDodgerBlue80 = Color(0x1426b2ff); static const colorOpacityDodgerBlue520 = Color(0x8500598a); - static const colorOpacityGrayDark800800 = Color(0xcc1f1f1f); - static const colorOpacityGrayLight80800 = Color(0xccf4f4f4); + static const colorOpacityGrayDark880800 = Color(0xcc141414); static const colorOpacityMalachite120 = Color(0x1f3de35a); static const colorOpacityMalachite640 = Color(0xa30e621d); static const colorOpacityScarlet80 = Color(0x14db0002); diff --git a/ouds_global_raw_tokens/lib/dimension_raw_tokens.dart b/ouds_global_raw_tokens/lib/dimension_raw_tokens.dart index 8e33e3fd2..a19827ddc 100644 --- a/ouds_global_raw_tokens/lib/dimension_raw_tokens.dart +++ b/ouds_global_raw_tokens/lib/dimension_raw_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// OUDS core tokens version 1.9.0 +// OUDS core tokens version 1.10.0 // Generated by Tokenator class DimensionRawTokens { diff --git a/ouds_global_raw_tokens/lib/effect_raw_tokens.dart b/ouds_global_raw_tokens/lib/effect_raw_tokens.dart index 6d4271614..59bc531ea 100644 --- a/ouds_global_raw_tokens/lib/effect_raw_tokens.dart +++ b/ouds_global_raw_tokens/lib/effect_raw_tokens.dart @@ -10,10 +10,10 @@ // Software description: Flutter library of reusable graphical components // -// OUDS core tokens version 1.9.0 +// OUDS core tokens version 1.10.0 // Generated by Tokenator class EffectRawTokens { - static const effectBlur160 = 16; static const effectBlur320 = 32; + static const effectBlur480 = 48; } \ No newline at end of file diff --git a/ouds_global_raw_tokens/lib/font_raw_tokens.dart b/ouds_global_raw_tokens/lib/font_raw_tokens.dart index 74840c619..7fbc1ce12 100644 --- a/ouds_global_raw_tokens/lib/font_raw_tokens.dart +++ b/ouds_global_raw_tokens/lib/font_raw_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// OUDS core tokens version 1.9.0 +// OUDS core tokens version 1.10.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_global_raw_tokens/lib/grid_raw_tokens.dart b/ouds_global_raw_tokens/lib/grid_raw_tokens.dart index 8ea7c88b4..9817d826e 100644 --- a/ouds_global_raw_tokens/lib/grid_raw_tokens.dart +++ b/ouds_global_raw_tokens/lib/grid_raw_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// OUDS core tokens version 1.9.0 +// OUDS core tokens version 1.10.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_global_raw_tokens/lib/opacity_raw_tokens.dart b/ouds_global_raw_tokens/lib/opacity_raw_tokens.dart index 201b200d4..880ab9dab 100644 --- a/ouds_global_raw_tokens/lib/opacity_raw_tokens.dart +++ b/ouds_global_raw_tokens/lib/opacity_raw_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// OUDS core tokens version 1.9.0 +// OUDS core tokens version 1.10.0 // Generated by Tokenator class OpacityRawTokens { diff --git a/ouds_global_raw_tokens/pubspec.yaml b/ouds_global_raw_tokens/pubspec.yaml index c81a0560b..e6340fe60 100644 --- a/ouds_global_raw_tokens/pubspec.yaml +++ b/ouds_global_raw_tokens/pubspec.yaml @@ -1,8 +1,8 @@ name: ouds_global_raw_tokens description: 'Raw tokens are basic design values (e.g., colors, typography) used to create a flexible and consistent theme' -version: 1.3.1 repository: https://github.com/Orange-OpenSource/ouds-flutter homepage: https://flutter.unified-design-system.orange.com +version: 2.0.0 environment: sdk: ^3.9.0 diff --git a/ouds_theme_contract/CHANGELOG.md b/ouds_theme_contract/CHANGELOG.md index e9ca22073..2ab375b2b 100644 --- a/ouds_theme_contract/CHANGELOG.md +++ b/ouds_theme_contract/CHANGELOG.md @@ -4,23 +4,27 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop) +## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/2.0.0...develop) ### Added ### Changed ### Fixed -## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 +## [2.0.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...2.0.0) - 2026-06-19 ### Added ### Changed +- [Library] Remove deprecated code and API ([#820](https://github.com/Orange-OpenSource/ouds-flutter/issues/820)) +- [Library] update tokens 2.5.0 ([#778](https://github.com/Orange-OpenSource/ouds-flutter/issues/778)) +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) ### Fixed +## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 + ## [1.3.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.2.0...1.3.0) - 2026-05-08 ### Added - ### Changed +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) - [Library] update tokens 1.9.0 - Component Bullet List ([#710](https://github.com/Orange-OpenSource/ouds-flutter/issues/710)) - [Library] update tokens 1.9.0 - Component Alert ([#672](https://github.com/Orange-OpenSource/ouds-flutter/issues/672)) - ### Fixed ## [1.2.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.1.2...1.2.0) - 2026-04-21 diff --git a/ouds_theme_contract/README.md b/ouds_theme_contract/README.md index 18726f2d1..b17b3fef0 100644 --- a/ouds_theme_contract/README.md +++ b/ouds_theme_contract/README.md @@ -14,7 +14,7 @@ To use **Ouds Theme Contract**, add it as a dependency in your `pubspec.yaml` fi ```yaml dependencies: - ouds_theme_contract: ^1.3.1 + ouds_theme_contract: ^2.0.0 ``` ## Package Structure diff --git a/ouds_theme_contract/lib/config/ouds_theme_config_model.dart b/ouds_theme_contract/lib/config/ouds_theme_config_model.dart index 0600bdfe3..34c23ed15 100644 --- a/ouds_theme_contract/lib/config/ouds_theme_config_model.dart +++ b/ouds_theme_contract/lib/config/ouds_theme_config_model.dart @@ -13,24 +13,15 @@ import 'package:flutter/material.dart'; import 'package:ouds_theme_contract/config/component/ouds_alert_message_config_border.dart'; import 'package:ouds_theme_contract/config/component/ouds_button_config.dart'; -import 'package:ouds_theme_contract/config/component/ouds_tag_config.dart'; import 'package:ouds_theme_contract/config/component/ouds_text_input_config.dart'; class OudsThemeConfigModel extends InheritedWidget { final OudsButtonConfig? button; - @Deprecated( - 'OudsTagConfig is deprecated and will be removed in a future version. Please migrate off of its usage.', - ) - final OudsTagConfig? tag; final OudsTextInputConfig? textInput; final OudsAlertMessageConfig? alertMessage; const OudsThemeConfigModel({ this.button, - @Deprecated( - 'OudsTagConfig is deprecated and will be removed in a future version. Please migrate off of its usage.', - ) - this.tag, this.textInput, this.alertMessage, required super.child, @@ -44,7 +35,6 @@ class OudsThemeConfigModel extends InheritedWidget { @override bool updateShouldNotify(covariant OudsThemeConfigModel oldWidget) { return button != oldWidget.button || - tag != oldWidget.tag || textInput != oldWidget.textInput || alertMessage != oldWidget.alertMessage; } diff --git a/ouds_theme_contract/lib/ouds_component_version.dart b/ouds_theme_contract/lib/ouds_component_version.dart index 5f6d0e61d..a789b2f99 100644 --- a/ouds_theme_contract/lib/ouds_component_version.dart +++ b/ouds_theme_contract/lib/ouds_component_version.dart @@ -13,23 +13,28 @@ // Generated by Tokenator class OudsComponentVersion { - static const alertMessage = '1.1.1'; - static const badge = '1.2.0'; - static const bar = '1.0.0'; - static const bottomSheet = '1.0.0'; - static const bulletList = '1.0.0'; - static const button = '3.2.0'; - static const checkbox = '2.4.0'; - static const chip = '1.3.0'; - static const divider = '1.0.0'; - static const inlineAlert = '1.0.0'; - static const link = '2.2.0'; - static const passwordInput = '1.2.0'; - static const phoneNumberInput = '1.2.0'; - static const pinCodeInput = '1.2.0'; - static const radioButton = '1.4.0'; - static const skeleton = '1.0.0'; - static const switchButton = '1.5.0'; - static const tag = '1.4.0'; - static const textInput = '1.3.0'; + static const alertMessage = '1.1.1'; + static const appBar = '1.0.0'; + static const badge = '1.2.0'; + static const badgeCount = '1.2.0'; + static const badgeIcon = '1.3.0'; + static const bottomSheet = '0.0.0'; + static const bulletList = '1.1.0'; + static const button = '3.2.0'; + static const checkbox = '2.4.0'; + static const divider = '1.0.0'; + static const filterChip = '1.4.0'; + static const inlineAlert = '1.0.0'; + static const inputTag = '1.2.0'; + static const link = '2.2.0'; + static const navigationBar = '1.0.0'; + static const passwordInput = '1.3.0'; + static const phoneNumberInput = '1.3.0'; + static const pinCodeInput = '1.3.0'; + static const radioButton = '1.4.0'; + static const skeleton = '1.0.0'; + static const suggestionChip = '1.4.0'; + static const switchButton = '1.5.0'; + static const tag = '1.5.0'; + static const textInput = '1.4.0'; } diff --git a/ouds_theme_contract/lib/ouds_tokens_version.dart b/ouds_theme_contract/lib/ouds_tokens_version.dart index cac791562..f16bb4299 100644 --- a/ouds_theme_contract/lib/ouds_tokens_version.dart +++ b/ouds_theme_contract/lib/ouds_tokens_version.dart @@ -13,14 +13,14 @@ // Generated by Tokenator class OudsTokensVersion { - static const oudsCore = '1.9.0'; + static const oudsCore = '1.10.0'; static const androidCore = '1.0.0'; static const androidSystem = '1.2.0'; static const orangeCore = '1.2.0'; - static const orangeBrand = '2.3.0'; - static const orangeCompactBrand = '2.3.0'; - static const soshCore = '1.2.0'; - static const soshBrand = '2.3.0'; - static const wireframeCore = '1.3.0'; - static const wireframeBrand = '2.3.0'; + static const orangeBrand = '2.5.0'; + static const orangeCompactBrand = '2.5.0'; + static const soshCore = '1.4.0'; + static const soshBrand = '2.5.0'; + static const wireframeCore = '1.4.0'; + static const wireframeBrand = '2.5.0'; } diff --git a/ouds_theme_contract/lib/theme/scheme/color/ouds_color_scheme.dart b/ouds_theme_contract/lib/theme/scheme/color/ouds_color_scheme.dart index 6a7736a3c..e6b476f74 100644 --- a/ouds_theme_contract/lib/theme/scheme/color/ouds_color_scheme.dart +++ b/ouds_theme_contract/lib/theme/scheme/color/ouds_color_scheme.dart @@ -23,10 +23,7 @@ class OudsColorScheme { final OudsColorSemanticTokens colorTokens; final bool isDarkTheme; - OudsColorScheme({ - required this.colorTokens, - required this.isDarkTheme, - }); + OudsColorScheme({required this.colorTokens, required this.isDarkTheme}); /// Creates an [OudsColorScheme] based on the current theme mode. /// @@ -41,7 +38,10 @@ class OudsColorScheme { required OudsColorSemanticTokens colorTokens, }) { final themeMode = OudsTheme.modeOf(context); - final isDark = themeMode == ThemeMode.system ? WidgetsBinding.instance.platformDispatcher.platformBrightness == Brightness.dark : themeMode == ThemeMode.dark; + final isDark = themeMode == ThemeMode.system + ? WidgetsBinding.instance.platformDispatcher.platformBrightness == + Brightness.dark + : themeMode == ThemeMode.dark; return OudsColorScheme(colorTokens: colorTokens, isDarkTheme: isDark); } @@ -50,51 +50,93 @@ class OudsColorScheme { T lightDark(T light, T dark) => isDarkTheme ? dark : light; /// Color - Action - Color get actionDisabled => isDarkTheme ? colorTokens.actionColorTokens.actionDisabledDark : colorTokens.actionColorTokens.actionDisabledLight; + Color get actionDisabled => isDarkTheme + ? colorTokens.actionColorTokens.actionDisabledDark + : colorTokens.actionColorTokens.actionDisabledLight; - Color get actionEnabled => isDarkTheme ? colorTokens.actionColorTokens.actionEnabledDark : colorTokens.actionColorTokens.actionEnabledLight; + Color get actionEnabled => isDarkTheme + ? colorTokens.actionColorTokens.actionEnabledDark + : colorTokens.actionColorTokens.actionEnabledLight; - Color get actionFocus => isDarkTheme ? colorTokens.actionColorTokens.actionFocusDark : colorTokens.actionColorTokens.actionFocusLight; + Color get actionFocus => isDarkTheme + ? colorTokens.actionColorTokens.actionFocusDark + : colorTokens.actionColorTokens.actionFocusLight; - Color get actionHighlighted => isDarkTheme ? colorTokens.actionColorTokens.actionHighlightedDark : colorTokens.actionColorTokens.actionHighlightedLight; + Color get actionHighlighted => isDarkTheme + ? colorTokens.actionColorTokens.actionHighlightedDark + : colorTokens.actionColorTokens.actionHighlightedLight; - Color get actionHover => isDarkTheme ? colorTokens.actionColorTokens.actionHoverDark : colorTokens.actionColorTokens.actionHoverLight; + Color get actionHover => isDarkTheme + ? colorTokens.actionColorTokens.actionHoverDark + : colorTokens.actionColorTokens.actionHoverLight; - Color get actionLoading => isDarkTheme ? colorTokens.actionColorTokens.actionLoadingDark : colorTokens.actionColorTokens.actionLoadingLight; + Color get actionLoading => isDarkTheme + ? colorTokens.actionColorTokens.actionLoadingDark + : colorTokens.actionColorTokens.actionLoadingLight; - Color get actionNegativeEnabled => isDarkTheme ? colorTokens.actionColorTokens.actionNegativeEnabledDark : colorTokens.actionColorTokens.actionNegativeEnabledLight; + Color get actionNegativeEnabled => isDarkTheme + ? colorTokens.actionColorTokens.actionNegativeEnabledDark + : colorTokens.actionColorTokens.actionNegativeEnabledLight; - Color get actionNegativeFocus => isDarkTheme ? colorTokens.actionColorTokens.actionNegativeFocusDark : colorTokens.actionColorTokens.actionNegativeFocusLight; + Color get actionNegativeFocus => isDarkTheme + ? colorTokens.actionColorTokens.actionNegativeFocusDark + : colorTokens.actionColorTokens.actionNegativeFocusLight; - Color get actionNegativeHover => isDarkTheme ? colorTokens.actionColorTokens.actionNegativeHoverDark : colorTokens.actionColorTokens.actionNegativeHoverLight; + Color get actionNegativeHover => isDarkTheme + ? colorTokens.actionColorTokens.actionNegativeHoverDark + : colorTokens.actionColorTokens.actionNegativeHoverLight; - Color get actionNegativeLoading => isDarkTheme ? colorTokens.actionColorTokens.actionNegativeLoadingDark : colorTokens.actionColorTokens.actionNegativeLoadingLight; + Color get actionNegativeLoading => isDarkTheme + ? colorTokens.actionColorTokens.actionNegativeLoadingDark + : colorTokens.actionColorTokens.actionNegativeLoadingLight; - Color get actionNegativePressed => isDarkTheme ? colorTokens.actionColorTokens.actionNegativePressedDark : colorTokens.actionColorTokens.actionNegativePressedLight; + Color get actionNegativePressed => isDarkTheme + ? colorTokens.actionColorTokens.actionNegativePressedDark + : colorTokens.actionColorTokens.actionNegativePressedLight; - Color get actionPressed => isDarkTheme ? colorTokens.actionColorTokens.actionPressedDark : colorTokens.actionColorTokens.actionPressedLight; + Color get actionPressed => isDarkTheme + ? colorTokens.actionColorTokens.actionPressedDark + : colorTokens.actionColorTokens.actionPressedLight; - Color get actionIosAccent => isDarkTheme ? colorTokens.actionColorTokens.actionIosAccentDark : colorTokens.actionColorTokens.actionIosAccentLight; + Color get actionSelected => isDarkTheme + ? colorTokens.actionColorTokens.actionSelectedDark + : colorTokens.actionColorTokens.actionSelectedLight; - Color get actionSelected => isDarkTheme ? colorTokens.actionColorTokens.actionSelectedDark : colorTokens.actionColorTokens.actionSelectedLight; + Color get actionSupportEnabled => isDarkTheme + ? colorTokens.actionColorTokens.actionSupportEnabledDark + : colorTokens.actionColorTokens.actionSupportEnabledLight; - Color get actionSupportEnabled => isDarkTheme ? colorTokens.actionColorTokens.actionSupportEnabledDark : colorTokens.actionColorTokens.actionSupportEnabledLight; + Color get actionSupportDisabled => isDarkTheme + ? colorTokens.actionColorTokens.actionSupportDisabledDark + : colorTokens.actionColorTokens.actionSupportDisabledLight; - Color get actionSupportDisabled => isDarkTheme ? colorTokens.actionColorTokens.actionSupportDisabledDark : colorTokens.actionColorTokens.actionSupportDisabledLight; + Color get actionSupportFocus => isDarkTheme + ? colorTokens.actionColorTokens.actionSupportFocusDark + : colorTokens.actionColorTokens.actionSupportFocusLight; - Color get actionSupportFocus => isDarkTheme ? colorTokens.actionColorTokens.actionSupportFocusDark : colorTokens.actionColorTokens.actionSupportFocusLight; + Color get actionSupportHover => isDarkTheme + ? colorTokens.actionColorTokens.actionSupportHoverDark + : colorTokens.actionColorTokens.actionSupportHoverLight; - Color get actionSupportHover => isDarkTheme ? colorTokens.actionColorTokens.actionSupportHoverDark : colorTokens.actionColorTokens.actionSupportHoverLight; + Color get actionSupportLoading => isDarkTheme + ? colorTokens.actionColorTokens.actionSupportLoadingDark + : colorTokens.actionColorTokens.actionSupportLoadingLight; - Color get actionSupportLoading => isDarkTheme ? colorTokens.actionColorTokens.actionSupportLoadingDark : colorTokens.actionColorTokens.actionSupportLoadingLight; + Color get actionSupportPressed => isDarkTheme + ? colorTokens.actionColorTokens.actionSupportPressedDark + : colorTokens.actionColorTokens.actionSupportPressedLight; - Color get actionSupportPressed => isDarkTheme ? colorTokens.actionColorTokens.actionSupportPressedDark : colorTokens.actionColorTokens.actionSupportPressedLight; + Color get actionVisited => isDarkTheme + ? colorTokens.actionColorTokens.actionVisitedDark + : colorTokens.actionColorTokens.actionVisitedLight; - Color get actionVisited => isDarkTheme ? colorTokens.actionColorTokens.actionVisitedDark : colorTokens.actionColorTokens.actionVisitedLight; + Color get actionReadOnlyPrimary => isDarkTheme + ? colorTokens.actionColorTokens.actionReadOnlyPrimaryDark + : colorTokens.actionColorTokens.actionReadOnlyPrimaryLight; - Color get actionReadOnlyPrimary => isDarkTheme ? colorTokens.actionColorTokens.actionReadOnlyPrimaryDark : colorTokens.actionColorTokens.actionReadOnlyPrimaryLight; - - Color get actionReadOnlySecondary => isDarkTheme ? colorTokens.actionColorTokens.actionReadOnlySecondaryDark : colorTokens.actionColorTokens.actionReadOnlySecondaryLight; + Color get actionReadOnlySecondary => isDarkTheme + ? colorTokens.actionColorTokens.actionReadOnlySecondaryDark + : colorTokens.actionColorTokens.actionReadOnlySecondaryLight; /// Color - Always Color get alwaysBlack => colorTokens.alwaysColorTokens.alwaysBlack; @@ -107,315 +149,545 @@ class OudsColorScheme { /// Color - Background - Color get bgInverseHigh => isDarkTheme ? colorTokens.backgroundColorTokens.bgInverseHighDark : colorTokens.backgroundColorTokens.bgInverseHighLight; + Color get bgInverseHigh => isDarkTheme + ? colorTokens.backgroundColorTokens.bgInverseHighDark + : colorTokens.backgroundColorTokens.bgInverseHighLight; - Color get bgInverseLow => isDarkTheme ? colorTokens.backgroundColorTokens.bgInverseLowDark : colorTokens.backgroundColorTokens.bgInverseLowLight; + Color get bgInverseLow => isDarkTheme + ? colorTokens.backgroundColorTokens.bgInverseLowDark + : colorTokens.backgroundColorTokens.bgInverseLowLight; - Color get bgPrimary => isDarkTheme ? colorTokens.backgroundColorTokens.bgPrimaryDark : colorTokens.backgroundColorTokens.bgPrimaryLight; + Color get bgPrimary => isDarkTheme + ? colorTokens.backgroundColorTokens.bgPrimaryDark + : colorTokens.backgroundColorTokens.bgPrimaryLight; - Color get bgSecondary => isDarkTheme ? colorTokens.backgroundColorTokens.bgSecondaryDark : colorTokens.backgroundColorTokens.bgSecondaryLight; + Color get bgSecondary => isDarkTheme + ? colorTokens.backgroundColorTokens.bgSecondaryDark + : colorTokens.backgroundColorTokens.bgSecondaryLight; - Color get bgTertiary => isDarkTheme ? colorTokens.backgroundColorTokens.bgTertiaryDark : colorTokens.backgroundColorTokens.bgTertiaryLight; + Color get bgTertiary => isDarkTheme + ? colorTokens.backgroundColorTokens.bgTertiaryDark + : colorTokens.backgroundColorTokens.bgTertiaryLight; /// Color - Border - Color get borderBrandPrimary => isDarkTheme ? colorTokens.borderColorTokens.borderBrandPrimaryDark : colorTokens.borderColorTokens.borderBrandPrimaryLight; + Color get borderBrandPrimary => isDarkTheme + ? colorTokens.borderColorTokens.borderBrandPrimaryDark + : colorTokens.borderColorTokens.borderBrandPrimaryLight; - Color get borderBrandSecondary => isDarkTheme ? colorTokens.borderColorTokens.borderBrandSecondaryDark : colorTokens.borderColorTokens.borderBrandSecondaryLight; + Color get borderBrandSecondary => isDarkTheme + ? colorTokens.borderColorTokens.borderBrandSecondaryDark + : colorTokens.borderColorTokens.borderBrandSecondaryLight; - Color get borderBrandTertiary => isDarkTheme ? colorTokens.borderColorTokens.borderBrandTertiaryDark : colorTokens.borderColorTokens.borderBrandTertiaryLight; + Color get borderBrandTertiary => isDarkTheme + ? colorTokens.borderColorTokens.borderBrandTertiaryDark + : colorTokens.borderColorTokens.borderBrandTertiaryLight; - Color get borderDefault => isDarkTheme ? colorTokens.borderColorTokens.borderDefaultDark : colorTokens.borderColorTokens.borderDefaultLight; + Color get borderDefault => isDarkTheme + ? colorTokens.borderColorTokens.borderDefaultDark + : colorTokens.borderColorTokens.borderDefaultLight; - Color get borderEmphasized => isDarkTheme ? colorTokens.borderColorTokens.borderEmphasizedDark : colorTokens.borderColorTokens.borderEmphasizedLight; + Color get borderEmphasized => isDarkTheme + ? colorTokens.borderColorTokens.borderEmphasizedDark + : colorTokens.borderColorTokens.borderEmphasizedLight; - Color get borderFocus => isDarkTheme ? colorTokens.borderColorTokens.borderFocusDark : colorTokens.borderColorTokens.borderFocusLight; + Color get borderFocus => isDarkTheme + ? colorTokens.borderColorTokens.borderFocusDark + : colorTokens.borderColorTokens.borderFocusLight; - Color get borderFocusInset => isDarkTheme ? colorTokens.borderColorTokens.borderFocusInsetDark : colorTokens.borderColorTokens.borderFocusInsetLight; + Color get borderFocusInset => isDarkTheme + ? colorTokens.borderColorTokens.borderFocusInsetDark + : colorTokens.borderColorTokens.borderFocusInsetLight; - Color get borderMuted => isDarkTheme ? colorTokens.borderColorTokens.borderMutedDark : colorTokens.borderColorTokens.borderMutedLight; + Color get borderMuted => isDarkTheme + ? colorTokens.borderColorTokens.borderMutedDark + : colorTokens.borderColorTokens.borderMutedLight; - Color get borderOnBrandPrimary => isDarkTheme ? colorTokens.borderColorTokens.borderOnBrandPrimaryDark : colorTokens.borderColorTokens.borderOnBrandPrimaryLight; + Color get borderOnBrandPrimary => isDarkTheme + ? colorTokens.borderColorTokens.borderOnBrandPrimaryDark + : colorTokens.borderColorTokens.borderOnBrandPrimaryLight; - Color get borderOnBrandSecondary => isDarkTheme ? colorTokens.borderColorTokens.borderOnBrandSecondaryDark : colorTokens.borderColorTokens.borderOnBrandSecondaryLight; + Color get borderOnBrandSecondary => isDarkTheme + ? colorTokens.borderColorTokens.borderOnBrandSecondaryDark + : colorTokens.borderColorTokens.borderOnBrandSecondaryLight; - Color get borderOnBrandTertiary => isDarkTheme ? colorTokens.borderColorTokens.borderOnBrandTertiaryDark : colorTokens.borderColorTokens.borderOnBrandTertiaryLight; + Color get borderOnBrandTertiary => isDarkTheme + ? colorTokens.borderColorTokens.borderOnBrandTertiaryDark + : colorTokens.borderColorTokens.borderOnBrandTertiaryLight; - Color get borderMinimal => isDarkTheme ? colorTokens.borderColorTokens.borderMinimalDark : colorTokens.borderColorTokens.borderMinimalLight; + Color get borderMinimal => isDarkTheme + ? colorTokens.borderColorTokens.borderMinimalDark + : colorTokens.borderColorTokens.borderMinimalLight; - Color get borderStatusAccent => isDarkTheme ? colorTokens.borderColorTokens.borderStatusAccentDark : colorTokens.borderColorTokens.borderStatusAccentLight; + Color get borderStatusAccent => isDarkTheme + ? colorTokens.borderColorTokens.borderStatusAccentDark + : colorTokens.borderColorTokens.borderStatusAccentLight; - Color get borderStatusInfo => isDarkTheme ? colorTokens.borderColorTokens.borderStatusInfoDark : colorTokens.borderColorTokens.borderStatusInfoLight; + Color get borderStatusInfo => isDarkTheme + ? colorTokens.borderColorTokens.borderStatusInfoDark + : colorTokens.borderColorTokens.borderStatusInfoLight; - Color get borderStatusNegative => isDarkTheme ? colorTokens.borderColorTokens.borderStatusNegativeDark : colorTokens.borderColorTokens.borderStatusNegativeLight; + Color get borderStatusNegative => isDarkTheme + ? colorTokens.borderColorTokens.borderStatusNegativeDark + : colorTokens.borderColorTokens.borderStatusNegativeLight; - Color get borderStatusPositive => isDarkTheme ? colorTokens.borderColorTokens.borderStatusPositiveDark : colorTokens.borderColorTokens.borderStatusPositiveLight; + Color get borderStatusPositive => isDarkTheme + ? colorTokens.borderColorTokens.borderStatusPositiveDark + : colorTokens.borderColorTokens.borderStatusPositiveLight; - Color get borderStatusWarning => isDarkTheme ? colorTokens.borderColorTokens.borderStatusWarningDark : colorTokens.borderColorTokens.borderStatusWarningLight; + Color get borderStatusWarning => isDarkTheme + ? colorTokens.borderColorTokens.borderStatusWarningDark + : colorTokens.borderColorTokens.borderStatusWarningLight; /// Color - Content - Color get contentBrandPrimary => isDarkTheme ? colorTokens.contentColorTokens.contentBrandPrimaryDark : colorTokens.contentColorTokens.contentBrandPrimaryLight; + Color get contentBrandPrimary => isDarkTheme + ? colorTokens.contentColorTokens.contentBrandPrimaryDark + : colorTokens.contentColorTokens.contentBrandPrimaryLight; - Color get contentBrandSecondary => isDarkTheme ? colorTokens.contentColorTokens.contentBrandSecondaryDark : colorTokens.contentColorTokens.contentBrandSecondaryLight; + Color get contentBrandSecondary => isDarkTheme + ? colorTokens.contentColorTokens.contentBrandSecondaryDark + : colorTokens.contentColorTokens.contentBrandSecondaryLight; - Color get contentBrandTertiary => isDarkTheme ? colorTokens.contentColorTokens.contentBrandTertiaryDark : colorTokens.contentColorTokens.contentBrandTertiaryLight; + Color get contentBrandTertiary => isDarkTheme + ? colorTokens.contentColorTokens.contentBrandTertiaryDark + : colorTokens.contentColorTokens.contentBrandTertiaryLight; - Color get contentInverse => isDarkTheme ? colorTokens.contentColorTokens.contentInverseDark : colorTokens.contentColorTokens.contentInverseLight; + Color get contentInverse => isDarkTheme + ? colorTokens.contentColorTokens.contentInverseDark + : colorTokens.contentColorTokens.contentInverseLight; - Color get contentDefault => isDarkTheme ? colorTokens.contentColorTokens.contentDefaultDark : colorTokens.contentColorTokens.contentDefaultLight; + Color get contentDefault => isDarkTheme + ? colorTokens.contentColorTokens.contentDefaultDark + : colorTokens.contentColorTokens.contentDefaultLight; - Color get contentDisabled => isDarkTheme ? colorTokens.contentColorTokens.contentDisabledDark : colorTokens.contentColorTokens.contentDisabledLight; + Color get contentDisabled => isDarkTheme + ? colorTokens.contentColorTokens.contentDisabledDark + : colorTokens.contentColorTokens.contentDisabledLight; - Color get contentMuted => isDarkTheme ? colorTokens.contentColorTokens.contentMutedDark : colorTokens.contentColorTokens.contentMutedLight; + Color get contentMuted => isDarkTheme + ? colorTokens.contentColorTokens.contentMutedDark + : colorTokens.contentColorTokens.contentMutedLight; - Color get contentOnActionDisabled => isDarkTheme ? colorTokens.contentColorTokens.contentOnActionDisabledDark : colorTokens.contentColorTokens.contentOnActionDisabledLight; + Color get contentOnActionDisabled => isDarkTheme + ? colorTokens.contentColorTokens.contentOnActionDisabledDark + : colorTokens.contentColorTokens.contentOnActionDisabledLight; - Color get contentOnActionEnabled => isDarkTheme ? colorTokens.contentColorTokens.contentOnActionEnabledDark : colorTokens.contentColorTokens.contentOnActionEnabledLight; + Color get contentOnActionEnabled => isDarkTheme + ? colorTokens.contentColorTokens.contentOnActionEnabledDark + : colorTokens.contentColorTokens.contentOnActionEnabledLight; - Color get contentOnActionFocus => isDarkTheme ? colorTokens.contentColorTokens.contentOnActionFocusDark : colorTokens.contentColorTokens.contentOnActionFocusLight; + Color get contentOnActionFocus => isDarkTheme + ? colorTokens.contentColorTokens.contentOnActionFocusDark + : colorTokens.contentColorTokens.contentOnActionFocusLight; - Color get contentOnActionHighlighted => isDarkTheme ? colorTokens.contentColorTokens.contentOnActionHighlightedDark : colorTokens.contentColorTokens.contentOnActionHighlightedLight; + Color get contentOnActionHighlighted => isDarkTheme + ? colorTokens.contentColorTokens.contentOnActionHighlightedDark + : colorTokens.contentColorTokens.contentOnActionHighlightedLight; - Color get contentOnActionHover => isDarkTheme ? colorTokens.contentColorTokens.contentOnActionHoverDark : colorTokens.contentColorTokens.contentOnActionHoverLight; + Color get contentOnActionHover => isDarkTheme + ? colorTokens.contentColorTokens.contentOnActionHoverDark + : colorTokens.contentColorTokens.contentOnActionHoverLight; - Color get contentOnActionLoading => isDarkTheme ? colorTokens.contentColorTokens.contentOnActionLoadingDark : colorTokens.contentColorTokens.contentOnActionLoadingLight; + Color get contentOnActionLoading => isDarkTheme + ? colorTokens.contentColorTokens.contentOnActionLoadingDark + : colorTokens.contentColorTokens.contentOnActionLoadingLight; - Color get contentOnActionPressed => isDarkTheme ? colorTokens.contentColorTokens.contentOnActionPressedDark : colorTokens.contentColorTokens.contentOnActionPressedLight; + Color get contentOnActionPressed => isDarkTheme + ? colorTokens.contentColorTokens.contentOnActionPressedDark + : colorTokens.contentColorTokens.contentOnActionPressedLight; - Color get contentOnActionSelected => isDarkTheme ? colorTokens.contentColorTokens.contentOnActionSelectedDark : colorTokens.contentColorTokens.contentOnActionSelectedLight; + Color get contentOnActionSelected => isDarkTheme + ? colorTokens.contentColorTokens.contentOnActionSelectedDark + : colorTokens.contentColorTokens.contentOnActionSelectedLight; - Color get contentOnBrandPrimary => isDarkTheme ? colorTokens.contentColorTokens.contentOnBrandPrimaryDark : colorTokens.contentColorTokens.contentOnBrandPrimaryLight; + Color get contentOnBrandPrimary => isDarkTheme + ? colorTokens.contentColorTokens.contentOnBrandPrimaryDark + : colorTokens.contentColorTokens.contentOnBrandPrimaryLight; - Color get contentOnBrandSecondary => isDarkTheme ? colorTokens.contentColorTokens.contentOnBrandSecondaryDark : colorTokens.contentColorTokens.contentOnBrandSecondaryLight; + Color get contentOnBrandSecondary => isDarkTheme + ? colorTokens.contentColorTokens.contentOnBrandSecondaryDark + : colorTokens.contentColorTokens.contentOnBrandSecondaryLight; - Color get contentOnBrandTertiary => isDarkTheme ? colorTokens.contentColorTokens.contentOnBrandTertiaryDark : colorTokens.contentColorTokens.contentOnBrandTertiaryLight; + Color get contentOnBrandTertiary => isDarkTheme + ? colorTokens.contentColorTokens.contentOnBrandTertiaryDark + : colorTokens.contentColorTokens.contentOnBrandTertiaryLight; - Color get contentOnStatusPositiveEmphasized => - isDarkTheme ? colorTokens.contentColorTokens.contentOnStatusPositiveEmphasizedDark : colorTokens.contentColorTokens.contentOnStatusPositiveEmphasizedLight; + Color get contentOnStatusPositiveEmphasized => isDarkTheme + ? colorTokens.contentColorTokens.contentOnStatusPositiveEmphasizedDark + : colorTokens.contentColorTokens.contentOnStatusPositiveEmphasizedLight; - Color get contentOnStatusPositiveMuted => isDarkTheme ? colorTokens.contentColorTokens.contentOnStatusPositiveMutedDark : colorTokens.contentColorTokens.contentOnStatusPositiveMutedLight; + Color get contentOnStatusPositiveMuted => isDarkTheme + ? colorTokens.contentColorTokens.contentOnStatusPositiveMutedDark + : colorTokens.contentColorTokens.contentOnStatusPositiveMutedLight; - Color get contentOnStatusWarningEmphasized => - isDarkTheme ? colorTokens.contentColorTokens.contentOnStatusWarningEmphasizedDark : colorTokens.contentColorTokens.contentOnStatusWarningEmphasizedLight; + Color get contentOnStatusWarningEmphasized => isDarkTheme + ? colorTokens.contentColorTokens.contentOnStatusWarningEmphasizedDark + : colorTokens.contentColorTokens.contentOnStatusWarningEmphasizedLight; - Color get contentOnStatusWarningMuted => isDarkTheme ? colorTokens.contentColorTokens.contentOnStatusWarningMutedDark : colorTokens.contentColorTokens.contentOnStatusWarningMutedLight; + Color get contentOnStatusWarningMuted => isDarkTheme + ? colorTokens.contentColorTokens.contentOnStatusWarningMutedDark + : colorTokens.contentColorTokens.contentOnStatusWarningMutedLight; - Color get contentOnStatusInfoEmphasized => isDarkTheme ? colorTokens.contentColorTokens.contentOnStatusInfoEmphasizedDark : colorTokens.contentColorTokens.contentOnStatusInfoEmphasizedLight; + Color get contentOnStatusInfoEmphasized => isDarkTheme + ? colorTokens.contentColorTokens.contentOnStatusInfoEmphasizedDark + : colorTokens.contentColorTokens.contentOnStatusInfoEmphasizedLight; - Color get contentOnStatusInfoMuted => isDarkTheme ? colorTokens.contentColorTokens.contentOnStatusInfoMutedDark : colorTokens.contentColorTokens.contentOnStatusInfoMutedLight; + Color get contentOnStatusInfoMuted => isDarkTheme + ? colorTokens.contentColorTokens.contentOnStatusInfoMutedDark + : colorTokens.contentColorTokens.contentOnStatusInfoMutedLight; - Color get contentOnStatusNegativeEmphasized => - isDarkTheme ? colorTokens.contentColorTokens.contentOnStatusNegativeEmphasizedDark : colorTokens.contentColorTokens.contentOnStatusNegativeEmphasizedLight; + Color get contentOnStatusNegativeEmphasized => isDarkTheme + ? colorTokens.contentColorTokens.contentOnStatusNegativeEmphasizedDark + : colorTokens.contentColorTokens.contentOnStatusNegativeEmphasizedLight; - Color get contentOnStatusNegativeMuted => isDarkTheme ? colorTokens.contentColorTokens.contentOnStatusNegativeMutedDark : colorTokens.contentColorTokens.contentOnStatusNegativeMutedLight; + Color get contentOnStatusNegativeMuted => isDarkTheme + ? colorTokens.contentColorTokens.contentOnStatusNegativeMutedDark + : colorTokens.contentColorTokens.contentOnStatusNegativeMutedLight; - Color get contentOnStatusAccentEmphasized => isDarkTheme ? colorTokens.contentColorTokens.contentOnStatusAccentEmphasizedDark : colorTokens.contentColorTokens.contentOnStatusAccentEmphasizedLight; + Color get contentOnStatusAccentEmphasized => isDarkTheme + ? colorTokens.contentColorTokens.contentOnStatusAccentEmphasizedDark + : colorTokens.contentColorTokens.contentOnStatusAccentEmphasizedLight; - Color get contentOnStatusAccentMuted => isDarkTheme ? colorTokens.contentColorTokens.contentOnStatusAccentMutedDark : colorTokens.contentColorTokens.contentOnStatusAccentMutedLight; + Color get contentOnStatusAccentMuted => isDarkTheme + ? colorTokens.contentColorTokens.contentOnStatusAccentMutedDark + : colorTokens.contentColorTokens.contentOnStatusAccentMutedLight; - Color get contentStatusAccent => isDarkTheme ? colorTokens.contentColorTokens.contentStatusAccentDark : colorTokens.contentColorTokens.contentStatusAccentLight; + Color get contentStatusAccent => isDarkTheme + ? colorTokens.contentColorTokens.contentStatusAccentDark + : colorTokens.contentColorTokens.contentStatusAccentLight; - Color get contentStatusInfo => isDarkTheme ? colorTokens.contentColorTokens.contentStatusInfoDark : colorTokens.contentColorTokens.contentStatusInfoLight; + Color get contentStatusInfo => isDarkTheme + ? colorTokens.contentColorTokens.contentStatusInfoDark + : colorTokens.contentColorTokens.contentStatusInfoLight; - Color get contentStatusNegative => isDarkTheme ? colorTokens.contentColorTokens.contentStatusNegativeDark : colorTokens.contentColorTokens.contentStatusNegativeLight; + Color get contentStatusNegative => isDarkTheme + ? colorTokens.contentColorTokens.contentStatusNegativeDark + : colorTokens.contentColorTokens.contentStatusNegativeLight; - Color get contentStatusPositive => isDarkTheme ? colorTokens.contentColorTokens.contentStatusPositiveDark : colorTokens.contentColorTokens.contentStatusPositiveLight; + Color get contentStatusPositive => isDarkTheme + ? colorTokens.contentColorTokens.contentStatusPositiveDark + : colorTokens.contentColorTokens.contentStatusPositiveLight; - Color get contentStatusWarning => isDarkTheme ? colorTokens.contentColorTokens.contentStatusWarningDark : colorTokens.contentColorTokens.contentStatusWarningLight; + Color get contentStatusWarning => isDarkTheme + ? colorTokens.contentColorTokens.contentStatusWarningDark + : colorTokens.contentColorTokens.contentStatusWarningLight; /// Color - Opacity - Color get opacityLowest => isDarkTheme ? colorTokens.opacityColorTokens.opacityLowestDark : colorTokens.opacityColorTokens.opacityLowestLight; + Color get opacityLowest => isDarkTheme + ? colorTokens.opacityColorTokens.opacityLowestDark + : colorTokens.opacityColorTokens.opacityLowestLight; - Color get opacityLower => isDarkTheme ? colorTokens.opacityColorTokens.opacityLowerDark : colorTokens.opacityColorTokens.opacityLowerLight; + Color get opacityLower => isDarkTheme + ? colorTokens.opacityColorTokens.opacityLowerDark + : colorTokens.opacityColorTokens.opacityLowerLight; - Color get opacityTransparent => isDarkTheme ? colorTokens.opacityColorTokens.opacityTransparentDark : colorTokens.opacityColorTokens.opacityTransparentLight; + Color get opacityTransparent => isDarkTheme + ? colorTokens.opacityColorTokens.opacityTransparentDark + : colorTokens.opacityColorTokens.opacityTransparentLight; /// Color - Overlay - Color get overlayDropdown => isDarkTheme ? colorTokens.overlayColorTokens.overlayDropdownDark : colorTokens.overlayColorTokens.overlayDropdownLight; + Color get overlayDropdown => isDarkTheme + ? colorTokens.overlayColorTokens.overlayDropdownDark + : colorTokens.overlayColorTokens.overlayDropdownLight; - Color get overlayTooltip => isDarkTheme ? colorTokens.overlayColorTokens.overlayTooltipDark : colorTokens.overlayColorTokens.overlayTooltipLight; + Color get overlayTooltip => isDarkTheme + ? colorTokens.overlayColorTokens.overlayTooltipDark + : colorTokens.overlayColorTokens.overlayTooltipLight; - Color get overlayDrag => isDarkTheme ? colorTokens.overlayColorTokens.overlayDragDark : colorTokens.overlayColorTokens.overlayDragLight; + Color get overlayDrag => isDarkTheme + ? colorTokens.overlayColorTokens.overlayDragDark + : colorTokens.overlayColorTokens.overlayDragLight; - Color get overlayModal => isDarkTheme ? colorTokens.overlayColorTokens.overlayModalDark : colorTokens.overlayColorTokens.overlayModalLight; + Color get overlayModal => isDarkTheme + ? colorTokens.overlayColorTokens.overlayModalSheetDark + : colorTokens.overlayColorTokens.overlayModalSheetLight; /// Color - Repository - Color get repositoryAccentMedium => colorTokens.repositoryColorTokens.repositoryAccentMedium; + Color get repositoryAccentMedium => + colorTokens.repositoryColorTokens.repositoryAccentMedium; + + Color get repositoryAccentHighest => + colorTokens.repositoryColorTokens.repositoryAccentHighest; - Color get repositoryAccentHighest => colorTokens.repositoryColorTokens.repositoryAccentHighest; + Color get repositoryAccentLow => + colorTokens.repositoryColorTokens.repositoryAccentLow; - Color get repositoryAccentLow => colorTokens.repositoryColorTokens.repositoryAccentLow; + Color get repositoryAccentLowest => + colorTokens.repositoryColorTokens.repositoryAccentLowest; - Color get repositoryAccentLowest => colorTokens.repositoryColorTokens.repositoryAccentLowest; + Color get repositoryInfoMedium => + colorTokens.repositoryColorTokens.repositoryInfoMedium; - Color get repositoryInfoMedium => colorTokens.repositoryColorTokens.repositoryInfoMedium; + Color get repositoryInfoHigh => + colorTokens.repositoryColorTokens.repositoryInfoHigh; - Color get repositoryInfoHigh => colorTokens.repositoryColorTokens.repositoryInfoHigh; + Color get repositoryInfoHighest => + colorTokens.repositoryColorTokens.repositoryInfoHighest; - Color get repositoryInfoHighest => colorTokens.repositoryColorTokens.repositoryInfoHighest; + Color get repositoryInfoLow => + colorTokens.repositoryColorTokens.repositoryInfoLow; - Color get repositoryInfoLow => colorTokens.repositoryColorTokens.repositoryInfoLow; + Color get repositoryInfoLowest => + colorTokens.repositoryColorTokens.repositoryInfoLowest; - Color get repositoryInfoLowest => colorTokens.repositoryColorTokens.repositoryInfoLowest; + Color get repositoryNegativeMedium => + colorTokens.repositoryColorTokens.repositoryNegativeMedium; - Color get repositoryNegativeMedium => colorTokens.repositoryColorTokens.repositoryNegativeMedium; + Color get repositoryNegativeHigh => + colorTokens.repositoryColorTokens.repositoryNegativeHigh; - Color get repositoryNegativeHigh => colorTokens.repositoryColorTokens.repositoryNegativeHigh; + Color get repositoryNegativeHigher => + colorTokens.repositoryColorTokens.repositoryNegativeHigher; - Color get repositoryNegativeHigher => colorTokens.repositoryColorTokens.repositoryNegativeHigher; + Color get repositoryNegativeHighest => + colorTokens.repositoryColorTokens.repositoryNegativeHighest; - Color get repositoryNegativeHighest => colorTokens.repositoryColorTokens.repositoryNegativeHighest; + Color get repositoryNegativeLow => + colorTokens.repositoryColorTokens.repositoryNegativeLow; - Color get repositoryNegativeLow => colorTokens.repositoryColorTokens.repositoryNegativeLow; + Color get repositoryNegativeLower => + colorTokens.repositoryColorTokens.repositoryNegativeLower; - Color get repositoryNegativeLower => colorTokens.repositoryColorTokens.repositoryNegativeLower; + Color get repositoryNegativeLowest => + colorTokens.repositoryColorTokens.repositoryNegativeLowest; - Color get repositoryNegativeLowest => colorTokens.repositoryColorTokens.repositoryNegativeLowest; + Color get repositoryNeutralEmphasizedBlack => + colorTokens.repositoryColorTokens.repositoryNeutralEmphasizedBlack; - Color get repositoryNeutralEmphasizedBlack => colorTokens.repositoryColorTokens.repositoryNeutralEmphasizedBlack; + Color get repositoryNeutralEmphasizedHigh => + colorTokens.repositoryColorTokens.repositoryNeutralEmphasizedHigh; - Color get repositoryNeutralEmphasizedHigh => colorTokens.repositoryColorTokens.repositoryNeutralEmphasizedHigh; + Color get repositoryNeutralEmphasizedHigher => + colorTokens.repositoryColorTokens.repositoryNeutralEmphasizedHigher; - Color get repositoryNeutralEmphasizedHigher => colorTokens.repositoryColorTokens.repositoryNeutralEmphasizedHigher; + Color get repositoryNeutralEmphasizedHighest => + colorTokens.repositoryColorTokens.repositoryNeutralEmphasizedHighest; - Color get repositoryNeutralEmphasizedHighest => colorTokens.repositoryColorTokens.repositoryNeutralEmphasizedHighest; + Color get repositoryNeutralEmphasizedMedium => + colorTokens.repositoryColorTokens.repositoryNeutralEmphasizedMedium; - Color get repositoryNeutralEmphasizedMedium => colorTokens.repositoryColorTokens.repositoryNeutralEmphasizedMedium; + Color get repositoryNeutralMutedLower => + colorTokens.repositoryColorTokens.repositoryNeutralMutedLower; - Color get repositoryNeutralMutedLower => colorTokens.repositoryColorTokens.repositoryNeutralMutedLower; + Color get repositoryNeutralMutedLowest => + colorTokens.repositoryColorTokens.repositoryNeutralMutedLowest; - Color get repositoryNeutralMutedLowest => colorTokens.repositoryColorTokens.repositoryNeutralMutedLowest; + Color get repositoryNeutralMutedWhite => + colorTokens.repositoryColorTokens.repositoryNeutralMutedWhite; - Color get repositoryNeutralMutedWhite => colorTokens.repositoryColorTokens.repositoryNeutralMutedWhite; + Color get repositoryOpacityBlackHigh => + colorTokens.repositoryColorTokens.repositoryOpacityBlackHigh; - Color get repositoryOpacityBlackHigh => colorTokens.repositoryColorTokens.repositoryOpacityBlackHigh; + Color get repositoryOpacityBlackHigher => + colorTokens.repositoryColorTokens.repositoryOpacityBlackHigher; - Color get repositoryOpacityBlackHigher => colorTokens.repositoryColorTokens.repositoryOpacityBlackHigher; + Color get repositoryOpacityBlackHighest => + colorTokens.repositoryColorTokens.repositoryOpacityBlackHighest; - Color get repositoryOpacityBlackHighest => colorTokens.repositoryColorTokens.repositoryOpacityBlackHighest; + Color get repositoryOpacityBlackLow => + colorTokens.repositoryColorTokens.repositoryOpacityBlackLow; - Color get repositoryOpacityBlackLow => colorTokens.repositoryColorTokens.repositoryOpacityBlackLow; + Color get repositoryOpacityBlackLower => + colorTokens.repositoryColorTokens.repositoryOpacityBlackLower; - Color get repositoryOpacityBlackLower => colorTokens.repositoryColorTokens.repositoryOpacityBlackLower; + Color get repositoryOpacityBlackLowest => + colorTokens.repositoryColorTokens.repositoryOpacityBlackLowest; - Color get repositoryOpacityBlackLowest => colorTokens.repositoryColorTokens.repositoryOpacityBlackLowest; + Color get repositoryOpacityBlackMedium => + colorTokens.repositoryColorTokens.repositoryOpacityBlackMedium; - Color get repositoryOpacityBlackMedium => colorTokens.repositoryColorTokens.repositoryOpacityBlackMedium; + Color get repositoryOpacityBlackMediumLow => + colorTokens.repositoryColorTokens.repositoryOpacityBlackMediumLow; - Color get repositoryOpacityBlackMediumLow => colorTokens.repositoryColorTokens.repositoryOpacityBlackMediumLow; + Color get repositoryOpacityBlackMediumHigh => + colorTokens.repositoryColorTokens.repositoryOpacityBlackMediumHigh; - Color get repositoryOpacityBlackMediumHigh => colorTokens.repositoryColorTokens.repositoryOpacityBlackMediumHigh; + Color get repositoryOpacityBlackTransparent => + colorTokens.repositoryColorTokens.repositoryOpacityBlackTransparent; - Color get repositoryOpacityBlackTransparent => colorTokens.repositoryColorTokens.repositoryOpacityBlackTransparent; + Color get repositoryOpacityWhiteHigh => + colorTokens.repositoryColorTokens.repositoryOpacityWhiteHigh; - Color get repositoryOpacityWhiteHigh => colorTokens.repositoryColorTokens.repositoryOpacityWhiteHigh; + Color get repositoryOpacityWhiteHigher => + colorTokens.repositoryColorTokens.repositoryOpacityWhiteHigher; - Color get repositoryOpacityWhiteHigher => colorTokens.repositoryColorTokens.repositoryOpacityWhiteHigher; + Color get repositoryOpacityWhiteHighest => + colorTokens.repositoryColorTokens.repositoryOpacityWhiteHighest; - Color get repositoryOpacityWhiteHighest => colorTokens.repositoryColorTokens.repositoryOpacityWhiteHighest; + Color get repositoryOpacityWhiteMedium => + colorTokens.repositoryColorTokens.repositoryOpacityWhiteMedium; - Color get repositoryOpacityWhiteMedium => colorTokens.repositoryColorTokens.repositoryOpacityWhiteMedium; + Color get repositoryOpacityWhiteMediumLow => + colorTokens.repositoryColorTokens.repositoryOpacityWhiteMediumLow; - Color get repositoryOpacityWhiteMediumLow => colorTokens.repositoryColorTokens.repositoryOpacityWhiteMediumLow; + Color get repositoryOpacityWhiteLow => + colorTokens.repositoryColorTokens.repositoryOpacityWhiteLow; - Color get repositoryOpacityWhiteLow => colorTokens.repositoryColorTokens.repositoryOpacityWhiteLow; + Color get repositoryOpacityWhiteLower => + colorTokens.repositoryColorTokens.repositoryOpacityWhiteLower; - Color get repositoryOpacityWhiteLower => colorTokens.repositoryColorTokens.repositoryOpacityWhiteLower; + Color get repositoryOpacityWhiteLowest => + colorTokens.repositoryColorTokens.repositoryOpacityWhiteLowest; - Color get repositoryOpacityWhiteLowest => colorTokens.repositoryColorTokens.repositoryOpacityWhiteLowest; + Color get repositoryOpacityWhiteTransparent => + colorTokens.repositoryColorTokens.repositoryOpacityWhiteTransparent; - Color get repositoryOpacityWhiteTransparent => colorTokens.repositoryColorTokens.repositoryOpacityWhiteTransparent; + Color get repositoryOpacityPrimaryHigh => + colorTokens.repositoryColorTokens.repositoryOpacityPrimaryHigh; - Color get repositoryOpacityPrimaryHigh => colorTokens.repositoryColorTokens.repositoryOpacityPrimaryHigh; + Color get repositoryOpacityPrimaryHigher => + colorTokens.repositoryColorTokens.repositoryOpacityPrimaryHigher; - Color get repositoryOpacityPrimaryHigher => colorTokens.repositoryColorTokens.repositoryOpacityPrimaryHigher; + Color get repositoryOpacityPrimaryLowest => + colorTokens.repositoryColorTokens.repositoryOpacityPrimaryLowest; - Color get repositoryOpacityPrimaryLowest => colorTokens.repositoryColorTokens.repositoryOpacityPrimaryLowest; + Color get repositoryOpacityPrimaryLower => + colorTokens.repositoryColorTokens.repositoryOpacityPrimaryLower; - Color get repositoryOpacityPrimaryLower => colorTokens.repositoryColorTokens.repositoryOpacityPrimaryLower; + Color get repositoryOpacityPrimaryLow => + colorTokens.repositoryColorTokens.repositoryOpacityPrimaryLow; - Color get repositoryOpacityPrimaryLow => colorTokens.repositoryColorTokens.repositoryOpacityPrimaryLow; + Color get repositoryOpacityPrimaryMedium => + colorTokens.repositoryColorTokens.repositoryOpacityPrimaryMedium; - Color get repositoryOpacityPrimaryMedium => colorTokens.repositoryColorTokens.repositoryOpacityPrimaryMedium; + Color get repositoryPositiveMedium => + colorTokens.repositoryColorTokens.repositoryPositiveMedium; - Color get repositoryPositiveMedium => colorTokens.repositoryColorTokens.repositoryPositiveMedium; + Color get repositoryPositiveHigh => + colorTokens.repositoryColorTokens.repositoryPositiveHigh; - Color get repositoryPositiveHigh => colorTokens.repositoryColorTokens.repositoryPositiveHigh; + Color get repositoryPositiveHigher => + colorTokens.repositoryColorTokens.repositoryPositiveHigher; - Color get repositoryPositiveHigher => colorTokens.repositoryColorTokens.repositoryPositiveHigher; + Color get repositoryPositiveHighest => + colorTokens.repositoryColorTokens.repositoryPositiveHighest; - Color get repositoryPositiveHighest => colorTokens.repositoryColorTokens.repositoryPositiveHighest; + Color get repositoryPositiveLow => + colorTokens.repositoryColorTokens.repositoryPositiveLow; - Color get repositoryPositiveLow => colorTokens.repositoryColorTokens.repositoryPositiveLow; + Color get repositoryPositiveLowest => + colorTokens.repositoryColorTokens.repositoryPositiveLowest; - Color get repositoryPositiveLowest => colorTokens.repositoryColorTokens.repositoryPositiveLowest; + Color get repositoryPrimaryMedium => + colorTokens.repositoryColorTokens.repositoryPrimaryMedium; - Color get repositoryPrimaryMedium => colorTokens.repositoryColorTokens.repositoryPrimaryMedium; + Color get repositoryPrimaryLow => + colorTokens.repositoryColorTokens.repositoryPrimaryLow; - Color get repositoryPrimaryLow => colorTokens.repositoryColorTokens.repositoryPrimaryLow; + Color get repositoryPrimaryLower => + colorTokens.repositoryColorTokens.repositoryPrimaryLower; - Color get repositoryPrimaryLower => colorTokens.repositoryColorTokens.repositoryPrimaryLower; + Color get repositoryPrimaryHigh => + colorTokens.repositoryColorTokens.repositoryPrimaryHigh; - Color get repositoryPrimaryHigh => colorTokens.repositoryColorTokens.repositoryPrimaryHigh; + Color get repositorySecondaryLow => + colorTokens.repositoryColorTokens.repositorySecondaryLow; - Color get repositorySecondaryLow => colorTokens.repositoryColorTokens.repositorySecondaryLow; + Color get repositorySecondaryLower => + colorTokens.repositoryColorTokens.repositorySecondaryLower; - Color get repositorySecondaryLower => colorTokens.repositoryColorTokens.repositorySecondaryLower; + Color get repositorySecondaryLowest => + colorTokens.repositoryColorTokens.repositorySecondaryLowest; - Color get repositorySecondaryLowest => colorTokens.repositoryColorTokens.repositorySecondaryLowest; + Color get repositorySecondaryHigh => + colorTokens.repositoryColorTokens.repositorySecondaryHigh; - Color get repositorySecondaryHigh => colorTokens.repositoryColorTokens.repositorySecondaryHigh; + Color get repositorySecondaryHigherHigh => + colorTokens.repositoryColorTokens.repositorySecondaryHigherHigh; - Color get repositorySecondaryHigher => colorTokens.repositoryColorTokens.repositorySecondaryHigher; + Color get repositorySecondaryHigherLow => + colorTokens.repositoryColorTokens.repositorySecondaryHigherLow; - Color get repositorySecondaryMedium => colorTokens.repositoryColorTokens.repositorySecondaryMedium; + Color get repositorySecondaryMedium => + colorTokens.repositoryColorTokens.repositorySecondaryMedium; - Color get repositoryWarningMedium => colorTokens.repositoryColorTokens.repositoryWarningMedium; + Color get repositoryWarningMedium => + colorTokens.repositoryColorTokens.repositoryWarningMedium; - Color get repositoryWarningHigh => colorTokens.repositoryColorTokens.repositoryWarningHigh; + Color get repositoryWarningHigh => + colorTokens.repositoryColorTokens.repositoryWarningHigh; - Color get repositoryWarningHighest => colorTokens.repositoryColorTokens.repositoryWarningHighest; + Color get repositoryWarningHighest => + colorTokens.repositoryColorTokens.repositoryWarningHighest; - Color get repositoryWarningLow => colorTokens.repositoryColorTokens.repositoryWarningLow; + Color get repositoryWarningLow => + colorTokens.repositoryColorTokens.repositoryWarningLow; - Color get repositoryWarningLowest => colorTokens.repositoryColorTokens.repositoryWarningLowest; + Color get repositoryWarningLowest => + colorTokens.repositoryColorTokens.repositoryWarningLowest; /// Color - Surface - Color get surfaceBrandPrimary => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceBrandPrimaryDark : colorTokens.surfaceColorTokens.surfaceBrandPrimaryLight; + Color get surfaceBrandPrimary => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceBrandPrimaryDark + : colorTokens.surfaceColorTokens.surfaceBrandPrimaryLight; - Color get surfaceBrandSecondary => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceBrandSecondaryDark : colorTokens.surfaceColorTokens.surfaceBrandSecondaryLight; + Color get surfaceBrandSecondary => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceBrandSecondaryDark + : colorTokens.surfaceColorTokens.surfaceBrandSecondaryLight; - Color get surfaceBrandTertiary => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceBrandTertiaryDark : colorTokens.surfaceColorTokens.surfaceBrandTertiaryLight; + Color get surfaceBrandTertiary => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceBrandTertiaryDark + : colorTokens.surfaceColorTokens.surfaceBrandTertiaryLight; - Color get surfaceInverseHigh => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceInverseHighDark : colorTokens.surfaceColorTokens.surfaceInverseHighLight; + Color get surfaceInverseHigh => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceInverseHighDark + : colorTokens.surfaceColorTokens.surfaceInverseHighLight; - Color get surfaceInverseLow => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceInverseLowDark : colorTokens.surfaceColorTokens.surfaceInverseLowLight; + Color get surfaceInverseLow => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceInverseLowDark + : colorTokens.surfaceColorTokens.surfaceInverseLowLight; - Color get surfacePrimary => isDarkTheme ? colorTokens.surfaceColorTokens.surfacePrimaryDark : colorTokens.surfaceColorTokens.surfacePrimaryLight; + Color get surfacePrimary => isDarkTheme + ? colorTokens.surfaceColorTokens.surfacePrimaryDark + : colorTokens.surfaceColorTokens.surfacePrimaryLight; - Color get surfaceSecondary => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceSecondaryDark : colorTokens.surfaceColorTokens.surfaceSecondaryLight; + Color get surfaceSecondary => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceSecondaryDark + : colorTokens.surfaceColorTokens.surfaceSecondaryLight; - Color get surfaceTertiary => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceTertiaryDark : colorTokens.surfaceColorTokens.surfaceTertiaryLight; + Color get surfaceTertiary => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceTertiaryDark + : colorTokens.surfaceColorTokens.surfaceTertiaryLight; - Color get surfaceStatusAccentEmphasized => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceStatusAccentEmphasizedDark : colorTokens.surfaceColorTokens.surfaceStatusAccentEmphasizedLight; + Color get surfaceStatusAccentEmphasized => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceStatusAccentEmphasizedDark + : colorTokens.surfaceColorTokens.surfaceStatusAccentEmphasizedLight; - Color get surfaceStatusAccentMuted => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceStatusAccentMutedDark : colorTokens.surfaceColorTokens.surfaceStatusAccentMutedLight; + Color get surfaceStatusAccentMuted => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceStatusAccentMutedDark + : colorTokens.surfaceColorTokens.surfaceStatusAccentMutedLight; - Color get surfaceStatusInfoEmphasized => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceStatusInfoEmphasizedDark : colorTokens.surfaceColorTokens.surfaceStatusInfoEmphasizedLight; + Color get surfaceStatusInfoEmphasized => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceStatusInfoEmphasizedDark + : colorTokens.surfaceColorTokens.surfaceStatusInfoEmphasizedLight; - Color get surfaceStatusInfoMuted => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceStatusInfoMutedDark : colorTokens.surfaceColorTokens.surfaceStatusInfoMutedLight; + Color get surfaceStatusInfoMuted => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceStatusInfoMutedDark + : colorTokens.surfaceColorTokens.surfaceStatusInfoMutedLight; - Color get surfaceStatusNegativeEmphasized => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceStatusNegativeEmphasizedDark : colorTokens.surfaceColorTokens.surfaceStatusNegativeEmphasizedLight; + Color get surfaceStatusNegativeEmphasized => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceStatusNegativeEmphasizedDark + : colorTokens.surfaceColorTokens.surfaceStatusNegativeEmphasizedLight; - Color get surfaceStatusNegativeMuted => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceStatusNegativeMutedDark : colorTokens.surfaceColorTokens.surfaceStatusNegativeMutedLight; + Color get surfaceStatusNegativeMuted => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceStatusNegativeMutedDark + : colorTokens.surfaceColorTokens.surfaceStatusNegativeMutedLight; - Color get surfaceStatusPositiveEmphasized => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceStatusPositiveEmphasizedDark : colorTokens.surfaceColorTokens.surfaceStatusPositiveEmphasizedLight; + Color get surfaceStatusPositiveEmphasized => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceStatusPositiveEmphasizedDark + : colorTokens.surfaceColorTokens.surfaceStatusPositiveEmphasizedLight; - Color get surfaceStatusPositiveMuted => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceStatusPositiveMutedDark : colorTokens.surfaceColorTokens.surfaceStatusPositiveMutedLight; + Color get surfaceStatusPositiveMuted => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceStatusPositiveMutedDark + : colorTokens.surfaceColorTokens.surfaceStatusPositiveMutedLight; - Color get surfaceStatusWarningEmphasized => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceStatusWarningEmphasizedDark : colorTokens.surfaceColorTokens.surfaceStatusWarningEmphasizedLight; + Color get surfaceStatusWarningEmphasized => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceStatusWarningEmphasizedDark + : colorTokens.surfaceColorTokens.surfaceStatusWarningEmphasizedLight; - Color get surfaceStatusWarningMuted => isDarkTheme ? colorTokens.surfaceColorTokens.surfaceStatusWarningMutedDark : colorTokens.surfaceColorTokens.surfaceStatusWarningMutedLight; + Color get surfaceStatusWarningMuted => isDarkTheme + ? colorTokens.surfaceColorTokens.surfaceStatusWarningMutedDark + : colorTokens.surfaceColorTokens.surfaceStatusWarningMutedLight; } diff --git a/ouds_theme_contract/lib/theme/scheme/responsive/ouds_size_scheme.dart b/ouds_theme_contract/lib/theme/scheme/responsive/ouds_size_scheme.dart index c7addcd32..b9d87ac2c 100644 --- a/ouds_theme_contract/lib/theme/scheme/responsive/ouds_size_scheme.dart +++ b/ouds_theme_contract/lib/theme/scheme/responsive/ouds_size_scheme.dart @@ -199,107 +199,96 @@ class OudsSizeScheme { tablet: sizeTokens.iconWithHeadingXlargeSizeLargeTablet, ); - /// MaxWidthTypeDisplay - double get maxWidthTypeDisplaySmall => - OudsWindowSizeClassUtil.selectMobileTablet( - sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeDisplaySmallMobile, - tablet: sizeTokens.maxWidthTypeDisplaySmallTablet, - ); + /// MaxWidthDisplay + double get maxWidthDisplaySmall => OudsWindowSizeClassUtil.selectMobileTablet( + sizeClass: sizeClass, + mobile: sizeTokens.maxWidthDisplaySmallMobile, + tablet: sizeTokens.maxWidthDisplaySmallTablet, + ); - double get maxWidthTypeDisplayMedium => + double get maxWidthDisplayMedium => OudsWindowSizeClassUtil.selectMobileTablet( sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeDisplayMediumMobile, - tablet: sizeTokens.maxWidthTypeDisplayMediumTablet, + mobile: sizeTokens.maxWidthDisplayMediumMobile, + tablet: sizeTokens.maxWidthDisplayMediumTablet, ); - double get maxWidthTypeDisplayLarge => - OudsWindowSizeClassUtil.selectMobileTablet( - sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeDisplayLargeMobile, - tablet: sizeTokens.maxWidthTypeDisplayLargeTablet, - ); + double get maxWidthDisplayLarge => OudsWindowSizeClassUtil.selectMobileTablet( + sizeClass: sizeClass, + mobile: sizeTokens.maxWidthDisplayLargeMobile, + tablet: sizeTokens.maxWidthDisplayLargeTablet, + ); - /// MaxWidthTypeHeading - double get maxWidthTypeHeadingSmall => - OudsWindowSizeClassUtil.selectMobileTablet( - sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeHeadingSmallMobile, - tablet: sizeTokens.maxWidthTypeHeadingSmallTablet, - ); + /// MaxWidthHeading + double get maxWidthHeadingSmall => OudsWindowSizeClassUtil.selectMobileTablet( + sizeClass: sizeClass, + mobile: sizeTokens.maxWidthHeadingSmallMobile, + tablet: sizeTokens.maxWidthHeadingSmallTablet, + ); - double get maxWidthTypeHeadingMedium => + double get maxWidthHeadingMedium => OudsWindowSizeClassUtil.selectMobileTablet( sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeHeadingMediumMobile, - tablet: sizeTokens.maxWidthTypeHeadingMediumTablet, + mobile: sizeTokens.maxWidthHeadingMediumMobile, + tablet: sizeTokens.maxWidthHeadingMediumTablet, ); - double get maxWidthTypeHeadingLarge => - OudsWindowSizeClassUtil.selectMobileTablet( - sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeHeadingLargeMobile, - tablet: sizeTokens.maxWidthTypeHeadingLargeTablet, - ); + double get maxWidthHeadingLarge => OudsWindowSizeClassUtil.selectMobileTablet( + sizeClass: sizeClass, + mobile: sizeTokens.maxWidthHeadingLargeMobile, + tablet: sizeTokens.maxWidthHeadingLargeTablet, + ); - double get maxWidthTypeHeadingExtraLarge => + double get maxWidthHeadingExtraLarge => OudsWindowSizeClassUtil.selectMobileTablet( sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeHeadingXlargeMobile, - tablet: sizeTokens.maxWidthTypeHeadingXlargeTablet, + mobile: sizeTokens.maxWidthHeadingXlargeMobile, + tablet: sizeTokens.maxWidthHeadingXlargeTablet, ); - /// MaxWidthTypeBody - double get maxWidthTypeBodySmall => - OudsWindowSizeClassUtil.selectMobileTablet( - sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeBodySmallMobile, - tablet: sizeTokens.maxWidthTypeBodySmallTablet, - ); + /// MaxWidthBody + double get maxWidthBodySmall => OudsWindowSizeClassUtil.selectMobileTablet( + sizeClass: sizeClass, + mobile: sizeTokens.maxWidthBodySmallMobile, + tablet: sizeTokens.maxWidthBodySmallTablet, + ); - double get maxWidthTypeBodyMedium => - OudsWindowSizeClassUtil.selectMobileTablet( - sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeBodyMediumMobile, - tablet: sizeTokens.maxWidthTypeBodyMediumTablet, - ); + double get maxWidthBodyMedium => OudsWindowSizeClassUtil.selectMobileTablet( + sizeClass: sizeClass, + mobile: sizeTokens.maxWidthBodyMediumMobile, + tablet: sizeTokens.maxWidthBodyMediumTablet, + ); - double get maxWidthTypeBodyLarge => - OudsWindowSizeClassUtil.selectMobileTablet( - sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeBodyLargeMobile, - tablet: sizeTokens.maxWidthTypeBodyLargeTablet, - ); + double get maxWidthBodyLarge => OudsWindowSizeClassUtil.selectMobileTablet( + sizeClass: sizeClass, + mobile: sizeTokens.maxWidthBodyLargeMobile, + tablet: sizeTokens.maxWidthBodyLargeTablet, + ); - /// MaxWidthTypeLabel - double get maxWidthTypeLabelSmall => - OudsWindowSizeClassUtil.selectMobileTablet( - sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeLabelSmallMobile, - tablet: sizeTokens.maxWidthTypeLabelSmallTablet, - ); + /// MaxWidthLabel + double get maxWidthLabelSmall => OudsWindowSizeClassUtil.selectMobileTablet( + sizeClass: sizeClass, + mobile: sizeTokens.maxWidthLabelSmallMobile, + tablet: sizeTokens.maxWidthLabelSmallTablet, + ); - double get maxWidthTypeLabelMedium => - OudsWindowSizeClassUtil.selectMobileTablet( - sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeLabelMediumMobile, - tablet: sizeTokens.maxWidthTypeLabelMediumTablet, - ); + double get maxWidthLabelMedium => OudsWindowSizeClassUtil.selectMobileTablet( + sizeClass: sizeClass, + mobile: sizeTokens.maxWidthLabelMediumMobile, + tablet: sizeTokens.maxWidthLabelMediumTablet, + ); - double get maxWidthTypeLabelLarge => - OudsWindowSizeClassUtil.selectMobileTablet( - sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeLabelLargeMobile, - tablet: sizeTokens.maxWidthTypeLabelLargeTablet, - ); + double get maxWidthLabelLarge => OudsWindowSizeClassUtil.selectMobileTablet( + sizeClass: sizeClass, + mobile: sizeTokens.maxWidthLabelLargeMobile, + tablet: sizeTokens.maxWidthLabelLargeTablet, + ); - double get maxWidthTypeLabelXlarge => - OudsWindowSizeClassUtil.selectMobileTablet( - sizeClass: sizeClass, - mobile: sizeTokens.maxWidthTypeLabelXlargeMobile, - tablet: sizeTokens.maxWidthTypeLabelXlargeTablet, - ); + double get maxWidthLabelXLarge => OudsWindowSizeClassUtil.selectMobileTablet( + sizeClass: sizeClass, + mobile: sizeTokens.maxWidthLabelXlargeMobile, + tablet: sizeTokens.maxWidthLabelXlargeTablet, + ); /// Non-responsive tokens (direct mapping) diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_alert_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_alert_tokens.dart index 279a55d3b..0522469e8 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_alert_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_alert_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsAlertTokens { diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_badge_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_badge_tokens.dart index 0c0102969..b0de74ab3 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_badge_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_badge_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsBadgeTokens { @@ -18,7 +18,9 @@ abstract class OudsBadgeTokens { late double sizeMedium; late double sizeSmall; late double sizeXsmall; - late double spaceInset; + late double spaceInsetMediumLarge; + late double spaceInsetSmall; + late double spaceInsetXsmall; late double spacePaddingInlineLarge; late double spacePaddingInlineMedium; } diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_bar_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_bar_tokens.dart index 4ad5e5f60..ca34f9e85 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_bar_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_bar_tokens.dart @@ -10,27 +10,14 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; abstract class OudsBarTokens { - late double borderRadiusActiveIndicatorCustomBottom; - late double borderRadiusActiveIndicatorCustomTop; - late Color colorActiveIndicatorAndroidSelectedDisabled; - late Color colorActiveIndicatorAndroidSelectedEnabled; - late Color colorActiveIndicatorAndroidSelectedFocus; - late Color colorActiveIndicatorAndroidSelectedHover; - late Color colorActiveIndicatorAndroidSelectedPressed; - late Color colorActiveIndicatorAndroidUnselectedDisabled; - late Color colorActiveIndicatorAndroidUnselectedFocus; - late Color colorActiveIndicatorAndroidUnselectedHover; - late Color colorActiveIndicatorAndroidUnselectedPressed; - late Color colorActiveIndicatorCustomSelectedEnabled; - late Color colorActiveIndicatorCustomSelectedFocus; - late Color colorActiveIndicatorCustomSelectedHover; - late Color colorActiveIndicatorCustomSelectedPressed; + late double borderRadiusCurrentIndicatorCustomBottom; + late double borderRadiusCurrentIndicatorCustomTop; late Color colorBgOpaque; late Color colorBgTranslucentDark; late Color colorBgTranslucentLight; @@ -40,14 +27,27 @@ abstract class OudsBarTokens { late Color colorContentSelectedFocus; late Color colorContentSelectedHover; late Color colorContentSelectedPressed; - late Color colorContentUnselectedEnabledDark; - late Color colorContentUnselectedEnabledLight; + late Color colorContentUnselectedEnabled; late Color colorContentUnselectedFocus; late Color colorContentUnselectedHover; late Color colorContentUnselectedPressed; + late Color colorCurrentIndicatorAndroidSelectedDisabled; + late Color colorCurrentIndicatorAndroidSelectedEnabled; + late Color colorCurrentIndicatorAndroidSelectedFocus; + late Color colorCurrentIndicatorAndroidSelectedHover; + late Color colorCurrentIndicatorAndroidSelectedPressed; + late Color colorCurrentIndicatorAndroidUnselectedDisabled; + late Color colorCurrentIndicatorAndroidUnselectedFocus; + late Color colorCurrentIndicatorAndroidUnselectedHover; + late Color colorCurrentIndicatorAndroidUnselectedPressed; + late Color colorCurrentIndicatorCustomSelectedEnabled; + late Color colorCurrentIndicatorCustomSelectedFocus; + late Color colorCurrentIndicatorCustomSelectedHover; + late Color colorCurrentIndicatorCustomSelectedPressed; + late Color colorIosAccent; late int effectBgBlur; - late double opacityActiveIndicatorCustom; - late double sizeHeightActiveIndicatorCustom; - late double sizeWidthActiveIndicatorCustomBottom; - late double sizeWidthActiveIndicatorCustomTop; + late double opacityCurrentIndicatorCustom; + late double sizeHeightCurrentIndicatorCustom; + late double sizeWidthCurrentIndicatorCustomBottom; + late double sizeWidthCurrentIndicatorCustomTop; } diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_bulletList_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_bulletList_tokens.dart index c23543b2d..ff62fdb16 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_bulletList_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_bulletList_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsBulletListTokens { diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_buttonMono_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_buttonMono_tokens.dart index 95dfbc9da..d8f7eecc3 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_buttonMono_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_buttonMono_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_button_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_button_tokens.dart index 132c1642b..9f164f936 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_button_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_button_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_checkbox_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_checkbox_tokens.dart index 5bbdc2929..56cb487b3 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_checkbox_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_checkbox_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsCheckboxTokens { @@ -23,6 +23,9 @@ abstract class OudsCheckboxTokens { late double borderWidthUnselectedFocus; late double borderWidthUnselectedHover; late double borderWidthUnselectedPressed; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late double sizeIndicator; late double sizeMaxHeight; late double sizeMinHeight; diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_chip_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_chip_tokens.dart index 43312c0e0..027b2a51b 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_chip_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_chip_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_controlItem_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_controlItem_tokens.dart index 4848b03c9..f9f1e296e 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_controlItem_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_controlItem_tokens.dart @@ -10,30 +10,106 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; abstract class OudsControlItemTokens { - late double borderRadius; + late double borderRadiusCurrentIndicator; + late double borderRadiusDefault; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late double borderRadiusItemOnly; + late double borderRadiusMedia; + late double borderRadiusMediaRoundedCorner; + late double borderRadiusRounded; + late double borderWidthCurrentPage; + late double borderWidthDefault; + late Color colorBadgeSafetyArea; + late Color colorBgCurrentDisabled; + late Color colorBgCurrentEnabled; + late Color colorBgCurrentFocus; + late Color colorBgCurrentHover; + late Color colorBgCurrentPressed; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late Color colorBgFocus; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late Color colorBgHover; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late Color colorBgLoading; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late Color colorBgPressed; + late Color colorContentCurrentDisabled; + late Color colorContentCurrentEnabled; + late Color colorContentCurrentFocus; + late Color colorContentCurrentHover; + late Color colorContentCurrentPressed; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late Color colorContentLoader; + late double fontLetterSpacingAvatarInitialXlarge; + late double fontLineHeightAvatarInitialXlarge; + late double fontSizeAvatarInitialXlarge; + late double opacityCurrentDivider; + late double opacityCurrentIndicator; + late double sizeAssetLarge; + late double sizeAssetMedium; + late double sizeAssetSmall; + late double sizeAssetXlarge; + late double sizeControlIndicator; + late double sizeCurrentIndicatorWidth; + + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late double sizeErrorIcon; + late double sizeFlagHeight; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late double sizeIcon; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late double sizeLoader; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late double sizeMaxHeightAssetsContainer; late double sizeMaxWidth; - late double sizeMinHeight; + late double sizeMinHeightCompact; + late double sizeMinHeightDefault; late double sizeMinWidth; late double spaceColumnGap; + late double spacePaddingBlockBottomSlot; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late double spacePaddingBlockDefault; - late double spacePaddingBlockTopErrorText; + late double spacePaddingBlockDensityCompact; + late double spacePaddingBlockDensityCompactBottomExpandContainer; + late double spacePaddingBlockDensityCompactTopAlignmentTopCounterweight; + late double spacePaddingBlockDensityCompactTopAlignmentTopTextContainer; + late double spacePaddingBlockDensityDefault; + late double spacePaddingBlockDensityDefaultBottomExpandContainer; + late double spacePaddingBlockDensityDefaultTopAlignmentTopCounterweight; + late double spacePaddingBlockDensityDefaultTopAlignmentTopTextContainer; + late double spacePaddingBlockTopHelperText; late double spacePaddingInline; + @Deprecated( + "This token is deprecated and will be removed in a future version.", + ) late double spacePaddingInlineErrorIcon; late double spaceRowGap; } diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_divider_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_divider_tokens.dart index f056bf741..7a65c6e24 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_divider_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_divider_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsDividerTokens { diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_icon_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_icon_tokens.dart index 53586e73f..55b1fc773 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_icon_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_icon_tokens.dart @@ -10,13 +10,14 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; abstract class OudsIconTokens { - late Color colorContentDefault; late Color colorContentStatusWarningExternalShape; late Color colorContentStatusWarningInternalShape; + late Color colorContentStatusWarningInverseExternalShape; + late Color colorContentStatusWarningInverseInternalShape; } diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_inputTag_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_inputTag_tokens.dart index 34983fd95..3a1cd6332 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_inputTag_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_inputTag_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_linkMono_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_linkMono_tokens.dart index 39fdf9714..b19e73239 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_linkMono_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_linkMono_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_link_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_link_tokens.dart index 58c01a6b3..eee238dfd 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_link_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_link_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_pinCodeInput_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_pinCodeInput_tokens.dart index 1eeaa5b8a..995bd4e3e 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_pinCodeInput_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_pinCodeInput_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsPinCodeInputTokens { diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_radioButton_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_radioButton_tokens.dart index b7866dcb8..6b5bb322c 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_radioButton_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_radioButton_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsRadioButtonTokens { @@ -23,7 +23,6 @@ abstract class OudsRadioButtonTokens { late double borderWidthUnselectedFocus; late double borderWidthUnselectedHover; late double borderWidthUnselectedPressed; - late double sizeIndicator; late double sizeMaxHeight; late double sizeMinHeight; late double sizeMinWidth; diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_skeleton_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_skeleton_tokens.dart index d919d58be..a82345cf4 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_skeleton_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_skeleton_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_switch_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_switch_tokens.dart index b894cefc5..45033e609 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_switch_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_switch_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_tag_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_tag_tokens.dart index c8c615b66..5ce8d0cad 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_tag_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_tag_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsTagTokens { diff --git a/ouds_theme_contract/lib/theme/tokens/components/ouds_textInput_tokens.dart b/ouds_theme_contract/lib/theme/tokens/components/ouds_textInput_tokens.dart index 68be1b9cf..8126bb5e8 100644 --- a/ouds_theme_contract/lib/theme/tokens/components/ouds_textInput_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/components/ouds_textInput_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -33,6 +33,8 @@ abstract class OudsTextInputTokens { late double sizeVerticalDividerHeight; late double spaceColumnGapDefault; late double spaceColumnGapInlineText; + late double spaceColumnGapLabelAsterisk; + late double spaceColumnGapLabelSmallAsterisk; late double spaceColumnGapTrailingErrorAction; late double spacePaddingBlockDefault; late double spacePaddingBlockTopHelperText; diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_border_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_border_semantic_tokens.dart index 75bc804e4..d79b7ab0b 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_border_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_border_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsBorderSemanticTokens { diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_action_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_action_semantic_tokens.dart index 0401bc71f..2a616bc67 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_action_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_action_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -26,8 +26,6 @@ abstract class OudsColorActionSemanticTokens { final Color actionHighlightedLight; final Color actionHoverDark; final Color actionHoverLight; - final Color actionIosAccentDark; - final Color actionIosAccentLight; final Color actionLoadingDark; final Color actionLoadingLight; final Color actionNegativeEnabledDark; @@ -74,8 +72,6 @@ abstract class OudsColorActionSemanticTokens { required this.actionHighlightedLight, required this.actionHoverDark, required this.actionHoverLight, - required this.actionIosAccentDark, - required this.actionIosAccentLight, required this.actionLoadingDark, required this.actionLoadingLight, required this.actionNegativeEnabledDark, diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_always_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_always_semantic_tokens.dart index 4f96a5c24..a8113000a 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_always_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_always_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_bg_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_bg_semantic_tokens.dart index 1fb71a9f3..256e64286 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_bg_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_bg_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_border_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_border_semantic_tokens.dart index f9215e144..7d575eb0b 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_border_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_border_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_content_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_content_semantic_tokens.dart index 9867ba94e..416ebe4f8 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_content_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_content_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_decorative_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_decorative_semantic_tokens.dart deleted file mode 100644 index a882ff5bb..000000000 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_decorative_semantic_tokens.dart +++ /dev/null @@ -1,116 +0,0 @@ -// -// Software Name: OUDS Flutter -// SPDX-FileCopyrightText: Copyright (c) Orange SA -// SPDX-License-Identifier: MIT -// -// This software is distributed under the MIT license, -// the text of which is available at https://opensource.org/license/MIT/ -// or see the "LICENSE" file for more details. -// -// Software description: Flutter library of reusable graphical components -// - -// Orange brand tokens version 1.5.0 -// Generated by Tokenator - -import 'package:flutter/material.dart'; - -abstract class OudsColorDecorativeSemanticTokens { - final Color decorativeAccent1Default; - final Color decorativeAccent1Emphasized; - final Color decorativeAccent1Muted; - final Color decorativeAccent2Default; - final Color decorativeAccent2Emphasized; - final Color decorativeAccent2Muted; - final Color decorativeAccent3Default; - final Color decorativeAccent3Emphasized; - final Color decorativeAccent3Muted; - final Color decorativeAccent4Default; - final Color decorativeAccent4Emphasized; - final Color decorativeAccent4Muted; - final Color decorativeAccent5Default; - final Color decorativeAccent5Emphasized; - final Color decorativeAccent5Muted; - final Color decorativeBrandPrimary; - final Color decorativeBrandPrimaryEmphasized; - final Color decorativeBrandPrimaryMuted; - final Color decorativeBrandSecondary; - final Color decorativeBrandSecondaryEmphasized; - final Color decorativeBrandSecondaryMuted; - final Color decorativeBrandTertiary; - final Color decorativeBrandTertiaryEmphasized; - final Color decorativeBrandTertiaryMuted; - final Color decorativeNeutralEmphasizedHigh; - final Color decorativeNeutralEmphasizedHigher; - final Color decorativeNeutralEmphasizedHighest; - final Color decorativeNeutralEmphasizedLow; - final Color decorativeNeutralEmphasizedLower; - final Color decorativeNeutralEmphasizedLowest; - final Color decorativeNeutralEmphasizedMedium; - final Color decorativeNeutralMutedHigh; - final Color decorativeNeutralMutedHigher; - final Color decorativeNeutralMutedHighest; - final Color decorativeNeutralMutedLow; - final Color decorativeNeutralMutedLower; - final Color decorativeNeutralMutedLowest; - final Color decorativeNeutralMutedMedium; - final Color decorativeSkinTint100; - final Color decorativeSkinTint200; - final Color decorativeSkinTint300; - final Color decorativeSkinTint400; - final Color decorativeSkinTint500; - final Color decorativeSkinTint600; - final Color decorativeSkinTint700; - final Color decorativeSkinTint800; - final Color decorativeSkinTint900; - - const OudsColorDecorativeSemanticTokens({ - required this.decorativeAccent1Default, - required this.decorativeAccent1Emphasized, - required this.decorativeAccent1Muted, - required this.decorativeAccent2Default, - required this.decorativeAccent2Emphasized, - required this.decorativeAccent2Muted, - required this.decorativeAccent3Default, - required this.decorativeAccent3Emphasized, - required this.decorativeAccent3Muted, - required this.decorativeAccent4Default, - required this.decorativeAccent4Emphasized, - required this.decorativeAccent4Muted, - required this.decorativeAccent5Default, - required this.decorativeAccent5Emphasized, - required this.decorativeAccent5Muted, - required this.decorativeBrandPrimary, - required this.decorativeBrandPrimaryEmphasized, - required this.decorativeBrandPrimaryMuted, - required this.decorativeBrandSecondary, - required this.decorativeBrandSecondaryEmphasized, - required this.decorativeBrandSecondaryMuted, - required this.decorativeBrandTertiary, - required this.decorativeBrandTertiaryEmphasized, - required this.decorativeBrandTertiaryMuted, - required this.decorativeNeutralEmphasizedHigh, - required this.decorativeNeutralEmphasizedHigher, - required this.decorativeNeutralEmphasizedHighest, - required this.decorativeNeutralEmphasizedLow, - required this.decorativeNeutralEmphasizedLower, - required this.decorativeNeutralEmphasizedLowest, - required this.decorativeNeutralEmphasizedMedium, - required this.decorativeNeutralMutedHigh, - required this.decorativeNeutralMutedHigher, - required this.decorativeNeutralMutedHighest, - required this.decorativeNeutralMutedLow, - required this.decorativeNeutralMutedLower, - required this.decorativeNeutralMutedLowest, - required this.decorativeNeutralMutedMedium, - required this.decorativeSkinTint100, - required this.decorativeSkinTint200, - required this.decorativeSkinTint300, - required this.decorativeSkinTint400, - required this.decorativeSkinTint500, - required this.decorativeSkinTint600, - required this.decorativeSkinTint700, - required this.decorativeSkinTint800, - required this.decorativeSkinTint900, - }); -} diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_opacity_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_opacity_semantic_tokens.dart index 420ff2699..82b79bc84 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_opacity_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_opacity_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_overlay_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_overlay_semantic_tokens.dart index b963bbdb0..c0db1f251 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_overlay_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_overlay_semantic_tokens.dart @@ -10,28 +10,32 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; abstract class OudsColorOverlaySemanticTokens { + final Color overlayBackdropDark; + final Color overlayBackdropLight; final Color overlayDragDark; final Color overlayDragLight; final Color overlayDropdownDark; final Color overlayDropdownLight; - final Color overlayModalDark; - final Color overlayModalLight; + final Color overlayModalSheetDark; + final Color overlayModalSheetLight; final Color overlayTooltipDark; final Color overlayTooltipLight; const OudsColorOverlaySemanticTokens({ + required this.overlayBackdropDark, + required this.overlayBackdropLight, required this.overlayDragDark, required this.overlayDragLight, required this.overlayDropdownDark, required this.overlayDropdownLight, - required this.overlayModalDark, - required this.overlayModalLight, + required this.overlayModalSheetDark, + required this.overlayModalSheetLight, required this.overlayTooltipDark, required this.overlayTooltipLight, }); diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_repository_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_repository_semantic_tokens.dart index 14dfef67c..5cec4cef0 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_repository_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_repository_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -105,7 +105,8 @@ abstract class OudsColorRepositorySemanticTokens { final Color repositoryPrimaryLowest; final Color repositoryPrimaryMedium; final Color repositorySecondaryHigh; - final Color repositorySecondaryHigher; + final Color repositorySecondaryHigherHigh; + final Color repositorySecondaryHigherLow; final Color repositorySecondaryHighest; final Color repositorySecondaryLow; final Color repositorySecondaryLower; @@ -216,7 +217,8 @@ abstract class OudsColorRepositorySemanticTokens { required this.repositoryPrimaryLowest, required this.repositoryPrimaryMedium, required this.repositorySecondaryHigh, - required this.repositorySecondaryHigher, + required this.repositorySecondaryHigherHigh, + required this.repositorySecondaryHigherLow, required this.repositorySecondaryHighest, required this.repositorySecondaryLow, required this.repositorySecondaryLower, diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_semantic_tokens.dart index 5d284f425..7e2707913 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_semantic_tokens.dart @@ -15,7 +15,6 @@ import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_always_sema import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_bg_semantic_tokens.dart'; import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_border_semantic_tokens.dart'; import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_content_semantic_tokens.dart'; -import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_decorative_semantic_tokens.dart'; import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_opacity_semantic_tokens.dart'; import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_overlay_semantic_tokens.dart'; import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_repository_semantic_tokens.dart'; @@ -27,7 +26,6 @@ class OudsColorSemanticTokens { final OudsColorBgSemanticTokens backgroundColorTokens; final OudsColorBorderSemanticTokens borderColorTokens; final OudsColorContentSemanticTokens contentColorTokens; - final OudsColorDecorativeSemanticTokens? decorativeColorTokens; final OudsColorOpacitySemanticTokens opacityColorTokens; final OudsColorOverlaySemanticTokens overlayColorTokens; final OudsColorSurfaceSemanticTokens surfaceColorTokens; @@ -39,7 +37,6 @@ class OudsColorSemanticTokens { required this.backgroundColorTokens, required this.borderColorTokens, required this.contentColorTokens, - this.decorativeColorTokens, required this.opacityColorTokens, required this.overlayColorTokens, required this.surfaceColorTokens, diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_surface_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_surface_semantic_tokens.dart index a2c2e0d57..f0503e404 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_surface_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_color_surface_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_effect_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_effect_semantic_tokens.dart index bc116f401..c81544ca3 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_effect_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_effect_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsEffectSemanticTokens { diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_elevation_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_elevation_semantic_tokens.dart index da9c5d5a9..2aeba45a6 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_elevation_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_elevation_semantic_tokens.dart @@ -13,6 +13,8 @@ // Android system tokens version 1.2.0 // Generated by Tokenator +/// TODO: Remove this class in Token version 2.5.0 + abstract class OudsElevationSemanticTokens { late double default_; late double drag; diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_font_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_font_semantic_tokens.dart index a064e093c..b11ddb440 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_font_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_font_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_grid_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_grid_semantic_tokens.dart index 7b31be03b..c234f0017 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_grid_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_grid_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsGridSemanticTokens { diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_opacity_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_opacity_semantic_tokens.dart index 3eb848da5..828c37b81 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_opacity_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_opacity_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsOpacitySemanticTokens { diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_size_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_size_semantic_tokens.dart index 8cb9e1de4..f45552218 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_size_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_size_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsSizeSemanticTokens { @@ -81,33 +81,34 @@ abstract class OudsSizeSemanticTokens { late double iconWithLabelXlargeSizeLarge; late double iconWithLabelXlargeSizeMedium; late double iconWithLabelXlargeSizeSmall; - late double maxWidthTypeBodyLargeMobile; - late double maxWidthTypeBodyLargeTablet; - late double maxWidthTypeBodyMediumMobile; - late double maxWidthTypeBodyMediumTablet; - late double maxWidthTypeBodySmallMobile; - late double maxWidthTypeBodySmallTablet; - late double maxWidthTypeDisplayLargeMobile; - late double maxWidthTypeDisplayLargeTablet; - late double maxWidthTypeDisplayMediumMobile; - late double maxWidthTypeDisplayMediumTablet; - late double maxWidthTypeDisplaySmallMobile; - late double maxWidthTypeDisplaySmallTablet; - late double maxWidthTypeHeadingLargeMobile; - late double maxWidthTypeHeadingLargeTablet; - late double maxWidthTypeHeadingMediumMobile; - late double maxWidthTypeHeadingMediumTablet; - late double maxWidthTypeHeadingSmallMobile; - late double maxWidthTypeHeadingSmallTablet; - late double maxWidthTypeHeadingXlargeMobile; - late double maxWidthTypeHeadingXlargeTablet; - late double maxWidthTypeLabelLargeMobile; - late double maxWidthTypeLabelLargeTablet; - late double maxWidthTypeLabelMediumMobile; - late double maxWidthTypeLabelMediumTablet; - late double maxWidthTypeLabelSmallMobile; - late double maxWidthTypeLabelSmallTablet; - late double maxWidthTypeLabelXlargeMobile; - late double maxWidthTypeLabelXlargeTablet; + late double iconWithLabelXlargeSizeXsmall; + late double maxWidthBodyLargeMobile; + late double maxWidthBodyLargeTablet; + late double maxWidthBodyMediumMobile; + late double maxWidthBodyMediumTablet; + late double maxWidthBodySmallMobile; + late double maxWidthBodySmallTablet; + late double maxWidthDisplayLargeMobile; + late double maxWidthDisplayLargeTablet; + late double maxWidthDisplayMediumMobile; + late double maxWidthDisplayMediumTablet; + late double maxWidthDisplaySmallMobile; + late double maxWidthDisplaySmallTablet; + late double maxWidthHeadingLargeMobile; + late double maxWidthHeadingLargeTablet; + late double maxWidthHeadingMediumMobile; + late double maxWidthHeadingMediumTablet; + late double maxWidthHeadingSmallMobile; + late double maxWidthHeadingSmallTablet; + late double maxWidthHeadingXlargeMobile; + late double maxWidthHeadingXlargeTablet; + late double maxWidthLabelLargeMobile; + late double maxWidthLabelLargeTablet; + late double maxWidthLabelMediumMobile; + late double maxWidthLabelMediumTablet; + late double maxWidthLabelSmallMobile; + late double maxWidthLabelSmallTablet; + late double maxWidthLabelXlargeMobile; + late double maxWidthLabelXlargeTablet; late double minInteractiveArea; } diff --git a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_space_semantic_tokens.dart b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_space_semantic_tokens.dart index 7389db569..a6be9934b 100644 --- a/ouds_theme_contract/lib/theme/tokens/semantic/ouds_space_semantic_tokens.dart +++ b/ouds_theme_contract/lib/theme/tokens/semantic/ouds_space_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator abstract class OudsSpaceSemanticTokens { diff --git a/ouds_theme_contract/pubspec.yaml b/ouds_theme_contract/pubspec.yaml index 53bb525f8..019b4b65c 100644 --- a/ouds_theme_contract/pubspec.yaml +++ b/ouds_theme_contract/pubspec.yaml @@ -1,8 +1,8 @@ name: ouds_theme_contract description: 'Defines the interface for theming in the OUDS framework, ensuring consistent application of design tokens.' -version: 1.3.1 repository: https://github.com/Orange-OpenSource/ouds-flutter homepage: https://flutter.unified-design-system.orange.com +version: 2.0.0 environment: sdk: ^3.9.0 @@ -13,7 +13,8 @@ resolution: workspace dependencies: flutter: sdk: flutter - ouds_global_raw_tokens: ^1.3.1 + # Global raw token + ouds_global_raw_tokens: ^2.0.0 dev_dependencies: flutter_test: diff --git a/ouds_theme_orange/CHANGELOG.md b/ouds_theme_orange/CHANGELOG.md index 6ec18b514..8d8a8f3f4 100644 --- a/ouds_theme_orange/CHANGELOG.md +++ b/ouds_theme_orange/CHANGELOG.md @@ -4,20 +4,26 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop) +## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/2.0.0...develop) ### Added ### Changed ### Fixed -## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 +## [2.0.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...2.0.0) - 2026-06-19 ### Added ### Changed +- [Library] Remove deprecated code and API ([#820](https://github.com/Orange-OpenSource/ouds-flutter/issues/820)) +- [Library] update tokens 2.5.0 ([#778](https://github.com/Orange-OpenSource/ouds-flutter/issues/778)) +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) ### Fixed +## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 + ## [1.3.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.2.0...1.3.0) - 2026-05-08 ### Added ### Changed +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) - [Library] update tokens 1.9.0 - Component Bullet List ([#710](https://github.com/Orange-OpenSource/ouds-flutter/issues/710)) - [Library] update tokens 1.9.0 - Component Alert ([#672](https://github.com/Orange-OpenSource/ouds-flutter/issues/672)) diff --git a/ouds_theme_orange/README.md b/ouds_theme_orange/README.md index 49b504446..6f2d547fa 100644 --- a/ouds_theme_orange/README.md +++ b/ouds_theme_orange/README.md @@ -15,7 +15,7 @@ dependency in your `pubspec.yaml` file. ```yaml dependencies: - ouds_theme_orange: ^1.3.1 + ouds_theme_orange: ^2.0.0 ``` ## Additional information diff --git a/ouds_theme_orange/assets/component/alert/error-fill.svg b/ouds_theme_orange/assets/component/alert/error-fill.svg new file mode 100644 index 000000000..ce39de740 --- /dev/null +++ b/ouds_theme_orange/assets/component/alert/error-fill.svg @@ -0,0 +1,3 @@ + + + diff --git a/ouds_theme_orange/assets/component/alert/important-fill.svg b/ouds_theme_orange/assets/component/alert/important-fill.svg index 0b8fe44fc..c2b698fbc 100644 --- a/ouds_theme_orange/assets/component/alert/important-fill.svg +++ b/ouds_theme_orange/assets/component/alert/important-fill.svg @@ -1,3 +1,3 @@ - - + + diff --git a/ouds_theme_orange/assets/component/alert/info-fill.svg b/ouds_theme_orange/assets/component/alert/info-fill.svg index 35e45d3b1..1c6d9c3b3 100644 --- a/ouds_theme_orange/assets/component/alert/info-fill.svg +++ b/ouds_theme_orange/assets/component/alert/info-fill.svg @@ -1,3 +1,3 @@ - - + + diff --git a/ouds_theme_orange/assets/component/alert/tick-confirmation-fill.svg b/ouds_theme_orange/assets/component/alert/tick-confirmation-fill.svg index 47ec55f7c..258b291c1 100644 --- a/ouds_theme_orange/assets/component/alert/tick-confirmation-fill.svg +++ b/ouds_theme_orange/assets/component/alert/tick-confirmation-fill.svg @@ -1,3 +1,3 @@ - - + + diff --git a/ouds_theme_orange/assets/component/alert/warning-external-shape.svg b/ouds_theme_orange/assets/component/alert/warning-external-shape.svg index 4139ad92c..8ba2fbc07 100644 --- a/ouds_theme_orange/assets/component/alert/warning-external-shape.svg +++ b/ouds_theme_orange/assets/component/alert/warning-external-shape.svg @@ -1,3 +1,3 @@ - - + + diff --git a/ouds_theme_orange/assets/component/alert/warning-internal-shape.svg b/ouds_theme_orange/assets/component/alert/warning-internal-shape.svg index 2413797ed..f0654a4c1 100644 --- a/ouds_theme_orange/assets/component/alert/warning-internal-shape.svg +++ b/ouds_theme_orange/assets/component/alert/warning-internal-shape.svg @@ -1,3 +1,3 @@ - - + + diff --git a/ouds_theme_orange/assets/component/alert/warning.svg b/ouds_theme_orange/assets/component/alert/warning.svg index b58238d3a..913441179 100644 --- a/ouds_theme_orange/assets/component/alert/warning.svg +++ b/ouds_theme_orange/assets/component/alert/warning.svg @@ -1,7 +1,7 @@ - + - + diff --git a/ouds_theme_orange/assets/component/badge-icon/error-fill.svg b/ouds_theme_orange/assets/component/badge-icon/error-fill.svg new file mode 100644 index 000000000..b101f4589 --- /dev/null +++ b/ouds_theme_orange/assets/component/badge-icon/error-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_orange/assets/component/badge-icon/info-fill.svg b/ouds_theme_orange/assets/component/badge-icon/info-fill.svg new file mode 100644 index 000000000..5b8da60ce --- /dev/null +++ b/ouds_theme_orange/assets/component/badge-icon/info-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_orange/assets/component/badge-icon/tick-confirmation-fill.svg b/ouds_theme_orange/assets/component/badge-icon/tick-confirmation-fill.svg new file mode 100644 index 000000000..f3e87e2f4 --- /dev/null +++ b/ouds_theme_orange/assets/component/badge-icon/tick-confirmation-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_orange/assets/component/badge-icon/warning-external-shape.svg b/ouds_theme_orange/assets/component/badge-icon/warning-external-shape.svg new file mode 100644 index 000000000..9f34c31c9 --- /dev/null +++ b/ouds_theme_orange/assets/component/badge-icon/warning-external-shape.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_orange/assets/component/badge-icon/warning-internal-shape.svg b/ouds_theme_orange/assets/component/badge-icon/warning-internal-shape.svg new file mode 100644 index 000000000..9e4b7e8d8 --- /dev/null +++ b/ouds_theme_orange/assets/component/badge-icon/warning-internal-shape.svg @@ -0,0 +1,3 @@ + + + diff --git a/ouds_theme_orange/assets/functional/navigation/form-chevron-left.svg b/ouds_theme_orange/assets/functional/navigation/form-chevron-left.svg index 6151709a8..650bb12e7 100644 --- a/ouds_theme_orange/assets/functional/navigation/form-chevron-left.svg +++ b/ouds_theme_orange/assets/functional/navigation/form-chevron-left.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_orange/lib/components/orange_alert_tokens.dart b/ouds_theme_orange/lib/components/orange_alert_tokens.dart index d4f145093..04c916ad2 100644 --- a/ouds_theme_orange/lib/components/orange_alert_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_alert_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; @@ -33,7 +33,8 @@ class OrangeAlertTokens extends OudsAlertTokens { @override double get sizeMinHeight => providersTokens.sizeTokens.minInteractiveArea; @override - double get sizeMinHeightBottomActionPlacement => DimensionRawTokens.dimension1250; + double get sizeMinHeightBottomActionPlacement => + DimensionRawTokens.dimension1250; @override double get sizeMinWidth => DimensionRawTokens.dimension2000; @override @@ -41,9 +42,11 @@ class OrangeAlertTokens extends OudsAlertTokens { @override double get spaceColumnGapAction => providersTokens.spaceTokens.columnGapSmall; @override - double get spacePaddingBlock => providersTokens.spaceTokens.paddingBlockMedium; + double get spacePaddingBlock => + providersTokens.spaceTokens.paddingBlockMedium; @override - double get spacePaddingInline => providersTokens.spaceTokens.paddingInlineLarge; + double get spacePaddingInline => + providersTokens.spaceTokens.paddingInlineLarge; @override double get spaceRowGap => providersTokens.spaceTokens.rowGapSmall; @override diff --git a/ouds_theme_orange/lib/components/orange_badge_tokens.dart b/ouds_theme_orange/lib/components/orange_badge_tokens.dart index 8a0217498..55c9dd1ca 100644 --- a/ouds_theme_orange/lib/components/orange_badge_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_badge_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; @@ -31,7 +31,11 @@ class OrangeBadgeTokens extends OudsBadgeTokens { @override double get sizeXsmall => DimensionRawTokens.dimension100; @override - double get spaceInset => DimensionRawTokens.dimensionOutOfSystem75; + double get spaceInsetMediumLarge => DimensionRawTokens.dimensionOutOfSystem75; + @override + double get spaceInsetSmall => DimensionRawTokens.dimensionOutOfSystem50; + @override + double get spaceInsetXsmall => DimensionRawTokens.dimensionOutOfSystem25; @override double get spacePaddingInlineLarge => providersTokens.spaceTokens.paddingInline2xsmall; @override diff --git a/ouds_theme_orange/lib/components/orange_bar_tokens.dart b/ouds_theme_orange/lib/components/orange_bar_tokens.dart index 58bb41b7b..4f5807962 100644 --- a/ouds_theme_orange/lib/components/orange_bar_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_bar_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -26,71 +26,71 @@ class OrangeBarTokens extends OudsBarTokens { OrangeBarTokens(this.providersTokens); @override - double get borderRadiusActiveIndicatorCustomBottom => providersTokens.borderTokens.radiusNone; + double get borderRadiusCurrentIndicatorCustomBottom => providersTokens.borderTokens.radiusNone; @override - double get borderRadiusActiveIndicatorCustomTop => providersTokens.borderTokens.radiusNone; + double get borderRadiusCurrentIndicatorCustomTop => providersTokens.borderTokens.radiusNone; @override - Color get colorActiveIndicatorAndroidSelectedDisabled => providersTokens.colorScheme.opacityTransparent; + Color get colorBgOpaque => providersTokens.colorScheme.bgSecondary; @override - Color get colorActiveIndicatorAndroidSelectedEnabled => providersTokens.colorScheme.opacityTransparent; + Color get colorBgTranslucentDark => ColorRawTokens.colorOpacityGrayDark880800; @override - Color get colorActiveIndicatorAndroidSelectedFocus => providersTokens.colorScheme.opacityTransparent; + Color get colorBgTranslucentLight => ColorRawTokens.colorOpacityWhite800; @override - Color get colorActiveIndicatorAndroidSelectedHover => providersTokens.colorScheme.opacityTransparent; + Color get colorBorderBadge => providersTokens.colorScheme.bgSecondary; @override - Color get colorActiveIndicatorAndroidSelectedPressed => providersTokens.colorScheme.opacityTransparent; + Color get colorContentOnIosAccent => providersTokens.colorScheme.contentOnActionSelected; @override - Color get colorActiveIndicatorAndroidUnselectedDisabled => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedEnabled => providersTokens.colorScheme.contentDefault; @override - Color get colorActiveIndicatorAndroidUnselectedFocus => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedFocus => providersTokens.colorScheme.actionFocus; @override - Color get colorActiveIndicatorAndroidUnselectedHover => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedHover => providersTokens.colorScheme.actionHover; @override - Color get colorActiveIndicatorAndroidUnselectedPressed => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorActiveIndicatorCustomSelectedEnabled => providersTokens.colorScheme.actionSelected; + Color get colorContentUnselectedEnabled => providersTokens.colorScheme.contentMuted; @override - Color get colorActiveIndicatorCustomSelectedFocus => providersTokens.colorScheme.actionFocus; + Color get colorContentUnselectedFocus => providersTokens.colorScheme.contentDefault; @override - Color get colorActiveIndicatorCustomSelectedHover => providersTokens.colorScheme.actionHover; + Color get colorContentUnselectedHover => providersTokens.colorScheme.contentDefault; @override - Color get colorActiveIndicatorCustomSelectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorContentUnselectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorBgOpaque => providersTokens.colorScheme.bgSecondary; + Color get colorCurrentIndicatorAndroidSelectedDisabled => providersTokens.colorScheme.opacityTransparent; @override - Color get colorBgTranslucentDark => ColorRawTokens.colorOpacityGrayDark800800; + Color get colorCurrentIndicatorAndroidSelectedEnabled => providersTokens.colorScheme.opacityTransparent; @override - Color get colorBgTranslucentLight => ColorRawTokens.colorOpacityGrayLight80800; + Color get colorCurrentIndicatorAndroidSelectedFocus => providersTokens.colorScheme.opacityTransparent; @override - Color get colorBorderBadge => providersTokens.colorScheme.bgSecondary; + Color get colorCurrentIndicatorAndroidSelectedHover => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentOnIosAccent => providersTokens.colorScheme.contentOnActionSelected; + Color get colorCurrentIndicatorAndroidSelectedPressed => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedEnabled => providersTokens.colorScheme.contentDefault; + Color get colorCurrentIndicatorAndroidUnselectedDisabled => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedFocus => providersTokens.colorScheme.actionFocus; + Color get colorCurrentIndicatorAndroidUnselectedFocus => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedHover => providersTokens.colorScheme.actionHover; + Color get colorCurrentIndicatorAndroidUnselectedHover => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorCurrentIndicatorAndroidUnselectedPressed => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentUnselectedEnabledDark => ColorRawTokens.colorOpacityWhite600; + Color get colorCurrentIndicatorCustomSelectedEnabled => providersTokens.colorScheme.actionSelected; @override - Color get colorContentUnselectedEnabledLight => ColorRawTokens.colorOpacityBlack600; + Color get colorCurrentIndicatorCustomSelectedFocus => providersTokens.colorScheme.actionFocus; @override - Color get colorContentUnselectedFocus => providersTokens.colorScheme.contentDefault; + Color get colorCurrentIndicatorCustomSelectedHover => providersTokens.colorScheme.actionHover; @override - Color get colorContentUnselectedHover => providersTokens.colorScheme.contentDefault; + Color get colorCurrentIndicatorCustomSelectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorContentUnselectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorIosAccent => providersTokens.colorScheme.actionSelected; @override - int get effectBgBlur => EffectRawTokens.effectBlur160; + int get effectBgBlur => EffectRawTokens.effectBlur320; @override - double get opacityActiveIndicatorCustom => providersTokens.opacityTokens.opaque; + double get opacityCurrentIndicatorCustom => providersTokens.opacityTokens.opaque; @override - double get sizeHeightActiveIndicatorCustom => DimensionRawTokens.dimensionOutOfSystem75; + double get sizeHeightCurrentIndicatorCustom => DimensionRawTokens.dimensionOutOfSystem75; @override - double get sizeWidthActiveIndicatorCustomBottom => DimensionRawTokens.dimension300; + double get sizeWidthCurrentIndicatorCustomBottom => DimensionRawTokens.dimension300; @override - double get sizeWidthActiveIndicatorCustomTop => DimensionRawTokens.dimension650; + double get sizeWidthCurrentIndicatorCustomTop => DimensionRawTokens.dimension500; } diff --git a/ouds_theme_orange/lib/components/orange_bulletList_tokens.dart b/ouds_theme_orange/lib/components/orange_bulletList_tokens.dart index ba3b96981..b9f9d61a9 100644 --- a/ouds_theme_orange/lib/components/orange_bulletList_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_bulletList_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_theme_orange/lib/components/orange_buttonMono_tokens.dart b/ouds_theme_orange/lib/components/orange_buttonMono_tokens.dart index c6863d4af..bd1e21de3 100644 --- a/ouds_theme_orange/lib/components/orange_buttonMono_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_buttonMono_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange/lib/components/orange_button_tokens.dart b/ouds_theme_orange/lib/components/orange_button_tokens.dart index 4c2e6ec8f..0a892a839 100644 --- a/ouds_theme_orange/lib/components/orange_button_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_button_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange/lib/components/orange_checkbox_tokens.dart b/ouds_theme_orange/lib/components/orange_checkbox_tokens.dart index 0fe69fd8e..3d8148ead 100644 --- a/ouds_theme_orange/lib/components/orange_checkbox_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_checkbox_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; @@ -39,6 +39,7 @@ class OrangeCheckboxTokens extends OudsCheckboxTokens { double get borderWidthUnselectedHover => providersTokens.borderTokens.widthMedium; @override double get borderWidthUnselectedPressed => providersTokens.borderTokens.widthMedium; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; @override diff --git a/ouds_theme_orange/lib/components/orange_chip_tokens.dart b/ouds_theme_orange/lib/components/orange_chip_tokens.dart index f037b07ef..2e3256b87 100644 --- a/ouds_theme_orange/lib/components/orange_chip_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_chip_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange/lib/components/orange_controlItem_tokens.dart b/ouds_theme_orange/lib/components/orange_controlItem_tokens.dart index f5f68a8f5..6ae30bec3 100644 --- a/ouds_theme_orange/lib/components/orange_controlItem_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_controlItem_tokens.dart @@ -10,11 +10,12 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; +import 'package:ouds_global_raw_tokens/font_raw_tokens.dart'; import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; import 'package:ouds_theme_contract/theme/tokens/components/ouds_controlItem_tokens.dart'; @@ -24,41 +25,131 @@ class OrangeControlItemTokens extends OudsControlItemTokens { OrangeControlItemTokens(this.providersTokens); @override - double get borderRadius => providersTokens.borderTokens.radiusNone; + double get borderRadiusCurrentIndicator => providersTokens.borderTokens.radiusNone; + @override + double get borderRadiusDefault => providersTokens.borderTokens.radiusDefault; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get borderRadiusItemOnly => providersTokens.borderTokens.radiusDefault; @override + double get borderRadiusMedia => providersTokens.borderTokens.radiusDefault; + @override + double get borderRadiusMediaRoundedCorner => providersTokens.borderTokens.radiusSmall; + @override + double get borderRadiusRounded => providersTokens.borderTokens.radiusMedium; + @override + double get borderWidthCurrentPage => providersTokens.borderTokens.widthMedium; + @override + double get borderWidthDefault => providersTokens.borderTokens.widthDefault; + @override + Color get colorBadgeSafetyArea => providersTokens.colorScheme.bgPrimary; + @override + Color get colorBgCurrentDisabled => providersTokens.colorScheme.actionSupportDisabled; + @override + Color get colorBgCurrentEnabled => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.actionSupportEnabled, providersTokens.colorScheme.actionSupportHover); + @override + Color get colorBgCurrentFocus => providersTokens.colorScheme.actionSupportFocus; + @override + Color get colorBgCurrentHover => providersTokens.colorScheme.actionSupportHover; + @override + Color get colorBgCurrentPressed => providersTokens.colorScheme.actionSupportPressed; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override Color get colorBgFocus => providersTokens.colorScheme.actionSupportFocus; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgHover => providersTokens.colorScheme.actionSupportHover; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgLoading => providersTokens.colorScheme.actionSupportLoading; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgPressed => providersTokens.colorScheme.actionSupportPressed; @override + Color get colorContentCurrentDisabled => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentEnabled => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentFocus => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentHover => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentPressed => providersTokens.colorScheme.contentDefault; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override Color get colorContentLoader => providersTokens.colorScheme.contentDefault; @override + double get fontLetterSpacingAvatarInitialXlarge => FontRawTokens.fontLetterSpacing450; + @override + double get fontLineHeightAvatarInitialXlarge => FontRawTokens.fontLineHeight650; + @override + double get fontSizeAvatarInitialXlarge => FontRawTokens.fontSize450; + @override + double get opacityCurrentDivider => providersTokens.opacityTokens.opaque; + @override + double get opacityCurrentIndicator => providersTokens.opacityTokens.opaque; + @override + double get sizeAssetLarge => DimensionRawTokens.dimension500; + @override + double get sizeAssetMedium => providersTokens.sizeTokens.iconWithLabelLargeSizeMedium; + @override + double get sizeAssetSmall => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; + @override + double get sizeAssetXlarge => DimensionRawTokens.dimension700; + @override + double get sizeControlIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; + @override + double get sizeCurrentIndicatorWidth => DimensionRawTokens.dimension50; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get sizeErrorIcon => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; @override + double get sizeFlagHeight => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get sizeIcon => providersTokens.sizeTokens.iconWithLabelLargeSizeMedium; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeLoader => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeMaxHeightAssetsContainer => DimensionRawTokens.dimension1200; @override double get sizeMaxWidth => DimensionRawTokens.dimension4000; @override - double get sizeMinHeight => DimensionRawTokens.dimension650; + double get sizeMinHeightCompact => providersTokens.sizeTokens.minInteractiveArea; + @override + double get sizeMinHeightDefault => DimensionRawTokens.dimension750; @override double get sizeMinWidth => DimensionRawTokens.dimension2000; @override double get spaceColumnGap => providersTokens.spaceTokens.columnGapMedium; @override + double get spacePaddingBlockBottomSlot => providersTokens.spaceTokens.paddingBlock3xsmall; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get spacePaddingBlockDefault => providersTokens.spaceTokens.paddingBlockMedium; @override - double get spacePaddingBlockTopErrorText => providersTokens.spaceTokens.paddingBlockXsmall; + double get spacePaddingBlockDensityCompact => providersTokens.spaceTokens.paddingBlockXsmall; + @override + double get spacePaddingBlockDensityCompactBottomExpandContainer => providersTokens.spaceTokens.paddingBlock2xlarge; + @override + double get spacePaddingBlockDensityCompactTopAlignmentTopCounterweight => providersTokens.spaceTokens.paddingBlockXsmall; + @override + double get spacePaddingBlockDensityCompactTopAlignmentTopTextContainer => providersTokens.spaceTokens.paddingBlockNone; + @override + double get spacePaddingBlockDensityDefault => providersTokens.spaceTokens.paddingBlockMedium; + @override + double get spacePaddingBlockDensityDefaultBottomExpandContainer => providersTokens.spaceTokens.paddingBlock3xlarge; + @override + double get spacePaddingBlockDensityDefaultTopAlignmentTopCounterweight => providersTokens.spaceTokens.paddingBlockSmall; + @override + double get spacePaddingBlockDensityDefaultTopAlignmentTopTextContainer => providersTokens.spaceTokens.paddingBlock4xsmall; + @override + double get spacePaddingBlockTopHelperText => providersTokens.spaceTokens.paddingBlockXsmall; @override double get spacePaddingInline => providersTokens.spaceTokens.paddingInlineLarge; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get spacePaddingInlineErrorIcon => providersTokens.spaceTokens.paddingInline4xsmall; @override diff --git a/ouds_theme_orange/lib/components/orange_divider_tokens.dart b/ouds_theme_orange/lib/components/orange_divider_tokens.dart index a16fddf7f..c0f4d395e 100644 --- a/ouds_theme_orange/lib/components/orange_divider_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_divider_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; diff --git a/ouds_theme_orange/lib/components/orange_icon_tokens.dart b/ouds_theme_orange/lib/components/orange_icon_tokens.dart index c8097ab25..051bf0c9c 100644 --- a/ouds_theme_orange/lib/components/orange_icon_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_icon_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -22,10 +22,12 @@ class OrangeIconTokens extends OudsIconTokens { OrangeIconTokens(this.providersTokens); - @override - Color get colorContentDefault => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryNeutralEmphasizedBlack, providersTokens.colorScheme.repositoryNeutralMutedLower); @override Color get colorContentStatusWarningExternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningMedium, providersTokens.colorScheme.repositoryWarningLow); @override Color get colorContentStatusWarningInternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningHigh, providersTokens.colorScheme.opacityTransparent); + @override + Color get colorContentStatusWarningInverseExternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningLow, providersTokens.colorScheme.repositoryWarningMedium); + @override + Color get colorContentStatusWarningInverseInternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.opacityTransparent, providersTokens.colorScheme.repositoryWarningHigh); } diff --git a/ouds_theme_orange/lib/components/orange_inputTag_tokens.dart b/ouds_theme_orange/lib/components/orange_inputTag_tokens.dart index 01c45d755..27cdad996 100644 --- a/ouds_theme_orange/lib/components/orange_inputTag_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_inputTag_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange/lib/components/orange_linkMono_tokens.dart b/ouds_theme_orange/lib/components/orange_linkMono_tokens.dart index 635801b4c..f71bfdc1b 100644 --- a/ouds_theme_orange/lib/components/orange_linkMono_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_linkMono_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange/lib/components/orange_link_tokens.dart b/ouds_theme_orange/lib/components/orange_link_tokens.dart index f6bc298d6..2fc612ec7 100644 --- a/ouds_theme_orange/lib/components/orange_link_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_link_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange/lib/components/orange_pinCodeInput_tokens.dart b/ouds_theme_orange/lib/components/orange_pinCodeInput_tokens.dart index de11170c0..ed7c2114e 100644 --- a/ouds_theme_orange/lib/components/orange_pinCodeInput_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_pinCodeInput_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_theme_orange/lib/components/orange_radioButton_tokens.dart b/ouds_theme_orange/lib/components/orange_radioButton_tokens.dart index 3c74d365c..bad1878cf 100644 --- a/ouds_theme_orange/lib/components/orange_radioButton_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_radioButton_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; @@ -40,8 +40,6 @@ class OrangeRadioButtonTokens extends OudsRadioButtonTokens { @override double get borderWidthUnselectedPressed => providersTokens.borderTokens.widthMedium; @override - double get sizeIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; - @override double get sizeMaxHeight => providersTokens.sizeTokens.minInteractiveArea; @override double get sizeMinHeight => providersTokens.sizeTokens.minInteractiveArea; diff --git a/ouds_theme_orange/lib/components/orange_skeleton_tokens.dart b/ouds_theme_orange/lib/components/orange_skeleton_tokens.dart index 974a1d3a0..ea67e3e9a 100644 --- a/ouds_theme_orange/lib/components/orange_skeleton_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_skeleton_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange/lib/components/orange_switch_tokens.dart b/ouds_theme_orange/lib/components/orange_switch_tokens.dart index 6a3fefb6f..95bb94b61 100644 --- a/ouds_theme_orange/lib/components/orange_switch_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_switch_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange/lib/components/orange_tag_tokens.dart b/ouds_theme_orange/lib/components/orange_tag_tokens.dart index 508b0e0bf..a71b73b30 100644 --- a/ouds_theme_orange/lib/components/orange_tag_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_tag_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; @@ -35,9 +35,9 @@ class OrangeTagTokens extends OudsTagTokens { @override double get sizeMinHeightSmall => DimensionRawTokens.dimension300; @override - double get sizeMinWidthDefault => DimensionRawTokens.dimension600; + double get sizeMinWidthDefault => DimensionRawTokens.dimension400; @override - double get sizeMinWidthSmall => DimensionRawTokens.dimension550; + double get sizeMinWidthSmall => DimensionRawTokens.dimension300; @override double get spaceColumnGapDefault => providersTokens.spaceTokens.columnGap2xsmall; @override diff --git a/ouds_theme_orange/lib/components/orange_textInput_tokens.dart b/ouds_theme_orange/lib/components/orange_textInput_tokens.dart index db168ff29..68c1bfedb 100644 --- a/ouds_theme_orange/lib/components/orange_textInput_tokens.dart +++ b/ouds_theme_orange/lib/components/orange_textInput_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -26,7 +26,7 @@ class OrangeTextInputTokens extends OudsTextInputTokens { @override double get borderRadiusDefault => providersTokens.borderTokens.radiusDefault; @override - double get borderRadiusRounded => providersTokens.borderTokens.radiusSmall; + double get borderRadiusRounded => providersTokens.borderTokens.radiusMedium; @override double get borderWidthDefault => providersTokens.borderTokens.widthDefault; @override @@ -58,6 +58,10 @@ class OrangeTextInputTokens extends OudsTextInputTokens { @override double get spaceColumnGapInlineText => providersTokens.spaceTokens.columnGapXsmall; @override + double get spaceColumnGapLabelAsterisk => providersTokens.spaceTokens.columnGap2xsmall; + @override + double get spaceColumnGapLabelSmallAsterisk => DimensionRawTokens.dimensionOutOfSystem75; + @override double get spaceColumnGapTrailingErrorAction => providersTokens.spaceTokens.columnGapXsmall; @override double get spacePaddingBlockDefault => providersTokens.spaceTokens.paddingBlock2xsmall; diff --git a/ouds_theme_orange/lib/material/orange_material_color_tokens.dart b/ouds_theme_orange/lib/material/orange_material_color_tokens.dart index 5a24cd69a..d6afdc334 100644 --- a/ouds_theme_orange/lib/material/orange_material_color_tokens.dart +++ b/ouds_theme_orange/lib/material/orange_material_color_tokens.dart @@ -13,6 +13,7 @@ // Android system tokens version 1.2.0 // Generated by Tokenator +import 'package:flutter/material.dart'; import 'package:ouds_theme_contract/theme/tokens/material/ouds_material_color_tokens.dart'; import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; @@ -20,7 +21,7 @@ class OrangeMaterialColorTokens extends OudsMaterialColorTokens { const OrangeMaterialColorTokens({ super.backgroundDark = ColorRawTokens.colorFunctionalGrayDark880, super.backgroundLight = ColorRawTokens.colorFunctionalWhite, - super.errorContainerDark = ColorRawTokens.colorFunctionalScarlet900, + super.errorContainerDark = const Color(0x00ff0000), super.errorContainerLight = ColorRawTokens.colorFunctionalScarlet100, super.errorDark = ColorRawTokens.colorFunctionalScarlet300, super.errorLight = ColorRawTokens.colorFunctionalScarlet600, diff --git a/ouds_theme_orange/lib/orange_theme.dart b/ouds_theme_orange/lib/orange_theme.dart index 3e8f31705..1363731fe 100644 --- a/ouds_theme_orange/lib/orange_theme.dart +++ b/ouds_theme_orange/lib/orange_theme.dart @@ -219,18 +219,7 @@ class OrangeTheme implements OudsThemeContract { /// /// The [orangeFontFamily] parameter specifies the font family to be used throughout /// the theme. - /// - /// **Note:** Omitting the [orangeFontFamily] is deprecated and this parameter will - /// become required in a future version. It is strongly recommended to explicitly - /// provide the font family name obtained from `OrangeFontProvider` to ensure - /// correct font rendering. See the [OrangeTheme] class documentation for - /// detailed instructions on loading the font. - @Deprecated( - 'Creating OrangeTheme() without orangeFontFamily is deprecated. ' - 'This parameter will be required in future versions. ' - 'Use OrangeTheme(fontFamily) instead.', - ) OrangeTheme([this.orangeFontFamily]); @override diff --git a/ouds_theme_orange/lib/semantic/orange_border_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_border_semantic_tokens.dart index 17d24bfb4..112ead527 100644 --- a/ouds_theme_orange/lib/semantic/orange_border_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_border_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_border_semantic_tokens.dart'; diff --git a/ouds_theme_orange/lib/semantic/orange_color_action_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_color_action_semantic_tokens.dart index ee4e6c350..335f168ee 100644 --- a/ouds_theme_orange/lib/semantic/orange_color_action_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_color_action_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_orange/raw/orange_color_raw_tokens.dart'; @@ -29,8 +29,6 @@ class OrangeColorActionSemanticTokens extends OudsColorActionSemanticTokens { super.actionHighlightedLight = ColorRawTokens.colorFunctionalBlack, super.actionHoverDark = ColorRawTokens.colorOpacityWhite640, super.actionHoverLight = ColorRawTokens.colorOpacityBlack680, - super.actionIosAccentDark = OrangeColorRawTokens.colorOrange500, - super.actionIosAccentLight = OrangeColorRawTokens.colorOrange550, super.actionLoadingDark = OrangeColorRawTokens.colorOrange500, super.actionLoadingLight = OrangeColorRawTokens.colorOrange550, super.actionNegativeEnabledDark = ColorRawTokens.colorFunctionalScarlet300, diff --git a/ouds_theme_orange/lib/semantic/orange_color_always_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_color_always_semantic_tokens.dart index 429c0b370..6007affb9 100644 --- a/ouds_theme_orange/lib/semantic/orange_color_always_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_color_always_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_always_semantic_tokens.dart'; diff --git a/ouds_theme_orange/lib/semantic/orange_color_bg_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_color_bg_semantic_tokens.dart index 71e618293..fc0ca3f8a 100644 --- a/ouds_theme_orange/lib/semantic/orange_color_bg_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_color_bg_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_orange/raw/orange_color_raw_tokens.dart'; @@ -27,7 +27,7 @@ class OrangeColorBgSemanticTokens extends OudsColorBgSemanticTokens { super.bgPrimaryLight = ColorRawTokens.colorFunctionalWhite, super.bgSecondaryDark = ColorRawTokens.colorFunctionalGrayDark800, super.bgSecondaryLight = ColorRawTokens.colorFunctionalGrayLight80, - super.bgTertiaryDark = OrangeColorRawTokens.colorWarmGray900, + super.bgTertiaryDark = OrangeColorRawTokens.colorWarmGray1000, super.bgTertiaryLight = OrangeColorRawTokens.colorWarmGray100, }); } diff --git a/ouds_theme_orange/lib/semantic/orange_color_border_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_color_border_semantic_tokens.dart index 55b8eb6a1..545b1b768 100644 --- a/ouds_theme_orange/lib/semantic/orange_color_border_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_color_border_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -28,7 +28,7 @@ class OrangeColorBorderSemanticTokens extends OudsColorBorderSemanticTokens { super.borderBrandTertiaryLight = const Color(0x00ff0000), super.borderDefaultDark = ColorRawTokens.colorOpacityWhite200, super.borderDefaultLight = ColorRawTokens.colorOpacityBlack200, - super.borderEmphasizedDark = ColorRawTokens.colorOpacityWhite920, + super.borderEmphasizedDark = ColorRawTokens.colorFunctionalGrayLight160, super.borderEmphasizedLight = ColorRawTokens.colorFunctionalBlack, super.borderFocusDark = ColorRawTokens.colorFunctionalGrayLight160, super.borderFocusInsetDark = ColorRawTokens.colorFunctionalGrayDark880, diff --git a/ouds_theme_orange/lib/semantic/orange_color_content_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_color_content_semantic_tokens.dart index 8a0eeb33c..018309959 100644 --- a/ouds_theme_orange/lib/semantic/orange_color_content_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_color_content_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange/lib/semantic/orange_color_decorative_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_color_decorative_semantic_tokens.dart deleted file mode 100644 index 9927c2998..000000000 --- a/ouds_theme_orange/lib/semantic/orange_color_decorative_semantic_tokens.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// Software Name: OUDS Flutter -// SPDX-FileCopyrightText: Copyright (c) Orange SA -// SPDX-License-Identifier: MIT -// -// This software is distributed under the MIT license, -// the text of which is available at https://opensource.org/license/MIT/ -// or see the "LICENSE" file for more details. -// -// Software description: Flutter library of reusable graphical components -// - -// Orange brand tokens version 1.5.0 -// Generated by Tokenator - -import 'package:flutter/material.dart'; -import 'package:ouds_theme_orange/raw/orange_color_raw_tokens.dart'; -import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_decorative_semantic_tokens.dart'; -import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; - -class OrangeColorDecorativeSemanticTokens extends OudsColorDecorativeSemanticTokens { - const OrangeColorDecorativeSemanticTokens({ - super.decorativeAccent1Default = OrangeColorRawTokens.colorDecorativeEmerald500, - super.decorativeAccent1Emphasized = OrangeColorRawTokens.colorDecorativeEmerald700, - super.decorativeAccent1Muted = OrangeColorRawTokens.colorDecorativeEmerald200, - super.decorativeAccent2Default = OrangeColorRawTokens.colorDecorativeSky400, - super.decorativeAccent2Emphasized = OrangeColorRawTokens.colorDecorativeSky700, - super.decorativeAccent2Muted = OrangeColorRawTokens.colorDecorativeSky200, - super.decorativeAccent3Default = ColorRawTokens.colorFunctionalSun500, - super.decorativeAccent3Emphasized = OrangeColorRawTokens.colorDecorativeAmber500, - super.decorativeAccent3Muted = ColorRawTokens.colorFunctionalSun200, - super.decorativeAccent4Default = OrangeColorRawTokens.colorDecorativeAmethyst400, - super.decorativeAccent4Emphasized = OrangeColorRawTokens.colorDecorativeAmethyst800, - super.decorativeAccent4Muted = OrangeColorRawTokens.colorDecorativeAmethyst200, - super.decorativeAccent5Default = OrangeColorRawTokens.colorDecorativeShockingPink200, - super.decorativeAccent5Emphasized = OrangeColorRawTokens.colorDecorativeShockingPink300, - super.decorativeAccent5Muted = OrangeColorRawTokens.colorDecorativeShockingPink100, - super.decorativeBrandPrimary = OrangeColorRawTokens.colorOrange500, - super.decorativeBrandPrimaryEmphasized = const Color(0x00ff0000), - super.decorativeBrandPrimaryMuted = const Color(0x00ff0000), - super.decorativeBrandSecondary = ColorRawTokens.colorFunctionalBlack, - super.decorativeBrandSecondaryEmphasized = const Color(0x00ff0000), - super.decorativeBrandSecondaryMuted = const Color(0x00ff0000), - super.decorativeBrandTertiary = ColorRawTokens.colorFunctionalWhite, - super.decorativeBrandTertiaryEmphasized = const Color(0x00ff0000), - super.decorativeBrandTertiaryMuted = const Color(0x00ff0000), - super.decorativeNeutralEmphasizedHigh = const Color(0x00ff0000), - super.decorativeNeutralEmphasizedHigher = ColorRawTokens.colorFunctionalGrayDark640, - super.decorativeNeutralEmphasizedHighest = const Color(0x00ff0000), - super.decorativeNeutralEmphasizedLow = ColorRawTokens.colorFunctionalGrayDark400, - super.decorativeNeutralEmphasizedLower = ColorRawTokens.colorFunctionalGrayDark320, - super.decorativeNeutralEmphasizedLowest = ColorRawTokens.colorFunctionalGrayDark240, - super.decorativeNeutralEmphasizedMedium = const Color(0x00ff0000), - super.decorativeNeutralMutedHigh = ColorRawTokens.colorFunctionalGrayLight400, - super.decorativeNeutralMutedHigher = ColorRawTokens.colorFunctionalGrayLight800, - super.decorativeNeutralMutedHighest = ColorRawTokens.colorFunctionalGrayLight960, - super.decorativeNeutralMutedLow = ColorRawTokens.colorFunctionalGrayLight240, - super.decorativeNeutralMutedLower = ColorRawTokens.colorFunctionalGrayLight160, - super.decorativeNeutralMutedLowest = ColorRawTokens.colorFunctionalGrayLight80, - super.decorativeNeutralMutedMedium = ColorRawTokens.colorFunctionalGrayLight320, - super.decorativeSkinTint100 = OrangeColorRawTokens.colorDecorativeDeepPeach100, - super.decorativeSkinTint200 = OrangeColorRawTokens.colorDecorativeDeepPeach200, - super.decorativeSkinTint300 = OrangeColorRawTokens.colorDecorativeDeepPeach300, - super.decorativeSkinTint400 = OrangeColorRawTokens.colorDecorativeDeepPeach400, - super.decorativeSkinTint500 = OrangeColorRawTokens.colorDecorativeDeepPeach500, - super.decorativeSkinTint600 = OrangeColorRawTokens.colorDecorativeDeepPeach600, - super.decorativeSkinTint700 = OrangeColorRawTokens.colorDecorativeDeepPeach700, - super.decorativeSkinTint800 = OrangeColorRawTokens.colorDecorativeDeepPeach800, - super.decorativeSkinTint900 = OrangeColorRawTokens.colorDecorativeDeepPeach900, - }); -} diff --git a/ouds_theme_orange/lib/semantic/orange_color_opacity_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_color_opacity_semantic_tokens.dart index 3d2cc4926..b9be93958 100644 --- a/ouds_theme_orange/lib/semantic/orange_color_opacity_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_color_opacity_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_opacity_semantic_tokens.dart'; diff --git a/ouds_theme_orange/lib/semantic/orange_color_overlay_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_color_overlay_semantic_tokens.dart index 001cbc035..c04241866 100644 --- a/ouds_theme_orange/lib/semantic/orange_color_overlay_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_color_overlay_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_overlay_semantic_tokens.dart'; @@ -18,12 +18,14 @@ import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; class OrangeColorOverlaySemanticTokens extends OudsColorOverlaySemanticTokens { const OrangeColorOverlaySemanticTokens({ + super.overlayBackdropDark = ColorRawTokens.colorOpacityBlack680, + super.overlayBackdropLight = ColorRawTokens.colorOpacityBlack680, super.overlayDragDark = ColorRawTokens.colorOpacityWhite80, super.overlayDragLight = ColorRawTokens.colorOpacityBlack40, super.overlayDropdownDark = ColorRawTokens.colorFunctionalGrayDark560, super.overlayDropdownLight = ColorRawTokens.colorFunctionalWhite, - super.overlayModalDark = ColorRawTokens.colorFunctionalGrayDark640, - super.overlayModalLight = ColorRawTokens.colorFunctionalWhite, + super.overlayModalSheetDark = ColorRawTokens.colorFunctionalGrayDark720, + super.overlayModalSheetLight = ColorRawTokens.colorFunctionalWhite, super.overlayTooltipDark = ColorRawTokens.colorFunctionalGrayDark560, super.overlayTooltipLight = ColorRawTokens.colorFunctionalGrayDark720, }); diff --git a/ouds_theme_orange/lib/semantic/orange_color_repository_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_color_repository_semantic_tokens.dart index 492b62f4a..25cf635fb 100644 --- a/ouds_theme_orange/lib/semantic/orange_color_repository_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_color_repository_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -29,14 +29,14 @@ class OrangeColorRepositorySemanticTokens extends OudsColorRepositorySemanticTok super.repositoryAccentMedium = OrangeColorRawTokens.colorOrange550, super.repositoryInfoHigh = ColorRawTokens.colorFunctionalDodgerBlue700, super.repositoryInfoHigher = const Color(0x00ff0000), - super.repositoryInfoHighest = ColorRawTokens.colorFunctionalDodgerBlue900, + super.repositoryInfoHighest = const Color(0x00ff0000), super.repositoryInfoLow = ColorRawTokens.colorFunctionalDodgerBlue300, super.repositoryInfoLower = const Color(0x00ff0000), - super.repositoryInfoLowest = ColorRawTokens.colorFunctionalDodgerBlue100, + super.repositoryInfoLowest = const Color(0x00ff0000), super.repositoryInfoMedium = const Color(0x00ff0000), super.repositoryNegativeHigh = ColorRawTokens.colorFunctionalScarlet700, super.repositoryNegativeHigher = ColorRawTokens.colorFunctionalScarlet800, - super.repositoryNegativeHighest = ColorRawTokens.colorFunctionalScarlet900, + super.repositoryNegativeHighest = const Color(0x00ff0000), super.repositoryNegativeLow = ColorRawTokens.colorFunctionalScarlet300, super.repositoryNegativeLower = ColorRawTokens.colorFunctionalScarlet200, super.repositoryNegativeLowest = ColorRawTokens.colorFunctionalScarlet100, @@ -96,10 +96,10 @@ class OrangeColorRepositorySemanticTokens extends OudsColorRepositorySemanticTok super.repositoryOpacityWhiteTransparent = ColorRawTokens.colorOpacityWhite0, super.repositoryPositiveHigh = ColorRawTokens.colorFunctionalMalachite700, super.repositoryPositiveHigher = ColorRawTokens.colorFunctionalMalachite750, - super.repositoryPositiveHighest = ColorRawTokens.colorFunctionalMalachite900, + super.repositoryPositiveHighest = const Color(0x00ff0000), super.repositoryPositiveLow = ColorRawTokens.colorFunctionalMalachite300, super.repositoryPositiveLower = const Color(0x00ff0000), - super.repositoryPositiveLowest = ColorRawTokens.colorFunctionalMalachite100, + super.repositoryPositiveLowest = const Color(0x00ff0000), super.repositoryPositiveMedium = ColorRawTokens.colorFunctionalMalachite600, super.repositoryPrimaryHigh = const Color(0x00ff0000), super.repositoryPrimaryHigher = const Color(0x00ff0000), @@ -109,7 +109,8 @@ class OrangeColorRepositorySemanticTokens extends OudsColorRepositorySemanticTok super.repositoryPrimaryLowest = const Color(0x00ff0000), super.repositoryPrimaryMedium = OrangeColorRawTokens.colorOrange550, super.repositorySecondaryHigh = const Color(0x00ff0000), - super.repositorySecondaryHigher = const Color(0x00ff0000), + super.repositorySecondaryHigherHigh = const Color(0x00ff0000), + super.repositorySecondaryHigherLow = const Color(0x00ff0000), super.repositorySecondaryHighest = const Color(0x00ff0000), super.repositorySecondaryLow = const Color(0x00ff0000), super.repositorySecondaryLower = const Color(0x00ff0000), @@ -124,10 +125,10 @@ class OrangeColorRepositorySemanticTokens extends OudsColorRepositorySemanticTok super.repositoryTertiaryMedium = const Color(0x00ff0000), super.repositoryWarningHigh = ColorRawTokens.colorFunctionalSun750, super.repositoryWarningHigher = const Color(0x00ff0000), - super.repositoryWarningHighest = ColorRawTokens.colorFunctionalSun900, + super.repositoryWarningHighest = const Color(0x00ff0000), super.repositoryWarningLow = ColorRawTokens.colorFunctionalSun300, super.repositoryWarningLower = const Color(0x00ff0000), - super.repositoryWarningLowest = ColorRawTokens.colorFunctionalSun100, + super.repositoryWarningLowest = const Color(0x00ff0000), super.repositoryWarningMedium = ColorRawTokens.colorFunctionalSun500, }); } diff --git a/ouds_theme_orange/lib/semantic/orange_color_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_color_semantic_tokens.dart index bfe4d8a6a..846680d16 100644 --- a/ouds_theme_orange/lib/semantic/orange_color_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_color_semantic_tokens.dart @@ -4,7 +4,6 @@ import 'package:ouds_theme_orange/semantic/orange_color_always_semantic_tokens.d import 'package:ouds_theme_orange/semantic/orange_color_bg_semantic_tokens.dart'; import 'package:ouds_theme_orange/semantic/orange_color_border_semantic_tokens.dart'; import 'package:ouds_theme_orange/semantic/orange_color_content_semantic_tokens.dart'; -import 'package:ouds_theme_orange/semantic/orange_color_decorative_semantic_tokens.dart'; import 'package:ouds_theme_orange/semantic/orange_color_opacity_semantic_tokens.dart'; import 'package:ouds_theme_orange/semantic/orange_color_overlay_semantic_tokens.dart'; import 'package:ouds_theme_orange/semantic/orange_color_repository_semantic_tokens.dart'; @@ -17,7 +16,6 @@ class OrangeColorSemanticTokens extends OudsColorSemanticTokens { OrangeColorBgSemanticTokens backgroundColorTokens = const OrangeColorBgSemanticTokens(), OrangeColorBorderSemanticTokens borderColorTokens = const OrangeColorBorderSemanticTokens(), OrangeColorContentSemanticTokens contentColorTokens = const OrangeColorContentSemanticTokens(), - OrangeColorDecorativeSemanticTokens decorativeColorTokens = const OrangeColorDecorativeSemanticTokens(), OrangeColorOpacitySemanticTokens opacityColorTokens = const OrangeColorOpacitySemanticTokens(), OrangeColorOverlaySemanticTokens overlayColorTokens = const OrangeColorOverlaySemanticTokens(), OrangeColorSurfaceSemanticTokens surfaceColorTokens = const OrangeColorSurfaceSemanticTokens(), @@ -28,7 +26,6 @@ class OrangeColorSemanticTokens extends OudsColorSemanticTokens { backgroundColorTokens: backgroundColorTokens, borderColorTokens: borderColorTokens, contentColorTokens: contentColorTokens, - decorativeColorTokens: decorativeColorTokens, opacityColorTokens: opacityColorTokens, overlayColorTokens: overlayColorTokens, surfaceColorTokens: surfaceColorTokens, diff --git a/ouds_theme_orange/lib/semantic/orange_color_surface_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_color_surface_semantic_tokens.dart index 17f17db60..410824ab1 100644 --- a/ouds_theme_orange/lib/semantic/orange_color_surface_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_color_surface_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange/lib/semantic/orange_effect_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_effect_semantic_tokens.dart index 59c69113d..44c6a89ab 100644 --- a/ouds_theme_orange/lib/semantic/orange_effect_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_effect_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_effect_semantic_tokens.dart'; @@ -18,5 +18,5 @@ import 'package:ouds_global_raw_tokens/effect_raw_tokens.dart'; class OrangeEffectSemanticTokens extends OudsEffectSemanticTokens { @override - int get blurDrag => EffectRawTokens.effectBlur320; + int get blurDrag => EffectRawTokens.effectBlur480; } diff --git a/ouds_theme_orange/lib/semantic/orange_font_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_font_semantic_tokens.dart index 4efe43f32..16b1d4ff9 100644 --- a/ouds_theme_orange/lib/semantic/orange_font_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_font_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange/lib/semantic/orange_grid_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_grid_semantic_tokens.dart index ec020d25d..7d395f2d9 100644 --- a/ouds_theme_orange/lib/semantic/orange_grid_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_grid_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_grid_semantic_tokens.dart'; @@ -18,7 +18,7 @@ import 'package:ouds_global_raw_tokens/grid_raw_tokens.dart'; class OrangeGridSemanticTokens extends OudsGridSemanticTokens { @override - double get compactColumnGap => GridRawTokens.gridColumnGap100; + double get compactColumnGap => GridRawTokens.gridColumnGap200; @override double get compactMargin => GridRawTokens.gridMargin300; @override diff --git a/ouds_theme_orange/lib/semantic/orange_opacity_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_opacity_semantic_tokens.dart index 2ac68cc87..9faa076f7 100644 --- a/ouds_theme_orange/lib/semantic/orange_opacity_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_opacity_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_opacity_semantic_tokens.dart'; diff --git a/ouds_theme_orange/lib/semantic/orange_size_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_size_semantic_tokens.dart index 2f9451a27..8a36d3ec2 100644 --- a/ouds_theme_orange/lib/semantic/orange_size_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_size_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_size_semantic_tokens.dart'; @@ -126,7 +126,7 @@ class OrangeSizeSemanticTokens extends OudsSizeSemanticTokens { @override double get iconWithLabelLargeSizeSmall => DimensionRawTokens.dimension300; @override - double get iconWithLabelLargeSizeXlarge => DimensionRawTokens.dimension550; + double get iconWithLabelLargeSizeXlarge => DimensionRawTokens.dimension450; @override double get iconWithLabelLargeSizeXsmall => DimensionRawTokens.dimension250; @override @@ -146,67 +146,69 @@ class OrangeSizeSemanticTokens extends OudsSizeSemanticTokens { @override double get iconWithLabelSmallSizeXsmall => DimensionRawTokens.dimensionOutOfSystem250; @override - double get iconWithLabelXlargeSizeLarge => DimensionRawTokens.dimension550; + double get iconWithLabelXlargeSizeLarge => DimensionRawTokens.dimension500; @override - double get iconWithLabelXlargeSizeMedium => DimensionRawTokens.dimension500; + double get iconWithLabelXlargeSizeMedium => DimensionRawTokens.dimension450; @override double get iconWithLabelXlargeSizeSmall => DimensionRawTokens.dimension400; @override - double get maxWidthTypeBodyLargeMobile => DimensionRawTokens.dimension6000; + double get iconWithLabelXlargeSizeXsmall => DimensionRawTokens.dimension350; @override - double get maxWidthTypeBodyLargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodyLargeMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodyMediumMobile => DimensionRawTokens.dimension6000; + double get maxWidthBodyLargeTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodyMediumTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodyMediumMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodySmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthBodyMediumTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodySmallTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodySmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeDisplayLargeMobile => DimensionRawTokens.dimension9000; + double get maxWidthBodySmallTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeDisplayLargeTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplayLargeMobile => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplayMediumMobile => DimensionRawTokens.dimension9000; + double get maxWidthDisplayLargeTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplayMediumTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplayMediumMobile => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplaySmallMobile => DimensionRawTokens.dimension9000; + double get maxWidthDisplayMediumTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplaySmallTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplaySmallMobile => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeHeadingLargeMobile => DimensionRawTokens.dimension7000; + double get maxWidthDisplaySmallTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeHeadingLargeTablet => DimensionRawTokens.dimension9000; + double get maxWidthHeadingLargeMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingMediumMobile => DimensionRawTokens.dimension7000; + double get maxWidthHeadingLargeTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeHeadingMediumTablet => DimensionRawTokens.dimension7000; + double get maxWidthHeadingMediumMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingSmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthHeadingMediumTablet => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingSmallTablet => DimensionRawTokens.dimension7000; + double get maxWidthHeadingSmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeHeadingXlargeMobile => DimensionRawTokens.dimension7000; + double get maxWidthHeadingSmallTablet => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingXlargeTablet => DimensionRawTokens.dimension9000; + double get maxWidthHeadingXlargeMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeLabelLargeMobile => DimensionRawTokens.dimension6000; + double get maxWidthHeadingXlargeTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeLabelLargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelLargeMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelMediumMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelLargeTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelMediumTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelMediumMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelSmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelMediumTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelSmallTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelSmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelXlargeMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelSmallTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelXlargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelXlargeMobile => DimensionRawTokens.dimension6000; + @override + double get maxWidthLabelXlargeTablet => DimensionRawTokens.dimension6000; @override double get minInteractiveArea => DimensionRawTokens.dimension600; } diff --git a/ouds_theme_orange/lib/semantic/orange_space_semantic_tokens.dart b/ouds_theme_orange/lib/semantic/orange_space_semantic_tokens.dart index b7a5d7d24..7e0ccc701 100644 --- a/ouds_theme_orange/lib/semantic/orange_space_semantic_tokens.dart +++ b/ouds_theme_orange/lib/semantic/orange_space_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange brand tokens version 2.3.0 +// Orange brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_space_semantic_tokens.dart'; diff --git a/ouds_theme_orange/pubspec.yaml b/ouds_theme_orange/pubspec.yaml index d503417fd..74b09dd9f 100644 --- a/ouds_theme_orange/pubspec.yaml +++ b/ouds_theme_orange/pubspec.yaml @@ -1,8 +1,8 @@ name: ouds_theme_orange description: 'Orange theme implementation for OUDS, with branding-specific design tokens.' -version: 1.3.1 repository: https://github.com/Orange-OpenSource/ouds-flutter homepage: https://flutter.unified-design-system.orange.com +version: 2.0.0 environment: sdk: ^3.9.0 @@ -13,9 +13,13 @@ resolution: workspace dependencies: flutter: sdk: flutter - ouds_core: ^1.3.1 - ouds_theme_contract: ^1.3.1 - ouds_global_raw_tokens: ^1.3.1 + # Core + ouds_core: ^2.0.0 + # Theme contract + ouds_theme_contract: ^2.0.0 + # Global raw token + ouds_global_raw_tokens: ^2.0.0 + path_provider: ^2.0.0 http: ^1.6.0 @@ -53,6 +57,7 @@ flutter: - assets/component/alert/ - assets/component/checkbox/ - assets/component/chip/ + - assets/component/badge-icon/ - assets/component/bullet-list/ - assets/component/button/ - assets/component/link/ diff --git a/ouds_theme_orange_compact/CHANGELOG.md b/ouds_theme_orange_compact/CHANGELOG.md index 5509ac31a..8735e84d9 100644 --- a/ouds_theme_orange_compact/CHANGELOG.md +++ b/ouds_theme_orange_compact/CHANGELOG.md @@ -4,20 +4,26 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop) +## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/2.0.0...develop) ### Added ### Changed ### Fixed -## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 +## [2.0.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...2.0.0) - 2026-06-19 ### Added ### Changed +- [Library] Remove deprecated code and API ([#820](https://github.com/Orange-OpenSource/ouds-flutter/issues/820)) +- [Library] update tokens 2.5.0 ([#778](https://github.com/Orange-OpenSource/ouds-flutter/issues/778)) +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) ### Fixed +## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 + ## [1.3.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.2.0...1.3.0) - 2026-05-08 ### Added ### Changed +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) - [Library] update tokens 1.9.0 - Component Bullet List ([#710](https://github.com/Orange-OpenSource/ouds-flutter/issues/710)) - [Library] update tokens 1.9.0 - Component Alert ([#672](https://github.com/Orange-OpenSource/ouds-flutter/issues/672)) diff --git a/ouds_theme_orange_compact/README.md b/ouds_theme_orange_compact/README.md index 7112d46c2..6e6de7de2 100644 --- a/ouds_theme_orange_compact/README.md +++ b/ouds_theme_orange_compact/README.md @@ -14,7 +14,7 @@ To use **Theme Orange Compact**, add it as a dependency in your `pubspec.yaml` f ```yaml dependencies: - ouds_theme_orange_compact: ^1.3.1 + ouds_theme_orange_compact: ^2.0.0 ``` ## Other OUDS Libraries diff --git a/ouds_theme_orange_compact/assets/component/alert/error-fill.svg b/ouds_theme_orange_compact/assets/component/alert/error-fill.svg new file mode 100644 index 000000000..ce39de740 --- /dev/null +++ b/ouds_theme_orange_compact/assets/component/alert/error-fill.svg @@ -0,0 +1,3 @@ + + + diff --git a/ouds_theme_orange_compact/assets/component/alert/important-fill.svg b/ouds_theme_orange_compact/assets/component/alert/important-fill.svg index 0b8fe44fc..c2b698fbc 100644 --- a/ouds_theme_orange_compact/assets/component/alert/important-fill.svg +++ b/ouds_theme_orange_compact/assets/component/alert/important-fill.svg @@ -1,3 +1,3 @@ - - + + diff --git a/ouds_theme_orange_compact/assets/component/alert/info-fill.svg b/ouds_theme_orange_compact/assets/component/alert/info-fill.svg index 35e45d3b1..1c6d9c3b3 100644 --- a/ouds_theme_orange_compact/assets/component/alert/info-fill.svg +++ b/ouds_theme_orange_compact/assets/component/alert/info-fill.svg @@ -1,3 +1,3 @@ - - + + diff --git a/ouds_theme_orange_compact/assets/component/alert/tick-confirmation-fill.svg b/ouds_theme_orange_compact/assets/component/alert/tick-confirmation-fill.svg index 47ec55f7c..258b291c1 100644 --- a/ouds_theme_orange_compact/assets/component/alert/tick-confirmation-fill.svg +++ b/ouds_theme_orange_compact/assets/component/alert/tick-confirmation-fill.svg @@ -1,3 +1,3 @@ - - + + diff --git a/ouds_theme_orange_compact/assets/component/alert/warning-external-shape.svg b/ouds_theme_orange_compact/assets/component/alert/warning-external-shape.svg index 4139ad92c..8ba2fbc07 100644 --- a/ouds_theme_orange_compact/assets/component/alert/warning-external-shape.svg +++ b/ouds_theme_orange_compact/assets/component/alert/warning-external-shape.svg @@ -1,3 +1,3 @@ - - + + diff --git a/ouds_theme_orange_compact/assets/component/alert/warning-internal-shape.svg b/ouds_theme_orange_compact/assets/component/alert/warning-internal-shape.svg index 2413797ed..f0654a4c1 100644 --- a/ouds_theme_orange_compact/assets/component/alert/warning-internal-shape.svg +++ b/ouds_theme_orange_compact/assets/component/alert/warning-internal-shape.svg @@ -1,3 +1,3 @@ - - + + diff --git a/ouds_theme_orange_compact/assets/component/alert/warning.svg b/ouds_theme_orange_compact/assets/component/alert/warning.svg index b58238d3a..913441179 100644 --- a/ouds_theme_orange_compact/assets/component/alert/warning.svg +++ b/ouds_theme_orange_compact/assets/component/alert/warning.svg @@ -1,7 +1,7 @@ - + - + diff --git a/ouds_theme_orange_compact/assets/component/badge-icon/error-fill.svg b/ouds_theme_orange_compact/assets/component/badge-icon/error-fill.svg new file mode 100644 index 000000000..b101f4589 --- /dev/null +++ b/ouds_theme_orange_compact/assets/component/badge-icon/error-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_orange_compact/assets/component/badge-icon/info-fill.svg b/ouds_theme_orange_compact/assets/component/badge-icon/info-fill.svg new file mode 100644 index 000000000..5b8da60ce --- /dev/null +++ b/ouds_theme_orange_compact/assets/component/badge-icon/info-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_orange_compact/assets/component/badge-icon/tick-confirmation-fill.svg b/ouds_theme_orange_compact/assets/component/badge-icon/tick-confirmation-fill.svg new file mode 100644 index 000000000..f3e87e2f4 --- /dev/null +++ b/ouds_theme_orange_compact/assets/component/badge-icon/tick-confirmation-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_orange_compact/assets/component/badge-icon/warning-external-shape.svg b/ouds_theme_orange_compact/assets/component/badge-icon/warning-external-shape.svg new file mode 100644 index 000000000..9f34c31c9 --- /dev/null +++ b/ouds_theme_orange_compact/assets/component/badge-icon/warning-external-shape.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_orange_compact/assets/component/badge-icon/warning-internal-shape.svg b/ouds_theme_orange_compact/assets/component/badge-icon/warning-internal-shape.svg new file mode 100644 index 000000000..9e4b7e8d8 --- /dev/null +++ b/ouds_theme_orange_compact/assets/component/badge-icon/warning-internal-shape.svg @@ -0,0 +1,3 @@ + + + diff --git a/ouds_theme_orange_compact/assets/functional/navigation/form-chevron-left.svg b/ouds_theme_orange_compact/assets/functional/navigation/form-chevron-left.svg new file mode 100644 index 000000000..650bb12e7 --- /dev/null +++ b/ouds_theme_orange_compact/assets/functional/navigation/form-chevron-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_alert_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_alert_tokens.dart index f284e52d2..70c0814a4 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_alert_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_alert_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_badge_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_badge_tokens.dart index 1181c952d..bc63f9e01 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_badge_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_badge_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; @@ -31,7 +31,11 @@ class OrangeCompactBadgeTokens extends OudsBadgeTokens { @override double get sizeXsmall => DimensionRawTokens.dimension100; @override - double get spaceInset => DimensionRawTokens.dimensionOutOfSystem75; + double get spaceInsetMediumLarge => DimensionRawTokens.dimensionOutOfSystem75; + @override + double get spaceInsetSmall => DimensionRawTokens.dimensionOutOfSystem50; + @override + double get spaceInsetXsmall => DimensionRawTokens.dimensionOutOfSystem25; @override double get spacePaddingInlineLarge => providersTokens.spaceTokens.paddingInline2xsmall; @override diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_bar_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_bar_tokens.dart index d46a42594..3eb93cb44 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_bar_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_bar_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -26,71 +26,71 @@ class OrangeCompactBarTokens extends OudsBarTokens { OrangeCompactBarTokens(this.providersTokens); @override - double get borderRadiusActiveIndicatorCustomBottom => providersTokens.borderTokens.radiusNone; + double get borderRadiusCurrentIndicatorCustomBottom => providersTokens.borderTokens.radiusNone; @override - double get borderRadiusActiveIndicatorCustomTop => providersTokens.borderTokens.radiusNone; + double get borderRadiusCurrentIndicatorCustomTop => providersTokens.borderTokens.radiusNone; @override - Color get colorActiveIndicatorAndroidSelectedDisabled => providersTokens.colorScheme.opacityTransparent; + Color get colorBgOpaque => providersTokens.colorScheme.bgSecondary; @override - Color get colorActiveIndicatorAndroidSelectedEnabled => providersTokens.colorScheme.opacityTransparent; + Color get colorBgTranslucentDark => ColorRawTokens.colorOpacityGrayDark880800; @override - Color get colorActiveIndicatorAndroidSelectedFocus => providersTokens.colorScheme.opacityTransparent; + Color get colorBgTranslucentLight => ColorRawTokens.colorOpacityWhite800; @override - Color get colorActiveIndicatorAndroidSelectedHover => providersTokens.colorScheme.opacityTransparent; + Color get colorBorderBadge => providersTokens.colorScheme.bgSecondary; @override - Color get colorActiveIndicatorAndroidSelectedPressed => providersTokens.colorScheme.opacityTransparent; + Color get colorContentOnIosAccent => providersTokens.colorScheme.contentOnActionSelected; @override - Color get colorActiveIndicatorAndroidUnselectedDisabled => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedEnabled => providersTokens.colorScheme.contentDefault; @override - Color get colorActiveIndicatorAndroidUnselectedFocus => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedFocus => providersTokens.colorScheme.actionFocus; @override - Color get colorActiveIndicatorAndroidUnselectedHover => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedHover => providersTokens.colorScheme.actionHover; @override - Color get colorActiveIndicatorAndroidUnselectedPressed => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorActiveIndicatorCustomSelectedEnabled => providersTokens.colorScheme.actionSelected; + Color get colorContentUnselectedEnabled => providersTokens.colorScheme.contentMuted; @override - Color get colorActiveIndicatorCustomSelectedFocus => providersTokens.colorScheme.actionFocus; + Color get colorContentUnselectedFocus => providersTokens.colorScheme.contentDefault; @override - Color get colorActiveIndicatorCustomSelectedHover => providersTokens.colorScheme.actionHover; + Color get colorContentUnselectedHover => providersTokens.colorScheme.contentDefault; @override - Color get colorActiveIndicatorCustomSelectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorContentUnselectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorBgOpaque => providersTokens.colorScheme.bgSecondary; + Color get colorCurrentIndicatorAndroidSelectedDisabled => providersTokens.colorScheme.opacityTransparent; @override - Color get colorBgTranslucentDark => ColorRawTokens.colorOpacityGrayDark800800; + Color get colorCurrentIndicatorAndroidSelectedEnabled => providersTokens.colorScheme.opacityTransparent; @override - Color get colorBgTranslucentLight => ColorRawTokens.colorOpacityGrayLight80800; + Color get colorCurrentIndicatorAndroidSelectedFocus => providersTokens.colorScheme.opacityTransparent; @override - Color get colorBorderBadge => providersTokens.colorScheme.bgSecondary; + Color get colorCurrentIndicatorAndroidSelectedHover => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentOnIosAccent => providersTokens.colorScheme.contentOnActionSelected; + Color get colorCurrentIndicatorAndroidSelectedPressed => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedEnabled => providersTokens.colorScheme.contentDefault; + Color get colorCurrentIndicatorAndroidUnselectedDisabled => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedFocus => providersTokens.colorScheme.actionFocus; + Color get colorCurrentIndicatorAndroidUnselectedFocus => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedHover => providersTokens.colorScheme.actionHover; + Color get colorCurrentIndicatorAndroidUnselectedHover => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorCurrentIndicatorAndroidUnselectedPressed => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentUnselectedEnabledDark => ColorRawTokens.colorOpacityWhite600; + Color get colorCurrentIndicatorCustomSelectedEnabled => providersTokens.colorScheme.actionSelected; @override - Color get colorContentUnselectedEnabledLight => ColorRawTokens.colorOpacityBlack600; + Color get colorCurrentIndicatorCustomSelectedFocus => providersTokens.colorScheme.actionFocus; @override - Color get colorContentUnselectedFocus => providersTokens.colorScheme.contentDefault; + Color get colorCurrentIndicatorCustomSelectedHover => providersTokens.colorScheme.actionHover; @override - Color get colorContentUnselectedHover => providersTokens.colorScheme.contentDefault; + Color get colorCurrentIndicatorCustomSelectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorContentUnselectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorIosAccent => providersTokens.colorScheme.actionSelected; @override - int get effectBgBlur => EffectRawTokens.effectBlur160; + int get effectBgBlur => EffectRawTokens.effectBlur320; @override - double get opacityActiveIndicatorCustom => providersTokens.opacityTokens.opaque; + double get opacityCurrentIndicatorCustom => providersTokens.opacityTokens.opaque; @override - double get sizeHeightActiveIndicatorCustom => DimensionRawTokens.dimensionOutOfSystem75; + double get sizeHeightCurrentIndicatorCustom => DimensionRawTokens.dimensionOutOfSystem75; @override - double get sizeWidthActiveIndicatorCustomBottom => DimensionRawTokens.dimension300; + double get sizeWidthCurrentIndicatorCustomBottom => DimensionRawTokens.dimension300; @override - double get sizeWidthActiveIndicatorCustomTop => DimensionRawTokens.dimension650; + double get sizeWidthCurrentIndicatorCustomTop => DimensionRawTokens.dimension500; } diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_bulletList_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_bulletList_tokens.dart index 9dcf5ef4a..3a7a42d06 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_bulletList_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_bulletList_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_buttonMono_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_buttonMono_tokens.dart index 783b19b10..42b562f6c 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_buttonMono_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_buttonMono_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_button_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_button_tokens.dart index 43ca868ab..3bdbb138a 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_button_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_button_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_checkbox_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_checkbox_tokens.dart index 9419fa1e0..0a2eaaa16 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_checkbox_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_checkbox_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; @@ -39,6 +39,7 @@ class OrangeCompactCheckboxTokens extends OudsCheckboxTokens { double get borderWidthUnselectedHover => providersTokens.borderTokens.widthMedium; @override double get borderWidthUnselectedPressed => providersTokens.borderTokens.widthMedium; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; @override diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_chip_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_chip_tokens.dart index 710d34d69..ca726eb56 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_chip_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_chip_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_controlItem_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_controlItem_tokens.dart index be09ca4ba..7f4af6e9e 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_controlItem_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_controlItem_tokens.dart @@ -10,11 +10,12 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; +import 'package:ouds_global_raw_tokens/font_raw_tokens.dart'; import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; import 'package:ouds_theme_contract/theme/tokens/components/ouds_controlItem_tokens.dart'; @@ -24,41 +25,131 @@ class OrangeCompactControlItemTokens extends OudsControlItemTokens { OrangeCompactControlItemTokens(this.providersTokens); @override - double get borderRadius => providersTokens.borderTokens.radiusNone; + double get borderRadiusCurrentIndicator => providersTokens.borderTokens.radiusNone; + @override + double get borderRadiusDefault => providersTokens.borderTokens.radiusDefault; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get borderRadiusItemOnly => providersTokens.borderTokens.radiusDefault; @override + double get borderRadiusMedia => providersTokens.borderTokens.radiusDefault; + @override + double get borderRadiusMediaRoundedCorner => providersTokens.borderTokens.radiusSmall; + @override + double get borderRadiusRounded => providersTokens.borderTokens.radiusMedium; + @override + double get borderWidthCurrentPage => providersTokens.borderTokens.widthMedium; + @override + double get borderWidthDefault => providersTokens.borderTokens.widthDefault; + @override + Color get colorBadgeSafetyArea => providersTokens.colorScheme.bgPrimary; + @override + Color get colorBgCurrentDisabled => providersTokens.colorScheme.actionSupportDisabled; + @override + Color get colorBgCurrentEnabled => providersTokens.colorScheme.actionSupportEnabled; + @override + Color get colorBgCurrentFocus => providersTokens.colorScheme.actionSupportFocus; + @override + Color get colorBgCurrentHover => providersTokens.colorScheme.actionSupportHover; + @override + Color get colorBgCurrentPressed => providersTokens.colorScheme.actionSupportPressed; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override Color get colorBgFocus => providersTokens.colorScheme.actionSupportFocus; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgHover => providersTokens.colorScheme.actionSupportHover; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgLoading => providersTokens.colorScheme.actionSupportLoading; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgPressed => providersTokens.colorScheme.actionSupportPressed; @override + Color get colorContentCurrentDisabled => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentEnabled => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentFocus => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentHover => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentPressed => providersTokens.colorScheme.contentDefault; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override Color get colorContentLoader => providersTokens.colorScheme.contentDefault; @override + double get fontLetterSpacingAvatarInitialXlarge => FontRawTokens.fontLetterSpacing350; + @override + double get fontLineHeightAvatarInitialXlarge => FontRawTokens.fontLineHeight550; + @override + double get fontSizeAvatarInitialXlarge => FontRawTokens.fontSize350; + @override + double get opacityCurrentDivider => providersTokens.opacityTokens.opaque; + @override + double get opacityCurrentIndicator => providersTokens.opacityTokens.opaque; + @override + double get sizeAssetLarge => DimensionRawTokens.dimension450; + @override + double get sizeAssetMedium => providersTokens.sizeTokens.iconWithLabelLargeSizeMedium; + @override + double get sizeAssetSmall => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; + @override + double get sizeAssetXlarge => DimensionRawTokens.dimension650; + @override + double get sizeControlIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; + @override + double get sizeCurrentIndicatorWidth => DimensionRawTokens.dimension50; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get sizeErrorIcon => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; @override + double get sizeFlagHeight => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get sizeIcon => providersTokens.sizeTokens.iconWithLabelLargeSizeMedium; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeLoader => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeMaxHeightAssetsContainer => DimensionRawTokens.dimension1000; @override double get sizeMaxWidth => DimensionRawTokens.dimension4000; @override - double get sizeMinHeight => DimensionRawTokens.dimension500; + double get sizeMinHeightCompact => providersTokens.sizeTokens.minInteractiveArea; + @override + double get sizeMinHeightDefault => DimensionRawTokens.dimension650; @override double get sizeMinWidth => DimensionRawTokens.dimension1800; @override double get spaceColumnGap => providersTokens.spaceTokens.columnGapMedium; @override + double get spacePaddingBlockBottomSlot => providersTokens.spaceTokens.paddingBlock4xsmall; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get spacePaddingBlockDefault => providersTokens.spaceTokens.paddingBlockMedium; @override - double get spacePaddingBlockTopErrorText => providersTokens.spaceTokens.paddingBlockXsmall; + double get spacePaddingBlockDensityCompact => providersTokens.spaceTokens.paddingBlockXsmall; + @override + double get spacePaddingBlockDensityCompactBottomExpandContainer => providersTokens.spaceTokens.paddingBlock2xlarge; + @override + double get spacePaddingBlockDensityCompactTopAlignmentTopCounterweight => providersTokens.spaceTokens.paddingBlockXsmall; + @override + double get spacePaddingBlockDensityCompactTopAlignmentTopTextContainer => providersTokens.spaceTokens.paddingBlockNone; + @override + double get spacePaddingBlockDensityDefault => providersTokens.spaceTokens.paddingBlockMedium; + @override + double get spacePaddingBlockDensityDefaultBottomExpandContainer => providersTokens.spaceTokens.paddingBlock3xlarge; + @override + double get spacePaddingBlockDensityDefaultTopAlignmentTopCounterweight => providersTokens.spaceTokens.paddingBlockSmall; + @override + double get spacePaddingBlockDensityDefaultTopAlignmentTopTextContainer => providersTokens.spaceTokens.paddingBlockNone; + @override + double get spacePaddingBlockTopHelperText => providersTokens.spaceTokens.paddingBlockXsmall; @override double get spacePaddingInline => providersTokens.spaceTokens.paddingInlineLarge; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get spacePaddingInlineErrorIcon => providersTokens.spaceTokens.paddingInline4xsmall; @override diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_divider_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_divider_tokens.dart index 0b1f281b7..172ba5ef0 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_divider_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_divider_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_icon_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_icon_tokens.dart index 38bbc6e0f..674693257 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_icon_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_icon_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -22,10 +22,12 @@ class OrangeCompactIconTokens extends OudsIconTokens { OrangeCompactIconTokens(this.providersTokens); - @override - Color get colorContentDefault => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryNeutralEmphasizedBlack, providersTokens.colorScheme.repositoryNeutralMutedLower); @override Color get colorContentStatusWarningExternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningMedium, providersTokens.colorScheme.repositoryWarningLow); @override Color get colorContentStatusWarningInternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningHigh, providersTokens.colorScheme.opacityTransparent); + @override + Color get colorContentStatusWarningInverseExternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningLow, providersTokens.colorScheme.repositoryWarningMedium); + @override + Color get colorContentStatusWarningInverseInternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.opacityTransparent, providersTokens.colorScheme.repositoryWarningHigh); } diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_inputTag_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_inputTag_tokens.dart index 03d1a9e4f..27d9e6bd5 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_inputTag_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_inputTag_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_linkMono_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_linkMono_tokens.dart index c27b730cc..a600e45e1 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_linkMono_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_linkMono_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_link_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_link_tokens.dart index b7e33c680..3d65432c3 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_link_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_link_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_pinCodeInput_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_pinCodeInput_tokens.dart index 2574f0284..4df026333 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_pinCodeInput_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_pinCodeInput_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_radioButton_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_radioButton_tokens.dart index ddc122d10..2f4037335 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_radioButton_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_radioButton_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; @@ -40,8 +40,6 @@ class OrangeCompactRadioButtonTokens extends OudsRadioButtonTokens { @override double get borderWidthUnselectedPressed => providersTokens.borderTokens.widthMedium; @override - double get sizeIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; - @override double get sizeMaxHeight => providersTokens.sizeTokens.minInteractiveArea; @override double get sizeMinHeight => providersTokens.sizeTokens.minInteractiveArea; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_skeleton_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_skeleton_tokens.dart index a4a621cc5..c659be89d 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_skeleton_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_skeleton_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_switch_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_switch_tokens.dart index be32fb6b5..f3cf2bfe5 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_switch_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_switch_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_tag_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_tag_tokens.dart index ac642bf75..a24e4181f 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_tag_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_tag_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; @@ -35,9 +35,9 @@ class OrangeCompactTagTokens extends OudsTagTokens { @override double get sizeMinHeightSmall => DimensionRawTokens.dimension250; @override - double get sizeMinWidthDefault => DimensionRawTokens.dimension550; + double get sizeMinWidthDefault => DimensionRawTokens.dimension350; @override - double get sizeMinWidthSmall => DimensionRawTokens.dimension500; + double get sizeMinWidthSmall => DimensionRawTokens.dimension300; @override double get spaceColumnGapDefault => providersTokens.spaceTokens.columnGap2xsmall; @override diff --git a/ouds_theme_orange_compact/lib/components/orangeCompact_textInput_tokens.dart b/ouds_theme_orange_compact/lib/components/orangeCompact_textInput_tokens.dart index 1f29afb7a..400b754ba 100644 --- a/ouds_theme_orange_compact/lib/components/orangeCompact_textInput_tokens.dart +++ b/ouds_theme_orange_compact/lib/components/orangeCompact_textInput_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -26,7 +26,7 @@ class OrangeCompactTextInputTokens extends OudsTextInputTokens { @override double get borderRadiusDefault => providersTokens.borderTokens.radiusDefault; @override - double get borderRadiusRounded => providersTokens.borderTokens.radiusSmall; + double get borderRadiusRounded => providersTokens.borderTokens.radiusMedium; @override double get borderWidthDefault => providersTokens.borderTokens.widthDefault; @override @@ -58,6 +58,10 @@ class OrangeCompactTextInputTokens extends OudsTextInputTokens { @override double get spaceColumnGapInlineText => providersTokens.spaceTokens.columnGapXsmall; @override + double get spaceColumnGapLabelAsterisk => providersTokens.spaceTokens.columnGap2xsmall; + @override + double get spaceColumnGapLabelSmallAsterisk => DimensionRawTokens.dimensionOutOfSystem75; + @override double get spaceColumnGapTrailingErrorAction => providersTokens.spaceTokens.columnGapXsmall; @override double get spacePaddingBlockDefault => providersTokens.spaceTokens.paddingBlock2xsmall; diff --git a/ouds_theme_orange_compact/lib/material/orangeCompact_material_color_tokens.dart b/ouds_theme_orange_compact/lib/material/orangeCompact_material_color_tokens.dart index a13d83d70..f42b622be 100644 --- a/ouds_theme_orange_compact/lib/material/orangeCompact_material_color_tokens.dart +++ b/ouds_theme_orange_compact/lib/material/orangeCompact_material_color_tokens.dart @@ -13,6 +13,7 @@ // Android system tokens version 1.2.0 // Generated by Tokenator +import 'package:flutter/material.dart'; import 'package:ouds_theme_contract/theme/tokens/material/ouds_material_color_tokens.dart'; import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; @@ -20,7 +21,7 @@ class OrangeCompactMaterialColorTokens extends OudsMaterialColorTokens { const OrangeCompactMaterialColorTokens({ super.backgroundDark = ColorRawTokens.colorFunctionalGrayDark880, super.backgroundLight = ColorRawTokens.colorFunctionalWhite, - super.errorContainerDark = ColorRawTokens.colorFunctionalScarlet900, + super.errorContainerDark = const Color(0x00ff0000), super.errorContainerLight = ColorRawTokens.colorFunctionalScarlet100, super.errorDark = ColorRawTokens.colorFunctionalScarlet300, super.errorLight = ColorRawTokens.colorFunctionalScarlet600, diff --git a/ouds_theme_orange_compact/lib/orange_compact_theme.dart b/ouds_theme_orange_compact/lib/orange_compact_theme.dart index 7031fa0dc..611780e58 100644 --- a/ouds_theme_orange_compact/lib/orange_compact_theme.dart +++ b/ouds_theme_orange_compact/lib/orange_compact_theme.dart @@ -154,18 +154,6 @@ class OrangeCompactTheme implements OudsThemeContract { /// /// The [orangeFontFamily] parameter specifies the font family to be used throughout /// the theme. - /// - /// **Note:** Omitting the [orangeFontFamily] is deprecated and this parameter will - /// become required in a future version. It is strongly recommended to explicitly - /// provide the font family name obtained from `OrangeFontProvider` to ensure - /// correct font rendering. See the [OrangeCompactTheme] class documentation for - /// detailed instructions on loading the font. - - @Deprecated( - 'Creating OrangeCompactTheme() without orangeFontFamily is deprecated. ' - 'This parameter will be required in future versions. ' - 'Use OrangeCompactTheme(fontFamily) instead.', - ) OrangeCompactTheme([this.orangeFontFamily]); @override diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_border_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_border_semantic_tokens.dart index 1a471bf5e..57268062b 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_border_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_border_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_border_semantic_tokens.dart'; diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_action_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_action_semantic_tokens.dart index 21a8aaf89..719c31489 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_action_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_action_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_orange/raw/orange_color_raw_tokens.dart'; @@ -29,8 +29,6 @@ class OrangeCompactColorActionSemanticTokens extends OudsColorActionSemanticToke super.actionHighlightedLight = ColorRawTokens.colorFunctionalBlack, super.actionHoverDark = ColorRawTokens.colorOpacityWhite640, super.actionHoverLight = ColorRawTokens.colorOpacityBlack680, - super.actionIosAccentDark = OrangeColorRawTokens.colorOrange500, - super.actionIosAccentLight = OrangeColorRawTokens.colorOrange550, super.actionLoadingDark = OrangeColorRawTokens.colorOrange500, super.actionLoadingLight = OrangeColorRawTokens.colorOrange550, super.actionNegativeEnabledDark = ColorRawTokens.colorFunctionalScarlet300, diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_always_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_always_semantic_tokens.dart index e559aea55..c621f68f5 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_always_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_always_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_always_semantic_tokens.dart'; diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_bg_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_bg_semantic_tokens.dart index 3135fd32b..90611b759 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_bg_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_bg_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_orange/raw/orange_color_raw_tokens.dart'; diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_border_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_border_semantic_tokens.dart index d23ab57eb..043d2dffb 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_border_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_border_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -28,7 +28,7 @@ class OrangeCompactColorBorderSemanticTokens extends OudsColorBorderSemanticToke super.borderBrandTertiaryLight = const Color(0x00ff0000), super.borderDefaultDark = ColorRawTokens.colorOpacityWhite200, super.borderDefaultLight = ColorRawTokens.colorOpacityBlack200, - super.borderEmphasizedDark = ColorRawTokens.colorOpacityWhite920, + super.borderEmphasizedDark = ColorRawTokens.colorFunctionalGrayLight160, super.borderEmphasizedLight = ColorRawTokens.colorFunctionalBlack, super.borderFocusDark = ColorRawTokens.colorFunctionalGrayLight160, super.borderFocusInsetDark = ColorRawTokens.colorFunctionalBlack, diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_content_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_content_semantic_tokens.dart index 2de44ac9e..6b946a5ee 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_content_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_content_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_opacity_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_opacity_semantic_tokens.dart index 3a41a0a9a..844923e44 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_opacity_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_opacity_semantic_tokens.dart @@ -10,13 +10,14 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator -import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_opacity_semantic_tokens.dart'; import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; +import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_opacity_semantic_tokens.dart'; -class OrangeCompactColorOpacitySemanticTokens extends OudsColorOpacitySemanticTokens { +class OrangeCompactColorOpacitySemanticTokens + extends OudsColorOpacitySemanticTokens { const OrangeCompactColorOpacitySemanticTokens({ super.opacityLowerDark = ColorRawTokens.colorOpacityWhite80, super.opacityLowerLight = ColorRawTokens.colorOpacityBlack80, diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_overlay_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_overlay_semantic_tokens.dart index 1d92ac31c..f95532c9f 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_overlay_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_overlay_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_overlay_semantic_tokens.dart'; @@ -18,12 +18,14 @@ import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; class OrangeCompactColorOverlaySemanticTokens extends OudsColorOverlaySemanticTokens { const OrangeCompactColorOverlaySemanticTokens({ + super.overlayBackdropDark = ColorRawTokens.colorOpacityBlack680, + super.overlayBackdropLight = ColorRawTokens.colorOpacityBlack680, super.overlayDragDark = ColorRawTokens.colorOpacityWhite80, super.overlayDragLight = ColorRawTokens.colorOpacityBlack40, super.overlayDropdownDark = ColorRawTokens.colorFunctionalGrayDark560, super.overlayDropdownLight = ColorRawTokens.colorFunctionalWhite, - super.overlayModalDark = ColorRawTokens.colorFunctionalGrayDark640, - super.overlayModalLight = ColorRawTokens.colorFunctionalWhite, + super.overlayModalSheetDark = ColorRawTokens.colorFunctionalGrayDark720, + super.overlayModalSheetLight = ColorRawTokens.colorFunctionalWhite, super.overlayTooltipDark = ColorRawTokens.colorFunctionalGrayDark560, super.overlayTooltipLight = ColorRawTokens.colorFunctionalGrayDark720, }); diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_repository_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_repository_semantic_tokens.dart index 0852d983d..243d8ed3d 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_repository_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_repository_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -29,14 +29,14 @@ class OrangeCompactColorRepositorySemanticTokens extends OudsColorRepositorySema super.repositoryAccentMedium = OrangeColorRawTokens.colorOrange550, super.repositoryInfoHigh = ColorRawTokens.colorFunctionalDodgerBlue700, super.repositoryInfoHigher = const Color(0x00ff0000), - super.repositoryInfoHighest = ColorRawTokens.colorFunctionalDodgerBlue900, + super.repositoryInfoHighest = const Color(0x00ff0000), super.repositoryInfoLow = ColorRawTokens.colorFunctionalDodgerBlue300, super.repositoryInfoLower = const Color(0x00ff0000), - super.repositoryInfoLowest = ColorRawTokens.colorFunctionalDodgerBlue100, + super.repositoryInfoLowest = const Color(0x00ff0000), super.repositoryInfoMedium = const Color(0x00ff0000), super.repositoryNegativeHigh = ColorRawTokens.colorFunctionalScarlet700, super.repositoryNegativeHigher = ColorRawTokens.colorFunctionalScarlet800, - super.repositoryNegativeHighest = ColorRawTokens.colorFunctionalScarlet900, + super.repositoryNegativeHighest = const Color(0x00ff0000), super.repositoryNegativeLow = ColorRawTokens.colorFunctionalScarlet300, super.repositoryNegativeLower = ColorRawTokens.colorFunctionalScarlet200, super.repositoryNegativeLowest = ColorRawTokens.colorFunctionalScarlet100, @@ -96,10 +96,10 @@ class OrangeCompactColorRepositorySemanticTokens extends OudsColorRepositorySema super.repositoryOpacityWhiteTransparent = ColorRawTokens.colorOpacityWhite0, super.repositoryPositiveHigh = ColorRawTokens.colorFunctionalMalachite700, super.repositoryPositiveHigher = ColorRawTokens.colorFunctionalMalachite750, - super.repositoryPositiveHighest = ColorRawTokens.colorFunctionalMalachite900, + super.repositoryPositiveHighest = const Color(0x00ff0000), super.repositoryPositiveLow = ColorRawTokens.colorFunctionalMalachite300, super.repositoryPositiveLower = const Color(0x00ff0000), - super.repositoryPositiveLowest = ColorRawTokens.colorFunctionalMalachite100, + super.repositoryPositiveLowest = const Color(0x00ff0000), super.repositoryPositiveMedium = ColorRawTokens.colorFunctionalMalachite600, super.repositoryPrimaryHigh = const Color(0x00ff0000), super.repositoryPrimaryHigher = const Color(0x00ff0000), @@ -109,7 +109,8 @@ class OrangeCompactColorRepositorySemanticTokens extends OudsColorRepositorySema super.repositoryPrimaryLowest = const Color(0x00ff0000), super.repositoryPrimaryMedium = OrangeColorRawTokens.colorOrange550, super.repositorySecondaryHigh = const Color(0x00ff0000), - super.repositorySecondaryHigher = const Color(0x00ff0000), + super.repositorySecondaryHigherHigh = const Color(0x00ff0000), + super.repositorySecondaryHigherLow = const Color(0x00ff0000), super.repositorySecondaryHighest = const Color(0x00ff0000), super.repositorySecondaryLow = const Color(0x00ff0000), super.repositorySecondaryLower = const Color(0x00ff0000), @@ -124,10 +125,10 @@ class OrangeCompactColorRepositorySemanticTokens extends OudsColorRepositorySema super.repositoryTertiaryMedium = const Color(0x00ff0000), super.repositoryWarningHigh = ColorRawTokens.colorFunctionalSun750, super.repositoryWarningHigher = const Color(0x00ff0000), - super.repositoryWarningHighest = ColorRawTokens.colorFunctionalSun900, + super.repositoryWarningHighest = const Color(0x00ff0000), super.repositoryWarningLow = ColorRawTokens.colorFunctionalSun300, super.repositoryWarningLower = const Color(0x00ff0000), - super.repositoryWarningLowest = ColorRawTokens.colorFunctionalSun100, + super.repositoryWarningLowest = const Color(0x00ff0000), super.repositoryWarningMedium = ColorRawTokens.colorFunctionalSun500, }); } diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_surface_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_surface_semantic_tokens.dart index 68119a047..22d99dd4c 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_surface_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_color_surface_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_effect_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_effect_semantic_tokens.dart index e6605007e..9c97de83d 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_effect_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_effect_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_effect_semantic_tokens.dart'; @@ -18,5 +18,5 @@ import 'package:ouds_global_raw_tokens/effect_raw_tokens.dart'; class OrangeCompactEffectSemanticTokens extends OudsEffectSemanticTokens { @override - int get blurDrag => EffectRawTokens.effectBlur320; + int get blurDrag => EffectRawTokens.effectBlur480; } diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_font_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_font_semantic_tokens.dart index 873a831f8..cb3629e16 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_font_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_font_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_grid_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_grid_semantic_tokens.dart index ef4360fbe..d7a59fa12 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_grid_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_grid_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_grid_semantic_tokens.dart'; @@ -18,7 +18,7 @@ import 'package:ouds_global_raw_tokens/grid_raw_tokens.dart'; class OrangeCompactGridSemanticTokens extends OudsGridSemanticTokens { @override - double get compactColumnGap => GridRawTokens.gridColumnGap100; + double get compactColumnGap => GridRawTokens.gridColumnGap200; @override double get compactMargin => GridRawTokens.gridMargin100; @override diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_opacity_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_opacity_semantic_tokens.dart index 77c3e3f04..d908c1ff2 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_opacity_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_opacity_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_opacity_semantic_tokens.dart'; diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_size_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_size_semantic_tokens.dart index 396a721eb..c3f113079 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_size_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_size_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_size_semantic_tokens.dart'; @@ -126,7 +126,7 @@ class OrangeCompactSizeSemanticTokens extends OudsSizeSemanticTokens { @override double get iconWithLabelLargeSizeSmall => DimensionRawTokens.dimension250; @override - double get iconWithLabelLargeSizeXlarge => DimensionRawTokens.dimension500; + double get iconWithLabelLargeSizeXlarge => DimensionRawTokens.dimension400; @override double get iconWithLabelLargeSizeXsmall => DimensionRawTokens.dimension200; @override @@ -146,67 +146,69 @@ class OrangeCompactSizeSemanticTokens extends OudsSizeSemanticTokens { @override double get iconWithLabelSmallSizeXsmall => DimensionRawTokens.dimensionOutOfSystem250; @override - double get iconWithLabelXlargeSizeLarge => DimensionRawTokens.dimension500; + double get iconWithLabelXlargeSizeLarge => DimensionRawTokens.dimension450; @override - double get iconWithLabelXlargeSizeMedium => DimensionRawTokens.dimension450; + double get iconWithLabelXlargeSizeMedium => DimensionRawTokens.dimension400; @override double get iconWithLabelXlargeSizeSmall => DimensionRawTokens.dimension350; @override - double get maxWidthTypeBodyLargeMobile => DimensionRawTokens.dimension6000; + double get iconWithLabelXlargeSizeXsmall => DimensionRawTokens.dimension300; @override - double get maxWidthTypeBodyLargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodyLargeMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodyMediumMobile => DimensionRawTokens.dimension6000; + double get maxWidthBodyLargeTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodyMediumTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodyMediumMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodySmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthBodyMediumTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodySmallTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodySmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeDisplayLargeMobile => DimensionRawTokens.dimension9000; + double get maxWidthBodySmallTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeDisplayLargeTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplayLargeMobile => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplayMediumMobile => DimensionRawTokens.dimension9000; + double get maxWidthDisplayLargeTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplayMediumTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplayMediumMobile => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplaySmallMobile => DimensionRawTokens.dimension7000; + double get maxWidthDisplayMediumTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplaySmallTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplaySmallMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingLargeMobile => DimensionRawTokens.dimension7000; + double get maxWidthDisplaySmallTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeHeadingLargeTablet => DimensionRawTokens.dimension7000; + double get maxWidthHeadingLargeMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingMediumMobile => DimensionRawTokens.dimension6000; + double get maxWidthHeadingLargeTablet => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingMediumTablet => DimensionRawTokens.dimension6000; + double get maxWidthHeadingMediumMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeHeadingSmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthHeadingMediumTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeHeadingSmallTablet => DimensionRawTokens.dimension6000; + double get maxWidthHeadingSmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeHeadingXlargeMobile => DimensionRawTokens.dimension7000; + double get maxWidthHeadingSmallTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeHeadingXlargeTablet => DimensionRawTokens.dimension7000; + double get maxWidthHeadingXlargeMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeLabelLargeMobile => DimensionRawTokens.dimension6000; + double get maxWidthHeadingXlargeTablet => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeLabelLargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelLargeMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelMediumMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelLargeTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelMediumTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelMediumMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelSmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelMediumTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelSmallTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelSmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelXlargeMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelSmallTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelXlargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelXlargeMobile => DimensionRawTokens.dimension6000; + @override + double get maxWidthLabelXlargeTablet => DimensionRawTokens.dimension6000; @override double get minInteractiveArea => DimensionRawTokens.dimension500; } diff --git a/ouds_theme_orange_compact/lib/semantic/orangeCompact_space_semantic_tokens.dart b/ouds_theme_orange_compact/lib/semantic/orangeCompact_space_semantic_tokens.dart index 07a9ed2e1..926b63a01 100644 --- a/ouds_theme_orange_compact/lib/semantic/orangeCompact_space_semantic_tokens.dart +++ b/ouds_theme_orange_compact/lib/semantic/orangeCompact_space_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Orange Compact brand tokens version 2.3.0 +// Orange Compact brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_space_semantic_tokens.dart'; diff --git a/ouds_theme_orange_compact/pubspec.yaml b/ouds_theme_orange_compact/pubspec.yaml index 3615b354f..9e0e17978 100644 --- a/ouds_theme_orange_compact/pubspec.yaml +++ b/ouds_theme_orange_compact/pubspec.yaml @@ -1,8 +1,8 @@ name: ouds_theme_orange_compact description: 'Orange Compact theme implementation for OUDS, with branding-specific design tokens optimized for compact displays.' -version: 1.3.1 repository: https://github.com/Orange-OpenSource/ouds-flutter homepage: https://flutter.unified-design-system.orange.com +version: 2.0.0 environment: sdk: ^3.9.0 @@ -13,10 +13,16 @@ resolution: workspace dependencies: flutter: sdk: flutter - ouds_core: ^1.3.1 - ouds_theme_contract: ^1.3.1 - ouds_global_raw_tokens: ^1.3.1 - ouds_theme_orange: ^1.3.1 + + # Core + ouds_core: ^2.0.0 + # Theme contract + ouds_theme_contract: ^2.0.0 + # Global raw token + ouds_global_raw_tokens: ^2.0.0 + # Orange Theme + ouds_theme_orange: ^2.0.0 + dev_dependencies: flutter_test: sdk: flutter @@ -52,6 +58,7 @@ flutter: - assets/component/alert/ - assets/component/checkbox/ - assets/component/chip/ + - assets/component/badge-icon/ - assets/component/bullet-list/ - assets/component/button/ - assets/component/link/ diff --git a/ouds_theme_sosh/CHANGELOG.md b/ouds_theme_sosh/CHANGELOG.md index 4a9842932..7253cd434 100644 --- a/ouds_theme_sosh/CHANGELOG.md +++ b/ouds_theme_sosh/CHANGELOG.md @@ -4,20 +4,25 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop) +## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/2.0.0...develop) ### Added ### Changed ### Fixed -## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 +## [2.0.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...2.0.0) - 2026-06-19 ### Added ### Changed +- [Library] update tokens 2.5.0 ([#778](https://github.com/Orange-OpenSource/ouds-flutter/issues/778)) +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) ### Fixed +## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 + ## [1.3.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.2.0...1.3.0) - 2026-05-08 ### Added ### Changed +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) - [Library] update tokens 1.9.0 - Component Bullet List ([#710](https://github.com/Orange-OpenSource/ouds-flutter/issues/710)) - [Library] update tokens 1.9.0 - Component Alert ([#672](https://github.com/Orange-OpenSource/ouds-flutter/issues/672)) diff --git a/ouds_theme_sosh/README.md b/ouds_theme_sosh/README.md index 0c84d48df..5fb56842c 100644 --- a/ouds_theme_sosh/README.md +++ b/ouds_theme_sosh/README.md @@ -14,7 +14,7 @@ To use **Theme Sosh**, add it as a dependency in your `pubspec.yaml` file. ```yaml dependencies: - ouds_theme_sosh: ^1.3.1 + ouds_theme_sosh: ^2.0.0 ``` ## Other OUDS Libraries diff --git a/ouds_theme_sosh/assets/component/alert/error-fill.svg b/ouds_theme_sosh/assets/component/alert/error-fill.svg new file mode 100644 index 000000000..5e61521e6 --- /dev/null +++ b/ouds_theme_sosh/assets/component/alert/error-fill.svg @@ -0,0 +1,3 @@ + + + diff --git a/ouds_theme_sosh/assets/component/badge-icon/error-fill.svg b/ouds_theme_sosh/assets/component/badge-icon/error-fill.svg new file mode 100644 index 000000000..fae8276ce --- /dev/null +++ b/ouds_theme_sosh/assets/component/badge-icon/error-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_sosh/assets/component/badge-icon/info-fill.svg b/ouds_theme_sosh/assets/component/badge-icon/info-fill.svg new file mode 100644 index 000000000..5e9b6fa26 --- /dev/null +++ b/ouds_theme_sosh/assets/component/badge-icon/info-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_sosh/assets/component/badge-icon/tick-confirmation-fill.svg b/ouds_theme_sosh/assets/component/badge-icon/tick-confirmation-fill.svg new file mode 100644 index 000000000..183d19780 --- /dev/null +++ b/ouds_theme_sosh/assets/component/badge-icon/tick-confirmation-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_sosh/assets/component/badge-icon/warning-external-shape.svg b/ouds_theme_sosh/assets/component/badge-icon/warning-external-shape.svg new file mode 100644 index 000000000..bc5bf133f --- /dev/null +++ b/ouds_theme_sosh/assets/component/badge-icon/warning-external-shape.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_sosh/assets/component/badge-icon/warning-internal-shape.svg b/ouds_theme_sosh/assets/component/badge-icon/warning-internal-shape.svg new file mode 100644 index 000000000..869a5aaf5 --- /dev/null +++ b/ouds_theme_sosh/assets/component/badge-icon/warning-internal-shape.svg @@ -0,0 +1,3 @@ + + + diff --git a/ouds_theme_sosh/assets/component/button/expanded-false.svg b/ouds_theme_sosh/assets/component/button/expanded-false.svg index 70a7d60e6..c1f8e6f59 100644 --- a/ouds_theme_sosh/assets/component/button/expanded-false.svg +++ b/ouds_theme_sosh/assets/component/button/expanded-false.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_sosh/assets/component/button/expanded-true.svg b/ouds_theme_sosh/assets/component/button/expanded-true.svg index 4f937648f..1cd77fd13 100644 --- a/ouds_theme_sosh/assets/component/button/expanded-true.svg +++ b/ouds_theme_sosh/assets/component/button/expanded-true.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_sosh/assets/component/button/next.svg b/ouds_theme_sosh/assets/component/button/next.svg index 2ece54a75..cebf30cb8 100644 --- a/ouds_theme_sosh/assets/component/button/next.svg +++ b/ouds_theme_sosh/assets/component/button/next.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_sosh/assets/component/button/previous.svg b/ouds_theme_sosh/assets/component/button/previous.svg index 95e9973fc..e6c12cd75 100644 --- a/ouds_theme_sosh/assets/component/button/previous.svg +++ b/ouds_theme_sosh/assets/component/button/previous.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_sosh/assets/component/chip/expanded-false.svg b/ouds_theme_sosh/assets/component/chip/expanded-false.svg index 70a7d60e6..c1f8e6f59 100644 --- a/ouds_theme_sosh/assets/component/chip/expanded-false.svg +++ b/ouds_theme_sosh/assets/component/chip/expanded-false.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_sosh/assets/component/chip/expanded-true.svg b/ouds_theme_sosh/assets/component/chip/expanded-true.svg index 4f937648f..1cd77fd13 100644 --- a/ouds_theme_sosh/assets/component/chip/expanded-true.svg +++ b/ouds_theme_sosh/assets/component/chip/expanded-true.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_sosh/assets/component/link/expanded-false.svg b/ouds_theme_sosh/assets/component/link/expanded-false.svg index 70a7d60e6..c1f8e6f59 100644 --- a/ouds_theme_sosh/assets/component/link/expanded-false.svg +++ b/ouds_theme_sosh/assets/component/link/expanded-false.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_sosh/assets/component/link/expanded-true.svg b/ouds_theme_sosh/assets/component/link/expanded-true.svg index 4f937648f..1cd77fd13 100644 --- a/ouds_theme_sosh/assets/component/link/expanded-true.svg +++ b/ouds_theme_sosh/assets/component/link/expanded-true.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_sosh/assets/component/link/next.svg b/ouds_theme_sosh/assets/component/link/next.svg index 2ece54a75..24da7d38b 100644 --- a/ouds_theme_sosh/assets/component/link/next.svg +++ b/ouds_theme_sosh/assets/component/link/next.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_sosh/assets/component/link/previous.svg b/ouds_theme_sosh/assets/component/link/previous.svg index 95e9973fc..c8ba3e145 100644 --- a/ouds_theme_sosh/assets/component/link/previous.svg +++ b/ouds_theme_sosh/assets/component/link/previous.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_sosh/assets/functional/navigation/form-chevron-left.svg b/ouds_theme_sosh/assets/functional/navigation/form-chevron-left.svg index 2b059280e..e7a298623 100644 --- a/ouds_theme_sosh/assets/functional/navigation/form-chevron-left.svg +++ b/ouds_theme_sosh/assets/functional/navigation/form-chevron-left.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_sosh/lib/components/sosh_alert_tokens.dart b/ouds_theme_sosh/lib/components/sosh_alert_tokens.dart index 885c44938..be449dad3 100644 --- a/ouds_theme_sosh/lib/components/sosh_alert_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_alert_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_badge_tokens.dart b/ouds_theme_sosh/lib/components/sosh_badge_tokens.dart index b5d69f853..3b395e259 100644 --- a/ouds_theme_sosh/lib/components/sosh_badge_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_badge_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; @@ -31,7 +31,11 @@ class SoshBadgeTokens extends OudsBadgeTokens { @override double get sizeXsmall => DimensionRawTokens.dimension100; @override - double get spaceInset => DimensionRawTokens.dimensionOutOfSystem75; + double get spaceInsetMediumLarge => DimensionRawTokens.dimensionOutOfSystem75; + @override + double get spaceInsetSmall => DimensionRawTokens.dimensionOutOfSystem50; + @override + double get spaceInsetXsmall => DimensionRawTokens.dimensionOutOfSystem25; @override double get spacePaddingInlineLarge => providersTokens.spaceTokens.paddingInline2xsmall; @override diff --git a/ouds_theme_sosh/lib/components/sosh_bar_tokens.dart b/ouds_theme_sosh/lib/components/sosh_bar_tokens.dart index f8b82d73e..1b7ec89d0 100644 --- a/ouds_theme_sosh/lib/components/sosh_bar_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_bar_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -19,6 +19,7 @@ import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; import 'package:ouds_global_raw_tokens/effect_raw_tokens.dart'; import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; import 'package:ouds_theme_contract/theme/tokens/components/ouds_bar_tokens.dart'; +import 'package:ouds_theme_sosh/raw/sosh_color_raw_tokens.dart'; class SoshBarTokens extends OudsBarTokens { final OudsProvidersTokens providersTokens; @@ -26,71 +27,71 @@ class SoshBarTokens extends OudsBarTokens { SoshBarTokens(this.providersTokens); @override - double get borderRadiusActiveIndicatorCustomBottom => providersTokens.borderTokens.radiusPill; + double get borderRadiusCurrentIndicatorCustomBottom => providersTokens.borderTokens.radiusPill; @override - double get borderRadiusActiveIndicatorCustomTop => providersTokens.borderTokens.radiusDefault; + double get borderRadiusCurrentIndicatorCustomTop => providersTokens.borderTokens.radiusDefault; @override - Color get colorActiveIndicatorAndroidSelectedDisabled => providersTokens.colorScheme.opacityTransparent; + Color get colorBgOpaque => providersTokens.colorScheme.bgSecondary; @override - Color get colorActiveIndicatorAndroidSelectedEnabled => providersTokens.colorScheme.opacityTransparent; + Color get colorBgTranslucentDark => SoshColorRawTokens.colorOpacityLochmaraDark960800; @override - Color get colorActiveIndicatorAndroidSelectedFocus => providersTokens.colorScheme.opacityTransparent; + Color get colorBgTranslucentLight => ColorRawTokens.colorOpacityWhite800; @override - Color get colorActiveIndicatorAndroidSelectedHover => providersTokens.colorScheme.opacityTransparent; + Color get colorBorderBadge => providersTokens.colorScheme.bgSecondary; @override - Color get colorActiveIndicatorAndroidSelectedPressed => providersTokens.colorScheme.opacityTransparent; + Color get colorContentOnIosAccent => providersTokens.colorScheme.contentOnActionSelected; @override - Color get colorActiveIndicatorAndroidUnselectedDisabled => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedEnabled => providersTokens.colorScheme.actionSelected; @override - Color get colorActiveIndicatorAndroidUnselectedFocus => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedFocus => providersTokens.colorScheme.actionFocus; @override - Color get colorActiveIndicatorAndroidUnselectedHover => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedHover => providersTokens.colorScheme.actionHover; @override - Color get colorActiveIndicatorAndroidUnselectedPressed => providersTokens.colorScheme.opacityTransparent; + Color get colorContentSelectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorActiveIndicatorCustomSelectedEnabled => providersTokens.colorScheme.actionSelected; + Color get colorContentUnselectedEnabled => providersTokens.colorScheme.contentMuted; @override - Color get colorActiveIndicatorCustomSelectedFocus => providersTokens.colorScheme.actionFocus; + Color get colorContentUnselectedFocus => providersTokens.colorScheme.contentDefault; @override - Color get colorActiveIndicatorCustomSelectedHover => providersTokens.colorScheme.actionHover; + Color get colorContentUnselectedHover => providersTokens.colorScheme.contentDefault; @override - Color get colorActiveIndicatorCustomSelectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorContentUnselectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorBgOpaque => providersTokens.colorScheme.bgSecondary; + Color get colorCurrentIndicatorAndroidSelectedDisabled => providersTokens.colorScheme.opacityTransparent; @override - Color get colorBgTranslucentDark => ColorRawTokens.colorOpacityGrayDark800800; + Color get colorCurrentIndicatorAndroidSelectedEnabled => providersTokens.colorScheme.opacityTransparent; @override - Color get colorBgTranslucentLight => ColorRawTokens.colorOpacityGrayLight80800; + Color get colorCurrentIndicatorAndroidSelectedFocus => providersTokens.colorScheme.opacityTransparent; @override - Color get colorBorderBadge => providersTokens.colorScheme.bgSecondary; + Color get colorCurrentIndicatorAndroidSelectedHover => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentOnIosAccent => providersTokens.colorScheme.contentOnActionSelected; + Color get colorCurrentIndicatorAndroidSelectedPressed => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedEnabled => providersTokens.colorScheme.actionSelected; + Color get colorCurrentIndicatorAndroidUnselectedDisabled => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedFocus => providersTokens.colorScheme.actionFocus; + Color get colorCurrentIndicatorAndroidUnselectedFocus => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedHover => providersTokens.colorScheme.actionHover; + Color get colorCurrentIndicatorAndroidUnselectedHover => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentSelectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorCurrentIndicatorAndroidUnselectedPressed => providersTokens.colorScheme.opacityTransparent; @override - Color get colorContentUnselectedEnabledDark => ColorRawTokens.colorOpacityWhite600; + Color get colorCurrentIndicatorCustomSelectedEnabled => providersTokens.colorScheme.actionSelected; @override - Color get colorContentUnselectedEnabledLight => ColorRawTokens.colorOpacityBlack600; + Color get colorCurrentIndicatorCustomSelectedFocus => providersTokens.colorScheme.actionFocus; @override - Color get colorContentUnselectedFocus => providersTokens.colorScheme.contentDefault; + Color get colorCurrentIndicatorCustomSelectedHover => providersTokens.colorScheme.actionHover; @override - Color get colorContentUnselectedHover => providersTokens.colorScheme.contentDefault; + Color get colorCurrentIndicatorCustomSelectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorContentUnselectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorIosAccent => providersTokens.colorScheme.actionSelected; @override - int get effectBgBlur => EffectRawTokens.effectBlur160; + int get effectBgBlur => EffectRawTokens.effectBlur320; @override - double get opacityActiveIndicatorCustom => providersTokens.opacityTokens.opaque; + double get opacityCurrentIndicatorCustom => providersTokens.opacityTokens.opaque; @override - double get sizeHeightActiveIndicatorCustom => DimensionRawTokens.dimensionOutOfSystem75; + double get sizeHeightCurrentIndicatorCustom => DimensionRawTokens.dimensionOutOfSystem75; @override - double get sizeWidthActiveIndicatorCustomBottom => DimensionRawTokens.dimension300; + double get sizeWidthCurrentIndicatorCustomBottom => DimensionRawTokens.dimension300; @override - double get sizeWidthActiveIndicatorCustomTop => DimensionRawTokens.dimension650; + double get sizeWidthCurrentIndicatorCustomTop => DimensionRawTokens.dimension500; } diff --git a/ouds_theme_sosh/lib/components/sosh_bulletList_tokens.dart b/ouds_theme_sosh/lib/components/sosh_bulletList_tokens.dart index 1cae52c39..298c41965 100644 --- a/ouds_theme_sosh/lib/components/sosh_bulletList_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_bulletList_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_buttonMono_tokens.dart b/ouds_theme_sosh/lib/components/sosh_buttonMono_tokens.dart index 4dc75f158..696ca1661 100644 --- a/ouds_theme_sosh/lib/components/sosh_buttonMono_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_buttonMono_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_button_tokens.dart b/ouds_theme_sosh/lib/components/sosh_button_tokens.dart index e619623ac..df457c5e8 100644 --- a/ouds_theme_sosh/lib/components/sosh_button_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_button_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_checkbox_tokens.dart b/ouds_theme_sosh/lib/components/sosh_checkbox_tokens.dart index 6ae929b1f..445491a78 100644 --- a/ouds_theme_sosh/lib/components/sosh_checkbox_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_checkbox_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; @@ -39,6 +39,7 @@ class SoshCheckboxTokens extends OudsCheckboxTokens { double get borderWidthUnselectedHover => providersTokens.borderTokens.widthMedium; @override double get borderWidthUnselectedPressed => providersTokens.borderTokens.widthMedium; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; @override diff --git a/ouds_theme_sosh/lib/components/sosh_chip_tokens.dart b/ouds_theme_sosh/lib/components/sosh_chip_tokens.dart index 2a388462f..0994ba861 100644 --- a/ouds_theme_sosh/lib/components/sosh_chip_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_chip_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_controlItem_tokens.dart b/ouds_theme_sosh/lib/components/sosh_controlItem_tokens.dart index 2ffb8dc1e..7fedfffcd 100644 --- a/ouds_theme_sosh/lib/components/sosh_controlItem_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_controlItem_tokens.dart @@ -10,11 +10,12 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; +import 'package:ouds_global_raw_tokens/font_raw_tokens.dart'; import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; import 'package:ouds_theme_contract/theme/tokens/components/ouds_controlItem_tokens.dart'; @@ -24,41 +25,131 @@ class SoshControlItemTokens extends OudsControlItemTokens { SoshControlItemTokens(this.providersTokens); @override - double get borderRadius => providersTokens.borderTokens.radiusNone; + double get borderRadiusCurrentIndicator => providersTokens.borderTokens.radiusDefault; + @override + double get borderRadiusDefault => providersTokens.borderTokens.radiusDefault; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get borderRadiusItemOnly => providersTokens.borderTokens.radiusDefault; @override + double get borderRadiusMedia => providersTokens.borderTokens.radiusDefault; + @override + double get borderRadiusMediaRoundedCorner => providersTokens.borderTokens.radiusDefault; + @override + double get borderRadiusRounded => providersTokens.borderTokens.radiusDefault; + @override + double get borderWidthCurrentPage => providersTokens.borderTokens.widthMedium; + @override + double get borderWidthDefault => providersTokens.borderTokens.widthDefault; + @override + Color get colorBadgeSafetyArea => providersTokens.colorScheme.bgPrimary; + @override + Color get colorBgCurrentDisabled => providersTokens.colorScheme.actionSupportDisabled; + @override + Color get colorBgCurrentEnabled => providersTokens.colorScheme.actionSupportEnabled; + @override + Color get colorBgCurrentFocus => providersTokens.colorScheme.actionSupportFocus; + @override + Color get colorBgCurrentHover => providersTokens.colorScheme.actionSupportHover; + @override + Color get colorBgCurrentPressed => providersTokens.colorScheme.actionSupportPressed; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override Color get colorBgFocus => providersTokens.colorScheme.actionSupportFocus; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgHover => providersTokens.colorScheme.actionSupportHover; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgLoading => providersTokens.colorScheme.actionSupportLoading; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgPressed => providersTokens.colorScheme.actionSupportPressed; @override + Color get colorContentCurrentDisabled => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentEnabled => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentFocus => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentHover => providersTokens.colorScheme.contentDefault; + @override + Color get colorContentCurrentPressed => providersTokens.colorScheme.contentDefault; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override Color get colorContentLoader => providersTokens.colorScheme.contentDefault; @override + double get fontLetterSpacingAvatarInitialXlarge => FontRawTokens.fontLetterSpacing450; + @override + double get fontLineHeightAvatarInitialXlarge => FontRawTokens.fontLineHeight650; + @override + double get fontSizeAvatarInitialXlarge => FontRawTokens.fontSize450; + @override + double get opacityCurrentDivider => providersTokens.opacityTokens.opaque; + @override + double get opacityCurrentIndicator => providersTokens.opacityTokens.opaque; + @override + double get sizeAssetLarge => DimensionRawTokens.dimension500; + @override + double get sizeAssetMedium => providersTokens.sizeTokens.iconWithLabelLargeSizeMedium; + @override + double get sizeAssetSmall => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; + @override + double get sizeAssetXlarge => DimensionRawTokens.dimension700; + @override + double get sizeControlIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; + @override + double get sizeCurrentIndicatorWidth => DimensionRawTokens.dimension50; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get sizeErrorIcon => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; @override + double get sizeFlagHeight => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get sizeIcon => providersTokens.sizeTokens.iconWithLabelLargeSizeMedium; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeLoader => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeMaxHeightAssetsContainer => DimensionRawTokens.dimension1200; @override double get sizeMaxWidth => DimensionRawTokens.dimension4000; @override - double get sizeMinHeight => DimensionRawTokens.dimension650; + double get sizeMinHeightCompact => providersTokens.sizeTokens.minInteractiveArea; + @override + double get sizeMinHeightDefault => DimensionRawTokens.dimension750; @override double get sizeMinWidth => DimensionRawTokens.dimension2000; @override double get spaceColumnGap => providersTokens.spaceTokens.columnGapMedium; @override + double get spacePaddingBlockBottomSlot => providersTokens.spaceTokens.paddingBlock3xsmall; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get spacePaddingBlockDefault => providersTokens.spaceTokens.paddingBlockMedium; @override - double get spacePaddingBlockTopErrorText => providersTokens.spaceTokens.paddingBlockXsmall; + double get spacePaddingBlockDensityCompact => providersTokens.spaceTokens.paddingBlockXsmall; + @override + double get spacePaddingBlockDensityCompactBottomExpandContainer => providersTokens.spaceTokens.paddingBlock2xlarge; + @override + double get spacePaddingBlockDensityCompactTopAlignmentTopCounterweight => providersTokens.spaceTokens.paddingBlockXsmall; + @override + double get spacePaddingBlockDensityCompactTopAlignmentTopTextContainer => providersTokens.spaceTokens.paddingBlockNone; + @override + double get spacePaddingBlockDensityDefault => providersTokens.spaceTokens.paddingBlockMedium; + @override + double get spacePaddingBlockDensityDefaultBottomExpandContainer => providersTokens.spaceTokens.paddingBlock3xlarge; + @override + double get spacePaddingBlockDensityDefaultTopAlignmentTopCounterweight => providersTokens.spaceTokens.paddingBlockSmall; + @override + double get spacePaddingBlockDensityDefaultTopAlignmentTopTextContainer => providersTokens.spaceTokens.paddingBlock4xsmall; + @override + double get spacePaddingBlockTopHelperText => providersTokens.spaceTokens.paddingBlockXsmall; @override double get spacePaddingInline => providersTokens.spaceTokens.paddingInlineLarge; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get spacePaddingInlineErrorIcon => providersTokens.spaceTokens.paddingInline4xsmall; @override diff --git a/ouds_theme_sosh/lib/components/sosh_divider_tokens.dart b/ouds_theme_sosh/lib/components/sosh_divider_tokens.dart index 3276a956f..3888bd7a4 100644 --- a/ouds_theme_sosh/lib/components/sosh_divider_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_divider_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_icon_tokens.dart b/ouds_theme_sosh/lib/components/sosh_icon_tokens.dart index eeb60d585..14eaf9eb0 100644 --- a/ouds_theme_sosh/lib/components/sosh_icon_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_icon_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -22,10 +22,12 @@ class SoshIconTokens extends OudsIconTokens { SoshIconTokens(this.providersTokens); - @override - Color get colorContentDefault => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryNeutralEmphasizedBlack, providersTokens.colorScheme.repositoryNeutralMutedLower); @override Color get colorContentStatusWarningExternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningMedium, providersTokens.colorScheme.repositoryWarningLow); @override Color get colorContentStatusWarningInternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningHigh, providersTokens.colorScheme.opacityTransparent); + @override + Color get colorContentStatusWarningInverseExternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningLow, providersTokens.colorScheme.repositoryWarningMedium); + @override + Color get colorContentStatusWarningInverseInternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.opacityTransparent, providersTokens.colorScheme.repositoryWarningHigh); } diff --git a/ouds_theme_sosh/lib/components/sosh_inputTag_tokens.dart b/ouds_theme_sosh/lib/components/sosh_inputTag_tokens.dart index 2008b937c..a2bd89612 100644 --- a/ouds_theme_sosh/lib/components/sosh_inputTag_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_inputTag_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_linkMono_tokens.dart b/ouds_theme_sosh/lib/components/sosh_linkMono_tokens.dart index aad32e420..dab480c01 100644 --- a/ouds_theme_sosh/lib/components/sosh_linkMono_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_linkMono_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_link_tokens.dart b/ouds_theme_sosh/lib/components/sosh_link_tokens.dart index 77314f286..07a4e5952 100644 --- a/ouds_theme_sosh/lib/components/sosh_link_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_link_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_pinCodeInput_tokens.dart b/ouds_theme_sosh/lib/components/sosh_pinCodeInput_tokens.dart index 33ce5ac3b..41f98fdd3 100644 --- a/ouds_theme_sosh/lib/components/sosh_pinCodeInput_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_pinCodeInput_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_radioButton_tokens.dart b/ouds_theme_sosh/lib/components/sosh_radioButton_tokens.dart index 8b9c88c03..3ad21f276 100644 --- a/ouds_theme_sosh/lib/components/sosh_radioButton_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_radioButton_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; @@ -40,8 +40,6 @@ class SoshRadioButtonTokens extends OudsRadioButtonTokens { @override double get borderWidthUnselectedPressed => providersTokens.borderTokens.widthMedium; @override - double get sizeIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; - @override double get sizeMaxHeight => providersTokens.sizeTokens.minInteractiveArea; @override double get sizeMinHeight => providersTokens.sizeTokens.minInteractiveArea; diff --git a/ouds_theme_sosh/lib/components/sosh_skeleton_tokens.dart b/ouds_theme_sosh/lib/components/sosh_skeleton_tokens.dart index 710b68994..9984a305b 100644 --- a/ouds_theme_sosh/lib/components/sosh_skeleton_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_skeleton_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_switch_tokens.dart b/ouds_theme_sosh/lib/components/sosh_switch_tokens.dart index 641b90b12..efe03167c 100644 --- a/ouds_theme_sosh/lib/components/sosh_switch_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_switch_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_sosh/lib/components/sosh_tag_tokens.dart b/ouds_theme_sosh/lib/components/sosh_tag_tokens.dart index c6fafee8d..aec879c77 100644 --- a/ouds_theme_sosh/lib/components/sosh_tag_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_tag_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; @@ -35,9 +35,9 @@ class SoshTagTokens extends OudsTagTokens { @override double get sizeMinHeightSmall => DimensionRawTokens.dimension300; @override - double get sizeMinWidthDefault => DimensionRawTokens.dimension600; + double get sizeMinWidthDefault => DimensionRawTokens.dimension400; @override - double get sizeMinWidthSmall => DimensionRawTokens.dimension550; + double get sizeMinWidthSmall => DimensionRawTokens.dimension300; @override double get spaceColumnGapDefault => providersTokens.spaceTokens.columnGap2xsmall; @override diff --git a/ouds_theme_sosh/lib/components/sosh_textInput_tokens.dart b/ouds_theme_sosh/lib/components/sosh_textInput_tokens.dart index dddf53743..dc18ac4f2 100644 --- a/ouds_theme_sosh/lib/components/sosh_textInput_tokens.dart +++ b/ouds_theme_sosh/lib/components/sosh_textInput_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -28,7 +28,7 @@ class SoshTextInputTokens extends OudsTextInputTokens { @override double get borderRadiusRounded => providersTokens.borderTokens.radiusDefault; @override - double get borderWidthDefault => providersTokens.borderTokens.widthThin; + double get borderWidthDefault => providersTokens.borderTokens.widthDefault; @override double get borderWidthFocus => providersTokens.borderTokens.widthMedium; @override @@ -58,6 +58,10 @@ class SoshTextInputTokens extends OudsTextInputTokens { @override double get spaceColumnGapInlineText => providersTokens.spaceTokens.columnGapXsmall; @override + double get spaceColumnGapLabelAsterisk => providersTokens.spaceTokens.columnGap2xsmall; + @override + double get spaceColumnGapLabelSmallAsterisk => DimensionRawTokens.dimensionOutOfSystem75; + @override double get spaceColumnGapTrailingErrorAction => providersTokens.spaceTokens.columnGapXsmall; @override double get spacePaddingBlockDefault => providersTokens.spaceTokens.paddingBlock2xsmall; diff --git a/ouds_theme_sosh/lib/material/sosh_material_color_tokens.dart b/ouds_theme_sosh/lib/material/sosh_material_color_tokens.dart index ca4ac5f27..9a884db76 100644 --- a/ouds_theme_sosh/lib/material/sosh_material_color_tokens.dart +++ b/ouds_theme_sosh/lib/material/sosh_material_color_tokens.dart @@ -13,14 +13,16 @@ // Android system tokens version 1.2.0 // Generated by Tokenator +import 'package:flutter/material.dart'; import 'package:ouds_theme_contract/theme/tokens/material/ouds_material_color_tokens.dart'; import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; +import 'package:ouds_theme_sosh/raw/sosh_color_raw_tokens.dart'; class SoshMaterialColorTokens extends OudsMaterialColorTokens { const SoshMaterialColorTokens({ - super.backgroundDark = ColorRawTokens.colorFunctionalGrayDark880, + super.backgroundDark = SoshColorRawTokens.colorFunctionalGrayDark880, super.backgroundLight = ColorRawTokens.colorFunctionalWhite, - super.errorContainerDark = ColorRawTokens.colorFunctionalScarlet900, + super.errorContainerDark = const Color(0x00ff0000), super.errorContainerLight = ColorRawTokens.colorFunctionalScarlet100, super.errorDark = ColorRawTokens.colorFunctionalScarlet300, super.errorLight = ColorRawTokens.colorFunctionalScarlet600, @@ -28,11 +30,11 @@ class SoshMaterialColorTokens extends OudsMaterialColorTokens { super.inverseOnSurfaceLight = ColorRawTokens.colorFunctionalWhite, super.inversePrimaryDark = ColorRawTokens.colorFunctionalBlack, super.inversePrimaryLight = ColorRawTokens.colorFunctionalWhite, - super.inverseSurfaceDark = ColorRawTokens.colorFunctionalGrayLight160, - super.inverseSurfaceLight = ColorRawTokens.colorFunctionalGrayDark720, - super.onBackgroundDark = ColorRawTokens.colorFunctionalGrayLight160, + super.inverseSurfaceDark = SoshColorRawTokens.colorFunctionalGrayLight160, + super.inverseSurfaceLight = SoshColorRawTokens.colorFunctionalGrayDark720, + super.onBackgroundDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.onBackgroundLight = ColorRawTokens.colorFunctionalBlack, - super.onErrorContainerDark = ColorRawTokens.colorFunctionalGrayLight160, + super.onErrorContainerDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.onErrorContainerLight = ColorRawTokens.colorFunctionalBlack, super.onErrorDark = ColorRawTokens.colorFunctionalBlack, super.onErrorLight = ColorRawTokens.colorFunctionalWhite, @@ -41,36 +43,36 @@ class SoshMaterialColorTokens extends OudsMaterialColorTokens { super.onPrimaryDark = ColorRawTokens.colorFunctionalBlack, super.onPrimaryFixedDark = ColorRawTokens.colorFunctionalWhite, super.onPrimaryFixedLight = ColorRawTokens.colorFunctionalWhite, - super.onPrimaryFixedVariantDark = ColorRawTokens.colorOpacityWhite640, - super.onPrimaryFixedVariantLight = ColorRawTokens.colorOpacityWhite640, - super.onPrimaryLight = ColorRawTokens.colorFunctionalGrayLight160, - super.onSecondaryContainerDark = ColorRawTokens.colorFunctionalGrayLight160, + super.onPrimaryFixedVariantDark = SoshColorRawTokens.colorOpacityWhite640, + super.onPrimaryFixedVariantLight = SoshColorRawTokens.colorOpacityWhite640, + super.onPrimaryLight = SoshColorRawTokens.colorFunctionalGrayLight160, + super.onSecondaryContainerDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.onSecondaryContainerLight = ColorRawTokens.colorFunctionalBlack, super.onSecondaryDark = ColorRawTokens.colorFunctionalBlack, super.onSecondaryFixedDark = ColorRawTokens.colorFunctionalWhite, super.onSecondaryFixedLight = ColorRawTokens.colorFunctionalWhite, - super.onSecondaryFixedVariantDark = ColorRawTokens.colorOpacityWhite640, - super.onSecondaryFixedVariantLight = ColorRawTokens.colorOpacityWhite640, - super.onSecondaryLight = ColorRawTokens.colorFunctionalGrayLight160, - super.onSurfaceDark = ColorRawTokens.colorFunctionalGrayLight160, + super.onSecondaryFixedVariantDark = SoshColorRawTokens.colorOpacityWhite640, + super.onSecondaryFixedVariantLight = SoshColorRawTokens.colorOpacityWhite640, + super.onSecondaryLight = SoshColorRawTokens.colorFunctionalGrayLight160, + super.onSurfaceDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.onSurfaceLight = ColorRawTokens.colorFunctionalBlack, - super.onSurfaceVariantDark = ColorRawTokens.colorOpacityWhite640, - super.onSurfaceVariantLight = ColorRawTokens.colorOpacityBlack680, - super.onTertiaryContainerDark = ColorRawTokens.colorFunctionalGrayLight160, + super.onSurfaceVariantDark = SoshColorRawTokens.colorOpacityWhite640, + super.onSurfaceVariantLight = SoshColorRawTokens.colorOpacityBlack720, + super.onTertiaryContainerDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.onTertiaryContainerLight = ColorRawTokens.colorFunctionalBlack, - super.onTertiaryDark = ColorRawTokens.colorFunctionalGrayLight160, + super.onTertiaryDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.onTertiaryFixedDark = ColorRawTokens.colorFunctionalBlack, super.onTertiaryFixedLight = ColorRawTokens.colorFunctionalBlack, - super.onTertiaryFixedVariantDark = ColorRawTokens.colorOpacityBlack680, - super.onTertiaryFixedVariantLight = ColorRawTokens.colorOpacityBlack680, + super.onTertiaryFixedVariantDark = SoshColorRawTokens.colorOpacityBlack720, + super.onTertiaryFixedVariantLight = SoshColorRawTokens.colorOpacityBlack720, super.onTertiaryLight = ColorRawTokens.colorFunctionalBlack, - super.outlineDark = ColorRawTokens.colorFunctionalGrayLight160, + super.outlineDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.outlineLight = ColorRawTokens.colorFunctionalBlack, - super.outlineVariantDark = ColorRawTokens.colorOpacityWhite200, - super.outlineVariantLight = ColorRawTokens.colorOpacityBlack200, - super.primaryContainerDark = ColorRawTokens.colorFunctionalGrayLight160, + super.outlineVariantDark = SoshColorRawTokens.colorOpacityWhite200, + super.outlineVariantLight = SoshColorRawTokens.colorOpacityBlack200, + super.primaryContainerDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.primaryContainerLight = ColorRawTokens.colorFunctionalBlack, - super.primaryDark = ColorRawTokens.colorFunctionalGrayLight160, + super.primaryDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.primaryFixedDark = ColorRawTokens.colorFunctionalBlack, super.primaryFixedDimDark = ColorRawTokens.colorFunctionalBlack, super.primaryFixedDimLight = ColorRawTokens.colorFunctionalBlack, @@ -78,40 +80,40 @@ class SoshMaterialColorTokens extends OudsMaterialColorTokens { super.primaryLight = ColorRawTokens.colorFunctionalBlack, super.scrimDark = ColorRawTokens.colorFunctionalBlack, super.scrimLight = ColorRawTokens.colorFunctionalBlack, - super.secondaryContainerDark = ColorRawTokens.colorOpacityWhite80, - super.secondaryContainerLight = ColorRawTokens.colorOpacityBlack40, - super.secondaryDark = ColorRawTokens.colorFunctionalGrayLight160, + super.secondaryContainerDark = SoshColorRawTokens.colorOpacityWhite80, + super.secondaryContainerLight = SoshColorRawTokens.colorOpacityBlack40, + super.secondaryDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.secondaryFixedDark = ColorRawTokens.colorFunctionalBlack, super.secondaryFixedDimDark = ColorRawTokens.colorFunctionalBlack, super.secondaryFixedDimLight = ColorRawTokens.colorFunctionalBlack, super.secondaryFixedLight = ColorRawTokens.colorFunctionalBlack, super.secondaryLight = ColorRawTokens.colorFunctionalBlack, - super.surfaceBrightDark = ColorRawTokens.colorFunctionalGrayDark640, + super.surfaceBrightDark = SoshColorRawTokens.colorFunctionalGrayDark640, super.surfaceBrightLight = ColorRawTokens.colorFunctionalWhite, - super.surfaceDark = ColorRawTokens.colorFunctionalGrayDark880, + super.surfaceDark = SoshColorRawTokens.colorFunctionalGrayDark880, super.surfaceDimDark = ColorRawTokens.colorFunctionalBlack, - super.surfaceDimLight = ColorRawTokens.colorFunctionalGrayLight80, + super.surfaceDimLight = SoshColorRawTokens.colorFunctionalGrayLight80, super.surfaceLight = ColorRawTokens.colorFunctionalWhite, - super.surfaceTintDark = ColorRawTokens.colorFunctionalGrayDark720, - super.surfaceTintLight = ColorRawTokens.colorFunctionalGrayLight80, - super.surfaceVariantDark = ColorRawTokens.colorFunctionalGrayDark720, - super.surfaceVariantLight = ColorRawTokens.colorFunctionalGrayLight80, - super.surfContainerDark = ColorRawTokens.colorFunctionalGrayDark720, - super.surfContainerHighDark = ColorRawTokens.colorFunctionalGrayDark720, - super.surfContainerHighestDark = ColorRawTokens.colorFunctionalGrayDark720, - super.surfContainerHighestLight = ColorRawTokens.colorFunctionalGrayLight80, - super.surfContainerHighLight = ColorRawTokens.colorFunctionalGrayLight80, - super.surfContainerLight = ColorRawTokens.colorFunctionalGrayLight80, - super.surfContainerLowDark = ColorRawTokens.colorFunctionalGrayDark720, - super.surfContainerLowestDark = ColorRawTokens.colorFunctionalGrayDark720, + super.surfaceTintDark = SoshColorRawTokens.colorFunctionalGrayDark720, + super.surfaceTintLight = SoshColorRawTokens.colorFunctionalGrayLight80, + super.surfaceVariantDark = SoshColorRawTokens.colorFunctionalGrayDark720, + super.surfaceVariantLight = SoshColorRawTokens.colorFunctionalGrayLight80, + super.surfContainerDark = SoshColorRawTokens.colorFunctionalGrayDark720, + super.surfContainerHighDark = SoshColorRawTokens.colorFunctionalGrayDark720, + super.surfContainerHighestDark = SoshColorRawTokens.colorFunctionalGrayDark720, + super.surfContainerHighestLight = SoshColorRawTokens.colorFunctionalGrayLight80, + super.surfContainerHighLight = SoshColorRawTokens.colorFunctionalGrayLight80, + super.surfContainerLight = SoshColorRawTokens.colorFunctionalGrayLight80, + super.surfContainerLowDark = SoshColorRawTokens.colorFunctionalGrayDark720, + super.surfContainerLowestDark = SoshColorRawTokens.colorFunctionalGrayDark720, super.surfContainerLowestLight = ColorRawTokens.colorFunctionalWhite, super.surfContainerLowLight = ColorRawTokens.colorFunctionalWhite, - super.tertiaryContainerDark = ColorRawTokens.colorFunctionalGrayDark880, + super.tertiaryContainerDark = SoshColorRawTokens.colorFunctionalGrayDark880, super.tertiaryContainerLight = ColorRawTokens.colorFunctionalWhite, - super.tertiaryDark = ColorRawTokens.colorFunctionalGrayDark880, + super.tertiaryDark = SoshColorRawTokens.colorFunctionalGrayDark880, super.tertiaryFixedDark = ColorRawTokens.colorFunctionalWhite, - super.tertiaryFixedDimDark = ColorRawTokens.colorFunctionalGrayLight80, - super.tertiaryFixedDimLight = ColorRawTokens.colorFunctionalGrayLight80, + super.tertiaryFixedDimDark = SoshColorRawTokens.colorFunctionalGrayLight80, + super.tertiaryFixedDimLight = SoshColorRawTokens.colorFunctionalGrayLight80, super.tertiaryFixedLight = ColorRawTokens.colorFunctionalWhite, super.tertiaryLight = ColorRawTokens.colorFunctionalWhite, }); diff --git a/ouds_theme_sosh/lib/raw/sosh_color_raw_tokens.dart b/ouds_theme_sosh/lib/raw/sosh_color_raw_tokens.dart index 2427986ec..b81903ee2 100644 --- a/ouds_theme_sosh/lib/raw/sosh_color_raw_tokens.dart +++ b/ouds_theme_sosh/lib/raw/sosh_color_raw_tokens.dart @@ -10,59 +10,139 @@ // Software description: Flutter library of reusable graphical components // -// Sosh core tokens version 1.2.0 +// Sosh core tokens version 1.4.0 // Generated by Tokenator import 'package:flutter/material.dart'; class SoshColorRawTokens { - static const colorBlueDuckDark80 = Color(0xff33b1c1); - static const colorBlueDuckDark160 = Color(0xff2fa3b1); - static const colorBlueDuckDark240 = Color(0xff2b94a1); - static const colorBlueDuckDark320 = Color(0xff26828e); - static const colorBlueDuckDark400 = Color(0xff247a85); - static const colorBlueDuckDark480 = Color(0xff1e6771); - static const colorBlueDuckDark560 = Color(0xff1a5961); - static const colorBlueDuckDark640 = Color(0xff154a51); - static const colorBlueDuckDark720 = Color(0xff113b40); - static const colorBlueDuckDark800 = Color(0xff0e2f34); - static const colorBlueDuckDark880 = Color(0xff0b2428); - static const colorBlueDuckDark960 = Color(0xff061618); - static const colorBlueDuckLight80 = Color(0xfff0f7fa); - static const colorBlueDuckLight160 = Color(0xffdff4f6); - static const colorBlueDuckLight240 = Color(0xffcfeef2); - static const colorBlueDuckLight320 = Color(0xffbfe8ee); - static const colorBlueDuckLight400 = Color(0xffaee3ea); - static const colorBlueDuckLight480 = Color(0xff9edde5); - static const colorBlueDuckLight560 = Color(0xff8ed8e1); - static const colorBlueDuckLight640 = Color(0xff7ed2dd); - static const colorBlueDuckLight720 = Color(0xff6eccd8); - static const colorBlueDuckLight800 = Color(0xff5ec7d4); - static const colorBlueDuckLight880 = Color(0xff4ec1d0); - static const colorBlueDuckLight960 = Color(0xff3ebbcc); - static const colorCitrine50 = Color(0xfff6f5ee); - static const colorCitrine100 = Color(0xfffff6cc); - static const colorCitrine200 = Color(0xffffec99); - static const colorCitrine300 = Color(0xffffe366); - static const colorCitrine400 = Color(0xffffd92e); - static const colorCitrine500 = Color(0xfffbcd00); - static const colorCitrine600 = Color(0xffc7a200); - static const colorCitrine700 = Color(0xff997d00); - static const colorCitrine800 = Color(0xff665300); - static const colorCitrine900 = Color(0xff332a00); - static const colorCitrine950 = Color(0xff241d00); - static const colorCitrine1000 = Color(0xff191500); - static const colorMagenta50 = Color(0xfffce9ee); - static const colorMagenta100 = Color(0xfff8d3dc); - static const colorMagenta200 = Color(0xfff2a6b9); - static const colorMagenta300 = Color(0xffeb7a96); - static const colorMagenta400 = Color(0xffe55277); - static const colorMagenta500 = Color(0xffd5204e); /** Test for support Figma */ - static const colorMagenta600 = Color(0xffb61b42); - static const colorMagenta700 = Color(0xff851430); - static const colorMagenta800 = Color(0xff590d20); - static const colorMagenta900 = Color(0xff2c0710); - static const colorMagenta950 = Color(0xff160308); - static const colorOpacityMagenta120 = Color(0x1fe55277); /** Test for support Figma */ - static const colorOpacityMagenta640 = Color(0xa3851430); /** Test for support Figma */ + static const colorFunctionalGrayDark80 = Color(0xff5e8097); + static const colorFunctionalGrayDark160 = Color(0xff56758a); + static const colorFunctionalGrayDark240 = Color(0xff4e6b7e); + static const colorFunctionalGrayDark320 = Color(0xff476071); + static const colorFunctionalGrayDark400 = Color(0xff3f5564); + static const colorFunctionalGrayDark480 = Color(0xff374b58); + static const colorFunctionalGrayDark560 = Color(0xff2f404b); + static const colorFunctionalGrayDark640 = Color(0xff27353f); + static const colorFunctionalGrayDark720 = Color(0xff1f2b32); + static const colorFunctionalGrayDark800 = Color(0xff182026); + static const colorFunctionalGrayDark880 = Color(0xff101519); + static const colorFunctionalGrayDark960 = Color(0xff080b0d); + static const colorFunctionalGrayLight80 = Color(0xfff7f9fa); + static const colorFunctionalGrayLight160 = Color(0xffe9eef1); + static const colorFunctionalGrayLight240 = Color(0xffd9e2e7); + static const colorFunctionalGrayLight320 = Color(0xffcdd8e0); + static const colorFunctionalGrayLight400 = Color(0xffc0ced8); + static const colorFunctionalGrayLight480 = Color(0xffb4c5d0); + static const colorFunctionalGrayLight560 = Color(0xffa7bbc8); + static const colorFunctionalGrayLight640 = Color(0xff9bb1c0); + static const colorFunctionalGrayLight720 = Color(0xff8ea7b8); + static const colorFunctionalGrayLight800 = Color(0xff819eb1); + static const colorFunctionalGrayLight880 = Color(0xff7594a9); + static const colorFunctionalGrayLight960 = Color(0xff688aa1); + static const colorLochmaraDark80 = Color(0xff0191f4); + static const colorLochmaraDark160 = Color(0xff0182da); + static const colorLochmaraDark240 = Color(0xff0173c1); + static const colorLochmaraDark320 = Color(0xff016ab2); + static const colorLochmaraDark400 = Color(0xff0161a2); + static const colorLochmaraDark480 = Color(0xff01558e); + static const colorLochmaraDark560 = Color(0xff01487a); + static const colorLochmaraDark640 = Color(0xff003c66); + static const colorLochmaraDark720 = Color(0xff003051); + static const colorLochmaraDark800 = Color(0xff002742); + static const colorLochmaraDark880 = Color(0xff002138); + static const colorLochmaraDark960 = Color(0xff001524); + static const colorLochmaraLight80 = Color(0xffedf6fd); + static const colorLochmaraLight160 = Color(0xffd6eeff); + static const colorLochmaraLight240 = Color(0xffc2e6ff); + static const colorLochmaraLight320 = Color(0xffaedeff); + static const colorLochmaraLight400 = Color(0xff99d5ff); + static const colorLochmaraLight480 = Color(0xff85cdfe); + static const colorLochmaraLight560 = Color(0xff71c5fe); + static const colorLochmaraLight640 = Color(0xff5dbcfe); + static const colorLochmaraLight720 = Color(0xff48b4fe); + static const colorLochmaraLight800 = Color(0xff34acfe); + static const colorLochmaraLight880 = Color(0xff20a3fe); + static const colorLochmaraLight960 = Color(0xff0b9bfe); + static const colorOpacityBlack0 = Color(0x00000f19); + static const colorOpacityBlack40 = Color(0x0a000f19); + static const colorOpacityBlack80 = Color(0x14000f19); + static const colorOpacityBlack120 = Color(0x1f000f19); + static const colorOpacityBlack160 = Color(0x29000f19); + static const colorOpacityBlack200 = Color(0x33000f19); + static const colorOpacityBlack240 = Color(0x3d000f19); + static const colorOpacityBlack280 = Color(0x47000f19); + static const colorOpacityBlack320 = Color(0x52000f19); + static const colorOpacityBlack360 = Color(0x5c000f19); + static const colorOpacityBlack400 = Color(0x66000f19); + static const colorOpacityBlack440 = Color(0x70000f19); + static const colorOpacityBlack480 = Color(0x7a000f19); + static const colorOpacityBlack520 = Color(0x85000f19); + static const colorOpacityBlack560 = Color(0x8f000f19); + static const colorOpacityBlack600 = Color(0x99000f19); + static const colorOpacityBlack640 = Color(0xa3000f19); + static const colorOpacityBlack680 = Color(0xad000f19); + static const colorOpacityBlack720 = Color(0xb8000f19); + static const colorOpacityBlack760 = Color(0xc2000f19); + static const colorOpacityBlack800 = Color(0xcc000f19); + static const colorOpacityBlack840 = Color(0xd6000f19); + static const colorOpacityBlack880 = Color(0xe0000f19); + static const colorOpacityBlack920 = Color(0xeb000f19); + static const colorOpacityBlack960 = Color(0xf5000f19); + static const colorOpacityLochmaraDark880520 = Color(0x8501558e); + static const colorOpacityLochmaraDark960800 = Color(0xcc001524); + static const colorOpacityLochmaraLight80080 = Color(0x1434acfe); + static const colorOpacityRaspberry100 = Color(0x1afc6999); /** Test for support Figma */ + static const colorOpacityRaspberry640 = Color(0xa3960333); /** Test for support Figma */ + static const colorOpacityTurbo160 = Color(0x29ffe500); /** Test for support Figma */ + static const colorOpacityTurbo480 = Color(0x7a665c00); /** Test for support Figma */ + static const colorOpacityWhite0 = Color(0x00edf6fc); + static const colorOpacityWhite40 = Color(0x0aedf6fc); + static const colorOpacityWhite80 = Color(0x14edf6fc); + static const colorOpacityWhite120 = Color(0x1fedf6fc); + static const colorOpacityWhite160 = Color(0x29edf6fc); + static const colorOpacityWhite200 = Color(0x33edf6fc); + static const colorOpacityWhite240 = Color(0x3dedf6fc); + static const colorOpacityWhite280 = Color(0x47edf6fc); + static const colorOpacityWhite320 = Color(0x52edf6fc); + static const colorOpacityWhite360 = Color(0x5cedf6fc); + static const colorOpacityWhite400 = Color(0x66edf6fc); + static const colorOpacityWhite440 = Color(0x70edf6fc); + static const colorOpacityWhite480 = Color(0x7aedf6fc); + static const colorOpacityWhite520 = Color(0x85edf6fc); + static const colorOpacityWhite560 = Color(0x8fedf6fc); + static const colorOpacityWhite600 = Color(0x99edf6fc); + static const colorOpacityWhite640 = Color(0xa3edf6fc); + static const colorOpacityWhite680 = Color(0xadedf6fc); + static const colorOpacityWhite720 = Color(0xb8edf6fc); + static const colorOpacityWhite760 = Color(0xc2edf6fc); + static const colorOpacityWhite800 = Color(0xccedf6fc); + static const colorOpacityWhite840 = Color(0xd6edf6fc); + static const colorOpacityWhite880 = Color(0xe0edf6fc); + static const colorOpacityWhite920 = Color(0xebedf6fc); + static const colorOpacityWhite960 = Color(0xf5edf6fc); + static const colorRaspberry50 = Color(0xffffe6ee); + static const colorRaspberry100 = Color(0xfffecddd); + static const colorRaspberry200 = Color(0xfffd9bbb); + static const colorRaspberry300 = Color(0xfffc6999); + static const colorRaspberry400 = Color(0xfffb226a); + static const colorRaspberry500 = Color(0xffde034b); + static const colorRaspberry600 = Color(0xffbf0341); + static const colorRaspberry700 = Color(0xff960333); + static const colorRaspberry800 = Color(0xff640222); + static const colorRaspberry900 = Color(0xff320111); + static const colorRaspberry950 = Color(0xff190009); + static const colorTurbo50 = Color(0xfffcfae8); + static const colorTurbo100 = Color(0xfffffacc); + static const colorTurbo200 = Color(0xfffff599); + static const colorTurbo300 = Color(0xffffef66); + static const colorTurbo400 = Color(0xffffea33); + static const colorTurbo500 = Color(0xffffe500); + static const colorTurbo600 = Color(0xffccb700); + static const colorTurbo700 = Color(0xff998900); + static const colorTurbo750 = Color(0xff7a6e00); + static const colorTurbo800 = Color(0xff665c00); + static const colorTurbo900 = Color(0xff332e00); + static const colorTurbo950 = Color(0xff221f02); + static const colorTurbo1000 = Color(0xff1a1700); } \ No newline at end of file diff --git a/ouds_theme_sosh/lib/semantic/sosh_border_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_border_semantic_tokens.dart index 6e46c1c7d..ca121f3cf 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_border_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_border_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_border_semantic_tokens.dart'; diff --git a/ouds_theme_sosh/lib/semantic/sosh_color_action_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_color_action_semantic_tokens.dart index 0df23d6f5..1e5d2f6d0 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_color_action_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_color_action_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_sosh/raw/sosh_color_raw_tokens.dart'; @@ -19,20 +19,18 @@ import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; class SoshColorActionSemanticTokens extends OudsColorActionSemanticTokens { const SoshColorActionSemanticTokens({ - super.actionDisabledDark = ColorRawTokens.colorOpacityWhite200, - super.actionDisabledLight = ColorRawTokens.colorOpacityBlack200, - super.actionEnabledDark = SoshColorRawTokens.colorBlueDuckLight800, - super.actionEnabledLight = SoshColorRawTokens.colorMagenta500, - super.actionFocusDark = ColorRawTokens.colorFunctionalGrayLight160, + super.actionDisabledDark = SoshColorRawTokens.colorOpacityWhite200, + super.actionDisabledLight = SoshColorRawTokens.colorOpacityBlack200, + super.actionEnabledDark = SoshColorRawTokens.colorLochmaraLight640, + super.actionEnabledLight = SoshColorRawTokens.colorRaspberry500, + super.actionFocusDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.actionFocusLight = ColorRawTokens.colorFunctionalBlack, - super.actionHighlightedDark = ColorRawTokens.colorFunctionalGrayLight160, - super.actionHighlightedLight = SoshColorRawTokens.colorBlueDuckDark400, - super.actionHoverDark = ColorRawTokens.colorFunctionalGrayLight160, + super.actionHighlightedDark = SoshColorRawTokens.colorFunctionalGrayLight160, + super.actionHighlightedLight = SoshColorRawTokens.colorLochmaraDark240, + super.actionHoverDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.actionHoverLight = ColorRawTokens.colorFunctionalBlack, - super.actionIosAccentDark = SoshColorRawTokens.colorBlueDuckLight800, - super.actionIosAccentLight = SoshColorRawTokens.colorMagenta500, - super.actionLoadingDark = SoshColorRawTokens.colorCitrine300, - super.actionLoadingLight = SoshColorRawTokens.colorBlueDuckDark400, + super.actionLoadingDark = SoshColorRawTokens.colorTurbo300, + super.actionLoadingLight = SoshColorRawTokens.colorLochmaraDark240, super.actionNegativeEnabledDark = ColorRawTokens.colorFunctionalScarlet300, super.actionNegativeEnabledLight = ColorRawTokens.colorFunctionalScarlet600, super.actionNegativeFocusDark = ColorRawTokens.colorFunctionalScarlet200, @@ -43,26 +41,26 @@ class SoshColorActionSemanticTokens extends OudsColorActionSemanticTokens { super.actionNegativeLoadingLight = ColorRawTokens.colorFunctionalScarlet800, super.actionNegativePressedDark = ColorRawTokens.colorFunctionalScarlet100, super.actionNegativePressedLight = ColorRawTokens.colorFunctionalScarlet800, - super.actionPressedDark = SoshColorRawTokens.colorCitrine300, - super.actionPressedLight = SoshColorRawTokens.colorBlueDuckDark400, - super.actionReadOnlyPrimaryDark = ColorRawTokens.colorFunctionalGrayLight160, + super.actionPressedDark = SoshColorRawTokens.colorTurbo300, + super.actionPressedLight = SoshColorRawTokens.colorLochmaraDark240, + super.actionReadOnlyPrimaryDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.actionReadOnlyPrimaryLight = ColorRawTokens.colorFunctionalBlack, - super.actionReadOnlySecondaryDark = ColorRawTokens.colorOpacityWhite200, - super.actionReadOnlySecondaryLight = ColorRawTokens.colorOpacityBlack200, - super.actionSelectedDark = SoshColorRawTokens.colorBlueDuckLight800, - super.actionSelectedLight = SoshColorRawTokens.colorMagenta500, - super.actionSupportDisabledDark = ColorRawTokens.colorOpacityWhite40, - super.actionSupportDisabledLight = ColorRawTokens.colorOpacityBlack40, - super.actionSupportEnabledDark = ColorRawTokens.colorOpacityWhite40, - super.actionSupportEnabledLight = ColorRawTokens.colorOpacityBlack40, - super.actionSupportFocusDark = ColorRawTokens.colorOpacityWhite80, - super.actionSupportFocusLight = ColorRawTokens.colorOpacityBlack80, - super.actionSupportHoverDark = ColorRawTokens.colorOpacityWhite80, - super.actionSupportHoverLight = ColorRawTokens.colorOpacityBlack80, - super.actionSupportLoadingDark = ColorRawTokens.colorOpacityWhite120, - super.actionSupportLoadingLight = ColorRawTokens.colorOpacityBlack120, - super.actionSupportPressedDark = ColorRawTokens.colorOpacityWhite120, - super.actionSupportPressedLight = ColorRawTokens.colorOpacityBlack120, + super.actionReadOnlySecondaryDark = SoshColorRawTokens.colorOpacityWhite200, + super.actionReadOnlySecondaryLight = SoshColorRawTokens.colorOpacityBlack200, + super.actionSelectedDark = SoshColorRawTokens.colorLochmaraLight640, + super.actionSelectedLight = SoshColorRawTokens.colorRaspberry500, + super.actionSupportDisabledDark = SoshColorRawTokens.colorOpacityWhite40, + super.actionSupportDisabledLight = SoshColorRawTokens.colorOpacityBlack40, + super.actionSupportEnabledDark = SoshColorRawTokens.colorOpacityWhite40, + super.actionSupportEnabledLight = SoshColorRawTokens.colorOpacityBlack40, + super.actionSupportFocusDark = SoshColorRawTokens.colorOpacityWhite80, + super.actionSupportFocusLight = SoshColorRawTokens.colorOpacityBlack80, + super.actionSupportHoverDark = SoshColorRawTokens.colorOpacityWhite80, + super.actionSupportHoverLight = SoshColorRawTokens.colorOpacityBlack80, + super.actionSupportLoadingDark = SoshColorRawTokens.colorOpacityWhite120, + super.actionSupportLoadingLight = SoshColorRawTokens.colorOpacityBlack120, + super.actionSupportPressedDark = SoshColorRawTokens.colorOpacityWhite120, + super.actionSupportPressedLight = SoshColorRawTokens.colorOpacityBlack120, super.actionVisitedDark = ColorRawTokens.colorFunctionalAmethyst400, super.actionVisitedLight = ColorRawTokens.colorFunctionalAmethyst600, }); diff --git a/ouds_theme_sosh/lib/semantic/sosh_color_always_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_color_always_semantic_tokens.dart index 17cee8fc3..ca21e60bd 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_color_always_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_color_always_semantic_tokens.dart @@ -10,16 +10,17 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator +import 'package:ouds_theme_sosh/raw/sosh_color_raw_tokens.dart'; import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_always_semantic_tokens.dart'; import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; class SoshColorAlwaysSemanticTokens extends OudsColorAlwaysSemanticTokens { const SoshColorAlwaysSemanticTokens({ super.alwaysBlack = ColorRawTokens.colorFunctionalBlack, - super.alwaysOnBlack = ColorRawTokens.colorFunctionalGrayLight160, + super.alwaysOnBlack = SoshColorRawTokens.colorFunctionalGrayLight160, super.alwaysOnWhite = ColorRawTokens.colorFunctionalBlack, super.alwaysWhite = ColorRawTokens.colorFunctionalWhite, }); diff --git a/ouds_theme_sosh/lib/semantic/sosh_color_bg_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_color_bg_semantic_tokens.dart index 77d4a22d1..67dc794b5 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_color_bg_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_color_bg_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_sosh/raw/sosh_color_raw_tokens.dart'; @@ -19,15 +19,15 @@ import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; class SoshColorBgSemanticTokens extends OudsColorBgSemanticTokens { const SoshColorBgSemanticTokens({ - super.bgInverseHighDark = ColorRawTokens.colorFunctionalGrayLight160, - super.bgInverseHighLight = SoshColorRawTokens.colorBlueDuckDark880, - super.bgInverseLowDark = SoshColorRawTokens.colorBlueDuckDark720, - super.bgInverseLowLight = SoshColorRawTokens.colorBlueDuckDark880, - super.bgPrimaryDark = SoshColorRawTokens.colorBlueDuckDark960, + super.bgInverseHighDark = SoshColorRawTokens.colorLochmaraLight80, + super.bgInverseHighLight = SoshColorRawTokens.colorLochmaraDark880, + super.bgInverseLowDark = SoshColorRawTokens.colorLochmaraDark720, + super.bgInverseLowLight = SoshColorRawTokens.colorLochmaraDark880, + super.bgPrimaryDark = SoshColorRawTokens.colorLochmaraDark960, super.bgPrimaryLight = ColorRawTokens.colorFunctionalWhite, - super.bgSecondaryDark = SoshColorRawTokens.colorBlueDuckDark880, - super.bgSecondaryLight = SoshColorRawTokens.colorBlueDuckLight80, - super.bgTertiaryDark = SoshColorRawTokens.colorCitrine950, - super.bgTertiaryLight = SoshColorRawTokens.colorCitrine50, + super.bgSecondaryDark = SoshColorRawTokens.colorLochmaraDark880, + super.bgSecondaryLight = SoshColorRawTokens.colorLochmaraLight80, + super.bgTertiaryDark = SoshColorRawTokens.colorTurbo950, + super.bgTertiaryLight = SoshColorRawTokens.colorTurbo50, }); } diff --git a/ouds_theme_sosh/lib/semantic/sosh_color_border_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_color_border_semantic_tokens.dart index 0851eea58..f6a3c6fe4 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_color_border_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_color_border_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_sosh/raw/sosh_color_raw_tokens.dart'; @@ -19,39 +19,39 @@ import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; class SoshColorBorderSemanticTokens extends OudsColorBorderSemanticTokens { const SoshColorBorderSemanticTokens({ - super.borderBrandPrimaryDark = SoshColorRawTokens.colorMagenta300, - super.borderBrandPrimaryLight = SoshColorRawTokens.colorMagenta500, - super.borderBrandSecondaryDark = SoshColorRawTokens.colorBlueDuckLight800, - super.borderBrandSecondaryLight = SoshColorRawTokens.colorBlueDuckDark400, - super.borderBrandTertiaryDark = SoshColorRawTokens.colorCitrine300, - super.borderBrandTertiaryLight = SoshColorRawTokens.colorCitrine500, - super.borderDefaultDark = ColorRawTokens.colorOpacityWhite200, - super.borderDefaultLight = ColorRawTokens.colorOpacityBlack200, - super.borderEmphasizedDark = ColorRawTokens.colorOpacityWhite920, + super.borderBrandPrimaryDark = SoshColorRawTokens.colorRaspberry300, + super.borderBrandPrimaryLight = SoshColorRawTokens.colorRaspberry500, + super.borderBrandSecondaryDark = SoshColorRawTokens.colorLochmaraLight640, + super.borderBrandSecondaryLight = SoshColorRawTokens.colorLochmaraDark240, + super.borderBrandTertiaryDark = SoshColorRawTokens.colorTurbo300, + super.borderBrandTertiaryLight = SoshColorRawTokens.colorTurbo500, + super.borderDefaultDark = SoshColorRawTokens.colorOpacityWhite200, + super.borderDefaultLight = SoshColorRawTokens.colorOpacityBlack200, + super.borderEmphasizedDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.borderEmphasizedLight = ColorRawTokens.colorFunctionalBlack, - super.borderFocusDark = ColorRawTokens.colorFunctionalGrayLight160, - super.borderFocusInsetDark = ColorRawTokens.colorFunctionalGrayDark880, + super.borderFocusDark = SoshColorRawTokens.colorFunctionalGrayLight160, + super.borderFocusInsetDark = SoshColorRawTokens.colorFunctionalGrayDark880, super.borderFocusInsetLight = ColorRawTokens.colorFunctionalWhite, super.borderFocusLight = ColorRawTokens.colorFunctionalBlack, - super.borderMinimalDark = ColorRawTokens.colorOpacityWhite40, - super.borderMinimalLight = ColorRawTokens.colorOpacityBlack40, - super.borderMutedDark = ColorRawTokens.colorOpacityWhite80, - super.borderMutedLight = ColorRawTokens.colorOpacityBlack80, - super.borderOnBrandPrimaryDark = SoshColorRawTokens.colorBlueDuckDark960, + super.borderMinimalDark = SoshColorRawTokens.colorOpacityWhite40, + super.borderMinimalLight = SoshColorRawTokens.colorOpacityBlack40, + super.borderMutedDark = SoshColorRawTokens.colorOpacityWhite80, + super.borderMutedLight = SoshColorRawTokens.colorOpacityBlack80, + super.borderOnBrandPrimaryDark = SoshColorRawTokens.colorLochmaraDark960, super.borderOnBrandPrimaryLight = ColorRawTokens.colorFunctionalWhite, - super.borderOnBrandSecondaryDark = SoshColorRawTokens.colorBlueDuckDark960, + super.borderOnBrandSecondaryDark = SoshColorRawTokens.colorLochmaraDark960, super.borderOnBrandSecondaryLight = ColorRawTokens.colorFunctionalWhite, - super.borderOnBrandTertiaryDark = SoshColorRawTokens.colorBlueDuckDark960, + super.borderOnBrandTertiaryDark = SoshColorRawTokens.colorLochmaraDark960, super.borderOnBrandTertiaryLight = ColorRawTokens.colorFunctionalBlack, - super.borderStatusAccentDark = SoshColorRawTokens.colorMagenta300, - super.borderStatusAccentLight = SoshColorRawTokens.colorMagenta500, - super.borderStatusInfoDark = ColorRawTokens.colorFunctionalDodgerBlue300, - super.borderStatusInfoLight = ColorRawTokens.colorFunctionalDodgerBlue700, + super.borderStatusAccentDark = SoshColorRawTokens.colorRaspberry300, + super.borderStatusAccentLight = SoshColorRawTokens.colorRaspberry500, + super.borderStatusInfoDark = SoshColorRawTokens.colorLochmaraLight400, + super.borderStatusInfoLight = SoshColorRawTokens.colorLochmaraDark240, super.borderStatusNegativeDark = ColorRawTokens.colorFunctionalScarlet300, super.borderStatusNegativeLight = ColorRawTokens.colorFunctionalScarlet600, super.borderStatusPositiveDark = ColorRawTokens.colorFunctionalMalachite300, super.borderStatusPositiveLight = ColorRawTokens.colorFunctionalMalachite750, - super.borderStatusWarningDark = ColorRawTokens.colorFunctionalSun300, - super.borderStatusWarningLight = ColorRawTokens.colorFunctionalSun500, + super.borderStatusWarningDark = SoshColorRawTokens.colorTurbo300, + super.borderStatusWarningLight = SoshColorRawTokens.colorTurbo500, }); } diff --git a/ouds_theme_sosh/lib/semantic/sosh_color_content_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_color_content_semantic_tokens.dart index e97e02697..28d167ec8 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_color_content_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_color_content_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_sosh/raw/sosh_color_raw_tokens.dart'; @@ -19,71 +19,71 @@ import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; class SoshColorContentSemanticTokens extends OudsColorContentSemanticTokens { const SoshColorContentSemanticTokens({ - super.contentBrandPrimaryDark = SoshColorRawTokens.colorMagenta300, - super.contentBrandPrimaryLight = SoshColorRawTokens.colorMagenta500, - super.contentBrandSecondaryDark = SoshColorRawTokens.colorBlueDuckLight800, - super.contentBrandSecondaryLight = SoshColorRawTokens.colorBlueDuckDark400, - super.contentBrandTertiaryDark = SoshColorRawTokens.colorCitrine300, - super.contentBrandTertiaryLight = SoshColorRawTokens.colorCitrine500, - super.contentDefaultDark = ColorRawTokens.colorFunctionalGrayLight160, + super.contentBrandPrimaryDark = SoshColorRawTokens.colorRaspberry300, + super.contentBrandPrimaryLight = SoshColorRawTokens.colorRaspberry500, + super.contentBrandSecondaryDark = SoshColorRawTokens.colorLochmaraLight640, + super.contentBrandSecondaryLight = SoshColorRawTokens.colorLochmaraDark240, + super.contentBrandTertiaryDark = SoshColorRawTokens.colorTurbo300, + super.contentBrandTertiaryLight = SoshColorRawTokens.colorTurbo500, + super.contentDefaultDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.contentDefaultLight = ColorRawTokens.colorFunctionalBlack, - super.contentDisabledDark = ColorRawTokens.colorOpacityWhite200, - super.contentDisabledLight = ColorRawTokens.colorOpacityBlack200, + super.contentDisabledDark = SoshColorRawTokens.colorOpacityWhite200, + super.contentDisabledLight = SoshColorRawTokens.colorOpacityBlack200, super.contentInverseDark = ColorRawTokens.colorFunctionalBlack, super.contentInverseLight = ColorRawTokens.colorFunctionalWhite, - super.contentMutedDark = ColorRawTokens.colorOpacityWhite640, - super.contentMutedLight = ColorRawTokens.colorOpacityBlack680, - super.contentOnActionDisabledDark = SoshColorRawTokens.colorBlueDuckDark960, + super.contentMutedDark = SoshColorRawTokens.colorOpacityWhite640, + super.contentMutedLight = SoshColorRawTokens.colorOpacityBlack720, + super.contentOnActionDisabledDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnActionDisabledLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnActionEnabledDark = SoshColorRawTokens.colorBlueDuckDark960, + super.contentOnActionEnabledDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnActionEnabledLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnActionFocusDark = SoshColorRawTokens.colorBlueDuckDark960, + super.contentOnActionFocusDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnActionFocusLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnActionHighlightedDark = SoshColorRawTokens.colorBlueDuckDark960, + super.contentOnActionHighlightedDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnActionHighlightedLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnActionHoverDark = SoshColorRawTokens.colorBlueDuckDark960, + super.contentOnActionHoverDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnActionHoverLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnActionLoadingDark = SoshColorRawTokens.colorBlueDuckDark960, + super.contentOnActionLoadingDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnActionLoadingLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnActionPressedDark = SoshColorRawTokens.colorBlueDuckDark960, + super.contentOnActionPressedDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnActionPressedLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnActionSelectedDark = SoshColorRawTokens.colorBlueDuckDark960, + super.contentOnActionSelectedDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnActionSelectedLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnBrandPrimaryDark = SoshColorRawTokens.colorBlueDuckDark960, + super.contentOnBrandPrimaryDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnBrandPrimaryLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnBrandSecondaryDark = SoshColorRawTokens.colorBlueDuckDark960, + super.contentOnBrandSecondaryDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnBrandSecondaryLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnBrandTertiaryDark = SoshColorRawTokens.colorBlueDuckDark960, + super.contentOnBrandTertiaryDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnBrandTertiaryLight = ColorRawTokens.colorFunctionalBlack, - super.contentOnStatusAccentEmphasizedDark = ColorRawTokens.colorFunctionalBlack, + super.contentOnStatusAccentEmphasizedDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnStatusAccentEmphasizedLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnStatusAccentMutedDark = ColorRawTokens.colorFunctionalGrayLight160, + super.contentOnStatusAccentMutedDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.contentOnStatusAccentMutedLight = ColorRawTokens.colorFunctionalBlack, - super.contentOnStatusInfoEmphasizedDark = ColorRawTokens.colorFunctionalBlack, + super.contentOnStatusInfoEmphasizedDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnStatusInfoEmphasizedLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnStatusInfoMutedDark = ColorRawTokens.colorFunctionalGrayLight160, + super.contentOnStatusInfoMutedDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.contentOnStatusInfoMutedLight = ColorRawTokens.colorFunctionalBlack, - super.contentOnStatusNegativeEmphasizedDark = ColorRawTokens.colorFunctionalBlack, + super.contentOnStatusNegativeEmphasizedDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnStatusNegativeEmphasizedLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnStatusNegativeMutedDark = ColorRawTokens.colorFunctionalGrayLight160, + super.contentOnStatusNegativeMutedDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.contentOnStatusNegativeMutedLight = ColorRawTokens.colorFunctionalBlack, - super.contentOnStatusPositiveEmphasizedDark = ColorRawTokens.colorFunctionalBlack, + super.contentOnStatusPositiveEmphasizedDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnStatusPositiveEmphasizedLight = ColorRawTokens.colorFunctionalWhite, - super.contentOnStatusPositiveMutedDark = ColorRawTokens.colorFunctionalGrayLight160, + super.contentOnStatusPositiveMutedDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.contentOnStatusPositiveMutedLight = ColorRawTokens.colorFunctionalBlack, - super.contentOnStatusWarningEmphasizedDark = ColorRawTokens.colorFunctionalBlack, + super.contentOnStatusWarningEmphasizedDark = SoshColorRawTokens.colorLochmaraDark960, super.contentOnStatusWarningEmphasizedLight = ColorRawTokens.colorFunctionalBlack, - super.contentOnStatusWarningMutedDark = ColorRawTokens.colorFunctionalGrayLight160, + super.contentOnStatusWarningMutedDark = SoshColorRawTokens.colorFunctionalGrayLight160, super.contentOnStatusWarningMutedLight = ColorRawTokens.colorFunctionalBlack, - super.contentStatusAccentDark = SoshColorRawTokens.colorMagenta300, - super.contentStatusAccentLight = SoshColorRawTokens.colorMagenta500, - super.contentStatusInfoDark = ColorRawTokens.colorFunctionalDodgerBlue300, - super.contentStatusInfoLight = ColorRawTokens.colorFunctionalDodgerBlue700, + super.contentStatusAccentDark = SoshColorRawTokens.colorRaspberry300, + super.contentStatusAccentLight = SoshColorRawTokens.colorRaspberry500, + super.contentStatusInfoDark = SoshColorRawTokens.colorLochmaraLight400, + super.contentStatusInfoLight = SoshColorRawTokens.colorLochmaraDark240, super.contentStatusNegativeDark = ColorRawTokens.colorFunctionalScarlet300, super.contentStatusNegativeLight = ColorRawTokens.colorFunctionalScarlet600, super.contentStatusPositiveDark = ColorRawTokens.colorFunctionalMalachite300, super.contentStatusPositiveLight = ColorRawTokens.colorFunctionalMalachite750, - super.contentStatusWarningDark = ColorRawTokens.colorFunctionalSun300, - super.contentStatusWarningLight = ColorRawTokens.colorFunctionalSun750, + super.contentStatusWarningDark = SoshColorRawTokens.colorTurbo300, + super.contentStatusWarningLight = SoshColorRawTokens.colorTurbo750, }); } diff --git a/ouds_theme_sosh/lib/semantic/sosh_color_decorative_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_color_decorative_semantic_tokens.dart deleted file mode 100644 index 18333eda0..000000000 --- a/ouds_theme_sosh/lib/semantic/sosh_color_decorative_semantic_tokens.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// Software Name: OUDS Flutter -// SPDX-FileCopyrightText: Copyright (c) Orange SA -// SPDX-License-Identifier: MIT -// -// This software is distributed under the MIT license, -// the text of which is available at https://opensource.org/license/MIT/ -// or see the "LICENSE" file for more details. -// -// Software description: Flutter library of reusable graphical components -// - -// Sosh brand tokens version 1.5.0 -// Generated by Tokenator - -import 'package:flutter/material.dart'; -import 'package:ouds_theme_sosh/raw/sosh_color_raw_tokens.dart'; -import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_decorative_semantic_tokens.dart'; -import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; - -class SoshColorDecorativeSemanticTokens extends OudsColorDecorativeSemanticTokens { - const SoshColorDecorativeSemanticTokens({ - super.decorativeAccent1Default = const Color(0x00ff0000), - super.decorativeAccent1Emphasized = const Color(0x00ff0000), - super.decorativeAccent1Muted = const Color(0x00ff0000), - super.decorativeAccent2Default = const Color(0x00ff0000), - super.decorativeAccent2Emphasized = const Color(0x00ff0000), - super.decorativeAccent2Muted = const Color(0x00ff0000), - super.decorativeAccent3Default = const Color(0x00ff0000), - super.decorativeAccent3Emphasized = const Color(0x00ff0000), - super.decorativeAccent3Muted = const Color(0x00ff0000), - super.decorativeAccent4Default = const Color(0x00ff0000), - super.decorativeAccent4Emphasized = const Color(0x00ff0000), - super.decorativeAccent4Muted = const Color(0x00ff0000), - super.decorativeAccent5Default = const Color(0x00ff0000), - super.decorativeAccent5Emphasized = const Color(0x00ff0000), - super.decorativeAccent5Muted = const Color(0x00ff0000), - super.decorativeBrandPrimary = SoshColorRawTokens.colorMagenta500, - super.decorativeBrandPrimaryEmphasized = const Color(0x00ff0000), - super.decorativeBrandPrimaryMuted = const Color(0x00ff0000), - super.decorativeBrandSecondary = SoshColorRawTokens.colorBlueDuckLight480, - super.decorativeBrandSecondaryEmphasized = const Color(0x00ff0000), - super.decorativeBrandSecondaryMuted = const Color(0x00ff0000), - super.decorativeBrandTertiary = SoshColorRawTokens.colorCitrine500, - super.decorativeBrandTertiaryEmphasized = const Color(0x00ff0000), - super.decorativeBrandTertiaryMuted = const Color(0x00ff0000), - super.decorativeNeutralEmphasizedHigh = const Color(0x00ff0000), - super.decorativeNeutralEmphasizedHigher = const Color(0x00ff0000), - super.decorativeNeutralEmphasizedHighest = const Color(0x00ff0000), - super.decorativeNeutralEmphasizedLow = ColorRawTokens.colorFunctionalGrayDark400, - super.decorativeNeutralEmphasizedLower = const Color(0x00ff0000), - super.decorativeNeutralEmphasizedLowest = const Color(0x00ff0000), - super.decorativeNeutralEmphasizedMedium = const Color(0x00ff0000), - super.decorativeNeutralMutedHigh = const Color(0x00ff0000), - super.decorativeNeutralMutedHigher = const Color(0x00ff0000), - super.decorativeNeutralMutedHighest = const Color(0x00ff0000), - super.decorativeNeutralMutedLow = const Color(0x00ff0000), - super.decorativeNeutralMutedLower = ColorRawTokens.colorFunctionalGrayLight160, - super.decorativeNeutralMutedLowest = const Color(0x00ff0000), - super.decorativeNeutralMutedMedium = ColorRawTokens.colorFunctionalGrayLight400, - super.decorativeSkinTint100 = const Color(0x00ff0000), - super.decorativeSkinTint200 = const Color(0x00ff0000), - super.decorativeSkinTint300 = const Color(0x00ff0000), - super.decorativeSkinTint400 = const Color(0x00ff0000), - super.decorativeSkinTint500 = const Color(0x00ff0000), - super.decorativeSkinTint600 = const Color(0x00ff0000), - super.decorativeSkinTint700 = const Color(0x00ff0000), - super.decorativeSkinTint800 = const Color(0x00ff0000), - super.decorativeSkinTint900 = const Color(0x00ff0000), - }); -} diff --git a/ouds_theme_sosh/lib/semantic/sosh_color_opacity_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_color_opacity_semantic_tokens.dart index 71f6ed9ec..2a52ceea9 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_color_opacity_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_color_opacity_semantic_tokens.dart @@ -10,19 +10,19 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator +import 'package:ouds_theme_sosh/raw/sosh_color_raw_tokens.dart'; import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_opacity_semantic_tokens.dart'; -import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; class SoshColorOpacitySemanticTokens extends OudsColorOpacitySemanticTokens { const SoshColorOpacitySemanticTokens({ - super.opacityLowerDark = ColorRawTokens.colorOpacityWhite80, - super.opacityLowerLight = ColorRawTokens.colorOpacityBlack80, - super.opacityLowestDark = ColorRawTokens.colorOpacityWhite40, - super.opacityLowestLight = ColorRawTokens.colorOpacityBlack40, - super.opacityTransparentDark = ColorRawTokens.colorOpacityWhite0, - super.opacityTransparentLight = ColorRawTokens.colorOpacityBlack0, + super.opacityLowerDark = SoshColorRawTokens.colorOpacityWhite80, + super.opacityLowerLight = SoshColorRawTokens.colorOpacityBlack80, + super.opacityLowestDark = SoshColorRawTokens.colorOpacityWhite40, + super.opacityLowestLight = SoshColorRawTokens.colorOpacityBlack40, + super.opacityTransparentDark = SoshColorRawTokens.colorOpacityWhite0, + super.opacityTransparentLight = SoshColorRawTokens.colorOpacityBlack0, }); } diff --git a/ouds_theme_sosh/lib/semantic/sosh_color_overlay_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_color_overlay_semantic_tokens.dart index e0bff0753..67f35d94e 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_color_overlay_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_color_overlay_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_sosh/raw/sosh_color_raw_tokens.dart'; @@ -19,13 +19,15 @@ import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; class SoshColorOverlaySemanticTokens extends OudsColorOverlaySemanticTokens { const SoshColorOverlaySemanticTokens({ - super.overlayDragDark = ColorRawTokens.colorOpacityWhite80, - super.overlayDragLight = ColorRawTokens.colorOpacityBlack40, - super.overlayDropdownDark = ColorRawTokens.colorFunctionalGrayDark560, + super.overlayBackdropDark = SoshColorRawTokens.colorOpacityBlack720, + super.overlayBackdropLight = SoshColorRawTokens.colorOpacityBlack720, + super.overlayDragDark = SoshColorRawTokens.colorOpacityWhite80, + super.overlayDragLight = SoshColorRawTokens.colorOpacityBlack40, + super.overlayDropdownDark = SoshColorRawTokens.colorFunctionalGrayDark560, super.overlayDropdownLight = ColorRawTokens.colorFunctionalWhite, - super.overlayModalDark = SoshColorRawTokens.colorBlueDuckDark720, - super.overlayModalLight = ColorRawTokens.colorFunctionalWhite, - super.overlayTooltipDark = ColorRawTokens.colorFunctionalGrayDark560, - super.overlayTooltipLight = ColorRawTokens.colorFunctionalGrayDark720, + super.overlayModalSheetDark = SoshColorRawTokens.colorLochmaraDark800, + super.overlayModalSheetLight = ColorRawTokens.colorFunctionalWhite, + super.overlayTooltipDark = SoshColorRawTokens.colorFunctionalGrayDark560, + super.overlayTooltipLight = SoshColorRawTokens.colorFunctionalGrayDark720, }); } diff --git a/ouds_theme_sosh/lib/semantic/sosh_color_repository_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_color_repository_semantic_tokens.dart index 062cb3367..f1f37520b 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_color_repository_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_color_repository_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -22,55 +22,55 @@ class SoshColorRepositorySemanticTokens extends OudsColorRepositorySemanticToken const SoshColorRepositorySemanticTokens({ super.repositoryAccentHigh = const Color(0x00ff0000), super.repositoryAccentHigher = const Color(0x00ff0000), - super.repositoryAccentHighest = SoshColorRawTokens.colorMagenta800, - super.repositoryAccentLow = SoshColorRawTokens.colorMagenta300, + super.repositoryAccentHighest = SoshColorRawTokens.colorRaspberry800, + super.repositoryAccentLow = SoshColorRawTokens.colorRaspberry300, super.repositoryAccentLower = const Color(0x00ff0000), - super.repositoryAccentLowest = SoshColorRawTokens.colorMagenta50, - super.repositoryAccentMedium = SoshColorRawTokens.colorMagenta500, - super.repositoryInfoHigh = ColorRawTokens.colorFunctionalDodgerBlue700, + super.repositoryAccentLowest = SoshColorRawTokens.colorRaspberry50, + super.repositoryAccentMedium = SoshColorRawTokens.colorRaspberry500, + super.repositoryInfoHigh = SoshColorRawTokens.colorLochmaraDark240, super.repositoryInfoHigher = const Color(0x00ff0000), - super.repositoryInfoHighest = ColorRawTokens.colorFunctionalDodgerBlue900, - super.repositoryInfoLow = ColorRawTokens.colorFunctionalDodgerBlue300, + super.repositoryInfoHighest = const Color(0x00ff0000), + super.repositoryInfoLow = SoshColorRawTokens.colorLochmaraLight400, super.repositoryInfoLower = const Color(0x00ff0000), - super.repositoryInfoLowest = ColorRawTokens.colorFunctionalDodgerBlue100, + super.repositoryInfoLowest = const Color(0x00ff0000), super.repositoryInfoMedium = const Color(0x00ff0000), super.repositoryNegativeHigh = ColorRawTokens.colorFunctionalScarlet700, super.repositoryNegativeHigher = ColorRawTokens.colorFunctionalScarlet800, - super.repositoryNegativeHighest = ColorRawTokens.colorFunctionalScarlet900, + super.repositoryNegativeHighest = const Color(0x00ff0000), super.repositoryNegativeLow = ColorRawTokens.colorFunctionalScarlet300, super.repositoryNegativeLower = ColorRawTokens.colorFunctionalScarlet200, super.repositoryNegativeLowest = ColorRawTokens.colorFunctionalScarlet100, super.repositoryNegativeMedium = ColorRawTokens.colorFunctionalScarlet600, super.repositoryNeutralEmphasizedBlack = ColorRawTokens.colorFunctionalBlack, - super.repositoryNeutralEmphasizedHigh = ColorRawTokens.colorFunctionalGrayDark720, - super.repositoryNeutralEmphasizedHigher = ColorRawTokens.colorFunctionalGrayDark800, - super.repositoryNeutralEmphasizedHighest = ColorRawTokens.colorFunctionalGrayDark880, - super.repositoryNeutralEmphasizedLow = ColorRawTokens.colorFunctionalGrayDark560, + super.repositoryNeutralEmphasizedHigh = SoshColorRawTokens.colorFunctionalGrayDark720, + super.repositoryNeutralEmphasizedHigher = SoshColorRawTokens.colorFunctionalGrayDark800, + super.repositoryNeutralEmphasizedHighest = SoshColorRawTokens.colorFunctionalGrayDark880, + super.repositoryNeutralEmphasizedLow = SoshColorRawTokens.colorFunctionalGrayDark560, super.repositoryNeutralEmphasizedLower = const Color(0x00ff0000), super.repositoryNeutralEmphasizedLowest = const Color(0x00ff0000), - super.repositoryNeutralEmphasizedMedium = ColorRawTokens.colorFunctionalGrayDark640, + super.repositoryNeutralEmphasizedMedium = SoshColorRawTokens.colorFunctionalGrayDark640, super.repositoryNeutralMutedHigh = const Color(0x00ff0000), super.repositoryNeutralMutedHigher = const Color(0x00ff0000), super.repositoryNeutralMutedHighest = const Color(0x00ff0000), super.repositoryNeutralMutedLow = const Color(0x00ff0000), - super.repositoryNeutralMutedLower = ColorRawTokens.colorFunctionalGrayLight160, - super.repositoryNeutralMutedLowest = ColorRawTokens.colorFunctionalGrayLight80, + super.repositoryNeutralMutedLower = SoshColorRawTokens.colorFunctionalGrayLight160, + super.repositoryNeutralMutedLowest = SoshColorRawTokens.colorFunctionalGrayLight80, super.repositoryNeutralMutedMedium = const Color(0x00ff0000), super.repositoryNeutralMutedWhite = ColorRawTokens.colorFunctionalWhite, - super.repositoryOpacityAccentLow = SoshColorRawTokens.colorOpacityMagenta120, - super.repositoryOpacityAccentMedium = SoshColorRawTokens.colorOpacityMagenta640, - super.repositoryOpacityBlackHigh = ColorRawTokens.colorOpacityBlack520, - super.repositoryOpacityBlackHigher = ColorRawTokens.colorOpacityBlack680, - super.repositoryOpacityBlackHighest = ColorRawTokens.colorOpacityBlack840, - super.repositoryOpacityBlackLow = ColorRawTokens.colorOpacityBlack120, - super.repositoryOpacityBlackLower = ColorRawTokens.colorOpacityBlack80, - super.repositoryOpacityBlackLowest = ColorRawTokens.colorOpacityBlack40, - super.repositoryOpacityBlackMedium = ColorRawTokens.colorOpacityBlack280, - super.repositoryOpacityBlackMediumHigh = ColorRawTokens.colorOpacityBlack440, - super.repositoryOpacityBlackMediumLow = ColorRawTokens.colorOpacityBlack200, - super.repositoryOpacityBlackTransparent = ColorRawTokens.colorOpacityBlack0, - super.repositoryOpacityInfoLow = ColorRawTokens.colorOpacityDodgerBlue80, - super.repositoryOpacityInfoMedium = ColorRawTokens.colorOpacityDodgerBlue520, + super.repositoryOpacityAccentLow = SoshColorRawTokens.colorOpacityRaspberry100, + super.repositoryOpacityAccentMedium = SoshColorRawTokens.colorOpacityRaspberry640, + super.repositoryOpacityBlackHigh = SoshColorRawTokens.colorOpacityBlack520, + super.repositoryOpacityBlackHigher = SoshColorRawTokens.colorOpacityBlack720, + super.repositoryOpacityBlackHighest = SoshColorRawTokens.colorOpacityBlack920, + super.repositoryOpacityBlackLow = SoshColorRawTokens.colorOpacityBlack120, + super.repositoryOpacityBlackLower = SoshColorRawTokens.colorOpacityBlack80, + super.repositoryOpacityBlackLowest = SoshColorRawTokens.colorOpacityBlack40, + super.repositoryOpacityBlackMedium = SoshColorRawTokens.colorOpacityBlack280, + super.repositoryOpacityBlackMediumHigh = SoshColorRawTokens.colorOpacityBlack440, + super.repositoryOpacityBlackMediumLow = SoshColorRawTokens.colorOpacityBlack200, + super.repositoryOpacityBlackTransparent = SoshColorRawTokens.colorOpacityBlack0, + super.repositoryOpacityInfoLow = SoshColorRawTokens.colorOpacityLochmaraLight80080, + super.repositoryOpacityInfoMedium = SoshColorRawTokens.colorOpacityLochmaraDark880520, super.repositoryOpacityNegativeLow = ColorRawTokens.colorOpacityScarlet80, super.repositoryOpacityNegativeMedium = ColorRawTokens.colorOpacityScarlet320, super.repositoryOpacityPositiveLow = ColorRawTokens.colorOpacityMalachite120, @@ -83,51 +83,52 @@ class SoshColorRepositorySemanticTokens extends OudsColorRepositorySemanticToken super.repositoryOpacityPrimaryLowest = const Color(0x00ff0000), super.repositoryOpacityPrimaryMedium = const Color(0x00ff0000), super.repositoryOpacityPrimaryTransparent = const Color(0x00ff0000), - super.repositoryOpacityWarningLow = ColorRawTokens.colorOpacitySun160, - super.repositoryOpacityWarningMedium = ColorRawTokens.colorOpacitySun480, - super.repositoryOpacityWhiteHigh = ColorRawTokens.colorOpacityWhite640, - super.repositoryOpacityWhiteHigher = ColorRawTokens.colorOpacityWhite800, - super.repositoryOpacityWhiteHighest = ColorRawTokens.colorOpacityWhite920, - super.repositoryOpacityWhiteLow = ColorRawTokens.colorOpacityWhite120, - super.repositoryOpacityWhiteLower = ColorRawTokens.colorOpacityWhite80, - super.repositoryOpacityWhiteLowest = ColorRawTokens.colorOpacityWhite40, - super.repositoryOpacityWhiteMedium = ColorRawTokens.colorOpacityWhite440, - super.repositoryOpacityWhiteMediumLow = ColorRawTokens.colorOpacityWhite200, - super.repositoryOpacityWhiteTransparent = ColorRawTokens.colorOpacityWhite0, + super.repositoryOpacityWarningLow = SoshColorRawTokens.colorOpacityTurbo160, + super.repositoryOpacityWarningMedium = SoshColorRawTokens.colorOpacityTurbo480, + super.repositoryOpacityWhiteHigh = SoshColorRawTokens.colorOpacityWhite640, + super.repositoryOpacityWhiteHigher = SoshColorRawTokens.colorOpacityWhite800, + super.repositoryOpacityWhiteHighest = SoshColorRawTokens.colorOpacityWhite920, + super.repositoryOpacityWhiteLow = SoshColorRawTokens.colorOpacityWhite120, + super.repositoryOpacityWhiteLower = SoshColorRawTokens.colorOpacityWhite80, + super.repositoryOpacityWhiteLowest = SoshColorRawTokens.colorOpacityWhite40, + super.repositoryOpacityWhiteMedium = SoshColorRawTokens.colorOpacityWhite440, + super.repositoryOpacityWhiteMediumLow = SoshColorRawTokens.colorOpacityWhite200, + super.repositoryOpacityWhiteTransparent = SoshColorRawTokens.colorOpacityWhite0, super.repositoryPositiveHigh = ColorRawTokens.colorFunctionalMalachite700, super.repositoryPositiveHigher = ColorRawTokens.colorFunctionalMalachite750, - super.repositoryPositiveHighest = ColorRawTokens.colorFunctionalMalachite900, + super.repositoryPositiveHighest = const Color(0x00ff0000), super.repositoryPositiveLow = ColorRawTokens.colorFunctionalMalachite300, super.repositoryPositiveLower = const Color(0x00ff0000), - super.repositoryPositiveLowest = ColorRawTokens.colorFunctionalMalachite100, + super.repositoryPositiveLowest = const Color(0x00ff0000), super.repositoryPositiveMedium = ColorRawTokens.colorFunctionalMalachite600, super.repositoryPrimaryHigh = const Color(0x00ff0000), super.repositoryPrimaryHigher = const Color(0x00ff0000), - super.repositoryPrimaryHighest = SoshColorRawTokens.colorMagenta800, - super.repositoryPrimaryLow = SoshColorRawTokens.colorMagenta300, + super.repositoryPrimaryHighest = const Color(0x00ff0000), + super.repositoryPrimaryLow = SoshColorRawTokens.colorRaspberry300, super.repositoryPrimaryLower = const Color(0x00ff0000), - super.repositoryPrimaryLowest = SoshColorRawTokens.colorMagenta50, - super.repositoryPrimaryMedium = SoshColorRawTokens.colorMagenta500, - super.repositorySecondaryHigh = SoshColorRawTokens.colorBlueDuckDark720, - super.repositorySecondaryHigher = SoshColorRawTokens.colorBlueDuckDark880, - super.repositorySecondaryHighest = SoshColorRawTokens.colorBlueDuckDark960, - super.repositorySecondaryLow = SoshColorRawTokens.colorBlueDuckDark400, - super.repositorySecondaryLower = SoshColorRawTokens.colorBlueDuckLight800, - super.repositorySecondaryLowest = SoshColorRawTokens.colorBlueDuckLight80, - super.repositorySecondaryMedium = SoshColorRawTokens.colorBlueDuckDark560, + super.repositoryPrimaryLowest = const Color(0x00ff0000), + super.repositoryPrimaryMedium = SoshColorRawTokens.colorRaspberry500, + super.repositorySecondaryHigh = SoshColorRawTokens.colorLochmaraDark720, + super.repositorySecondaryHigherHigh = SoshColorRawTokens.colorLochmaraDark880, + super.repositorySecondaryHigherLow = SoshColorRawTokens.colorLochmaraDark800, + super.repositorySecondaryHighest = SoshColorRawTokens.colorLochmaraDark960, + super.repositorySecondaryLow = SoshColorRawTokens.colorLochmaraDark240, + super.repositorySecondaryLower = SoshColorRawTokens.colorLochmaraLight640, + super.repositorySecondaryLowest = SoshColorRawTokens.colorLochmaraLight80, + super.repositorySecondaryMedium = SoshColorRawTokens.colorLochmaraDark480, super.repositoryTertiaryHigh = const Color(0x00ff0000), super.repositoryTertiaryHigher = const Color(0x00ff0000), - super.repositoryTertiaryHighest = SoshColorRawTokens.colorCitrine950, - super.repositoryTertiaryLow = SoshColorRawTokens.colorCitrine300, + super.repositoryTertiaryHighest = SoshColorRawTokens.colorTurbo950, + super.repositoryTertiaryLow = SoshColorRawTokens.colorTurbo300, super.repositoryTertiaryLower = const Color(0x00ff0000), - super.repositoryTertiaryLowest = SoshColorRawTokens.colorCitrine50, - super.repositoryTertiaryMedium = SoshColorRawTokens.colorCitrine500, - super.repositoryWarningHigh = ColorRawTokens.colorFunctionalSun750, + super.repositoryTertiaryLowest = SoshColorRawTokens.colorTurbo50, + super.repositoryTertiaryMedium = SoshColorRawTokens.colorTurbo500, + super.repositoryWarningHigh = SoshColorRawTokens.colorTurbo750, super.repositoryWarningHigher = const Color(0x00ff0000), - super.repositoryWarningHighest = ColorRawTokens.colorFunctionalSun900, - super.repositoryWarningLow = ColorRawTokens.colorFunctionalSun300, + super.repositoryWarningHighest = const Color(0x00ff0000), + super.repositoryWarningLow = SoshColorRawTokens.colorTurbo300, super.repositoryWarningLower = const Color(0x00ff0000), - super.repositoryWarningLowest = ColorRawTokens.colorFunctionalSun100, - super.repositoryWarningMedium = ColorRawTokens.colorFunctionalSun500, + super.repositoryWarningLowest = const Color(0x00ff0000), + super.repositoryWarningMedium = SoshColorRawTokens.colorTurbo500, }); } diff --git a/ouds_theme_sosh/lib/semantic/sosh_color_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_color_semantic_tokens.dart index e9f3d4f35..b6a386a1d 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_color_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_color_semantic_tokens.dart @@ -4,7 +4,6 @@ import 'package:ouds_theme_sosh/semantic/sosh_color_always_semantic_tokens.dart' import 'package:ouds_theme_sosh/semantic/sosh_color_bg_semantic_tokens.dart'; import 'package:ouds_theme_sosh/semantic/sosh_color_border_semantic_tokens.dart'; import 'package:ouds_theme_sosh/semantic/sosh_color_content_semantic_tokens.dart'; -import 'package:ouds_theme_sosh/semantic/sosh_color_decorative_semantic_tokens.dart'; import 'package:ouds_theme_sosh/semantic/sosh_color_opacity_semantic_tokens.dart'; import 'package:ouds_theme_sosh/semantic/sosh_color_overlay_semantic_tokens.dart'; import 'package:ouds_theme_sosh/semantic/sosh_color_repository_semantic_tokens.dart'; @@ -17,7 +16,6 @@ class SoshColorSemanticTokens extends OudsColorSemanticTokens { SoshColorBgSemanticTokens backgroundColorTokens = const SoshColorBgSemanticTokens(), SoshColorBorderSemanticTokens borderColorTokens = const SoshColorBorderSemanticTokens(), SoshColorContentSemanticTokens contentColorTokens = const SoshColorContentSemanticTokens(), - SoshColorDecorativeSemanticTokens decorativeColorTokens = const SoshColorDecorativeSemanticTokens(), SoshColorOpacitySemanticTokens opacityColorTokens = const SoshColorOpacitySemanticTokens(), SoshColorOverlaySemanticTokens overlayColorTokens = const SoshColorOverlaySemanticTokens(), SoshColorSurfaceSemanticTokens surfaceColorTokens = const SoshColorSurfaceSemanticTokens(), @@ -28,7 +26,6 @@ class SoshColorSemanticTokens extends OudsColorSemanticTokens { backgroundColorTokens: backgroundColorTokens, borderColorTokens: borderColorTokens, contentColorTokens: contentColorTokens, - decorativeColorTokens: decorativeColorTokens, opacityColorTokens: opacityColorTokens, overlayColorTokens: overlayColorTokens, surfaceColorTokens: surfaceColorTokens, diff --git a/ouds_theme_sosh/lib/semantic/sosh_color_surface_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_color_surface_semantic_tokens.dart index 1e16c6f07..5ce1ebfa2 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_color_surface_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_color_surface_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_sosh/raw/sosh_color_raw_tokens.dart'; @@ -19,28 +19,28 @@ import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; class SoshColorSurfaceSemanticTokens extends OudsColorSurfaceSemanticTokens { const SoshColorSurfaceSemanticTokens({ - super.surfaceBrandPrimaryDark = SoshColorRawTokens.colorMagenta300, - super.surfaceBrandPrimaryLight = SoshColorRawTokens.colorMagenta500, - super.surfaceBrandSecondaryDark = SoshColorRawTokens.colorBlueDuckLight800, - super.surfaceBrandSecondaryLight = SoshColorRawTokens.colorBlueDuckDark400, - super.surfaceBrandTertiaryDark = SoshColorRawTokens.colorCitrine300, - super.surfaceBrandTertiaryLight = SoshColorRawTokens.colorCitrine500, - super.surfaceInverseHighDark = ColorRawTokens.colorFunctionalGrayLight160, - super.surfaceInverseHighLight = ColorRawTokens.colorFunctionalGrayDark720, - super.surfaceInverseLowDark = ColorRawTokens.colorOpacityWhite120, - super.surfaceInverseLowLight = ColorRawTokens.colorFunctionalGrayDark720, - super.surfacePrimaryDark = ColorRawTokens.colorOpacityWhite40, + super.surfaceBrandPrimaryDark = SoshColorRawTokens.colorRaspberry300, + super.surfaceBrandPrimaryLight = SoshColorRawTokens.colorRaspberry500, + super.surfaceBrandSecondaryDark = SoshColorRawTokens.colorLochmaraLight640, + super.surfaceBrandSecondaryLight = SoshColorRawTokens.colorLochmaraDark240, + super.surfaceBrandTertiaryDark = SoshColorRawTokens.colorTurbo300, + super.surfaceBrandTertiaryLight = SoshColorRawTokens.colorTurbo500, + super.surfaceInverseHighDark = SoshColorRawTokens.colorLochmaraLight80, + super.surfaceInverseHighLight = SoshColorRawTokens.colorLochmaraDark880, + super.surfaceInverseLowDark = SoshColorRawTokens.colorOpacityWhite120, + super.surfaceInverseLowLight = SoshColorRawTokens.colorLochmaraDark880, + super.surfacePrimaryDark = SoshColorRawTokens.colorOpacityWhite40, super.surfacePrimaryLight = ColorRawTokens.colorFunctionalWhite, - super.surfaceSecondaryDark = ColorRawTokens.colorOpacityWhite80, - super.surfaceSecondaryLight = ColorRawTokens.colorOpacityBlack40, - super.surfaceStatusAccentEmphasizedDark = SoshColorRawTokens.colorMagenta300, - super.surfaceStatusAccentEmphasizedLight = SoshColorRawTokens.colorMagenta500, - super.surfaceStatusAccentMutedDark = SoshColorRawTokens.colorOpacityMagenta640, - super.surfaceStatusAccentMutedLight = SoshColorRawTokens.colorOpacityMagenta120, - super.surfaceStatusInfoEmphasizedDark = ColorRawTokens.colorFunctionalDodgerBlue300, - super.surfaceStatusInfoEmphasizedLight = ColorRawTokens.colorFunctionalDodgerBlue700, - super.surfaceStatusInfoMutedDark = ColorRawTokens.colorOpacityDodgerBlue520, - super.surfaceStatusInfoMutedLight = ColorRawTokens.colorOpacityDodgerBlue80, + super.surfaceSecondaryDark = SoshColorRawTokens.colorOpacityWhite80, + super.surfaceSecondaryLight = SoshColorRawTokens.colorOpacityBlack40, + super.surfaceStatusAccentEmphasizedDark = SoshColorRawTokens.colorRaspberry300, + super.surfaceStatusAccentEmphasizedLight = SoshColorRawTokens.colorRaspberry500, + super.surfaceStatusAccentMutedDark = SoshColorRawTokens.colorOpacityRaspberry640, + super.surfaceStatusAccentMutedLight = SoshColorRawTokens.colorOpacityRaspberry100, + super.surfaceStatusInfoEmphasizedDark = SoshColorRawTokens.colorLochmaraLight400, + super.surfaceStatusInfoEmphasizedLight = SoshColorRawTokens.colorLochmaraDark240, + super.surfaceStatusInfoMutedDark = SoshColorRawTokens.colorOpacityLochmaraDark880520, + super.surfaceStatusInfoMutedLight = SoshColorRawTokens.colorOpacityLochmaraLight80080, super.surfaceStatusNegativeEmphasizedDark = ColorRawTokens.colorFunctionalScarlet300, super.surfaceStatusNegativeEmphasizedLight = ColorRawTokens.colorFunctionalScarlet600, super.surfaceStatusNegativeMutedDark = ColorRawTokens.colorOpacityScarlet320, @@ -49,11 +49,11 @@ class SoshColorSurfaceSemanticTokens extends OudsColorSurfaceSemanticTokens { super.surfaceStatusPositiveEmphasizedLight = ColorRawTokens.colorFunctionalMalachite750, super.surfaceStatusPositiveMutedDark = ColorRawTokens.colorOpacityMalachite640, super.surfaceStatusPositiveMutedLight = ColorRawTokens.colorOpacityMalachite120, - super.surfaceStatusWarningEmphasizedDark = ColorRawTokens.colorFunctionalSun300, - super.surfaceStatusWarningEmphasizedLight = ColorRawTokens.colorFunctionalSun500, - super.surfaceStatusWarningMutedDark = ColorRawTokens.colorOpacitySun480, - super.surfaceStatusWarningMutedLight = ColorRawTokens.colorOpacitySun160, - super.surfaceTertiaryDark = SoshColorRawTokens.colorOpacityMagenta640, - super.surfaceTertiaryLight = SoshColorRawTokens.colorOpacityMagenta120, + super.surfaceStatusWarningEmphasizedDark = SoshColorRawTokens.colorTurbo300, + super.surfaceStatusWarningEmphasizedLight = SoshColorRawTokens.colorTurbo500, + super.surfaceStatusWarningMutedDark = SoshColorRawTokens.colorOpacityTurbo480, + super.surfaceStatusWarningMutedLight = SoshColorRawTokens.colorOpacityTurbo160, + super.surfaceTertiaryDark = SoshColorRawTokens.colorOpacityRaspberry640, + super.surfaceTertiaryLight = SoshColorRawTokens.colorOpacityRaspberry100, }); } diff --git a/ouds_theme_sosh/lib/semantic/sosh_effect_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_effect_semantic_tokens.dart index 18020c378..0eda2df9c 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_effect_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_effect_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_effect_semantic_tokens.dart'; @@ -18,5 +18,5 @@ import 'package:ouds_global_raw_tokens/effect_raw_tokens.dart'; class SoshEffectSemanticTokens extends OudsEffectSemanticTokens { @override - int get blurDrag => EffectRawTokens.effectBlur320; + int get blurDrag => EffectRawTokens.effectBlur480; } diff --git a/ouds_theme_sosh/lib/semantic/sosh_font_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_font_semantic_tokens.dart index 6829d74b7..abac17f2c 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_font_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_font_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_sosh/lib/semantic/sosh_grid_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_grid_semantic_tokens.dart index 61d0a0d62..7e930c4ce 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_grid_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_grid_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_grid_semantic_tokens.dart'; @@ -18,7 +18,7 @@ import 'package:ouds_global_raw_tokens/grid_raw_tokens.dart'; class SoshGridSemanticTokens extends OudsGridSemanticTokens { @override - double get compactColumnGap => GridRawTokens.gridColumnGap100; + double get compactColumnGap => GridRawTokens.gridColumnGap200; @override double get compactMargin => GridRawTokens.gridMargin300; @override diff --git a/ouds_theme_sosh/lib/semantic/sosh_opacity_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_opacity_semantic_tokens.dart index 66d584dd9..c9b1adaea 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_opacity_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_opacity_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_opacity_semantic_tokens.dart'; diff --git a/ouds_theme_sosh/lib/semantic/sosh_size_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_size_semantic_tokens.dart index e14b99655..c548bccec 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_size_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_size_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_size_semantic_tokens.dart'; @@ -126,7 +126,7 @@ class SoshSizeSemanticTokens extends OudsSizeSemanticTokens { @override double get iconWithLabelLargeSizeSmall => DimensionRawTokens.dimension300; @override - double get iconWithLabelLargeSizeXlarge => DimensionRawTokens.dimension550; + double get iconWithLabelLargeSizeXlarge => DimensionRawTokens.dimension450; @override double get iconWithLabelLargeSizeXsmall => DimensionRawTokens.dimension250; @override @@ -146,67 +146,69 @@ class SoshSizeSemanticTokens extends OudsSizeSemanticTokens { @override double get iconWithLabelSmallSizeXsmall => DimensionRawTokens.dimensionOutOfSystem250; @override - double get iconWithLabelXlargeSizeLarge => DimensionRawTokens.dimension550; + double get iconWithLabelXlargeSizeLarge => DimensionRawTokens.dimension500; @override - double get iconWithLabelXlargeSizeMedium => DimensionRawTokens.dimension500; + double get iconWithLabelXlargeSizeMedium => DimensionRawTokens.dimension450; @override double get iconWithLabelXlargeSizeSmall => DimensionRawTokens.dimension400; @override - double get maxWidthTypeBodyLargeMobile => DimensionRawTokens.dimension6000; + double get iconWithLabelXlargeSizeXsmall => DimensionRawTokens.dimension350; @override - double get maxWidthTypeBodyLargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodyLargeMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodyMediumMobile => DimensionRawTokens.dimension6000; + double get maxWidthBodyLargeTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodyMediumTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodyMediumMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodySmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthBodyMediumTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodySmallTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodySmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeDisplayLargeMobile => DimensionRawTokens.dimension9000; + double get maxWidthBodySmallTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeDisplayLargeTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplayLargeMobile => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplayMediumMobile => DimensionRawTokens.dimension9000; + double get maxWidthDisplayLargeTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplayMediumTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplayMediumMobile => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplaySmallMobile => DimensionRawTokens.dimension9000; + double get maxWidthDisplayMediumTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplaySmallTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplaySmallMobile => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeHeadingLargeMobile => DimensionRawTokens.dimension7000; + double get maxWidthDisplaySmallTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeHeadingLargeTablet => DimensionRawTokens.dimension9000; + double get maxWidthHeadingLargeMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingMediumMobile => DimensionRawTokens.dimension7000; + double get maxWidthHeadingLargeTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeHeadingMediumTablet => DimensionRawTokens.dimension7000; + double get maxWidthHeadingMediumMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingSmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthHeadingMediumTablet => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingSmallTablet => DimensionRawTokens.dimension7000; + double get maxWidthHeadingSmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeHeadingXlargeMobile => DimensionRawTokens.dimension7000; + double get maxWidthHeadingSmallTablet => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingXlargeTablet => DimensionRawTokens.dimension9000; + double get maxWidthHeadingXlargeMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeLabelLargeMobile => DimensionRawTokens.dimension6000; + double get maxWidthHeadingXlargeTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeLabelLargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelLargeMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelMediumMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelLargeTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelMediumTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelMediumMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelSmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelMediumTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelSmallTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelSmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelXlargeMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelSmallTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelXlargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelXlargeMobile => DimensionRawTokens.dimension6000; + @override + double get maxWidthLabelXlargeTablet => DimensionRawTokens.dimension6000; @override double get minInteractiveArea => DimensionRawTokens.dimension600; } diff --git a/ouds_theme_sosh/lib/semantic/sosh_space_semantic_tokens.dart b/ouds_theme_sosh/lib/semantic/sosh_space_semantic_tokens.dart index 8b83ad2ed..cfabf1d3c 100644 --- a/ouds_theme_sosh/lib/semantic/sosh_space_semantic_tokens.dart +++ b/ouds_theme_sosh/lib/semantic/sosh_space_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Sosh brand tokens version 2.3.0 +// Sosh brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_space_semantic_tokens.dart'; diff --git a/ouds_theme_sosh/pubspec.yaml b/ouds_theme_sosh/pubspec.yaml index 2baa52ef0..b66e1d6a7 100644 --- a/ouds_theme_sosh/pubspec.yaml +++ b/ouds_theme_sosh/pubspec.yaml @@ -1,8 +1,8 @@ name: ouds_theme_sosh description: 'Sosh theme implementation for OUDS, with branding-specific design tokens.' -version: 1.3.1 repository: https://github.com/Orange-OpenSource/ouds-flutter homepage: https://flutter.unified-design-system.orange.com +version: 2.0.0 environment: sdk: ^3.9.0 @@ -13,9 +13,12 @@ resolution: workspace dependencies: flutter: sdk: flutter - ouds_core: ^1.3.1 - ouds_theme_contract: ^1.3.1 - ouds_global_raw_tokens: ^1.3.1 + # Core + ouds_core: ^2.0.0 + # Theme contract + ouds_theme_contract: ^2.0.0 + # Global raw token + ouds_global_raw_tokens: ^2.0.0 dev_dependencies: flutter_test: @@ -45,6 +48,7 @@ flutter: - assets/component/alert/ - assets/component/checkbox/ - assets/component/chip/ + - assets/component/badge-icon/ - assets/component/bullet-list/ - assets/component/button/ - assets/component/link/ diff --git a/ouds_theme_wireframe/CHANGELOG.md b/ouds_theme_wireframe/CHANGELOG.md index 97a764355..1bed70a17 100644 --- a/ouds_theme_wireframe/CHANGELOG.md +++ b/ouds_theme_wireframe/CHANGELOG.md @@ -4,20 +4,25 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop) +## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/2.0.0...develop) ### Added ### Changed ### Fixed -## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 +## [2.0.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...2.0.0) - 2026-06-19 ### Added ### Changed +- [Library] update tokens 2.5.0 ([#778](https://github.com/Orange-OpenSource/ouds-flutter/issues/778)) +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) ### Fixed +## [1.3.1](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.0...1.3.1) - 2026-05-14 + ## [1.3.0](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.2.0...1.3.0) - 2026-05-08 ### Added ### Changed +- [Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726)) - [Library] update tokens 1.9.0 - Component Bullet List ([#710](https://github.com/Orange-OpenSource/ouds-flutter/issues/710)) - [Library] update tokens 1.9.0 - Component Alert ([#672](https://github.com/Orange-OpenSource/ouds-flutter/issues/672)) diff --git a/ouds_theme_wireframe/README.md b/ouds_theme_wireframe/README.md index 7f10c20a7..56810d13a 100644 --- a/ouds_theme_wireframe/README.md +++ b/ouds_theme_wireframe/README.md @@ -14,7 +14,7 @@ To use **Theme Wireframe**, add it as a dependency in your `pubspec.yaml` file. ```yaml dependencies: - ouds_theme_wireframe: ^1.3.1 + ouds_theme_wireframe: ^2.0.0 ``` ## Other OUDS Libraries diff --git a/ouds_theme_wireframe/assets/communication/accessibility/accessibility-vision.svg b/ouds_theme_wireframe/assets/communication/accessibility/accessibility-vision.svg index d88d03daf..364797cb3 100644 --- a/ouds_theme_wireframe/assets/communication/accessibility/accessibility-vision.svg +++ b/ouds_theme_wireframe/assets/communication/accessibility/accessibility-vision.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/communication/security-and-safety/lock.svg b/ouds_theme_wireframe/assets/communication/security-and-safety/lock.svg index a0338915a..f347e64a8 100644 --- a/ouds_theme_wireframe/assets/communication/security-and-safety/lock.svg +++ b/ouds_theme_wireframe/assets/communication/security-and-safety/lock.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/alert/error-fill.svg b/ouds_theme_wireframe/assets/component/alert/error-fill.svg new file mode 100644 index 000000000..cac9fb201 --- /dev/null +++ b/ouds_theme_wireframe/assets/component/alert/error-fill.svg @@ -0,0 +1,4 @@ + + + + diff --git a/ouds_theme_wireframe/assets/component/alert/important-fill.svg b/ouds_theme_wireframe/assets/component/alert/important-fill.svg index 5e38bf105..3bb331903 100644 --- a/ouds_theme_wireframe/assets/component/alert/important-fill.svg +++ b/ouds_theme_wireframe/assets/component/alert/important-fill.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/alert/info-fill.svg b/ouds_theme_wireframe/assets/component/alert/info-fill.svg index 21c72e769..f9310ba2e 100644 --- a/ouds_theme_wireframe/assets/component/alert/info-fill.svg +++ b/ouds_theme_wireframe/assets/component/alert/info-fill.svg @@ -1,4 +1,4 @@ - - + + diff --git a/ouds_theme_wireframe/assets/component/alert/tick-confirmation-fill.svg b/ouds_theme_wireframe/assets/component/alert/tick-confirmation-fill.svg index 1ef5e7fc8..87c9ff2c0 100644 --- a/ouds_theme_wireframe/assets/component/alert/tick-confirmation-fill.svg +++ b/ouds_theme_wireframe/assets/component/alert/tick-confirmation-fill.svg @@ -1,4 +1,4 @@ - - + + diff --git a/ouds_theme_wireframe/assets/component/alert/warning-external-shape.svg b/ouds_theme_wireframe/assets/component/alert/warning-external-shape.svg index e7055de69..9e316cd42 100644 --- a/ouds_theme_wireframe/assets/component/alert/warning-external-shape.svg +++ b/ouds_theme_wireframe/assets/component/alert/warning-external-shape.svg @@ -1,4 +1,4 @@ - - + + diff --git a/ouds_theme_wireframe/assets/component/alert/warning-internal-shape.svg b/ouds_theme_wireframe/assets/component/alert/warning-internal-shape.svg index bbbe4c9e6..ffd540f13 100644 --- a/ouds_theme_wireframe/assets/component/alert/warning-internal-shape.svg +++ b/ouds_theme_wireframe/assets/component/alert/warning-internal-shape.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/alert/warning.svg b/ouds_theme_wireframe/assets/component/alert/warning.svg index 5875cfb57..28df636d8 100644 --- a/ouds_theme_wireframe/assets/component/alert/warning.svg +++ b/ouds_theme_wireframe/assets/component/alert/warning.svg @@ -1,6 +1,6 @@ - + diff --git a/ouds_theme_wireframe/assets/component/badge-icon/error-fill.svg b/ouds_theme_wireframe/assets/component/badge-icon/error-fill.svg new file mode 100644 index 000000000..50c000458 --- /dev/null +++ b/ouds_theme_wireframe/assets/component/badge-icon/error-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_wireframe/assets/component/badge-icon/info-fill.svg b/ouds_theme_wireframe/assets/component/badge-icon/info-fill.svg new file mode 100644 index 000000000..13d1811ce --- /dev/null +++ b/ouds_theme_wireframe/assets/component/badge-icon/info-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_wireframe/assets/component/badge-icon/tick-confirmation-fill.svg b/ouds_theme_wireframe/assets/component/badge-icon/tick-confirmation-fill.svg new file mode 100644 index 000000000..d61854588 --- /dev/null +++ b/ouds_theme_wireframe/assets/component/badge-icon/tick-confirmation-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_wireframe/assets/component/badge-icon/warning-external-shape.svg b/ouds_theme_wireframe/assets/component/badge-icon/warning-external-shape.svg new file mode 100644 index 000000000..337cf1974 --- /dev/null +++ b/ouds_theme_wireframe/assets/component/badge-icon/warning-external-shape.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ouds_theme_wireframe/assets/component/badge-icon/warning-internal-shape.svg b/ouds_theme_wireframe/assets/component/badge-icon/warning-internal-shape.svg new file mode 100644 index 000000000..87fb8f355 --- /dev/null +++ b/ouds_theme_wireframe/assets/component/badge-icon/warning-internal-shape.svg @@ -0,0 +1,3 @@ + + + diff --git a/ouds_theme_wireframe/assets/component/button/expanded-false.svg b/ouds_theme_wireframe/assets/component/button/expanded-false.svg index 147bc32d4..98bea2da3 100644 --- a/ouds_theme_wireframe/assets/component/button/expanded-false.svg +++ b/ouds_theme_wireframe/assets/component/button/expanded-false.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/button/expanded-true.svg b/ouds_theme_wireframe/assets/component/button/expanded-true.svg index 876d540ff..31d54c7bc 100644 --- a/ouds_theme_wireframe/assets/component/button/expanded-true.svg +++ b/ouds_theme_wireframe/assets/component/button/expanded-true.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/button/expurge.svg b/ouds_theme_wireframe/assets/component/button/expurge.svg index 7e4b9738f..14493cf7a 100644 --- a/ouds_theme_wireframe/assets/component/button/expurge.svg +++ b/ouds_theme_wireframe/assets/component/button/expurge.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/button/increment-higher.svg b/ouds_theme_wireframe/assets/component/button/increment-higher.svg index 27c06c393..be6b40a71 100644 --- a/ouds_theme_wireframe/assets/component/button/increment-higher.svg +++ b/ouds_theme_wireframe/assets/component/button/increment-higher.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/button/increment-lower.svg b/ouds_theme_wireframe/assets/component/button/increment-lower.svg index 979dcf745..d56948334 100644 --- a/ouds_theme_wireframe/assets/component/button/increment-lower.svg +++ b/ouds_theme_wireframe/assets/component/button/increment-lower.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/button/next.svg b/ouds_theme_wireframe/assets/component/button/next.svg index f58ba75cb..ebf05bd61 100644 --- a/ouds_theme_wireframe/assets/component/button/next.svg +++ b/ouds_theme_wireframe/assets/component/button/next.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/button/previous.svg b/ouds_theme_wireframe/assets/component/button/previous.svg index 97cdc6c9a..7ff70f441 100644 --- a/ouds_theme_wireframe/assets/component/button/previous.svg +++ b/ouds_theme_wireframe/assets/component/button/previous.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/checkbox/checkbox-selected.svg b/ouds_theme_wireframe/assets/component/checkbox/checkbox-selected.svg index f5b93c193..e64ac6a33 100644 --- a/ouds_theme_wireframe/assets/component/checkbox/checkbox-selected.svg +++ b/ouds_theme_wireframe/assets/component/checkbox/checkbox-selected.svg @@ -1,6 +1,6 @@ - + diff --git a/ouds_theme_wireframe/assets/component/checkbox/checkbox-undetermined.svg b/ouds_theme_wireframe/assets/component/checkbox/checkbox-undetermined.svg index 924a56178..7c078f81a 100644 --- a/ouds_theme_wireframe/assets/component/checkbox/checkbox-undetermined.svg +++ b/ouds_theme_wireframe/assets/component/checkbox/checkbox-undetermined.svg @@ -1,6 +1,6 @@ - + diff --git a/ouds_theme_wireframe/assets/component/chip/expanded-false.svg b/ouds_theme_wireframe/assets/component/chip/expanded-false.svg index 147bc32d4..98bea2da3 100644 --- a/ouds_theme_wireframe/assets/component/chip/expanded-false.svg +++ b/ouds_theme_wireframe/assets/component/chip/expanded-false.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/chip/expanded-true.svg b/ouds_theme_wireframe/assets/component/chip/expanded-true.svg index 876d540ff..31d54c7bc 100644 --- a/ouds_theme_wireframe/assets/component/chip/expanded-true.svg +++ b/ouds_theme_wireframe/assets/component/chip/expanded-true.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/chip/tick.svg b/ouds_theme_wireframe/assets/component/chip/tick.svg index d9248b5ac..42d5a6da3 100644 --- a/ouds_theme_wireframe/assets/component/chip/tick.svg +++ b/ouds_theme_wireframe/assets/component/chip/tick.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/link/expanded-false.svg b/ouds_theme_wireframe/assets/component/link/expanded-false.svg index c771419ab..6768c516b 100644 --- a/ouds_theme_wireframe/assets/component/link/expanded-false.svg +++ b/ouds_theme_wireframe/assets/component/link/expanded-false.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/link/expanded-true.svg b/ouds_theme_wireframe/assets/component/link/expanded-true.svg index 18dde0615..f066a9932 100644 --- a/ouds_theme_wireframe/assets/component/link/expanded-true.svg +++ b/ouds_theme_wireframe/assets/component/link/expanded-true.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/link/next.svg b/ouds_theme_wireframe/assets/component/link/next.svg index f58ba75cb..ebf05bd61 100644 --- a/ouds_theme_wireframe/assets/component/link/next.svg +++ b/ouds_theme_wireframe/assets/component/link/next.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/link/previous.svg b/ouds_theme_wireframe/assets/component/link/previous.svg index 97cdc6c9a..7ff70f441 100644 --- a/ouds_theme_wireframe/assets/component/link/previous.svg +++ b/ouds_theme_wireframe/assets/component/link/previous.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/radio-button/radio-button-selected.svg b/ouds_theme_wireframe/assets/component/radio-button/radio-button-selected.svg index e0dacc193..218408bef 100644 --- a/ouds_theme_wireframe/assets/component/radio-button/radio-button-selected.svg +++ b/ouds_theme_wireframe/assets/component/radio-button/radio-button-selected.svg @@ -1,6 +1,6 @@ - + diff --git a/ouds_theme_wireframe/assets/component/switch/selected-switch.svg b/ouds_theme_wireframe/assets/component/switch/selected-switch.svg index d9248b5ac..42d5a6da3 100644 --- a/ouds_theme_wireframe/assets/component/switch/selected-switch.svg +++ b/ouds_theme_wireframe/assets/component/switch/selected-switch.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/component/tag/close.svg b/ouds_theme_wireframe/assets/component/tag/close.svg index 2c5ef3f2f..a602131c4 100644 --- a/ouds_theme_wireframe/assets/component/tag/close.svg +++ b/ouds_theme_wireframe/assets/component/tag/close.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/functional/actions/delete.svg b/ouds_theme_wireframe/assets/functional/actions/delete.svg index ef783f781..ce09a0da2 100644 --- a/ouds_theme_wireframe/assets/functional/actions/delete.svg +++ b/ouds_theme_wireframe/assets/functional/actions/delete.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/functional/navigation/form-chevron-left.svg b/ouds_theme_wireframe/assets/functional/navigation/form-chevron-left.svg index 6ed76a81b..8a8cd55cc 100644 --- a/ouds_theme_wireframe/assets/functional/navigation/form-chevron-left.svg +++ b/ouds_theme_wireframe/assets/functional/navigation/form-chevron-left.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/functional/navigation/menu.svg b/ouds_theme_wireframe/assets/functional/navigation/menu.svg index c2bb35759..82562f1ba 100644 --- a/ouds_theme_wireframe/assets/functional/navigation/menu.svg +++ b/ouds_theme_wireframe/assets/functional/navigation/menu.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/functional/settings-and-tools/hide.svg b/ouds_theme_wireframe/assets/functional/settings-and-tools/hide.svg index 29069193b..2ba6f19d3 100644 --- a/ouds_theme_wireframe/assets/functional/settings-and-tools/hide.svg +++ b/ouds_theme_wireframe/assets/functional/settings-and-tools/hide.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/assets/functional/social-and-engagement/heart-empty.svg b/ouds_theme_wireframe/assets/functional/social-and-engagement/heart-empty.svg index 9ecdfc9ae..242ca92b9 100644 --- a/ouds_theme_wireframe/assets/functional/social-and-engagement/heart-empty.svg +++ b/ouds_theme_wireframe/assets/functional/social-and-engagement/heart-empty.svg @@ -1,3 +1,3 @@ - + diff --git a/ouds_theme_wireframe/lib/components/wireframe_alert_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_alert_tokens.dart index 9bbf5d78d..f3992fc8e 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_alert_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_alert_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_theme_wireframe/lib/components/wireframe_badge_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_badge_tokens.dart index d74ebbfeb..272c21f40 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_badge_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_badge_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; @@ -31,7 +31,11 @@ class WireframeBadgeTokens extends OudsBadgeTokens { @override double get sizeXsmall => DimensionRawTokens.dimension100; @override - double get spaceInset => DimensionRawTokens.dimensionOutOfSystem75; + double get spaceInsetMediumLarge => DimensionRawTokens.dimensionOutOfSystem75; + @override + double get spaceInsetSmall => DimensionRawTokens.dimensionOutOfSystem50; + @override + double get spaceInsetXsmall => DimensionRawTokens.dimensionOutOfSystem25; @override double get spacePaddingInlineLarge => providersTokens.spaceTokens.paddingInline2xsmall; @override diff --git a/ouds_theme_wireframe/lib/components/wireframe_bar_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_bar_tokens.dart index 5b0f277da..1f36ed13b 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_bar_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_bar_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -19,6 +19,7 @@ import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; import 'package:ouds_global_raw_tokens/effect_raw_tokens.dart'; import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; import 'package:ouds_theme_contract/theme/tokens/components/ouds_bar_tokens.dart'; +import 'package:ouds_theme_wireframe/raw/wireframe_color_raw_tokens.dart'; class WireframeBarTokens extends OudsBarTokens { final OudsProvidersTokens providersTokens; @@ -26,71 +27,71 @@ class WireframeBarTokens extends OudsBarTokens { WireframeBarTokens(this.providersTokens); @override - double get borderRadiusActiveIndicatorCustomBottom => providersTokens.borderTokens.radiusPill; + double get borderRadiusCurrentIndicatorCustomBottom => providersTokens.borderTokens.radiusPill; @override - double get borderRadiusActiveIndicatorCustomTop => providersTokens.borderTokens.radiusDefault; + double get borderRadiusCurrentIndicatorCustomTop => providersTokens.borderTokens.radiusDefault; @override - Color get colorActiveIndicatorAndroidSelectedDisabled => providersTokens.colorScheme.actionSupportDisabled; + Color get colorBgOpaque => providersTokens.colorScheme.bgSecondary; @override - Color get colorActiveIndicatorAndroidSelectedEnabled => providersTokens.colorScheme.actionSupportEnabled; + Color get colorBgTranslucentDark => WireframeColorRawTokens.colorOpacityGrayDark880800; @override - Color get colorActiveIndicatorAndroidSelectedFocus => providersTokens.colorScheme.actionSupportFocus; + Color get colorBgTranslucentLight => ColorRawTokens.colorOpacityWhite800; @override - Color get colorActiveIndicatorAndroidSelectedHover => providersTokens.colorScheme.actionSupportHover; + Color get colorBorderBadge => providersTokens.colorScheme.bgSecondary; @override - Color get colorActiveIndicatorAndroidSelectedPressed => providersTokens.colorScheme.actionSupportPressed; + Color get colorContentOnIosAccent => providersTokens.colorScheme.contentOnActionSelected; @override - Color get colorActiveIndicatorAndroidUnselectedDisabled => providersTokens.colorScheme.actionSupportDisabled; + Color get colorContentSelectedEnabled => providersTokens.colorScheme.actionSelected; @override - Color get colorActiveIndicatorAndroidUnselectedFocus => providersTokens.colorScheme.actionSupportFocus; + Color get colorContentSelectedFocus => providersTokens.colorScheme.actionFocus; @override - Color get colorActiveIndicatorAndroidUnselectedHover => providersTokens.colorScheme.actionSupportHover; + Color get colorContentSelectedHover => providersTokens.colorScheme.actionHover; @override - Color get colorActiveIndicatorAndroidUnselectedPressed => providersTokens.colorScheme.actionSupportPressed; + Color get colorContentSelectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorActiveIndicatorCustomSelectedEnabled => providersTokens.colorScheme.actionSelected; + Color get colorContentUnselectedEnabled => providersTokens.colorScheme.contentMuted; @override - Color get colorActiveIndicatorCustomSelectedFocus => providersTokens.colorScheme.actionFocus; + Color get colorContentUnselectedFocus => providersTokens.colorScheme.actionFocus; @override - Color get colorActiveIndicatorCustomSelectedHover => providersTokens.colorScheme.actionHover; + Color get colorContentUnselectedHover => providersTokens.colorScheme.actionHover; @override - Color get colorActiveIndicatorCustomSelectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorContentUnselectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorBgOpaque => providersTokens.colorScheme.bgSecondary; + Color get colorCurrentIndicatorAndroidSelectedDisabled => providersTokens.colorScheme.actionSupportDisabled; @override - Color get colorBgTranslucentDark => ColorRawTokens.colorOpacityGrayDark800800; + Color get colorCurrentIndicatorAndroidSelectedEnabled => providersTokens.colorScheme.actionSupportEnabled; @override - Color get colorBgTranslucentLight => ColorRawTokens.colorOpacityGrayLight80800; + Color get colorCurrentIndicatorAndroidSelectedFocus => providersTokens.colorScheme.actionSupportFocus; @override - Color get colorBorderBadge => providersTokens.colorScheme.bgSecondary; + Color get colorCurrentIndicatorAndroidSelectedHover => providersTokens.colorScheme.actionSupportHover; @override - Color get colorContentOnIosAccent => providersTokens.colorScheme.contentOnActionSelected; + Color get colorCurrentIndicatorAndroidSelectedPressed => providersTokens.colorScheme.actionSupportPressed; @override - Color get colorContentSelectedEnabled => providersTokens.colorScheme.actionSelected; + Color get colorCurrentIndicatorAndroidUnselectedDisabled => providersTokens.colorScheme.actionSupportDisabled; @override - Color get colorContentSelectedFocus => providersTokens.colorScheme.actionFocus; + Color get colorCurrentIndicatorAndroidUnselectedFocus => providersTokens.colorScheme.actionSupportFocus; @override - Color get colorContentSelectedHover => providersTokens.colorScheme.actionHover; + Color get colorCurrentIndicatorAndroidUnselectedHover => providersTokens.colorScheme.actionSupportHover; @override - Color get colorContentSelectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorCurrentIndicatorAndroidUnselectedPressed => providersTokens.colorScheme.actionSupportPressed; @override - Color get colorContentUnselectedEnabledDark => ColorRawTokens.colorOpacityWhite600; + Color get colorCurrentIndicatorCustomSelectedEnabled => providersTokens.colorScheme.actionSelected; @override - Color get colorContentUnselectedEnabledLight => ColorRawTokens.colorOpacityBlack600; + Color get colorCurrentIndicatorCustomSelectedFocus => providersTokens.colorScheme.actionFocus; @override - Color get colorContentUnselectedFocus => providersTokens.colorScheme.actionFocus; + Color get colorCurrentIndicatorCustomSelectedHover => providersTokens.colorScheme.actionHover; @override - Color get colorContentUnselectedHover => providersTokens.colorScheme.actionHover; + Color get colorCurrentIndicatorCustomSelectedPressed => providersTokens.colorScheme.actionPressed; @override - Color get colorContentUnselectedPressed => providersTokens.colorScheme.actionPressed; + Color get colorIosAccent => providersTokens.colorScheme.actionSelected; @override - int get effectBgBlur => EffectRawTokens.effectBlur160; + int get effectBgBlur => EffectRawTokens.effectBlur320; @override - double get opacityActiveIndicatorCustom => providersTokens.opacityTokens.invisible; + double get opacityCurrentIndicatorCustom => providersTokens.opacityTokens.invisible; @override - double get sizeHeightActiveIndicatorCustom => DimensionRawTokens.dimensionOutOfSystem75; + double get sizeHeightCurrentIndicatorCustom => DimensionRawTokens.dimensionOutOfSystem75; @override - double get sizeWidthActiveIndicatorCustomBottom => DimensionRawTokens.dimension300; + double get sizeWidthCurrentIndicatorCustomBottom => DimensionRawTokens.dimension300; @override - double get sizeWidthActiveIndicatorCustomTop => DimensionRawTokens.dimension650; + double get sizeWidthCurrentIndicatorCustomTop => DimensionRawTokens.dimension500; } diff --git a/ouds_theme_wireframe/lib/components/wireframe_bulletList_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_bulletList_tokens.dart index 885433280..57318f473 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_bulletList_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_bulletList_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_theme_wireframe/lib/components/wireframe_buttonMono_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_buttonMono_tokens.dart index 17b3ce094..2686c5d80 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_buttonMono_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_buttonMono_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_wireframe/lib/components/wireframe_button_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_button_tokens.dart index 709970e6e..5ca972542 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_button_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_button_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -41,9 +41,9 @@ class WireframeButtonTokens extends OudsButtonTokens { @override Color get colorBgBrandHover => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositorySecondaryHigh, providersTokens.colorScheme.repositorySecondaryLower); @override - Color get colorBgBrandLoading => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositorySecondaryHigher, providersTokens.colorScheme.repositorySecondaryLowest); + Color get colorBgBrandLoading => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositorySecondaryHigherHigh, providersTokens.colorScheme.repositorySecondaryLowest); @override - Color get colorBgBrandPressed => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositorySecondaryHigher, providersTokens.colorScheme.repositorySecondaryLowest); + Color get colorBgBrandPressed => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositorySecondaryHigherHigh, providersTokens.colorScheme.repositorySecondaryLowest); @override Color get colorBgDefaultDisabled => providersTokens.colorScheme.actionDisabled; @override diff --git a/ouds_theme_wireframe/lib/components/wireframe_checkbox_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_checkbox_tokens.dart index fb59094e5..f70f0c93e 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_checkbox_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_checkbox_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; @@ -39,6 +39,7 @@ class WireframeCheckboxTokens extends OudsCheckboxTokens { double get borderWidthUnselectedHover => providersTokens.borderTokens.widthMedium; @override double get borderWidthUnselectedPressed => providersTokens.borderTokens.widthMedium; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; @override diff --git a/ouds_theme_wireframe/lib/components/wireframe_chip_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_chip_tokens.dart index 9aab2e068..8f3a855ae 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_chip_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_chip_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_wireframe/lib/components/wireframe_controlItem_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_controlItem_tokens.dart index db59dafdc..10b84fd8f 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_controlItem_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_controlItem_tokens.dart @@ -10,11 +10,12 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; +import 'package:ouds_global_raw_tokens/font_raw_tokens.dart'; import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; import 'package:ouds_theme_contract/theme/tokens/components/ouds_controlItem_tokens.dart'; @@ -24,41 +25,131 @@ class WireframeControlItemTokens extends OudsControlItemTokens { WireframeControlItemTokens(this.providersTokens); @override - double get borderRadius => providersTokens.borderTokens.radiusNone; + double get borderRadiusCurrentIndicator => providersTokens.borderTokens.radiusDefault; + @override + double get borderRadiusDefault => providersTokens.borderTokens.radiusDefault; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get borderRadiusItemOnly => providersTokens.borderTokens.radiusDefault; @override + double get borderRadiusMedia => providersTokens.borderTokens.radiusDefault; + @override + double get borderRadiusMediaRoundedCorner => providersTokens.borderTokens.radiusSmall; + @override + double get borderRadiusRounded => providersTokens.borderTokens.radiusDefault; + @override + double get borderWidthCurrentPage => providersTokens.borderTokens.widthMedium; + @override + double get borderWidthDefault => providersTokens.borderTokens.widthDefault; + @override + Color get colorBadgeSafetyArea => providersTokens.colorScheme.bgPrimary; + @override + Color get colorBgCurrentDisabled => providersTokens.colorScheme.actionDisabled; + @override + Color get colorBgCurrentEnabled => providersTokens.colorScheme.actionSelected; + @override + Color get colorBgCurrentFocus => providersTokens.colorScheme.actionFocus; + @override + Color get colorBgCurrentHover => providersTokens.colorScheme.actionHover; + @override + Color get colorBgCurrentPressed => providersTokens.colorScheme.actionPressed; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override Color get colorBgFocus => providersTokens.colorScheme.actionSupportFocus; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgHover => providersTokens.colorScheme.actionSupportHover; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgLoading => providersTokens.colorScheme.actionSupportLoading; + @Deprecated("This token is deprecated and will be removed in a future version.") @override Color get colorBgPressed => providersTokens.colorScheme.actionSupportPressed; @override + Color get colorContentCurrentDisabled => providersTokens.colorScheme.contentOnActionDisabled; + @override + Color get colorContentCurrentEnabled => providersTokens.colorScheme.contentOnActionSelected; + @override + Color get colorContentCurrentFocus => providersTokens.colorScheme.contentOnActionFocus; + @override + Color get colorContentCurrentHover => providersTokens.colorScheme.contentOnActionHover; + @override + Color get colorContentCurrentPressed => providersTokens.colorScheme.contentOnActionPressed; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override Color get colorContentLoader => providersTokens.colorScheme.actionLoading; @override + double get fontLetterSpacingAvatarInitialXlarge => FontRawTokens.fontLetterSpacing450; + @override + double get fontLineHeightAvatarInitialXlarge => FontRawTokens.fontLineHeight650; + @override + double get fontSizeAvatarInitialXlarge => FontRawTokens.fontSize450; + @override + double get opacityCurrentDivider => providersTokens.opacityTokens.invisible; + @override + double get opacityCurrentIndicator => providersTokens.opacityTokens.invisible; + @override + double get sizeAssetLarge => DimensionRawTokens.dimension500; + @override + double get sizeAssetMedium => providersTokens.sizeTokens.iconWithLabelLargeSizeMedium; + @override + double get sizeAssetSmall => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; + @override + double get sizeAssetXlarge => DimensionRawTokens.dimension700; + @override + double get sizeControlIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; + @override + double get sizeCurrentIndicatorWidth => DimensionRawTokens.dimension50; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get sizeErrorIcon => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; @override + double get sizeFlagHeight => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get sizeIcon => providersTokens.sizeTokens.iconWithLabelLargeSizeMedium; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeLoader => providersTokens.sizeTokens.iconWithLabelLargeSizeSmall; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get sizeMaxHeightAssetsContainer => DimensionRawTokens.dimension1200; @override double get sizeMaxWidth => DimensionRawTokens.dimension4000; @override - double get sizeMinHeight => DimensionRawTokens.dimension650; + double get sizeMinHeightCompact => providersTokens.sizeTokens.minInteractiveArea; + @override + double get sizeMinHeightDefault => DimensionRawTokens.dimension750; @override double get sizeMinWidth => DimensionRawTokens.dimension2000; @override double get spaceColumnGap => providersTokens.spaceTokens.columnGapMedium; @override + double get spacePaddingBlockBottomSlot => providersTokens.spaceTokens.paddingBlock3xsmall; + @Deprecated("This token is deprecated and will be removed in a future version.") + @override double get spacePaddingBlockDefault => providersTokens.spaceTokens.paddingBlockMedium; @override - double get spacePaddingBlockTopErrorText => providersTokens.spaceTokens.paddingBlockXsmall; + double get spacePaddingBlockDensityCompact => providersTokens.spaceTokens.paddingBlockXsmall; + @override + double get spacePaddingBlockDensityCompactBottomExpandContainer => providersTokens.spaceTokens.paddingBlock2xlarge; + @override + double get spacePaddingBlockDensityCompactTopAlignmentTopCounterweight => providersTokens.spaceTokens.paddingBlockXsmall; + @override + double get spacePaddingBlockDensityCompactTopAlignmentTopTextContainer => providersTokens.spaceTokens.paddingBlockNone; + @override + double get spacePaddingBlockDensityDefault => providersTokens.spaceTokens.paddingBlockMedium; + @override + double get spacePaddingBlockDensityDefaultBottomExpandContainer => providersTokens.spaceTokens.paddingBlock3xlarge; + @override + double get spacePaddingBlockDensityDefaultTopAlignmentTopCounterweight => providersTokens.spaceTokens.paddingBlockSmall; + @override + double get spacePaddingBlockDensityDefaultTopAlignmentTopTextContainer => providersTokens.spaceTokens.paddingBlock4xsmall; + @override + double get spacePaddingBlockTopHelperText => providersTokens.spaceTokens.paddingBlockXsmall; @override double get spacePaddingInline => providersTokens.spaceTokens.paddingInlineLarge; + @Deprecated("This token is deprecated and will be removed in a future version.") @override double get spacePaddingInlineErrorIcon => providersTokens.spaceTokens.paddingInline4xsmall; @override diff --git a/ouds_theme_wireframe/lib/components/wireframe_divider_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_divider_tokens.dart index 003f0a3e2..076bc7154 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_divider_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_divider_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; diff --git a/ouds_theme_wireframe/lib/components/wireframe_icon_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_icon_tokens.dart index 5b29b6a93..173ff30f9 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_icon_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_icon_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -22,10 +22,12 @@ class WireframeIconTokens extends OudsIconTokens { WireframeIconTokens(this.providersTokens); - @override - Color get colorContentDefault => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryNeutralEmphasizedBlack, providersTokens.colorScheme.repositoryNeutralMutedLower); @override Color get colorContentStatusWarningExternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningMedium, providersTokens.colorScheme.repositoryWarningLow); @override Color get colorContentStatusWarningInternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningHigh, providersTokens.colorScheme.opacityTransparent); + @override + Color get colorContentStatusWarningInverseExternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.repositoryWarningLow, providersTokens.colorScheme.repositoryWarningMedium); + @override + Color get colorContentStatusWarningInverseInternalShape => providersTokens.colorScheme.lightDark(providersTokens.colorScheme.opacityTransparent, providersTokens.colorScheme.repositoryWarningHigh); } diff --git a/ouds_theme_wireframe/lib/components/wireframe_inputTag_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_inputTag_tokens.dart index 014e6f5f3..347c29eee 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_inputTag_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_inputTag_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_wireframe/lib/components/wireframe_linkMono_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_linkMono_tokens.dart index 7eaed3dc9..362e8b98a 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_linkMono_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_linkMono_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_wireframe/lib/components/wireframe_link_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_link_tokens.dart index cd3ed420d..687b86257 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_link_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_link_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_wireframe/lib/components/wireframe_pinCodeInput_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_pinCodeInput_tokens.dart index e3149c366..377a83435 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_pinCodeInput_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_pinCodeInput_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; diff --git a/ouds_theme_wireframe/lib/components/wireframe_radioButton_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_radioButton_tokens.dart index 92df2f4eb..d69bc5351 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_radioButton_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_radioButton_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/ouds_tokens_provider.dart'; @@ -40,8 +40,6 @@ class WireframeRadioButtonTokens extends OudsRadioButtonTokens { @override double get borderWidthUnselectedPressed => providersTokens.borderTokens.widthMedium; @override - double get sizeIndicator => providersTokens.sizeTokens.iconWithLabelLargeSizeXsmall; - @override double get sizeMaxHeight => providersTokens.sizeTokens.minInteractiveArea; @override double get sizeMinHeight => providersTokens.sizeTokens.minInteractiveArea; diff --git a/ouds_theme_wireframe/lib/components/wireframe_skeleton_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_skeleton_tokens.dart index 5555ccc8f..d6efcd5fe 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_skeleton_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_skeleton_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_wireframe/lib/components/wireframe_switch_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_switch_tokens.dart index f166ffebd..7e360da97 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_switch_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_switch_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_wireframe/lib/components/wireframe_tag_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_tag_tokens.dart index ad2f0fb4c..4ae971642 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_tag_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_tag_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_global_raw_tokens/dimension_raw_tokens.dart'; @@ -35,9 +35,9 @@ class WireframeTagTokens extends OudsTagTokens { @override double get sizeMinHeightSmall => DimensionRawTokens.dimension300; @override - double get sizeMinWidthDefault => DimensionRawTokens.dimension600; + double get sizeMinWidthDefault => DimensionRawTokens.dimension400; @override - double get sizeMinWidthSmall => DimensionRawTokens.dimension550; + double get sizeMinWidthSmall => DimensionRawTokens.dimension300; @override double get spaceColumnGapDefault => providersTokens.spaceTokens.columnGap2xsmall; @override diff --git a/ouds_theme_wireframe/lib/components/wireframe_textInput_tokens.dart b/ouds_theme_wireframe/lib/components/wireframe_textInput_tokens.dart index 7e3fd776e..f9b4877bd 100644 --- a/ouds_theme_wireframe/lib/components/wireframe_textInput_tokens.dart +++ b/ouds_theme_wireframe/lib/components/wireframe_textInput_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -58,6 +58,10 @@ class WireframeTextInputTokens extends OudsTextInputTokens { @override double get spaceColumnGapInlineText => providersTokens.spaceTokens.columnGapXsmall; @override + double get spaceColumnGapLabelAsterisk => providersTokens.spaceTokens.columnGap2xsmall; + @override + double get spaceColumnGapLabelSmallAsterisk => DimensionRawTokens.dimensionOutOfSystem75; + @override double get spaceColumnGapTrailingErrorAction => providersTokens.spaceTokens.columnGapXsmall; @override double get spacePaddingBlockDefault => providersTokens.spaceTokens.paddingBlock2xsmall; diff --git a/ouds_theme_wireframe/lib/material/wireframe_material_color_tokens.dart b/ouds_theme_wireframe/lib/material/wireframe_material_color_tokens.dart index 8a632cf77..ab9860ddd 100644 --- a/ouds_theme_wireframe/lib/material/wireframe_material_color_tokens.dart +++ b/ouds_theme_wireframe/lib/material/wireframe_material_color_tokens.dart @@ -13,6 +13,7 @@ // Android system tokens version 1.2.0 // Generated by Tokenator +import 'package:flutter/material.dart'; import 'package:ouds_theme_contract/theme/tokens/material/ouds_material_color_tokens.dart'; import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; import 'package:ouds_theme_wireframe/raw/wireframe_color_raw_tokens.dart'; @@ -21,7 +22,7 @@ class WireframeMaterialColorTokens extends OudsMaterialColorTokens { const WireframeMaterialColorTokens({ super.backgroundDark = WireframeColorRawTokens.colorFunctionalGrayDark880, super.backgroundLight = ColorRawTokens.colorFunctionalWhite, - super.errorContainerDark = ColorRawTokens.colorFunctionalScarlet900, + super.errorContainerDark = const Color(0x00ff0000), super.errorContainerLight = ColorRawTokens.colorFunctionalScarlet100, super.errorDark = ColorRawTokens.colorFunctionalScarlet300, super.errorLight = ColorRawTokens.colorFunctionalScarlet600, diff --git a/ouds_theme_wireframe/lib/raw/wireframe_color_raw_tokens.dart b/ouds_theme_wireframe/lib/raw/wireframe_color_raw_tokens.dart index 0fb0e676e..42b11f0de 100644 --- a/ouds_theme_wireframe/lib/raw/wireframe_color_raw_tokens.dart +++ b/ouds_theme_wireframe/lib/raw/wireframe_color_raw_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe core tokens version 1.3.0 +// Wireframe core tokens version 1.4.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -76,8 +76,7 @@ class WireframeColorRawTokens { static const colorOpacityBlack880 = Color(0xe005052e); static const colorOpacityBlack920 = Color(0xeb05052e); static const colorOpacityBlack960 = Color(0xf505052e); - static const colorOpacityGrayDark800800 = Color(0xcc181c26); - static const colorOpacityGrayLight80800 = Color(0xccf7f8fa); + static const colorOpacityGrayDark880800 = Color(0xcc101319); static const colorOpacityRoyalBlue0 = Color(0x002055e5); static const colorOpacityRoyalBlue40 = Color(0x0a2055e5); static const colorOpacityRoyalBlue80 = Color(0x142055e5); diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_border_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_border_semantic_tokens.dart index 6f37ad8ba..9634df981 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_border_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_border_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_border_semantic_tokens.dart'; @@ -28,13 +28,13 @@ class WireframeBorderSemanticTokens extends OudsBorderSemanticTokens { @override double get radiusPill => BorderRawTokens.borderRadius9999; @override - double get radiusSmall => BorderRawTokens.borderRadius100; + double get radiusSmall => BorderRawTokens.borderRadius75; @override String get styleDefault => BorderRawTokens.borderStyleSolid; @override String get styleDrag => BorderRawTokens.borderStyleDashed; @override - double get widthDefault => BorderRawTokens.borderWidth25; + double get widthDefault => BorderRawTokens.borderWidth50; @override double get widthFocus => BorderRawTokens.borderWidth125; @override @@ -48,5 +48,5 @@ class WireframeBorderSemanticTokens extends OudsBorderSemanticTokens { @override double get widthThicker => BorderRawTokens.borderWidth150; @override - double get widthThin => BorderRawTokens.borderWidth50; + double get widthThin => BorderRawTokens.borderWidth25; } diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_color_action_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_color_action_semantic_tokens.dart index a12733ab6..a0d7b51f0 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_color_action_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_color_action_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_wireframe/raw/wireframe_color_raw_tokens.dart'; @@ -29,8 +29,6 @@ class WireframeColorActionSemanticTokens extends OudsColorActionSemanticTokens { super.actionHighlightedLight = WireframeColorRawTokens.colorRoyalBlue800, super.actionHoverDark = WireframeColorRawTokens.colorRoyalBlue200, super.actionHoverLight = WireframeColorRawTokens.colorRoyalBlue800, - super.actionIosAccentDark = WireframeColorRawTokens.colorRoyalBlue300, - super.actionIosAccentLight = WireframeColorRawTokens.colorRoyalBlue600, super.actionLoadingDark = WireframeColorRawTokens.colorRoyalBlue100, super.actionLoadingLight = WireframeColorRawTokens.colorRoyalBlue900, super.actionNegativeEnabledDark = ColorRawTokens.colorFunctionalScarlet300, diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_color_always_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_color_always_semantic_tokens.dart index d4d8abd3c..d215a94c7 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_color_always_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_color_always_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_wireframe/raw/wireframe_color_raw_tokens.dart'; diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_color_bg_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_color_bg_semantic_tokens.dart index 026abc1de..c57b653c5 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_color_bg_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_color_bg_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_wireframe/raw/wireframe_color_raw_tokens.dart'; diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_color_border_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_color_border_semantic_tokens.dart index 934250590..124ab317d 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_color_border_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_color_border_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -28,12 +28,12 @@ class WireframeColorBorderSemanticTokens extends OudsColorBorderSemanticTokens { super.borderBrandTertiaryLight = const Color(0x00ff0000), super.borderDefaultDark = WireframeColorRawTokens.colorOpacityWhite200, super.borderDefaultLight = WireframeColorRawTokens.colorOpacityBlack200, - super.borderEmphasizedDark = WireframeColorRawTokens.colorOpacityWhite920, + super.borderEmphasizedDark = WireframeColorRawTokens.colorFunctionalGrayLight160, super.borderEmphasizedLight = WireframeColorRawTokens.colorFunctionalGrayDark960, - super.borderFocusDark = WireframeColorRawTokens.colorFunctionalGrayLight160, + super.borderFocusDark = WireframeColorRawTokens.colorRoyalBlue100, super.borderFocusInsetDark = WireframeColorRawTokens.colorFunctionalGrayDark880, super.borderFocusInsetLight = ColorRawTokens.colorFunctionalWhite, - super.borderFocusLight = WireframeColorRawTokens.colorFunctionalGrayDark960, + super.borderFocusLight = WireframeColorRawTokens.colorRoyalBlue900, super.borderMinimalDark = WireframeColorRawTokens.colorOpacityWhite40, super.borderMinimalLight = WireframeColorRawTokens.colorOpacityBlack40, super.borderMutedDark = WireframeColorRawTokens.colorOpacityWhite80, diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_color_content_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_color_content_semantic_tokens.dart index a6aab53b9..d5c6f421d 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_color_content_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_color_content_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_color_opacity_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_color_opacity_semantic_tokens.dart index d541d498c..d81a433ed 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_color_opacity_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_color_opacity_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_wireframe/raw/wireframe_color_raw_tokens.dart'; diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_color_overlay_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_color_overlay_semantic_tokens.dart index 5b3090578..732c11e78 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_color_overlay_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_color_overlay_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_wireframe/raw/wireframe_color_raw_tokens.dart'; @@ -19,12 +19,14 @@ import 'package:ouds_global_raw_tokens/color_raw_tokens.dart'; class WireframeColorOverlaySemanticTokens extends OudsColorOverlaySemanticTokens { const WireframeColorOverlaySemanticTokens({ + super.overlayBackdropDark = WireframeColorRawTokens.colorOpacityBlack680, + super.overlayBackdropLight = WireframeColorRawTokens.colorOpacityBlack680, super.overlayDragDark = WireframeColorRawTokens.colorOpacityWhite80, super.overlayDragLight = WireframeColorRawTokens.colorOpacityBlack40, super.overlayDropdownDark = WireframeColorRawTokens.colorFunctionalGrayDark560, super.overlayDropdownLight = ColorRawTokens.colorFunctionalWhite, - super.overlayModalDark = WireframeColorRawTokens.colorFunctionalGrayDark720, - super.overlayModalLight = ColorRawTokens.colorFunctionalWhite, + super.overlayModalSheetDark = WireframeColorRawTokens.colorFunctionalGrayDark720, + super.overlayModalSheetLight = ColorRawTokens.colorFunctionalWhite, super.overlayTooltipDark = WireframeColorRawTokens.colorFunctionalGrayDark560, super.overlayTooltipLight = WireframeColorRawTokens.colorFunctionalGrayDark720, }); diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_color_repository_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_color_repository_semantic_tokens.dart index 401c96d9f..0787124cc 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_color_repository_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_color_repository_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; @@ -29,14 +29,14 @@ class WireframeColorRepositorySemanticTokens extends OudsColorRepositorySemantic super.repositoryAccentMedium = WireframeColorRawTokens.colorRustyRed600, super.repositoryInfoHigh = ColorRawTokens.colorFunctionalDodgerBlue700, super.repositoryInfoHigher = const Color(0x00ff0000), - super.repositoryInfoHighest = ColorRawTokens.colorFunctionalDodgerBlue900, + super.repositoryInfoHighest = const Color(0x00ff0000), super.repositoryInfoLow = ColorRawTokens.colorFunctionalDodgerBlue300, super.repositoryInfoLower = const Color(0x00ff0000), - super.repositoryInfoLowest = ColorRawTokens.colorFunctionalDodgerBlue100, + super.repositoryInfoLowest = const Color(0x00ff0000), super.repositoryInfoMedium = const Color(0x00ff0000), super.repositoryNegativeHigh = ColorRawTokens.colorFunctionalScarlet700, super.repositoryNegativeHigher = ColorRawTokens.colorFunctionalScarlet800, - super.repositoryNegativeHighest = ColorRawTokens.colorFunctionalScarlet900, + super.repositoryNegativeHighest = const Color(0x00ff0000), super.repositoryNegativeLow = ColorRawTokens.colorFunctionalScarlet300, super.repositoryNegativeLower = ColorRawTokens.colorFunctionalScarlet200, super.repositoryNegativeLowest = ColorRawTokens.colorFunctionalScarlet100, @@ -96,10 +96,10 @@ class WireframeColorRepositorySemanticTokens extends OudsColorRepositorySemantic super.repositoryOpacityWhiteTransparent = WireframeColorRawTokens.colorOpacityWhite0, super.repositoryPositiveHigh = ColorRawTokens.colorFunctionalMalachite700, super.repositoryPositiveHigher = ColorRawTokens.colorFunctionalMalachite750, - super.repositoryPositiveHighest = ColorRawTokens.colorFunctionalMalachite900, + super.repositoryPositiveHighest = const Color(0x00ff0000), super.repositoryPositiveLow = ColorRawTokens.colorFunctionalMalachite300, super.repositoryPositiveLower = const Color(0x00ff0000), - super.repositoryPositiveLowest = ColorRawTokens.colorFunctionalMalachite100, + super.repositoryPositiveLowest = const Color(0x00ff0000), super.repositoryPositiveMedium = ColorRawTokens.colorFunctionalMalachite600, super.repositoryPrimaryHigh = WireframeColorRawTokens.colorRoyalBlue800, super.repositoryPrimaryHigher = WireframeColorRawTokens.colorRoyalBlue900, @@ -109,7 +109,8 @@ class WireframeColorRepositorySemanticTokens extends OudsColorRepositorySemantic super.repositoryPrimaryLowest = WireframeColorRawTokens.colorRoyalBlue100, super.repositoryPrimaryMedium = WireframeColorRawTokens.colorRoyalBlue600, super.repositorySecondaryHigh = WireframeColorRawTokens.colorRustyRed700, - super.repositorySecondaryHigher = WireframeColorRawTokens.colorRustyRed800, + super.repositorySecondaryHigherHigh = WireframeColorRawTokens.colorRustyRed800, + super.repositorySecondaryHigherLow = WireframeColorRawTokens.colorRustyRed800, super.repositorySecondaryHighest = const Color(0x00ff0000), super.repositorySecondaryLow = WireframeColorRawTokens.colorRustyRed400, super.repositorySecondaryLower = WireframeColorRawTokens.colorRustyRed300, @@ -124,10 +125,10 @@ class WireframeColorRepositorySemanticTokens extends OudsColorRepositorySemantic super.repositoryTertiaryMedium = const Color(0x00ff0000), super.repositoryWarningHigh = ColorRawTokens.colorFunctionalSun750, super.repositoryWarningHigher = const Color(0x00ff0000), - super.repositoryWarningHighest = ColorRawTokens.colorFunctionalSun900, + super.repositoryWarningHighest = const Color(0x00ff0000), super.repositoryWarningLow = ColorRawTokens.colorFunctionalSun300, super.repositoryWarningLower = const Color(0x00ff0000), - super.repositoryWarningLowest = ColorRawTokens.colorFunctionalSun100, + super.repositoryWarningLowest = const Color(0x00ff0000), super.repositoryWarningMedium = ColorRawTokens.colorFunctionalSun500, }); } diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_color_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_color_semantic_tokens.dart index 72676179b..72375a871 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_color_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_color_semantic_tokens.dart @@ -16,7 +16,6 @@ class WireframeColorSemanticTokens extends OudsColorSemanticTokens { WireframeColorBgSemanticTokens backgroundColorTokens = const WireframeColorBgSemanticTokens(), WireframeColorBorderSemanticTokens borderColorTokens = const WireframeColorBorderSemanticTokens(), WireframeColorContentSemanticTokens contentColorTokens = const WireframeColorContentSemanticTokens(), - //WireframeColorDecorativeSemanticTokens decorativeColorTokens = const WireframeColorDecorativeSemanticTokens(), WireframeColorOpacitySemanticTokens opacityColorTokens = const WireframeColorOpacitySemanticTokens(), WireframeColorOverlaySemanticTokens overlayColorTokens = const WireframeColorOverlaySemanticTokens(), WireframeColorSurfaceSemanticTokens surfaceColorTokens = const WireframeColorSurfaceSemanticTokens(), @@ -27,7 +26,6 @@ class WireframeColorSemanticTokens extends OudsColorSemanticTokens { backgroundColorTokens: backgroundColorTokens, borderColorTokens: borderColorTokens, contentColorTokens: contentColorTokens, - //decorativeColorTokens: decorativeColorTokens, opacityColorTokens: opacityColorTokens, overlayColorTokens: overlayColorTokens, surfaceColorTokens: surfaceColorTokens, diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_color_surface_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_color_surface_semantic_tokens.dart index 103490f11..2ed3eef6f 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_color_surface_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_color_surface_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_effect_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_effect_semantic_tokens.dart index 8f12172e6..0c92a17e6 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_effect_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_effect_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_effect_semantic_tokens.dart'; @@ -18,5 +18,5 @@ import 'package:ouds_global_raw_tokens/effect_raw_tokens.dart'; class WireframeEffectSemanticTokens extends OudsEffectSemanticTokens { @override - int get blurDrag => EffectRawTokens.effectBlur320; + int get blurDrag => EffectRawTokens.effectBlur480; } diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_font_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_font_semantic_tokens.dart index 78d5cbc59..2da031ca4 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_font_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_font_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:flutter/material.dart'; diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_grid_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_grid_semantic_tokens.dart index 5008f6141..54b459d4c 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_grid_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_grid_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_grid_semantic_tokens.dart'; @@ -18,7 +18,7 @@ import 'package:ouds_global_raw_tokens/grid_raw_tokens.dart'; class WireframeGridSemanticTokens extends OudsGridSemanticTokens { @override - double get compactColumnGap => GridRawTokens.gridColumnGap100; + double get compactColumnGap => GridRawTokens.gridColumnGap200; @override double get compactMargin => GridRawTokens.gridMargin300; @override diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_opacity_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_opacity_semantic_tokens.dart index d7e7ffe16..2c224b753 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_opacity_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_opacity_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_opacity_semantic_tokens.dart'; diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_size_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_size_semantic_tokens.dart index 0de7c39ed..93d8308e1 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_size_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_size_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_size_semantic_tokens.dart'; @@ -126,7 +126,7 @@ class WireframeSizeSemanticTokens extends OudsSizeSemanticTokens { @override double get iconWithLabelLargeSizeSmall => DimensionRawTokens.dimension300; @override - double get iconWithLabelLargeSizeXlarge => DimensionRawTokens.dimension550; + double get iconWithLabelLargeSizeXlarge => DimensionRawTokens.dimension450; @override double get iconWithLabelLargeSizeXsmall => DimensionRawTokens.dimension250; @override @@ -146,67 +146,69 @@ class WireframeSizeSemanticTokens extends OudsSizeSemanticTokens { @override double get iconWithLabelSmallSizeXsmall => DimensionRawTokens.dimensionOutOfSystem250; @override - double get iconWithLabelXlargeSizeLarge => DimensionRawTokens.dimension550; + double get iconWithLabelXlargeSizeLarge => DimensionRawTokens.dimension500; @override - double get iconWithLabelXlargeSizeMedium => DimensionRawTokens.dimension500; + double get iconWithLabelXlargeSizeMedium => DimensionRawTokens.dimension450; @override double get iconWithLabelXlargeSizeSmall => DimensionRawTokens.dimension400; @override - double get maxWidthTypeBodyLargeMobile => DimensionRawTokens.dimension6000; + double get iconWithLabelXlargeSizeXsmall => DimensionRawTokens.dimension350; @override - double get maxWidthTypeBodyLargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodyLargeMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodyMediumMobile => DimensionRawTokens.dimension6000; + double get maxWidthBodyLargeTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodyMediumTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodyMediumMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodySmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthBodyMediumTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeBodySmallTablet => DimensionRawTokens.dimension6000; + double get maxWidthBodySmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeDisplayLargeMobile => DimensionRawTokens.dimension9000; + double get maxWidthBodySmallTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeDisplayLargeTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplayLargeMobile => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplayMediumMobile => DimensionRawTokens.dimension9000; + double get maxWidthDisplayLargeTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplayMediumTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplayMediumMobile => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplaySmallMobile => DimensionRawTokens.dimension9000; + double get maxWidthDisplayMediumTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeDisplaySmallTablet => DimensionRawTokens.dimension9000; + double get maxWidthDisplaySmallMobile => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeHeadingLargeMobile => DimensionRawTokens.dimension7000; + double get maxWidthDisplaySmallTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeHeadingLargeTablet => DimensionRawTokens.dimension9000; + double get maxWidthHeadingLargeMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingMediumMobile => DimensionRawTokens.dimension7000; + double get maxWidthHeadingLargeTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeHeadingMediumTablet => DimensionRawTokens.dimension7000; + double get maxWidthHeadingMediumMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingSmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthHeadingMediumTablet => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingSmallTablet => DimensionRawTokens.dimension7000; + double get maxWidthHeadingSmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeHeadingXlargeMobile => DimensionRawTokens.dimension7000; + double get maxWidthHeadingSmallTablet => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeHeadingXlargeTablet => DimensionRawTokens.dimension9000; + double get maxWidthHeadingXlargeMobile => DimensionRawTokens.dimension7000; @override - double get maxWidthTypeLabelLargeMobile => DimensionRawTokens.dimension6000; + double get maxWidthHeadingXlargeTablet => DimensionRawTokens.dimension9000; @override - double get maxWidthTypeLabelLargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelLargeMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelMediumMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelLargeTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelMediumTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelMediumMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelSmallMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelMediumTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelSmallTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelSmallMobile => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelXlargeMobile => DimensionRawTokens.dimension6000; + double get maxWidthLabelSmallTablet => DimensionRawTokens.dimension6000; @override - double get maxWidthTypeLabelXlargeTablet => DimensionRawTokens.dimension6000; + double get maxWidthLabelXlargeMobile => DimensionRawTokens.dimension6000; + @override + double get maxWidthLabelXlargeTablet => DimensionRawTokens.dimension6000; @override double get minInteractiveArea => DimensionRawTokens.dimension600; } diff --git a/ouds_theme_wireframe/lib/semantic/wireframe_space_semantic_tokens.dart b/ouds_theme_wireframe/lib/semantic/wireframe_space_semantic_tokens.dart index 9b8a898bf..76d65697a 100644 --- a/ouds_theme_wireframe/lib/semantic/wireframe_space_semantic_tokens.dart +++ b/ouds_theme_wireframe/lib/semantic/wireframe_space_semantic_tokens.dart @@ -10,7 +10,7 @@ // Software description: Flutter library of reusable graphical components // -// Wireframe brand tokens version 2.3.0 +// Wireframe brand tokens version 2.5.0 // Generated by Tokenator import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_space_semantic_tokens.dart'; diff --git a/ouds_theme_wireframe/pubspec.yaml b/ouds_theme_wireframe/pubspec.yaml index 8c3da1362..a4606c02b 100644 --- a/ouds_theme_wireframe/pubspec.yaml +++ b/ouds_theme_wireframe/pubspec.yaml @@ -1,8 +1,8 @@ name: ouds_theme_wireframe description: 'Wireframe theme implementation for OUDS, with branding-specific design tokens.' -version: 1.3.1 repository: https://github.com/Orange-OpenSource/ouds-flutter homepage: https://flutter.unified-design-system.orange.com +version: 2.0.0 environment: sdk: ^3.9.0 @@ -13,9 +13,12 @@ resolution: workspace dependencies: flutter: sdk: flutter - ouds_core: ^1.3.1 - ouds_theme_contract: ^1.3.1 - ouds_global_raw_tokens: ^1.3.1 + # Core + ouds_core: ^2.0.0 + # Theme contract + ouds_theme_contract: ^2.0.0 + # Global raw token + ouds_global_raw_tokens: ^2.0.0 dev_dependencies: flutter_test: @@ -49,6 +52,7 @@ flutter: - assets/component/alert/ - assets/component/checkbox/ - assets/component/chip/ + - assets/component/badge-icon/ - assets/component/bullet-list/ - assets/component/button/ - assets/component/link/ diff --git a/pubspec.lock b/pubspec.lock index 8a5e12e0b..1e002876e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: app_settings - sha256: "3e46c561441e5820d3a25339bf8b51b9e45a5f686873851a20c257a530917795" + sha256: "64d50e666fd96ae90301bf71205f05019286f940ad6f5fed3d1be19c6af7546a" url: "https://pub.dev" source: hosted - version: "6.1.1" + version: "7.0.0" args: dependency: transitive description: diff --git a/skills/ouds-flutter-accessibility/SKILL.md b/skills/ouds-flutter-accessibility/SKILL.md new file mode 100644 index 000000000..2307a2d03 --- /dev/null +++ b/skills/ouds-flutter-accessibility/SKILL.md @@ -0,0 +1,707 @@ +--- +name: ouds-flutter-accessibility +description: Reference guide for OUDS Flutter accessibility rules and patterns — Semantics, MergeSemantics, ExcludeSemantics, text scale, high-contrast, screen readers (TalkBack / VoiceOver), orientation, bug diagnosis and enhancement +license: MIT +--- + +# OUDS Flutter Accessibility Guide + +> **Agent optimization**: See [copilot-instructions.md §9](../../.github/copilot-instructions.md#9-agent-response-optimization-) for token-efficient response guidelines. + +This skill applies to accessibility work in the OUDS Flutter repository. Use it for Flutter widgets and semantics patterns, not for OUDS web, Android native, or iOS native platforms. + +Use this skill when a user asks about: + +- how to make an OUDS component accessible +- which `Semantics` flags to use on a widget +- how to support TalkBack (Android) or VoiceOver (iOS) +- how to handle text scale, high-contrast or orientation +- how to **diagnose and fix an accessibility bug** +- how to **enhance existing accessibility** (add missing labels, fix wrong flags, improve focus order) +- how to test accessibility on device or emulator + +> 📖 Reference: [Orange accessibility guidelines (mobile)](https://a11y-guidelines.orange.com/fr/mobile/) + +--- + +## 0. Agent workflow — fixing or enhancing accessibility + +When asked to fix a bug or add/improve accessibility on an existing widget, follow this sequence: + +``` +1. READ the widget source file — identify all interactive, informational and decorative elements +2. DIAGNOSE — match the code against the bug catalogue in §9 +3. PLAN the fix — choose the correct pattern from §2 or §10 +4. APPLY the change — use before/after from §9 or §10 as template +5. VERIFY — run the checklist in §8 on the modified widget +6. FORMAT & ANALYZE — dart format . && flutter analyze --no-pub (zero errors required) +``` + +> Do not guess — always read the widget source before proposing a fix. + +--- + +## 1. Core rules — 🔴 MANDATORY + +These rules apply to **every** OUDS component and every custom widget built on top of OUDS. + +| Rule | Detail | +|------|--------| +| Wrap every interactive root in `Semantics` | Use appropriate flags: `button`, `checked`, `toggled`, `label`, `hint`, `value` | +| Use `ExcludeSemantics` on decorative children | Icons, illustrations and dividers that carry no information must be hidden from screen readers | +| Use `MergeSemantics` to group related nodes | When several widgets form a single logical unit, merge them into one focusable node | +| Provide `semanticsLabel` on color-only components | `OudsBadge` and similar widgets convey meaning via color — always add a text alternative | +| Never hardcode accessibility strings | Use `OudsLocalizations.of(context)` — never pass raw string literals to `Semantics` | +| Never lock text size | Use OUDS typography tokens — never override `MediaQuery.textScalerOf` | +| Never lock portrait orientation | OUDS supports both orientations — never call `SystemChrome.setPreferredOrientations` | +| Support high-contrast mode | Use `ouds_accessibility_plugin` to detect system high-contrast and adapt visuals | + +--- + +## 2. Semantics patterns + +### 2.1 Interactive widget — button + +```dart +Semantics( + button: true, + label: OudsLocalizations.of(context).myActionLabel, + child: GestureDetector( + onTap: onPressed, + child: const MyButtonVisual(), + ), +) +``` + +### 2.2 Toggle / switch + +```dart +Semantics( + toggled: isEnabled, + button: true, + child: GestureDetector( + onTap: () => onChanged(!isEnabled), + child: MyToggleVisual(isEnabled: isEnabled), + ), +) +``` + +### 2.3 Checkbox / radio + +```dart +Semantics( + checked: isChecked, + label: OudsLocalizations.of(context).myOptionLabel, + child: GestureDetector( + onTap: () => onChanged(!isChecked), + child: MyCheckVisual(checked: isChecked), + ), +) +``` + +### 2.4 Informational — value with unit + +```dart +Semantics( + label: 'Progress', + value: '$progress %', + child: MyProgressVisual(progress: progress), +) +``` + +### 2.5 Decorative element — excluded + +```dart +ExcludeSemantics( + child: SvgPicture.asset('assets/illustration.svg'), +) +``` + +### 2.6 Grouped label + control + +```dart +MergeSemantics( + child: Row( + children: [ + Text('Notifications'), + OudsSwitch(value: isOn, onChanged: (v) => setState(() => isOn = v)), + ], + ), +) +``` + +--- + +## 3. OUDS components — built-in semantics + +These OUDS components handle semantics **automatically** via `OudsLocalizations`. Do **not** duplicate accessibility strings manually. + +| Component | Handled automatically | +|-----------|-----------------------| +| `OudsCheckbox` | `checked`, `disabled`, `error` labels via `OudsLocalizations` | +| `OudsSwitch` | `toggled`, `disabled`, `readOnly` labels via `OudsLocalizations` | +| `OudsRadioButton` | `checked`, `disabled`, `error` labels via `OudsLocalizations` | +| `OudsButton` | `button` flag + `label` | +| `OudsLink` | `link` flag + `label` | + +For `OudsBadge`, always pass `semanticsLabel` explicitly — color is the only visual differentiator: + +```dart +OudsBadge.standard( + status: Negative(), + size: OudsBadgeSize.medium, + semanticsLabel: 'Error', // required — never omit + child: Icon(Icons.mail), +) + +OudsBadge.count( + label: '12', + status: Info(), + size: OudsBadgeSize.large, + semanticsLabel: '12 notifications', + child: Icon(Icons.notifications), +) +``` + +--- + +## 4. Text scale + +OUDS typography tokens automatically respect `MediaQuery.textScalerOf`. No manual intervention is needed. + +```dart +// Correct — scales automatically +Text( + 'Label', + style: OudsTheme.of(context).typographyTokens.typeLabelDefaultMedium(context), +) + +// ❌ Forbidden — breaks system text scale +MediaQuery( + data: MediaQuery.of(context).copyWith(textScaler: TextScaler.noScaling), + child: child, +) +``` + +**Test at:** 100 %, 150 %, 200 % system text scale — no layout overflow should occur. + +--- + +## 5. High-contrast mode + +`ouds_accessibility_plugin` provides a platform-level signal. OUDS components use it internally. + +When building a **custom component** that needs to adapt to high contrast: + +```dart +import 'package:ouds_accessibility_plugin/ouds_accessibility_plugin.dart'; + +class MyCustomWidget extends StatefulWidget { + const MyCustomWidget({super.key}); + @override + State createState() => _MyCustomWidgetState(); +} + +class _MyCustomWidgetState extends State { + bool _isHighContrast = false; + + @override + void initState() { + super.initState(); + OudsAccessibilityPlugin.isHighContrastEnabled().then((value) { + setState(() => _isHighContrast = value); + }); + } + + @override + Widget build(BuildContext context) { + final colors = OudsTheme.of(context).colorScheme(context); + return Container( + color: _isHighContrast ? colors.bgPrimary : colors.bgSecondary, + child: const MyContent(), + ); + } +} +``` + +> `OudsCheckbox`, `OudsSwitch` and `OudsRadioButton` already use `ouds_accessibility_plugin` internally — no action needed for those components. + +--- + +## 6. Orientation support + +Never lock the app to portrait mode. OUDS supports landscape and portrait. + +```dart +// ❌ Forbidden +SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); + +// ✅ Correct — do nothing, let the OS handle rotation +``` + +Test both orientations on a physical device or emulator before marking work complete. + +--- + +## 7. Screen reader support + +### 7.1 Localizations — never hardcode strings + +```dart +// ❌ Forbidden +Semantics(label: 'Close button', child: closeIcon) + +// ✅ Correct +Semantics( + label: OudsLocalizations.of(context).closeButtonLabel, + child: closeIcon, +) +``` + +### 7.2 Focus order + +Flutter traverses the widget tree top-to-bottom by default. To reorder: + +```dart +FocusTraversalGroup( + policy: OrderedTraversalPolicy(), + child: Column( + children: [ + FocusTraversalOrder(order: const NumericFocusOrder(1), child: myFirstWidget), + FocusTraversalOrder(order: const NumericFocusOrder(2), child: mySecondWidget), + ], + ), +) +``` + +### 7.3 TalkBack (Android) testing + +1. Enable TalkBack in **Settings → Accessibility → TalkBack**. +2. Navigate the component with swipe gestures. +3. Verify: focus ring visible, label announced, state changes announced (toggled / checked / error). +4. Verify: decorative elements are skipped. + +### 7.4 VoiceOver (iOS) testing + +1. Enable VoiceOver in **Settings → Accessibility → VoiceOver** (or triple-click the side button). +2. Navigate with swipe, activate with double-tap. +3. Verify same points as TalkBack above. + +--- + +## 8. Custom component — full accessibility checklist + +Apply this checklist before considering any new or migrated interactive widget complete: + +- [ ] Root interactive element wrapped in `Semantics` with appropriate flags (`button`, `checked`, `toggled`, `label`, `hint`, `value`) +- [ ] `ExcludeSemantics` applied to all purely decorative children (icons, illustrations, dividers) +- [ ] `MergeSemantics` used where label + control form a single logical unit +- [ ] `semanticsLabel` provided on any widget where color is the only visual differentiator +- [ ] All accessibility strings sourced from `OudsLocalizations.of(context)` — no hardcoded strings +- [ ] Text uses OUDS typography tokens — no `MediaQuery.textScalerOf` override +- [ ] Landscape orientation supported — no `SystemChrome.setPreferredOrientations` call +- [ ] High-contrast adaptation verified (either via built-in OUDS tokens or `ouds_accessibility_plugin`) +- [ ] TalkBack (Android) tested on device or emulator +- [ ] VoiceOver (iOS) tested on device or emulator +- [ ] Text scale tested at 100 %, 150 %, 200 % — no layout overflow +- [ ] Focus order is logical and matches the visual reading order + +--- + +## 9. Bug catalogue — diagnosis and fix + +Each entry describes a **symptom** (what TalkBack/VoiceOver announces or skips), the **root cause** in code, and the **fix**. + +--- + +### 9.1 Interactive widget not announced by screen reader + +**Symptom:** TalkBack/VoiceOver skips a button, chip or card — user cannot focus or activate it. + +**Root cause:** The widget uses `GestureDetector` or `InkWell` without a `Semantics` wrapper. + +```dart +// ❌ Bug +GestureDetector( + onTap: () => doSomething(), + child: MyCardVisual(), +) +``` + +```dart +// ✅ Fix +Semantics( + button: true, + label: OudsLocalizations.of(context).myCardActionLabel, + child: GestureDetector( + onTap: () => doSomething(), + child: MyCardVisual(), + ), +) +``` + +--- + +### 9.2 Hardcoded accessibility string + +**Symptom:** String is not translated when locale changes, or fails audit because it is a raw literal. + +**Root cause:** `Semantics(label: 'Close')` passes a string literal. + +```dart +// ❌ Bug +Semantics(label: 'Close', child: closeIcon) + +// ❌ Also wrong — interpolated literal +Semantics(label: 'Badge: $count', child: badgeWidget) +``` + +```dart +// ✅ Fix — use OudsLocalizations +Semantics( + label: OudsLocalizations.of(context).closeButtonLabel, + child: closeIcon, +) + +// ✅ Fix — for OudsBadge +OudsBadge.count( + label: '$count', + status: Info(), + semanticsLabel: OudsLocalizations.of(context).notificationsCount(count), + child: Icon(Icons.notifications), +) +``` + +--- + +### 9.3 Decorative element announced by screen reader + +**Symptom:** TalkBack announces "unlabelled image" or reads an SVG file name — creates noise for screen reader users. + +**Root cause:** Decorative icon or illustration has no `ExcludeSemantics` wrapper. + +```dart +// ❌ Bug +SvgPicture.asset('assets/illustration_success.svg') +Icon(Icons.star) +``` + +```dart +// ✅ Fix +ExcludeSemantics( + child: SvgPicture.asset('assets/illustration_success.svg'), +) + +ExcludeSemantics( + child: Icon(Icons.star), +) +``` + +--- + +### 9.4 Missing semanticsLabel on OudsBadge + +**Symptom:** TalkBack announces the badge color or a numeric count without context — user cannot understand the meaning. + +**Root cause:** `semanticsLabel` not provided on `OudsBadge`. + +```dart +// ❌ Bug +OudsBadge.standard(status: Negative(), child: Icon(Icons.mail)) + +// ❌ Bug +OudsBadge.count(label: '5', status: Info(), child: Icon(Icons.notifications)) +``` + +```dart +// ✅ Fix +OudsBadge.standard( + status: Negative(), + semanticsLabel: OudsLocalizations.of(context).mailError, + child: Icon(Icons.mail), +) + +OudsBadge.count( + label: '5', + status: Info(), + semanticsLabel: OudsLocalizations.of(context).notificationsCount(5), + child: Icon(Icons.notifications), +) +``` + +--- + +### 9.5 Wrong or missing Semantics flags + +**Symptom:** TalkBack announces "button" for a toggle, or announces a state that does not change when the user interacts. + +**Root cause:** Wrong flag used, or flag value is static (not bound to widget state). + +```dart +// ❌ Bug — toggle announced as plain button, state never updates +Semantics( + button: true, + child: MyToggle(isOn: isOn, onChanged: onChanged), +) +``` + +```dart +// ✅ Fix — use toggled, bind to state +Semantics( + toggled: isOn, // reflects current state + button: true, + child: MyToggle(isOn: isOn, onChanged: onChanged), +) +``` + +**Flag reference:** + +| Widget type | Correct flags | +|-------------|---------------| +| Button / action | `button: true, label: ...` | +| Toggle / switch | `toggled: value, button: true` | +| Checkbox | `checked: value, label: ...` | +| Radio button | `checked: value == groupValue, label: ...` | +| Text input | `textField: true, label: ...` | +| Informational value | `label: ..., value: ...` | +| Image with meaning | `image: true, label: ...` | + +--- + +### 9.6 Duplicate semantics — OUDS component + manual Semantics wrapper + +**Symptom:** TalkBack announces the label twice, or announces contradictory states. + +**Root cause:** A manual `Semantics` wraps an OUDS component that already handles its own semantics. + +```dart +// ❌ Bug — OudsCheckbox handles checked/label automatically +Semantics( + checked: isChecked, + label: 'Accept terms', + child: OudsCheckbox( + value: isChecked, + onChanged: (v) => setState(() => isChecked = v), + ), +) +``` + +```dart +// ✅ Fix — remove the outer Semantics, let OUDS handle it +OudsCheckbox( + value: isChecked, + onChanged: (v) => setState(() => isChecked = v), +) +``` + +Components that handle their own semantics: `OudsCheckbox`, `OudsSwitch`, `OudsRadioButton`, `OudsButton`, `OudsLink`. + +--- + +### 9.7 Text size locked — scale not respected + +**Symptom:** Text stays the same size regardless of system font scale setting. + +**Root cause:** `MediaQuery.textScalerOf` is overridden, or `TextStyle` uses a literal `fontSize`. + +```dart +// ❌ Bug — hardcoded font size, ignores system scale +Text('Label', style: const TextStyle(fontSize: 16)) + +// ❌ Bug — forces no scaling on subtree +MediaQuery( + data: MediaQuery.of(context).copyWith(textScaler: TextScaler.noScaling), + child: child, +) +``` + +```dart +// ✅ Fix — use OUDS typography token +Text( + 'Label', + style: OudsTheme.of(context).typographyTokens.typeLabelDefaultMedium(context), +) +``` + +--- + +### 9.8 Label and interactive control not merged — announced separately + +**Symptom:** TalkBack reads the label ("Notifications"), then separately reads the switch ("off, switch"). User must swipe twice to reach the control. + +**Root cause:** `Text` and `OudsSwitch` are siblings without `MergeSemantics`. + +```dart +// ❌ Bug +Row( + children: [ + const Text('Notifications'), + OudsSwitch(value: isOn, onChanged: (v) => setState(() => isOn = v)), + ], +) +``` + +```dart +// ✅ Fix +MergeSemantics( + child: Row( + children: [ + const Text('Notifications'), + OudsSwitch(value: isOn, onChanged: (v) => setState(() => isOn = v)), + ], + ), +) +``` + +--- + +### 9.9 Error / disabled state not announced + +**Symptom:** TalkBack does not mention that a field is in error or that a button is disabled. + +**Root cause:** State change not reflected in Semantics, or `isError` / `enabled` parameter missing. + +```dart +// ❌ Bug — error state visually shown but not announced +Semantics( + button: true, + label: 'Submit', + child: MyButtonVisual(hasError: true), +) + +// ❌ Bug — text field error visually shown but not semantically set +OudsTextField( + decoration: OudsInputDecoration(labelText: 'Email'), + // errorText missing even though validation failed +) +``` + +```dart +// ✅ Fix — reflect error in Semantics +Semantics( + button: true, + label: OudsLocalizations.of(context).submitLabel, + hint: hasError ? OudsLocalizations.of(context).formHasErrors : null, + child: MyButtonVisual(hasError: hasError), +) + +// ✅ Fix — use errorText so OudsTextField announces the error +OudsTextField( + decoration: OudsInputDecoration( + labelText: 'Email', + errorText: _validationError, // non-null when invalid + ), +) +``` + +--- + +### 9.10 Portrait orientation locked + +**Symptom:** App does not rotate on a device held in landscape — accessibility users who mount devices in fixed positions cannot use the app. + +**Root cause:** `SystemChrome.setPreferredOrientations` called somewhere (often in `main()` or `initState()`). + +```dart +// ❌ Bug +SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); +``` + +```dart +// ✅ Fix — remove the call entirely; let the OS handle rotation +// No replacement needed — omit the call +``` + +--- + +## 10. Enhancement patterns — improving existing accessibility + +Use these patterns when accessibility exists but is incomplete or can be improved. + +### 10.1 Add a hint to clarify an action + +A hint gives screen reader users extra context about what an action does. + +```dart +// Before — label only +Semantics( + button: true, + label: OudsLocalizations.of(context).deleteLabel, + child: deleteButton, +) + +// After — with hint +Semantics( + button: true, + label: OudsLocalizations.of(context).deleteLabel, + hint: OudsLocalizations.of(context).deleteHint, // e.g. "Removes the item permanently" + child: deleteButton, +) +``` + +### 10.2 Announce live content changes + +When content updates dynamically (e.g. a counter, a status message), use `liveRegion` so the change is announced without focus change. + +```dart +Semantics( + liveRegion: true, + label: OudsLocalizations.of(context).statusMessage(currentStatus), + child: MyStatusBanner(status: currentStatus), +) +``` + +### 10.3 Improve focus order on complex layouts + +When the visual layout order does not match the logical reading order: + +```dart +FocusTraversalGroup( + policy: OrderedTraversalPolicy(), + child: Column( + children: [ + FocusTraversalOrder(order: const NumericFocusOrder(1), child: titleWidget), + FocusTraversalOrder(order: const NumericFocusOrder(2), child: bodyWidget), + FocusTraversalOrder(order: const NumericFocusOrder(3), child: actionButton), + ], + ), +) +``` + +### 10.4 Provide a value for progress or slider + +```dart +// Before — announced as unlabelled +LinearProgressIndicator(value: progress) + +// After — with semantic label and value +Semantics( + label: OudsLocalizations.of(context).uploadProgress, + value: '${(progress * 100).round()} %', + child: LinearProgressIndicator(value: progress), +) +``` + +### 10.5 Group a form section into a single semantic node + +When a form row has a label, a field and an inline error, group them so the user hears everything in one focus: + +```dart +Semantics( + label: OudsLocalizations.of(context).emailFieldLabel, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + OudsTextField( + decoration: OudsInputDecoration( + labelText: 'Email', + errorText: _emailError, + ), + ), + ], + ), +) +``` + +--- + diff --git a/skills/ouds-flutter-figma-to-dart/SKILL.md b/skills/ouds-flutter-figma-to-dart/SKILL.md new file mode 100644 index 000000000..d2e79c653 --- /dev/null +++ b/skills/ouds-flutter-figma-to-dart/SKILL.md @@ -0,0 +1,172 @@ +--- +name: ouds-flutter-figma-to-dart +description: Reference guide for deriving Dart naming and token layer from Figma token families in the OUDS Flutter project (raw, semantic and component tokens) +license: MIT +--- + +# OUDS Flutter Figma-to-Dart Mapping + +> **Agent optimization**: See [copilot-instructions.md §9](../../.github/copilot-instructions.md#9-agent-response-optimization-) for token-efficient response guidelines. + +This skill applies to token mapping in the OUDS Flutter repository. Use it when translating Figma tokens to Flutter/Dart naming, not for OUDS web, Android native, or iOS native platforms. + +## 1. Quick-reference cheat sheet + +```text +TOKEN LAYERS IN THIS REPOSITORY + Raw tokens → `ouds_global_raw_tokens/lib/*.dart` + Semantic tokens → `ouds_theme_contract/lib/theme/tokens/semantic/*.dart` + Component tokens → `ouds_theme_contract/lib/theme/tokens/components/*.dart` + Theme values → implemented in `ouds_theme_orange/`, `ouds_theme_sosh/`, etc. + +LOOKUP ORDER + 1. Identify whether the Figma item is raw / semantic / component scoped + 2. Find the corresponding generated abstract token file in `ouds_theme_contract` + 3. Find the concrete brand implementation in each theme package + 4. Consume the value through `OudsTheme.of(context)` — never by editing generated files + +STOP IMMEDIATELY + - If the task asks to manually edit generated token files + - If the token file is under `ouds_global_raw_tokens`, `ouds_theme_contract`, + `ouds_theme_orange`, `ouds_theme_orange_compact`, `ouds_theme_sosh`, or `ouds_theme_wireframe` +``` + +--- + +## 2. Layer mapping in Flutter + +### Layer 1 — Raw tokens + +Raw token files live in `ouds_global_raw_tokens/lib/`. + +| Family | File | Example names | +|--------|------|---------------| +| Border | `border_raw_tokens.dart` | raw border constants | +| Color | `color_raw_tokens.dart` | raw color constants | +| Dimension | `dimension_raw_tokens.dart` | `dimension200`, `dimensionOutOfSystem25` | +| Effect | `effect_raw_tokens.dart` | raw effect constants | +| Elevation | `elevation_raw_tokens.dart` | raw elevation constants | +| Font | `font_raw_tokens.dart` | raw font constants | +| Grid | `grid_raw_tokens.dart` | raw grid constants | +| Opacity | `opacity_raw_tokens.dart` | raw opacity constants | + +Example: + +```dart +DimensionRawTokens.dimension200 +DimensionRawTokens.dimensionOutOfSystem25 +``` + +### Layer 2 — Semantic tokens + +Semantic token interfaces live in `ouds_theme_contract/lib/theme/tokens/semantic/`. + +| Semantic family | File | Typical access | +|-----------------|------|----------------| +| Border | `ouds_border_semantic_tokens.dart` | via theme border / scheme APIs | +| Color | `ouds_color_semantic_tokens.dart` | `theme.colorScheme(context)` | +| Elevation | `ouds_elevation_semantic_tokens.dart` | via theme providers | +| Font | `ouds_font_semantic_tokens.dart` | `theme.typographyTokens` / font tokens | +| Grid | `ouds_grid_semantic_tokens.dart` | `theme.gridScheme(context)` | +| Opacity | `ouds_opacity_semantic_tokens.dart` | via providers | +| Size | `ouds_size_semantic_tokens.dart` | `theme.sizeScheme(context)` | +| Space | `ouds_space_semantic_tokens.dart` | `theme.spaceScheme(context)` | + +### Layer 3 — Component tokens + +Component token interfaces live in `ouds_theme_contract/lib/theme/tokens/components/`. + +| Component | File | Typical access | +|-----------|------|----------------| +| Alert | `ouds_alert_tokens.dart` | `theme.componentsTokens(context).alert` | +| Badge | `ouds_badge_tokens.dart` | `theme.componentsTokens(context).badge` | +| Bar | `ouds_bar_tokens.dart` | `theme.componentsTokens(context).bar` | +| Bullet list | `ouds_bulletList_tokens.dart` | `theme.componentsTokens(context).bulletList` | +| Button | `ouds_button_tokens.dart` | `theme.componentsTokens(context).button` | +| Button mono | `ouds_buttonMono_tokens.dart` | mono button token group | +| Checkbox | `ouds_checkbox_tokens.dart` | `theme.componentsTokens(context).checkbox` | +| Chip | `ouds_chip_tokens.dart` | `theme.componentsTokens(context).chip` | +| Control item | `ouds_controlItem_tokens.dart` | shared item tokens | +| Divider | `ouds_divider_tokens.dart` | `theme.componentsTokens(context).divider` | +| Icon | `ouds_icon_tokens.dart` | `theme.componentsTokens(context).icon` | +| Input tag | `ouds_inputTag_tokens.dart` | `theme.componentsTokens(context).inputTag` | +| Link | `ouds_link_tokens.dart` | `theme.componentsTokens(context).link` | +| Link mono | `ouds_linkMono_tokens.dart` | mono link token group | +| Pin code input | `ouds_pinCodeInput_tokens.dart` | `theme.componentsTokens(context).pinCodeInput` | +| Radio button | `ouds_radioButton_tokens.dart` | `theme.componentsTokens(context).radioButton` | +| Skeleton | `ouds_skeleton_tokens.dart` | `theme.componentsTokens(context).skeleton` | +| Switch | `ouds_switch_tokens.dart` | `theme.componentsTokens(context).switch` | +| Tag | `ouds_tag_tokens.dart` | `theme.componentsTokens(context).tag` | +| Text input | `ouds_textInput_tokens.dart` | `theme.componentsTokens(context).textInput` | + +Observed naming patterns: + +- Component file names and accessors are lowerCamelCase with preserved internal capitals when part of the domain name: `textInput`, `pinCodeInput`, `radioButton` +- Token properties flatten the Figma hierarchy into lowerCamelCase names +- Common prefixes describe the token domain: `border`, `color`, `size`, `space` + +Examples from generated files: + +```dart +// Button tokens +borderRadiusDefault +colorBgDefaultEnabled +colorContentBrandPressed +sizeMinHeight +spacePaddingInlineIconStart + +// Text input tokens +colorBorderEnabled +sizeCountrySelectorFlagHeight +spaceColumnGapLabelAsterisk +spacePaddingInlineCountrySelectorStart +spaceRowGapLabelInput +``` + +--- + +## 3. Practical lookup workflow + +When a user gives you a Figma token name or token family: + +1. Decide the layer: + - primitive design value → raw token + - reusable semantic meaning (space, color, border, size, typography) → semantic token + - component-specific styling → component token +2. Search the generated interfaces first in `ouds_theme_contract/lib/theme/tokens/` +3. If needed, inspect the matching theme implementation in: + - `ouds_theme_orange/` + - `ouds_theme_orange_compact/` + - `ouds_theme_sosh/` + - `ouds_theme_wireframe/` +4. In component code, consume through `OudsTheme.of(context)` accessors +5. If no dedicated component token exists, reuse existing theme accessors instead of creating a token file manually + +--- + +## 4. Examples + +| Need | Flutter lookup | +|------|----------------| +| Raw spacing / dimension scale | `ouds_global_raw_tokens/lib/dimension_raw_tokens.dart` | +| Semantic spacing token | `OudsTheme.of(context).spaceScheme(context).fixedMedium` | +| Semantic responsive spacing | `OudsTheme.of(context).spaceScheme(context).scaled3xsmallMobile` | +| Component button background token | `OudsTheme.of(context).componentsTokens(context).button.colorBgDefaultEnabled` | +| Component text input spacing token | `OudsTheme.of(context).componentsTokens(context).textInput.spaceColumnGapLabelAsterisk` | +| Typography token | `OudsTheme.of(context).typographyTokens` | +| Component token interface definition | `ouds_theme_contract/lib/theme/tokens/components/...` | +| Raw token definition | `ouds_global_raw_tokens/lib/...` | + +--- + +## 5. Critical rules + +- Token files in `ouds_global_raw_tokens`, `ouds_theme_contract`, `ouds_theme_orange`, `ouds_theme_orange_compact`, `ouds_theme_sosh`, and `ouds_theme_wireframe` are generated by Tokenator and must not be edited manually. +- If a new component does **not** have a generated token file, do **not** invent one manually. +- Reuse existing tokens from: + - `OudsTheme.of(context).spaceScheme(context)` + - `OudsTheme.of(context).colorScheme(context)` + - `OudsTheme.of(context).typographyTokens` + - `OudsTheme.of(context).componentsTokens(context)` +- When unsure about an exact Figma-to-Dart property mapping, inspect the generated token interfaces instead of guessing. + diff --git a/skills/ouds-flutter-framework-usage/SKILL.md b/skills/ouds-flutter-framework-usage/SKILL.md new file mode 100644 index 000000000..45fa49767 --- /dev/null +++ b/skills/ouds-flutter-framework-usage/SKILL.md @@ -0,0 +1,702 @@ +--- +name: ouds-flutter-framework-usage +description: How to set up and use the OUDS Flutter framework with imports, themes, tokens, localizations, theme tweaks, and available components with code examples +license: MIT +--- + +# OUDS Flutter Framework Usage + +> **Agent optimization**: See [copilot-instructions.md §9](../../.github/copilot-instructions.md#9-agent-response-optimization-) for token-efficient response guidelines. + +This skill applies to the OUDS Flutter repository. Use it for Flutter components, themes, tokens and localizations, not for OUDS web, Android native, or iOS native platforms. + +## 1. Basic setup + +```dart +import 'package:flutter/material.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; +import 'package:ouds_theme_contract/ouds_theme.dart'; +import 'package:ouds_theme_orange/orange_theme.dart'; +import 'package:ouds_theme_orange/orange_font_service.dart'; + +void main() { + WidgetsFlutterBinding.ensureInitialized(); + OrangeFontService.instance.loadFromCdn(); + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + final theme = OrangeTheme(OrangeFontService.instance.fontFamily); + + return MaterialApp( + theme: theme.themeData, + darkTheme: theme.darkThemeData, + builder: (context, child) { + return OudsTheme( + themeContract: theme, + themeMode: ThemeMode.system, + onColoredSurface: false, + child: child ?? const SizedBox.shrink(), + ); + }, + localizationsDelegates: const [ + OudsLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ], + supportedLocales: OudsLocalizations.supportedLocales, + home: const Scaffold(body: Center(child: Text('Hello'))), + ); + } +} +``` + +--- + +## 2. Imports + +Import components directly from their package path. Do **not** use or create a root barrel file for `ouds_core`. + +| Package | When | +|---------|------| +| `package:ouds_core/components/...` | Use OUDS widgets | +| `package:ouds_theme_contract/ouds_theme.dart` | Read the active theme from context | +| `package:ouds_theme_orange/orange_theme.dart` | Orange brand theme | +| `package:ouds_theme_orange_compact/orange_compact_theme.dart` | Orange Compact theme | +| `package:ouds_theme_sosh/ouds_theme_sosh.dart` | Sosh theme | +| `package:ouds_theme_wireframe/ouds_theme_wireframe.dart` | Wireframe theme | +| `package:ouds_core/l10n/gen/ouds_localizations.dart` | OUDS accessibility and default strings | + +Examples: + +```dart +import 'package:ouds_core/components/button/ouds_button.dart'; +import 'package:ouds_core/components/form_input/ouds_text_input.dart'; +import 'package:ouds_core/components/link/ouds_link.dart'; +import 'package:ouds_theme_contract/ouds_theme.dart'; +``` + +--- + +## 3. Themes + +Inject an `OudsTheme` near the root of the app and consume it with `OudsTheme.of(context)`. + +```dart +final theme = OudsTheme.of(context); +final colors = theme.colorScheme(context); +final spaces = theme.spaceScheme(context); +final typography = theme.typographyTokens; +final components = theme.componentsTokens(context); +``` + +Available themes in this repository: + +- `OrangeTheme` +- `OrangeCompactTheme` +- `SoshTheme` +- `WireframeTheme` + +### Theme config and tweaks + +Use `OudsThemeConfigModel` to tune component configuration and `OudsThemeTweak` to locally force or invert theme mode. + +```dart +OudsThemeConfigModel( + button: OudsButtonConfig(rounded: false), + textInput: OudsTextInputConfig(rounded: true), + child: OudsTheme( + themeContract: theme, + themeMode: ThemeMode.system, + onColoredSurface: false, + child: child, + ), +) +``` + +```dart +OudsThemeTweak( + tweak: OudsThemeTweakType.forceDark, + child: MyPreview(), +) +``` + +--- + +## 4. Token namespaces + +| Accessor | Content | +|----------|---------| +| `theme.colorScheme(context)` | Active semantic color scheme | +| `theme.spaceScheme(context)` | Active spacing scheme | +| `theme.sizeScheme(context)` | Active size scheme | +| `theme.gridScheme(context)` | Active grid scheme | +| `theme.typographyTokens` | Typography tokens | +| `theme.componentsTokens(context)` | Component token groups | +| `theme.providersTokens(context)` | Combined theme providers | + +Common component token groups include: + +- `theme.componentsTokens(context).button` +- `theme.componentsTokens(context).badge` +- `theme.componentsTokens(context).chip` +- `theme.componentsTokens(context).divider` +- `theme.componentsTokens(context).icon` +- `theme.componentsTokens(context).link` +- `theme.componentsTokens(context).pinCodeInput` +- `theme.componentsTokens(context).radioButton` +- `theme.componentsTokens(context).switch` +- `theme.componentsTokens(context).tag` +- `theme.componentsTokens(context).textInput` + +--- + +## 5. Common state patterns + +These patterns apply to `OudsTextField`, `OudsPasswordInput`, `OudsPhoneNumberInput`, `OudsPinCodeInput`, `OudsCheckbox`, `OudsSwitch` and `OudsRadioButton` unless noted otherwise. + +### Input widgets (`OudsTextField`, `OudsPasswordInput`, `OudsPhoneNumberInput`) + +| Pattern | Parameter | +|---------|-----------| +| Helper text | `decoration: OudsInputDecoration(helperText: 'Hint message')` | +| Error state | `decoration: OudsInputDecoration(errorText: 'Field required')` | +| Read-only | `readOnly: true` | +| Disabled | `enabled: false` | +| Loading indicator | `decoration: OudsInputDecoration(loader: true)` | + +> **⛔ Forbidden combination**: `loader: true` and `errorText != null` at the same time → assertion error at runtime. Loading and error states are mutually exclusive. + +```dart +// Helper text +OudsTextField( + decoration: OudsInputDecoration( + labelText: 'Email', + helperText: 'We will never share your email.', + ), +) + +// Error state +OudsTextField( + decoration: OudsInputDecoration( + labelText: 'Email', + errorText: 'Invalid email address', + ), +) + +// Read-only +OudsTextField( + readOnly: true, + decoration: OudsInputDecoration(labelText: 'Email'), +) + +// Disabled +OudsTextField( + enabled: false, + decoration: OudsInputDecoration(labelText: 'Email'), +) + +// Loading (mutually exclusive with errorText) +OudsTextField( + decoration: OudsInputDecoration( + labelText: 'Search', + loader: true, + // errorText: '…' ← FORBIDDEN when loader: true + ), +) +``` + +### Control widgets (`OudsCheckbox`, `OudsSwitch`, `OudsRadioButton`) + +| Pattern | How | +|---------|-----| +| Disabled | Pass `onChanged: null` | +| Read-only | `readOnly: true` | +| Error state | `isError: true` (Checkbox, RadioButton only) | +| Indeterminate (tristate) | `tristate: true`, `value: null` (Checkbox only) | + +```dart +// Enabled checkbox +OudsCheckbox( + value: isChecked, + onChanged: (value) => setState(() => isChecked = value), +) + +// Disabled checkbox (onChanged: null) +OudsCheckbox( + value: false, + onChanged: null, +) + +// Error checkbox +OudsCheckbox( + value: false, + onChanged: (value) => setState(() => isChecked = value), + isError: true, +) + +// Tristate / indeterminate +OudsCheckbox( + value: null, // null = indeterminate + tristate: true, + onChanged: (value) => setState(() => isChecked = value), +) + +// Disabled switch (onChanged: null) +OudsSwitch( + value: true, + onChanged: null, +) + +// Read-only switch (keeps handler, prevents interaction) +OudsSwitch( + value: true, + onChanged: (value) {}, + readOnly: true, +) + +// Radio button group +OudsRadioButton( + value: 'option_a', + groupValue: _selected, + onChanged: (value) => setState(() => _selected = value!), +) + +// Radio button — error +OudsRadioButton( + value: 'option_b', + groupValue: _selected, + onChanged: (value) => setState(() => _selected = value!), + isError: true, +) +``` + +--- + +## 6. Common patterns + +### Tokens only + +Never hardcode colors, dimensions or strings in OUDS code. + +```dart +final theme = OudsTheme.of(context); + +Padding( + padding: EdgeInsets.all(theme.spaceScheme(context).fixedMedium), + child: Text( + 'Label', + style: theme.typographyTokens.typeLabelDefaultMedium(context), + ), +) +``` + +### Localizations + +Use OUDS or app localizations instead of hardcoded strings. + +```dart +import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; + +final l10n = OudsLocalizations.of(context); +``` + +### Accessibility + +> Load the **`ouds-flutter-accessibility`** skill for the full a11y reference (Semantics patterns, text scale, high-contrast, TalkBack/VoiceOver, testing checklist). + +Key reminders: +- Wrap every interactive root in `Semantics` with appropriate flags (`button`, `checked`, `toggled`, `label`, `hint`, `value`) +- Use `ExcludeSemantics` on decorative children +- Use `MergeSemantics` to group label + control into a single focusable node +- `OudsCheckbox`, `OudsSwitch` and `OudsRadioButton` handle semantics automatically via `OudsLocalizations` — do not duplicate +- Always provide `semanticsLabel` on `OudsBadge` — color is the only visual differentiator + +### Demo registration + +Every new component needs a demo screen in `app/lib/ui/components//` and must be registered in `app/lib/ui/components/components.dart`. + +--- + +## 7. Components + +**Index:** [Alert](#alert) [Badge](#badge) [Bottom Sheet](#bottom-sheet) [Button](#button) [Checkbox / Switch / Radio](#checkbox--switch--radio-button) [Chips](#filter-chip--suggestion-chip) [Divider](#divider) [Link](#link) [Navigation Bar](#navigation-bar) [Tag](#tag) [Text inputs](#text-input--password--phone--pin-code) [Top bar](#top-bar--app-bar) + +The repository currently exposes component families under: + +`alert/` · `badge/` · `bottom_sheet/` · `button/` · `checkbox/` · `chip/` · `country_selector/` · `divider/` · `form_input/` · `link/` · `navigation/` · `pin_code_input/` · `radio_button/` · `switch/` · `tag/` · `top_bar/` + +--- + +### Alert + +Two components: `OudsAlertMessage` (full-featured, persistent) and `OudsInlineAlert` (lightweight, inline in content flow). + +Statuses for both: `Positive()`, `Info()`, `Warning()`, `Negative()`, `Neutral(icon: ...)`, `Accent(icon: ...)` + +```dart +// --- OudsAlertMessage --- + +// Minimal +OudsAlertMessage( + label: 'Your profile has been updated.', + status: Positive(), +) + +// With close button +OudsAlertMessage( + label: 'Session expired.', + status: Warning(), + onClose: () {}, +) + +// With description + action link at bottom +OudsAlertMessage( + label: 'Verification required.', + status: Info(), + description: 'Please confirm your email to continue.', + actionLayout: OudsAlertMessageActionLayout( + text: 'Resend email', + onClick: () {}, + layout: OudsAlertMessageActionLayoutEnum.bottom, + ), + onClose: () {}, +) + +// Neutral with custom icon and bullet list +OudsAlertMessage( + label: 'New features available.', + status: Neutral(icon: 'assets/ic_star.svg'), + bulletList: ['Dark mode', 'Improved performance', 'New components'], +) + +// --- OudsInlineAlert --- +// Lightweight, placed inline in the content flow. No close button, no action link. + +OudsInlineAlert(label: 'This field is required.') // default: Neutral +OudsInlineAlert(label: 'Invalid format.', status: Negative()) +OudsInlineAlert(label: 'Saved successfully.', status: Positive()) +OudsInlineAlert(label: 'Check your connection.', status: Warning()) +``` + +--- + +### Badge + +Always provide `semanticsLabel` — color is the only visual differentiator. + +```dart +// Standard badge (dot) +OudsBadge.standard( + status: Negative(), + size: OudsBadgeSize.medium, + semanticsLabel: 'Error', + child: Icon(Icons.mail), +) + +// Count badge — values >= 100 are displayed as "+99" +OudsBadge.count( + label: '12', + status: Info(), + size: OudsBadgeSize.large, + semanticsLabel: '12 notifications', + child: Icon(Icons.notifications), +) + +// Icon badge with functional status icon +OudsBadge.icon( + status: Warning(), + size: OudsBadgeSize.large, + semanticsLabel: 'Warning', + child: Icon(Icons.settings), +) + +// Icon badge with custom icon (Neutral/Accent only) +OudsBadge.icon( + status: Accent(icon: 'assets/heart.svg'), + size: OudsBadgeSize.medium, + semanticsLabel: 'Favorite', + child: Icon(Icons.person), +) +``` + +> ⚠️ Deprecated: `OudsBadge(status: OudsBadgeStatus.positive)` → use named constructors above. + +--- + +### Bottom Sheet + +Two variants: **modal** (blocks the main screen) and **standard** (persistent, co-exists with main content). + +```dart +// Modal bottom sheet +OudsModalBottomSheet( + dragHandle: true, + builder: (context) => Padding( + padding: const EdgeInsets.all(16), + child: Text('Sheet content'), + ), +).show(context: context); + +// Standard (persistent) bottom sheet — with programmatic control +final scaffoldKey = GlobalKey(); + +OudsBottomSheetScaffold( + key: scaffoldKey, + sheetContent: (context) => Text('Sheet body'), + content: (context) => Text('Main screen content'), + onExpansionChanged: (expanded) => debugPrint('Expanded: $expanded'), +) + +// Expand / collapse programmatically +scaffoldKey.currentState?.expand(); +scaffoldKey.currentState?.partialExpand(); +``` + +> For the standard variant: avoid wrapping `body` in `SafeArea` and set `Scaffold(extendBody: true)` if you want content to scroll behind the sheet. + +--- + +### Button + +```dart +OudsButton( + label: 'Label', + appearance: OudsButtonAppearance.defaultAppearance, + onPressed: () {}, +) + +OudsButton( + icon: 'assets/ic_heart.svg', + appearance: OudsButtonAppearance.strong, + onPressed: () {}, +) +``` + +--- + +### Checkbox / Switch / Radio button + +These use `ouds_accessibility_plugin` internally for high-contrast detection. Semantics strings are provided automatically via `OudsLocalizations`. See §5 for state patterns. + +```dart +OudsCheckbox( + value: isChecked, + onChanged: (value) => setState(() => isChecked = value), +) + +OudsSwitch( + value: isEnabled, + onChanged: (value) => setState(() => isEnabled = value), +) + +OudsRadioButton( + value: 'option_a', + groupValue: _selected, + onChanged: (value) => setState(() => _selected = value!), +) +``` + +--- + +### Filter chip / Suggestion chip + +```dart +OudsFilterChip( + label: 'Label', + selected: true, + onSelected: (selected) {}, +) + +OudsSuggestionChip( + label: 'Label', + onPressed: () {}, +) +``` + +--- + +### Divider + +```dart +OudsDivider.horizontal() // full width, default color +OudsDivider.horizontal(color: OudsDividerColor.emphasized) +OudsDivider.horizontal(color: OudsDividerColor.brandPrimary, margin: EdgeInsets.symmetric(horizontal: 16)) + +OudsDivider.vertical() // default color +OudsDivider.vertical(color: OudsDividerColor.muted) +``` + +Available colors: `defaultColor`, `muted`, `emphasized`, `brandPrimary`, `onBrandPrimary`, `alwaysBlack`, `alwaysOnBlack`, `alwaysWhite`, `alwaysOnWhite`. + +--- + +### Link + +```dart +OudsLink( + label: 'Learn more', + onPressed: () {}, +) + +OudsLink( + label: 'Back', + layout: OudsLinkLayout.back, + onPressed: () {}, +) +``` + +--- + +### Navigation bar + +Supports 3 to 5 destinations. For the translucent variant, set `Scaffold(extendBody: true)` and avoid wrapping body in `SafeArea`. + +```dart +// Opaque (default) +OudsNavigationBar( + destinations: [ + OudsNavigationBarItem(icon: 'assets/home.svg', label: 'Home'), + OudsNavigationBarItem(icon: 'assets/search.svg', label: 'Search'), + OudsNavigationBarItem(icon: 'assets/profile.svg', label: 'Profile'), + ], + selectedIndex: _selectedIndex, + onDestinationSelected: (index) => setState(() => _selectedIndex = index), +) + +// Translucent (blurred background, content scrolls behind) +Scaffold( + extendBody: true, + bottomNavigationBar: OudsNavigationBar( + translucent: true, + destinations: [...], + selectedIndex: _selectedIndex, + onDestinationSelected: (index) => setState(() => _selectedIndex = index), + ), + body: MyScrollableContent(), +) +``` + +--- + +### Tag + +Prefer named constructors. Statuses: `Positive()`, `Negative()`, `Info()`, `Warning()`, `Accent()`, `Neutral()`. + +```dart +OudsTag.text(label: 'Label', status: Positive()) +OudsTag.text(label: 'Label', status: Warning(), size: OudsTagSize.small) +OudsTag.icon(label: 'Label', status: Neutral(icon: 'assets/ic_heart.svg')) +OudsTag.bullet(label: 'Label', status: Info()) +``` + +> ⚠️ Deprecated: `OudsTag(label: ..., status: OudsTagStatus.positive)` → use named constructors above. + +--- + +### Text input / password / phone / pin code + +See §5 for error / helper / readOnly / disabled / loading state patterns. + +```dart +// Text field — with prefix icon and helper link +OudsTextField( + decoration: OudsInputDecoration( + labelText: 'Email', + hintText: 'you@example.com', + prefixIcon: 'assets/ic_mail.svg', + helperText: 'We will never share your address.', + ), + helperLink: OudsLink(label: 'Privacy policy', onPressed: () {}), +) + +// Password input +OudsPasswordInput( + decoration: OudsPasswordInputDecoration( + labelText: 'Password', + helperText: 'At least 8 characters.', + ), +) + +// Phone number input with country selector +OudsPhoneNumberInput( + decoration: OudsInputDecoration( + labelText: 'Phone number', + hintText: '06 12 34 56 78', + ), + countrySelector: CountrySelector( + countryFilter: CountryFilter.custom, + codes: ['FR', 'TN', 'US'], + onCountryChanged: (country) {}, + readOnly: false, + ), +) + +// Pin code input +OudsPinCodeInput( + controllers: List.generate(6, (_) => TextEditingController()), + digitInputDecoration: OudsDigitInputDecoration(hintText: '-'), + helperText: 'Enter the 6-digit code sent to your email.', +) +``` + +--- + +### Top bar / App bar + +```dart +OudsTopBar( + title: 'Title', + leadingActions: [ + OudsTopBarActionConfig.back( + previousPageTitle: 'Back', + onActionPressed: () {}, + ), + ], +) +``` + +Use `OudsTopAppBar` when you need the full Material top app bar implementation (search, actions overflow, etc.). + +--- + +## 8. Testing and verification + +Before considering code complete, run all of the following: + +```bash +dart format . +flutter analyze --no-pub +(cd app && flutter test) +(cd ouds_core && flutter test) +``` + +Also run tests in every other modified package that has a `test/` directory: + +```bash +(cd ouds_global_raw_tokens && flutter test) +(cd ouds_theme_contract && flutter test) +(cd ouds_theme_orange && flutter test) +(cd ouds_theme_sosh && flutter test) +(cd ouds_theme_wireframe && flutter test) +``` + +If ARB localization files changed: + +```bash +cd app && flutter gen-l10n +cd ouds_core && flutter gen-l10n +``` + +### Multi-theme and display checklist + +- [ ] Component tested with all 4 themes: **Orange**, **Orange Compact**, **Sosh**, **Wireframe** +- [ ] Component tested in **light** and **dark** mode +- [ ] Full accessibility checklist completed → load **`ouds-flutter-accessibility`** skill for details + diff --git a/skills/ouds-flutter-migration-guide/SKILL.md b/skills/ouds-flutter-migration-guide/SKILL.md new file mode 100644 index 000000000..95669ef08 --- /dev/null +++ b/skills/ouds-flutter-migration-guide/SKILL.md @@ -0,0 +1,937 @@ +--- +name: ouds-flutter-migration-guide +description: How to migrate to OUDS Flutter — from native Flutter components, custom/branded components, or across OUDS library versions — with before/after mappings and required actions +license: MIT +--- + +# OUDS Flutter Migration Guide + +> **Agent optimization**: See [copilot-instructions.md §9](../../.github/copilot-instructions.md#9-agent-response-optimization-) for token-efficient response guidelines. + +This skill applies to migration work in the OUDS Flutter repository. Use it for Flutter adoption and version migrations, not for OUDS web, Android native, or iOS native platforms. + +Use this skill when a user asks how to: + +- **adopt** OUDS Flutter in a new or existing app (from native Flutter widgets or custom components) +- **migrate** existing OUDS Flutter code across library versions +- **understand** breaking changes between released OUDS versions + +> ⚙️ Always load **`ouds-flutter-framework-usage`** alongside this skill to get accurate component APIs, token accessors and state patterns. + +--- + +## Part 1 — Adoption: Native Flutter / Material → OUDS Flutter + +### 1.1 Quick decision checklist + +Before touching any widget, answer these questions: + +1. Is the app already wrapped in `OudsTheme`? → if not, do §1.2 first. +2. Does a direct OUDS equivalent exist for the widget? → use the mapping table in §1.3. +3. Does the widget use hardcoded colors / sizes / text styles? → replace them using §1.4. +4. Is the widget interactive? → verify accessibility in §1.6. + +--- + +### 1.2 App setup — add `OudsTheme` once + +**Before:** + +```dart +void main() => runApp(const MyApp()); + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + theme: ThemeData(colorSchemeSeed: Colors.orange), + home: const HomeScreen(), + ); + } +} +``` + +**After:** + +```dart +import 'package:ouds_theme_contract/ouds_theme.dart'; +import 'package:ouds_theme_orange/orange_theme.dart'; +import 'package:ouds_theme_orange/orange_font_service.dart'; +import 'package:ouds_core/l10n/gen/ouds_localizations.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; + +void main() { + WidgetsFlutterBinding.ensureInitialized(); + OrangeFontService.instance.loadFromCdn(); + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + final theme = OrangeTheme(OrangeFontService.instance.fontFamily); + return MaterialApp( + theme: theme.themeData, + darkTheme: theme.darkThemeData, + builder: (context, child) => OudsTheme( + themeContract: theme, + themeMode: ThemeMode.system, + onColoredSurface: false, + child: child ?? const SizedBox.shrink(), + ), + localizationsDelegates: const [ + OudsLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ], + supportedLocales: OudsLocalizations.supportedLocales, + home: const HomeScreen(), + ); + } +} +``` + +> Choose the theme that matches the brand: `OrangeTheme`, `OrangeCompactTheme`, `SoshTheme`, `WireframeTheme`. + +--- + +### 1.3 Component mapping — Material / Flutter → OUDS + +| Native Flutter / Material | OUDS equivalent | Import path | +|---------------------------|-----------------|-------------| +| `ElevatedButton` / `FilledButton` / `OutlinedButton` / `TextButton` | `OudsButton` (use `appearance:`) | `package:ouds_core/components/button/ouds_button.dart` | +| `TextField` / `TextFormField` | `OudsTextField` | `package:ouds_core/components/form_input/ouds_text_input.dart` | +| `Switch` | `OudsSwitch` | `package:ouds_core/components/switch/ouds_switch.dart` | +| `Checkbox` | `OudsCheckbox` | `package:ouds_core/components/checkbox/ouds_checkbox.dart` | +| `Radio` / `RadioListTile` | `OudsRadioButton` | `package:ouds_core/components/radio_button/ouds_radio_button.dart` | +| `FilterChip` | `OudsFilterChip` | `package:ouds_core/components/chip/ouds_filter_chip.dart` | +| `ActionChip` / `SuggestionChip` | `OudsSuggestionChip` | `package:ouds_core/components/chip/ouds_suggestion_chip.dart` | +| `Divider` / `VerticalDivider` | `OudsDivider.horizontal()` / `OudsDivider.vertical()` | `package:ouds_core/components/divider/ouds_divider.dart` | +| `InkWell` / `GestureDetector` (link) | `OudsLink` | `package:ouds_core/components/link/ouds_link.dart` | +| `NavigationBar` / `BottomNavigationBar` | `OudsNavigationBar` | `package:ouds_core/components/navigation/ouds_navigation_bar.dart` | +| `AppBar` / `SliverAppBar` | `OudsTopBar` / `OudsTopAppBar` | `package:ouds_core/components/top_bar/` | +| `SnackBar` / `Banner` | `OudsAlertMessage` / `OudsInlineAlert` | `package:ouds_core/components/alert/` | +| `showModalBottomSheet` | `OudsModalBottomSheet` | `package:ouds_core/components/bottom_sheet/ouds_modal_bottom_sheet.dart` | +| `DraggableScrollableSheet` (persistent) | `OudsBottomSheetScaffold` | `package:ouds_core/components/bottom_sheet/ouds_bottom_sheet_scaffold.dart` | +| `CircularProgressIndicator` | `OudsCircularProgressIndicator` | `package:ouds_core/components/progress/` | +| `Badge` (Material 3) | `OudsBadge.standard()` / `.count()` / `.icon()` | `package:ouds_core/components/badge/ouds_badge.dart` | +| `Chip` (read-only label) | `OudsTag.text()` / `.icon()` / `.bullet()` | `package:ouds_core/components/tag/ouds_tag.dart` | + +> If no OUDS equivalent exists yet, keep the native widget but replace hardcoded style values with OUDS tokens (see §1.4). + +--- + +### 1.4 Replacing hardcoded values with OUDS tokens + +Always use `OudsTheme.of(context)` — never hardcode colors, sizes or text styles. + +#### Colors + +```dart +// Before +Container(color: const Color(0xFFFF7900)) + +// After +final colors = OudsTheme.of(context).colorScheme(context); +Container(color: colors.actionEnabled) +``` + +Common semantic color accessors: + +| Intent | Token example | +|--------|---------------| +| Primary action | `colors.actionEnabled` | +| Destructive / error | `colors.feedbackNegativeText` | +| Surface background | `colors.bgPrimary` | +| On-surface text | `colors.contentDefault` | +| Disabled | `colors.actionDisabled` | + +#### Typography + +```dart +// Before +Text('Title', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)) + +// After +final typography = OudsTheme.of(context).typographyTokens; +Text('Title', style: typography.typeHeadingMediumLarge(context)) +``` + +Common typography token families: `typeDisplayLarge`, `typeHeadingMediumLarge`, `typeLabelDefaultMedium`, `typeBodyDefaultMedium`, `typeCodeMedium`. + +#### Spacing + +```dart +// Before +Padding(padding: const EdgeInsets.all(16)) + +// After +final spaces = OudsTheme.of(context).spaceScheme(context); +Padding(padding: EdgeInsets.all(spaces.fixedMedium)) +``` + +Common space tokens: `fixedNone`, `fixedSmash`, `fixedShortest`, `fixedShorter`, `fixedShort`, `fixedMedium`, `fixedTall`, `fixedTaller`, `fixedTallest`. + +--- + +### 1.5 Key migration examples + +#### `ElevatedButton` → `OudsButton` + +```dart +// Before +ElevatedButton( + onPressed: () {}, + child: const Text('Confirm'), +) + +// After +import 'package:ouds_core/components/button/ouds_button.dart'; + +OudsButton( + label: 'Confirm', + appearance: OudsButtonAppearance.defaultAppearance, + onPressed: () {}, +) +``` + +Available appearances: `defaultAppearance`, `strong`, `minimal`, `loading`, `negative`. + +> ⚠️ `OudsButton` is full-width by default. Wrap in `SizedBox` or `IntrinsicWidth` if you need content-sized behavior. + +--- + +#### `TextField` / `TextFormField` → `OudsTextField` + +```dart +// Before +TextField( + decoration: const InputDecoration( + labelText: 'Email', + hintText: 'you@example.com', + errorText: 'Invalid email', + ), +) + +// After +import 'package:ouds_core/components/form_input/ouds_text_input.dart'; + +OudsTextField( + decoration: OudsInputDecoration( + labelText: 'Email', + hintText: 'you@example.com', + errorText: 'Invalid email', + ), +) +``` + +State parameters: `readOnly`, `enabled`, `OudsInputDecoration(loader: true)`. +> **⛔ Forbidden**: `loader: true` + `errorText != null` simultaneously → assertion error. + +--- + +#### `Switch` → `OudsSwitch` + +```dart +// Before +Switch(value: isOn, onChanged: (v) => setState(() => isOn = v)) + +// After +import 'package:ouds_core/components/switch/ouds_switch.dart'; + +OudsSwitch( + value: isOn, + onChanged: (v) => setState(() => isOn = v), +) +``` + +Disabled: `onChanged: null`. Read-only: `readOnly: true` (keep `onChanged` set). + +--- + +#### `Checkbox` → `OudsCheckbox` + +```dart +// Before +Checkbox(value: isChecked, onChanged: (v) => setState(() => isChecked = v ?? false)) + +// After +import 'package:ouds_core/components/checkbox/ouds_checkbox.dart'; + +OudsCheckbox( + value: isChecked, + onChanged: (v) => setState(() => isChecked = v), +) +``` + +Error state: add `isError: true`. Tristate / indeterminate: add `tristate: true, value: null`. + +--- + +#### `BottomNavigationBar` / `NavigationBar` → `OudsNavigationBar` + +```dart +// Before +BottomNavigationBar( + currentIndex: _selectedIndex, + onTap: (index) => setState(() => _selectedIndex = index), + items: const [ + BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'), + BottomNavigationBarItem(icon: Icon(Icons.search), label: 'Search'), + ], +) + +// After +import 'package:ouds_core/components/navigation/ouds_navigation_bar.dart'; + +OudsNavigationBar( + destinations: [ + OudsNavigationBarItem(icon: 'assets/home.svg', label: 'Home'), + OudsNavigationBarItem(icon: 'assets/search.svg', label: 'Search'), + ], + selectedIndex: _selectedIndex, + onDestinationSelected: (index) => setState(() => _selectedIndex = index), +) +``` + +Supports 3–5 destinations. Translucent variant: add `translucent: true` + `Scaffold(extendBody: true)`. + +--- + +#### `AppBar` → `OudsTopBar` + +```dart +// Before +AppBar( + title: const Text('Settings'), + leading: BackButton(), +) + +// After +import 'package:ouds_core/components/top_bar/ouds_top_bar.dart'; + +OudsTopBar( + title: 'Settings', + leadingActions: [ + OudsTopBarActionConfig.back( + previousPageTitle: 'Back', + onActionPressed: () {}, + ), + ], +) +``` + +--- + +#### `SnackBar` → `OudsAlertMessage` / `OudsInlineAlert` + +```dart +// Before +ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Profile updated')), +) + +// After — persistent alert in the content tree +import 'package:ouds_core/components/alert/ouds_alert_message.dart'; + +OudsAlertMessage( + label: 'Profile updated.', + status: Positive(), + onClose: () {}, +) + +// After — lightweight inline alert (no close button) +import 'package:ouds_core/components/alert/ouds_inline_alert.dart'; + +OudsInlineAlert(label: 'Profile updated.', status: Positive()) +``` + +--- + +### 1.6 Accessibility — migration-specific points + +> For the full a11y reference, load the **`ouds-flutter-accessibility`** skill. + +Migration-specific actions to perform after replacing native widgets with OUDS equivalents: + +- [ ] Remove hardcoded `Semantics(label: '...')` strings → use `OudsLocalizations.of(context)` instead +- [ ] Remove `MediaQuery.textScalerOf(context)` overrides — OUDS typography tokens handle scaling automatically +- [ ] Remove `SystemChrome.setPreferredOrientations` locks — OUDS supports both orientations +- [ ] Replace `Icon(Icons.xxx)` with SVG asset paths where OUDS components require it (e.g. `OudsNavigationBarItem(icon: 'assets/...')`) +- [ ] Add `semanticsLabel` on every `OudsBadge` — color is the only visual differentiator +- [ ] Run TalkBack (Android) and VoiceOver (iOS) to verify after migration + +--- + +## Part 2 — Adoption: Custom / branded components → OUDS Flutter + +### 2.1 Decision tree + +``` +Custom component + │ + ▼ +Does an OUDS equivalent exist? (see §1.3) + ├─ Yes → Replace entirely + └─ No ─┐ + ▼ + Is the custom widget purely visual (no interaction)? + ├─ Yes → Keep widget structure, replace hardcoded values with OUDS tokens (§2.2 – §2.4) + └─ No → Wrap in Semantics, replace state management patterns (§2.5) +``` + +--- + +### 2.2 Migrating custom colors → OUDS color tokens + +Custom components often define their own color palette (constants, extension on `ThemeData`, or `ColorScheme` overrides). Replace all of these with the OUDS color scheme. + +**Before:** + +```dart +class AppColors { + static const primary = Color(0xFFFF7900); + static const error = Color(0xFFCD3C14); + static const surface = Color(0xFFFFFFFF); +} + +Container(color: AppColors.primary) +``` + +**After:** + +```dart +final colors = OudsTheme.of(context).colorScheme(context); +Container(color: colors.actionEnabled) +``` + +**Mapping approach:** + +| Semantic intent | OUDS accessor example | +|-----------------|-----------------------| +| Brand / primary action | `colors.actionEnabled` | +| Hover / pressed action | `colors.actionHover` / `colors.actionPressed` | +| Error / destructive | `colors.feedbackNegativeText` | +| Success | `colors.feedbackPositiveText` | +| Warning | `colors.feedbackWarningText` | +| Informational | `colors.feedbackInfoText` | +| Text on surface | `colors.contentDefault` | +| Muted / secondary text | `colors.contentMuted` | +| Background primary | `colors.bgPrimary` | +| Background secondary | `colors.bgSecondary` | +| Overlay / scrim | `colors.overlayDefault` | + +> Browse the full list in `ouds_theme_contract/lib/tokens/semantic/` (generated by Tokenator — read-only). + +--- + +### 2.3 Migrating custom text styles → OUDS typography tokens + +**Before:** + +```dart +const TextStyle titleStyle = TextStyle( + fontFamily: 'HelvNeue', + fontSize: 24, + fontWeight: FontWeight.w700, + height: 1.25, +); + +Text('Title', style: titleStyle) +``` + +**After:** + +```dart +final typography = OudsTheme.of(context).typographyTokens; +Text('Title', style: typography.typeHeadingMediumLarge(context)) +``` + +**Typography token families:** + +| Role | Token example | +|------|---------------| +| Hero / display | `typeDisplayLarge(context)` | +| Section heading (large) | `typeHeadingMediumLarge(context)` | +| Section heading (small) | `typeHeadingMediumSmall(context)` | +| Label / button text | `typeLabelDefaultMedium(context)` | +| Body paragraph | `typeBodyDefaultMedium(context)` | +| Caption / hint | `typeBodyDefaultSmall(context)` | +| Monospace / code | `typeCodeMedium(context)` | + +> All tokens automatically respect the system font scale — never override `MediaQuery.textScalerOf`. + +--- + +### 2.4 Migrating custom spacing → OUDS space tokens + +**Before:** + +```dart +const double kPaddingSmall = 8.0; +const double kPaddingMedium = 16.0; +const double kPaddingLarge = 24.0; + +Padding(padding: const EdgeInsets.all(kPaddingMedium)) +``` + +**After:** + +```dart +final spaces = OudsTheme.of(context).spaceScheme(context); +Padding(padding: EdgeInsets.all(spaces.fixedMedium)) +``` + +**Space token reference:** + +| Custom value (example) | OUDS token | +|------------------------|------------| +| 0 | `spaces.fixedNone` | +| 2 | `spaces.fixedSmash` | +| 4 | `spaces.fixedShortest` | +| 8 | `spaces.fixedShorter` | +| 12 | `spaces.fixedShort` | +| 16 | `spaces.fixedMedium` | +| 24 | `spaces.fixedTall` | +| 32 | `spaces.fixedTaller` | +| 40+ | `spaces.fixedTallest` | + +--- + +### 2.5 Migrating custom interactive components + +Custom interactive widgets (custom buttons, toggles, selectors) usually combine a `GestureDetector` / `InkWell`, a custom `BoxDecoration` for visual state, and a `StatefulWidget` for selected / pressed / disabled states. + +**Migration steps:** + +1. Check §1.3 — if an OUDS equivalent exists, replace entirely. +2. If not, keep the widget skeleton and: + - Replace `BoxDecoration` colors with `OudsTheme.of(context).colorScheme(context)`. + - Replace `TextStyle` with `OudsTheme.of(context).typographyTokens`. + - Replace padding / border-radius constants with `spaceScheme` / `sizeScheme` tokens. + - Wrap the root in `Semantics` with the appropriate flags. + +**Before — custom toggle button:** + +```dart +class CustomToggle extends StatefulWidget { + final bool value; + final ValueChanged onChanged; + const CustomToggle({required this.value, required this.onChanged, super.key}); + @override + State createState() => _CustomToggleState(); +} + +class _CustomToggleState extends State { + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => widget.onChanged(!widget.value), + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + width: 52, + height: 28, + decoration: BoxDecoration( + color: widget.value ? const Color(0xFFFF7900) : const Color(0xFFCCCCCC), + borderRadius: BorderRadius.circular(14), + ), + ), + ); + } +} +``` + +**After — replace with `OudsSwitch` (preferred):** + +```dart +import 'package:ouds_core/components/switch/ouds_switch.dart'; + +OudsSwitch( + value: _isEnabled, + onChanged: (v) => setState(() => _isEnabled = v), +) +``` + +**After — if no OUDS equivalent, apply tokens + Semantics:** + +```dart +class _CustomToggleState extends State { + @override + Widget build(BuildContext context) { + final colors = OudsTheme.of(context).colorScheme(context); + final sizes = OudsTheme.of(context).sizeScheme(context); + + return Semantics( + toggled: widget.value, + button: true, + child: GestureDetector( + onTap: () => widget.onChanged(!widget.value), + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + width: sizes.iconWithLabelSizeShort, + height: sizes.iconSizeMedium, + decoration: BoxDecoration( + color: widget.value + ? colors.actionEnabled // replaces hardcoded orange + : colors.actionDisabled, // replaces hardcoded grey + borderRadius: BorderRadius.circular(sizes.iconSizeMedium / 2), + ), + ), + ), + ); + } +} +``` + +--- + +### 2.6 Migrating custom cards and containers + +| What | Replace with | +|------|-------------| +| `color: const Color(0xFF...)` | `colors.bgSecondary` or `colors.bgPrimary` | +| `border: Border.all(color: ...)` | `colors.borderDefault` or `colors.borderStrong` | +| `borderRadius: BorderRadius.circular(12)` | `theme.sizeScheme(context)` radius tokens when available | +| `Padding(padding: const EdgeInsets.all(16))` | `spaces.fixedMedium` | + +**Before:** + +```dart +Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: const Color(0xFFDDDDDD)), + ), + child: content, +) +``` + +**After:** + +```dart +final colors = OudsTheme.of(context).colorScheme(context); +final spaces = OudsTheme.of(context).spaceScheme(context); + +Container( + padding: EdgeInsets.all(spaces.fixedMedium), + decoration: BoxDecoration( + color: colors.bgPrimary, + borderRadius: BorderRadius.circular(12), // keep until radius tokens are available + border: Border.all(color: colors.borderDefault), + ), + child: content, +) +``` + +--- + +### 2.7 Customization via `OudsThemeConfigModel` and `OudsThemeTweak` + +When migrating a component that had local visual overrides (rounded corners, inverted theme), use the OUDS config and tweak mechanisms instead of custom style parameters. + +```dart +// Local config override (e.g. non-rounded buttons in a specific area) +OudsThemeConfigModel( + button: OudsButtonConfig(rounded: false), + textInput: OudsTextInputConfig(rounded: true), + child: MySection(), +) + +// Force dark mode locally (e.g. hero banner on a colored surface) +OudsThemeTweak( + tweak: OudsThemeTweakType.forceDark, + child: MyHeroBanner(), +) +``` + +--- + +### 2.8 Migration validation checklist (custom components) + +- [ ] No `Color(0xFF...)` literal remaining — all colors from `colorScheme(context)` +- [ ] No `TextStyle(fontSize: ...)` literal remaining — all styles from `typographyTokens` +- [ ] No magic number padding/margin — all values from `spaceScheme(context)` or `sizeScheme(context)` +- [ ] All user-facing strings use `OudsLocalizations.of(context)` or app localizations +- [ ] `dart format .` → `flutter analyze --no-pub` → zero errors +- [ ] Full accessibility checklist completed → load **`ouds-flutter-accessibility`** skill for details + +--- + +## Part 3 — OUDS version-to-version migration + +Use this part when the codebase **already uses OUDS Flutter** and you need to update to a newer OUDS version. + +### 3.1 Quick triage + +Before proposing changes: + +1. Identify the source version and target version. +2. Check whether the migration is additive, deprecated-but-compatible, or breaking. +3. Search for deprecated constructors and theme config usage in the affected code. +4. Prefer direct API migrations shown in `MIGRATION.md` over guessed replacements. + +--- + +### 3.2 Version summary + +| Migration | Compatibility | Migration required | Main topics | +|-----------|---------------|--------------------|-------------| +| `v1.3.0 → v1.3.1` | Full | No | Maintenance release, bug fixes, accessibility improvements | +| `v1.2.0 → v1.3.0` | Partial | Yes for deprecated APIs | `OudsTag` named constructors, `OudsBadge` named constructors, `OudsPinCodeInput.keyboardType`, new alert/bottom-sheet components | +| `v1.1.x → v1.2.0` | No | Yes | `OudsTagConfig` removal from theme config, status icon updates, top bar components, French support | +| `v1.0.0 → v1.1.1` | Partial | Usually yes | `OrangeTheme` deprecation, `OudsButton` full-width behavior, Orange Compact theme, token updates | + +--- + +### 3.3 High-impact migrations + +#### 3.3.1 `OudsTag` → named constructors (`v1.2.x` → `v1.3.0`) + +**Before:** + +```dart +OudsTag( + label: 'My Tag', + status: OudsTagStatus.positive, + size: OudsTagSize.small, +) + +OudsTag( + label: 'Custom', + layout: OudsTagLayout.textAndIcon, + status: OudsTagStatus.neutral, + icon: 'assets/custom_icon.svg', +) +``` + +**After:** + +```dart +OudsTag.text( + label: 'My Tag', + status: Positive(), + size: OudsTagSize.small, +) + +OudsTag.icon( + label: 'Custom', + status: Neutral(icon: 'assets/custom_icon.svg'), +) +``` + +**Required actions:** + +- Replace `OudsTag(...)` with `OudsTag.text(...)`, `OudsTag.icon(...)`, or `OudsTag.bullet(...)`. +- Replace `OudsTagStatus` enum values with `OudsIconStatus` classes. +- Remove `layout` and `icon` parameters — move the icon into `Accent(icon: ...)` or `Neutral(icon: ...)`. + +**Status mapping:** + +| Old | New | +|-----|-----| +| `OudsTagStatus.positive` | `Positive()` | +| `OudsTagStatus.negative` | `Negative()` | +| `OudsTagStatus.info` | `Info()` | +| `OudsTagStatus.warning` | `Warning()` | +| `OudsTagStatus.accent` | `Accent()` | +| `OudsTagStatus.neutral` | `Neutral()` | + +--- + +#### 3.3.2 `OudsBadge` → named constructors (`v1.2.x` → `v1.3.0`) + +**Before:** + +```dart +OudsBadge( + status: OudsBadgeStatus.positive, + size: OudsBadgeSize.medium, +) + +OudsBadge( + status: OudsBadgeStatus.negative, + size: OudsBadgeSize.large, + label: '5', +) +``` + +**After:** + +```dart +OudsBadge.standard( + status: Positive(), + size: OudsBadgeSize.medium, +) + +OudsBadge.count( + status: Negative(), + size: OudsBadgeSize.large, + label: '5', +) +``` + +**Required actions:** + +- Replace `OudsBadge(...)` with `OudsBadge.standard(...)`, `OudsBadge.count(...)`, or `OudsBadge.icon(...)`. +- Replace `OudsBadgeStatus` with `OudsIconStatus` classes (same mapping as `OudsTag`). +- Remove the `icon` parameter — icon is now derived from `status`. + +--- + +#### 3.3.3 Remove `OudsTagConfig` from `OudsThemeConfigModel` (`v1.1.x` → `v1.2.0`) + +**Before:** + +```dart +OudsThemeConfigModel( + tag: OudsTagConfig(roundedCorners: true), + child: MyApp(), +) +``` + +**After:** + +```dart +OudsThemeConfigModel( + child: MyApp(), +) + +OudsTag.text( + label: 'My Tag', + roundedCorners: true, + status: Positive(), +) +``` + +**Required actions:** + +- Remove `tag: OudsTagConfig(...)` from `OudsThemeConfigModel`. +- Move tag corner styling to the widget itself via `roundedCorners`. + +--- + +#### 3.3.4 `OrangeTheme` deprecation (`v1.0.0` → `v1.1.1`) + +`MIGRATION.md` documents a move from `OrangeTheme` to `OudsOrangeTheme`. + +Use `MIGRATION.md` as source of truth, but verify the currently available theme API in the repository first — the current codebase exposes `OrangeTheme` via `ouds_theme_orange/lib/orange_theme.dart`. + +**Migration-safe approach:** + +1. Inspect the imports and currently installed package version. +2. Align the code with the version actually installed. +3. Do not blindly apply this step without confirming the theme API surface. + +--- + +### 3.4 Medium and low impact migrations + +#### `OudsButton` full width by default (`v1.0.0` → `v1.1.1`) + +If legacy UI relied on content-sized buttons, constrain width explicitly: + +```dart +SizedBox( + width: 200, + child: OudsButton( + label: 'Click me', + onPressed: () {}, + appearance: OudsButtonAppearance.defaultAppearance, + ), +) +``` + +Alternative: `IntrinsicWidth` wrapper. + +#### `OudsPinCodeInput.keyboardType` (`v1.2.0` → `v1.3.0`) + +Additive, not breaking: + +```dart +OudsPinCodeInput( + controllers: List.generate(6, (_) => TextEditingController()), + keyboardType: OudsPinCodeKeyboardType.alphanumeric, +) +``` + +If not needed, keep the default numeric behavior. + +#### Token updates + +When the migration guide mentions token updates: + +- review any custom theme overrides, +- verify that component-specific overrides still apply, +- do **not** manually edit generated token files. + +--- + +### 3.5 New components introduced by version + +#### `v1.2.0 → v1.3.0` + +| Component | Class | +|-----------|-------| +| Bottom Sheet | `OudsBottomSheetScaffold`, `OudsModalBottomSheet` | +| Alert Message | `OudsAlertMessage` | +| Inline Alert | `OudsInlineAlert` | + +#### `v1.1.x → v1.2.0` + +| Component | Class | +|-----------|-------| +| Toolbar Top | `OudsToolbarTop` | +| Top App Bar | `OudsTopAppBar` | + +#### `v1.0.0 → v1.1.1` + +| Component | Class | +|-----------|-------| +| Navigation Bar | `OudsNavigationBar` | +| Bottom Navigation | `OudsBottomBar` | +| Navigation Bar Item | `OudsNavigationBarItem` | + +--- + +### 3.6 Migration workflow for code changes + +When performing a version-to-version migration: + +1. Search for deprecated symbols: + - `OudsTag(` + - `OudsBadge(` + - `OudsTagStatus` + - `OudsBadgeStatus` + - `OudsTagConfig` +2. Replace APIs using the before/after mappings in §3.3. +3. Update related demo screens if public APIs changed. +4. Update dartdoc examples if they still show deprecated usage. +5. Run the required verification steps: + +```bash +dart format . +flutter analyze --no-pub +(cd app && flutter test) +(cd ouds_core && flutter test) +``` + +Also run tests in every other modified package that has a `test/` directory. + +--- + +## Support + +If a migration is unclear or incomplete: + +- read `MIGRATION.md` first, +- inspect current implementations in `ouds_core/lib/components/` and theme packages, +- then use the repository support channels documented in `MIGRATION.md`: + - GitHub issues + - GitHub discussions + - `.github/MAINTAINERS.md` + diff --git a/skills/ouds-flutter-vocabulary/SKILL.md b/skills/ouds-flutter-vocabulary/SKILL.md new file mode 100644 index 000000000..cac69ebf6 --- /dev/null +++ b/skills/ouds-flutter-vocabulary/SKILL.md @@ -0,0 +1,40 @@ +--- +name: ouds-flutter-vocabulary +description: Reference guide for OUDS Flutter vocabulary and core concepts (Tokenator, token types, theme, theme tweak, theme config, token provider, component) +license: MIT +--- + +# OUDS Flutter Vocabulary + +> **Agent optimization**: See [copilot-instructions.md §9](../../.github/copilot-instructions.md#9-agent-response-optimization-) for token-efficient response guidelines. + +This skill applies to the OUDS Flutter repository and terminology. Use it for Flutter-specific OUDS vocabulary, not for OUDS web, Android native, or iOS native platforms. + +## Terminology + +| Term | Definition | +|------|------------| +| **Tokenator** | Internal tool that converts Figma-exported token specifications into generated Dart token source files and theme implementations | +| **token** | Named variable holding a design value; in OUDS many tokens are generated from Figma via Tokenator | +| **raw token** | Primitive token value defined in `ouds_global_raw_tokens/lib/` such as dimensions, colors, borders, opacity or fonts | +| **semantic token** | Token abstraction that carries UI meaning and is exposed through theme providers such as colors, borders, spaces, sizes, typography or elevation | +| **component token** | Token scoped to one component, exposed from `OudsTheme.of(context).componentsTokens(context)` for component-specific styling | +| **theme** | Concrete implementation of `OudsThemeContract` that provides semantic tokens, component tokens, Material `ThemeData`, assets and fonts | +| **theme contract** | The `OudsThemeContract` interface defined in `ouds_theme_contract`, implemented by all OUDS brand themes | +| **theme tweak** | Local subtree override applied with `OudsThemeTweak` to force or invert light/dark mode for a portion of the widget tree | +| **theme config** | Lightweight component-specific tuning injected with `OudsThemeConfigModel`, e.g. rounded button or text input configuration | +| **token provider** | Grouping of semantic or component tokens made accessible by the active theme | +| **component** | Reusable Flutter widget shipped by OUDS, usually under `ouds_core/lib/components//` and prefixed with `Ouds` | +| **demo app** | The `app/` package, also called "Design System Toolbox", used to showcase themes, tokens and components interactively | +| **direct package import** | Repository convention of importing components by their package path such as `package:ouds_core/components/button/ouds_button.dart` instead of a root barrel file | + +## When to load which skill + +| Task | Skill to load | +|------|---------------| +| Ask about or explain OUDS-specific terms (Tokenator, token, raw token, semantic token, component token, theme, …) | `ouds-flutter-vocabulary` (this skill) | +| Write or review Dart / Flutter code using OUDS components, themes or tokens | `ouds-flutter-framework-usage` | +| Translate a Figma token or token family into the corresponding Flutter package / token layer / naming pattern | `ouds-flutter-figma-to-dart` | +| Adopt OUDS from native Flutter or custom components, migrate between versions, remove deprecated APIs | `ouds-flutter-migration-guide` | +| Implement or review accessibility — Semantics, screen readers, text scale, high-contrast, orientation | `ouds-flutter-accessibility` | +