@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,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-text-field.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);
|
|
@@ -12,17 +18,56 @@ import { MoniElement, sharedStyles, fieldStyles } from './_base/index.js';
|
|
|
12
18
|
import './moni-icon.js';
|
|
13
19
|
import './moni-progress.js';
|
|
14
20
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
21
|
+
* Material Design 3 Text Field component.
|
|
22
|
+
*
|
|
23
|
+
* A full-featured input field that wraps a native `<input>` inside the M3
|
|
24
|
+
* field shell (`.field` class from `fieldStyles`). Supports floating labels,
|
|
25
|
+
* filled and outlined variants, leading/trailing icons, helper text, and
|
|
26
|
+
* error states.
|
|
27
|
+
*
|
|
28
|
+
* **M3 spec reference:** `m3-docs/components/text-fields/specs.md`
|
|
29
|
+
*
|
|
30
|
+
* **Visual architecture:**
|
|
31
|
+
* Uses `fieldStyles` for the complete CSS field shell. The field container
|
|
32
|
+
* is a `<div class="field [modifiers]">` wrapping:
|
|
33
|
+
* 1. Optional leading icon.
|
|
34
|
+
* 2. Native `<input>` element.
|
|
35
|
+
* 3. Floating `<label>` (when `label` is set).
|
|
36
|
+
* 4. Optional trailing icon or loading spinner.
|
|
37
|
+
* 5. `<output>` for helper/error text.
|
|
38
|
+
*
|
|
39
|
+
* **Visual-only contract:**
|
|
40
|
+
* This component does **not** listen to `@input` events to sync the `value`
|
|
41
|
+
* attribute back from the underlying `<input>`. Consumers must either:
|
|
42
|
+
* - Submit the native form (the `<input name>` participates in form submission).
|
|
43
|
+
* - Listen to `change` or `input` events via standard DOM event handling.
|
|
44
|
+
* - Use a framework binding (e.g. `bind:value` in Svelte, `v-model` in Vue).
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```html
|
|
48
|
+
* <moni-text-field
|
|
49
|
+
* label="Email address"
|
|
50
|
+
* type="email"
|
|
51
|
+
* name="email"
|
|
52
|
+
* icon="mail"
|
|
53
|
+
* variant="outlined"
|
|
54
|
+
* helper="We'll never share your email."
|
|
55
|
+
* ></moni-text-field>
|
|
17
56
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
57
|
+
* <moni-text-field
|
|
58
|
+
* label="Amount"
|
|
59
|
+
* type="number"
|
|
60
|
+
* prefix="$"
|
|
61
|
+
* error
|
|
62
|
+
* error-text="Value must be positive"
|
|
63
|
+
* ></moni-text-field>
|
|
64
|
+
* ```
|
|
21
65
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
66
|
+
* @csspart field - The outer `.field` div container.
|
|
67
|
+
* @csspart input - The native `<input>` element.
|
|
68
|
+
* @csspart label - The floating `<label>` element.
|
|
69
|
+
* @csspart helper - The helper `<output>` element.
|
|
70
|
+
* @csspart error-output - The error `<output>` element.
|
|
26
71
|
*/
|
|
27
72
|
let MoniTextField = class MoniTextField extends MoniElement {
|
|
28
73
|
constructor() {
|
|
@@ -1,27 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-textarea.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
|
import './moni-icon.js';
|
|
3
9
|
import './moni-progress.js';
|
|
4
10
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
11
|
+
* Material Design 3 Textarea component.
|
|
12
|
+
*
|
|
13
|
+
* A multi-line text input field designed for collecting longer amounts of text,
|
|
14
|
+
* such as comments, descriptions, or messages.
|
|
15
|
+
*
|
|
16
|
+
* **M3 spec reference:** `m3-docs/components/text-fields/specs.md`
|
|
17
|
+
*
|
|
18
|
+
* **Visual architecture:**
|
|
19
|
+
* It shares the exact same `.field` shell and styling engine as
|
|
20
|
+
* `<moni-text-field>`, but internally renders a native `<textarea>` instead
|
|
21
|
+
* of an `<input>`. This ensures visual consistency across all form elements
|
|
22
|
+
* regarding floating labels, helper text, error states, and icons.
|
|
23
|
+
*
|
|
24
|
+
* **Character Counter:**
|
|
25
|
+
* If the `maxlength` attribute is set, the textarea automatically displays
|
|
26
|
+
* a character counter (`{current length} / {maxlength}`) positioned at the
|
|
27
|
+
* trailing edge of the supporting text area (bottom right). This can be
|
|
28
|
+
* suppressed by setting the `no-counter` attribute.
|
|
29
|
+
*
|
|
30
|
+
* **State management:**
|
|
31
|
+
* This component is purely visual and presentational. It reflects attributes
|
|
32
|
+
* down to the native textarea, but it does NOT attach internal `@input` or
|
|
33
|
+
* `@change` listeners. Consumers should attach standard DOM listeners directly
|
|
34
|
+
* to this element to capture user input, just as they would with a native
|
|
35
|
+
* textarea.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```html
|
|
39
|
+
* <!-- Standard filled textarea -->
|
|
40
|
+
* <moni-textarea label="Description" rows="4"></moni-textarea>
|
|
41
|
+
*
|
|
42
|
+
* <!-- Outlined textarea with character counter -->
|
|
43
|
+
* <moni-textarea
|
|
44
|
+
* variant="outlined"
|
|
45
|
+
* label="Bio"
|
|
46
|
+
* maxlength="160"
|
|
47
|
+
* ></moni-textarea>
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @csspart field - The outer `.field` div container.
|
|
51
|
+
* @csspart input - The native `<textarea>` element.
|
|
52
|
+
* @csspart label - The floating `<label>` element.
|
|
53
|
+
* @csspart helper - The helper/error text area.
|
|
54
|
+
* @csspart counter - The character counter element.
|
|
25
55
|
*/
|
|
26
56
|
export declare class MoniTextarea extends MoniElement {
|
|
27
57
|
name: string;
|
|
@@ -46,7 +76,7 @@ export declare class MoniTextarea extends MoniElement {
|
|
|
46
76
|
private _input;
|
|
47
77
|
updated(changed: Map<string, unknown>): void;
|
|
48
78
|
static styles: import("lit").CSSResult[];
|
|
49
|
-
render(): import("lit
|
|
79
|
+
render(): import("lit").TemplateResult<1>;
|
|
50
80
|
}
|
|
51
81
|
declare global {
|
|
52
82
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moni-textarea.d.ts","sourceRoot":"","sources":["../../src/components/moni-textarea.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"moni-textarea.d.ts","sourceRoot":"","sources":["../../src/components/moni-textarea.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,WAAW,EAA6B,MAAM,kBAAkB,CAAC;AAC1E,OAAO,gBAAgB,CAAC;AACxB,OAAO,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,qBACa,YAAa,SAAQ,WAAW;IACf,IAAI,SAAM;IACV,KAAK,SAAM;IACX,OAAO,EAAE,QAAQ,GAAG,UAAU,CAAY;IAEvE,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAY;IAExD,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAc;IACvB,IAAI,SAAM;IACkB,YAAY,SAAM;IAC9C,MAAM,SAAM;IACZ,MAAM,SAAM;IACE,IAAI,SAAK;IACT,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE3E,SAAS,UAAS;IAC0B,OAAO,UAAS;IAChB,QAAQ,UAAS;IAChC,MAAM,SAAM;IACa,SAAS,SAAM;IACzB,KAAK,UAAS;IAC7B,KAAK,SAAM;IACX,WAAW,SAAM;IAE3B,OAAO,CAAC,MAAM,CAAuB;IAE/C,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAU9C,OAAgB,MAAM,4BAA+B;IAE5C,MAAM;CAkGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,eAAe,EAAE,YAAY,CAAC;KAC9B;CACD;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-textarea.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);
|
|
@@ -12,26 +18,50 @@ import { MoniElement, sharedStyles, fieldStyles } from './_base/index.js';
|
|
|
12
18
|
import './moni-icon.js';
|
|
13
19
|
import './moni-progress.js';
|
|
14
20
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
21
|
+
* Material Design 3 Textarea component.
|
|
22
|
+
*
|
|
23
|
+
* A multi-line text input field designed for collecting longer amounts of text,
|
|
24
|
+
* such as comments, descriptions, or messages.
|
|
25
|
+
*
|
|
26
|
+
* **M3 spec reference:** `m3-docs/components/text-fields/specs.md`
|
|
27
|
+
*
|
|
28
|
+
* **Visual architecture:**
|
|
29
|
+
* It shares the exact same `.field` shell and styling engine as
|
|
30
|
+
* `<moni-text-field>`, but internally renders a native `<textarea>` instead
|
|
31
|
+
* of an `<input>`. This ensures visual consistency across all form elements
|
|
32
|
+
* regarding floating labels, helper text, error states, and icons.
|
|
33
|
+
*
|
|
34
|
+
* **Character Counter:**
|
|
35
|
+
* If the `maxlength` attribute is set, the textarea automatically displays
|
|
36
|
+
* a character counter (`{current length} / {maxlength}`) positioned at the
|
|
37
|
+
* trailing edge of the supporting text area (bottom right). This can be
|
|
38
|
+
* suppressed by setting the `no-counter` attribute.
|
|
39
|
+
*
|
|
40
|
+
* **State management:**
|
|
41
|
+
* This component is purely visual and presentational. It reflects attributes
|
|
42
|
+
* down to the native textarea, but it does NOT attach internal `@input` or
|
|
43
|
+
* `@change` listeners. Consumers should attach standard DOM listeners directly
|
|
44
|
+
* to this element to capture user input, just as they would with a native
|
|
45
|
+
* textarea.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```html
|
|
49
|
+
* <!-- Standard filled textarea -->
|
|
50
|
+
* <moni-textarea label="Description" rows="4"></moni-textarea>
|
|
17
51
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
52
|
+
* <!-- Outlined textarea with character counter -->
|
|
53
|
+
* <moni-textarea
|
|
54
|
+
* variant="outlined"
|
|
55
|
+
* label="Bio"
|
|
56
|
+
* maxlength="160"
|
|
57
|
+
* ></moni-textarea>
|
|
58
|
+
* ```
|
|
22
59
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* - prefix: short text rendered before the input (e.g. "https://")
|
|
29
|
-
* - suffix: short text rendered after the input (e.g. ".com")
|
|
30
|
-
* - loading: present → shows indeterminate circular progress
|
|
31
|
-
* - rows: native textarea rows attribute (default 3)
|
|
32
|
-
* - maxlength: when set, displays a character counter
|
|
33
|
-
* (auto-shown; can be hidden via `no-counter`)
|
|
34
|
-
* - no-counter: suppress the character counter even when maxlength is set
|
|
60
|
+
* @csspart field - The outer `.field` div container.
|
|
61
|
+
* @csspart input - The native `<textarea>` element.
|
|
62
|
+
* @csspart label - The floating `<label>` element.
|
|
63
|
+
* @csspart helper - The helper/error text area.
|
|
64
|
+
* @csspart counter - The character counter element.
|
|
35
65
|
*/
|
|
36
66
|
let MoniTextarea = class MoniTextarea extends MoniElement {
|
|
37
67
|
constructor() {
|
|
@@ -1,20 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-time-picker.ts
|
|
3
|
+
* @package @moni-labs/moni-ui
|
|
4
|
+
* @license MIT
|
|
5
|
+
* @contributors Moni Labs & Contributors
|
|
6
|
+
*/
|
|
1
7
|
import { PropertyValues } from 'lit';
|
|
2
8
|
import { MoniElement } from './_base/index.js';
|
|
3
9
|
import './moni-icon.js';
|
|
4
10
|
import './moni-button.js';
|
|
5
11
|
/**
|
|
6
|
-
* Material Design 3 Time Picker
|
|
7
|
-
*
|
|
12
|
+
* Material Design 3 Time Picker component.
|
|
13
|
+
*
|
|
14
|
+
* A highly interactive control that allows users to select a specific time.
|
|
15
|
+
* It provides two distinct input modes:
|
|
16
|
+
* 1. **Dial mode:** An interactive clock face where users can drag or click
|
|
17
|
+
* to select hours and minutes.
|
|
18
|
+
* 2. **Input mode:** Standard text inputs for precise keyboard entry.
|
|
19
|
+
*
|
|
20
|
+
* **M3 spec reference:** `m3-docs/components/time-pickers/specs.md`
|
|
21
|
+
*
|
|
22
|
+
* **Time formats & modes:**
|
|
23
|
+
* - The `value` property expects and always outputs a 24-hour formatted string
|
|
24
|
+
* (`HH:MM`, e.g., `"14:30"`).
|
|
25
|
+
* - Setting `use-24-hour` configures the visual presentation to use a 24-hour
|
|
26
|
+
* clock dial (inner and outer rings) and removes the AM/PM toggle. Otherwise,
|
|
27
|
+
* it uses a standard 12-hour dial with an AM/PM toggle.
|
|
28
|
+
*
|
|
29
|
+
* **Responsive design:**
|
|
30
|
+
* The `orientation` attribute configures the layout. `vertical` stacks the
|
|
31
|
+
* time display above the clock face, `horizontal` places them side-by-side,
|
|
32
|
+
* and `auto` responds to the container/viewport width automatically.
|
|
33
|
+
*
|
|
34
|
+
* @fires change - Fired when the selected time changes interactively. The
|
|
35
|
+
* `detail.value` contains the new time in `HH:MM` format.
|
|
36
|
+
* @fires cancel - Fired when the 'Cancel' button is clicked.
|
|
37
|
+
* @fires ok - Fired when the 'OK' button is clicked. The `detail.value`
|
|
38
|
+
* contains the final confirmed time.
|
|
8
39
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```html
|
|
42
|
+
* <!-- 12-hour format (AM/PM) -->
|
|
43
|
+
* <moni-time-picker value="14:30"></moni-time-picker>
|
|
13
44
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* - ok: Fired when OK button is clicked (detail: { value })
|
|
45
|
+
* <!-- 24-hour format -->
|
|
46
|
+
* <moni-time-picker use-24-hour value="14:30"></moni-time-picker>
|
|
47
|
+
* ```
|
|
18
48
|
*/
|
|
19
49
|
export declare class MoniTimePicker extends MoniElement {
|
|
20
50
|
value: string;
|
|
@@ -40,7 +70,7 @@ export declare class MoniTimePicker extends MoniElement {
|
|
|
40
70
|
private handleMinuteInputChange;
|
|
41
71
|
static styles: import("lit").CSSResult[];
|
|
42
72
|
private renderDialClockFace;
|
|
43
|
-
render(): import("lit
|
|
73
|
+
render(): import("lit").TemplateResult<1>;
|
|
44
74
|
}
|
|
45
75
|
declare global {
|
|
46
76
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moni-time-picker.d.ts","sourceRoot":"","sources":["../../src/components/moni-time-picker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AACxB,OAAO,kBAAkB,CAAC;AAE1B
|
|
1
|
+
{"version":3,"file":"moni-time-picker.d.ts","sourceRoot":"","sources":["../../src/components/moni-time-picker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AACxB,OAAO,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBACa,cAAe,SAAQ,WAAW;IACjB,KAAK,SAAW;IACyB,SAAS,UAAS;IAC3D,IAAI,EAAE,MAAM,GAAG,OAAO,CAAU;IAChC,WAAW,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAAU;IAE7E,OAAO,CAAC,eAAe,CAA6B;IACpD,OAAO,CAAC,MAAM,CAAqB;IAEnC,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,aAAa,CAAK;IAEb,OAAO,CAAC,WAAW,CAAC,CAAiB;IAE3D,OAAO,CAAC,UAAU,CAAS;cAER,UAAU,CAAC,iBAAiB,EAAE,cAAc;IAM/D,OAAO,CAAC,UAAU;IAoBlB,OAAO,CAAC,WAAW;IAwBnB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,sBAAsB;IA2C9B,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,qBAAqB;IAiB7B,OAAO,CAAC,uBAAuB;IAY/B,OAAgB,MAAM,4BAqXpB;IAEF,OAAO,CAAC,mBAAmB;IAwIlB,MAAM;CAsFf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,kBAAkB,EAAE,cAAc,CAAC;KACnC;CACD;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-time-picker.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);
|
|
@@ -10,18 +16,42 @@ import { MoniElement, sharedStyles } from './_base/index.js';
|
|
|
10
16
|
import './moni-icon.js';
|
|
11
17
|
import './moni-button.js';
|
|
12
18
|
/**
|
|
13
|
-
* Material Design 3 Time Picker
|
|
14
|
-
*
|
|
19
|
+
* Material Design 3 Time Picker component.
|
|
20
|
+
*
|
|
21
|
+
* A highly interactive control that allows users to select a specific time.
|
|
22
|
+
* It provides two distinct input modes:
|
|
23
|
+
* 1. **Dial mode:** An interactive clock face where users can drag or click
|
|
24
|
+
* to select hours and minutes.
|
|
25
|
+
* 2. **Input mode:** Standard text inputs for precise keyboard entry.
|
|
26
|
+
*
|
|
27
|
+
* **M3 spec reference:** `m3-docs/components/time-pickers/specs.md`
|
|
28
|
+
*
|
|
29
|
+
* **Time formats & modes:**
|
|
30
|
+
* - The `value` property expects and always outputs a 24-hour formatted string
|
|
31
|
+
* (`HH:MM`, e.g., `"14:30"`).
|
|
32
|
+
* - Setting `use-24-hour` configures the visual presentation to use a 24-hour
|
|
33
|
+
* clock dial (inner and outer rings) and removes the AM/PM toggle. Otherwise,
|
|
34
|
+
* it uses a standard 12-hour dial with an AM/PM toggle.
|
|
35
|
+
*
|
|
36
|
+
* **Responsive design:**
|
|
37
|
+
* The `orientation` attribute configures the layout. `vertical` stacks the
|
|
38
|
+
* time display above the clock face, `horizontal` places them side-by-side,
|
|
39
|
+
* and `auto` responds to the container/viewport width automatically.
|
|
40
|
+
*
|
|
41
|
+
* @fires change - Fired when the selected time changes interactively. The
|
|
42
|
+
* `detail.value` contains the new time in `HH:MM` format.
|
|
43
|
+
* @fires cancel - Fired when the 'Cancel' button is clicked.
|
|
44
|
+
* @fires ok - Fired when the 'OK' button is clicked. The `detail.value`
|
|
45
|
+
* contains the final confirmed time.
|
|
15
46
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```html
|
|
49
|
+
* <!-- 12-hour format (AM/PM) -->
|
|
50
|
+
* <moni-time-picker value="14:30"></moni-time-picker>
|
|
20
51
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* - ok: Fired when OK button is clicked (detail: { value })
|
|
52
|
+
* <!-- 24-hour format -->
|
|
53
|
+
* <moni-time-picker use-24-hour value="14:30"></moni-time-picker>
|
|
54
|
+
* ```
|
|
25
55
|
*/
|
|
26
56
|
let MoniTimePicker = class MoniTimePicker extends MoniElement {
|
|
27
57
|
constructor() {
|
|
@@ -1,30 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-toolbar.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
|
|
9
|
+
* Material Design 3 Top App Bar (Toolbar) component.
|
|
10
|
+
*
|
|
11
|
+
* Top app bars display information and actions at the top of a screen.
|
|
12
|
+
* They are used for branding, screen titles, navigation, and actions.
|
|
13
|
+
*
|
|
14
|
+
* **M3 spec reference:** `m3-docs/components/top-app-bar/specs.md`
|
|
15
|
+
*
|
|
16
|
+
* **Note:** This is the standard top-level toolbar. For bottom navigation
|
|
17
|
+
* bars (often used on mobile), use `<moni-app-bar>`.
|
|
18
|
+
*
|
|
19
|
+
* **Variants:**
|
|
20
|
+
* - `standard` (default): A full-width bar (64dp height) that sits flush
|
|
21
|
+
* against the top of the screen.
|
|
22
|
+
* - `floating`: A detached bar with a 4dp margin and rounded 8dp corners,
|
|
23
|
+
* appearing to float above the content.
|
|
4
24
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
25
|
+
* **Scroll behavior:**
|
|
26
|
+
* When the `scroll` attribute is present, the toolbar visually responds to
|
|
27
|
+
* scrolling by increasing its elevation (shadow) and dynamically shifting
|
|
28
|
+
* its surface color to indicate depth over the scrolling content.
|
|
7
29
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```html
|
|
32
|
+
* <!-- Standard toolbar with navigation and actions -->
|
|
33
|
+
* <moni-toolbar title="Inbox">
|
|
34
|
+
* <moni-icon-button slot="leading" icon="menu"></moni-icon-button>
|
|
35
|
+
* <moni-icon-button slot="trailing" icon="search"></moni-icon-button>
|
|
36
|
+
* <moni-icon-button slot="trailing" icon="more_vert"></moni-icon-button>
|
|
37
|
+
* </moni-toolbar>
|
|
11
38
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
39
|
+
* <!-- Floating toolbar with an attached FAB -->
|
|
40
|
+
* <moni-toolbar type="floating" title="Notes">
|
|
41
|
+
* <moni-fab slot="action-button" icon="add"></moni-fab>
|
|
42
|
+
* </moni-toolbar>
|
|
43
|
+
* ```
|
|
17
44
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
45
|
+
* @slot default - The title text or center content.
|
|
46
|
+
* @slot leading - Navigation icon/button placed on the far left.
|
|
47
|
+
* @slot trailing - Action icons/buttons placed on the far right.
|
|
48
|
+
* @slot action-button - A floating action button (FAB) anchored to the right side.
|
|
21
49
|
*/
|
|
22
50
|
export declare class MoniToolbar extends MoniElement {
|
|
23
51
|
type: 'standard' | 'floating';
|
|
24
52
|
scrolled: boolean;
|
|
25
53
|
title: string;
|
|
26
54
|
static styles: import("lit").CSSResult[];
|
|
27
|
-
render(): import("lit
|
|
55
|
+
render(): import("lit").TemplateResult<1>;
|
|
28
56
|
}
|
|
29
57
|
declare global {
|
|
30
58
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moni-toolbar.d.ts","sourceRoot":"","sources":["../../src/components/moni-toolbar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"moni-toolbar.d.ts","sourceRoot":"","sources":["../../src/components/moni-toolbar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBACa,WAAY,SAAQ,WAAW;IAE3C,IAAI,EAAE,UAAU,GAAG,UAAU,CAAc;IAE3C,QAAQ,UAAS;IACY,KAAK,SAAM;IAExC,OAAgB,MAAM,4BA8DpB;IAEO,MAAM;CAcf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,WAAW,CAAC;KAC5B;CACD;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-toolbar.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,24 +14,46 @@ import { html, css } 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
|
|
17
|
+
* Material Design 3 Top App Bar (Toolbar) component.
|
|
18
|
+
*
|
|
19
|
+
* Top app bars display information and actions at the top of a screen.
|
|
20
|
+
* They are used for branding, screen titles, navigation, and actions.
|
|
21
|
+
*
|
|
22
|
+
* **M3 spec reference:** `m3-docs/components/top-app-bar/specs.md`
|
|
23
|
+
*
|
|
24
|
+
* **Note:** This is the standard top-level toolbar. For bottom navigation
|
|
25
|
+
* bars (often used on mobile), use `<moni-app-bar>`.
|
|
26
|
+
*
|
|
27
|
+
* **Variants:**
|
|
28
|
+
* - `standard` (default): A full-width bar (64dp height) that sits flush
|
|
29
|
+
* against the top of the screen.
|
|
30
|
+
* - `floating`: A detached bar with a 4dp margin and rounded 8dp corners,
|
|
31
|
+
* appearing to float above the content.
|
|
12
32
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
33
|
+
* **Scroll behavior:**
|
|
34
|
+
* When the `scroll` attribute is present, the toolbar visually responds to
|
|
35
|
+
* scrolling by increasing its elevation (shadow) and dynamically shifting
|
|
36
|
+
* its surface color to indicate depth over the scrolling content.
|
|
15
37
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```html
|
|
40
|
+
* <!-- Standard toolbar with navigation and actions -->
|
|
41
|
+
* <moni-toolbar title="Inbox">
|
|
42
|
+
* <moni-icon-button slot="leading" icon="menu"></moni-icon-button>
|
|
43
|
+
* <moni-icon-button slot="trailing" icon="search"></moni-icon-button>
|
|
44
|
+
* <moni-icon-button slot="trailing" icon="more_vert"></moni-icon-button>
|
|
45
|
+
* </moni-toolbar>
|
|
19
46
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
47
|
+
* <!-- Floating toolbar with an attached FAB -->
|
|
48
|
+
* <moni-toolbar type="floating" title="Notes">
|
|
49
|
+
* <moni-fab slot="action-button" icon="add"></moni-fab>
|
|
50
|
+
* </moni-toolbar>
|
|
51
|
+
* ```
|
|
25
52
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
53
|
+
* @slot default - The title text or center content.
|
|
54
|
+
* @slot leading - Navigation icon/button placed on the far left.
|
|
55
|
+
* @slot trailing - Action icons/buttons placed on the far right.
|
|
56
|
+
* @slot action-button - A floating action button (FAB) anchored to the right side.
|
|
29
57
|
*/
|
|
30
58
|
let MoniToolbar = class MoniToolbar extends MoniElement {
|
|
31
59
|
constructor() {
|
|
@@ -1,33 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-tooltip.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
|
-
*
|
|
4
|
-
*
|
|
9
|
+
* Material Design 3 Tooltip component.
|
|
10
|
+
*
|
|
11
|
+
* Tooltips provide contextual text labels or rich content that appear when
|
|
12
|
+
* users hover over, focus on, or tap an element. They surface supplementary
|
|
13
|
+
* information that helps users understand interface elements without
|
|
14
|
+
* permanently occupying screen space.
|
|
15
|
+
*
|
|
16
|
+
* **M3 spec reference:** `m3-docs/components/tooltips/specs.md`
|
|
17
|
+
*
|
|
18
|
+
* **Types:**
|
|
19
|
+
* - **Plain** (default) — Text-only label for simple descriptions (max 1 line).
|
|
20
|
+
* - **Rich** (`rich` attribute) — HTML content including formatted text,
|
|
21
|
+
* links, and icons. Rich tooltips can contain multiple lines and action links.
|
|
22
|
+
*
|
|
23
|
+
* **Placements:**
|
|
24
|
+
* - `top` (default), `top-start`, `top-end`
|
|
25
|
+
* - `bottom`, `bottom-start`, `bottom-end`
|
|
26
|
+
*
|
|
27
|
+
* **Trigger mechanism:**
|
|
28
|
+
* The tooltip uses `position: absolute` inside the parent element. The parent
|
|
29
|
+
* must have `position: relative` (set automatically via `connectedCallback`).
|
|
30
|
+
* Hover/focus events on the parent trigger the tooltip's CSS `:hover` and
|
|
31
|
+
* `:focus-within` selectors, which drive the show/hide transition.
|
|
32
|
+
*
|
|
33
|
+
* **Accessibility:**
|
|
34
|
+
* - The tooltip has `role="tooltip"`.
|
|
35
|
+
* - For keyboard accessibility, the parent should have `aria-describedby`
|
|
36
|
+
* pointing to the tooltip's `id` attribute. The component exposes a
|
|
37
|
+
* `tooltipId` getter for this purpose.
|
|
38
|
+
* - The `Escape` key closes rich tooltips.
|
|
5
39
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```html
|
|
42
|
+
* <!-- Plain tooltip -->
|
|
43
|
+
* <button aria-describedby="save-tip">
|
|
44
|
+
* Save
|
|
45
|
+
* <moni-tooltip id="save-tip" text="Ctrl+S"></moni-tooltip>
|
|
46
|
+
* </button>
|
|
11
47
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
48
|
+
* <!-- Rich tooltip -->
|
|
49
|
+
* <button>
|
|
50
|
+
* Filter
|
|
51
|
+
* <moni-tooltip rich position="bottom">
|
|
52
|
+
* <strong>Filter by date</strong>
|
|
53
|
+
* <p>Select a date range to filter results.</p>
|
|
54
|
+
* </moni-tooltip>
|
|
55
|
+
* </button>
|
|
56
|
+
* ```
|
|
15
57
|
*
|
|
16
|
-
*
|
|
17
|
-
* - The tooltip has `role="tooltip"` (M3 spec).
|
|
18
|
-
* - When `rich` content is used, the parent should also have
|
|
19
|
-
* `aria-describedby="<tooltip-id>"`. The component sets a unique `id` on
|
|
20
|
-
* the tooltip element and exposes it via `tooltipId` getter.
|
|
21
|
-
* - `Escape` closes the tooltip (WAI-ARIA tooltip pattern).
|
|
58
|
+
* @slot default - Rich content for the tooltip body (only used when `rich=true`).
|
|
22
59
|
*
|
|
23
|
-
*
|
|
24
|
-
* - text: tooltip text (plain tooltip)
|
|
25
|
-
* - position: top (default) | top-start | top-end | bottom | bottom-start | bottom-end
|
|
26
|
-
* - size: '' (default) | small | medium | large
|
|
27
|
-
* - rich: boolean — when true, the default slot accepts arbitrary HTML
|
|
28
|
-
* for rich content (links, icons, etc.). When false (default),
|
|
29
|
-
* the slot is rendered as text only.
|
|
30
|
-
* - id: forwarded to the tooltip element (useful for aria-describedby)
|
|
60
|
+
* @csspart tooltip - The tooltip container element.
|
|
31
61
|
*/
|
|
32
62
|
export declare class MoniTooltip extends MoniElement {
|
|
33
63
|
text: string;
|
|
@@ -54,7 +84,7 @@ export declare class MoniTooltip extends MoniElement {
|
|
|
54
84
|
*/
|
|
55
85
|
get tooltipId(): string;
|
|
56
86
|
static styles: import("lit").CSSResult[];
|
|
57
|
-
render(): import("lit
|
|
87
|
+
render(): import("lit").TemplateResult<1>;
|
|
58
88
|
}
|
|
59
89
|
declare global {
|
|
60
90
|
interface HTMLElementTagNameMap {
|