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(announcement): add <rh-announcement> #1722

Closed
wants to merge 110 commits into from
Closed

Conversation

alypilkons
Copy link
Collaborator

@alypilkons alypilkons commented Jul 22, 2024

What I did

  1. Created the rh-announcement banner. Figma file here.

This will be used mainly as a banner that appears at the very top of the page for personalizations run through Adobe Target.

Testing Instructions

Visit the deploy preview.

Notes to Reviewers

  • Should we use a max-width container query?
  • Should the slot for the CTA be slot="cta" or slot="footer"?
  • Right now, if there's no content in the default slot, this component will hide itself via display: none;.

I'm new to Lit and typescript so happy for any/all feedback! :)

To Do's:

Closes #1576

Copy link

changeset-bot bot commented Jul 22, 2024

🦋 Changeset detected

Latest commit: 0d98377

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@rhds/elements Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Jul 22, 2024

Deploy Preview for red-hat-design-system ready!

Name Link
🔨 Latest commit 0d98377
🔍 Latest deploy log https://app.netlify.com/sites/red-hat-design-system/deploys/66eadcb0f37fa600083afb2a
😎 Deploy Preview https://deploy-preview-1722--red-hat-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@bennypowers bennypowers changed the title Feat/rh announcement banner feat(announcement): add <rh-announcement> Jul 22, 2024
Copy link
Contributor

github-actions bot commented Jul 22, 2024

Size Change: +2.36 kB (+1.29%)

Total Size: 186 kB

Filename Size Change
./elements.js 482 B +9 B (+1.9%)
./lib/environment.js 4.1 kB +7 B (+0.17%)
./elements/rh-announcement/rh-announcement.js 2.16 kB +2.16 kB (new file) 🆕
./react/rh-announcement/rh-announcement.js 178 B +178 B (new file) 🆕
ℹ️ View Unchanged
Filename Size
./elements/rh-accordion/context.js 162 B
./elements/rh-accordion/rh-accordion-header.js 2.77 kB
./elements/rh-accordion/rh-accordion-panel.js 1.37 kB
./elements/rh-accordion/rh-accordion.js 3.17 kB
./elements/rh-alert/rh-alert.js 3.93 kB
./elements/rh-audio-player/rh-audio-player-about.js 1.85 kB
./elements/rh-audio-player/rh-audio-player-rate-stepper.js 1.85 kB
./elements/rh-audio-player/rh-audio-player-scrolling-text-overflow.js 1.53 kB
./elements/rh-audio-player/rh-audio-player-subscribe.js 1.43 kB
./elements/rh-audio-player/rh-audio-player.js 13.2 kB
./elements/rh-audio-player/rh-cue.js 2 kB
./elements/rh-audio-player/rh-transcript.js 2.75 kB
./elements/rh-avatar/random-pattern-controller.js 2.72 kB
./elements/rh-avatar/rh-avatar.js 2.9 kB
./elements/rh-back-to-top/rh-back-to-top.js 2.09 kB
./elements/rh-badge/rh-badge.js 1.1 kB
./elements/rh-blockquote/rh-blockquote.js 1.4 kB
./elements/rh-breadcrumb/rh-breadcrumb.js 1.5 kB
./elements/rh-button/rh-button.js 4.24 kB
./elements/rh-card/rh-card.js 3.48 kB
./elements/rh-code-block/prism.css.js 725 B
./elements/rh-code-block/prism.js 556 B
./elements/rh-code-block/rh-code-block.js 6.93 kB
./elements/rh-cta/rh-cta.js 3.89 kB
./elements/rh-dialog/rh-dialog.js 4.78 kB
./elements/rh-dialog/yt-api.js 617 B
./elements/rh-footer/rh-footer-block.js 766 B
./elements/rh-footer/rh-footer-copyright.js 362 B
./elements/rh-footer/rh-footer-links.js 1.17 kB
./elements/rh-footer/rh-footer-social-link.js 964 B
./elements/rh-footer/rh-footer-universal.js 4.05 kB
./elements/rh-footer/rh-footer.js 5.01 kB
./elements/rh-health-index/rh-health-index.js 2.35 kB
./elements/rh-icon/rh-icon.js 2.36 kB
./elements/rh-icon/ssr.js 181 B
./elements/rh-menu/rh-menu.js 1.29 kB
./elements/rh-navigation-secondary/rh-navigation-secondary-dropdown.js 2.47 kB
./elements/rh-navigation-secondary/rh-navigation-secondary-menu-section.js 1.35 kB
./elements/rh-navigation-secondary/rh-navigation-secondary-menu.js 1.75 kB
./elements/rh-navigation-secondary/rh-navigation-secondary-overlay.js 571 B
./elements/rh-navigation-secondary/rh-navigation-secondary.js 5.27 kB
./elements/rh-navigation-secondary/test/fixtures.js 769 B
./elements/rh-pagination/rh-pagination.js 5.46 kB
./elements/rh-site-status/rh-site-status.js 3.08 kB
./elements/rh-skip-link/rh-skip-link.js 1.24 kB
./elements/rh-spinner/rh-spinner.js 1.43 kB
./elements/rh-stat/rh-stat.js 2.2 kB
./elements/rh-subnav/rh-subnav.js 2.7 kB
./elements/rh-surface/rh-surface.js 1.11 kB
./elements/rh-surface/test/elements.js 423 B
./elements/rh-switch/rh-switch.js 2.92 kB
./elements/rh-table/rh-sort-button.js 1.49 kB
./elements/rh-table/rh-table.js 2.91 kB
./elements/rh-tabs/context.js 160 B
./elements/rh-tabs/rh-tab-panel.js 1.14 kB
./elements/rh-tabs/rh-tab.js 2.93 kB
./elements/rh-tabs/rh-tabs.js 3.68 kB
./elements/rh-tag/rh-tag.js 2.84 kB
./elements/rh-tile/rh-tile-group.js 1.81 kB
./elements/rh-tile/rh-tile.js 5.16 kB
./elements/rh-timestamp/rh-timestamp.js 983 B
./elements/rh-tooltip/rh-tooltip.js 2.24 kB
./elements/rh-video-embed/rh-video-embed.js 4.6 kB
./lib/context/color/consumer.js 1.23 kB
./lib/context/color/controller.js 947 B
./lib/context/color/provider.js 2.08 kB
./lib/context/event.js 593 B
./lib/context/headings/consumer.js 722 B
./lib/context/headings/controller.js 1.12 kB
./lib/context/headings/provider.js 1.24 kB
./lib/DirController.js 565 B
./lib/elements/rh-context-demo/rh-context-demo.js 1.28 kB
./lib/elements/rh-context-picker/rh-context-picker.js 2.21 kB
./lib/functions.js 175 B
./lib/I18nController.js 1.38 kB
./lib/ScreenSizeController.js 849 B
./react/rh-accordion/rh-accordion-header.js 199 B
./react/rh-accordion/rh-accordion-panel.js 185 B
./react/rh-accordion/rh-accordion.js 215 B
./react/rh-alert/rh-alert.js 184 B
./react/rh-audio-player/rh-audio-player-about.js 191 B
./react/rh-audio-player/rh-audio-player-rate-stepper.js 213 B
./react/rh-audio-player/rh-audio-player-scrolling-text-overflow.js 214 B
./react/rh-audio-player/rh-audio-player-subscribe.js 196 B
./react/rh-audio-player/rh-audio-player.js 183 B
./react/rh-audio-player/rh-cue.js 195 B
./react/rh-audio-player/rh-transcript.js 207 B
./react/rh-avatar/rh-avatar.js 173 B
./react/rh-back-to-top/rh-back-to-top.js 183 B
./react/rh-badge/rh-badge.js 174 B
./react/rh-blockquote/rh-blockquote.js 179 B
./react/rh-breadcrumb/rh-breadcrumb.js 179 B
./react/rh-button/rh-button.js 174 B
./react/rh-card/rh-card.js 172 B
./react/rh-code-block/rh-code-block.js 181 B
./react/rh-cta/rh-cta.js 170 B
./react/rh-dialog/rh-dialog.js 203 B
./react/rh-footer/rh-footer-block.js 184 B
./react/rh-footer/rh-footer-copyright.js 187 B
./react/rh-footer/rh-footer-links.js 185 B
./react/rh-footer/rh-footer-social-link.js 193 B
./react/rh-footer/rh-footer-universal.js 188 B
./react/rh-footer/rh-footer.js 174 B
./react/rh-health-index/rh-health-index.js 184 B
./react/rh-icon/rh-icon.js 202 B
./react/rh-menu/rh-menu.js 173 B
./react/rh-navigation-secondary/rh-navigation-secondary-dropdown.js 217 B
./react/rh-navigation-secondary/rh-navigation-secondary-menu-section.js 205 B
./react/rh-navigation-secondary/rh-navigation-secondary-menu.js 199 B
./react/rh-navigation-secondary/rh-navigation-secondary-overlay.js 201 B
./react/rh-navigation-secondary/rh-navigation-secondary.js 213 B
./react/rh-pagination/rh-pagination.js 178 B
./react/rh-site-status/rh-site-status.js 181 B
./react/rh-skip-link/rh-skip-link.js 181 B
./react/rh-spinner/rh-spinner.js 175 B
./react/rh-stat/rh-stat.js 171 B
./react/rh-subnav/rh-subnav.js 175 B
./react/rh-surface/rh-surface.js 175 B
./react/rh-switch/rh-switch.js 185 B
./react/rh-table/rh-sort-button.js 213 B
./react/rh-table/rh-table.js 174 B
./react/rh-tabs/rh-tab-panel.js 181 B
./react/rh-tabs/rh-tab.js 187 B
./react/rh-tabs/rh-tabs.js 174 B
./react/rh-tag/rh-tag.js 182 B
./react/rh-tile/rh-tile-group.js 183 B
./react/rh-tile/rh-tile.js 194 B
./react/rh-timestamp/rh-timestamp.js 176 B
./react/rh-tooltip/rh-tooltip.js 175 B
./react/rh-video-embed/rh-video-embed.js 227 B

compressed-size-action

@coreyvickery coreyvickery self-requested a review July 25, 2024 14:17
@coreyvickery coreyvickery added the for dev Ready for development label Jul 25, 2024
@coreyvickery
Copy link
Collaborator

@alypilkons I cannot find a demo to review.

@coreyvickery
Copy link
Collaborator

@alypilkons I thought we increased the size of the text to 18px on large viewports?

@alypilkons
Copy link
Collaborator Author

alypilkons commented Aug 12, 2024

@alypilkons I thought we increased the size of the text to 18px on large viewports?

@coreyvickery I did add CSS to set a default of 18px for the body text, but it's being overwritten by a CSS rule on the deploy page that sets p (paragraph) tags to 16px. Because the body slot of the component is anonymous/customizable (can be p, span, header, etc) I don't have as much control from the component side. But it would be easy to set CSS there when using the component (and I think on pages that have p font size set to 18px, that 18px font size will apply to the p in the component too)

To have more control here, we could build the p tag into the component, but that gives us less flexibility to use other elements in the banner. @zeroedin @adamjohnson let me know if you have any thoughts or if I'm getting anything wrong here.

Copy link
Collaborator

@zeroedin zeroedin left a comment

Choose a reason for hiding this comment

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

run npm run lint and fix errors

@adamjohnson
Copy link
Collaborator

@alypilkons I thought we increased the size of the text to 18px on large viewports?

RE: page styles overriding component styles.

You can do this:

#body ::slotted(p) {
  font-size: var(--rh-font-size-body-text-lg, 1.125rem) !important;
}

We generally add !important to enforce styles like this.

More about styling web components.

@adamjohnson
Copy link
Collaborator

FYI I am picking this up with the goal of getting into Charmander.

@adamjohnson adamjohnson self-assigned this Aug 14, 2024
@adamjohnson adamjohnson changed the base branch from main to staging/charmander August 14, 2024 18:19
adamjohnson added a commit that referenced this pull request Aug 16, 2024
@markcaron
Copy link
Collaborator

@adamjohnson can we hold on this and release with Clefairy (or Cubone)? Since there are no docs ready and some concerns about the API, I don't want to hold up Charmander or rush this feature out.

CC: @jvanpelt @zeroedin @bennypowers @alypilkons

@coreyvickery
Copy link
Collaborator

@markcaron Good call, docs for Announcement will be done by the end of Cubone or a lot sooner.

@markcaron
Copy link
Collaborator

@adamjohnson we'll need to rebase with staging/clefairy

Base automatically changed from staging/charmander to main August 26, 2024 19:05
bennypowers and others added 20 commits September 17, 2024 14:52
* docs: icon design update

* docs: move icons to foundations

* docs(icon): feedback footer

* docs(icon): list styles

* docs(icon): fix a whoopsie

* docs(icon): layouts

* docs: copy assets

* docs(icons): fix permalink

* docs(icon): copy

* docs: icons feedback

* docs: change title of page and update section heading case

* docs: iconography order

* docs: align buttons

---------

Co-authored-by: marionnegp <[email protected]>
* docs: simplify installation tabs

* docs: fix import map on installation page

* docs: jspm import maps

* docs: no pfe version

* docs: install tabs

* chore: patch prism-esm see if that lets build complete

see KonnorRogers/prism-esm#3

* docs: fail more gracefully when JSPM can't cope

* chore: lint nonsense

* docs: link to install info

* docs: installation tabs styles
@bennypowers bennypowers removed this from the 2024/Q4 — Cubone release milestone Sep 26, 2024
Base automatically changed from staging/clefairy to main September 30, 2024 20:08
@adamjohnson adamjohnson changed the base branch from main to staging/cubone November 12, 2024 15:04
@zeroedin zeroedin changed the base branch from staging/cubone to main November 12, 2024 15:52
adamjohnson added a commit that referenced this pull request Feb 3, 2025
@adamjohnson
Copy link
Collaborator

After our 1/16/25 sync on rh-announcement, I have pushed a new PR to Github to bypass these 100+ merge conflicts. Work on <rh-announcement> is continuing in #2153!

I will close this PR in favor of using #2153 going forward.

@adamjohnson adamjohnson closed this Feb 3, 2025
adamjohnson added a commit that referenced this pull request Feb 26, 2025
* feat(announcement): add `<rh-announcement>`

Continuation on PR #1722.

* fix(announcement): fix lint error from font stack

* fix(announcement): remove unused variable

* fix(announcement): dismissible button location

* fix(announcement): fix dismissible demo spelling

* refactor(announcement): alphabetize `#container` properties

* fix(announcement): use appropriate token values for bkg color

* feat(announcement): enable theming of the background of the `#container`

* fix(announcement): remove content, body and cta parts

* fix(announcement): rename attr `imgleft` to `image-position`

* docs(announcement): add explainer text to image position demo

* refactor(announcement): nest CSS selectors

* fix(announcement): center align image on tablet+ viewports

* feat(announcement): add lightdom CSS / improve FOUC

* fix(announcement): proper rh-button a11y label attribute

* docs(announcement): remove outdated docs files

* fix(announcement): remove unneeded demo styles for `<main>`

* fix(announcement): center image + content on mobile viewports

* feat(announcement): add `block-start` to `image-position` property

* docs(announcement): remove docs related to outdated CSS parts

* docs(announcement): add docs for the close event

* docs(announcement): add `image-position` examples to Dismissible demo

* fix(announcement): increase close / dismiss button size

* fix(announcement): spacing tweaks

* fix(announcement): reference surface var for `.dark` bkg color

* chore(announcement): normalize spacing in `calc`

* refactor(announcement): nest css

* fix(announcement): remove left padding from CTA

* fix(announcement): restore padding to `inline-start` CTA on mobile viewports

* chore(announcement): add announcement to repo status file

* docs(announcement): add content to overview page

* docs(announcement): add content to style page

* docs(announcement): add content to guidelines page

* docs(announcement): add content to accessibility page

* docs(announcement): alt first

* docs(announcement): move href to CTA host, no lightdom HTML

* docs(announcement): remove fallbacks from vars in demo SVGs

* docs(announcement): spelling fix, update attributes in announcement README

* fix(announcement): rename lightdom.css to lightdom-shim.css

* fix(announcement): remove lightdom shim dark color palette slotted content color definitions

* test(announcement): add tests for close / dismiss functionality

* fix(announcement): remove `--rh-color-surface-dark-alt`

* docs(announcement): add note about personalization to Overview

* test(announcement): nest actions in describe blocks

* refactor(announcement): spelling for dismissible 👉 dismissABLE

---------

Co-authored-by: Benny Powers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for dev Ready for development
Projects
Status: Done ☑️
Development

Successfully merging this pull request may close these issues.

[feat] <rh-announcement>element
8 participants