-
Notifications
You must be signed in to change notification settings - Fork 5
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
USWDS-Next - Alpha: Create usa-card
component
#13
Open
mahoneycm
wants to merge
39
commits into
develop
Choose a base branch
from
cm/lit-card
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+594
−0
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
c4f8c72
Add identifier component
amyleadem 3d348a9
Add scaffolding to elements
amyleadem dae3bb9
Add attribute-based identifier
amyleadem eb8c394
Replace inline classes with slot names
amyleadem 78ff480
Clean up code
amyleadem 0bb3b3a
Check for existence of slot elements before manipulating
amyleadem f346baf
Generate logo wrapper; clean up code and comments
amyleadem d732d9d
Add examples of diff logo counts
amyleadem cb1fcb7
Create card component
mahoneycm 2bf476c
Remove identifier to isolate component
mahoneycm 80b74a5
Switch to slot approach
mahoneycm 16ffebb
Add component markup
mahoneycm e588cd8
Add usa-card group component
mahoneycm 8b88b43
Add flag variant
mahoneycm d0b9832
Remove console.log
mahoneycm 698f559
Add all variant classes
mahoneycm 104f0a3
Add all variants to index.html
mahoneycm fb9d0f8
Update properties to use reactive props syntax
mahoneycm e264fed
Co-authored-by: James Mejia <[email protected]>
mahoneycm f977c70
Add card variants to storybook
mahoneycm 833036a
Remove unused variants
mahoneycm 0dc2b0a
testing conditional image
mahoneycm ed9e4eb
Add conditional header first logic
mahoneycm 873193d
Remove unused setClasses function
mahoneycm f89956b
Revise variant approach
mahoneycm 80b53fd
Use new variant attributes
mahoneycm 51f8461
Fix exdent check
mahoneycm cb347f6
Fix indent example in index.html
mahoneycm ef16691
Update storybook controls
mahoneycm 97b3626
Remove unused functions, update attributes to kebab case
mahoneycm 1c6fb6c
Normalize storybook controls, add card group example
mahoneycm bfe9ccc
Add flag variants to card group
mahoneycm 008dc99
Add expanded control panel to display descriptions
mahoneycm 42393e6
Set heading styles via card-heading slot
mahoneycm 1e190c9
Abstract styles to usa-card.scss.js
mahoneycm ff84c5f
Merge branch 'develop' of github.com:uswds/uswds-next into cm/lit-card
mahoneycm 434007d
Move components to src/components
mahoneycm 8808009
Fix card group html display
mahoneycm 93a482a
Add story description for flag media right
mahoneycm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,24 @@ | ||||||
import { LitElement, html, unsafeCSS } from "lit"; | ||||||
import usaCardStyle from "@uswds/uswds/scss/usa-card?inline"; | ||||||
|
||||||
export class UsaCardGroup extends LitElement { | ||||||
static styles = [ | ||||||
unsafeCSS(usaCardStyle), | ||||||
] | ||||||
|
||||||
constructor() { | ||||||
super(); | ||||||
|
||||||
this.cards = [...this.children]; | ||||||
} | ||||||
|
||||||
render() { | ||||||
return html` | ||||||
<ul class="usa-card-group"> | ||||||
${this.cards.map((card) => html`<li>${card}</li>`)} | ||||||
</ul> | ||||||
` | ||||||
} | ||||||
} | ||||||
|
||||||
window.customElements.define("usa-card-group", UsaCardGroup); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Could you please add some JSDoc comments to explain the props/attributes for this component? If you end up adding any style hooks, add those in too. Take a look at the supported metadata for custom element manifests to see what's available.