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

Add Accordion list style option #90

Merged
merged 7 commits into from
Sep 14, 2023

Conversation

maxatdetroit
Copy link
Member

@maxatdetroit maxatdetroit commented Sep 12, 2023

Context

We want to add options to the Accordion component and to the List Group component in order to support a list style. See CityOfDetroit/detroitmi#1086 for an example.

This PR

This PR:

  • updates the Accordion component to support a list style by setting the data-ol attribute on the accordion component
  • removes unused variables from accordion components
  • updates accordion to use the canonical assignedElements when listening to slot changes
  • [update] allows for color customization for list numbers and borders based on bootstrap supported color variable names

There are a few other things that can be done in future PRs:

  • Dynamically update list numbers to match accordion header text styles
  • Use alternating colors for list numbers and border (Note: I don't believe this is actually desirable)

Test

Added a story for list-style accordion component. Looks good on desktop and mobile.
Screenshot 2023-09-13 at 7 25 55 PM
Screenshot 2023-09-13 at 7 26 09 PM

Ran all rendering tests:

$ yarn test-storybook
 PASS   browser: chromium  src/stories/offcanvas.stories.js
 PASS   browser: chromium  src/stories/modal.stories.js
 PASS   browser: chromium  src/stories/accordion.stories.js
 PASS   browser: chromium  src/stories/listgroup.stories.js
 PASS   browser: chromium  src/stories/card.stories.js
 PASS   browser: chromium  src/stories/alert.stories.js
 PASS   browser: chromium  src/stories/dropdown.stories.js
 PASS   browser: chromium  src/stories/pagination.stories.js
 PASS   browser: chromium  src/stories/image.stories.js
 PASS   browser: chromium  src/stories/formcheck.stories.js
 PASS   browser: chromium  src/stories/geocoder.stories.js
 PASS   browser: chromium  src/stories/navbar.stories.js
 PASS   browser: chromium  src/stories/carousel.stories.js
 PASS   browser: chromium  src/stories/buttongroup.stories.js
 PASS   browser: chromium  src/stories/nav.stories.js
 PASS   browser: chromium  src/stories/container.stories.js
 PASS   browser: chromium  src/stories/badge.stories.js
 PASS   browser: chromium  src/stories/formcontrol.stories.js
 PASS   browser: chromium  src/stories/form.stories.js
 PASS   browser: chromium  src/stories/formlabel.stories.js
 PASS   browser: chromium  src/stories/progress.stories.js
 PASS   browser: chromium  src/stories/button.stories.js
 PASS   browser: chromium  src/stories/spinner.stories.js
 PASS   browser: chromium  src/stories/icon.stories.js
 PASS   browser: chromium  src/stories/formcheckgroup.stories.js
 PASS   browser: chromium  src/stories/formselect.stories.js
 PASS   browser: chromium  src/stories/range.stories.js
 PASS   browser: chromium  src/stories/breadcrumb.stories.js
 PASS   browser: chromium  src/stories/loader.stories.js
 PASS   browser: chromium  src/stories/table.stories.js (7.346 s)

Test Suites: 30 passed, 30 total
Tests:       155 passed, 155 total
Snapshots:   0 total
Time:        8.966 s
Ran all test suites.

@jedgar1mx jedgar1mx self-requested a review September 12, 2023 17:52
Copy link
Member

@jedgar1mx jedgar1mx left a comment

Choose a reason for hiding this comment

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

We need a way to manipulate the list box color outside of the default single color.. We have instances where each item has to be a different color.

@maxatdetroit
Copy link
Member Author

maxatdetroit commented Sep 13, 2023

Heads up - I'm struggling with line endings making it look like I changed every single line of code in the files I touched. Working on resolving that now.

@maxatdetroit
Copy link
Member Author

@jedgar1mx this should be good for another review.

See the original comment for an update on what it looks like with customizable colors for the number boxes, border, and text. Customization supports bootstrap color names (primary, secondary, success, warning, dark, light, etc.).

@jedgar1mx jedgar1mx merged commit 9273e55 into CityOfDetroit:dev Sep 14, 2023
@maxatdetroit maxatdetroit deleted the Feature.1086.1 branch September 15, 2023 14:49
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.

2 participants