Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#264] Add component checkbox #447

Draft
wants to merge 27 commits into
base: develop
Choose a base branch
from
Draft

Conversation

pylapp
Copy link
Member

@pylapp pylapp commented Feb 6, 2025

Related issues

#264

Description

Add checkbox component

Motivation & Context

Types of change

  • New feature (non-breaking change which adds functionality)

Previews

Checklist

Contribution

Accessibility

  • My change follows accessibility good practices

Design

  • My change respects the design guidelines of Orange Unified Design System

Development

  • My change follows the developer guide
  • I checked my changes do not add new SwiftLint warnings
  • I have added unit tests to cover my changes (optional)

Documentation

  • My change introduces changes to the documentation and/or I have updated the documentation accordingly

Checklist (for Core Team only)

  • The evolution have been tested and the project builds for iPhones and iPads
  • Code review has been done by reviewers according to CODEOWNERS file
  • Design review has been done
  • Accessibiltiy review has been done
  • (NA) Q/A team has tested the evolution
  • Documentation has been updated if relevant
  • Internal files have been updated if relevant (like CONTRIBUTING, DEVELOP, THIRD_PARTY, CONTRIBUTORS, NOTICE)
  • CHANGELOG has been updated respecting keep a changelog rules and reference the issues
  • The wiki has been updated if needed (optional)

pylapp added 22 commits February 6, 2025 12:08
Tokens library version v0.5.0

Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
@pylapp pylapp force-pushed the 264-add-component-checkbox-4 branch from 9fe0d4b to 3eb7f25 Compare February 6, 2025 11:44
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>

// MARK: - Checkbox Configuration Model

/// The model shared between `CheckboxPageConfiguration` view and `SwitchPageComponent` view.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ The model shared between CheckboxConfiguration view and CheckboxPage view.

didSet { updateCode() }
}

@Published var labelContent: String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renouer en labelTextContent

override init() {
status = .enabled
selectorState = .selected
layout = .selectorOnly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange to have helperText and other options with switchonly selected

}
}

// MARK: - Switch Demo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkbox Demo

HStack(alignment: .center) {
Spacer()
OUDSCheckbox(state: $model.selectorState,
isError: model.isError && model.status == CheckboxConfigurationModel.DesignToolboxCheckboxStatus.enabled,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reduire CheckboxConfigurationModel.DesignToolboxCheckboxStatus.enabled, .enabled

/// isError: true,
/// divider: true)
/// ```
///
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ajouter une exemple du disable
et indiquer ce qui est interdit en complément du warning dans la description

/// - Parameters:
/// - state: A binding to a property that determines wether the selector is ticked, unticked or preticked.
/// - isError: True if the look and feel of the component must reflect an error state, default set to `false`
/// - isReadOnly: True if component is in read only, i.e. not really disabled but user cannot interact with it yet, default set to `false`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ajouter un warning si disbaled avec error et/ou readonly


extension Bundle {

/// The OUDS bundle, useful to find resources
public static let OUDSComponents = Bundle.module

/// Loads thefirst preferred localization from main Bundle or if not defined the english one
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loads the first p....

// A leading checkbox with a label
OUDSCheckbox(state: $state, label: "Hello world")

// A trailing checkbox with a label, an helper text, an icon, a divider and is about an error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ajouter le inverse pour être conforme au commentaire

@@ -20,7 +20,7 @@ import OUDSTokensSemantic

extension OrangeThemeCheckRadioComponentTokensProvider: CheckRadioComponentTokens {
@objc open var checkRadioSizeMaxHeightAssetsContainer: SizeSemanticToken { DimensionRawTokens.dimension1200 }
@objc open var checkRadioSizeMaxHeightSelectorOnly: SizeSemanticToken { DimensionRawTokens.dimension600 }
@objc open var checkRadioSizeMaxHeightSelectorOnly: SizeSemanticToken { DimensionRawTokens.dimension600 }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supprimer l'espace

Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
@pylapp pylapp added the ⌛ waiting for validations The issue associated to this pull request is being reviewed by PO / a11y tea design team label Feb 7, 2025
@pylapp pylapp marked this pull request as draft February 10, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌛ waiting for validations The issue associated to this pull request is being reviewed by PO / a11y tea design team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants