Skip to content

[FEATURE] UI customization part 2 component primitives - #213

Open
zhuje wants to merge 4 commits into
perses:ui-customizationfrom
zhuje:ui-customization-pt2-ou1328
Open

[FEATURE] UI customization part 2 component primitives #213
zhuje wants to merge 4 commits into
perses:ui-customizationfrom
zhuje:ui-customization-pt2-ou1328

Conversation

@zhuje

@zhuje zhuje commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Create the Button and Alert component primitives as part of this initiative: UI Customization (perses/perses#3570).

Screenshots

Figures below show screenshots from Ladle for Button and Alert
Screenshot 2026-08-04 at 4 25 39 PM
Screenshot 2026-08-04 at 4 25 51 PM
Screenshot 2026-08-04 at 4 26 10 PM

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.
  • E2E tests are stable and unlikely to be flaky.
    See e2e docs for more details. Common issues include:
    • Is the data inconsistent? You need to mock API requests.
    • Does the time change? You need to use consistent time values or mock time utilities.
    • Does it have loading states? You need to wait for loading to complete.

@zhuje
zhuje requested review from a team and AntoineThebaud as code owners August 5, 2026 02:31
@zhuje
zhuje marked this pull request as draft August 5, 2026 02:52
Comment thread components/src/next/css/index.css Outdated
Comment thread components/src/next/primitives/Button/Button.tsx
@zhuje
zhuje force-pushed the ui-customization branch from c114509 to 3ca3f2d Compare August 5, 2026 15:45
… primitives

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
@zhuje
zhuje force-pushed the ui-customization-pt2-ou1328 branch from 3de4fac to 8dcf2da Compare August 5, 2026 19:09
zhuje added 2 commits August 5, 2026 20:22
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
@zhuje
zhuje marked this pull request as ready for review August 6, 2026 00:30
@zhuje
zhuje requested a review from jgbernalp August 6, 2026 00:30
@zhuje zhuje changed the title UI customization pt2 ou1328 [FEATURE] UI Customization Part 2. Component primitives Aug 6, 2026
@zhuje zhuje changed the title [FEATURE] UI Customization Part 2. Component primitives [FEATURE] UI customization part 2 component primitives Aug 6, 2026

/* ---- Color tokens (scoped per data-color) ---- */
.ps-Button[data-color='primary'] {
--btn-bg: var(--perses-status-icon-primary);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we coupling icon colors with button colors?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated semantics.css with new tokens to clarify the naming e.g., --perses-status-solid-primary: var(--perses-color-blue-400);

const classes = ['ps-Alert', className].filter(Boolean).join(' ');

return (
<div role="alert" className={classes} data-severity={severity} {...rest}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this spread is at the end it means all the properties we set are overridable. Maybe role and data-severity which is needed for applying the tokens should not be overridable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it. Moved {...rest} to the beginning.

const classes = ['ps-Button', className].filter(Boolean).join(' ');

return (
<BaseButton className={classes} data-variant={variant} data-color={color} data-size={size} {...rest}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same here, all properties become overridable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated. Moved {...rest} to the beginning.

children,
...rest
}: ButtonProps): React.ReactElement {
const classes = ['ps-Button', className].filter(Boolean).join(' ');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we could use clsx instead of duplicating this pattern

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Installed and utilized clsx.

className,
children,
...rest
}: ButtonProps): React.ReactElement {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

checking the forwardRef I think we need to keep it for React 18 compatibility, as React 19 didn't drop it yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay, restoredforwardRef

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
@zhuje
zhuje requested a review from jgbernalp August 7, 2026 14:50
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