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: add button-card component #990

Open
wants to merge 7 commits into
base: canary
Choose a base branch
from

Conversation

andreearusu
Copy link
Collaborator

@andreearusu andreearusu commented Oct 29, 2021

Please check if the PR fulfills these requirements

  • The commit message follows semantic commit message guidelines
  • The changes are documented in component docs and changelog
  • The ESLint plugin has been updated if a new component is added
  • Test have been added or modified, if appropriate
  • Has been verified locally

What kind of change does this PR introduce?
Added ButonCard Component

Screen.Recording.2021-10-29.at.16.59.43.mov

Closes #423

…into 3pg/feature/button-card-component

� Conflicts:
�	framework/components/AButtonCard/AButtonCard.scss
@andreearusu andreearusu requested a review from BogdanV3 October 29, 2021 13:54
@codecov
Copy link

codecov bot commented Oct 29, 2021

Codecov Report

Merging #990 (7ad15fd) into master (d4a1ace) will decrease coverage by 1.10%.
The diff coverage is 20.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #990      +/-   ##
==========================================
- Coverage   90.00%   88.90%   -1.11%     
==========================================
  Files          88       89       +1     
  Lines        2811     2856      +45     
  Branches      980      991      +11     
==========================================
+ Hits         2530     2539       +9     
- Misses        240      269      +29     
- Partials       41       48       +7     
Impacted Files Coverage Δ
framework/components/AButtonCard/AButtonCard.js 20.00% <20.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4a1ace...7ad15fd. Read the comment docs.

@andreearusu andreearusu force-pushed the 3pg/feature/button-card-component branch from 5b6d5e5 to 7ad15fd Compare October 29, 2021 15:19
@frattaro frattaro changed the title 3pg/feature/button card component feat: add button-card component Nov 1, 2021
Copy link
Contributor

@frattaro frattaro left a comment

Choose a reason for hiding this comment

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

Looks good, thanks. In the way of tests, just snapshots should take care of it -- described here: #987 (comment)

Can you add an entry in /framework/changelog.mdx along the lines of:

## 3.2.0 (pending)

- Added `AButtonCard`, `AButtonCardTitle`, `AButtonCardBody` components

Comment on lines +8 to +9
const containerClassName = " a-button-card__title";
const className = propsClassName + containerClassName;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const containerClassName = " a-button-card__title";
const className = propsClassName + containerClassName;
const className = `a-button-card__title ${propsClassName}`.trim();

* String representing class names to be passed to component container
*/
className: PropTypes.bool
};
Copy link
Contributor

Choose a reason for hiding this comment

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

The proptypes for this component can be removed since it doesn't have any custom props

Comment on lines +30 to +31
const containerClassName = " a-button-card__body";
const className = propsClassName + containerClassName;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const containerClassName = " a-button-card__body";
const className = propsClassName + containerClassName;
const className = ` a-button-card__body ${propsClassName}`.trim();

* String representing class names to be passed to component container
*/
className: PropTypes.bool
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, this proptypes can be removed

/**
* Toggles the `selected` style variant.
*/
selected: PropTypes.bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Could add target and value here just because they don't always pass through

</AButtonCard>`}
/>

<Playground
Copy link
Contributor

Choose a reason for hiding this comment

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

This playground needs a heading

<AButtonCardBody>Description of events goes here</AButtonCardBody>
</AButtonCard>
</p>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
</div>
</div>

The `AButtonCard` component inherits passed props.

<Props of="AButtonCard" />

Copy link
Contributor

Choose a reason for hiding this comment

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

Need to add props for AButtonCardTitle, AButtonCardBody, even though they're empty, only to explicitly state that they are empty

Comment on lines 3 to 8
$btn-card-min-width: 350px;
$btn-card-min-height: 150px;
$btn-card-padding: 20px;
$btn-card-title-margin-bottom: 10px;
$btn-card-font-size: $font-size--md;
$btn-card-bar-height: -5px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please distribute these values and remove the sass variables? They're not set up to be overridden and we don't have guidance on what should be overridable

Comment on lines +11 to +28
$btn-card-body-color: map-get($theme, "btn-card", "body-color");
$btn-card-body-color--selected: map-deep-get($theme, "base", "color");
$btn-card-border-color--disabled: map-get(
$theme,
"btn-card",
"border-color--disabled"
);
$btn-card-title-color--disabled: map-get(
$theme,
"btn-card",
"title-color--disabled"
);
$btn-card-body-color--disabled: map-get(
$theme,
"btn-card",
"body-color--disabled"
);
$base-color--selected: map-get($theme, "btn-card", "box-shadow--selected");
Copy link
Contributor

Choose a reason for hiding this comment

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

These also should be distributed

@frattaro
Copy link
Contributor

frattaro commented Nov 1, 2021

I made the following change to the PR description to ensure the issue linking works:

-Closes Issue #423
+Closes #423

I'm not sure if "Closes Issue" works as an auto-close keyword and I saw GitHub hadn't picked up on the issue link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button Card Component
4 participants