@moni-labs/moni-ui 0.2.0 → 0.3.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 +52 -194
- package/custom-elements.json +1636 -350
- package/dist/actions/index.d.ts +6 -0
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +6 -0
- package/dist/components/_base/field-styles.d.ts +51 -16
- package/dist/components/_base/field-styles.d.ts.map +1 -1
- package/dist/components/_base/field-styles.js +164 -36
- package/dist/components/_base/index.d.ts +25 -0
- package/dist/components/_base/index.d.ts.map +1 -1
- package/dist/components/_base/index.js +25 -0
- package/dist/components/_base/interaction-styles.d.ts +39 -12
- package/dist/components/_base/interaction-styles.d.ts.map +1 -1
- package/dist/components/_base/interaction-styles.js +85 -33
- package/dist/components/_base/moni-element.d.ts +43 -8
- package/dist/components/_base/moni-element.d.ts.map +1 -1
- package/dist/components/_base/moni-element.js +43 -8
- package/dist/components/_base/shared-styles.d.ts +41 -17
- package/dist/components/_base/shared-styles.d.ts.map +1 -1
- package/dist/components/_base/shared-styles.js +113 -21
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +6 -0
- package/dist/components/loading-shapes.d.ts +6 -0
- package/dist/components/loading-shapes.d.ts.map +1 -1
- package/dist/components/loading-shapes.js +6 -0
- package/dist/components/moni-app-bar.d.ts +128 -33
- package/dist/components/moni-app-bar.d.ts.map +1 -1
- package/dist/components/moni-app-bar.js +121 -26
- package/dist/components/moni-badge.d.ts +122 -14
- package/dist/components/moni-badge.d.ts.map +1 -1
- package/dist/components/moni-badge.js +122 -14
- package/dist/components/moni-bottom-sheet.d.ts +120 -15
- package/dist/components/moni-bottom-sheet.d.ts.map +1 -1
- package/dist/components/moni-bottom-sheet.js +116 -12
- package/dist/components/moni-button-group.d.ts +53 -27
- package/dist/components/moni-button-group.d.ts.map +1 -1
- package/dist/components/moni-button-group.js +49 -23
- package/dist/components/moni-button-segment.d.ts +28 -8
- package/dist/components/moni-button-segment.d.ts.map +1 -1
- package/dist/components/moni-button-segment.js +27 -7
- package/dist/components/moni-button.d.ts +51 -32
- package/dist/components/moni-button.d.ts.map +1 -1
- package/dist/components/moni-button.js +50 -31
- package/dist/components/moni-card.d.ts +91 -31
- package/dist/components/moni-card.d.ts.map +1 -1
- package/dist/components/moni-card.js +86 -26
- package/dist/components/moni-carousel.d.ts +67 -17
- package/dist/components/moni-carousel.d.ts.map +1 -1
- package/dist/components/moni-carousel.js +59 -16
- package/dist/components/moni-checkbox.d.ts +122 -17
- package/dist/components/moni-checkbox.d.ts.map +1 -1
- package/dist/components/moni-checkbox.js +118 -14
- package/dist/components/moni-chip.d.ts +56 -30
- package/dist/components/moni-chip.d.ts.map +1 -1
- package/dist/components/moni-chip.js +51 -25
- package/dist/components/moni-color-field.d.ts +44 -6
- package/dist/components/moni-color-field.d.ts.map +1 -1
- package/dist/components/moni-color-field.js +43 -5
- package/dist/components/moni-context-menu.d.ts +44 -22
- package/dist/components/moni-context-menu.d.ts.map +1 -1
- package/dist/components/moni-context-menu.js +43 -21
- package/dist/components/moni-dialog.d.ts +107 -15
- package/dist/components/moni-dialog.d.ts.map +1 -1
- package/dist/components/moni-dialog.js +105 -14
- package/dist/components/moni-divider.d.ts +50 -15
- package/dist/components/moni-divider.d.ts.map +1 -1
- package/dist/components/moni-divider.js +49 -14
- package/dist/components/moni-expansion.d.ts +44 -8
- package/dist/components/moni-expansion.d.ts.map +1 -1
- package/dist/components/moni-expansion.js +43 -7
- package/dist/components/moni-fab-menu.d.ts +39 -20
- package/dist/components/moni-fab-menu.d.ts.map +1 -1
- package/dist/components/moni-fab-menu.js +38 -19
- package/dist/components/moni-fab.d.ts +49 -23
- package/dist/components/moni-fab.d.ts.map +1 -1
- package/dist/components/moni-fab.js +46 -20
- package/dist/components/moni-file-field.d.ts +54 -14
- package/dist/components/moni-file-field.d.ts.map +1 -1
- package/dist/components/moni-file-field.js +53 -13
- package/dist/components/moni-icon.d.ts +78 -11
- package/dist/components/moni-icon.d.ts.map +1 -1
- package/dist/components/moni-icon.js +77 -10
- package/dist/components/moni-list-item.d.ts +61 -30
- package/dist/components/moni-list-item.d.ts.map +1 -1
- package/dist/components/moni-list-item.js +55 -24
- package/dist/components/moni-list.d.ts +37 -13
- package/dist/components/moni-list.d.ts.map +1 -1
- package/dist/components/moni-list.js +36 -12
- package/dist/components/moni-loading-indicator.d.ts +38 -11
- package/dist/components/moni-loading-indicator.d.ts.map +1 -1
- package/dist/components/moni-loading-indicator.js +37 -10
- package/dist/components/moni-menu-item.d.ts +31 -8
- package/dist/components/moni-menu-item.d.ts.map +1 -1
- package/dist/components/moni-menu-item.js +30 -7
- package/dist/components/moni-menu.d.ts +58 -33
- package/dist/components/moni-menu.d.ts.map +1 -1
- package/dist/components/moni-menu.js +51 -26
- package/dist/components/moni-morph-modal.d.ts +7 -1
- package/dist/components/moni-morph-modal.d.ts.map +1 -1
- package/dist/components/moni-morph-modal.js +46 -24
- package/dist/components/moni-nav-item.d.ts +50 -10
- package/dist/components/moni-nav-item.d.ts.map +1 -1
- package/dist/components/moni-nav-item.js +48 -8
- package/dist/components/moni-nav.d.ts +57 -22
- package/dist/components/moni-nav.d.ts.map +1 -1
- package/dist/components/moni-nav.js +53 -18
- package/dist/components/moni-progress.d.ts +108 -20
- package/dist/components/moni-progress.d.ts.map +1 -1
- package/dist/components/moni-progress.js +104 -16
- package/dist/components/moni-radio.d.ts +106 -14
- package/dist/components/moni-radio.d.ts.map +1 -1
- package/dist/components/moni-radio.js +104 -13
- package/dist/components/moni-ripple.d.ts +121 -10
- package/dist/components/moni-ripple.d.ts.map +1 -1
- package/dist/components/moni-ripple.js +120 -9
- package/dist/components/moni-segmented-button.d.ts +31 -11
- package/dist/components/moni-segmented-button.d.ts.map +1 -1
- package/dist/components/moni-segmented-button.js +30 -10
- package/dist/components/moni-select-option.d.ts +43 -9
- package/dist/components/moni-select-option.d.ts.map +1 -1
- package/dist/components/moni-select-option.js +41 -7
- package/dist/components/moni-select.d.ts +59 -2
- package/dist/components/moni-select.d.ts.map +1 -1
- package/dist/components/moni-select.js +58 -1
- package/dist/components/moni-shape.d.ts +1 -1
- package/dist/components/moni-side-sheet.d.ts +56 -19
- package/dist/components/moni-side-sheet.d.ts.map +1 -1
- package/dist/components/moni-side-sheet.js +53 -16
- package/dist/components/moni-slider.d.ts +56 -25
- package/dist/components/moni-slider.d.ts.map +1 -1
- package/dist/components/moni-slider.js +55 -24
- package/dist/components/moni-snackbar.d.ts +86 -17
- package/dist/components/moni-snackbar.d.ts.map +1 -1
- package/dist/components/moni-snackbar.js +85 -16
- package/dist/components/moni-split-button.d.ts +38 -9
- package/dist/components/moni-split-button.d.ts.map +1 -1
- package/dist/components/moni-split-button.js +37 -8
- package/dist/components/moni-step.d.ts +42 -9
- package/dist/components/moni-step.d.ts.map +1 -1
- package/dist/components/moni-step.js +41 -8
- package/dist/components/moni-stepper.d.ts +43 -6
- package/dist/components/moni-stepper.d.ts.map +1 -1
- package/dist/components/moni-stepper.js +42 -5
- package/dist/components/moni-switch.d.ts +103 -16
- package/dist/components/moni-switch.d.ts.map +1 -1
- package/dist/components/moni-switch.js +99 -13
- package/dist/components/moni-tab.d.ts +35 -8
- package/dist/components/moni-tab.d.ts.map +1 -1
- package/dist/components/moni-tab.js +34 -7
- package/dist/components/moni-tabs.d.ts +51 -13
- package/dist/components/moni-tabs.d.ts.map +1 -1
- package/dist/components/moni-tabs.js +48 -10
- package/dist/components/moni-text-field.d.ts +55 -10
- package/dist/components/moni-text-field.d.ts.map +1 -1
- package/dist/components/moni-text-field.js +54 -9
- package/dist/components/moni-textarea.d.ts +51 -21
- package/dist/components/moni-textarea.d.ts.map +1 -1
- package/dist/components/moni-textarea.js +48 -18
- package/dist/components/moni-time-picker.d.ts +41 -11
- package/dist/components/moni-time-picker.d.ts.map +1 -1
- package/dist/components/moni-time-picker.js +40 -10
- package/dist/components/moni-toolbar.d.ts +43 -15
- package/dist/components/moni-toolbar.d.ts.map +1 -1
- package/dist/components/moni-toolbar.js +42 -14
- package/dist/components/moni-tooltip.d.ts +55 -25
- package/dist/components/moni-tooltip.d.ts.map +1 -1
- package/dist/components/moni-tooltip.js +54 -24
- package/dist/components/moni-typography.d.ts +43 -18
- package/dist/components/moni-typography.d.ts.map +1 -1
- package/dist/components/moni-typography.js +42 -17
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +59 -2
- package/dist/styles/tailwind.css +67 -0
- package/dist/styles/tokens.css +111 -99
- package/dist/utils/color.d.ts +181 -2
- package/dist/utils/color.d.ts.map +1 -1
- package/dist/utils/color.js +182 -4
- package/dist/utils/theme.svelte.d.ts +305 -2
- package/dist/utils/theme.svelte.d.ts.map +1 -1
- package/dist/utils/theme.svelte.js +331 -2
- package/dist/web-components.d.ts +28 -0
- package/dist/web-components.d.ts.map +1 -1
- package/dist/web-components.js +29 -2
- package/package.json +1 -1
- package/src/actions/index.ts +7 -0
- package/src/components/_base/field-styles.ts +165 -37
- package/src/components/_base/index.ts +27 -0
- package/src/components/_base/interaction-styles.ts +86 -33
- package/src/components/_base/moni-element.ts +44 -8
- package/src/components/_base/shared-styles.ts +114 -21
- package/src/components/index.ts +7 -0
- package/src/components/loading-shapes.ts +7 -0
- package/src/components/moni-app-bar.ts +127 -26
- package/src/components/moni-badge.ts +128 -14
- package/src/components/moni-bottom-sheet.ts +125 -13
- package/src/components/moni-button-group.ts +50 -23
- package/src/components/moni-button-segment.ts +28 -7
- package/src/components/moni-button.ts +51 -31
- package/src/components/moni-card.ts +90 -26
- package/src/components/moni-carousel.ts +67 -16
- package/src/components/moni-checkbox.ts +125 -14
- package/src/components/moni-chip.ts +52 -25
- package/src/components/moni-color-field.ts +44 -5
- package/src/components/moni-context-menu.ts +44 -21
- package/src/components/moni-dialog.ts +111 -14
- package/src/components/moni-divider.ts +50 -14
- package/src/components/moni-expansion.ts +44 -7
- package/src/components/moni-fab-menu.ts +39 -19
- package/src/components/moni-fab.ts +47 -20
- package/src/components/moni-file-field.ts +54 -13
- package/src/components/moni-icon.ts +80 -10
- package/src/components/moni-list-item.ts +56 -24
- package/src/components/moni-list.ts +37 -12
- package/src/components/moni-loading-indicator.ts +38 -10
- package/src/components/moni-menu-item.ts +31 -7
- package/src/components/moni-menu.ts +52 -26
- package/src/components/moni-morph-modal.ts +58 -24
- package/src/components/moni-nav-item.ts +49 -8
- package/src/components/moni-nav.ts +54 -18
- package/src/components/moni-progress.ts +109 -16
- package/src/components/moni-radio.ts +111 -13
- package/src/components/moni-ripple.ts +126 -9
- package/src/components/moni-segmented-button.ts +31 -10
- package/src/components/moni-select-option.ts +42 -7
- package/src/components/moni-select.ts +79 -1
- package/src/components/moni-side-sheet.ts +54 -16
- package/src/components/moni-slider.ts +56 -24
- package/src/components/moni-snackbar.ts +90 -16
- package/src/components/moni-split-button.ts +38 -8
- package/src/components/moni-step.ts +42 -8
- package/src/components/moni-stepper.ts +43 -5
- package/src/components/moni-switch.ts +106 -13
- package/src/components/moni-tab.ts +35 -7
- package/src/components/moni-tabs.ts +49 -10
- package/src/components/moni-text-field.ts +55 -9
- package/src/components/moni-textarea.ts +49 -18
- package/src/components/moni-time-picker.ts +41 -10
- package/src/components/moni-toolbar.ts +43 -14
- package/src/components/moni-tooltip.ts +55 -24
- package/src/components/moni-typography.ts +43 -17
- package/src/index.ts +67 -3
- package/src/styles/tailwind.css +67 -0
- package/src/styles/tokens.css +111 -99
- package/src/types/svelte-runes.d.ts +64 -2
- package/src/utils/color.ts +286 -5
- package/src/utils/theme.svelte.ts +411 -2
- package/src/web-components.ts +31 -2
- package/dist/assets/shapes/arch.svg +0 -1
- package/dist/assets/shapes/arrow.svg +0 -1
- package/dist/assets/shapes/boom.svg +0 -1
- package/dist/assets/shapes/burst.svg +0 -1
- package/dist/assets/shapes/circle.svg +0 -1
- package/dist/assets/shapes/clamshell.svg +0 -1
- package/dist/assets/shapes/diamond.svg +0 -1
- package/dist/assets/shapes/fan.svg +0 -1
- package/dist/assets/shapes/flower.svg +0 -1
- package/dist/assets/shapes/gem.svg +0 -1
- package/dist/assets/shapes/ghost-ish.svg +0 -1
- package/dist/assets/shapes/heart.svg +0 -1
- package/dist/assets/shapes/leaf-clover4.svg +0 -1
- package/dist/assets/shapes/leaf-clover8.svg +0 -1
- package/dist/assets/shapes/loading-indicator.svg +0 -1
- package/dist/assets/shapes/oval.svg +0 -1
- package/dist/assets/shapes/pentagon.svg +0 -1
- package/dist/assets/shapes/pill.svg +0 -1
- package/dist/assets/shapes/pixel-circle.svg +0 -1
- package/dist/assets/shapes/pixel-triangle.svg +0 -1
- package/dist/assets/shapes/puffy-diamond.svg +0 -1
- package/dist/assets/shapes/puffy.svg +0 -1
- package/dist/assets/shapes/semicircle.svg +0 -1
- package/dist/assets/shapes/sided-cookie12.svg +0 -1
- package/dist/assets/shapes/sided-cookie4.svg +0 -1
- package/dist/assets/shapes/sided-cookie6.svg +0 -1
- package/dist/assets/shapes/sided-cookie7.svg +0 -1
- package/dist/assets/shapes/sided-cookie9.svg +0 -1
- package/dist/assets/shapes/slanted.svg +0 -1
- package/dist/assets/shapes/soft-boom.svg +0 -1
- package/dist/assets/shapes/soft-burst.svg +0 -1
- package/dist/assets/shapes/square.svg +0 -1
- package/dist/assets/shapes/sunny.svg +0 -1
- package/dist/assets/shapes/triangle.svg +0 -1
- package/dist/assets/shapes/very-sunny.svg +0 -1
- package/dist/assets/shapes/wavy-circle.svg +0 -1
- package/dist/assets/shapes/wavy.svg +0 -1
- package/src/assets/shapes/arch.svg +0 -1
- package/src/assets/shapes/arrow.svg +0 -1
- package/src/assets/shapes/boom.svg +0 -1
- package/src/assets/shapes/burst.svg +0 -1
- package/src/assets/shapes/circle.svg +0 -1
- package/src/assets/shapes/clamshell.svg +0 -1
- package/src/assets/shapes/diamond.svg +0 -1
- package/src/assets/shapes/fan.svg +0 -1
- package/src/assets/shapes/flower.svg +0 -1
- package/src/assets/shapes/gem.svg +0 -1
- package/src/assets/shapes/ghost-ish.svg +0 -1
- package/src/assets/shapes/heart.svg +0 -1
- package/src/assets/shapes/leaf-clover4.svg +0 -1
- package/src/assets/shapes/leaf-clover8.svg +0 -1
- package/src/assets/shapes/loading-indicator.svg +0 -1
- package/src/assets/shapes/oval.svg +0 -1
- package/src/assets/shapes/pentagon.svg +0 -1
- package/src/assets/shapes/pill.svg +0 -1
- package/src/assets/shapes/pixel-circle.svg +0 -1
- package/src/assets/shapes/pixel-triangle.svg +0 -1
- package/src/assets/shapes/puffy-diamond.svg +0 -1
- package/src/assets/shapes/puffy.svg +0 -1
- package/src/assets/shapes/semicircle.svg +0 -1
- package/src/assets/shapes/sided-cookie12.svg +0 -1
- package/src/assets/shapes/sided-cookie4.svg +0 -1
- package/src/assets/shapes/sided-cookie6.svg +0 -1
- package/src/assets/shapes/sided-cookie7.svg +0 -1
- package/src/assets/shapes/sided-cookie9.svg +0 -1
- package/src/assets/shapes/slanted.svg +0 -1
- package/src/assets/shapes/soft-boom.svg +0 -1
- package/src/assets/shapes/soft-burst.svg +0 -1
- package/src/assets/shapes/square.svg +0 -1
- package/src/assets/shapes/sunny.svg +0 -1
- package/src/assets/shapes/triangle.svg +0 -1
- package/src/assets/shapes/very-sunny.svg +0 -1
- package/src/assets/shapes/wavy-circle.svg +0 -1
- package/src/assets/shapes/wavy.svg +0 -1
|
@@ -1,24 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/_base/shared-styles.ts
|
|
3
|
+
* @package @moni-labs/moni-ui
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @contributors Moni Labs & Contributors
|
|
6
|
+
*/
|
|
1
7
|
import { css } from 'lit';
|
|
2
8
|
/**
|
|
3
|
-
*
|
|
9
|
+
* Baseline CSS injected into the shadow root of **every** Moni Web Component.
|
|
10
|
+
*
|
|
11
|
+
* This stylesheet is the foundational layer of the Moni design system. It serves
|
|
12
|
+
* four distinct responsibilities:
|
|
13
|
+
*
|
|
14
|
+
* **1. Box-sizing reset**
|
|
15
|
+
* Applies `box-sizing: border-box` to `:host`, all descendants, and slotted
|
|
16
|
+
* elements so every component has predictable sizing without override surprises.
|
|
17
|
+
*
|
|
18
|
+
* **2. CSS custom property bridge (Token namespace)**
|
|
19
|
+
* The component library uses short "bare" variable names internally (e.g.
|
|
20
|
+
* `var(--primary)`) for concise CSS. Because shadow DOM isolates custom
|
|
21
|
+
* properties by default, this sheet creates a bridge that resolves these
|
|
22
|
+
* internal names from the global token namespaces in the following priority:
|
|
4
23
|
*
|
|
5
|
-
*
|
|
6
|
-
* 1. Box-sizing reset on the host and its descendants.
|
|
7
|
-
* 2. CSS custom property bridge: exposes the **BeerCSS token namespace**
|
|
8
|
-
* (`--primary`, `--on-primary`, `--surface`, `--elevate1`, …) inside the
|
|
9
|
-
* shadow root, falling back to sensible Material 3 defaults if the host
|
|
10
|
-
* document has not provided the alias yet.
|
|
11
|
-
* 3. The `--md-sys-color-*` and `--color-*` aliases kept for backward
|
|
12
|
-
* compatibility with the MD3 theme engine that the rest of the Moni apps
|
|
13
|
-
* (MoniAuth-Client, MoniAuth-Yo, Moni-Labs) still rely on.
|
|
14
|
-
* 4. Helper utility classes (`.truncate`, `.visually-hidden`).
|
|
24
|
+
* `--moni-*` (Moni namespace) → `--md-sys-color-*` (MD3 spec) → hardcoded M3 default
|
|
15
25
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
26
|
+
* This lets a host document use any of the three namespaces to theme components.
|
|
27
|
+
*
|
|
28
|
+
* **3. MD3 `--color-*` aliases**
|
|
29
|
+
* A second `:host` block maps the older `--color-<role>` prefix to the primary
|
|
30
|
+
* bare tokens. These aliases ensure backward compatibility with Moni apps
|
|
31
|
+
* (MoniAuth-Client, MoniAuth-Yo) that still reference `--color-primary`, etc.
|
|
32
|
+
*
|
|
33
|
+
* **4. Utility classes**
|
|
34
|
+
* Provides `.truncate` (single-line text clipping) and `.visually-hidden`
|
|
35
|
+
* (screen-reader-only content) for use inside component shadow trees.
|
|
36
|
+
*
|
|
37
|
+
* **Usage:**
|
|
38
|
+
* ```ts
|
|
39
|
+
* static override styles = [sharedStyles, css`/* component-specific styles *\/`];
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @see {@link fieldStyles} — Additional styles for input field components.
|
|
43
|
+
* @see {@link interactionStyles} — M3 state layer system for interactive elements.
|
|
20
44
|
*/
|
|
21
45
|
export const sharedStyles = css `
|
|
46
|
+
/* ─── 1. Box-sizing reset ─────────────────────────────────────────────── */
|
|
22
47
|
:host {
|
|
23
48
|
box-sizing: border-box;
|
|
24
49
|
font-family: var(--font);
|
|
@@ -38,15 +63,67 @@ export const sharedStyles = css `
|
|
|
38
63
|
font-style: normal;
|
|
39
64
|
}
|
|
40
65
|
|
|
41
|
-
/* ───
|
|
66
|
+
/* ─── 2. CSS custom property bridge ──────────────────────────────────── */
|
|
67
|
+
/* Each token resolves in order: Moni namespace → MD3 spec → M3 default. */
|
|
42
68
|
:host {
|
|
43
|
-
/* ───
|
|
69
|
+
/* ─── Primary palette ─── */
|
|
70
|
+
--primary: var(--moni-primary, var(--md-sys-color-primary, #6750A4));
|
|
71
|
+
--on-primary: var(--moni-on-primary, var(--md-sys-color-on-primary, #ffffff));
|
|
72
|
+
--primary-container: var(--moni-primary-container, var(--md-sys-color-primary-container, #eaddff));
|
|
73
|
+
--on-primary-container: var(--moni-on-primary-container, var(--md-sys-color-on-primary-container, #21005d));
|
|
74
|
+
|
|
75
|
+
/* ─── Secondary palette ─── */
|
|
76
|
+
--secondary: var(--moni-secondary, var(--md-sys-color-secondary, #625b71));
|
|
77
|
+
--on-secondary: var(--moni-on-secondary, var(--md-sys-color-on-secondary, #ffffff));
|
|
78
|
+
--secondary-container: var(--moni-secondary-container, var(--md-sys-color-secondary-container, #e8def8));
|
|
79
|
+
--on-secondary-container: var(--moni-on-secondary-container, var(--md-sys-color-on-secondary-container, #1d192b));
|
|
80
|
+
|
|
81
|
+
/* ─── Tertiary palette ─── */
|
|
82
|
+
--tertiary: var(--moni-tertiary, var(--md-sys-color-tertiary, #7d5260));
|
|
83
|
+
--on-tertiary: var(--moni-on-tertiary, var(--md-sys-color-on-tertiary, #ffffff));
|
|
84
|
+
--tertiary-container: var(--moni-tertiary-container, var(--md-sys-color-tertiary-container, #ffd8e4));
|
|
85
|
+
--on-tertiary-container: var(--moni-on-tertiary-container, var(--md-sys-color-on-tertiary-container, #31111d));
|
|
86
|
+
|
|
87
|
+
/* ─── Error palette ─── */
|
|
88
|
+
--error: var(--moni-error, var(--md-sys-color-error, #b3261e));
|
|
89
|
+
--on-error: var(--moni-on-error, var(--md-sys-color-on-error, #ffffff));
|
|
90
|
+
--error-container: var(--moni-error-container, var(--md-sys-color-error-container, #f9dedc));
|
|
91
|
+
--on-error-container: var(--moni-on-error-container, var(--md-sys-color-on-error-container, #410e0b));
|
|
92
|
+
|
|
93
|
+
/* ─── Background & surface ─── */
|
|
94
|
+
--background: var(--moni-background, var(--md-sys-color-background, #fef7ff));
|
|
95
|
+
--on-background: var(--moni-on-background, var(--md-sys-color-on-background, #1d1b20));
|
|
96
|
+
--surface: var(--moni-surface, var(--md-sys-color-surface, #fef7ff));
|
|
97
|
+
--on-surface: var(--moni-on-surface, var(--md-sys-color-on-surface, #1d1b20));
|
|
98
|
+
--surface-variant: var(--moni-surface-variant, var(--md-sys-color-surface-variant, #e7e0ec));
|
|
99
|
+
--on-surface-variant: var(--moni-on-surface-variant, var(--md-sys-color-on-surface-variant, #49454f));
|
|
100
|
+
|
|
101
|
+
/* ─── Outline ─── */
|
|
102
|
+
--outline: var(--moni-outline, var(--md-sys-color-outline, #79747e));
|
|
103
|
+
--outline-variant: var(--moni-outline-variant, var(--md-sys-color-outline-variant, #cac4d0));
|
|
104
|
+
|
|
105
|
+
/* ─── Surface container hierarchy (5-level elevation tones) ─── */
|
|
106
|
+
--surface-container-lowest: var(--moni-surface-container-lowest, var(--md-sys-color-surface-container-lowest, #ffffff));
|
|
107
|
+
--surface-container-low: var(--moni-surface-container-low, var(--md-sys-color-surface-container-low, #f7f2fa));
|
|
108
|
+
--surface-container: var(--moni-surface-container, var(--md-sys-color-surface-container, #f3edf7));
|
|
109
|
+
--surface-container-high: var(--moni-surface-container-high, var(--md-sys-color-surface-container-high, #ece6f0));
|
|
110
|
+
--surface-container-highest: var(--moni-surface-container-highest, var(--md-sys-color-surface-container-highest, #e6e1e5));
|
|
111
|
+
|
|
112
|
+
/* ─── Inverse surfaces (snackbar, tooltip) ─── */
|
|
113
|
+
--inverse-surface: var(--moni-inverse-surface, var(--md-sys-color-inverse-surface, #313033));
|
|
114
|
+
--inverse-on-surface: var(--moni-inverse-on-surface, var(--md-sys-color-inverse-on-surface, #f4f0f4));
|
|
115
|
+
--inverse-primary: var(--moni-inverse-primary, var(--md-sys-color-inverse-primary, #d0bcff));
|
|
116
|
+
|
|
117
|
+
/* ─── Structural / non-color tokens ─── */
|
|
118
|
+
/* Scrim overlay used in modals, bottom sheets, dialogs. */
|
|
44
119
|
--shadow: 0 0 0 0 transparent;
|
|
45
120
|
--scrim: rgb(0 0 0 / 0.5);
|
|
121
|
+
/* State layer color for hover/pressed overlays. */
|
|
46
122
|
--active: color-mix(in srgb, currentColor 10%, transparent);
|
|
47
123
|
--overlay: rgb(0 0 0 / 0.5);
|
|
48
124
|
--image: linear-gradient(currentColor 0 0);
|
|
49
125
|
|
|
126
|
+
/* ─── Typography tokens ─── */
|
|
50
127
|
--font: var(--moni-font-sans, 'Geist', system-ui, -apple-system, sans-serif);
|
|
51
128
|
--font-title: var(
|
|
52
129
|
--moni-font-title,
|
|
@@ -55,19 +132,25 @@ export const sharedStyles = css `
|
|
|
55
132
|
serif
|
|
56
133
|
);
|
|
57
134
|
--font-mono: 'Geist Mono', 'Fira Code', monospace;
|
|
135
|
+
/* Icon font: override via --font-icon-override to use a different icon set. */
|
|
58
136
|
--font-icon: var(--font-icon-override, 'Material Symbols Rounded');
|
|
59
137
|
|
|
138
|
+
/* ─── Elevation shadows (MD3 tonal levels 1–3) ─── */
|
|
60
139
|
--elevate1: 0 0.125rem 0.125rem 0 rgb(0 0 0 / 0.32);
|
|
61
140
|
--elevate2: 0 0.25rem 0.5rem 0 rgb(0 0 0 / 0.4);
|
|
62
141
|
--elevate3: 0 0.375rem 0.75rem 0 rgb(0 0 0 / 0.48);
|
|
63
142
|
|
|
143
|
+
/* ─── Transition speed scale ─── */
|
|
144
|
+
/* speed1 = fastest micro-interactions; speed4 = slowest page transitions. */
|
|
64
145
|
--speed1: 100ms;
|
|
65
146
|
--speed2: 200ms;
|
|
66
147
|
--speed3: 300ms;
|
|
67
148
|
--speed4: 400ms;
|
|
68
149
|
}
|
|
69
150
|
|
|
70
|
-
/* ─── MD3
|
|
151
|
+
/* ─── 3. MD3 --color-* backward-compatibility aliases ─────────────── */
|
|
152
|
+
/* These map the older --color-<role> naming convention used in legacy */
|
|
153
|
+
/* Moni apps to the primary bare tokens above. Do not remove. */
|
|
71
154
|
:host {
|
|
72
155
|
--color-primary: var(--primary);
|
|
73
156
|
--color-on-primary: var(--on-primary);
|
|
@@ -109,8 +192,7 @@ export const sharedStyles = css `
|
|
|
109
192
|
--color-inverse-on-surface: var(--inverse-on-surface);
|
|
110
193
|
--color-inverse-primary: var(--inverse-primary);
|
|
111
194
|
|
|
112
|
-
/*
|
|
113
|
-
apps that import them continue to work. */
|
|
195
|
+
/* Named aliases for tokens defined in the legacy tokens.css stylesheet. */
|
|
114
196
|
--font-sans: var(--font);
|
|
115
197
|
--shadow-1: var(--elevate1);
|
|
116
198
|
--shadow-2: var(--elevate2);
|
|
@@ -124,13 +206,23 @@ export const sharedStyles = css `
|
|
|
124
206
|
--duration-normal: 250ms;
|
|
125
207
|
}
|
|
126
208
|
|
|
127
|
-
/* ─── Utility classes
|
|
209
|
+
/* ─── 4. Utility classes ─────────────────────────────────────────────── */
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Clamps text to a single line with an ellipsis when overflow occurs.
|
|
213
|
+
* Apply to any element inside a shadow root where text needs to be truncated.
|
|
214
|
+
*/
|
|
128
215
|
.truncate {
|
|
129
216
|
overflow: hidden;
|
|
130
217
|
white-space: nowrap;
|
|
131
218
|
text-overflow: ellipsis;
|
|
132
219
|
}
|
|
133
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Visually hides an element while keeping it accessible to screen readers
|
|
223
|
+
* and maintaining its position in the DOM and tab order.
|
|
224
|
+
* Use for labeling icon-only buttons, skip links, etc.
|
|
225
|
+
*/
|
|
134
226
|
.visually-hidden {
|
|
135
227
|
position: absolute;
|
|
136
228
|
width: 1px;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/index.ts
|
|
3
|
+
* @package @moni-labs/moni-ui
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @contributors Moni Labs & Contributors
|
|
6
|
+
*/
|
|
1
7
|
export { MoniBadge } from './moni-badge.js';
|
|
2
8
|
export { MoniBottomSheet } from './moni-bottom-sheet.js';
|
|
3
9
|
export { MoniButton } from './moni-button.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/index.ts
|
|
3
|
+
* @package @moni-labs/moni-ui
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @contributors Moni Labs & Contributors
|
|
6
|
+
*/
|
|
1
7
|
// Auto-register all Moni UI Web Components.
|
|
2
8
|
// Importing this file defines every <moni-*> custom element.
|
|
3
9
|
export { MoniBadge } from './moni-badge.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading-shapes.d.ts","sourceRoot":"","sources":["../../src/components/loading-shapes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB;;;;;;;;CAQpC,CAAC"}
|
|
1
|
+
{"version":3,"file":"loading-shapes.d.ts","sourceRoot":"","sources":["../../src/components/loading-shapes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;CAQpC,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/loading-shapes.ts
|
|
3
|
+
* @package @moni-labs/moni-ui
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @contributors Moni Labs & Contributors
|
|
6
|
+
*/
|
|
1
7
|
export const loadingIndicatorPolygons = {
|
|
2
8
|
'4-sided-cookie': '63.83% 2.22%, 65.10% 1.70%, 66.36% 1.26%, 67.62% 0.89%, 68.88% 0.58%, 70.14% 0.34%, 71.39% 0.16%, 72.63% 0.05%, 73.86% 0.00%, 75.08% 0.01%, 76.28% 0.08%, 77.48% 0.21%, 78.66% 0.40%, 79.82% 0.63%, 80.97% 0.93%, 82.09% 1.27%, 83.20% 1.67%, 84.28% 2.11%, 85.34% 2.60%, 86.37% 3.14%, 87.38% 3.72%, 88.36% 4.35%, 89.31% 5.02%, 90.23% 5.73%, 91.12% 6.48%, 91.98% 7.26%, 92.80% 8.09%, 93.58% 8.94%, 94.32% 9.83%, 95.03% 10.76%, 95.70% 11.71%, 96.32% 12.69%, 96.90% 13.70%, 97.43% 14.74%, 97.92% 15.80%, 98.36% 16.88%, 98.76% 17.99%, 99.10% 19.12%, 99.38% 20.26%, 99.62% 21.43%, 99.80% 22.61%, 99.92% 23.80%, 99.99% 25.01%, 100.00% 26.23%, 99.94% 27.47%, 99.83% 28.71%, 99.65% 29.95%, 99.40% 31.21%, 99.09% 32.47%, 98.71% 33.73%, 98.26% 35.00%, 97.75% 36.25%, 97.26% 37.36%, 96.78% 38.47%, 96.30% 39.59%, 95.83% 40.72%, 95.42% 41.87%, 95.06% 43.03%, 94.76% 44.21%, 94.52% 45.40%, 94.33% 46.59%, 94.20% 47.79%, 94.12% 48.99%, 94.11% 50.19%, 94.14% 51.40%, 94.24% 52.60%, 94.39% 53.80%, 94.59% 54.99%, 94.85% 56.17%, 95.17% 57.34%, 95.55% 58.50%, 95.98% 59.65%, 96.45% 60.77%, 96.94% 61.89%, 97.42% 63.00%, 97.92% 64.15%, 98.41% 65.41%, 98.84% 66.68%, 99.20% 67.94%, 99.49% 69.20%, 99.71% 70.45%, 99.87% 71.70%, 99.97% 72.93%, 100.00% 74.16%, 99.97% 75.38%, 99.89% 76.58%, 99.75% 77.78%, 99.55% 78.95%, 99.30% 80.11%, 98.99% 81.25%, 98.63% 82.37%, 98.23% 83.47%, 97.77% 84.55%, 97.27% 85.60%, 96.72% 86.63%, 96.12% 87.63%, 95.49% 88.60%, 94.81% 89.55%, 94.09% 90.46%, 93.33% 91.34%, 92.54% 92.19%, 91.70% 93.00%, 90.84% 93.77%, 89.94% 94.51%, 89.01% 95.20%, 88.05% 95.86%, 87.06% 96.47%, 86.04% 97.04%, 85.00% 97.56%, 83.93% 98.04%, 82.84% 98.47%, 81.73% 98.85%, 80.60% 99.17%, 79.45% 99.45%, 78.28% 99.67%, 77.09% 99.84%, 75.89% 99.95%, 74.68% 100.00%, 73.46% 99.99%, 72.23% 99.92%, 70.98% 99.79%, 69.73% 99.59%, 68.48% 99.33%, 67.22% 99.00%, 65.95% 98.60%, 64.69% 98.14%, 63.47% 97.63%, 62.36% 97.14%, 61.25% 96.66%, 60.13% 96.18%, 58.99% 95.72%, 57.84% 95.32%, 56.67% 94.98%, 55.49% 94.70%, 54.31% 94.47%, 53.11% 94.29%, 51.91% 94.18%, 50.71% 94.11%, 49.50% 94.11%, 48.30% 94.16%, 47.10% 94.27%, 45.90% 94.43%, 44.71% 94.65%, 43.53% 94.93%, 42.36% 95.26%, 41.21% 95.65%, 40.07% 96.09%, 38.95% 96.58%, 37.84% 97.06%, 36.72% 97.54%, 35.54% 98.05%, 34.27% 98.53%, 33.01% 98.94%, 31.74% 99.28%, 30.49% 99.55%, 29.24% 99.76%, 27.99% 99.90%, 26.76% 99.98%, 25.53% 100.00%, 24.32% 99.96%, 23.12% 99.86%, 21.93% 99.70%, 20.76% 99.49%, 19.60% 99.23%, 18.47% 98.91%, 17.35% 98.54%, 16.26% 98.12%, 15.19% 97.65%, 14.14% 97.13%, 13.12% 96.57%, 12.12% 95.97%, 11.16% 95.32%, 10.22% 94.63%, 9.32% 93.90%, 8.45% 93.14%, 7.61% 92.33%, 6.81% 91.49%, 6.04% 90.62%, 5.32% 89.71%, 4.63% 88.77%, 3.99% 87.80%, 3.38% 86.81%, 2.83% 85.78%, 2.31% 84.74%, 1.85% 83.66%, 1.43% 82.57%, 1.07% 81.45%, 0.75% 80.31%, 0.49% 79.16%, 0.28% 77.98%, 0.13% 76.80%, 0.04% 75.59%, 0.00% 74.38%, 0.02% 73.15%, 0.11% 71.92%, 0.26% 70.67%, 0.47% 69.42%, 0.75% 68.16%, 1.09% 66.90%, 1.51% 65.64%, 1.99% 64.37%, 2.49% 63.19%, 2.98% 62.08%, 3.46% 60.97%, 3.94% 59.85%, 4.38% 58.71%, 4.77% 57.55%, 5.09% 56.38%, 5.37% 55.20%, 5.58% 54.01%, 5.74% 52.81%, 5.84% 51.61%, 5.89% 50.41%, 5.88% 49.20%, 5.82% 48.00%, 5.70% 46.80%, 5.52% 45.61%, 5.28% 44.42%, 4.99% 43.24%, 4.65% 42.07%, 4.25% 40.92%, 3.79% 39.78%, 3.30% 38.67%, 2.82% 37.56%, 2.34% 36.45%, 1.82% 35.22%, 1.36% 33.95%, 0.97% 32.69%, 0.65% 31.43%, 0.39% 30.18%, 0.20% 28.93%, 0.07% 27.68%, 0.01% 26.45%, 0.01% 25.23%, 0.06% 24.02%, 0.17% 22.82%, 0.34% 21.64%, 0.57% 20.47%, 0.85% 19.32%, 1.18% 18.19%, 1.56% 17.08%, 2.00% 15.99%, 2.48% 14.92%, 3.00% 13.88%, 3.57% 12.87%, 4.19% 11.88%, 4.85% 10.92%, 5.55% 9.99%, 6.29% 9.10%, 7.06% 8.23%, 7.88% 7.41%, 8.72% 6.61%, 9.61% 5.86%, 10.52% 5.14%, 11.47% 4.47%, 12.44% 3.83%, 13.45% 3.24%, 14.48% 2.69%, 15.53% 2.19%, 16.61% 1.74%, 17.71% 1.34%, 18.83% 0.98%, 19.98% 0.68%, 21.14% 0.43%, 22.31% 0.24%, 23.50% 0.10%, 24.71% 0.02%, 25.93% 0.00%, 27.16% 0.04%, 28.39% 0.14%, 29.64% 0.30%, 30.89% 0.53%, 32.15% 0.83%, 33.41% 1.19%, 34.68% 1.62%, 35.94% 2.12%, 37.08% 2.61%, 38.20% 3.10%, 39.31% 3.58%, 40.43% 4.06%, 41.58% 4.48%, 42.74% 4.85%, 43.91% 5.17%, 45.10% 5.43%, 46.29% 5.63%, 47.49% 5.77%, 48.69% 5.86%, 49.89% 5.90%, 51.10% 5.87%, 52.30% 5.79%, 53.50% 5.66%, 54.69% 5.47%, 55.88% 5.22%, 57.05% 4.91%, 58.21% 4.55%, 59.36% 4.14%, 60.49% 3.67%, 61.61% 3.18%, 62.72% 2.70%, 63.83% 2.22%',
|
|
3
9
|
'9-sided-cookie': '61.39% 5.18%, 62.25% 5.81%, 63.15% 6.37%, 64.08% 6.88%, 65.04% 7.33%, 66.03% 7.71%, 67.04% 8.02%, 68.07% 8.27%, 69.11% 8.45%, 70.17% 8.57%, 71.18% 8.61%, 72.43% 8.63%, 73.38% 8.68%, 74.46% 8.80%, 75.52% 9.00%, 76.56% 9.26%, 77.57% 9.59%, 78.55% 9.98%, 79.50% 10.44%, 80.42% 10.95%, 81.30% 11.52%, 82.14% 12.14%, 82.93% 12.81%, 83.69% 13.54%, 84.39% 14.31%, 85.05% 15.13%, 85.65% 15.99%, 86.20% 16.89%, 86.69% 17.84%, 87.12% 18.81%, 87.49% 19.83%, 87.79% 20.87%, 87.99% 21.78%, 88.22% 23.01%, 88.46% 24.01%, 88.76% 25.02%, 89.14% 26.02%, 89.57% 26.98%, 90.07% 27.91%, 90.63% 28.81%, 91.24% 29.67%, 91.91% 30.49%, 92.64% 31.27%, 93.40% 31.98%, 94.34% 32.79%, 95.02% 33.41%, 95.78% 34.19%, 96.48% 35.02%, 97.12% 35.88%, 97.70% 36.77%, 98.21% 37.69%, 98.66% 38.65%, 99.05% 39.62%, 99.37% 40.62%, 99.63% 41.63%, 99.82% 42.66%, 99.94% 43.70%, 100.00% 44.74%, 99.99% 45.79%, 99.91% 46.84%, 99.76% 47.88%, 99.54% 48.92%, 99.26% 49.95%, 98.90% 50.97%, 98.47% 51.97%, 98.04% 52.81%, 97.43% 53.91%, 96.96% 54.80%, 96.53% 55.77%, 96.16% 56.77%, 95.86% 57.78%, 95.63% 58.81%, 95.46% 59.86%, 95.36% 60.91%, 95.34% 61.97%, 95.38% 63.03%, 95.49% 64.09%, 95.68% 65.27%, 95.82% 66.19%, 95.91% 67.28%, 95.93% 68.36%, 95.88% 69.43%, 95.76% 70.49%, 95.57% 71.53%, 95.32% 72.55%, 95.00% 73.55%, 94.61% 74.53%, 94.17% 75.47%, 93.66% 76.39%, 93.10% 77.27%, 92.48% 78.11%, 91.81% 78.92%, 91.09% 79.68%, 90.31% 80.39%, 89.48% 81.06%, 88.61% 81.68%, 87.69% 82.23%, 86.73% 82.74%, 85.81% 83.14%, 84.74% 83.55%, 83.75% 83.94%, 82.78% 84.40%, 81.85% 84.91%, 80.96% 85.49%, 80.11% 86.11%, 79.30% 86.80%, 78.54% 87.53%, 77.83% 88.31%, 77.17% 89.14%, 76.56% 90.02%, 75.97% 90.98%, 75.43% 91.87%, 74.84% 92.73%, 74.17% 93.59%, 73.45% 94.38%, 72.69% 95.13%, 71.89% 95.82%, 71.04% 96.45%, 70.16% 97.02%, 69.25% 97.53%, 68.30% 97.99%, 67.34% 98.38%, 66.34% 98.71%, 65.33% 98.97%, 64.30% 99.17%, 63.26% 99.30%, 62.21% 99.37%, 61.15% 99.37%, 60.08% 99.29%, 59.02% 99.15%, 57.96% 98.93%, 56.92% 98.65%, 55.99% 98.34%, 54.89% 97.96%, 53.86% 97.67%, 52.82% 97.46%, 51.77% 97.31%, 50.72% 97.23%, 49.66% 97.21%, 48.61% 97.27%, 47.55% 97.39%, 46.51% 97.59%, 45.48% 97.85%, 44.51% 98.16%, 43.35% 98.56%, 42.42% 98.84%, 41.36% 99.08%, 40.30% 99.25%, 39.24% 99.35%, 38.18% 99.38%, 37.12% 99.34%, 36.07% 99.23%, 35.04% 99.05%, 34.02% 98.81%, 33.02% 98.50%, 32.04% 98.13%, 31.09% 97.70%, 30.17% 97.21%, 29.27% 96.66%, 28.42% 96.05%, 27.60% 95.38%, 26.82% 94.66%, 26.08% 93.88%, 25.40% 93.04%, 24.76% 92.16%, 24.27% 91.38%, 23.64% 90.33%, 23.06% 89.45%, 22.42% 88.60%, 21.72% 87.80%, 20.98% 87.05%, 20.19% 86.35%, 19.35% 85.70%, 18.47% 85.11%, 17.56% 84.58%, 16.60% 84.10%, 15.67% 83.70%, 14.49% 83.26%, 13.63% 82.90%, 12.65% 82.42%, 11.72% 81.88%, 10.83% 81.29%, 9.98% 80.64%, 9.19% 79.94%, 8.45% 79.20%, 7.75% 78.41%, 7.12% 77.58%, 6.53% 76.71%, 6.01% 75.81%, 5.54% 74.87%, 5.14% 73.91%, 4.80% 72.92%, 4.52% 71.90%, 4.30% 70.87%, 4.16% 69.82%, 4.08% 68.75%, 4.08% 67.67%, 4.15% 66.59%, 4.26% 65.66%, 4.47% 64.41%, 4.59% 63.41%, 4.66% 62.35%, 4.66% 61.29%, 4.59% 60.23%, 4.44% 59.18%, 4.24% 58.15%, 3.96% 57.13%, 3.62% 56.12%, 3.21% 55.14%, 2.73% 54.19%, 2.14% 53.14%, 1.71% 52.32%, 1.25% 51.33%, 0.87% 50.32%, 0.55% 49.29%, 0.31% 48.25%, 0.14% 47.21%, 0.04% 46.16%, 0.00% 45.11%, 0.03% 44.07%, 0.13% 43.03%, 0.30% 42.00%, 0.53% 40.98%, 0.83% 39.98%, 1.19% 38.99%, 1.62% 38.03%, 2.11% 37.10%, 2.67% 36.19%, 3.28% 35.32%, 3.96% 34.48%, 4.70% 33.69%, 5.41% 33.02%, 6.33% 32.22%, 7.09% 31.54%, 7.84% 30.78%, 8.53% 29.97%, 9.16% 29.12%, 9.74% 28.24%, 10.26% 27.32%, 10.72% 26.37%, 11.11% 25.38%, 11.45% 24.37%, 11.71% 23.34%, 11.94% 22.20%, 12.13% 21.24%, 12.40% 20.20%, 12.75% 19.17%, 13.15% 18.18%, 13.62% 17.23%, 14.15% 16.31%, 14.73% 15.43%, 15.37% 14.60%, 16.06% 13.81%, 16.80% 13.07%, 17.58% 12.37%, 18.40% 11.73%, 19.27% 11.14%, 20.17% 10.61%, 21.11% 10.14%, 22.08% 9.72%, 23.08% 9.37%, 24.11% 9.09%, 25.16% 8.87%, 26.24% 8.72%, 27.27% 8.64%, 28.33% 8.62%, 29.45% 8.59%, 30.51% 8.50%, 31.56% 8.34%, 32.60% 8.12%, 33.62% 7.83%, 34.61% 7.47%, 35.58% 7.05%, 36.52% 6.56%, 37.43% 6.02%, 38.31% 5.41%, 39.15% 4.75%, 39.15% 4.75%, 40.04% 4.03%, 40.85% 3.44%, 41.76% 2.86%, 42.71% 2.35%, 43.68% 1.90%, 44.67% 1.52%, 45.68% 1.21%, 46.70% 0.96%, 47.73% 0.78%, 48.77% 0.67%, 49.81% 0.62%, 50.86% 0.65%, 51.90% 0.73%, 52.94% 0.89%, 53.96% 1.11%, 54.98% 1.40%, 55.97% 1.76%, 56.95% 2.18%, 57.90% 2.67%, 58.83% 3.23%, 59.73% 3.85%, 60.46% 4.43%',
|
|
@@ -1,47 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-app-bar.ts
|
|
3
|
+
* @package @moni-labs/moni-ui
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @contributors Moni Labs & Contributors
|
|
6
|
+
*/
|
|
1
7
|
import { MoniElement } from './_base/index.js';
|
|
2
8
|
/**
|
|
3
|
-
* Material 3 App Bar
|
|
4
|
-
*
|
|
5
|
-
* App bars
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
9
|
+
* Material Design 3 App Bar component.
|
|
10
|
+
*
|
|
11
|
+
* App bars provide navigation and action controls at the top (or bottom) of a
|
|
12
|
+
* screen. They are positioned sticky by default so they remain visible as the
|
|
13
|
+
* user scrolls through content.
|
|
14
|
+
*
|
|
15
|
+
* **M3 spec reference:** `m3-docs/components/app-bars/specs.md`
|
|
16
|
+
*
|
|
17
|
+
* **Placement:**
|
|
18
|
+
* - `top` (default) — 64dp header fixed above page content. Uses `position: sticky`
|
|
19
|
+
* with `inset-block-start: 0` so it stays at the top of the scroll container.
|
|
20
|
+
* - `bottom` — Mobile navigation footer anchored to the bottom of the viewport.
|
|
21
|
+
* Ideal for housing primary navigation icons and an optional FAB.
|
|
22
|
+
*
|
|
23
|
+
* **Variants:**
|
|
24
|
+
* - `standard` — Flat surface (no shadow) when content is at the top. Best for most UIs.
|
|
25
|
+
* - `floating` — Always elevated with `--elevate2` shadow. Use when the bar visually
|
|
26
|
+
* floats above the content regardless of scroll position.
|
|
27
|
+
*
|
|
28
|
+
* **Sizes:**
|
|
29
|
+
* - `default` — 64dp (4rem) tall. Standard for most use cases.
|
|
30
|
+
* - `prominent` — 152dp (9.5rem) tall. Use when a subtitle or expanded area is needed.
|
|
31
|
+
* The `subtitle` attribute is only rendered in this size.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```html
|
|
35
|
+
* <!-- Top app bar with navigation icon and action buttons -->
|
|
36
|
+
* <moni-app-bar title="Settings">
|
|
37
|
+
* <moni-button slot="leading" shape="circle" variant="text" icon="menu"></moni-button>
|
|
38
|
+
* <moni-button slot="trailing" shape="circle" variant="text" icon="search"></moni-button>
|
|
39
|
+
* <moni-button slot="trailing" shape="circle" variant="text" icon="more_vert"></moni-button>
|
|
40
|
+
* </moni-app-bar>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```html
|
|
45
|
+
* <!-- Prominent app bar with subtitle -->
|
|
46
|
+
* <moni-app-bar size="prominent" title="Inbox" subtitle="12 unread messages" elevated>
|
|
47
|
+
* </moni-app-bar>
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @slot leading - Navigation icon(s) placed on the leading (start) edge.
|
|
51
|
+
* @slot trailing - Action icon(s) placed on the trailing (end) edge.
|
|
52
|
+
* @slot fab - FAB anchored to the trailing edge (bottom placement only).
|
|
53
|
+
* @slot default - Additional content (e.g. a tab bar below the title row).
|
|
54
|
+
*
|
|
55
|
+
* @csspart bar - The inner grid container.
|
|
56
|
+
* @csspart leading - The leading slot wrapper.
|
|
57
|
+
* @csspart trailing - The trailing slot wrapper.
|
|
58
|
+
* @csspart title - The title text element.
|
|
59
|
+
* @csspart subtitle - The subtitle text element (prominent size only).
|
|
60
|
+
* @csspart actions - The actions slot wrapper (prominent size only).
|
|
35
61
|
*/
|
|
36
62
|
export declare class MoniAppBar extends MoniElement {
|
|
63
|
+
/**
|
|
64
|
+
* Determines whether the bar is placed at the top or bottom of the viewport.
|
|
65
|
+
*
|
|
66
|
+
* - `'top'` (default) — Sticky header at the top of the scroll container.
|
|
67
|
+
* - `'bottom'` — Fixed footer; primarily used for mobile bottom navigation patterns.
|
|
68
|
+
*
|
|
69
|
+
* @default 'top'
|
|
70
|
+
*/
|
|
37
71
|
placement: 'top' | 'bottom';
|
|
72
|
+
/**
|
|
73
|
+
* Visual variant of the app bar.
|
|
74
|
+
*
|
|
75
|
+
* - `'standard'` (default) — Flat surface. No shadow at rest; gains shadow
|
|
76
|
+
* programmatically via the `elevated` attribute when content scrolls beneath it.
|
|
77
|
+
* - `'floating'` — Permanently elevated with `--elevate2` box-shadow.
|
|
78
|
+
*
|
|
79
|
+
* @default 'standard'
|
|
80
|
+
*/
|
|
38
81
|
variant: 'standard' | 'floating';
|
|
82
|
+
/**
|
|
83
|
+
* Height variant of the app bar.
|
|
84
|
+
*
|
|
85
|
+
* - `'default'` — 64dp (4rem). Standard M3 top app bar height.
|
|
86
|
+
* - `'prominent'` — 152dp (9.5rem). Use when showing a subtitle or when
|
|
87
|
+
* extra vertical space is needed for a contextual action row.
|
|
88
|
+
*
|
|
89
|
+
* @default 'default'
|
|
90
|
+
*/
|
|
39
91
|
size: 'default' | 'prominent';
|
|
92
|
+
/**
|
|
93
|
+
* Title text displayed in the center of the app bar.
|
|
94
|
+
*
|
|
95
|
+
* The title is center-aligned per M3 spec. Long titles are truncated with
|
|
96
|
+
* an ellipsis. For semantic HTML, the consumer should also provide an `<h1>`
|
|
97
|
+
* in the page content that matches this title.
|
|
98
|
+
*
|
|
99
|
+
* @default ''
|
|
100
|
+
*/
|
|
40
101
|
title: string;
|
|
102
|
+
/**
|
|
103
|
+
* Optional subtitle displayed below the title.
|
|
104
|
+
*
|
|
105
|
+
* Only rendered when `size="prominent"`. Provides secondary context
|
|
106
|
+
* (e.g. folder name, item count, description).
|
|
107
|
+
*
|
|
108
|
+
* @default ''
|
|
109
|
+
*/
|
|
41
110
|
subtitle: string;
|
|
111
|
+
/**
|
|
112
|
+
* When present, applies `--elevate2` box-shadow to signal that content has
|
|
113
|
+
* scrolled beneath the bar.
|
|
114
|
+
*
|
|
115
|
+
* Consumers are responsible for toggling this attribute reactively based on
|
|
116
|
+
* the scroll position of the main content area:
|
|
117
|
+
* ```ts
|
|
118
|
+
* container.addEventListener('scroll', () => {
|
|
119
|
+
* appBar.elevated = container.scrollTop > 0;
|
|
120
|
+
* });
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @default false
|
|
124
|
+
*/
|
|
42
125
|
elevated: boolean;
|
|
43
126
|
static styles: import("lit").CSSResult[];
|
|
44
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Renders the app bar grid layout.
|
|
129
|
+
*
|
|
130
|
+
* The inner `.bar` element uses a 3-column CSS grid:
|
|
131
|
+
* - Column 1: leading slot (navigation icon).
|
|
132
|
+
* - Column 2: title (center-aligned, fills remaining space).
|
|
133
|
+
* - Column 3: trailing slot (action icons).
|
|
134
|
+
*
|
|
135
|
+
* In `prominent` size, a subtitle row and an actions row are appended
|
|
136
|
+
* conditionally. The subtitle only renders when the `subtitle` attribute
|
|
137
|
+
* is non-empty; the actions slot always renders for prominent bars.
|
|
138
|
+
*/
|
|
139
|
+
render(): import("lit").TemplateResult<1>;
|
|
45
140
|
}
|
|
46
141
|
declare global {
|
|
47
142
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moni-app-bar.d.ts","sourceRoot":"","sources":["../../src/components/moni-app-bar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"moni-app-bar.d.ts","sourceRoot":"","sources":["../../src/components/moni-app-bar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,qBACa,UAAW,SAAQ,WAAW;IAC1C;;;;;;;OAOG;IAEH,SAAS,EAAE,KAAK,GAAG,QAAQ,CAAS;IAEpC;;;;;;;;OAQG;IAEH,OAAO,EAAE,UAAU,GAAG,UAAU,CAAc;IAE9C;;;;;;;;OAQG;IAEH,IAAI,EAAE,SAAS,GAAG,WAAW,CAAa;IAE1C;;;;;;;;OAQG;IAC0B,KAAK,SAAM;IAExC;;;;;;;OAOG;IAC0B,QAAQ,SAAM;IAE3C;;;;;;;;;;;;;OAaG;IACyC,QAAQ,UAAS;IAE7D,OAAgB,MAAM,4BAyGpB;IAEF;;;;;;;;;;;OAWG;IACM,MAAM;CAwBf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,UAAU,CAAC;KAC3B;CACD;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-app-bar.ts
|
|
3
|
+
* @package @moni-labs/moni-ui
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @contributors Moni Labs & Contributors
|
|
6
|
+
*/
|
|
1
7
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
8
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
9
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,47 +14,124 @@ import { html, css, nothing } from 'lit';
|
|
|
8
14
|
import { customElement, property } from 'lit/decorators.js';
|
|
9
15
|
import { MoniElement, sharedStyles } from './_base/index.js';
|
|
10
16
|
/**
|
|
11
|
-
* Material 3 App Bar
|
|
17
|
+
* Material Design 3 App Bar component.
|
|
18
|
+
*
|
|
19
|
+
* App bars provide navigation and action controls at the top (or bottom) of a
|
|
20
|
+
* screen. They are positioned sticky by default so they remain visible as the
|
|
21
|
+
* user scrolls through content.
|
|
22
|
+
*
|
|
23
|
+
* **M3 spec reference:** `m3-docs/components/app-bars/specs.md`
|
|
24
|
+
*
|
|
25
|
+
* **Placement:**
|
|
26
|
+
* - `top` (default) — 64dp header fixed above page content. Uses `position: sticky`
|
|
27
|
+
* with `inset-block-start: 0` so it stays at the top of the scroll container.
|
|
28
|
+
* - `bottom` — Mobile navigation footer anchored to the bottom of the viewport.
|
|
29
|
+
* Ideal for housing primary navigation icons and an optional FAB.
|
|
12
30
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* icons and an optional FAB anchor.
|
|
31
|
+
* **Variants:**
|
|
32
|
+
* - `standard` — Flat surface (no shadow) when content is at the top. Best for most UIs.
|
|
33
|
+
* - `floating` — Always elevated with `--elevate2` shadow. Use when the bar visually
|
|
34
|
+
* floats above the content regardless of scroll position.
|
|
18
35
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
36
|
+
* **Sizes:**
|
|
37
|
+
* - `default` — 64dp (4rem) tall. Standard for most use cases.
|
|
38
|
+
* - `prominent` — 152dp (9.5rem) tall. Use when a subtitle or expanded area is needed.
|
|
39
|
+
* The `subtitle` attribute is only rendered in this size.
|
|
22
40
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```html
|
|
43
|
+
* <!-- Top app bar with navigation icon and action buttons -->
|
|
44
|
+
* <moni-app-bar title="Settings">
|
|
45
|
+
* <moni-button slot="leading" shape="circle" variant="text" icon="menu"></moni-button>
|
|
46
|
+
* <moni-button slot="trailing" shape="circle" variant="text" icon="search"></moni-button>
|
|
47
|
+
* <moni-button slot="trailing" shape="circle" variant="text" icon="more_vert"></moni-button>
|
|
48
|
+
* </moni-app-bar>
|
|
49
|
+
* ```
|
|
26
50
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```html
|
|
53
|
+
* <!-- Prominent app bar with subtitle -->
|
|
54
|
+
* <moni-app-bar size="prominent" title="Inbox" subtitle="12 unread messages" elevated>
|
|
55
|
+
* </moni-app-bar>
|
|
56
|
+
* ```
|
|
29
57
|
*
|
|
30
|
-
*
|
|
31
|
-
* -
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* - title: text content of the title (centered)
|
|
35
|
-
* - subtitle: optional subtitle shown below the title (prominent only)
|
|
36
|
-
* - elevated: present → adds elevation 2 shadow (e.g. when scrolled)
|
|
58
|
+
* @slot leading - Navigation icon(s) placed on the leading (start) edge.
|
|
59
|
+
* @slot trailing - Action icon(s) placed on the trailing (end) edge.
|
|
60
|
+
* @slot fab - FAB anchored to the trailing edge (bottom placement only).
|
|
61
|
+
* @slot default - Additional content (e.g. a tab bar below the title row).
|
|
37
62
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
63
|
+
* @csspart bar - The inner grid container.
|
|
64
|
+
* @csspart leading - The leading slot wrapper.
|
|
65
|
+
* @csspart trailing - The trailing slot wrapper.
|
|
66
|
+
* @csspart title - The title text element.
|
|
67
|
+
* @csspart subtitle - The subtitle text element (prominent size only).
|
|
68
|
+
* @csspart actions - The actions slot wrapper (prominent size only).
|
|
43
69
|
*/
|
|
44
70
|
let MoniAppBar = class MoniAppBar extends MoniElement {
|
|
45
71
|
constructor() {
|
|
46
72
|
super(...arguments);
|
|
73
|
+
/**
|
|
74
|
+
* Determines whether the bar is placed at the top or bottom of the viewport.
|
|
75
|
+
*
|
|
76
|
+
* - `'top'` (default) — Sticky header at the top of the scroll container.
|
|
77
|
+
* - `'bottom'` — Fixed footer; primarily used for mobile bottom navigation patterns.
|
|
78
|
+
*
|
|
79
|
+
* @default 'top'
|
|
80
|
+
*/
|
|
47
81
|
this.placement = 'top';
|
|
82
|
+
/**
|
|
83
|
+
* Visual variant of the app bar.
|
|
84
|
+
*
|
|
85
|
+
* - `'standard'` (default) — Flat surface. No shadow at rest; gains shadow
|
|
86
|
+
* programmatically via the `elevated` attribute when content scrolls beneath it.
|
|
87
|
+
* - `'floating'` — Permanently elevated with `--elevate2` box-shadow.
|
|
88
|
+
*
|
|
89
|
+
* @default 'standard'
|
|
90
|
+
*/
|
|
48
91
|
this.variant = 'standard';
|
|
92
|
+
/**
|
|
93
|
+
* Height variant of the app bar.
|
|
94
|
+
*
|
|
95
|
+
* - `'default'` — 64dp (4rem). Standard M3 top app bar height.
|
|
96
|
+
* - `'prominent'` — 152dp (9.5rem). Use when showing a subtitle or when
|
|
97
|
+
* extra vertical space is needed for a contextual action row.
|
|
98
|
+
*
|
|
99
|
+
* @default 'default'
|
|
100
|
+
*/
|
|
49
101
|
this.size = 'default';
|
|
102
|
+
/**
|
|
103
|
+
* Title text displayed in the center of the app bar.
|
|
104
|
+
*
|
|
105
|
+
* The title is center-aligned per M3 spec. Long titles are truncated with
|
|
106
|
+
* an ellipsis. For semantic HTML, the consumer should also provide an `<h1>`
|
|
107
|
+
* in the page content that matches this title.
|
|
108
|
+
*
|
|
109
|
+
* @default ''
|
|
110
|
+
*/
|
|
50
111
|
this.title = '';
|
|
112
|
+
/**
|
|
113
|
+
* Optional subtitle displayed below the title.
|
|
114
|
+
*
|
|
115
|
+
* Only rendered when `size="prominent"`. Provides secondary context
|
|
116
|
+
* (e.g. folder name, item count, description).
|
|
117
|
+
*
|
|
118
|
+
* @default ''
|
|
119
|
+
*/
|
|
51
120
|
this.subtitle = '';
|
|
121
|
+
/**
|
|
122
|
+
* When present, applies `--elevate2` box-shadow to signal that content has
|
|
123
|
+
* scrolled beneath the bar.
|
|
124
|
+
*
|
|
125
|
+
* Consumers are responsible for toggling this attribute reactively based on
|
|
126
|
+
* the scroll position of the main content area:
|
|
127
|
+
* ```ts
|
|
128
|
+
* container.addEventListener('scroll', () => {
|
|
129
|
+
* appBar.elevated = container.scrollTop > 0;
|
|
130
|
+
* });
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @default false
|
|
134
|
+
*/
|
|
52
135
|
this.elevated = false;
|
|
53
136
|
}
|
|
54
137
|
static { this.styles = [
|
|
@@ -157,6 +240,18 @@ let MoniAppBar = class MoniAppBar extends MoniElement {
|
|
|
157
240
|
}
|
|
158
241
|
`
|
|
159
242
|
]; }
|
|
243
|
+
/**
|
|
244
|
+
* Renders the app bar grid layout.
|
|
245
|
+
*
|
|
246
|
+
* The inner `.bar` element uses a 3-column CSS grid:
|
|
247
|
+
* - Column 1: leading slot (navigation icon).
|
|
248
|
+
* - Column 2: title (center-aligned, fills remaining space).
|
|
249
|
+
* - Column 3: trailing slot (action icons).
|
|
250
|
+
*
|
|
251
|
+
* In `prominent` size, a subtitle row and an actions row are appended
|
|
252
|
+
* conditionally. The subtitle only renders when the `subtitle` attribute
|
|
253
|
+
* is non-empty; the actions slot always renders for prominent bars.
|
|
254
|
+
*/
|
|
160
255
|
render() {
|
|
161
256
|
const hasSubtitle = this.size === 'prominent' && Boolean(this.subtitle);
|
|
162
257
|
const hasActions = Boolean(this.size === 'prominent');
|