@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-select-option.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,14 +14,42 @@ 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
|
-
*
|
|
17
|
+
* Material Design 3 Select Option component.
|
|
18
|
+
*
|
|
19
|
+
* An individual selectable item designed to be placed inside a
|
|
20
|
+
* `<moni-select>` dropdown.
|
|
21
|
+
*
|
|
22
|
+
* **Interaction and layout:**
|
|
23
|
+
* Options are rendered as accessible `<li>` elements styled identically to
|
|
24
|
+
* `<moni-menu-item>`. When slotted into a `<moni-select>`, the parent
|
|
25
|
+
* component extracts their `value`, `label`, and `group` attributes to build
|
|
26
|
+
* its internal data model and handles the actual selection logic, keyboard
|
|
27
|
+
* navigation, and rendering within the dropdown popup.
|
|
28
|
+
*
|
|
29
|
+
* **Grouping:**
|
|
30
|
+
* Options can be categorized into subcategories by providing a `group`
|
|
31
|
+
* attribute. The parent `<moni-select>` uses this to automatically generate
|
|
32
|
+
* group headers (`<moni-select-group>`) in the dropdown list.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```html
|
|
36
|
+
* <moni-select label="Favorite framework">
|
|
37
|
+
* <!-- Standard option -->
|
|
38
|
+
* <moni-select-option value="lit">Lit Element</moni-select-option>
|
|
39
|
+
*
|
|
40
|
+
* <!-- Disabled option -->
|
|
41
|
+
* <moni-select-option value="react" disabled>React (not allowed)</moni-select-option>
|
|
42
|
+
*
|
|
43
|
+
* <!-- Grouped option -->
|
|
44
|
+
* <moni-select-option value="vue" group="Other">Vue.js</moni-select-option>
|
|
45
|
+
* </moni-select>
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @slot default - The text label for the option. If the `label` attribute is
|
|
49
|
+
* omitted, the parent `<moni-select>` will read this slot's
|
|
50
|
+
* `textContent`.
|
|
12
51
|
*
|
|
13
|
-
*
|
|
14
|
-
* - value: string value of the option
|
|
15
|
-
* - label: text label (uses textContent or slot if empty)
|
|
16
|
-
* - group: subcategory group/category name
|
|
17
|
-
* - selected: present -> active highlight state
|
|
18
|
-
* - disabled: present -> disabled
|
|
52
|
+
* @csspart item - The outer `<li>` element.
|
|
19
53
|
*/
|
|
20
54
|
let MoniSelectOption = class MoniSelectOption extends MoniElement {
|
|
21
55
|
constructor() {
|
|
@@ -1,9 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-select.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
|
import './moni-select-option.js';
|
|
5
11
|
/**
|
|
6
|
-
*
|
|
12
|
+
* Material Design 3 Select (Dropdown) component.
|
|
13
|
+
*
|
|
14
|
+
* A fully-featured custom select dropdown with searchability, option groups,
|
|
15
|
+
* keyboard navigation, animation, and optional mobile drawer/sheet mode.
|
|
16
|
+
* Replaces the native `<select>` element with a fully styled, accessible
|
|
17
|
+
* M3-compliant alternative.
|
|
18
|
+
*
|
|
19
|
+
* **M3 spec reference:** `m3-docs/components/menus/specs.md` (dropdown menus)
|
|
20
|
+
*
|
|
21
|
+
* **Feature summary:**
|
|
22
|
+
* - Filled and outlined variants matching the M3 text field styles.
|
|
23
|
+
* - Floating label with the standard field-styles floating label animation.
|
|
24
|
+
* - Searchable mode: `searchable` attribute adds an inline filter input.
|
|
25
|
+
* - Option groups: slot `<moni-select-group>` elements for hierarchical options.
|
|
26
|
+
* - Mobile drawer: `drawer` attribute opens options in a `<moni-bottom-sheet>`
|
|
27
|
+
* instead of a dropdown popup, ideal for touch UIs.
|
|
28
|
+
* - Keyboard navigation: Arrow keys, Enter, Escape, and Tab per ARIA combobox.
|
|
29
|
+
* - Loading state: `loading` shows an indeterminate circular progress.
|
|
30
|
+
* - Multi-value support: `multiple` enables multiple selection.
|
|
31
|
+
*
|
|
32
|
+
* **Option sources:**
|
|
33
|
+
* Options can be provided in two ways:
|
|
34
|
+
* 1. **Slotted `<moni-select-option>` elements** (default, recommended for SSR).
|
|
35
|
+
* 2. **`options` property** — a `DropdownNode[]` array for fully programmatic control.
|
|
36
|
+
*
|
|
37
|
+
* **Value binding:**
|
|
38
|
+
* The `value` property holds the currently selected option's value string.
|
|
39
|
+
* For multiple selection, `values` holds `string[]`. On change, a composed
|
|
40
|
+
* `'change'` event is fired.
|
|
41
|
+
*
|
|
42
|
+
* @fires change - Bubbles and is composed. Fired when the selected value changes.
|
|
43
|
+
* Read `element.value` (or `element.values` for `multiple`).
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```html
|
|
47
|
+
* <moni-select label="Country" name="country" variant="outlined">
|
|
48
|
+
* <moni-select-option value="us">United States</moni-select-option>
|
|
49
|
+
* <moni-select-option value="gb">United Kingdom</moni-select-option>
|
|
50
|
+
* <moni-select-option value="de">Germany</moni-select-option>
|
|
51
|
+
* </moni-select>
|
|
52
|
+
*
|
|
53
|
+
* <!-- Searchable select -->
|
|
54
|
+
* <moni-select label="Language" searchable>
|
|
55
|
+
* <moni-select-option value="ts">TypeScript</moni-select-option>
|
|
56
|
+
* <moni-select-option value="py">Python</moni-select-option>
|
|
57
|
+
* </moni-select>
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @slot default - `<moni-select-option>` or `<moni-select-group>` children.
|
|
61
|
+
*
|
|
62
|
+
* @csspart field - The outer `.field` div container.
|
|
63
|
+
* @csspart dropdown - The floating option list container.
|
|
7
64
|
*/
|
|
8
65
|
export declare class MoniSelect extends MoniElement {
|
|
9
66
|
name: string;
|
|
@@ -65,7 +122,7 @@ export declare class MoniSelect extends MoniElement {
|
|
|
65
122
|
private _renderSubcategoryList;
|
|
66
123
|
private _renderDesktopNode;
|
|
67
124
|
private _renderOptionsList;
|
|
68
|
-
render(): import("lit
|
|
125
|
+
render(): import("lit").TemplateResult<1>;
|
|
69
126
|
}
|
|
70
127
|
declare global {
|
|
71
128
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moni-select.d.ts","sourceRoot":"","sources":["../../src/components/moni-select.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"moni-select.d.ts","sourceRoot":"","sources":["../../src/components/moni-select.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,WAAW,EAA6B,MAAM,kBAAkB,CAAC;AAC1E,OAAO,gBAAgB,CAAC;AACxB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,yBAAyB,CAAC;AAuCjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,qBACa,UAAW,SAAQ,WAAW;IACb,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;IACR,QAAQ,UAAS;IACjB,OAAO,UAAS;IAC/B,MAAM,SAAM;IACa,SAAS,SAAM;IACzB,KAAK,UAAS;IAC7B,KAAK,SAAM;IACX,IAAI,SAAM;IACkB,YAAY,SAClD;IACyB,UAAU,UAAS;IACnB,SAAS,UAAS;IAClB,KAAK,UAAS;IAC7B,WAAW,SAAM;IACjB,WAAW,EAAE,UAAU,GAAG,OAAO,CAAc;IAC/C,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAU;IACpC,aAAa,SAAa;IAE3E,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,gBAAgB,CAAiD;IACzE,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,cAAc,CAAmB;IAEnC,OAAO,CAAC,KAAK,CAAmB;IAC/B,OAAO,CAAC,MAAM,CAAoB;IAElD,OAAgB,MAAM,4BAmUpB;IAEO,iBAAiB;IAOjB,oBAAoB;IAOpB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC;IAa1E,OAAO,CAAC,oBAAoB;IAoB5B,OAAO,CAAC,mBAAmB,CAIzB;IAEF,OAAO,CAAC,yBAAyB;IAgDjC,OAAO,CAAC,aAAa,CAKnB;IAEF,OAAO,CAAC,aAAa,CAKnB;IAEF,OAAO,CAAC,mBAAmB;IAwD3B,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,aAAa;IAqDrB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,aAAa;IAkCrB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,cAAc;IAsBtB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,UAAU;IAkClB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,eAAe;IA0BvB,OAAO,CAAC,sBAAsB;IAoC9B,OAAO,CAAC,kBAAkB;IA+B1B,OAAO,CAAC,kBAAkB;IAsDjB,MAAM;CA6Hf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,aAAa,EAAE,UAAU,CAAC;KAC1B;CACD;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-select.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);
|
|
@@ -13,7 +19,58 @@ import './moni-icon.js';
|
|
|
13
19
|
import './moni-progress.js';
|
|
14
20
|
import './moni-select-option.js';
|
|
15
21
|
/**
|
|
16
|
-
*
|
|
22
|
+
* Material Design 3 Select (Dropdown) component.
|
|
23
|
+
*
|
|
24
|
+
* A fully-featured custom select dropdown with searchability, option groups,
|
|
25
|
+
* keyboard navigation, animation, and optional mobile drawer/sheet mode.
|
|
26
|
+
* Replaces the native `<select>` element with a fully styled, accessible
|
|
27
|
+
* M3-compliant alternative.
|
|
28
|
+
*
|
|
29
|
+
* **M3 spec reference:** `m3-docs/components/menus/specs.md` (dropdown menus)
|
|
30
|
+
*
|
|
31
|
+
* **Feature summary:**
|
|
32
|
+
* - Filled and outlined variants matching the M3 text field styles.
|
|
33
|
+
* - Floating label with the standard field-styles floating label animation.
|
|
34
|
+
* - Searchable mode: `searchable` attribute adds an inline filter input.
|
|
35
|
+
* - Option groups: slot `<moni-select-group>` elements for hierarchical options.
|
|
36
|
+
* - Mobile drawer: `drawer` attribute opens options in a `<moni-bottom-sheet>`
|
|
37
|
+
* instead of a dropdown popup, ideal for touch UIs.
|
|
38
|
+
* - Keyboard navigation: Arrow keys, Enter, Escape, and Tab per ARIA combobox.
|
|
39
|
+
* - Loading state: `loading` shows an indeterminate circular progress.
|
|
40
|
+
* - Multi-value support: `multiple` enables multiple selection.
|
|
41
|
+
*
|
|
42
|
+
* **Option sources:**
|
|
43
|
+
* Options can be provided in two ways:
|
|
44
|
+
* 1. **Slotted `<moni-select-option>` elements** (default, recommended for SSR).
|
|
45
|
+
* 2. **`options` property** — a `DropdownNode[]` array for fully programmatic control.
|
|
46
|
+
*
|
|
47
|
+
* **Value binding:**
|
|
48
|
+
* The `value` property holds the currently selected option's value string.
|
|
49
|
+
* For multiple selection, `values` holds `string[]`. On change, a composed
|
|
50
|
+
* `'change'` event is fired.
|
|
51
|
+
*
|
|
52
|
+
* @fires change - Bubbles and is composed. Fired when the selected value changes.
|
|
53
|
+
* Read `element.value` (or `element.values` for `multiple`).
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```html
|
|
57
|
+
* <moni-select label="Country" name="country" variant="outlined">
|
|
58
|
+
* <moni-select-option value="us">United States</moni-select-option>
|
|
59
|
+
* <moni-select-option value="gb">United Kingdom</moni-select-option>
|
|
60
|
+
* <moni-select-option value="de">Germany</moni-select-option>
|
|
61
|
+
* </moni-select>
|
|
62
|
+
*
|
|
63
|
+
* <!-- Searchable select -->
|
|
64
|
+
* <moni-select label="Language" searchable>
|
|
65
|
+
* <moni-select-option value="ts">TypeScript</moni-select-option>
|
|
66
|
+
* <moni-select-option value="py">Python</moni-select-option>
|
|
67
|
+
* </moni-select>
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @slot default - `<moni-select-option>` or `<moni-select-group>` children.
|
|
71
|
+
*
|
|
72
|
+
* @csspart field - The outer `.field` div container.
|
|
73
|
+
* @csspart dropdown - The floating option list container.
|
|
17
74
|
*/
|
|
18
75
|
let MoniSelect = class MoniSelect extends MoniElement {
|
|
19
76
|
constructor() {
|
|
@@ -19,7 +19,7 @@ export declare class MoniShape extends MoniElement {
|
|
|
19
19
|
shapeRadius: string;
|
|
20
20
|
color: 'primary' | 'secondary' | 'tertiary' | 'surface';
|
|
21
21
|
static styles: import("lit").CSSResult[];
|
|
22
|
-
render(): import("lit
|
|
22
|
+
render(): import("lit").TemplateResult<1>;
|
|
23
23
|
}
|
|
24
24
|
declare global {
|
|
25
25
|
interface HTMLElementTagNameMap {
|
|
@@ -1,26 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-side-sheet.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 Side Sheet
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
12
|
+
* Material Design 3 Side Sheet component.
|
|
13
|
+
*
|
|
14
|
+
* Side sheets show supplementary content that is anchored to the left or right
|
|
15
|
+
* edge of the screen. They can be standard (inline with content) or modal
|
|
16
|
+
* (overlaying content with a scrim).
|
|
17
|
+
*
|
|
18
|
+
* **M3 spec reference:** `m3-docs/components/side-sheets/specs.md`
|
|
19
|
+
*
|
|
20
|
+
* **Dialog behavior:**
|
|
21
|
+
* Internally, this component uses the native HTML `<dialog>` element for robust
|
|
22
|
+
* accessibility, focus trapping, and top-layer rendering.
|
|
23
|
+
* - When `modal=true`, the sheet uses `dialog.showModal()`, rendering a scrim
|
|
24
|
+
* backdrop and trapping focus. Pressing `Escape` closes it.
|
|
25
|
+
* - When `modal=false`, the sheet uses `dialog.show()` and remains interactive
|
|
26
|
+
* alongside the main page content.
|
|
27
|
+
*
|
|
28
|
+
* **Drag & Resize (Moni feature):**
|
|
29
|
+
* Setting the `with-handle` attribute adds a draggable grab handle to the inner
|
|
30
|
+
* edge of the sheet. Users can click and drag this handle to resize the sheet's
|
|
31
|
+
* width up to the `max-width` limit. If the user drags the sheet towards the
|
|
32
|
+
* screen edge quickly or beyond a certain threshold, it automatically closes.
|
|
33
|
+
*
|
|
34
|
+
* **Animations:**
|
|
35
|
+
* Side sheets slide in from the specified `side` (`left` or `right`). The open
|
|
36
|
+
* and close animations are handled via CSS transitions tied to the `open` property.
|
|
37
|
+
*
|
|
38
|
+
* @fires close - Fired when the side sheet is completely closed (after animations
|
|
39
|
+
* finish), either via the close button, scrim click, drag-to-close,
|
|
40
|
+
* or `Escape` key.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```html
|
|
44
|
+
* <!-- Modal side sheet on the right -->
|
|
45
|
+
* <moni-side-sheet id="details-sheet" modal title="Item Details">
|
|
46
|
+
* <p>Here is more information about the selected item.</p>
|
|
47
|
+
* <div slot="footer">
|
|
48
|
+
* <moni-button>Save</moni-button>
|
|
49
|
+
* </div>
|
|
50
|
+
* </moni-side-sheet>
|
|
51
|
+
*
|
|
52
|
+
* <!-- Resizable, detached side sheet on the left -->
|
|
53
|
+
* <moni-side-sheet side="left" detached with-handle max-width="50vw">
|
|
54
|
+
* <p>Navigation options</p>
|
|
55
|
+
* </moni-side-sheet>
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @slot default - Main body content.
|
|
59
|
+
* @slot header - Custom header content (overrides `title`, close/back buttons remain).
|
|
60
|
+
* @slot footer - Bottom-anchored action area.
|
|
24
61
|
*/
|
|
25
62
|
export declare class MoniSideSheet extends MoniElement {
|
|
26
63
|
open: boolean;
|
|
@@ -51,7 +88,7 @@ export declare class MoniSideSheet extends MoniElement {
|
|
|
51
88
|
private _onBackClick;
|
|
52
89
|
private _onDialogClick;
|
|
53
90
|
static styles: import("lit").CSSResult[];
|
|
54
|
-
render(): import("lit
|
|
91
|
+
render(): import("lit").TemplateResult<1>;
|
|
55
92
|
}
|
|
56
93
|
declare global {
|
|
57
94
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moni-side-sheet.d.ts","sourceRoot":"","sources":["../../src/components/moni-side-sheet.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-side-sheet.d.ts","sourceRoot":"","sources":["../../src/components/moni-side-sheet.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,qBACa,aAAc,SAAQ,WAAW;IACD,IAAI,UAAS;IACb,KAAK,UAAS;IAC7B,IAAI,EAAE,OAAO,GAAG,MAAM,CAAW;IACjC,KAAK,SAAM;IACI,QAAQ,UAAS;IACO,QAAQ,UAAS;IACjB,QAAQ,UAAS;IACf,UAAU,UAAS;IACpB,SAAS,UAAS;IAC7B,aAAa,SAAW;IAC7B,QAAQ,SAAM;IAElD,OAAO,CAAC,OAAO,CAAqB;IAErD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,oBAAoB,CAAK;IACjC,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,cAAc;IAcb,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAyDlD,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,cAAc;IAkCtB,OAAO,CAAC,YAAY;IAiFpB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,cAAc;IAUtB,OAAgB,MAAM,4BAgMpB;IAEO,MAAM;CA0Df;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,iBAAiB,EAAE,aAAa,CAAC;KACjC;CACD;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-side-sheet.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,24 +16,55 @@ 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 Side Sheet
|
|
14
|
-
*
|
|
19
|
+
* Material Design 3 Side Sheet component.
|
|
20
|
+
*
|
|
21
|
+
* Side sheets show supplementary content that is anchored to the left or right
|
|
22
|
+
* edge of the screen. They can be standard (inline with content) or modal
|
|
23
|
+
* (overlaying content with a scrim).
|
|
24
|
+
*
|
|
25
|
+
* **M3 spec reference:** `m3-docs/components/side-sheets/specs.md`
|
|
26
|
+
*
|
|
27
|
+
* **Dialog behavior:**
|
|
28
|
+
* Internally, this component uses the native HTML `<dialog>` element for robust
|
|
29
|
+
* accessibility, focus trapping, and top-layer rendering.
|
|
30
|
+
* - When `modal=true`, the sheet uses `dialog.showModal()`, rendering a scrim
|
|
31
|
+
* backdrop and trapping focus. Pressing `Escape` closes it.
|
|
32
|
+
* - When `modal=false`, the sheet uses `dialog.show()` and remains interactive
|
|
33
|
+
* alongside the main page content.
|
|
34
|
+
*
|
|
35
|
+
* **Drag & Resize (Moni feature):**
|
|
36
|
+
* Setting the `with-handle` attribute adds a draggable grab handle to the inner
|
|
37
|
+
* edge of the sheet. Users can click and drag this handle to resize the sheet's
|
|
38
|
+
* width up to the `max-width` limit. If the user drags the sheet towards the
|
|
39
|
+
* screen edge quickly or beyond a certain threshold, it automatically closes.
|
|
40
|
+
*
|
|
41
|
+
* **Animations:**
|
|
42
|
+
* Side sheets slide in from the specified `side` (`left` or `right`). The open
|
|
43
|
+
* and close animations are handled via CSS transitions tied to the `open` property.
|
|
44
|
+
*
|
|
45
|
+
* @fires close - Fired when the side sheet is completely closed (after animations
|
|
46
|
+
* finish), either via the close button, scrim click, drag-to-close,
|
|
47
|
+
* or `Escape` key.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```html
|
|
51
|
+
* <!-- Modal side sheet on the right -->
|
|
52
|
+
* <moni-side-sheet id="details-sheet" modal title="Item Details">
|
|
53
|
+
* <p>Here is more information about the selected item.</p>
|
|
54
|
+
* <div slot="footer">
|
|
55
|
+
* <moni-button>Save</moni-button>
|
|
56
|
+
* </div>
|
|
57
|
+
* </moni-side-sheet>
|
|
15
58
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* - detached: boolean (adds 16px/16dp margins/rounded corners all around)
|
|
22
|
-
* - showClose: boolean (shows standard close button)
|
|
23
|
-
* - showBack: boolean (shows standard back button)
|
|
24
|
-
* - noBorder: boolean (removes borders, default: false)
|
|
25
|
-
* - withHandle: boolean (shows grab handle and enables dragging to close/resize, default: false)
|
|
26
|
-
* - expanded-width: string (width when expanded, default: '600px')
|
|
27
|
-
* - max-width: string (maximum width restriction, default: '100%')
|
|
59
|
+
* <!-- Resizable, detached side sheet on the left -->
|
|
60
|
+
* <moni-side-sheet side="left" detached with-handle max-width="50vw">
|
|
61
|
+
* <p>Navigation options</p>
|
|
62
|
+
* </moni-side-sheet>
|
|
63
|
+
* ```
|
|
28
64
|
*
|
|
29
|
-
*
|
|
30
|
-
* -
|
|
65
|
+
* @slot default - Main body content.
|
|
66
|
+
* @slot header - Custom header content (overrides `title`, close/back buttons remain).
|
|
67
|
+
* @slot footer - Bottom-anchored action area.
|
|
31
68
|
*/
|
|
32
69
|
let MoniSideSheet = class MoniSideSheet extends MoniElement {
|
|
33
70
|
constructor() {
|
|
@@ -1,33 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-slider.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
|
/**
|
|
4
|
-
*
|
|
10
|
+
* Material Design 3 Slider component.
|
|
11
|
+
*
|
|
12
|
+
* Sliders allow users to select a single value or a range of values from a
|
|
13
|
+
* continuous or discrete scale.
|
|
14
|
+
*
|
|
15
|
+
* **M3 spec reference:** `m3-docs/components/sliders/specs.md`
|
|
16
|
+
*
|
|
17
|
+
* **Slider modes:**
|
|
18
|
+
* - **Continuous** (default) — Smooth drag between `min` and `max`. Use when
|
|
19
|
+
* the exact value does not need to be defined by the user (e.g. volume).
|
|
20
|
+
* - **Discrete** — Set `step` to snap to discrete intervals. Tick marks
|
|
21
|
+
* appear via the native `<datalist>` element in Chrome/Edge. Firefox does
|
|
22
|
+
* not render datalist ticks for range inputs.
|
|
23
|
+
* - **Range** (`range` attribute) — Two thumbs that define a minimum and
|
|
24
|
+
* maximum value within the slider's extent.
|
|
25
|
+
* - **Vertical** (`vertical` attribute) — 90° rotated slider.
|
|
26
|
+
*
|
|
27
|
+
* **Value label tooltip:**
|
|
28
|
+
* When `indicator` is set, the current value is displayed in a tooltip above
|
|
29
|
+
* (or below, via `indicator-placement`) the active thumb during focus/drag.
|
|
30
|
+
*
|
|
31
|
+
* **Tick marks:**
|
|
32
|
+
* - `ticks` attribute: adds datalist with marks at `min` and `max` only.
|
|
33
|
+
* - `tick-interval` attribute: generates datalist options at every N units
|
|
34
|
+
* between `min` and `max`, creating visible tick marks at those positions.
|
|
35
|
+
*
|
|
36
|
+
* **Internal state management:**
|
|
37
|
+
* Uses `@state()` for `_value` and `_valueHigh` so the fill track width and
|
|
38
|
+
* tooltip position update reactively on every drag `input` event without
|
|
39
|
+
* waiting for the `change` event.
|
|
40
|
+
*
|
|
41
|
+
* @fires change - Bubbles and is composed. Fired when dragging ends and the
|
|
42
|
+
* value is committed. Read `element.value` for the new value.
|
|
43
|
+
* @fires input - Fired on every drag step. Read `element.value` for the
|
|
44
|
+
* live value during drag.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```html
|
|
48
|
+
* <!-- Continuous slider -->
|
|
49
|
+
* <moni-slider name="volume" min="0" max="100" value="60"></moni-slider>
|
|
5
50
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* - Track visual (span) and tooltip positions update immediately on drag
|
|
51
|
+
* <!-- Discrete slider with ticks every 10 units -->
|
|
52
|
+
* <moni-slider step="10" tick-interval="10" indicator></moni-slider>
|
|
9
53
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - Tick marks: in Chrome/Edge, native `<datalist>` ticks render at every
|
|
14
|
-
* option value. In Firefox, the datalist ticks are not rendered for
|
|
15
|
-
* range inputs; consumers can use `tick-interval` to manually generate
|
|
16
|
-
* a visual fallback if needed (P3.4 — outside the scope of this release).
|
|
17
|
-
* - State layer: hover/focus state uses CSS `::before` overlay at 0.08/0.12
|
|
18
|
-
* opacity per M3 (handled by `interaction-styles.ts`).
|
|
54
|
+
* <!-- Range slider -->
|
|
55
|
+
* <moni-slider range min="0" max="100" value="20" value-high="80"></moni-slider>
|
|
56
|
+
* ```
|
|
19
57
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* - range: present → two thumbs
|
|
25
|
-
* - ticks: present → datalist with min/max marks
|
|
26
|
-
* - tick-interval: number — when set, generates datalist options every
|
|
27
|
-
* N units between min and max. Overrides `ticks`.
|
|
28
|
-
* - indicator: present → show value tooltip on focus
|
|
29
|
-
* - indicator-placement: top (default) | bottom
|
|
30
|
-
* - inset-icon: Material Symbols name inside the colored track
|
|
58
|
+
* @csspart slider - The outer slider container.
|
|
59
|
+
* @csspart track - The track background.
|
|
60
|
+
* @csspart fill - The filled portion of the track.
|
|
61
|
+
* @csspart indicator - The value label tooltip.
|
|
31
62
|
*/
|
|
32
63
|
export declare class MoniSlider extends MoniElement {
|
|
33
64
|
name: string;
|
|
@@ -62,7 +93,7 @@ export declare class MoniSlider extends MoniElement {
|
|
|
62
93
|
*/
|
|
63
94
|
private _renderDatalist;
|
|
64
95
|
static styles: import("lit").CSSResult[];
|
|
65
|
-
render(): import("lit
|
|
96
|
+
render(): import("lit").TemplateResult<1>;
|
|
66
97
|
}
|
|
67
98
|
declare global {
|
|
68
99
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moni-slider.d.ts","sourceRoot":"","sources":["../../src/components/moni-slider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"moni-slider.d.ts","sourceRoot":"","sources":["../../src/components/moni-slider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,qBACa,UAAW,SAAQ,WAAW;IACb,IAAI,SAAM;IACV,GAAG,SAAO;IACV,GAAG,SAAS;IACZ,IAAI,SAAM;IAEvC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAQ;IACmB,SAAS,SAAM;IAErE,kBAAkB,EAAE,KAAK,GAAG,QAAQ,CAAS;IAE7C,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAY;IAGrB,KAAK,UAAS;IACd,QAAQ,UAAS;IACjB,KAAK,UAAS;IACd,SAAS,UAAS;IACK,UAAU,UAAS;IAEtF,8EAA8E;IACrE,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,SAAS,CAAQ;IAElC,IACI,KAAK,IACI,MAAM,CADgB;IACnC,IAAI,KAAK,CAAC,CAAC,EAAE,MAAM,EAAsB;IAEzC,IACI,QAAQ,IACI,MAAM,CADmB;IACzC,IAAI,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAyB;IAE/C,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,SAAS;IAUjB;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAsBvB,OAAgB,MAAM,4BA0MpB;IAEO,MAAM;CAkDf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,aAAa,EAAE,UAAU,CAAC;KAC1B;CACD;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file components/moni-slider.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,33 +16,58 @@ import { ifDefined } from 'lit/directives/if-defined.js';
|
|
|
10
16
|
import { MoniElement, sharedStyles } from './_base/index.js';
|
|
11
17
|
import './moni-icon.js';
|
|
12
18
|
/**
|
|
13
|
-
*
|
|
19
|
+
* Material Design 3 Slider component.
|
|
20
|
+
*
|
|
21
|
+
* Sliders allow users to select a single value or a range of values from a
|
|
22
|
+
* continuous or discrete scale.
|
|
23
|
+
*
|
|
24
|
+
* **M3 spec reference:** `m3-docs/components/sliders/specs.md`
|
|
25
|
+
*
|
|
26
|
+
* **Slider modes:**
|
|
27
|
+
* - **Continuous** (default) — Smooth drag between `min` and `max`. Use when
|
|
28
|
+
* the exact value does not need to be defined by the user (e.g. volume).
|
|
29
|
+
* - **Discrete** — Set `step` to snap to discrete intervals. Tick marks
|
|
30
|
+
* appear via the native `<datalist>` element in Chrome/Edge. Firefox does
|
|
31
|
+
* not render datalist ticks for range inputs.
|
|
32
|
+
* - **Range** (`range` attribute) — Two thumbs that define a minimum and
|
|
33
|
+
* maximum value within the slider's extent.
|
|
34
|
+
* - **Vertical** (`vertical` attribute) — 90° rotated slider.
|
|
35
|
+
*
|
|
36
|
+
* **Value label tooltip:**
|
|
37
|
+
* When `indicator` is set, the current value is displayed in a tooltip above
|
|
38
|
+
* (or below, via `indicator-placement`) the active thumb during focus/drag.
|
|
39
|
+
*
|
|
40
|
+
* **Tick marks:**
|
|
41
|
+
* - `ticks` attribute: adds datalist with marks at `min` and `max` only.
|
|
42
|
+
* - `tick-interval` attribute: generates datalist options at every N units
|
|
43
|
+
* between `min` and `max`, creating visible tick marks at those positions.
|
|
44
|
+
*
|
|
45
|
+
* **Internal state management:**
|
|
46
|
+
* Uses `@state()` for `_value` and `_valueHigh` so the fill track width and
|
|
47
|
+
* tooltip position update reactively on every drag `input` event without
|
|
48
|
+
* waiting for the `change` event.
|
|
49
|
+
*
|
|
50
|
+
* @fires change - Bubbles and is composed. Fired when dragging ends and the
|
|
51
|
+
* value is committed. Read `element.value` for the new value.
|
|
52
|
+
* @fires input - Fired on every drag step. Read `element.value` for the
|
|
53
|
+
* live value during drag.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```html
|
|
57
|
+
* <!-- Continuous slider -->
|
|
58
|
+
* <moni-slider name="volume" min="0" max="100" value="60"></moni-slider>
|
|
14
59
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* - Track visual (span) and tooltip positions update immediately on drag
|
|
60
|
+
* <!-- Discrete slider with ticks every 10 units -->
|
|
61
|
+
* <moni-slider step="10" tick-interval="10" indicator></moni-slider>
|
|
18
62
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* - Tick marks: in Chrome/Edge, native `<datalist>` ticks render at every
|
|
23
|
-
* option value. In Firefox, the datalist ticks are not rendered for
|
|
24
|
-
* range inputs; consumers can use `tick-interval` to manually generate
|
|
25
|
-
* a visual fallback if needed (P3.4 — outside the scope of this release).
|
|
26
|
-
* - State layer: hover/focus state uses CSS `::before` overlay at 0.08/0.12
|
|
27
|
-
* opacity per M3 (handled by `interaction-styles.ts`).
|
|
63
|
+
* <!-- Range slider -->
|
|
64
|
+
* <moni-slider range min="0" max="100" value="20" value-high="80"></moni-slider>
|
|
65
|
+
* ```
|
|
28
66
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* - range: present → two thumbs
|
|
34
|
-
* - ticks: present → datalist with min/max marks
|
|
35
|
-
* - tick-interval: number — when set, generates datalist options every
|
|
36
|
-
* N units between min and max. Overrides `ticks`.
|
|
37
|
-
* - indicator: present → show value tooltip on focus
|
|
38
|
-
* - indicator-placement: top (default) | bottom
|
|
39
|
-
* - inset-icon: Material Symbols name inside the colored track
|
|
67
|
+
* @csspart slider - The outer slider container.
|
|
68
|
+
* @csspart track - The track background.
|
|
69
|
+
* @csspart fill - The filled portion of the track.
|
|
70
|
+
* @csspart indicator - The value label tooltip.
|
|
40
71
|
*/
|
|
41
72
|
let MoniSlider = class MoniSlider extends MoniElement {
|
|
42
73
|
constructor() {
|