Skip to content

ROU-4822 - [feat](checkbox): Add new checkbox features under the scope of the new ionic theme.#29213

Closed
JoaoFerreira-FrontEnd wants to merge 4 commits intonextfrom
ROU-4822
Closed

ROU-4822 - [feat](checkbox): Add new checkbox features under the scope of the new ionic theme.#29213
JoaoFerreira-FrontEnd wants to merge 4 commits intonextfrom
ROU-4822

Conversation

@JoaoFerreira-FrontEnd
Copy link
Contributor

@JoaoFerreira-FrontEnd JoaoFerreira-FrontEnd commented Mar 25, 2024

Issue number: ROU-4822


What is the new behavior?

  • 4 states (Selected, Unselected, Undeterminated, Error) for ionic theme
  • 5 styles (Enabled, Disabled, Hover, Pressed, Focus) for ionic theme
  • Target area (minimum 48px) for ionic theme
  • Implement the 2 sizes (24px and 18px) for ionic theme
  • Required Checkbox
  • Two orientations for the ionic theme

Does this introduce a breaking change?

  • Yes
  • No

Preview

checkbox_IonicFramework

- add features for ionic theme of checkbox;
@github-actions github-actions bot added package: core @ionic/core package package: angular @ionic/angular package package: vue @ionic/vue package labels Mar 25, 2024
@mapsandapps mapsandapps self-requested a review March 25, 2024 17:26

border: 2px solid $checkbox-ionic-focus-ring-color;

/* stylelint-disable-next-line property-disallowed-list */
Copy link
Contributor

Choose a reason for hiding this comment

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

Ionic Framework provides a @include border-radius mixin. This is why we throw the stylelint error.

This usage should be updated to:

@include border-radius(var(--border-radius));

/**
* Set to `"soft"` for a checkbox with more rounded corners.
*/
@Prop({ reflect: true }) shape?: 'soft' | 'rectangular' = 'soft';
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend removing the { reflect: true } for now. This applies to both usages.

This is some history here, but Ionic Framework currently uses reflection of CSS classes on the element host, to use for the styling selectors. We should eventually move away from this, as reflecting the attributes is actually more compliant in SSR environments (mark-up provided by the developer matches the rendered output).

Since we are not using these attributes in our current style implementation, we are invoking more JS in Stencil's virtual dom to reflect the attributes to the element.

<svg class="checkbox-icon" viewBox="0 0 24 24" part="container">
{path}
</svg>
{theme === 'ionic' && <div part="focus-ring" class="focus-ring"></div>}
Copy link
Contributor

Choose a reason for hiding this comment

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

Be sure to document this shadow part at the top of the file. You can checkout what was done for button on the latest next branch. We should make it clear this shadow part is only available in the ionic theme.

@@ -0,0 +1,43 @@
import { expect } from '@playwright/test';
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm working to correct an issue in our test generators: #29206, but after that is merged we should be able to add ionic-md to existing test cases vs. having separate test cases specifically for the ionic theme.

The advantage is we aren't maintaining entire test suites specific to a theme, but can run the same test suite against many different themes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that makes sense, I did just maintain a page with everything just for the stage, so the designers can see everything side by side.

sean-perkins added a commit that referenced this pull request Mar 29, 2024
Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Adds the default display of a checkbox with the `"ionic"` theme.
  - The default size of a checkbox with the theme is 24px.
- Adds global sass files specific to the ionic theme. 

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Split from #29213. I
will note differences in comments on this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package package: vue @ionic/vue package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants