-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[PM-16102] Increase clickable area for bit-item actions #12450
Changes from 2 commits
67bf5b4
67b5d95
fc4c0eb
dfc5952
7cf39ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<span [ngClass]="{ 'tw-truncate tw-block': truncate }"> | ||
<ng-content></ng-content> | ||
</span> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { NgModule } from "@angular/core"; | ||
|
||
import { BadgeDirective } from "./badge.directive"; | ||
import { BadgeComponent } from "./badge.component"; | ||
|
||
@NgModule({ | ||
imports: [BadgeDirective], | ||
exports: [BadgeDirective], | ||
imports: [BadgeComponent], | ||
exports: [BadgeComponent], | ||
}) | ||
export class BadgeModule {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { BadgeDirective, BadgeVariant } from "./badge.directive"; | ||
export { BadgeComponent, BadgeVariant } from "./badge.component"; | ||
export * from "./badge.module"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,9 @@ import { A11yCellDirective } from "../a11y/a11y-cell.directive"; | |
imports: [], | ||
template: `<ng-content></ng-content>`, | ||
providers: [{ provide: A11yCellDirective, useExisting: ItemActionComponent }], | ||
host: { | ||
class: | ||
"[&>button]:tw-relative [&>button:not([bit-item-content])]:before:tw-content-[''] [&>button]:before:tw-absolute [&>button]:before:tw-block [&>button]:before:tw-top-[-0.75rem] [&>button]:before:tw-bottom-[-0.75rem] [&>button]:before:tw-right-[-0.25rem] [&>button]:before:tw-left-[-0.25rem]", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. โน๏ธ The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. โ In And if these values are meant to be coupled, would it be helpful to represent them as a shared CSS variable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm yeah it probably should be. I think I was eyeballing whether or not it looked like the right height and never went back and updated it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For posterity, they don't match because the padding units have a different origin point than the positioning units, but they are updated to be more accurate and responsive to compact mode in this commit: fc4c0eb |
||
}, | ||
}) | ||
export class ItemActionComponent extends A11yCellDirective {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an FYI, this is a breaking change. Since an element can only have one component attached, it was possible to do
<span bitBadge my-other-component>
before this PR. After this PR, it would error.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the Angular style guide suggests kebab-case for components, and pascalCase for directives. However, we are not consistently following this, and I don't think it is worth the code diff as part of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do a quick check for any
bitBadge
instances doing that before I merge.