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

feat(components/pages): tokenize page, page header, link lists #3030

Merged
merged 7 commits into from
Jan 16, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ describe(`pages-storybook-blocks-tile-dashboard`, () => {
});
});
});
});
}, true);
});
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ describe(`pages-storybook`, () => {
});
});
});
});
}, true);
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ describe(`pages-storybook`, () => {
});
});
});
});
}, true);
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ describe(`pages-storybook`, () => {
});
});
});
});
}, true);
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ describe(`pages-storybook`, () => {
});
});
});
});
}, true);
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ describe(`pages-storybook-tabs-tile-dashboard`, () => {
});
});
});
});
}, true);
});
9 changes: 6 additions & 3 deletions apps/e2e/pages-storybook/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"styles": [
"apps/e2e/pages-storybook/src/styles.scss",
"libs/components/theme/src/lib/styles/sky.scss",
"libs/components/theme/src/lib/styles/themes/modern/styles.scss"
"libs/components/theme/src/lib/styles/themes/modern/styles.scss",
"node_modules/@blackbaud/skyux-design-tokens/scss/blackbaud.css"
],
"scripts": []
},
Expand Down Expand Up @@ -88,7 +89,8 @@
"compodoc": false,
"styles": [
"libs/components/theme/src/lib/styles/sky.scss",
"libs/components/theme/src/lib/styles/themes/modern/styles.scss"
"libs/components/theme/src/lib/styles/themes/modern/styles.scss",
"node_modules/@blackbaud/skyux-design-tokens/scss/blackbaud.css"
]
},
"configurations": {
Expand All @@ -108,7 +110,8 @@
"compodoc": false,
"styles": [
"libs/components/theme/src/lib/styles/sky.scss",
"libs/components/theme/src/lib/styles/themes/modern/styles.scss"
"libs/components/theme/src/lib/styles/themes/modern/styles.scss",
"node_modules/@blackbaud/skyux-design-tokens/scss/blackbaud.css"
]
},
"configurations": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-host-overrides() {
--sky-override-link-item-space-below: var(--sky-margin-stacked-sm);
}

:host {
display: block;
margin: 0 0
var(--sky-override-link-item-space-below, var(--sky-space-stacked-s)) 0;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { SkyThemeComponentClassDirective } from '@skyux/theme';

/**
* A wrapper for each link in a link list.
Expand All @@ -7,14 +8,10 @@ import { Component } from '@angular/core';
standalone: true,
selector: 'sky-link-list-item',
template: `<ng-content />`,
styles: `
:host {
display: block;
margin: 0 0 var(--sky-margin-stacked-sm) 0;
}
`,
styleUrl: './link-list-item.component.scss',
host: {
'[attr.role]': '"listitem"',
},
hostDirectives: [SkyThemeComponentClassDirective],
})
export class SkyLinkListItemComponent {}
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-overrides('.sky-link-list') {
--sky-override-link-list-space-below: var(--sky-margin-stacked-xl);
}

@include compatMixins.sky-default-host-overrides() {
--sky-override-link-list-heading-space: var(--sky-margin-stacked-sm);
}

ul.sky-link-list {
list-style: none;
margin: 0 0 var(--sky-margin-stacked-xl) 0;
margin: 0 0
var(--sky-override-link-list-space-below, var(--sky-space-stacked-xl)) 0;
padding-left: 0;
}

h2,
li {
margin: 0 0 var(--sky-margin-stacked-sm) 0;
margin: 0 0
var(--sky-override-link-list-heading-space, var(--sky-space-stacked-s)) 0;
}

ul.sky-link-list > li:has(> a[hidden]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { NgTemplateOutlet } from '@angular/common';
import { Component, computed, contentChildren, input } from '@angular/core';
import { SkyWaitModule } from '@skyux/indicators';
import { SkyAppLinkModule, SkyHrefModule } from '@skyux/router';
import { SkyThemeComponentClassDirective } from '@skyux/theme';

import { SkyPageLink } from '../action-hub/types/page-link';
import { SkyPageLinksInput } from '../action-hub/types/page-links-input';
Expand All @@ -23,6 +24,7 @@ import { SkyLinkListItemComponent } from './link-list-item.component';
SkyHrefModule,
SkyWaitModule,
],
hostDirectives: [SkyThemeComponentClassDirective],
})
export class SkyLinkListComponent {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-overrides('sky-page-header-actions') {
--sky-override-page-header-actions-button-space-bottom: var(
--sky-margin-stacked-sm
);
--sky-override-page-header-actions-button-space-right: var(
--sky-margin-inline-sm
);
--sky-override-page-header-actions-space-bottom: calc(
var(--sky-margin-stacked-sm) * -1
);
--sky-override-page-header-actions-space-top: var(--sky-margin-stacked-xl);
}

sky-page-header-actions {
display: block;

&:not(:empty) {
margin-top: var(--sky-margin-stacked-xl);
margin-top: var(
--sky-override-page-header-actions-space-top,
var(--sky-space-stacked-xl)
);
// Negate the bottom margin of the last row of buttons so it doesn't create extra
// vertical space between the actions and the page content.
margin-bottom: calc(var(--sky-margin-stacked-sm) * -1);
margin-bottom: var(
--sky-override-page-header-actions-space-bottom,
calc(var(--sky-space-stacked-s) * -1)
);
}

> sky-dropdown {
Expand All @@ -16,13 +37,19 @@ sky-page-header-actions {
// inside the dropdown.
> :is(.sky-btn, sky-dropdown) {
// Vertical space between rows of buttons that have wrapped.
margin-bottom: var(--sky-margin-stacked-sm);
margin-bottom: var(
--sky-override-page-header-actions-button-space-bottom,
var(--sky-space-stacked-s)
);

&:not(:last-child) {
// Horizontal space between buttons on the same row. Use margin-right so that
// extra horizontal space is not added to the first button that wraps to the
// next line.
margin-right: var(--sky-margin-inline-sm);
margin-right: var(
--sky-override-page-header-actions-button-space-right,
var(--sky-space-gap-action_group-m)
);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-host-overrides() {
--sky-override-page-header-alert-space-below: var(--sky-margin-stacked-lg);
--sky-override-page-header-alert-space-between: var(--sky-margin-stacked-lg);
}

:host {
display: block;
display: flex;
flex-direction: column;
row-gap: var(
--sky-override-page-header-alert-space-between,
var(--sky-space-stacked-l)
);

&:not(:empty) {
margin-bottom: var(--sky-margin-stacked-lg);

::ng-deep {
sky-alert + sky-alert {
margin-top: var(--sky-margin-stacked-lg);
}
}
margin-bottom: var(
--sky-override-page-header-alert-space-below,
var(--sky-space-stacked-l)
);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { SkyThemeComponentClassDirective } from '@skyux/theme';

/**
* Displays alerts within the page header and applies spacing between alerts. Appears above the page title.
Expand All @@ -8,5 +9,6 @@ import { Component } from '@angular/core';
templateUrl: './page-header-alerts.component.html',
styleUrls: ['./page-header-alerts.component.scss'],
standalone: false,
hostDirectives: [SkyThemeComponentClassDirective],
})
export class SkyPageHeaderAlertsComponent {}
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
@use 'libs/components/theme/src/lib/styles/mixins' as mixins;
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-host-overrides() {
--sky-override-page-header-avatar-space-above: 5px;
--sky-override-page-header-avatar-space-right-sm: var(--sky-margin-inline-lg);
--sky-override-page-header-avatar-space-right-xs: var(--sky-margin-inline-sm);
}

:host {
display: block;

&:not(:empty) {
padding-top: 5px;
margin-right: var(--sky-margin-inline-sm);
padding-top: var(
--sky-override-page-header-avatar-space-above,
var(--sky-space-stacked-xs)
);
margin-right: var(
--sky-override-page-header-avatar-space-right-xs,
var(--sky-space-inline-s)
);
}
}

@include mixins.sky-host-responsive-container-sm-min() {
&:not(:empty) {
margin-right: var(--sky-margin-inline-lg);
margin-right: var(
--sky-override-page-header-avatar-space-right-sm,
var(--sky-space-inline-l)
);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, inject } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { SkyDefaultInputProvider, SkyMediaQueryService } from '@skyux/core';
import { SkyThemeComponentClassDirective } from '@skyux/theme';

/**
* Displays an avatar within the page header to the left of the page title.
Expand All @@ -13,6 +14,7 @@ import { SkyDefaultInputProvider, SkyMediaQueryService } from '@skyux/core';
styleUrls: ['./page-header-avatar.component.scss'],
providers: [SkyDefaultInputProvider],
standalone: false,
hostDirectives: [SkyThemeComponentClassDirective],
})
export class SkyPageHeaderAvatarComponent {
constructor() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-host-overrides() {
--sky-override-page-header-details-space-above: var(--sky-margin-stacked-sm);
}

:host {
display: block;

&:not(:empty) {
margin-top: var(--sky-margin-stacked-sm);
margin-top: var(
--sky-override-page-header-details-space-above,
var(--sky-space-stacked-s)
);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { SkyThemeComponentClassDirective } from '@skyux/theme';

/**
* Displays additional information in the page header, like record details.
Expand All @@ -9,5 +10,6 @@ import { Component } from '@angular/core';
templateUrl: './page-header-details.component.html',
styleUrls: ['./page-header-details.component.scss'],
standalone: false,
hostDirectives: [SkyThemeComponentClassDirective],
})
export class SkyPageHeaderDetailsComponent {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
@use 'libs/components/theme/src/lib/styles/mixins' as mixins;
@use 'libs/components/theme/src/lib/styles/variables' as *;
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins;

@include compatMixins.sky-default-overrides('.sky-page-header') {
--sky-override-page-header-chevron-color: var(--sky-text-color-default);
--sky-override-page-header-chevron-size: 16px;
--sky-override-page-header-hub-spoke-spacing: #{$sky-space-md};
--sky-override-page-header-parent-color: #{$sky-text-color-action-primary};
}

:host {
flex-grow: var(--sky-layout-host-header-flex-grow, 0);
Expand Down Expand Up @@ -28,12 +35,26 @@
}

&-parent-link {
color: $sky-text-color-action-primary;
color: var(
--sky-override-page-header-parent-color,
var(--sky-color-text-action)
);
}

&-chevron {
font-size: 16px;
margin: 0 $sky-space-md;
color: var(
--sky-override-page-header-chevron-color,
var(--sky-color-icon-default)
);
font-size: var(
--sky-override-page-header-chevron-size,
var(--sky-size-icon-s)
);
margin: 0
var(
--sky-override-page-header-hub-spoke-spacing,
var(--sky-space-gap-icon-m)
);
}

&-chevron,
Expand All @@ -48,19 +69,3 @@
}
}
}

@include mixins.sky-theme-modern() {
.sky-page-header {
&-parent-link {
color: $sky-theme-modern-text-color-action-primary;
}
}
}

@include mixins.sky-theme-modern-dark() {
.sky-page-header {
&-parent-link {
color: $sky-theme-modern-mode-dark-text-color-action-primary;
}
}
}
Loading
Loading