Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

refactor(library): Upgrade Library component implementation #411

Conversation

petrgazarov
Copy link
Contributor

Issue #363

Refactors TemplateLibrary component

Changes

  • Renames component to Library
  • Adds classes as a way to override default styles
  • Removes libraryProps prop, and makes other prop names more generic
  • Adds a checkbox filter based on item type
  • Adds support for heterogeneous libraries

Flags

  • This is a breaking change

@petrgazarov petrgazarov force-pushed the petrgazarov/363/upgrade-library-component branch from 21385a3 to a28c89e Compare May 11, 2020 08:10
Closes accordproject#363

Signed-off-by: Petr Gazarov <petrgazarov@gmail.com>
Comment on lines +43 to +57
- `cicero-ui__library-search-input` : search input.
- `cicero-ui__library-card` : library card. An additional class of `item.itemType` will be added to the card,
so different CSS selectors can be used based on the item's `itemType` value.
- `cicero-ui__library-card-content` : content element inside a library item card.
- `cicero-ui__library-card-logo` : logo element inside a library item card.
- `cicero-ui__library-card-header` : header element inside a library item card.
- `cicero-ui__library-card-meta` : meta element inside a library item card.
- `cicero-ui__library-card-type` : item type name element inside a library item card.
- `cicero-ui__library-card-item-version` : version element inside a library item card.
- `cicero-ui__library-card-actions` : actions element inside a library item card.
- `cicero-ui__library-card-primary-btn` : primary button inside a library item card.
- `cicero-ui__library-card-secondary-btn` : secondary button inside a library item card.
- `cicero-ui__library-add-item-button` : add new library item button.
- `cicero-ui__library-upload-button` : upload new library item button.
- `cicero-ui__library-import-button` : import new library item button.
Copy link
Member

Choose a reason for hiding this comment

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

Curious if there is any reason for this syntax? We'll be needing to sync our className properties across markdown-editor and cicero-ui, so this would likely set the standard for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No specific reason for choosing this one, @irmerk. The purpose for name-spacing here is to avoid clashes with the user's application code, as well as clashes with other components in cicero-ui library.

Copy link
Member

@DianaLease DianaLease left a comment

Choose a reason for hiding this comment

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

👏
To go off of @irmerk's comment - We talked a bit about this on Thursday, but I like the cicero-ui__ prefix for class names, and I think we could use the same pattern across cicero-ui in other components. Interested to hear other people's thoughts too though!

@jolanglinais
Copy link
Member

Yeah I think cicero-ui__<COMPONENT>-... works great. I'll make a note of that in the open PR around that.

Copy link
Member

@jolanglinais jolanglinais left a comment

Choose a reason for hiding this comment

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

🧨

This all looks great to me!

@jolanglinais jolanglinais merged commit b50bcc9 into accordproject:master May 11, 2020
@dselman dselman deleted the petrgazarov/363/upgrade-library-component branch May 11, 2020 21:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Breaking Change 💥 Type: Enhancement ✨ Improvement to process or efficiency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TemplateLibrary: make styles extensible with classes; change to support heterogeneous libraries
3 participants