[HXCS-1479] Breadcrumbs as secondary entry point (#8750)

* Move breadcrumb outside of the core

* Fix styling

* Fix storybook
This commit is contained in:
Popovics András
2023-07-20 16:13:09 +02:00
committed by GitHub
parent e0ab94c680
commit 1ebac21251
19 changed files with 74 additions and 28 deletions

View File

@@ -0,0 +1,3 @@
# @alfresco/adf-core/breadcrumbs
Secondary entry point of `@alfresco/adf-core`. It can be used by importing from `@alfresco/adf-core/breadcrumbs`.

View File

@@ -0,0 +1,5 @@
{
"lib": {
"entryFile": "src/index.ts"
}
}

View File

@@ -0,0 +1,18 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './src/index';

View File

@@ -22,7 +22,7 @@ import { MatIconModule } from '@angular/material/icon';
import { BreadcrumbComponent } from '../components/breadcrumb/breadcrumb.component';
import { BreadcrumbItemComponent } from '../components/breadcrumb-item/breadcrumb-item.component';
import { DemoBreadcrumbComponent } from './demo-breadcrumb.component';
import { CoreStoryModule } from '../../testing/core.story.module';
import { CoreStoryModule } from '../../../src/lib/testing/core.story.module';
// https://stackoverflow.com/a/58210459/8820824
type NonFunctionPropertyNames<T> = {[K in keyof T]: T[K] extends () => any ? never : K}[keyof T];

View File

@@ -0,0 +1,33 @@
@use 'sass:map';
@use '@angular/material' as mat;
@mixin adf-breadcrumb-theme($theme) {
$config: mat.get-color-config($theme);
$foreground-palette: map.get($config, foreground);
$primary-palette: map.get($config, primary);
$text-color: mat.get-color-from-palette($foreground-palette, text);
$primary: mat.get-color-from-palette($primary-palette, text);
adf-breadcrumb {
.adf-breadcrumb__show-all-button-icon--rotate {
color: mat.get-color-from-palette($primary-palette, 500);
}
.adf-breadcrumb__item-wrapper {
a,
a:active,
a:visited {
color: $primary;
}
&:last-child a {
text-decoration: none;
color: $text-color;
}
&:last-child a:hover {
text-decoration: none;
}
}
}
}

View File

@@ -2,6 +2,11 @@
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/libs/core",
"assets": [
{
"glob": "**/*.scss",
"input": "./breadcrumbs/src/styles",
"output": "./breadcrumbs/styles"
},
{
"glob": "custom-theme/**/*",
"input": "./",

View File

@@ -14,6 +14,9 @@
"exports": {
"./theming": {
"sass": "./lib/theming/_index.scss"
},
"./breadcrumbs": {
"sass": "./breadcrumbs/styles/_breadcrumb.theme.scss"
}
},
"dependencies": {

View File

@@ -1,22 +0,0 @@
@use 'sass:map';
@use '@angular/material' as mat;
@mixin adf-breadcrumb-theme($theme) {
$config: mat.get-color-config($theme);
$foreground-palette: map.get($config, foreground);
$primary-palette: map.get($config, primary);
$text-color: mat.get-color-from-palette($foreground-palette, text);
.adf-breadcrumb__show-all-button-icon--rotate {
color: mat.get-color-from-palette($primary-palette, 500);
}
.adf-breadcrumb .adf-breadcrumb__item-wrapper:last-child a {
text-decoration: none;
color: $text-color;
}
.adf-breadcrumb .adf-breadcrumb__item-wrapper:last-child a:hover {
text-decoration: none;
}
}

View File

@@ -8,7 +8,6 @@
@import '../styles/mixins';
@import '../form/components/widgets/form.theme';
@import '../clipboard/clipboard.theme';
@import '../breadcrumb/breadcrumb.theme';
@import './snackbar.theme';
@import './material.theme';
@import './components-variables';
@@ -112,7 +111,6 @@
}
@include mat-datetimepicker-theme($theme);
@include adf-breadcrumb-theme($theme);
@include adf-snackbar-theme;
@include adf-material-theme;
@include adf-components-variables;