Skip to content

feat: style of sandbox note#351

Merged
twjeffery merged 2 commits into
alphafrom
sandbox-note
May 8, 2025
Merged

feat: style of sandbox note#351
twjeffery merged 2 commits into
alphafrom
sandbox-note

Conversation

@twjeffery
Copy link
Copy Markdown
Collaborator

@twjeffery twjeffery commented May 1, 2025

Updated styling to the "note" in the sandbox

  • Added properties and styling to sandbox note to be able to use a callout or basic text
  • Added callout note to "Warn user of a deadline" example on Modal component page

Can now use type, heading, and content properties to add a note as a callout

<Sandbox
             note={{
               type: "important",
               heading: "AlertDialog Accessibility",
               content: "Do not make the modal closeable or add any focusable elements before the action button when using an AlertDialog. This ensures that the screen reader will announce the full content."
             }}>
image

Can still use default note styling without callout

<Sandbox
             note={
               "Do not make the modal closeable or add any focusable elements before the action button when using an AlertDialog. This ensures that the screen reader will announce the full content."
             }>
image

@netlify
Copy link
Copy Markdown

netlify Bot commented May 1, 2025

Deploy Preview for abgov-ui-component-docs ready!

Name Link
🔨 Latest commit 4777287
🔍 Latest deploy log https://app.netlify.com/sites/abgov-ui-component-docs/deploys/681bca92b0cd010008fce426
😎 Deploy Preview https://deploy-preview-351--abgov-ui-component-docs.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.

@twjeffery twjeffery marked this pull request as ready for review May 1, 2025 16:06
@twjeffery twjeffery requested a review from bdfranck May 1, 2025 16:06
Copy link
Copy Markdown
Collaborator

@bdfranck bdfranck left a comment

Choose a reason for hiding this comment

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

Looks good! Just one small suggestion for using a shared type.

Comment thread src/components/sandbox/Sandbox.tsx Outdated
@bdfranck
Copy link
Copy Markdown
Collaborator

bdfranck commented May 1, 2025

Testing

✅ When I add a note as a string, I see it as text.
image

💹 When I add a note as an object with a type, heading, and content; I can see it as a callout.
image

✅ I can add a note without a heading.
image

✅ I can add a note without a type.
image

✅ I can add a note without content.
image

✅ I see an error when I add an invalid type to a note.
image

@twjeffery twjeffery requested a review from bdfranck May 7, 2025 21:06
Copy link
Copy Markdown
Collaborator

@bdfranck bdfranck left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

Comment thread src/components/sandbox/Sandbox.tsx
@twjeffery twjeffery merged commit 51976c0 into alpha May 8, 2025
7 checks passed
@twjeffery twjeffery deleted the sandbox-note branch May 8, 2025 17:42
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