Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion projects/components/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,12 @@ export * from './time-range/time-range.component';
export * from './time-range/time-range.module';

// Titled Content
export { TitledContentComponent, TitlePosition } from './titled-content/titled-content.component';
export {
TitledContentComponent,
TitlePosition,
TitledContentTitleStyle,
TitledContentHeaderJustify
} from './titled-content/titled-content.component';
export { TitledContentModule } from './titled-content/titled-content.module';

// Toggle Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,24 @@
display: flex;
flex-direction: row;
align-items: center;
justify-items: center;

&.center {
justify-items: center;
}

&.space-between {
justify-content: space-between;
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.

what is the difference between justify-items and justify-content: ?

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.

  • The justify-items property controls the alignment of grid items. It is set on the grid container.
  • The justify-content property controls the alignment of grid columns. It is set on the grid container. It does not apply to or control the alignment of grid items.

I kept the old property present here with justify-items and I added the new property to the new style

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.

okay.. so justify-items: space-between would not work here?

}

.link {
margin-left: 20px;
margin-top: 14px;
&.regular {
margin-left: 20px;
margin-top: 14px;
}

&.grayed-out {
margin: 0 16px 12px 16px;
}
}

.controls {
Expand All @@ -26,11 +39,23 @@
}

.title {
@include overline($gray-9);
margin-top: 16px;
&.regular {
@include overline($gray-9);
margin-top: 16px;
}

&.grayed-out {
@include overline($gray-5);
height: 12px;
margin-bottom: 12px;
}
}
}

.header:has(.title .grayed-out) {
margin-bottom: 12px;
}

.content {
height: 100%;
width: 100%;
Expand All @@ -40,8 +65,15 @@

.footer {
.title {
@include overline($gray-4);
margin-top: 8px;
}

&.regular {
@include overline($gray-4);
}

&.grayed-out {
@include overline($gray-5);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ import { TitledHeaderControlDirective } from './header-controls/titled-header-co
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div class="titled-content-container">
<div class="header" [htLayoutChangeTrigger]="this.shouldShowHeader">
<ht-label *ngIf="this.shouldShowTitleInHeader" [label]="this.title" class="title"></ht-label>
<ht-link [paramsOrUrl]="this.link" class="link" *ngIf="this.link">
<div class="header" [ngClass]="this.headerJustifyContent" [htLayoutChangeTrigger]="this.shouldShowHeader">
<ht-label
*ngIf="this.shouldShowTitleInHeader"
[ngClass]="this.titleStyle"
[label]="this.title"
class="title"
></ht-label>
<ht-link [paramsOrUrl]="this.link" class="link" [ngClass]="this.titleStyle" *ngIf="this.link">
<ht-button
[label]="this.linkLabel"
role="${ButtonRole.Primary}"
display="${ButtonStyle.Text}"
role="${ButtonRole.Quaternary}"
Comment thread
anandtiwary marked this conversation as resolved.
display="${ButtonStyle.Solid}"
size="${ButtonSize.ExtraSmall}"
icon="${IconType.ChevronRight}"
[trailingIcon]="true"
Expand All @@ -29,8 +34,8 @@ import { TitledHeaderControlDirective } from './header-controls/titled-header-co
<div class="content">
<ng-content></ng-content>
</div>
<div class="footer">
<ht-label *ngIf="this.shouldShowTitleInFooter" [label]="this.title" class="title"></ht-label>
<div class="footer" *ngIf="this.shouldShowTitleInFooter">
<ht-label [ngClass]="this.titleStyle" [label]="this.title" class="title"></ht-label>
</div>
</div>
`
Expand All @@ -42,12 +47,18 @@ export class TitledContentComponent {
@Input()
public titlePosition: TitlePosition = TitlePosition.Header;

@Input()
public titleStyle: TitledContentTitleStyle = TitledContentTitleStyle.Regular;

@Input()
public hideTitle: boolean = false;

@Input()
public link?: string;

@Input()
public headerJustifyContent: TitledContentHeaderJustify = TitledContentHeaderJustify.Center;

@Input()
public linkLabel?: string;

Expand Down Expand Up @@ -75,3 +86,14 @@ export const enum TitlePosition {
Header = 'header',
Footer = 'footer'
}

// Regular title (black) and GrayedOut new style (gray)
export const enum TitledContentTitleStyle {
Regular = 'regular',
GrayedOut = 'grayed-out'
Comment thread
palbizu marked this conversation as resolved.
}

export const enum TitledContentHeaderJustify {
Center = 'center',
SpaceBetween = 'space-between'
}