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

feat(checkbox, tree-item, card): add component tokens with fallbacks #8838

Merged
merged 14 commits into from
Mar 2, 2024

Conversation

alisonailea
Copy link
Contributor

Related Issue: #7180

Summary

Checkbox

--calcite-checkbox-background-color: defines the background color of the component
--calcite-checkbox-background-color-checked: defines the background color of the component when it's in a ::checked state
--calcite-checkbox-icon-color: defines the icon color of the checkbox.
--calcite-checkbox-shadow: defines the shadow of the component
--calcite-checkbox-shadow-checked: defines the shadow of the component in a ::checked state
--calcite-checkbox-shadow-hover: defines the shadow of the component in a :hover state.
--calcite-checkbox-shadow-invalid: defines the shadow of the component in an invalid state.
--calcite-checkbox-size: defines the checkbox's size vertically and horizontally.

Tree Item

--calcite-tree-item-checkbox-background-color: defines the background-color of the sub-component.
--calcite-tree-item-checkbox-background-color-checked: defines the background-color of the sub-component when checked.
--calcite-tree-item-checkbox-icon-color: defines the checkmark color of the sub-component.
--calcite-tree-item-checkbox-shadow: defines the shadow of the sub-component.
--calcite-tree-item-checkbox-shadow-checked: defines the shadow of the sub-component when checked.
--calcite-tree-item-checkbox-shadow-hover: defines the shadow of the sub-component when hovered.
--calcite-tree-item-checkbox-shadow-invalid: defines the shadow of the sub-component when invalid.
--calcite-tree-item-checkbox-size: defines the size of the sub-component.

Card

--calcite-card-checkbox-background-color: defines the background-color of the sub-component.
--calcite-card-checkbox-background-color-checked: defines the background-color of the sub-component when checked.
--calcite-card-checkbox-icon-color: defines the checkmark color of the sub-component.
--calcite-card-checkbox-shadow: defines the shadow of the sub-component.
--calcite-card-checkbox-shadow-checked: defines the shadow of the sub-component when checked.
--calcite-card-checkbox-shadow-hover: defines the shadow of the sub-component when hovered.
--calcite-card-checkbox-shadow-invalid: defines the shadow of the sub-component when invalid.
--calcite-card-checkbox-size: defines the size of the sub-component.

@alisonailea alisonailea added enhancement Issues tied to a new feature or request. design-tokens Issues requiring design tokens. labels Feb 27, 2024
@alisonailea alisonailea requested a review from a team as a code owner February 27, 2024 18:56
@alisonailea alisonailea added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Feb 28, 2024
…components into astump/7180-checkbox

# Conflicts:
#	packages/calcite-components/src/components/card/card.scss
@alisonailea alisonailea requested review from a team and macandcheese February 29, 2024 18:10
* @prop --calcite-card-background-color: Specifies the background color of the component.
* @prop --calcite-card-border-color: Specifies the border color of the component.
* @prop --calcite-card-shadow: Specifies the shadow of the component.
* @prop --calcite-card-checkbox-background-color-checked: *deprecated* defines the background-color of the sub-component when checked.
* @prop --calcite-card-checkbox-background-color: *deprecated* defines the background-color of the sub-component.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a convention outside the scope of this, but can we use [Deprecated] for this tag?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can have a custom stylelint rule for this? Deprecated should be surrounded by brackets or something.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that's a good idea. Both @prop here and @slot in the tsx files use this as unfortunately you can't use the built-in JSDoc @deprecated functionality. Maybe something Stencil could build into their compiler.

Copy link
Member

Choose a reason for hiding this comment

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

We could open a stencil request for this but i'm not sure if they would add it.

Copy link
Member

Choose a reason for hiding this comment

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

Would it be the same as this issue @macandcheese ? ionic-team/stencil#3111

Copy link
Contributor

Choose a reason for hiding this comment

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

Similar - the JSDoc @deprecated they mention in the follow-up comment works for props, events, methods, just not for slots / css props.

* @prop --calcite-card-checkbox-shadow-hover: *deprecated* defines the shadow of the sub-component when hovered.
* @prop --calcite-card-checkbox-shadow-invalid: *deprecated* defines the shadow of the sub-component when invalid.
* @prop --calcite-card-checkbox-shadow: *deprecated* defines the shadow of the sub-component.
* @prop --calcite-card-checkbox-size: *deprecated* defines the size of the sub-component.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to allow the checkbox size to be customized when it's rendered within another component. Applies to Tree Item as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a previously documented token though. I think we need to deprecate and remove in the next breaking change

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I just meant --calcite-card-checkbox-size and --calcite-tree-item-checkbox-size.

* @prop --calcite-tree-item-checkbox-shadow: defines the shadow of the sub-component.
* @prop --calcite-tree-item-checkbox-shadow-checked: defines the shadow of the sub-component when checked.
* @prop --calcite-tree-item-checkbox-shadow-hover: defines the shadow of the sub-component when hovered.
* @prop --calcite-tree-item-checkbox-shadow-invalid: defines the shadow of the sub-component when invalid.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think a Checkbox can be in an invalid state within Tree, so this isn't applicable.

* @prop --calcite-card-checkbox-icon-color: *deprecated* defines the checkmark color of the sub-component.
* @prop --calcite-card-checkbox-shadow-checked: *deprecated* defines the shadow of the sub-component when checked.
* @prop --calcite-card-checkbox-shadow-hover: *deprecated* defines the shadow of the sub-component when hovered.
* @prop --calcite-card-checkbox-shadow-invalid: *deprecated* defines the shadow of the sub-component when invalid.
Copy link
Contributor

Choose a reason for hiding this comment

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

This one as well - the Checkbox within Card can't be in an invalid state.

@alisonailea alisonailea requested review from macandcheese and a team March 1, 2024 17:48
@alisonailea alisonailea merged commit 93146c2 into epic/7180-component-tokens Mar 2, 2024
4 checks passed
@alisonailea alisonailea deleted the astump/7180-checkbox branch March 2, 2024 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design-tokens Issues requiring design tokens. enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants