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

[Button Group] Add outlined prop #6788

Merged
merged 5 commits into from
Jul 15, 2024
Merged

Conversation

ljlinsc
Copy link
Contributor

@ljlinsc ljlinsc commented May 6, 2024

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

Add outlined prop to ButtonGroup component.

Screenshot

No outline Outlined (new changes) Regular Button
image image image
image image
image image image

@changelog-app
Copy link

changelog-app bot commented May 6, 2024

Generate changelog in packages/core/changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

[Button Group] Add outlined prop


Generate changelog in packages/docs-app/changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

[Button Group] Add outlined prop


Check the box to generate changelog(s)

  • Generate changelog entry

@svc-palantir-github
Copy link

Fix lint error

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

michael-yx-wu
michael-yx-wu previously approved these changes May 6, 2024
@adidahiya
Copy link
Contributor

Nit: I think the border colors might need adjustments, the vertical borders between buttons are slightly more opaque (brighter in dark theme, darker in light theme) than the outer border of the group:

CleanShot 2024-05-07 at 08 28 08
CleanShot 2024-05-07 at 08 29 07

@policy-bot policy-bot bot dismissed michael-yx-wu’s stale review May 7, 2024 15:42

Invalidated by push of 25aeb89

@svc-palantir-github
Copy link

Fix border overlap

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

Copy link
Contributor

@evansjohnson evansjohnson left a comment

Choose a reason for hiding this comment

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

just one small comment - could you push a commit so the PR preview builds again?

packages/core/src/components/button/_button-group.scss Outdated Show resolved Hide resolved
const buttonGroupClasses = classNames(
Classes.BUTTON_GROUP,
{
[Classes.FILL]: fill,
[Classes.LARGE]: large,
[Classes.MINIMAL]: minimal,
[Classes.OUTLINED]: outlined,
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

@ljlinsc ljlinsc force-pushed the llin/button-group-outlined branch 3 times, most recently from 38c31cd to 8f61358 Compare July 3, 2024 15:07
@ljlinsc ljlinsc force-pushed the llin/button-group-outlined branch from 8f61358 to b70d7d2 Compare July 3, 2024 15:08
@svc-palantir-github
Copy link

Only apply border-bottom inside outlined wrapper

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

Copy link
Contributor

@evansjohnson evansjohnson left a comment

Choose a reason for hiding this comment

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

leaving this review just in case it's helpful in the future - @ljlinsc highlighted #4026 so I don't think we should worry about the slight px difference for now since it's also an issue in the underlying button component

}
}

&:not(.#{$ns}-minimal):not(.#{$ns}-outlined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed? I'm seeing the button group grow in size when outlined which I don't think is intentional

(added some extra buttons locally to test)

vertical (extra 1px per button, expect for last is what I'd assume):
Screenshot 2024-07-03 at 11 31 45 AM

Screenshot 2024-07-03 at 11 31 41 AM

horizontal (2px per button):
Screenshot 2024-07-03 at 11 33 55 AM

Screenshot 2024-07-03 at 11 34 00 AM


&.#{$ns}-outlined {
> .#{$ns}-button:not(:last-child) {
border-bottom: none;
Copy link
Contributor

Choose a reason for hiding this comment

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

could we do a transparent color border instead of none here? border-bottom-color: transparent - it looks like that should fix any small shifts when toggling this prop


&:not(.#{$ns}-vertical) {
> .#{$ns}-button:not(:last-child) {
border-right: none;
Copy link
Contributor

Choose a reason for hiding this comment

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

here I think none instead of transparent color actually helps, since the Button component itself currently grows 2px when outlined. this brings that down to 1px at least

Copy link
Contributor

@evansjohnson evansjohnson left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!

We may need to revisit some of this CSS if addressing #4026 but this seems fine for now. The underlying button also displays some px shift when toggling this prop, so not worrying about it here either for now.

In practice if users use outline consistently (don't toggle for the same button group) this shouldn't be a big issue.

@ljlinsc ljlinsc merged commit b38194b into develop Jul 15, 2024
13 checks passed
@ljlinsc ljlinsc deleted the llin/button-group-outlined branch July 15, 2024 18:52
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.

6 participants