@exmg/exm-breadcrumbs 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/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # `<exm-breadcrumbs>` [![Published on npm](https://img.shields.io/npm/v/@exmg/exm-breadcrumbs.svg)](https://www.npmjs.com/package/@exmg/exm-breadcrumbs)
2
+
3
+ # @exmg/exm-breadcrumbs
4
+
5
+ Component to render breadcrumbs within a page or component with the option to enable / disable arrow seperator
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ npm install @exmg/exm-breadcrumbs
11
+ ```
12
+
13
+ ## Example Usage
14
+
15
+ ### Standard
16
+
17
+ ```js
18
+ @state()
19
+ private items = [
20
+ {href: '/home', content: 'Home page'},
21
+ {href: '/users', content: 'User List'},
22
+ {href: '/users/1234', content: 'Mark'},
23
+ {href: '/users/1234/details', content: 'Details'},
24
+ ];
25
+ ```
26
+
27
+ ```html
28
+ <exm-breadcrumbs .items="${this.items}"></exm-breadcrumbs>
29
+ ```
30
+
31
+ ## API
32
+
33
+ ### Slots
34
+
35
+ | Name | Description |
36
+ | --------- | ---------------------------------- |
37
+ | _default_ | Button to handle copy to clipboard |
38
+
39
+ ### Properties/Attributes
40
+
41
+ | Name | Type | Default | Description |
42
+ | ---------------- | --------- | ------- | --------------------------------------------- |
43
+ | `items` | `array` | _[]_ | The items displayed by the breadcrumbs |
44
+ | `arrowSeperator` | `boolean` | _false_ | Whether or not to display the arrow seperator |
45
+
46
+ ### Methods
47
+
48
+ _None_
49
+
50
+ ### Events
51
+
52
+ _None_
53
+
54
+ ### CSS Custom Properties
55
+
56
+ _None_
57
+
58
+ ## Additional references
59
+
60
+ - [Additional Documentation](https://exmg.github.io/exmachina-web-components/ExmgBreadcrumbs.html)
61
+
62
+ - [Demo](https://exmg.github.io/exmachina-web-components/demo/?el=exm-breadcrumbs)
package/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export { BreadcrumbItem } from './src/types.js';
2
+ export { ExmgBreadcrumbs } from './src/exm-breadcrumbs.js';
3
+ export { ExmgBreadcrumbsBase } from './src/exm-breadcrumbs-base.js';
4
+ export { BreadcrumbsControllerConfig, BreadcrumbsController } from './src/exm-breadcrumbs-controller.js';
5
+ export { BreadcrumbsMixin, BreadcrumbsClass, BreadcrumbsInterface } from './src/exm-breadcrumb-mixin.js';
6
+ export { style as breadcrumbStyles } from './src/styles/exm-breadcrumbs-styles-css.js';
package/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export { ExmgBreadcrumbs } from './src/exm-breadcrumbs.js';
2
+ export { ExmgBreadcrumbsBase } from './src/exm-breadcrumbs-base.js';
3
+ export { BreadcrumbsController } from './src/exm-breadcrumbs-controller.js';
4
+ export { BreadcrumbsMixin, BreadcrumbsClass } from './src/exm-breadcrumb-mixin.js';
5
+ export { style as breadcrumbStyles } from './src/styles/exm-breadcrumbs-styles-css.js';
6
+ //# sourceMappingURL=index.js.map
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@exmg/exm-breadcrumbs",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "main": "index.js",
6
+ "module": "index.js",
7
+ "exports": {
8
+ ".": "./index.js",
9
+ "./exm-breadcrumbs.js": "./src/exm-breadcrumbs.js"
10
+ },
11
+ "dependencies": {
12
+ "@exmg/lit-base": "^2.0.1",
13
+ "@material/typography": "^14.0.0",
14
+ "lit": "^3.0.0",
15
+ "tslib": "^2.6.2"
16
+ },
17
+ "devDependencies": {
18
+ "@exmg/lit-cli": "1.1.13"
19
+ },
20
+ "keywords": [
21
+ "web-components",
22
+ "lit",
23
+ "button"
24
+ ],
25
+ "files": [
26
+ "**/*.scss",
27
+ "**/*.js",
28
+ "**/*.d.ts"
29
+ ],
30
+ "homepage": "https://github.com/exmg/exmachina-web-components",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git@github.com:exmg/exm-web-components.git",
34
+ "directory": "packages/exm-breadcrumbs"
35
+ },
36
+ "license": "MIT",
37
+ "scripts": {
38
+ "build:styles": "exmg-lit-cli sass -f \"./**/*.scss\""
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "gitHead": "0907b55c89325d59902b98a64c352bf6e1fc81ff"
44
+ }
@@ -0,0 +1,31 @@
1
+ import { ExmgBreadcrumbs } from './exm-breadcrumbs.js';
2
+ import { ExmgElement, Constructor } from '@exmg/lit-base/index.js';
3
+ import { BreadcrumbItem } from './types.js';
4
+ /**
5
+ * @class
6
+ * @abstract
7
+ * @extends ExmgElement
8
+ * @property {ExmgBreadcrumbs|undefined} breadcrumbsElement - Reference to the breadcrumbs element.
9
+ * @property {BreadcrumbItem[]|undefined} breadcrumbs - The breadcrumbs array.
10
+ */
11
+ export declare abstract class BreadcrumbsClass extends ExmgElement {
12
+ breadcrumbsElement?: ExmgBreadcrumbs;
13
+ breadcrumbs?: BreadcrumbItem[];
14
+ }
15
+ /**
16
+ * @interface
17
+ * @extends BreadcrumbsClass
18
+ * @method emitSetBreadcrumbs - Emit a custom event to set breadcrumbs.
19
+ * @method emitResetBreadcrumbs - Emit a custom event to reset breadcrumbs.
20
+ */
21
+ export interface BreadcrumbsInterface {
22
+ emitSetBreadcrumbs(items: BreadcrumbItem[]): void;
23
+ emitResetBreadcrumbs(): void;
24
+ }
25
+ /**
26
+ * @function
27
+ * @template T
28
+ * @param {T} base - The base class.
29
+ * @returns {Constructor<BreadcrumbsInterface> & T} - The BreadcrumbsMixin class.
30
+ */
31
+ export declare const BreadcrumbsMixin: <T extends Constructor<ExmgElement & BreadcrumbsClass>>(base: T) => Constructor<BreadcrumbsInterface> & T;
@@ -0,0 +1,92 @@
1
+ import { __decorate } from "tslib";
2
+ import { observer, ExmgElement } from '@exmg/lit-base/index.js';
3
+ import { property } from 'lit/decorators.js';
4
+ /**
5
+ * @class
6
+ * @abstract
7
+ * @extends ExmgElement
8
+ * @property {ExmgBreadcrumbs|undefined} breadcrumbsElement - Reference to the breadcrumbs element.
9
+ * @property {BreadcrumbItem[]|undefined} breadcrumbs - The breadcrumbs array.
10
+ */
11
+ export class BreadcrumbsClass extends ExmgElement {
12
+ }
13
+ /**
14
+ * @function
15
+ * @template T
16
+ * @param {T} base - The base class.
17
+ * @returns {Constructor<BreadcrumbsInterface> & T} - The BreadcrumbsMixin class.
18
+ */
19
+ export const BreadcrumbsMixin = (base) => {
20
+ /**
21
+ * @class
22
+ * @extends base
23
+ * @implements BreadcrumbsInterface
24
+ * @property {function} setBreadcrumbsBind - The binded setBreadcrumbs function.
25
+ * @property {function} resetBreadcrumbsBind - The binded resetBreadcrumbs function.
26
+ * @property {BreadcrumbItem[]|undefined} breadcrumbs - The breadcrumbs array.
27
+ */
28
+ class BreadcrumbsState extends base {
29
+ /**
30
+ * Emit a custom event to set breadcrumbs from anywhere in the application.
31
+ * @param {BreadcrumbItem[]} items - The breadcrumbs array.
32
+ * @returns {void}
33
+ */
34
+ emitSetBreadcrumbs(items) {
35
+ window.dispatchEvent(new CustomEvent('breadcrumbs-set', {
36
+ bubbles: true,
37
+ composed: true,
38
+ detail: { items },
39
+ }));
40
+ }
41
+ /**
42
+ * Emit a custom event to reset breadcrumbs.
43
+ * @returns {void}
44
+ */
45
+ emitResetBreadcrumbs() {
46
+ window.dispatchEvent(new CustomEvent('breadcrumbs-reset', {
47
+ bubbles: true,
48
+ composed: true,
49
+ detail: false,
50
+ }));
51
+ }
52
+ /**
53
+ * Reset the breadcrumbs element.
54
+ * @returns {void}
55
+ */
56
+ resetBreadcrumbs() {
57
+ this.breadcrumbsElement && (this.breadcrumbsElement.items = []);
58
+ }
59
+ /**
60
+ * Set the breadcrumbs element.
61
+ * @param {CustomEvent<{ items: BreadcrumbItem[] }>} e - The custom event.
62
+ * @returns {void}
63
+ */
64
+ setBreadcrumbs(e) {
65
+ this.breadcrumbsElement && (this.breadcrumbsElement.items = e.detail.items);
66
+ }
67
+ constructor(...args) {
68
+ super(args);
69
+ this.breadcrumbs = [];
70
+ this.setBreadcrumbsBind = this.setBreadcrumbs.bind(this);
71
+ this.resetBreadcrumbsBind = this.resetBreadcrumbs.bind(this);
72
+ // @ts-ignore
73
+ window.addEventListener('breadcrumbs-set', this.setBreadcrumbsBind);
74
+ window.addEventListener('breadcrumbs-reset', this.resetBreadcrumbsBind);
75
+ }
76
+ disconnectedCallback() {
77
+ this.emitResetBreadcrumbs();
78
+ // @ts-ignore
79
+ window.removeEventListener('breadcrumbs-set', this.setBreadcrumbsBind);
80
+ window.removeEventListener('breadcrumbs-reset', this.resetBreadcrumbsBind);
81
+ super.disconnectedCallback();
82
+ }
83
+ }
84
+ __decorate([
85
+ property({ type: Array }),
86
+ observer(function (breadcrumbs) {
87
+ this.emitSetBreadcrumbs(breadcrumbs);
88
+ })
89
+ ], BreadcrumbsState.prototype, "breadcrumbs", void 0);
90
+ return BreadcrumbsState;
91
+ };
92
+ //# sourceMappingURL=exm-breadcrumb-mixin.js.map
@@ -0,0 +1,17 @@
1
+ import { BreadcrumbItem } from './types.js';
2
+ import { ExmgElement } from '@exmg/lit-base/index.js';
3
+ export declare const arrowSeparator: import("lit-html").TemplateResult<1>;
4
+ export declare class ExmgBreadcrumbsBase extends ExmgElement {
5
+ /**
6
+ * The items displayed by the breadcrumbs
7
+ * @type {Array}
8
+ */
9
+ items: BreadcrumbItem[];
10
+ /**
11
+ * Whether or not to display the arrow seperator
12
+ * @type {Boolean}
13
+ */
14
+ arrowSeperator: boolean;
15
+ protected renderItems(): unknown;
16
+ render(): import("lit-html").TemplateResult<1>;
17
+ }
@@ -0,0 +1,54 @@
1
+ import { __decorate } from "tslib";
2
+ import { html, nothing } from 'lit';
3
+ import { property } from 'lit/decorators.js';
4
+ import { repeat } from 'lit/directives/repeat.js';
5
+ import { classMap } from 'lit/directives/class-map.js';
6
+ import { ExmgElement } from '@exmg/lit-base/index.js';
7
+ export const arrowSeparator = html `
8
+ <svg height="24" viewBox="0 0 24 24" width="24" preserveAspectRatio="xMidYMid meet">
9
+ <path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"></path>
10
+ </svg>
11
+ `;
12
+ export class ExmgBreadcrumbsBase extends ExmgElement {
13
+ constructor() {
14
+ super(...arguments);
15
+ /**
16
+ * The items displayed by the breadcrumbs
17
+ * @type {Array}
18
+ */
19
+ this.items = [];
20
+ /**
21
+ * Whether or not to display the arrow seperator
22
+ * @type {Boolean}
23
+ */
24
+ this.arrowSeperator = false;
25
+ }
26
+ renderItems() {
27
+ var _a;
28
+ const lastIndex = ((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) - 1;
29
+ return repeat(this.items || [], ({ href, content }) => `${href}${content}`, ({ href, content }, index) => {
30
+ return html `
31
+ <li class="${classMap({ arrowSeperator: this.arrowSeperator })}">
32
+ <a href=${href} aria-current=${index === lastIndex ? 'page' : 'false'}>${content}</a>
33
+ ${this.arrowSeperator && index !== lastIndex ? arrowSeparator : nothing}
34
+ </li>
35
+ `;
36
+ });
37
+ }
38
+ render() {
39
+ return html `
40
+ <nav class="breadcrumb" aria-label="Breadcrumb">
41
+ <ol>
42
+ ${this.renderItems()}
43
+ </ol>
44
+ </nav>
45
+ `;
46
+ }
47
+ }
48
+ __decorate([
49
+ property({ type: Array })
50
+ ], ExmgBreadcrumbsBase.prototype, "items", void 0);
51
+ __decorate([
52
+ property({ type: Boolean, attribute: 'arrow-separator', reflect: true })
53
+ ], ExmgBreadcrumbsBase.prototype, "arrowSeperator", void 0);
54
+ //# sourceMappingURL=exm-breadcrumbs-base.js.map
@@ -0,0 +1,23 @@
1
+ import { ReactiveControllerHost } from 'lit';
2
+ import { BreadcrumbItem } from './types.js';
3
+ import { ExmgBreadcrumbs } from './exm-breadcrumbs.js';
4
+ export interface BreadcrumbsControllerConfig {
5
+ breadcrumbsElement?: ExmgBreadcrumbs;
6
+ }
7
+ export declare class BreadcrumbsController {
8
+ _host: ReactiveControllerHost;
9
+ breadcrumbsElement?: ExmgBreadcrumbs;
10
+ setBreadcrumbsBind: (e: CustomEvent<{
11
+ items: BreadcrumbItem[];
12
+ }>) => void;
13
+ resetBreadcrumbsBind: () => void;
14
+ breadcrumbs?: BreadcrumbItem[];
15
+ constructor(host: ReactiveControllerHost, { breadcrumbsElement }: BreadcrumbsControllerConfig);
16
+ emitSetBreadcrumbs(items: BreadcrumbItem[]): void;
17
+ emitResetBreadcrumbs(): void;
18
+ resetBreadcrumbs(): void;
19
+ setBreadcrumbs(e: CustomEvent<{
20
+ items: BreadcrumbItem[];
21
+ }>): void;
22
+ hostDisconnected(): void;
23
+ }
@@ -0,0 +1,46 @@
1
+ import { __decorate } from "tslib";
2
+ import { observer } from '@exmg/lit-base/index.js';
3
+ export class BreadcrumbsController {
4
+ constructor(host, { breadcrumbsElement }) {
5
+ this.breadcrumbs = [];
6
+ (this._host = host).addController(this);
7
+ this.breadcrumbsElement = breadcrumbsElement;
8
+ this.setBreadcrumbsBind = this.setBreadcrumbs.bind(this);
9
+ this.resetBreadcrumbsBind = this.resetBreadcrumbs.bind(this);
10
+ // @ts-ignore
11
+ window.addEventListener('breadcrumbs-set', this.setBreadcrumbsBind);
12
+ window.addEventListener('breadcrumbs-reset', this.resetBreadcrumbsBind);
13
+ }
14
+ emitSetBreadcrumbs(items) {
15
+ window.dispatchEvent(new CustomEvent('breadcrumbs-set', {
16
+ bubbles: true,
17
+ composed: true,
18
+ detail: { items },
19
+ }));
20
+ }
21
+ emitResetBreadcrumbs() {
22
+ window.dispatchEvent(new CustomEvent('breadcrumbs-reset', {
23
+ bubbles: true,
24
+ composed: true,
25
+ detail: false,
26
+ }));
27
+ }
28
+ resetBreadcrumbs() {
29
+ this.breadcrumbsElement && (this.breadcrumbsElement.items = []);
30
+ }
31
+ setBreadcrumbs(e) {
32
+ this.breadcrumbsElement && (this.breadcrumbsElement.items = e.detail.items);
33
+ }
34
+ hostDisconnected() {
35
+ this.emitResetBreadcrumbs();
36
+ // @ts-ignore
37
+ window.removeEventListener('breadcrumbs-set', this.setBreadcrumbsBind);
38
+ window.removeEventListener('breadcrumbs-reset', this.resetBreadcrumbsBind);
39
+ }
40
+ }
41
+ __decorate([
42
+ observer(function (breadcrumbs) {
43
+ this.emitSetBreadcrumbs(breadcrumbs);
44
+ })
45
+ ], BreadcrumbsController.prototype, "breadcrumbs", void 0);
46
+ //# sourceMappingURL=exm-breadcrumbs-controller.js.map
@@ -0,0 +1,30 @@
1
+ import { ExmgBreadcrumbsBase } from './exm-breadcrumbs-base.js';
2
+ /**
3
+ * exm-breadcrumbs
4
+ *
5
+ * Component to render breadcrumbs within a page or component with the option to enable / disable arrow seperator
6
+ *
7
+ * * Example:
8
+ * ```js
9
+ * @state()
10
+ * private items = [
11
+ * {href: '/home', content: 'Home page'},
12
+ * {href: '/users', content: 'User List'},
13
+ * {href: '/users/1234', content: 'Mark'},
14
+ * {href: '/users/1234/details', content: 'Details'},
15
+ * ];
16
+ * ```
17
+ *
18
+ * ```html
19
+ * <exm-breadcrumbs .items="${this.items}"></exm-breadcrumbs>
20
+ * ```
21
+ *
22
+ */
23
+ export declare class ExmgBreadcrumbs extends ExmgBreadcrumbsBase {
24
+ static styles: import("lit").CSSResult;
25
+ }
26
+ declare global {
27
+ interface HTMLElementTagNameMap {
28
+ 'exm-breadcrumbs': ExmgBreadcrumbs;
29
+ }
30
+ }
@@ -0,0 +1,33 @@
1
+ import { __decorate } from "tslib";
2
+ import { customElement } from 'lit/decorators.js';
3
+ import { style } from './styles/exm-breadcrumbs-styles-css.js';
4
+ import { ExmgBreadcrumbsBase } from './exm-breadcrumbs-base.js';
5
+ /**
6
+ * exm-breadcrumbs
7
+ *
8
+ * Component to render breadcrumbs within a page or component with the option to enable / disable arrow seperator
9
+ *
10
+ * * Example:
11
+ * ```js
12
+ * @state()
13
+ * private items = [
14
+ * {href: '/home', content: 'Home page'},
15
+ * {href: '/users', content: 'User List'},
16
+ * {href: '/users/1234', content: 'Mark'},
17
+ * {href: '/users/1234/details', content: 'Details'},
18
+ * ];
19
+ * ```
20
+ *
21
+ * ```html
22
+ * <exm-breadcrumbs .items="${this.items}"></exm-breadcrumbs>
23
+ * ```
24
+ *
25
+ */
26
+ let ExmgBreadcrumbs = class ExmgBreadcrumbs extends ExmgBreadcrumbsBase {
27
+ };
28
+ ExmgBreadcrumbs.styles = style;
29
+ ExmgBreadcrumbs = __decorate([
30
+ customElement('exm-breadcrumbs')
31
+ ], ExmgBreadcrumbs);
32
+ export { ExmgBreadcrumbs };
33
+ //# sourceMappingURL=exm-breadcrumbs.js.map
@@ -0,0 +1,2 @@
1
+ export declare const style: import("lit").CSSResult;
2
+ export default style;
@@ -0,0 +1,4 @@
1
+ import { css } from 'lit';
2
+ export const style = css `:host{display:block;--_breadcrumbs-seperator-color: var(--breadcrumbs-seperator-color, var(--md-sys-color-primary, #0071dc));--_breadcrumbs-text-color: var(--breadcrumbs-text-color, var(--md-sys-color-primary, #0071dc));--_breadcrumbs-decoration-color: var(--breadcrumbs-decoration-color, var(--md-sys-color-primary, #0071dc));--_breadcrumbs-visited-color: var(--breadcrumbs-visited-color, var(--md-sys-color-primary, #0071dc));--_breadcrumbs-current-color: var(--breadcrumbs-current-color, var(--md-sys-color-primary, #0071dc));--_breadcrumbs-item-separator-size: var(--breadcrumbs-item-separator-size, 24px);--_breadcrumbs-item-separator-padding: var(breadcrumbs-item-separator-padding, 0);display:block;color:var(--breadcrumbs-text-color)}svg{height:var(--_breadcrumbs-item-separator-size);width:var(--_breadcrumbs-item-separator-size);min-height:var(--_breadcrumbs-item-separator-size);min-width:var(--_breadcrumbs-item-separator-size);vertical-align:middle;display:inline-flex;justify-content:center;align-items:center;padding:0 var(--_breadcrumbs-item-separator-padding, 0);fill:var(--_breadcrumbs-seperator-color)}nav.breadcrumb li{display:inline}li{margin:.25em 0 .5em;padding:0}a[href]{color:var(--_breadcrumbs-text-color);text-decoration-color:var(--_breadcrumbs-decoration-color);text-decoration-skip-ink:none}a:visited{text-decoration-color:var(--_breadcrumbs-visited-color)}nav.breadcrumb ol{margin:0;padding-left:0;list-style:none}nav.breadcrumb li+li::before{display:inline-block;margin:0 .25em;transform:rotate(15deg);border-right:.1em solid var(--_breadcrumbs-seperator-color);height:.8em;content:""}:host([arrow-separator]) nav.breadcrumb li+li::before{display:none}nav.breadcrumb [aria-current=page]{color:var(--_breadcrumbs-current-color);font-weight:600;text-decoration:none}@media(max-width: 460px){.breadcrumb-item{display:none}.breadcrumb-item:first-child,.breadcrumb-item:last-child{display:initial}}`;
3
+ export default style;
4
+ //# sourceMappingURL=exm-breadcrumbs-styles-css.js.map
@@ -0,0 +1,79 @@
1
+ :host {
2
+ display: block;
3
+ --_breadcrumbs-seperator-color: var(--breadcrumbs-seperator-color, var(--md-sys-color-primary, #0071dc));
4
+ --_breadcrumbs-text-color: var(--breadcrumbs-text-color, var(--md-sys-color-primary, #0071dc));
5
+ --_breadcrumbs-decoration-color: var(--breadcrumbs-decoration-color, var(--md-sys-color-primary, #0071dc));
6
+ --_breadcrumbs-visited-color: var(--breadcrumbs-visited-color, var(--md-sys-color-primary, #0071dc));
7
+ --_breadcrumbs-current-color: var(--breadcrumbs-current-color, var(--md-sys-color-primary, #0071dc));
8
+ --_breadcrumbs-item-separator-size: var(--breadcrumbs-item-separator-size, 24px);
9
+ --_breadcrumbs-item-separator-padding: var(breadcrumbs-item-separator-padding, 0);
10
+ display: block;
11
+ color: var(--breadcrumbs-text-color);
12
+ }
13
+
14
+ svg {
15
+ height: var(--_breadcrumbs-item-separator-size);
16
+ width: var(--_breadcrumbs-item-separator-size);
17
+ min-height: var(--_breadcrumbs-item-separator-size);
18
+ min-width: var(--_breadcrumbs-item-separator-size);
19
+ vertical-align: middle;
20
+ display: inline-flex;
21
+ justify-content: center;
22
+ align-items: center;
23
+ padding: 0 var(--_breadcrumbs-item-separator-padding, 0);
24
+ fill: var(--_breadcrumbs-seperator-color);
25
+ }
26
+
27
+ nav.breadcrumb li {
28
+ display: inline;
29
+ }
30
+
31
+ li {
32
+ margin: 0.25em 0 0.5em;
33
+ padding: 0;
34
+ }
35
+
36
+ a[href] {
37
+ color: var(--_breadcrumbs-text-color);
38
+ text-decoration-color: var(--_breadcrumbs-decoration-color);
39
+ text-decoration-skip-ink: none;
40
+ }
41
+
42
+ a:visited {
43
+ text-decoration-color: var(--_breadcrumbs-visited-color);
44
+ }
45
+
46
+ nav.breadcrumb ol {
47
+ margin: 0;
48
+ padding-left: 0;
49
+ list-style: none;
50
+ }
51
+
52
+ nav.breadcrumb li + li::before {
53
+ display: inline-block;
54
+ margin: 0 0.25em;
55
+ transform: rotate(15deg);
56
+ border-right: 0.1em solid var(--_breadcrumbs-seperator-color);
57
+ height: 0.8em;
58
+ content: '';
59
+ }
60
+
61
+ :host([arrow-separator]) nav.breadcrumb li + li::before {
62
+ display: none;
63
+ }
64
+
65
+ nav.breadcrumb [aria-current='page'] {
66
+ color: var(--_breadcrumbs-current-color);
67
+ font-weight: 600;
68
+ text-decoration: none;
69
+ }
70
+
71
+ @media (max-width: 460px) {
72
+ .breadcrumb-item {
73
+ display: none;
74
+ }
75
+ .breadcrumb-item:first-child,
76
+ .breadcrumb-item:last-child {
77
+ display: initial;
78
+ }
79
+ }
package/src/types.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export interface BreadcrumbItem {
2
+ href: string;
3
+ content: string;
4
+ }
package/src/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map