emulsify-ds / compound

Compound is the default component collection for Emulsify
https://emulsify-ds.github.io/compound/
GNU General Public License v2.0
12 stars 12 forks source link

feat: Table component #30

Closed callinmullaney closed 2 years ago

callinmullaney commented 2 years ago

Summary

This PR fixes/implements the following bugs/features

Explain the motivation for making this change. What existing problem does the pull request solve?

Documentation Update (required)

How to review this PR

ryanhagerty commented 2 years ago

This is more of an open question:

How do we feel about making a follow-up ticket to make our tables responsive by default?

It's such a common feature request that takes a chunk of time, but my only hesitation is that it drifts into the field of 'too opinionated'. If we think it's too much, we could have an option for a 'standard (basic) table' and a 'responsive table' that users could pick from when starting up the CLI.

callinmullaney commented 2 years ago

@ryanhagerty I refactored this a bit and made the following changes:

  1. Utilize add_attributes twig function on table and cells. This allows the platform (drupal) to inject whatever attributes it needs like no_striping or sticky.
  2. Fixed the border colors mentioned in your comment above so striped rows maintain the borders between cells.
  3. Add an example data-cell-highlight to a column of cells and updated styles. This is strictly to demonstrate how to add attributes to individual cells within the same yml file.

As for the responsive table comment. I definitely agree with your assessment that this is a typical time consuming request. However, because the overflow:scroll method is less than ideal and the restacking method is more opinionated, I decided to leave that feature out of this PR for now. I think once we develop our 4K specific component library that is based on Compound we can explore this request further.

callinmullaney commented 2 years ago

@ModulesUnraveled I welcome your review of this PR as well :smile:

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 1.3.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: