crdx-components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +38 -0
- package/bun.lock +491 -0
- package/crdx-components-1.0.0.tgz +0 -0
- package/crdx-components-tokenized-components-1.0.1.tgz +0 -0
- package/ng-package.json +12 -0
- package/npm +0 -0
- package/package.json +33 -0
- package/src/index.ts +45 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.css +206 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.html +15 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.ts +47 -0
- package/src/lib/components/button/button.css +371 -0
- package/src/lib/components/button/button.html +187 -0
- package/src/lib/components/button/button.ts +103 -0
- package/src/lib/components/card/card.css +285 -0
- package/src/lib/components/card/card.html +69 -0
- package/src/lib/components/card/card.ts +93 -0
- package/src/lib/components/checkbox/checkbox-showcase.component.css +42 -0
- package/src/lib/components/checkbox/checkbox-showcase.component.html +36 -0
- package/src/lib/components/checkbox/checkbox-showcase.component.ts +13 -0
- package/src/lib/components/checkbox/checkbox.css +10 -0
- package/src/lib/components/checkbox/checkbox.html +13 -0
- package/src/lib/components/checkbox/checkbox.ts +64 -0
- package/src/lib/components/circular-progress-stepper/circular-progress-stepper.css +89 -0
- package/src/lib/components/circular-progress-stepper/circular-progress-stepper.html +23 -0
- package/src/lib/components/circular-progress-stepper/circular-progress-stepper.ts +40 -0
- package/src/lib/components/dialogs/alert-modal/alert-modal.css +118 -0
- package/src/lib/components/dialogs/alert-modal/alert-modal.html +29 -0
- package/src/lib/components/dialogs/alert-modal/alert-modal.ts +28 -0
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.css +219 -0
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.html +60 -0
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.store.ts +139 -0
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.ts +63 -0
- package/src/lib/components/dialogs/container-custom/container-custom.css +11 -0
- package/src/lib/components/dialogs/container-custom/container-custom.html +3 -0
- package/src/lib/components/dialogs/container-custom/container-custom.ts +37 -0
- package/src/lib/components/dialogs/container-custom/custom-modal.state.ts +57 -0
- package/src/lib/components/dialogs/error-modal/error-modal.css +53 -0
- package/src/lib/components/dialogs/error-modal/error-modal.html +17 -0
- package/src/lib/components/dialogs/error-modal/error-modal.ts +20 -0
- package/src/lib/components/dialogs/side-modal/side-modal.css +80 -0
- package/src/lib/components/dialogs/side-modal/side-modal.html +30 -0
- package/src/lib/components/dialogs/side-modal/side-modal.state.ts +78 -0
- package/src/lib/components/dialogs/side-modal/side-modal.ts +50 -0
- package/src/lib/components/divider/divider.css +24 -0
- package/src/lib/components/divider/divider.html +7 -0
- package/src/lib/components/divider/divider.ts +13 -0
- package/src/lib/components/footer-actions/footer/footer-flow.store.ts +30 -0
- package/src/lib/components/footer-actions/footer/footer.html +14 -0
- package/src/lib/components/footer-actions/footer/footer.ts +50 -0
- package/src/lib/components/footer-actions/modal-footer-actions/modal-footer-actions.css +44 -0
- package/src/lib/components/footer-actions/modal-footer-actions/modal-footer-actions.html +7 -0
- package/src/lib/components/footer-actions/modal-footer-actions/modal-footer-actions.ts +12 -0
- package/src/lib/components/footer-actions/page-footer-actions/page-footer-actions.css +31 -0
- package/src/lib/components/footer-actions/page-footer-actions/page-footer-actions.html +7 -0
- package/src/lib/components/footer-actions/page-footer-actions/page-footer-actions.ts +12 -0
- package/src/lib/components/form-field/select-field.css +178 -0
- package/src/lib/components/form-field/select-field.html +94 -0
- package/src/lib/components/form-field/select-field.ts +324 -0
- package/src/lib/components/form-field/text-field.css +41 -0
- package/src/lib/components/form-field/text-field.html +38 -0
- package/src/lib/components/form-field/text-field.ts +102 -0
- package/src/lib/components/header/header.css +142 -0
- package/src/lib/components/header/header.html +36 -0
- package/src/lib/components/header/header.ts +101 -0
- package/src/lib/components/icon-button/icon-button.css +445 -0
- package/src/lib/components/icon-button/icon-button.html +15 -0
- package/src/lib/components/icon-button/icon-button.ts +49 -0
- package/src/lib/components/list-item/list-item.css +122 -0
- package/src/lib/components/list-item/list-item.html +79 -0
- package/src/lib/components/list-item/list-item.ts +104 -0
- package/src/lib/components/menu/menu.css +39 -0
- package/src/lib/components/menu/menu.html +57 -0
- package/src/lib/components/menu/menu.ts +159 -0
- package/src/lib/components/shared-table/shared-table-cell-template.directive.ts +25 -0
- package/src/lib/components/shared-table/shared-table.component.css +223 -0
- package/src/lib/components/shared-table/shared-table.component.html +96 -0
- package/src/lib/components/shared-table/shared-table.component.ts +172 -0
- package/src/lib/components/sidebar/sidebar.css +234 -0
- package/src/lib/components/sidebar/sidebar.html +67 -0
- package/src/lib/components/sidebar/sidebar.ts +92 -0
- package/src/lib/components/slide-toggle/slide-toggle.css +0 -0
- package/src/lib/components/slide-toggle/slide-toggle.html +3 -0
- package/src/lib/components/slide-toggle/slide-toggle.ts +18 -0
- package/src/lib/components/spinner/spinner.css +9 -0
- package/src/lib/components/spinner/spinner.html +9 -0
- package/src/lib/components/spinner/spinner.ts +17 -0
- package/src/lib/components/tooltip/tooltip.css +32 -0
- package/src/lib/components/tooltip/tooltip.html +3 -0
- package/src/lib/components/tooltip/tooltip.ts +31 -0
- package/src/lib/icons/configuration-countable.svg +8 -0
- package/src/lib/icons/edit-table.svg +3 -0
- package/src/lib/icons/edit.svg +3 -0
- package/src/lib/icons/error-circle.svg +8 -0
- package/src/lib/icons/hub.svg +3 -0
- package/src/lib/icons/icon-menu.svg +8 -0
- package/src/lib/icons/info-error.svg +8 -0
- package/src/lib/icons/keyboard_arrow_down.svg +1 -0
- package/src/lib/icons/logo.svg +0 -0
- package/src/lib/icons/logout.svg +0 -0
- package/src/lib/icons/notifications.svg +0 -0
- package/src/lib/icons/profile-user-menu.svg +0 -0
- package/src/lib/icons/profile.svg +0 -0
- package/src/lib/icons/register-icons.ts +101 -0
- package/src/lib/icons/visibility.svg +0 -0
- package/src/lib/lib-ui/lib-ui.html +1 -0
- package/src/lib/lib-ui/lib-ui.scss +0 -0
- package/src/lib/lib-ui/lib-ui.ts +9 -0
- package/src/lib/styles/generated/_app-tokens.scss +2757 -0
- package/src/lib/styles/generated/_md3-tokens.scss +179 -0
- package/src/lib/styles/generated/_tokens-avatars.scss +4 -0
- package/src/lib/styles/global-material-theme.scss +69 -0
- package/src/lib/styles/index.scss +16 -0
- package/src/lib/styles/layout.scss +29 -0
- package/src/lib/styles/overrides/_index.scss +11 -0
- package/src/lib/styles/overrides/_mat-button-overrides.scss +105 -0
- package/src/lib/styles/overrides/_mat-checkbox-overrides.scss +49 -0
- package/src/lib/styles/overrides/_mat-form-field-overrides.scss +148 -0
- package/src/lib/styles/overrides/_mat-icon-button-overrides.scss +20 -0
- package/src/lib/styles/overrides/_mat-list-overrides.scss +59 -0
- package/src/lib/styles/overrides/_mat-slide-toggle-overrides.scss +33 -0
- package/src/lib/styles/overrides/_mat-table-overrides.scss +259 -0
- package/src/lib/styles/overrides/_mat-tabs-overrides.scss +116 -0
- package/src/lib/styles/scrollbar.scss +40 -0
- package/src/lib/styles/text-classes.scss +116 -0
- package/src/lib/styles/typography.scss +14 -0
- package/tsconfig.json +30 -0
- package/tsconfig.lib.json +20 -0
package/ng-package.json
ADDED
package/npm
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "crdx-components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Credix shared UI component library",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "ng-packagr -p ng-package.json",
|
|
8
|
+
"build:watch": "ng-packagr -p ng-package.json --watch",
|
|
9
|
+
"release": "npm run build && cd dist && npm publish"
|
|
10
|
+
},
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@angular/animations": ">=21.0.0",
|
|
13
|
+
"@angular/cdk": ">=21.0.0",
|
|
14
|
+
"@angular/common": ">=21.0.0",
|
|
15
|
+
"@angular/core": ">=21.0.0",
|
|
16
|
+
"@angular/forms": ">=21.0.0",
|
|
17
|
+
"@angular/material": ">=21.0.0",
|
|
18
|
+
"@angular/platform-browser": ">=21.0.0",
|
|
19
|
+
"@angular/router": ">=21.0.0",
|
|
20
|
+
"@ngx-translate/core": ">=17.0.0",
|
|
21
|
+
"rxjs": ">=7.0.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@angular/compiler": "~21.0.0",
|
|
25
|
+
"@angular/compiler-cli": "~21.0.0",
|
|
26
|
+
"ng-packagr": "~21.0.0",
|
|
27
|
+
"tslib": "^2.3.0",
|
|
28
|
+
"typescript": "~5.9.2"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"registry": "https://registry.npmjs.org"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export * from './lib/lib-ui/lib-ui';
|
|
2
|
+
export * from './lib/icons/register-icons';
|
|
3
|
+
|
|
4
|
+
// Core data display/navigation.
|
|
5
|
+
export * from './lib/components/shared-table/shared-table.component';
|
|
6
|
+
export * from './lib/components/breadcrumb/breadcrumb.component';
|
|
7
|
+
export * from './lib/components/sidebar/sidebar';
|
|
8
|
+
export * from './lib/components/header/header';
|
|
9
|
+
|
|
10
|
+
// Inputs and selections.
|
|
11
|
+
export * from './lib/components/form-field/text-field';
|
|
12
|
+
export * from './lib/components/form-field/select-field';
|
|
13
|
+
export * from './lib/components/list-item/list-item';
|
|
14
|
+
export * from './lib/components/checkbox/checkbox';
|
|
15
|
+
export * from './lib/components/checkbox/checkbox-showcase.component';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Prefer `lib-select-field` for new implementations.
|
|
19
|
+
* Kept for compatibility during migration window.
|
|
20
|
+
*/
|
|
21
|
+
export * from './lib/components/menu/menu';
|
|
22
|
+
|
|
23
|
+
// Actions and affordances.
|
|
24
|
+
export * from './lib/components/button/button';
|
|
25
|
+
export * from './lib/components/icon-button/icon-button';
|
|
26
|
+
export * from './lib/components/slide-toggle/slide-toggle';
|
|
27
|
+
export * from './lib/components/circular-progress-stepper/circular-progress-stepper';
|
|
28
|
+
export * from './lib/components/spinner/spinner';
|
|
29
|
+
export * from './lib/components/divider/divider';
|
|
30
|
+
export * from './lib/components/tooltip/tooltip';
|
|
31
|
+
export * from './lib/components/card/card';
|
|
32
|
+
|
|
33
|
+
// Dialogs and modal containers.
|
|
34
|
+
export * from './lib/components/dialogs/confirm-modal/confirm-modal';
|
|
35
|
+
export * from './lib/components/dialogs/confirm-modal/confirm-modal.store';
|
|
36
|
+
export * from './lib/components/dialogs/side-modal/side-modal';
|
|
37
|
+
export * from './lib/components/dialogs/side-modal/side-modal.state';
|
|
38
|
+
|
|
39
|
+
// Footer layouts.
|
|
40
|
+
export * from './lib/components/footer-actions/page-footer-actions/page-footer-actions';
|
|
41
|
+
export * from './lib/components/footer-actions/modal-footer-actions/modal-footer-actions';
|
|
42
|
+
export * from './lib/components/footer-actions/footer/footer';
|
|
43
|
+
export * from './lib/components/footer-actions/footer/footer-flow.store';
|
|
44
|
+
|
|
45
|
+
export const LIB_UI_STYLES_PATH = './lib/styles/index.scss';
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
.shared-breadcrumb {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 0.5rem;
|
|
5
|
+
padding: 0;
|
|
6
|
+
color: var(
|
|
7
|
+
--breadcrumbs-label-enabled-breadcrumb-enabled-label-text-color,
|
|
8
|
+
var(--pallete-scheme-surface-on-surface-variant, #434749)
|
|
9
|
+
);
|
|
10
|
+
font-family: var(--breadcrumbs-label-enabled-breadcrumb-label-text-font, Heebo);
|
|
11
|
+
font-size: var(--breadcrumbs-label-enabled-breadcrumb-label-text-size, 14px);
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: var(--breadcrumbs-label-enabled-breadcrumb-label-text-weight, 400);
|
|
14
|
+
line-height: calc(var(--breadcrumbs-label-enabled-breadcrumb-label-text-line-height, 20) * 1px);
|
|
15
|
+
letter-spacing: var(--breadcrumbs-label-enabled-breadcrumb-label-text-tracking, 0.25px);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.shared-breadcrumb__parent {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 0.5rem;
|
|
22
|
+
border: none;
|
|
23
|
+
background: none;
|
|
24
|
+
padding: 0.625rem 0.75rem;
|
|
25
|
+
border-radius: 100px;
|
|
26
|
+
position: relative;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
font: inherit;
|
|
29
|
+
font-weight: var(
|
|
30
|
+
--breadcrumbs-label-enabled-breadcrumb-label-text-weight,
|
|
31
|
+
400
|
|
32
|
+
);
|
|
33
|
+
color: inherit;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
transition: color 150ms ease, background-color 150ms ease;
|
|
36
|
+
/* Token ya contiene RGBA con alpha baked-in: usar directo, sin color-mix adicional. */
|
|
37
|
+
--breadcrumb-ripple-color: var(
|
|
38
|
+
--breadcrumbs-label-pressed-breadcrumb-pressed-ripple-color,
|
|
39
|
+
rgba(24, 28, 30, 0.08)
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.shared-breadcrumb__parent::after {
|
|
44
|
+
content: '';
|
|
45
|
+
position: absolute;
|
|
46
|
+
right: 0;
|
|
47
|
+
bottom: 0;
|
|
48
|
+
width: 48px;
|
|
49
|
+
height: 28px;
|
|
50
|
+
background-color: var(--breadcrumb-ripple-color);
|
|
51
|
+
-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='28' viewBox='0 0 48 28' fill='none'><path d='M48 3.12389V28H0C0 12.536 14.7249 0 32.8889 0C38.3368 0 43.4753 1.12771 48 3.12389Z' fill='black'/></svg>");
|
|
52
|
+
mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='28' viewBox='0 0 48 28' fill='none'><path d='M48 3.12389V28H0C0 12.536 14.7249 0 32.8889 0C38.3368 0 43.4753 1.12771 48 3.12389Z' fill='black'/></svg>");
|
|
53
|
+
-webkit-mask-repeat: no-repeat;
|
|
54
|
+
mask-repeat: no-repeat;
|
|
55
|
+
-webkit-mask-size: contain;
|
|
56
|
+
mask-size: contain;
|
|
57
|
+
opacity: 0;
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.shared-breadcrumb__parent:hover,
|
|
62
|
+
.shared-breadcrumb__parent:focus-visible {
|
|
63
|
+
color: var(
|
|
64
|
+
--breadcrumbs-label-hovered-breadcrumb-hovered-label-text-color,
|
|
65
|
+
var(--pallete-scheme-surface-on-surface, #181c1e)
|
|
66
|
+
);
|
|
67
|
+
background-color: var(
|
|
68
|
+
--breadcrumbs-label-hovered-breadcrumb-hovered-state-layer-color,
|
|
69
|
+
rgba(24, 28, 30, 0.08)
|
|
70
|
+
);
|
|
71
|
+
outline: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.shared-breadcrumb__parent:focus-visible {
|
|
75
|
+
outline: calc(
|
|
76
|
+
var(--breadcrumbs-label-focused-breadcrumb-focused-indicator-weight, 3) * 1px
|
|
77
|
+
)
|
|
78
|
+
solid var(--breadcrumbs-label-focused-breadcrumb-focused-indicator-color, #5b5f61);
|
|
79
|
+
outline-offset: 2px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.shared-breadcrumb__parent:active {
|
|
83
|
+
color: var(
|
|
84
|
+
--breadcrumbs-label-pressed-breadcrumb-pressed-label-text-color,
|
|
85
|
+
var(--pallete-scheme-surface-on-surface, #181c1e)
|
|
86
|
+
);
|
|
87
|
+
background-color: var(
|
|
88
|
+
--breadcrumbs-label-pressed-breadcrumb-pressed-state-layer-color,
|
|
89
|
+
rgba(24, 28, 30, 0.1)
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.shared-breadcrumb__parent:active::after {
|
|
94
|
+
opacity: 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.shared-breadcrumb__separator {
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
color: var(--breadcrumbs-divider-breadcrumb-divider-color, #181c1e);
|
|
101
|
+
text-align: center;
|
|
102
|
+
font-family: var(--breadcrumbs-divider-breadcrumb-divider-text-font, Heebo);
|
|
103
|
+
font-size: var(--breadcrumbs-divider-breadcrumb-divider-text-size, 14px);
|
|
104
|
+
font-style: normal;
|
|
105
|
+
font-weight: var(--breadcrumbs-divider-breadcrumb-divider-text-weight, 400);
|
|
106
|
+
line-height: calc(var(--breadcrumbs-divider-breadcrumb-divider-text-line-height, 20) * 1px);
|
|
107
|
+
letter-spacing: var(--breadcrumbs-divider-breadcrumb-divider-text-tracking, 0.25px);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.shared-breadcrumb__current {
|
|
111
|
+
display: inline-flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
padding: 0.625rem 0.75rem;
|
|
114
|
+
gap: 0.5rem;
|
|
115
|
+
border-radius: 100px;
|
|
116
|
+
position: relative;
|
|
117
|
+
overflow: hidden;
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
font-weight: var(
|
|
120
|
+
--breadcrumbs-label-selected-breadcrumb-selected-label-text-weight,
|
|
121
|
+
700
|
|
122
|
+
);
|
|
123
|
+
color: var(
|
|
124
|
+
--breadcrumbs-label-selected-breadcrumb-selected-label-hovered-text-color,
|
|
125
|
+
var(--pallete-scheme-surface-on-surface, #181c1e)
|
|
126
|
+
);
|
|
127
|
+
letter-spacing: var(--breadcrumbs-label-selected-breadcrumb-selected-label-text-tracking, 0.1px);
|
|
128
|
+
/* Token ya contiene RGBA con alpha baked-in: usar directo, sin color-mix adicional. */
|
|
129
|
+
--breadcrumb-ripple-color: var(
|
|
130
|
+
--breadcrumbs-label-pressed-breadcrumb-pressed-ripple-color,
|
|
131
|
+
rgba(24, 28, 30, 0.08)
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.shared-breadcrumb__current::after {
|
|
136
|
+
content: '';
|
|
137
|
+
position: absolute;
|
|
138
|
+
right: 0;
|
|
139
|
+
bottom: 0;
|
|
140
|
+
width: 48px;
|
|
141
|
+
height: 28px;
|
|
142
|
+
background-color: var(--breadcrumb-ripple-color);
|
|
143
|
+
-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='28' viewBox='0 0 48 28' fill='none'><path d='M48 3.12389V28H0C0 12.536 14.7249 0 32.8889 0C38.3368 0 43.4753 1.12771 48 3.12389Z' fill='black'/></svg>");
|
|
144
|
+
mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='28' viewBox='0 0 48 28' fill='none'><path d='M48 3.12389V28H0C0 12.536 14.7249 0 32.8889 0C38.3368 0 43.4753 1.12771 48 3.12389Z' fill='black'/></svg>");
|
|
145
|
+
-webkit-mask-repeat: no-repeat;
|
|
146
|
+
mask-repeat: no-repeat;
|
|
147
|
+
-webkit-mask-size: contain;
|
|
148
|
+
mask-size: contain;
|
|
149
|
+
opacity: 0;
|
|
150
|
+
pointer-events: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.shared-breadcrumb__current:hover,
|
|
154
|
+
.shared-breadcrumb__current:focus-visible {
|
|
155
|
+
background-color: var(
|
|
156
|
+
--breadcrumbs-label-hovered-breadcrumb-hovered-state-layer-color,
|
|
157
|
+
rgba(24, 28, 30, 0.08)
|
|
158
|
+
);
|
|
159
|
+
outline: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.shared-breadcrumb__current:active {
|
|
163
|
+
color: var(
|
|
164
|
+
--breadcrumbs-label-pressed-breadcrumb-pressed-label-text-color,
|
|
165
|
+
#181c1e
|
|
166
|
+
);
|
|
167
|
+
background-color: var(
|
|
168
|
+
--breadcrumbs-label-pressed-breadcrumb-pressed-state-layer-color,
|
|
169
|
+
rgba(24, 28, 30, 0.1)
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.shared-breadcrumb__current:active::after {
|
|
174
|
+
opacity: 1;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.shared-breadcrumb__current-label {
|
|
178
|
+
position: relative;
|
|
179
|
+
z-index: 1;
|
|
180
|
+
text-align: center;
|
|
181
|
+
font-size: var(--breadcrumbs-label-enabled-breadcrumb-label-text-size, 14px);
|
|
182
|
+
font-style: normal;
|
|
183
|
+
line-height: calc(var(--breadcrumbs-label-enabled-breadcrumb-label-text-line-height, 20) * 1px);
|
|
184
|
+
letter-spacing: var(--breadcrumbs-label-enabled-breadcrumb-label-text-tracking, 0.25px);
|
|
185
|
+
font-weight: inherit;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.shared-breadcrumb__parent-label {
|
|
189
|
+
position: relative;
|
|
190
|
+
z-index: 1;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.shared-breadcrumb__current:active .shared-breadcrumb__current-label {
|
|
194
|
+
font-weight: var(
|
|
195
|
+
--breadcrumbs-label-enabled-breadcrumb-label-text-weight,
|
|
196
|
+
400
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.shared-breadcrumb__current:hover .shared-breadcrumb__current-label,
|
|
201
|
+
.shared-breadcrumb__current:focus-visible .shared-breadcrumb__current-label {
|
|
202
|
+
font-weight: var(
|
|
203
|
+
--breadcrumbs-label-enabled-breadcrumb-label-text-weight,
|
|
204
|
+
400
|
|
205
|
+
);
|
|
206
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<nav class="shared-breadcrumb" *ngIf="currentLabel() || parentLabel()">
|
|
2
|
+
@if (parentLabel()) {
|
|
3
|
+
<button
|
|
4
|
+
type="button"
|
|
5
|
+
class="shared-breadcrumb__parent"
|
|
6
|
+
(click)="navigateToParent()"
|
|
7
|
+
>
|
|
8
|
+
<span class="shared-breadcrumb__parent-label">{{ parentLabel() }}</span>
|
|
9
|
+
</button>
|
|
10
|
+
<span class="shared-breadcrumb__separator">/</span>
|
|
11
|
+
}
|
|
12
|
+
<span class="shared-breadcrumb__current">
|
|
13
|
+
<span class="shared-breadcrumb__current-label">{{ currentLabel() }}</span>
|
|
14
|
+
</span>
|
|
15
|
+
</nav>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, OnInit, Output, inject, signal } from '@angular/core';
|
|
3
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'lib-breadcrumb, shared-breadcrumb',
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
templateUrl: './breadcrumb.component.html',
|
|
9
|
+
styleUrl: './breadcrumb.component.css',
|
|
10
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
})
|
|
12
|
+
export class SharedBreadcrumbComponent implements OnInit {
|
|
13
|
+
private readonly route = inject(ActivatedRoute, { optional: true });
|
|
14
|
+
private readonly router = inject(Router, { optional: true });
|
|
15
|
+
@Output() parentNavigate = new EventEmitter<string>();
|
|
16
|
+
|
|
17
|
+
readonly parentLabel = signal<string>('');
|
|
18
|
+
readonly parentUrl = signal<string>('');
|
|
19
|
+
readonly currentLabel = signal<string>('');
|
|
20
|
+
|
|
21
|
+
ngOnInit(): void {
|
|
22
|
+
const currentRoute = this.route;
|
|
23
|
+
if (!currentRoute) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const parentRoute = currentRoute.parent;
|
|
28
|
+
const parentData = parentRoute?.snapshot.data ?? {};
|
|
29
|
+
const currentData = currentRoute.snapshot.data ?? {};
|
|
30
|
+
|
|
31
|
+
const parentLabel = parentData['breadcrumb'] ?? currentData['parentBreadcrumb'] ?? '';
|
|
32
|
+
const parentUrl = parentData['url'] ?? currentData['parentUrl'] ?? '/';
|
|
33
|
+
const currentLabel = currentData['breadcrumb'] ?? '';
|
|
34
|
+
|
|
35
|
+
this.parentLabel.set(parentLabel);
|
|
36
|
+
this.parentUrl.set(parentUrl);
|
|
37
|
+
this.currentLabel.set(currentLabel);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
navigateToParent(): void {
|
|
41
|
+
const target = this.parentUrl();
|
|
42
|
+
if (target) {
|
|
43
|
+
this.parentNavigate.emit(target);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|