@mintplayer/web-components 2.0.2 → 2.1.1
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/carousel/src/styles/carousel.styles.d.ts +2 -0
- package/dropdown/src/styles/dropdown.styles.d.ts +2 -0
- package/dropdown-menu/index.d.ts +1 -0
- package/dropdown-menu/index.mjs +562 -0
- package/dropdown-menu/src/components/index.d.ts +1 -0
- package/dropdown-menu/src/components/mp-dropdown-element.d.ts +19 -0
- package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +46 -0
- package/dropdown-menu/src/index.d.ts +3 -0
- package/dropdown-menu/src/styles/index.d.ts +1 -0
- package/dropdown-menu/src/types/dropdown.d.ts +9 -0
- package/dropdown-menu/src/types/index.d.ts +1 -0
- package/navbar/index.d.ts +1 -0
- package/navbar/index.mjs +1361 -0
- package/navbar/src/components/index.d.ts +4 -0
- package/navbar/src/components/mp-navbar-brand.d.ts +13 -0
- package/navbar/src/components/mp-navbar-dropdown.d.ts +35 -0
- package/navbar/src/components/mp-navbar-element.d.ts +9 -0
- package/navbar/src/components/mp-navbar-item.d.ts +16 -0
- package/navbar/src/components/mp-navbar.d.ts +52 -0
- package/navbar/src/index.d.ts +3 -0
- package/navbar/src/styles/index.d.ts +4 -0
- package/navbar/src/types/index.d.ts +1 -0
- package/navbar/src/types/navbar.d.ts +7 -0
- package/package.json +9 -1
- package/dropdown-menu/src/styles/dropdown-divider.styles.d.ts +0 -2
- package/dropdown-menu/src/styles/dropdown-header.styles.d.ts +0 -2
- package/dropdown-menu/src/styles/dropdown-item.styles.d.ts +0 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MpNavbarElement } from './mp-navbar-element';
|
|
2
|
+
/**
|
|
3
|
+
* `<mp-navbar-brand>` — the navbar brand/logo. Place it in the navbar's
|
|
4
|
+
* `slot="brand"`, and slot a link (`<a href>`) or text as its content; it is
|
|
5
|
+
* styled as a Bootstrap `.navbar-brand` via `::slotted`. Light-DOM anchor →
|
|
6
|
+
* works no-JS.
|
|
7
|
+
*
|
|
8
|
+
* <mp-navbar-brand slot="brand"><a href="/">MyApp</a></mp-navbar-brand>
|
|
9
|
+
*/
|
|
10
|
+
export declare class MpNavbarBrand extends MpNavbarElement {
|
|
11
|
+
static styles: import('lit').CSSResult[];
|
|
12
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MpNavbarElement } from './mp-navbar-element';
|
|
2
|
+
/**
|
|
3
|
+
* `<mp-navbar-dropdown>` — a navbar entry that opens a dropdown. Slot the
|
|
4
|
+
* trigger label into `slot="label"` and an `<mp-dropdown-menu>` as the default
|
|
5
|
+
* content (the panel). Nest one inside a dropdown item to make a submenu.
|
|
6
|
+
*
|
|
7
|
+
* <mp-navbar-dropdown>
|
|
8
|
+
* <span slot="label">Products</span>
|
|
9
|
+
* <mp-dropdown-menu>
|
|
10
|
+
* <mp-dropdown-item><a href="/p1">Product 1</a></mp-dropdown-item>
|
|
11
|
+
* <mp-navbar-dropdown> <!-- submenu -->
|
|
12
|
+
* <span slot="label">More</span>
|
|
13
|
+
* <mp-dropdown-menu>…</mp-dropdown-menu>
|
|
14
|
+
* </mp-navbar-dropdown>
|
|
15
|
+
* </mp-dropdown-menu>
|
|
16
|
+
* </mp-navbar-dropdown>
|
|
17
|
+
*
|
|
18
|
+
* Reveal (see navbar-dropdown.styles.scss): no-JS uses `:focus-within`; once
|
|
19
|
+
* `connectedCallback` sets `data-js`, only clicks control visibility. A
|
|
20
|
+
* first-level panel is positioned + height-capped in CSS. A **submenu** renders
|
|
21
|
+
* inline within its parent with no JS, and — with JS — opens as a fixed overlay
|
|
22
|
+
* positioned to the side by the shared `OverlayController`.
|
|
23
|
+
*/
|
|
24
|
+
export declare class MpNavbarDropdown extends MpNavbarElement {
|
|
25
|
+
#private;
|
|
26
|
+
static styles: import('lit').CSSResult[];
|
|
27
|
+
static get observedAttributes(): string[];
|
|
28
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
29
|
+
connectedCallback(): void;
|
|
30
|
+
disconnectedCallback(): void;
|
|
31
|
+
/** Close the dropdown (both the overlay and the inline paths). Public so the
|
|
32
|
+
* parent `mp-navbar` can dismiss every dropdown when a nav link is clicked. */
|
|
33
|
+
close(): void;
|
|
34
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Shared base for the small navbar sub-element WCs (item, brand): they render
|
|
4
|
+
* static chrome (a `<slot>`), so the only shared concern is the
|
|
5
|
+
* Declarative-Shadow-DOM handoff — identical to mp-shell / the dropdown WCs.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class MpNavbarElement extends LitElement {
|
|
8
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MpNavbarElement } from './mp-navbar-element';
|
|
2
|
+
/**
|
|
3
|
+
* `<mp-navbar-item>` — a navbar nav entry. Slot a real link (`<a href>`) as the
|
|
4
|
+
* default content: it stays light DOM so it navigates with no JavaScript, and is
|
|
5
|
+
* styled as a Bootstrap `.nav-link` via `::slotted` (see navbar-item.styles.scss).
|
|
6
|
+
* Routing (e.g. Angular `routerLink`) is added by the framework wrapper on the
|
|
7
|
+
* slotted anchor.
|
|
8
|
+
*
|
|
9
|
+
* Attributes (reflected; drive `::slotted` styling, so the DSD chrome stays static):
|
|
10
|
+
* - `active` — current page (`.active` appearance).
|
|
11
|
+
* - `disabled` — non-interactive.
|
|
12
|
+
*/
|
|
13
|
+
export declare class MpNavbarItem extends MpNavbarElement {
|
|
14
|
+
static styles: import('lit').CSSResult[];
|
|
15
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* `<mp-navbar>` — a responsive Bootstrap navbar whose chrome (the bar, the
|
|
4
|
+
* hamburger toggle, the collapsible region) lives in its shadow root, with the
|
|
5
|
+
* responsive collapse driven by a pure-CSS state machine (see
|
|
6
|
+
* `navbar.styles.scss`). It therefore works with JavaScript disabled when the
|
|
7
|
+
* shadow root is present (server-rendered as Declarative Shadow DOM).
|
|
8
|
+
*
|
|
9
|
+
* Authoring (vanilla): slot the brand into `slot="brand"`, the nav items as the
|
|
10
|
+
* default slot (they are per-element WCs — `mp-navbar-item` etc. — that style
|
|
11
|
+
* themselves; the navbar only owns the bar chrome). The hamburger is the
|
|
12
|
+
* `toggler` slot's fallback — an animated 3-bar → X glyph driven by the same
|
|
13
|
+
* no-JS `:checked` machine as the collapse. Slot a custom glyph via
|
|
14
|
+
* `slot="toggler"`: it must be NON-interactive (no `<button>`/`<a href>`, or
|
|
15
|
+
* native label→checkbox click forwarding dies) and can derive its open-state
|
|
16
|
+
* from the inherited `--mp-navbar-expanded: 0|1` custom property.
|
|
17
|
+
*
|
|
18
|
+
* <mp-navbar breakpoint="lg" color="body-tertiary">
|
|
19
|
+
* <a slot="brand" href="/">MyApp</a>
|
|
20
|
+
* <mp-navbar-item href="/home">Home</mp-navbar-item>
|
|
21
|
+
* …
|
|
22
|
+
* </mp-navbar>
|
|
23
|
+
*
|
|
24
|
+
* Attributes:
|
|
25
|
+
* - `breakpoint` — Bootstrap breakpoint name (`xs`…`xxl`, default `md`); at/above
|
|
26
|
+
* it the nav is inline and the hamburger hidden, below it the nav collapses.
|
|
27
|
+
* - `color` — background: a theme color (`primary`…`dark`) or an adaptive
|
|
28
|
+
* `body` / `body-secondary` / `body-tertiary`. Solid colors also set
|
|
29
|
+
* `data-bs-theme` on the host for text/link contrast.
|
|
30
|
+
* - `expanded` — programmatic collapse state (narrow mode); reflects the toggle.
|
|
31
|
+
* - `aria-label` — landmark label for the `<nav>` (default `Main navigation`).
|
|
32
|
+
* - `positioning` — `fixed` pins the bar to the top of the viewport, full width
|
|
33
|
+
* (like Bootstrap's `.fixed-top`); omit for the default in-flow bar. The
|
|
34
|
+
* consumer is responsible for offsetting page content below a fixed bar.
|
|
35
|
+
*
|
|
36
|
+
* Events: `expandedchange` (`detail: { expanded }`) when the collapse toggles.
|
|
37
|
+
*/
|
|
38
|
+
export declare class MpNavbar extends LitElement {
|
|
39
|
+
#private;
|
|
40
|
+
static styles: import('lit').CSSResult[];
|
|
41
|
+
static get observedAttributes(): string[];
|
|
42
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
43
|
+
connectedCallback(): void;
|
|
44
|
+
disconnectedCallback(): void;
|
|
45
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
46
|
+
/** Whether the collapse is (visually) expanded — the toggle's checked state. */
|
|
47
|
+
get expanded(): boolean;
|
|
48
|
+
set expanded(v: boolean);
|
|
49
|
+
/** Programmatically open/close the collapse. */
|
|
50
|
+
toggle(force?: boolean): void;
|
|
51
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { NavbarBreakpoint, NavbarExpandedChangeEventDetail } from './navbar';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Bootstrap breakpoint names the navbar expands at. */
|
|
2
|
+
export type NavbarBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
3
|
+
/** `detail` of the `expandedchange` event the navbar fires when the collapse toggles. */
|
|
4
|
+
export interface NavbarExpandedChangeEventDetail {
|
|
5
|
+
/** Whether the collapse is now (visually) expanded. */
|
|
6
|
+
expanded: boolean;
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/web-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Framework-agnostic Lit web components for the @mintplayer/bootstrap design system. Consumed by @mintplayer/ng-bootstrap, @mintplayer/react-bootstrap, and @mintplayer/vue-bootstrap.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -61,6 +61,10 @@
|
|
|
61
61
|
"types": "./dock/index.d.ts",
|
|
62
62
|
"import": "./dock/index.mjs"
|
|
63
63
|
},
|
|
64
|
+
"./dropdown-menu": {
|
|
65
|
+
"types": "./dropdown-menu/index.d.ts",
|
|
66
|
+
"import": "./dropdown-menu/index.mjs"
|
|
67
|
+
},
|
|
64
68
|
"./file-manager": {
|
|
65
69
|
"types": "./file-manager/index.d.ts",
|
|
66
70
|
"import": "./file-manager/index.mjs"
|
|
@@ -69,6 +73,10 @@
|
|
|
69
73
|
"types": "./multi-range/index.d.ts",
|
|
70
74
|
"import": "./multi-range/index.mjs"
|
|
71
75
|
},
|
|
76
|
+
"./navbar": {
|
|
77
|
+
"types": "./navbar/index.d.ts",
|
|
78
|
+
"import": "./navbar/index.mjs"
|
|
79
|
+
},
|
|
72
80
|
"./otp-input": {
|
|
73
81
|
"types": "./otp-input/index.d.ts",
|
|
74
82
|
"import": "./otp-input/index.mjs"
|