Skip to content

Commit d5a0513

Browse files
authored
chore: add opacity tokens (#36)(#63)
1 parent 4900671 commit d5a0513

File tree

15 files changed

+123
-7
lines changed

15 files changed

+123
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11+
- [Library] Add opacity tokens ([#36](https://github.com/Orange-OpenSource/ouds-flutter/issues/36))
1112
- [DemoApp] Rename demo app to DesignToolbox ([#28](https://github.com/Orange-OpenSource/ouds-flutter/issues/28))
1213
- [Library] Implement tokens architecture ([#37](https://github.com/Orange-OpenSource/ouds-flutter/issues/37))
1314
- [Library] Create the basics of a documentation ([#7](https://github.com/Orange-OpenSource/ouds-flutter/issues/7))

app/pubspec.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,42 +304,42 @@ packages:
304304
path: "../ouds_core"
305305
relative: true
306306
source: path
307-
version: "0.0.1"
307+
version: "0.1.0"
308308
ouds_global_raw_tokens:
309309
dependency: transitive
310310
description:
311311
path: "../ouds_global_raw_tokens"
312312
relative: true
313313
source: path
314-
version: "0.0.1"
314+
version: "0.1.0"
315315
ouds_theme_contract:
316316
dependency: "direct main"
317317
description:
318318
path: "../ouds_theme_contract"
319319
relative: true
320320
source: path
321-
version: "0.0.1"
321+
version: "0.1.0"
322322
ouds_theme_orange:
323323
dependency: "direct main"
324324
description:
325325
path: "../ouds_theme_orange"
326326
relative: true
327327
source: path
328-
version: "0.0.1"
328+
version: "0.1.0"
329329
ouds_theme_orange_country:
330330
dependency: "direct main"
331331
description:
332332
path: "../ouds_theme_orange_country"
333333
relative: true
334334
source: path
335-
version: "0.0.1"
335+
version: "0.1.0"
336336
ouds_theme_white_label:
337337
dependency: "direct main"
338338
description:
339339
path: "../ouds_theme_white_label"
340340
relative: true
341341
source: path
342-
version: "0.0.1"
342+
version: "0.1.0"
343343
package_config:
344344
dependency: transitive
345345
description:

ouds_core/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11+
- [Library] Add opacity tokens ([#36](https://github.com/Orange-OpenSource/ouds-flutter/issues/36))
1112
- [Library] Implement tokens architecture ([#37](https://github.com/Orange-OpenSource/ouds-flutter/issues/37))
1213
- [Library] Create the basics of a documentation ([#7](https://github.com/Orange-OpenSource/ouds-flutter/issues/7))
1314
- [Library] Create the basic architecture of the library ([#4](https://github.com/Orange-OpenSource/ouds-flutter/issues/4))

ouds_global_raw_tokens/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11+
- [Library] Add opacity tokens ([#36](https://github.com/Orange-OpenSource/ouds-flutter/issues/36))
1112
- [Library] Implement tokens architecture ([#37](https://github.com/Orange-OpenSource/ouds-flutter/issues/37))
1213
- [Library] Create the basics of a documentation ([#7](https://github.com/Orange-OpenSource/ouds-flutter/issues/7))
1314
- [Library] Create the basic architecture of the library ([#4](https://github.com/Orange-OpenSource/ouds-flutter/issues/4))

ouds_theme_contract/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11+
- [Library] Add opacity tokens ([#36](https://github.com/Orange-OpenSource/ouds-flutter/issues/36))
1112
- [Library] Implement tokens architecture ([#37](https://github.com/Orange-OpenSource/ouds-flutter/issues/37))
1213
- [Library] Create the basics of a documentation ([#7](https://github.com/Orange-OpenSource/ouds-flutter/issues/7))
1314
- [Library] Create the basic architecture of the library ([#4](https://github.com/Orange-OpenSource/ouds-flutter/issues/4))

ouds_theme_contract/lib/ouds_theme_contract.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import 'package:ouds_theme_contract/theme/tokens/components/ouds_components_toke
1717
import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_border_semantic_tokens.dart';
1818
import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_semantic_tokens.dart';
1919
import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_font_semantic_tokens.dart';
20+
import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_opacity_semantic_tokens.dart';
2021

2122
/// Contract to create an OUDS-compliant theme.
2223
/// Any values that are not defined will inherit from the default Orange theme.
@@ -31,6 +32,9 @@ abstract interface class OudsThemeContract {
3132
/// Customization of the OUDS components if needed
3233
OudsComponentsTokens get componentsTokens;
3334

35+
/// Opacity semantic tokens values used in the theme
36+
OudsOpacitySemanticTokens get opacityTokens;
37+
3438
/// Border semantic tokens values used in the theme
3539
OudsBorderSemanticTokens get borderTokens;
3640

ouds_theme_contract/lib/ouds_tokens_provider.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,22 @@
1313
import 'package:ouds_theme_contract/ouds_color_scheme.dart';
1414
import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_border_semantic_tokens.dart';
1515
import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_font_semantic_tokens.dart';
16+
import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_opacity_semantic_tokens.dart';
1617

1718
/// [OudsProvidersTokens] is a container class that holds the theme-related tokens for color, border, and font.
18-
/// It provides access to different theme tokens like [OudsColorScheme], [OudsBorderSemanticTokens], and [OudsFontSemanticTokens],
19+
/// It provides access to different theme tokens like [OudsColorScheme], [OudsBorderSemanticTokens], and [OudsFontSemanticTokens] etc,
1920
/// which are used to apply the appropriate styling across the application.
2021
/// This class allows easy access to the semantic tokens for the theme, ensuring consistent design application.
2122
2223
class OudsProvidersTokens {
2324
final OudsColorScheme colorScheme;
25+
final OudsOpacitySemanticTokens opacityTokens;
2426
final OudsBorderSemanticTokens borderTokens;
2527
final OudsFontSemanticTokens fontTokens;
2628

2729
OudsProvidersTokens({
2830
required this.colorScheme,
31+
required this.opacityTokens,
2932
required this.borderTokens,
3033
required this.fontTokens,
3134
});
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// Software Name: OUDS Flutter
3+
// SPDX-FileCopyrightText: Copyright (c) Orange SA
4+
// SPDX-License-Identifier: MIT
5+
//
6+
// This software is distributed under the MIT license,
7+
// the text of which is available at https://opensource.org/license/MIT/
8+
// or see the "LICENSE" file for more details.
9+
//
10+
// Software description: Flutter library of reusable graphical components
11+
//
12+
13+
// Tokens version 0.5.0
14+
// Generated by Tokenator
15+
16+
17+
abstract class OudsOpacitySemanticTokens {
18+
late double invisible;
19+
late double medium;
20+
late double opaque;
21+
late double strong;
22+
late double weak;
23+
late double weaker;
24+
}

ouds_theme_orange/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11+
- [Library] Add opacity tokens ([#36](https://github.com/Orange-OpenSource/ouds-flutter/issues/36))
1112
- [Library] Implement tokens architecture ([#37](https://github.com/Orange-OpenSource/ouds-flutter/issues/37))
1213
- [Library] Create the basics of a documentation ([#7](https://github.com/Orange-OpenSource/ouds-flutter/issues/7))
1314
- [Library] Create the basic architecture of the library ([#4](https://github.com/Orange-OpenSource/ouds-flutter/issues/4))

ouds_theme_orange/lib/orange_theme.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ import 'package:ouds_theme_contract/theme/tokens/components/ouds_components_toke
1919
import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_border_semantic_tokens.dart';
2020
import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_color_semantic_tokens.dart';
2121
import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_font_semantic_tokens.dart';
22+
import 'package:ouds_theme_contract/theme/tokens/semantic/ouds_opacity_semantic_tokens.dart';
2223
import 'package:ouds_theme_orange/material/orange_material_color_dark_tokens.dart';
2324
import 'package:ouds_theme_orange/material/orange_material_color_light_tokens.dart';
2425
import 'package:ouds_theme_orange/semantic/orange_border_semantic_tokens.dart';
2526
import 'package:ouds_theme_orange/semantic/orange_color_semantic_tokens.dart';
2627
import 'package:ouds_theme_orange/semantic/orange_font_semantic_tokens.dart';
28+
import 'package:ouds_theme_orange/semantic/orange_opacity_semantic_tokens.dart';
2729

2830
/// [OrangeTheme] implements the [OudsThemeContract] and defines the "Orange" theme for the application.
2931
/// It provides both light and dark theme configurations using the OUDS design system, including color, typography,
@@ -65,6 +67,9 @@ class OrangeTheme implements OudsThemeContract {
6567
OudsColorSemanticTokens get colorSemanticTokens =>
6668
OrangeColorSemanticTokens();
6769

70+
@override
71+
OudsOpacitySemanticTokens get opacityTokens => OrangeOpacitySemanticTokens();
72+
6873
@override
6974
OudsBorderSemanticTokens get borderTokens => OrangeBorderSemanticTokens();
7075

@@ -78,6 +83,7 @@ class OrangeTheme implements OudsThemeContract {
7883
@override
7984
OudsProvidersTokens get providersTokens => OudsProvidersTokens(
8085
colorScheme: colorsScheme,
86+
opacityTokens: opacityTokens,
8187
borderTokens: borderTokens,
8288
fontTokens: fontTokens);
8389

0 commit comments

Comments
 (0)