@mintplayer/web-components 1.3.0 → 1.5.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.
@@ -0,0 +1,59 @@
1
+ import { LitElement } from 'lit';
2
+ export interface ShellStateChangeEventDetail {
3
+ /** Whether the sidebar is now (visually) open after the toggle. */
4
+ open: boolean;
5
+ }
6
+ /**
7
+ * `<mp-shell>` — responsive sidebar layout shell.
8
+ *
9
+ * The shadow DOM is *static chrome* (a hidden checkbox toggle, the hamburger
10
+ * label, the sidebar-root with named slots); the consumer's sidebar and main
11
+ * content are slotted light DOM. All visibility is pure CSS (see
12
+ * `shell.styles.scss`), so it works with JavaScript disabled when the shadow
13
+ * root is present (e.g. server-rendered as Declarative Shadow DOM).
14
+ *
15
+ * Authoring (vanilla):
16
+ *
17
+ * <mp-shell breakpoint="md">
18
+ * <div slot="topbar">…brand / nav…</div>
19
+ * <nav slot="sidebar">…</nav>
20
+ * <main>…</main>
21
+ * </mp-shell>
22
+ *
23
+ * Layout: a full-width top bar (the built-in hamburger toggle on its left, plus
24
+ * the `topbar` slot) sits above a row of `sidebar` + default (content) slots.
25
+ * The sidebar slides in/out below the top bar, which stays put.
26
+ *
27
+ * Attributes:
28
+ * - `state` — `auto` (default) | `show` | `hide`.
29
+ * - `breakpoint` — Bootstrap breakpoint name (`xs`…`xxl`, default `md`); below
30
+ * it the sidebar starts collapsed, at/above it expanded.
31
+ * - `size` — expanded sidebar width (any CSS length); also settable via the
32
+ * `--mp-shell-size` custom property.
33
+ * - `external-toggle` — hides the built-in hamburger; the consumer supplies a
34
+ * `<label for>` + a `slot="toggle"` checkbox and a global bridge rule.
35
+ * - `dismiss-on-navigate` — opt-in: when a navigation link (`<a href>`) inside
36
+ * the `sidebar` slot is clicked while in narrow/overlay mode, auto-close the
37
+ * drawer (the mobile-drawer convention). No effect in wide mode; a pure
38
+ * progressive enhancement (with JS off the link just navigates). Mark a link
39
+ * (or any wrapper around it) with `data-no-dismiss` to exclude it — e.g. a
40
+ * parent nav item that only expands a sub-list or highlights the active path
41
+ * and cancels its own navigation.
42
+ *
43
+ * Events: `statechange` (`detail: { open }`) when the toggle flips.
44
+ */
45
+ export declare class MpShell extends LitElement {
46
+ #private;
47
+ static styles: import('lit').CSSResult[];
48
+ static get observedAttributes(): string[];
49
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
50
+ connectedCallback(): void;
51
+ disconnectedCallback(): void;
52
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
53
+ private get toggleInput();
54
+ /** Whether the sidebar is currently (visually) open. */
55
+ get open(): boolean;
56
+ /** Programmatically open/close the sidebar. Pass a boolean to force a state. */
57
+ toggle(force?: boolean): void;
58
+ render(): import('lit-html').TemplateResult<1>;
59
+ }
@@ -0,0 +1,4 @@
1
+ export { MpShell } from './components';
2
+ export type { ShellStateChangeEventDetail } from './components';
3
+ export type { ShellState } from './types';
4
+ export { shellStyles } from './styles';
@@ -0,0 +1 @@
1
+ export { shellStyles } from './shell.styles';
@@ -0,0 +1,2 @@
1
+ export declare const shellStyles: import('lit').CSSResult;
2
+ export default shellStyles;
@@ -0,0 +1 @@
1
+ export type { ShellState } from './shell-state';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Declarative sidebar state set by the consumer.
3
+ * - `auto` — responsive: collapsed below `breakpoint`, expanded at/above it;
4
+ * the toggle then flips it (inverse of the responsive default).
5
+ * - `show` — force expanded regardless of viewport / toggle.
6
+ * - `hide` — force collapsed regardless of viewport / toggle.
7
+ */
8
+ export type ShellState = 'auto' | 'show' | 'hide';