@moni-labs/moni-ui 0.2.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/LICENSE +34 -0
- package/README.md +264 -0
- package/custom-elements.json +12510 -0
- package/dist/actions/index.d.ts +2 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +1 -0
- package/dist/assets/arch.svg +1 -0
- package/dist/assets/arrow.svg +1 -0
- package/dist/assets/boom.svg +1 -0
- package/dist/assets/bun.svg +1 -0
- package/dist/assets/burst.svg +1 -0
- package/dist/assets/circle.svg +1 -0
- package/dist/assets/clamshell.svg +1 -0
- package/dist/assets/diamond.svg +1 -0
- package/dist/assets/fan.svg +1 -0
- package/dist/assets/flower.svg +1 -0
- package/dist/assets/gem.svg +1 -0
- package/dist/assets/ghost-ish.svg +1 -0
- package/dist/assets/heart.svg +1 -0
- package/dist/assets/leaf-clover4.svg +1 -0
- package/dist/assets/leaf-clover8.svg +1 -0
- package/dist/assets/loading-indicator.svg +1 -0
- package/dist/assets/material-symbols-rounded.woff2 +0 -0
- package/dist/assets/material-symbols-subset.woff2 +0 -0
- package/dist/assets/oval.svg +1 -0
- package/dist/assets/pentagon.svg +1 -0
- package/dist/assets/pill.svg +1 -0
- package/dist/assets/pixel-circle.svg +1 -0
- package/dist/assets/pixel-triangle.svg +1 -0
- package/dist/assets/puffy-diamond.svg +1 -0
- package/dist/assets/puffy.svg +1 -0
- package/dist/assets/semicircle.svg +1 -0
- package/dist/assets/shapes/arch.svg +1 -0
- package/dist/assets/shapes/arrow.svg +1 -0
- package/dist/assets/shapes/boom.svg +1 -0
- package/dist/assets/shapes/burst.svg +1 -0
- package/dist/assets/shapes/circle.svg +1 -0
- package/dist/assets/shapes/clamshell.svg +1 -0
- package/dist/assets/shapes/diamond.svg +1 -0
- package/dist/assets/shapes/fan.svg +1 -0
- package/dist/assets/shapes/flower.svg +1 -0
- package/dist/assets/shapes/gem.svg +1 -0
- package/dist/assets/shapes/ghost-ish.svg +1 -0
- package/dist/assets/shapes/heart.svg +1 -0
- package/dist/assets/shapes/leaf-clover4.svg +1 -0
- package/dist/assets/shapes/leaf-clover8.svg +1 -0
- package/dist/assets/shapes/loading-indicator.svg +1 -0
- package/dist/assets/shapes/oval.svg +1 -0
- package/dist/assets/shapes/pentagon.svg +1 -0
- package/dist/assets/shapes/pill.svg +1 -0
- package/dist/assets/shapes/pixel-circle.svg +1 -0
- package/dist/assets/shapes/pixel-triangle.svg +1 -0
- package/dist/assets/shapes/puffy-diamond.svg +1 -0
- package/dist/assets/shapes/puffy.svg +1 -0
- package/dist/assets/shapes/semicircle.svg +1 -0
- package/dist/assets/shapes/sided-cookie12.svg +1 -0
- package/dist/assets/shapes/sided-cookie4.svg +1 -0
- package/dist/assets/shapes/sided-cookie6.svg +1 -0
- package/dist/assets/shapes/sided-cookie7.svg +1 -0
- package/dist/assets/shapes/sided-cookie9.svg +1 -0
- package/dist/assets/shapes/slanted.svg +1 -0
- package/dist/assets/shapes/soft-boom.svg +1 -0
- package/dist/assets/shapes/soft-burst.svg +1 -0
- package/dist/assets/shapes/square.svg +1 -0
- package/dist/assets/shapes/sunny.svg +1 -0
- package/dist/assets/shapes/triangle.svg +1 -0
- package/dist/assets/shapes/very-sunny.svg +1 -0
- package/dist/assets/shapes/wavy-circle.svg +1 -0
- package/dist/assets/shapes/wavy.svg +1 -0
- package/dist/assets/sided-cookie12.svg +1 -0
- package/dist/assets/sided-cookie4.svg +1 -0
- package/dist/assets/sided-cookie6.svg +1 -0
- package/dist/assets/sided-cookie7.svg +1 -0
- package/dist/assets/sided-cookie9.svg +1 -0
- package/dist/assets/slanted.svg +1 -0
- package/dist/assets/soft-boom.svg +1 -0
- package/dist/assets/soft-burst.svg +1 -0
- package/dist/assets/square.svg +1 -0
- package/dist/assets/star.svg +1 -0
- package/dist/assets/sunny.svg +1 -0
- package/dist/assets/triangle.svg +1 -0
- package/dist/assets/very-sunny.svg +1 -0
- package/dist/assets/wavy-circle.svg +1 -0
- package/dist/assets/wavy.svg +1 -0
- package/dist/components/_base/field-styles.d.ts +24 -0
- package/dist/components/_base/field-styles.d.ts.map +1 -0
- package/dist/components/_base/field-styles.js +504 -0
- package/dist/components/_base/index.d.ts +4 -0
- package/dist/components/_base/index.d.ts.map +1 -0
- package/dist/components/_base/index.js +3 -0
- package/dist/components/_base/interaction-styles.d.ts +22 -0
- package/dist/components/_base/interaction-styles.d.ts.map +1 -0
- package/dist/components/_base/interaction-styles.js +123 -0
- package/dist/components/_base/moni-element.d.ts +18 -0
- package/dist/components/_base/moni-element.d.ts.map +1 -0
- package/dist/components/_base/moni-element.js +19 -0
- package/dist/components/_base/shared-styles.d.ts +22 -0
- package/dist/components/_base/shared-styles.d.ts.map +1 -0
- package/dist/components/_base/shared-styles.js +146 -0
- package/dist/components/index.d.ts +42 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +43 -0
- package/dist/components/loading-shapes.d.ts +10 -0
- package/dist/components/loading-shapes.d.ts.map +1 -0
- package/dist/components/loading-shapes.js +9 -0
- package/dist/components/moni-app-bar.d.ts +52 -0
- package/dist/components/moni-app-bar.d.ts.map +1 -0
- package/dist/components/moni-app-bar.js +207 -0
- package/dist/components/moni-badge.d.ts +37 -0
- package/dist/components/moni-badge.d.ts.map +1 -0
- package/dist/components/moni-badge.js +153 -0
- package/dist/components/moni-bottom-sheet.d.ts +52 -0
- package/dist/components/moni-bottom-sheet.d.ts.map +1 -0
- package/dist/components/moni-bottom-sheet.js +440 -0
- package/dist/components/moni-button-group.d.ts +55 -0
- package/dist/components/moni-button-group.d.ts.map +1 -0
- package/dist/components/moni-button-group.js +278 -0
- package/dist/components/moni-button-segment.d.ts +29 -0
- package/dist/components/moni-button-segment.d.ts.map +1 -0
- package/dist/components/moni-button-segment.js +300 -0
- package/dist/components/moni-button.d.ts +70 -0
- package/dist/components/moni-button.d.ts.map +1 -0
- package/dist/components/moni-button.js +727 -0
- package/dist/components/moni-card.d.ts +48 -0
- package/dist/components/moni-card.d.ts.map +1 -0
- package/dist/components/moni-card.js +216 -0
- package/dist/components/moni-carousel.d.ts +111 -0
- package/dist/components/moni-carousel.d.ts.map +1 -0
- package/dist/components/moni-carousel.js +1007 -0
- package/dist/components/moni-checkbox.d.ts +39 -0
- package/dist/components/moni-checkbox.d.ts.map +1 -0
- package/dist/components/moni-checkbox.js +212 -0
- package/dist/components/moni-chip.d.ts +57 -0
- package/dist/components/moni-chip.d.ts.map +1 -0
- package/dist/components/moni-chip.js +340 -0
- package/dist/components/moni-color-field.d.ts +33 -0
- package/dist/components/moni-color-field.d.ts.map +1 -0
- package/dist/components/moni-color-field.js +170 -0
- package/dist/components/moni-context-menu.d.ts +55 -0
- package/dist/components/moni-context-menu.d.ts.map +1 -0
- package/dist/components/moni-context-menu.js +184 -0
- package/dist/components/moni-dialog.d.ts +37 -0
- package/dist/components/moni-dialog.d.ts.map +1 -0
- package/dist/components/moni-dialog.js +257 -0
- package/dist/components/moni-divider.d.ts +33 -0
- package/dist/components/moni-divider.d.ts.map +1 -0
- package/dist/components/moni-divider.js +81 -0
- package/dist/components/moni-expansion.d.ts +25 -0
- package/dist/components/moni-expansion.d.ts.map +1 -0
- package/dist/components/moni-expansion.js +94 -0
- package/dist/components/moni-fab-menu.d.ts +58 -0
- package/dist/components/moni-fab-menu.d.ts.map +1 -0
- package/dist/components/moni-fab-menu.js +247 -0
- package/dist/components/moni-fab.d.ts +48 -0
- package/dist/components/moni-fab.d.ts.map +1 -0
- package/dist/components/moni-fab.js +284 -0
- package/dist/components/moni-file-field.d.ts +47 -0
- package/dist/components/moni-file-field.d.ts.map +1 -0
- package/dist/components/moni-file-field.js +189 -0
- package/dist/components/moni-icon.d.ts +30 -0
- package/dist/components/moni-icon.d.ts.map +1 -0
- package/dist/components/moni-icon.js +107 -0
- package/dist/components/moni-list-item.d.ts +51 -0
- package/dist/components/moni-list-item.d.ts.map +1 -0
- package/dist/components/moni-list-item.js +239 -0
- package/dist/components/moni-list.d.ts +32 -0
- package/dist/components/moni-list.d.ts.map +1 -0
- package/dist/components/moni-list.js +67 -0
- package/dist/components/moni-loading-indicator.d.ts +32 -0
- package/dist/components/moni-loading-indicator.d.ts.map +1 -0
- package/dist/components/moni-loading-indicator.js +189 -0
- package/dist/components/moni-menu-item.d.ts +27 -0
- package/dist/components/moni-menu-item.d.ts.map +1 -0
- package/dist/components/moni-menu-item.js +99 -0
- package/dist/components/moni-menu.d.ts +55 -0
- package/dist/components/moni-menu.d.ts.map +1 -0
- package/dist/components/moni-menu.js +295 -0
- package/dist/components/moni-morph-modal.d.ts +78 -0
- package/dist/components/moni-morph-modal.d.ts.map +1 -0
- package/dist/components/moni-morph-modal.js +1223 -0
- package/dist/components/moni-nav-item.d.ts +38 -0
- package/dist/components/moni-nav-item.d.ts.map +1 -0
- package/dist/components/moni-nav-item.js +262 -0
- package/dist/components/moni-nav.d.ts +46 -0
- package/dist/components/moni-nav.d.ts.map +1 -0
- package/dist/components/moni-nav.js +272 -0
- package/dist/components/moni-progress.d.ts +45 -0
- package/dist/components/moni-progress.d.ts.map +1 -0
- package/dist/components/moni-progress.js +333 -0
- package/dist/components/moni-radio.d.ts +38 -0
- package/dist/components/moni-radio.d.ts.map +1 -0
- package/dist/components/moni-radio.js +218 -0
- package/dist/components/moni-ripple.d.ts +35 -0
- package/dist/components/moni-ripple.d.ts.map +1 -0
- package/dist/components/moni-ripple.js +156 -0
- package/dist/components/moni-segmented-button.d.ts +52 -0
- package/dist/components/moni-segmented-button.d.ts.map +1 -0
- package/dist/components/moni-segmented-button.js +208 -0
- package/dist/components/moni-select-option.d.ts +27 -0
- package/dist/components/moni-select-option.d.ts.map +1 -0
- package/dist/components/moni-select-option.js +102 -0
- package/dist/components/moni-select.d.ts +76 -0
- package/dist/components/moni-select.d.ts.map +1 -0
- package/dist/components/moni-select.js +1136 -0
- package/dist/components/moni-shape.d.ts +30 -0
- package/dist/components/moni-shape.d.ts.map +1 -0
- package/dist/components/moni-shape.js +146 -0
- package/dist/components/moni-side-sheet.d.ts +62 -0
- package/dist/components/moni-side-sheet.d.ts.map +1 -0
- package/dist/components/moni-side-sheet.js +576 -0
- package/dist/components/moni-slider.d.ts +73 -0
- package/dist/components/moni-slider.d.ts.map +1 -0
- package/dist/components/moni-slider.js +422 -0
- package/dist/components/moni-snackbar.d.ts +40 -0
- package/dist/components/moni-snackbar.d.ts.map +1 -0
- package/dist/components/moni-snackbar.js +161 -0
- package/dist/components/moni-split-button.d.ts +33 -0
- package/dist/components/moni-split-button.d.ts.map +1 -0
- package/dist/components/moni-split-button.js +122 -0
- package/dist/components/moni-step.d.ts +30 -0
- package/dist/components/moni-step.d.ts.map +1 -0
- package/dist/components/moni-step.js +175 -0
- package/dist/components/moni-stepper.d.ts +35 -0
- package/dist/components/moni-stepper.d.ts.map +1 -0
- package/dist/components/moni-stepper.js +101 -0
- package/dist/components/moni-switch.d.ts +39 -0
- package/dist/components/moni-switch.d.ts.map +1 -0
- package/dist/components/moni-switch.js +258 -0
- package/dist/components/moni-tab.d.ts +27 -0
- package/dist/components/moni-tab.d.ts.map +1 -0
- package/dist/components/moni-tab.js +147 -0
- package/dist/components/moni-tabs.d.ts +31 -0
- package/dist/components/moni-tabs.d.ts.map +1 -0
- package/dist/components/moni-tabs.js +106 -0
- package/dist/components/moni-text-field.d.ts +46 -0
- package/dist/components/moni-text-field.d.ts.map +1 -0
- package/dist/components/moni-text-field.js +190 -0
- package/dist/components/moni-textarea.d.ts +57 -0
- package/dist/components/moni-textarea.d.ts.map +1 -0
- package/dist/components/moni-textarea.js +228 -0
- package/dist/components/moni-time-picker.d.ts +51 -0
- package/dist/components/moni-time-picker.d.ts.map +1 -0
- package/dist/components/moni-time-picker.js +823 -0
- package/dist/components/moni-toolbar.d.ts +35 -0
- package/dist/components/moni-toolbar.d.ts.map +1 -0
- package/dist/components/moni-toolbar.js +128 -0
- package/dist/components/moni-tooltip.d.ts +65 -0
- package/dist/components/moni-tooltip.d.ts.map +1 -0
- package/dist/components/moni-tooltip.js +320 -0
- package/dist/components/moni-typography.d.ts +42 -0
- package/dist/components/moni-typography.d.ts.map +1 -0
- package/dist/components/moni-typography.js +205 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/styles/animations.css +46 -0
- package/dist/styles/base.css +248 -0
- package/dist/styles/index.css +3 -0
- package/dist/styles/tokens.css +190 -0
- package/dist/utils/color.d.ts +51 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/color.js +107 -0
- package/dist/utils/theme.svelte.d.ts +45 -0
- package/dist/utils/theme.svelte.d.ts.map +1 -0
- package/dist/utils/theme.svelte.js +168 -0
- package/dist/web-components.d.ts +3 -0
- package/dist/web-components.d.ts.map +1 -0
- package/dist/web-components.js +4 -0
- package/package.json +76 -0
- package/src/actions/index.ts +2 -0
- package/src/assets/arch.svg +1 -0
- package/src/assets/arrow.svg +1 -0
- package/src/assets/boom.svg +1 -0
- package/src/assets/bun.svg +1 -0
- package/src/assets/burst.svg +1 -0
- package/src/assets/circle.svg +1 -0
- package/src/assets/clamshell.svg +1 -0
- package/src/assets/diamond.svg +1 -0
- package/src/assets/fan.svg +1 -0
- package/src/assets/flower.svg +1 -0
- package/src/assets/gem.svg +1 -0
- package/src/assets/ghost-ish.svg +1 -0
- package/src/assets/heart.svg +1 -0
- package/src/assets/leaf-clover4.svg +1 -0
- package/src/assets/leaf-clover8.svg +1 -0
- package/src/assets/loading-indicator.svg +1 -0
- package/src/assets/material-symbols-rounded.woff2 +0 -0
- package/src/assets/material-symbols-subset.woff2 +0 -0
- package/src/assets/oval.svg +1 -0
- package/src/assets/pentagon.svg +1 -0
- package/src/assets/pill.svg +1 -0
- package/src/assets/pixel-circle.svg +1 -0
- package/src/assets/pixel-triangle.svg +1 -0
- package/src/assets/puffy-diamond.svg +1 -0
- package/src/assets/puffy.svg +1 -0
- package/src/assets/semicircle.svg +1 -0
- package/src/assets/shapes/arch.svg +1 -0
- package/src/assets/shapes/arrow.svg +1 -0
- package/src/assets/shapes/boom.svg +1 -0
- package/src/assets/shapes/burst.svg +1 -0
- package/src/assets/shapes/circle.svg +1 -0
- package/src/assets/shapes/clamshell.svg +1 -0
- package/src/assets/shapes/diamond.svg +1 -0
- package/src/assets/shapes/fan.svg +1 -0
- package/src/assets/shapes/flower.svg +1 -0
- package/src/assets/shapes/gem.svg +1 -0
- package/src/assets/shapes/ghost-ish.svg +1 -0
- package/src/assets/shapes/heart.svg +1 -0
- package/src/assets/shapes/leaf-clover4.svg +1 -0
- package/src/assets/shapes/leaf-clover8.svg +1 -0
- package/src/assets/shapes/loading-indicator.svg +1 -0
- package/src/assets/shapes/oval.svg +1 -0
- package/src/assets/shapes/pentagon.svg +1 -0
- package/src/assets/shapes/pill.svg +1 -0
- package/src/assets/shapes/pixel-circle.svg +1 -0
- package/src/assets/shapes/pixel-triangle.svg +1 -0
- package/src/assets/shapes/puffy-diamond.svg +1 -0
- package/src/assets/shapes/puffy.svg +1 -0
- package/src/assets/shapes/semicircle.svg +1 -0
- package/src/assets/shapes/sided-cookie12.svg +1 -0
- package/src/assets/shapes/sided-cookie4.svg +1 -0
- package/src/assets/shapes/sided-cookie6.svg +1 -0
- package/src/assets/shapes/sided-cookie7.svg +1 -0
- package/src/assets/shapes/sided-cookie9.svg +1 -0
- package/src/assets/shapes/slanted.svg +1 -0
- package/src/assets/shapes/soft-boom.svg +1 -0
- package/src/assets/shapes/soft-burst.svg +1 -0
- package/src/assets/shapes/square.svg +1 -0
- package/src/assets/shapes/sunny.svg +1 -0
- package/src/assets/shapes/triangle.svg +1 -0
- package/src/assets/shapes/very-sunny.svg +1 -0
- package/src/assets/shapes/wavy-circle.svg +1 -0
- package/src/assets/shapes/wavy.svg +1 -0
- package/src/assets/sided-cookie12.svg +1 -0
- package/src/assets/sided-cookie4.svg +1 -0
- package/src/assets/sided-cookie6.svg +1 -0
- package/src/assets/sided-cookie7.svg +1 -0
- package/src/assets/sided-cookie9.svg +1 -0
- package/src/assets/slanted.svg +1 -0
- package/src/assets/soft-boom.svg +1 -0
- package/src/assets/soft-burst.svg +1 -0
- package/src/assets/square.svg +1 -0
- package/src/assets/star.svg +1 -0
- package/src/assets/sunny.svg +1 -0
- package/src/assets/triangle.svg +1 -0
- package/src/assets/very-sunny.svg +1 -0
- package/src/assets/wavy-circle.svg +1 -0
- package/src/assets/wavy.svg +1 -0
- package/src/assets.d.ts +12 -0
- package/src/components/_base/field-styles.ts +507 -0
- package/src/components/_base/index.ts +3 -0
- package/src/components/_base/interaction-styles.ts +125 -0
- package/src/components/_base/moni-element.ts +21 -0
- package/src/components/_base/shared-styles.ts +148 -0
- package/src/components/index.ts +45 -0
- package/src/components/loading-shapes.ts +9 -0
- package/src/components/moni-app-bar.test.ts +86 -0
- package/src/components/moni-app-bar.ts +190 -0
- package/src/components/moni-badge.ts +138 -0
- package/src/components/moni-bottom-sheet.test.ts +420 -0
- package/src/components/moni-bottom-sheet.ts +425 -0
- package/src/components/moni-button-group.test.ts +148 -0
- package/src/components/moni-button-group.ts +277 -0
- package/src/components/moni-button-segment.ts +291 -0
- package/src/components/moni-button.test.ts +166 -0
- package/src/components/moni-button.ts +709 -0
- package/src/components/moni-card.test.ts +83 -0
- package/src/components/moni-card.ts +203 -0
- package/src/components/moni-carousel.test.ts +238 -0
- package/src/components/moni-carousel.ts +1027 -0
- package/src/components/moni-checkbox.test.ts +78 -0
- package/src/components/moni-checkbox.ts +192 -0
- package/src/components/moni-chip.test.ts +168 -0
- package/src/components/moni-chip.ts +335 -0
- package/src/components/moni-color-field.test.ts +56 -0
- package/src/components/moni-color-field.ts +135 -0
- package/src/components/moni-context-menu.test.ts +99 -0
- package/src/components/moni-context-menu.ts +166 -0
- package/src/components/moni-dialog.ts +240 -0
- package/src/components/moni-divider.test.ts +42 -0
- package/src/components/moni-divider.ts +77 -0
- package/src/components/moni-expansion.ts +86 -0
- package/src/components/moni-fab-menu.test.ts +118 -0
- package/src/components/moni-fab-menu.ts +237 -0
- package/src/components/moni-fab.test.ts +128 -0
- package/src/components/moni-fab.ts +262 -0
- package/src/components/moni-file-field.test.ts +81 -0
- package/src/components/moni-file-field.ts +149 -0
- package/src/components/moni-icon.test.ts +70 -0
- package/src/components/moni-icon.ts +97 -0
- package/src/components/moni-list-item.test.ts +114 -0
- package/src/components/moni-list-item.ts +222 -0
- package/src/components/moni-list.ts +59 -0
- package/src/components/moni-loading-indicator.test.ts +41 -0
- package/src/components/moni-loading-indicator.ts +188 -0
- package/src/components/moni-menu-item.ts +85 -0
- package/src/components/moni-menu.test.ts +87 -0
- package/src/components/moni-menu.ts +287 -0
- package/src/components/moni-morph-modal.test.ts +286 -0
- package/src/components/moni-morph-modal.ts +1312 -0
- package/src/components/moni-nav-item.ts +243 -0
- package/src/components/moni-nav.test.ts +139 -0
- package/src/components/moni-nav.ts +266 -0
- package/src/components/moni-progress.test.ts +90 -0
- package/src/components/moni-progress.ts +322 -0
- package/src/components/moni-radio.test.ts +86 -0
- package/src/components/moni-radio.ts +196 -0
- package/src/components/moni-ripple.ts +146 -0
- package/src/components/moni-segmented-button.test.ts +99 -0
- package/src/components/moni-segmented-button.ts +220 -0
- package/src/components/moni-select-option.ts +85 -0
- package/src/components/moni-select.test.ts +210 -0
- package/src/components/moni-select.ts +1107 -0
- package/src/components/moni-shape.ts +128 -0
- package/src/components/moni-side-sheet.test.ts +128 -0
- package/src/components/moni-side-sheet.ts +544 -0
- package/src/components/moni-slider.test.ts +82 -0
- package/src/components/moni-slider.ts +387 -0
- package/src/components/moni-snackbar.test.ts +82 -0
- package/src/components/moni-snackbar.ts +146 -0
- package/src/components/moni-split-button.ts +121 -0
- package/src/components/moni-step.test.ts +57 -0
- package/src/components/moni-step.ts +155 -0
- package/src/components/moni-stepper.test.ts +116 -0
- package/src/components/moni-stepper.ts +100 -0
- package/src/components/moni-switch.test.ts +117 -0
- package/src/components/moni-switch.ts +237 -0
- package/src/components/moni-tab.test.ts +54 -0
- package/src/components/moni-tab.ts +133 -0
- package/src/components/moni-tabs.ts +92 -0
- package/src/components/moni-text-field.test.ts +115 -0
- package/src/components/moni-text-field.ts +149 -0
- package/src/components/moni-textarea.test.ts +147 -0
- package/src/components/moni-textarea.ts +176 -0
- package/src/components/moni-time-picker.test.ts +61 -0
- package/src/components/moni-time-picker.ts +800 -0
- package/src/components/moni-toolbar.test.ts +93 -0
- package/src/components/moni-toolbar.ts +119 -0
- package/src/components/moni-tooltip.test.ts +122 -0
- package/src/components/moni-tooltip.ts +324 -0
- package/src/components/moni-typography.test.ts +119 -0
- package/src/components/moni-typography.ts +195 -0
- package/src/index.ts +65 -0
- package/src/styles/animations.css +46 -0
- package/src/styles/base.css +248 -0
- package/src/styles/index.css +3 -0
- package/src/styles/tokens.css +190 -0
- package/src/types/svelte-runes.d.ts +7 -0
- package/src/utils/color.ts +170 -0
- package/src/utils/theme.svelte.ts +206 -0
- package/src/web-components.ts +5 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, css, nothing } from 'lit';
|
|
8
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
9
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
11
|
+
import { MoniElement, sharedStyles, fieldStyles } from './_base/index.js';
|
|
12
|
+
import './moni-icon.js';
|
|
13
|
+
/**
|
|
14
|
+
* Visual-only file field. Renders a hidden `<input type="file">` over a
|
|
15
|
+
* read-only text input that shows the chosen file names.
|
|
16
|
+
*
|
|
17
|
+
* The DOM order is `input[type=text], label, input[type=file], output` so
|
|
18
|
+
* that the floating label CSS selector `input + label` lifts correctly even
|
|
19
|
+
* though the visible field is the read-only text input.
|
|
20
|
+
*
|
|
21
|
+
* Attributes:
|
|
22
|
+
* - name, label, value, variant, size, shape, disabled, helper, error,
|
|
23
|
+
* error-text, placeholder — see moni-text-field.
|
|
24
|
+
* - accept: forwarded to input.accept
|
|
25
|
+
* - multiple: present → input.multiple
|
|
26
|
+
* - button-label: text on the picker button (visual only, default: "Choose file")
|
|
27
|
+
* - icon: leading Material Symbols name
|
|
28
|
+
* - trailing-icon: trailing Material Symbols name
|
|
29
|
+
*/
|
|
30
|
+
let MoniFileField = class MoniFileField extends MoniElement {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
this.name = '';
|
|
34
|
+
this.label = '';
|
|
35
|
+
this.variant = 'outlined';
|
|
36
|
+
this.size = 'medium';
|
|
37
|
+
this.shape = 'no-round';
|
|
38
|
+
this.accept = '';
|
|
39
|
+
this.multiple = false;
|
|
40
|
+
this.buttonLabel = 'Choose file';
|
|
41
|
+
this.disabled = false;
|
|
42
|
+
this.helper = '';
|
|
43
|
+
this.errorText = '';
|
|
44
|
+
this.error = false;
|
|
45
|
+
this.value = '';
|
|
46
|
+
this.icon = '';
|
|
47
|
+
this.trailingIcon = 'folder_open';
|
|
48
|
+
}
|
|
49
|
+
updated(changed) {
|
|
50
|
+
if (this._fileInput) {
|
|
51
|
+
if (changed.has('disabled'))
|
|
52
|
+
this._fileInput.disabled = this.disabled;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
static { this.styles = [
|
|
56
|
+
sharedStyles,
|
|
57
|
+
fieldStyles,
|
|
58
|
+
css `
|
|
59
|
+
input[type='file'] {
|
|
60
|
+
position: absolute;
|
|
61
|
+
inset: 0;
|
|
62
|
+
opacity: 0;
|
|
63
|
+
z-index: 2;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
}
|
|
66
|
+
input[type='text'] {
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
}
|
|
69
|
+
`
|
|
70
|
+
]; }
|
|
71
|
+
render() {
|
|
72
|
+
const isActive = Boolean(this.value);
|
|
73
|
+
const hasLeading = Boolean(this.icon);
|
|
74
|
+
const hasTrailing = Boolean(this.trailingIcon);
|
|
75
|
+
const fieldClasses = {
|
|
76
|
+
field: true,
|
|
77
|
+
label: Boolean(this.label),
|
|
78
|
+
fill: this.variant === 'filled',
|
|
79
|
+
border: this.variant === 'outlined',
|
|
80
|
+
small: this.size === 'small',
|
|
81
|
+
large: this.size === 'large',
|
|
82
|
+
extra: this.size === 'extra',
|
|
83
|
+
prefix: hasLeading,
|
|
84
|
+
suffix: hasTrailing,
|
|
85
|
+
invalid: this.error,
|
|
86
|
+
round: this.shape === 'round',
|
|
87
|
+
square: this.shape === 'no-round'
|
|
88
|
+
};
|
|
89
|
+
const leading = this.icon
|
|
90
|
+
? html `<i class="leading-icon" part="leading-icon"
|
|
91
|
+
><moni-icon name="${this.icon}"></moni-icon
|
|
92
|
+
></i>`
|
|
93
|
+
: nothing;
|
|
94
|
+
const trailing = this.trailingIcon
|
|
95
|
+
? html `<i class="trailing-icon" part="trailing-icon"
|
|
96
|
+
><moni-icon name="${this.trailingIcon}"></moni-icon
|
|
97
|
+
></i>`
|
|
98
|
+
: nothing;
|
|
99
|
+
return html `<div class=${classMap(fieldClasses)} part="field">
|
|
100
|
+
${leading}
|
|
101
|
+
<input
|
|
102
|
+
type="text"
|
|
103
|
+
part="display"
|
|
104
|
+
readonly
|
|
105
|
+
placeholder=${this.buttonLabel}
|
|
106
|
+
.value=${this.value}
|
|
107
|
+
?disabled=${this.disabled}
|
|
108
|
+
name=${ifDefined(this.name ? `${this.name}-display` : undefined)}
|
|
109
|
+
class=${isActive ? 'active' : ''}
|
|
110
|
+
/>
|
|
111
|
+
${this.label
|
|
112
|
+
? html `<label
|
|
113
|
+
part="label"
|
|
114
|
+
class=${classMap({ active: isActive })}
|
|
115
|
+
>${this.label}</label
|
|
116
|
+
>`
|
|
117
|
+
: nothing}
|
|
118
|
+
<input
|
|
119
|
+
type="file"
|
|
120
|
+
part="file"
|
|
121
|
+
?disabled=${this.disabled}
|
|
122
|
+
accept=${ifDefined(this.accept || undefined)}
|
|
123
|
+
?multiple=${this.multiple}
|
|
124
|
+
name=${ifDefined(this.name || undefined)}
|
|
125
|
+
/>
|
|
126
|
+
${trailing}
|
|
127
|
+
${this.error
|
|
128
|
+
? html `<output part="helper" class="invalid"
|
|
129
|
+
>${this.errorText || this.helper}</output
|
|
130
|
+
>`
|
|
131
|
+
: this.helper
|
|
132
|
+
? html `<output part="helper">${this.helper}</output>`
|
|
133
|
+
: nothing}
|
|
134
|
+
</div>`;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
__decorate([
|
|
138
|
+
property({ reflect: true })
|
|
139
|
+
], MoniFileField.prototype, "name", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
property({ reflect: true })
|
|
142
|
+
], MoniFileField.prototype, "label", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
property({ reflect: true })
|
|
145
|
+
], MoniFileField.prototype, "variant", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
property({ reflect: true })
|
|
148
|
+
], MoniFileField.prototype, "size", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
property({ reflect: true })
|
|
151
|
+
], MoniFileField.prototype, "shape", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
property({ reflect: true })
|
|
154
|
+
], MoniFileField.prototype, "accept", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
property({ type: Boolean, reflect: true })
|
|
157
|
+
], MoniFileField.prototype, "multiple", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
property({ reflect: true, attribute: 'button-label' })
|
|
160
|
+
], MoniFileField.prototype, "buttonLabel", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
property({ type: Boolean, reflect: true })
|
|
163
|
+
], MoniFileField.prototype, "disabled", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
property({ reflect: true })
|
|
166
|
+
], MoniFileField.prototype, "helper", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
property({ reflect: true, attribute: 'error-text' })
|
|
169
|
+
], MoniFileField.prototype, "errorText", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
property({ type: Boolean, reflect: true })
|
|
172
|
+
], MoniFileField.prototype, "error", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
property({ reflect: true })
|
|
175
|
+
], MoniFileField.prototype, "value", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
property({ reflect: true })
|
|
178
|
+
], MoniFileField.prototype, "icon", void 0);
|
|
179
|
+
__decorate([
|
|
180
|
+
property({ reflect: true, attribute: 'trailing-icon' })
|
|
181
|
+
], MoniFileField.prototype, "trailingIcon", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
query('input[type="file"]')
|
|
184
|
+
], MoniFileField.prototype, "_fileInput", void 0);
|
|
185
|
+
MoniFileField = __decorate([
|
|
186
|
+
customElement('moni-file-field')
|
|
187
|
+
], MoniFileField);
|
|
188
|
+
export { MoniFileField };
|
|
189
|
+
export default MoniFileField;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { MoniElement } from './_base/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Visual-only icon.
|
|
4
|
+
*
|
|
5
|
+
* Renders a Material Symbols glyph by name. The font must be loaded
|
|
6
|
+
* globally in the host document (see `@moni-labs/moni-ui/styles`).
|
|
7
|
+
*
|
|
8
|
+
* Attributes:
|
|
9
|
+
* - name: icon name from https://fonts.google.com/icons
|
|
10
|
+
* - size: tiny | small | medium (default) | large | extra
|
|
11
|
+
* - filled: present → switches to the filled variant (font-variation-settings)
|
|
12
|
+
*
|
|
13
|
+
* Slots:
|
|
14
|
+
* - default: fallback text if no name is given
|
|
15
|
+
* - (also accepts slotted <svg> or <img> as override)
|
|
16
|
+
*/
|
|
17
|
+
export declare class MoniIcon extends MoniElement {
|
|
18
|
+
name: string;
|
|
19
|
+
size: 'tiny' | 'small' | 'medium' | 'large' | 'extra';
|
|
20
|
+
filled: boolean;
|
|
21
|
+
static styles: import("lit").CSSResult[];
|
|
22
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
23
|
+
}
|
|
24
|
+
declare global {
|
|
25
|
+
interface HTMLElementTagNameMap {
|
|
26
|
+
'moni-icon': MoniIcon;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export default MoniIcon;
|
|
30
|
+
//# sourceMappingURL=moni-icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moni-icon.d.ts","sourceRoot":"","sources":["../../src/components/moni-icon.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;;;;;;GAcG;AACH,qBACa,QAAS,SAAQ,WAAW;IACX,IAAI,SAAM;IAEvC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAY;IACrB,MAAM,UAAS;IAE3D,OAAgB,MAAM,4BAyDpB;IAEO,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, css } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { MoniElement, sharedStyles } from './_base/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Visual-only icon.
|
|
12
|
+
*
|
|
13
|
+
* Renders a Material Symbols glyph by name. The font must be loaded
|
|
14
|
+
* globally in the host document (see `@moni-labs/moni-ui/styles`).
|
|
15
|
+
*
|
|
16
|
+
* Attributes:
|
|
17
|
+
* - name: icon name from https://fonts.google.com/icons
|
|
18
|
+
* - size: tiny | small | medium (default) | large | extra
|
|
19
|
+
* - filled: present → switches to the filled variant (font-variation-settings)
|
|
20
|
+
*
|
|
21
|
+
* Slots:
|
|
22
|
+
* - default: fallback text if no name is given
|
|
23
|
+
* - (also accepts slotted <svg> or <img> as override)
|
|
24
|
+
*/
|
|
25
|
+
let MoniIcon = class MoniIcon extends MoniElement {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.name = '';
|
|
29
|
+
this.size = 'medium';
|
|
30
|
+
this.filled = false;
|
|
31
|
+
}
|
|
32
|
+
static { this.styles = [
|
|
33
|
+
sharedStyles,
|
|
34
|
+
css `
|
|
35
|
+
:host {
|
|
36
|
+
--_size: 1.5rem;
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
vertical-align: middle;
|
|
41
|
+
font-family: var(--font-icon);
|
|
42
|
+
font-weight: normal;
|
|
43
|
+
font-style: normal;
|
|
44
|
+
font-size: var(--_size);
|
|
45
|
+
letter-spacing: normal;
|
|
46
|
+
text-transform: none;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
word-wrap: normal;
|
|
49
|
+
direction: ltr;
|
|
50
|
+
font-feature-settings: 'liga';
|
|
51
|
+
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
52
|
+
-webkit-font-smoothing: antialiased;
|
|
53
|
+
line-height: 1;
|
|
54
|
+
inline-size: var(--_size);
|
|
55
|
+
block-size: var(--_size);
|
|
56
|
+
/* Explicit inherit so the icon glyph picks up color from
|
|
57
|
+
whatever consumer wraps it (button variants, chip selected
|
|
58
|
+
state, list-item active, etc.). */
|
|
59
|
+
color: inherit;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([size='tiny']) {
|
|
63
|
+
--_size: 1rem;
|
|
64
|
+
}
|
|
65
|
+
:host([size='small']) {
|
|
66
|
+
--_size: 1.25rem;
|
|
67
|
+
}
|
|
68
|
+
:host([size='medium']) {
|
|
69
|
+
--_size: 1.5rem;
|
|
70
|
+
}
|
|
71
|
+
:host([size='large']) {
|
|
72
|
+
--_size: 1.75rem;
|
|
73
|
+
}
|
|
74
|
+
:host([size='extra']) {
|
|
75
|
+
--_size: 2rem;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([filled]) {
|
|
79
|
+
font-variation-settings: 'FILL' 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
::slotted(svg),
|
|
83
|
+
::slotted(img) {
|
|
84
|
+
inline-size: 100%;
|
|
85
|
+
block-size: 100%;
|
|
86
|
+
object-fit: contain;
|
|
87
|
+
}
|
|
88
|
+
`
|
|
89
|
+
]; }
|
|
90
|
+
render() {
|
|
91
|
+
return html `<slot>${this.name}</slot>`;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
__decorate([
|
|
95
|
+
property({ reflect: true })
|
|
96
|
+
], MoniIcon.prototype, "name", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
property({ reflect: true })
|
|
99
|
+
], MoniIcon.prototype, "size", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
property({ type: Boolean, reflect: true })
|
|
102
|
+
], MoniIcon.prototype, "filled", void 0);
|
|
103
|
+
MoniIcon = __decorate([
|
|
104
|
+
customElement('moni-icon')
|
|
105
|
+
], MoniIcon);
|
|
106
|
+
export { MoniIcon };
|
|
107
|
+
export default MoniIcon;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { MoniElement } from './_base/index.js';
|
|
2
|
+
import './moni-icon.js';
|
|
3
|
+
/**
|
|
4
|
+
* Material 3 List Item (`m3-docs/components/lists/specs.md`).
|
|
5
|
+
*
|
|
6
|
+
* One row in a `<moni-list>`. Supports up to 3 lines of text:
|
|
7
|
+
* - line 1: headline (required).
|
|
8
|
+
* - line 2: supporting text (optional).
|
|
9
|
+
* - line 3: trailing meta text (optional).
|
|
10
|
+
*
|
|
11
|
+
* Plus optional leading/trailing icons or avatars.
|
|
12
|
+
*
|
|
13
|
+
* M3 measurements:
|
|
14
|
+
* - Min height: 56dp (1-line), 72dp (2-line), 88dp (3-line).
|
|
15
|
+
* - Horizontal padding: 16dp.
|
|
16
|
+
* - Vertical padding: 8dp top/bottom (so 1-line is 56dp tall).
|
|
17
|
+
* - Leading icon/avatar size: 24dp.
|
|
18
|
+
*
|
|
19
|
+
* Attributes:
|
|
20
|
+
* - lines: 1 (default) | 2 | 3
|
|
21
|
+
* - icon: Material Symbols name (leading icon)
|
|
22
|
+
* - avatar: URL for a leading image
|
|
23
|
+
* - trailing-icon: Material Symbols name (trailing icon)
|
|
24
|
+
* - active: present → background uses secondary-container
|
|
25
|
+
* - disabled: present → opacity 38%, cursor not-allowed
|
|
26
|
+
* - href: present → renders as <a>; otherwise <button>
|
|
27
|
+
*
|
|
28
|
+
* Slots:
|
|
29
|
+
* - default: headline (line 1)
|
|
30
|
+
* - supporting:line 2 text
|
|
31
|
+
* - meta: line 3 text
|
|
32
|
+
* - trailing-meta: trailing small text (right side)
|
|
33
|
+
*/
|
|
34
|
+
export declare class MoniListItem extends MoniElement {
|
|
35
|
+
lines: 1 | 2 | 3;
|
|
36
|
+
icon: string;
|
|
37
|
+
avatar: string;
|
|
38
|
+
trailingIcon: string;
|
|
39
|
+
active: boolean;
|
|
40
|
+
disabled: boolean;
|
|
41
|
+
href: string;
|
|
42
|
+
static styles: import("lit").CSSResult[];
|
|
43
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
44
|
+
}
|
|
45
|
+
declare global {
|
|
46
|
+
interface HTMLElementTagNameMap {
|
|
47
|
+
'moni-list-item': MoniListItem;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export default MoniListItem;
|
|
51
|
+
//# sourceMappingURL=moni-list-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moni-list-item.d.ts","sourceRoot":"","sources":["../../src/components/moni-list-item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBACa,YAAa,SAAQ,WAAW;IAE5C,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAK;IACQ,IAAI,SAAM;IACV,MAAM,SAAM;IAEzC,YAAY,SAAM;IAC0B,MAAM,UAAS;IACf,QAAQ,UAAS;IAChC,IAAI,SAAM;IAEvC,OAAgB,MAAM,4BAoHpB;IAEO,MAAM;CA+Cf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,gBAAgB,EAAE,YAAY,CAAC;KAC/B;CACD;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, css, nothing } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { MoniElement, sharedStyles } from './_base/index.js';
|
|
10
|
+
import './moni-icon.js';
|
|
11
|
+
/**
|
|
12
|
+
* Material 3 List Item (`m3-docs/components/lists/specs.md`).
|
|
13
|
+
*
|
|
14
|
+
* One row in a `<moni-list>`. Supports up to 3 lines of text:
|
|
15
|
+
* - line 1: headline (required).
|
|
16
|
+
* - line 2: supporting text (optional).
|
|
17
|
+
* - line 3: trailing meta text (optional).
|
|
18
|
+
*
|
|
19
|
+
* Plus optional leading/trailing icons or avatars.
|
|
20
|
+
*
|
|
21
|
+
* M3 measurements:
|
|
22
|
+
* - Min height: 56dp (1-line), 72dp (2-line), 88dp (3-line).
|
|
23
|
+
* - Horizontal padding: 16dp.
|
|
24
|
+
* - Vertical padding: 8dp top/bottom (so 1-line is 56dp tall).
|
|
25
|
+
* - Leading icon/avatar size: 24dp.
|
|
26
|
+
*
|
|
27
|
+
* Attributes:
|
|
28
|
+
* - lines: 1 (default) | 2 | 3
|
|
29
|
+
* - icon: Material Symbols name (leading icon)
|
|
30
|
+
* - avatar: URL for a leading image
|
|
31
|
+
* - trailing-icon: Material Symbols name (trailing icon)
|
|
32
|
+
* - active: present → background uses secondary-container
|
|
33
|
+
* - disabled: present → opacity 38%, cursor not-allowed
|
|
34
|
+
* - href: present → renders as <a>; otherwise <button>
|
|
35
|
+
*
|
|
36
|
+
* Slots:
|
|
37
|
+
* - default: headline (line 1)
|
|
38
|
+
* - supporting:line 2 text
|
|
39
|
+
* - meta: line 3 text
|
|
40
|
+
* - trailing-meta: trailing small text (right side)
|
|
41
|
+
*/
|
|
42
|
+
let MoniListItem = class MoniListItem extends MoniElement {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments);
|
|
45
|
+
this.lines = 1;
|
|
46
|
+
this.icon = '';
|
|
47
|
+
this.avatar = '';
|
|
48
|
+
this.trailingIcon = '';
|
|
49
|
+
this.active = false;
|
|
50
|
+
this.disabled = false;
|
|
51
|
+
this.href = '';
|
|
52
|
+
}
|
|
53
|
+
static { this.styles = [
|
|
54
|
+
sharedStyles,
|
|
55
|
+
css `
|
|
56
|
+
:host {
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: 1rem;
|
|
60
|
+
padding: 0.5rem 1rem;
|
|
61
|
+
min-block-size: 3.5rem;
|
|
62
|
+
color: var(--on-surface);
|
|
63
|
+
background-color: transparent;
|
|
64
|
+
text-decoration: none;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
position: relative;
|
|
67
|
+
font-family: var(--font);
|
|
68
|
+
transition: background-color var(--speed2);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host([active]) {
|
|
72
|
+
background-color: var(--secondary-container);
|
|
73
|
+
color: var(--on-secondary-container);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([disabled]) {
|
|
77
|
+
opacity: 0.38;
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
cursor: not-allowed;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host(:not(:last-child)) {
|
|
83
|
+
border-block-end: 0.0625rem solid var(--outline-variant);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:host([lines='2']) {
|
|
87
|
+
min-block-size: 4.5rem;
|
|
88
|
+
}
|
|
89
|
+
:host([lines='3']) {
|
|
90
|
+
min-block-size: 5.5rem;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.leading,
|
|
94
|
+
.trailing {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
flex: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.leading-icon {
|
|
102
|
+
font-size: 1.5rem;
|
|
103
|
+
color: var(--on-surface-variant);
|
|
104
|
+
}
|
|
105
|
+
:host([active]) .leading-icon {
|
|
106
|
+
color: var(--on-secondary-container);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.avatar {
|
|
110
|
+
inline-size: 2.5rem;
|
|
111
|
+
block-size: 2.5rem;
|
|
112
|
+
border-radius: 50%;
|
|
113
|
+
background-color: var(--surface-container);
|
|
114
|
+
background-size: cover;
|
|
115
|
+
background-position: center;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.text {
|
|
119
|
+
flex: auto;
|
|
120
|
+
min-inline-size: 0;
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
gap: 0.125rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.headline {
|
|
127
|
+
font-size: 1rem;
|
|
128
|
+
line-height: 1.5rem;
|
|
129
|
+
font-weight: 500;
|
|
130
|
+
color: inherit;
|
|
131
|
+
margin: 0;
|
|
132
|
+
padding: 0;
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
text-overflow: ellipsis;
|
|
135
|
+
white-space: nowrap;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.supporting,
|
|
139
|
+
.meta {
|
|
140
|
+
font-size: 0.875rem;
|
|
141
|
+
line-height: 1.25rem;
|
|
142
|
+
font-weight: 400;
|
|
143
|
+
color: var(--on-surface-variant);
|
|
144
|
+
margin: 0;
|
|
145
|
+
padding: 0;
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
text-overflow: ellipsis;
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
}
|
|
150
|
+
:host([active]) .supporting,
|
|
151
|
+
:host([active]) .meta {
|
|
152
|
+
color: var(--on-secondary-container);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.trailing-meta {
|
|
156
|
+
font-size: 0.75rem;
|
|
157
|
+
color: var(--on-surface-variant);
|
|
158
|
+
white-space: nowrap;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.trailing-icon {
|
|
162
|
+
font-size: 1.5rem;
|
|
163
|
+
color: var(--on-surface-variant);
|
|
164
|
+
}
|
|
165
|
+
:host([active]) .trailing-icon {
|
|
166
|
+
color: var(--on-secondary-container);
|
|
167
|
+
}
|
|
168
|
+
`
|
|
169
|
+
]; }
|
|
170
|
+
render() {
|
|
171
|
+
const leading = this.avatar
|
|
172
|
+
? html `<span
|
|
173
|
+
class="avatar"
|
|
174
|
+
part="avatar"
|
|
175
|
+
style="background-image: url('${this.avatar}');"
|
|
176
|
+
></span>`
|
|
177
|
+
: this.icon
|
|
178
|
+
? html `<span class="leading leading-icon" part="leading">
|
|
179
|
+
<moni-icon name="${this.icon}"></moni-icon>
|
|
180
|
+
</span>`
|
|
181
|
+
: html `<slot name="leading"></slot>`;
|
|
182
|
+
const trailing = this.trailingIcon
|
|
183
|
+
? html `<span class="trailing trailing-icon" part="trailing">
|
|
184
|
+
<moni-icon name="${this.trailingIcon}"></moni-icon>
|
|
185
|
+
</span>`
|
|
186
|
+
: html `<slot name="trailing"></slot>`;
|
|
187
|
+
const supporting = this.lines >= 2
|
|
188
|
+
? html `<span class="supporting" part="supporting"
|
|
189
|
+
><slot name="supporting"></slot
|
|
190
|
+
></span>`
|
|
191
|
+
: nothing;
|
|
192
|
+
const meta = this.lines >= 3
|
|
193
|
+
? html `<span class="meta" part="meta"><slot name="meta"></slot></span>`
|
|
194
|
+
: nothing;
|
|
195
|
+
const inner = html `
|
|
196
|
+
${leading}
|
|
197
|
+
<div class="text" part="text">
|
|
198
|
+
<span class="headline" part="headline"><slot></slot></span>
|
|
199
|
+
${supporting} ${meta}
|
|
200
|
+
</div>
|
|
201
|
+
${trailing}
|
|
202
|
+
<slot name="trailing-meta"></slot>
|
|
203
|
+
`;
|
|
204
|
+
return this.href
|
|
205
|
+
? html `<a
|
|
206
|
+
class="row"
|
|
207
|
+
part="row"
|
|
208
|
+
href=${this.href}
|
|
209
|
+
>${inner}</a
|
|
210
|
+
>`
|
|
211
|
+
: inner;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
__decorate([
|
|
215
|
+
property({ reflect: true })
|
|
216
|
+
], MoniListItem.prototype, "lines", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
property({ reflect: true })
|
|
219
|
+
], MoniListItem.prototype, "icon", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
property({ reflect: true })
|
|
222
|
+
], MoniListItem.prototype, "avatar", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
property({ reflect: true, attribute: 'trailing-icon' })
|
|
225
|
+
], MoniListItem.prototype, "trailingIcon", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ type: Boolean, reflect: true })
|
|
228
|
+
], MoniListItem.prototype, "active", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
property({ type: Boolean, reflect: true })
|
|
231
|
+
], MoniListItem.prototype, "disabled", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
property({ reflect: true })
|
|
234
|
+
], MoniListItem.prototype, "href", void 0);
|
|
235
|
+
MoniListItem = __decorate([
|
|
236
|
+
customElement('moni-list-item')
|
|
237
|
+
], MoniListItem);
|
|
238
|
+
export { MoniListItem };
|
|
239
|
+
export default MoniListItem;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MoniElement } from './_base/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Material 3 List (`m3-docs/components/lists/specs.md`).
|
|
4
|
+
*
|
|
5
|
+
* A list is a continuous vertical index of text and images. The
|
|
6
|
+
* container itself is purely structural (no padding); spacing and
|
|
7
|
+
* dividers are controlled by `<moni-list-item>` children.
|
|
8
|
+
*
|
|
9
|
+
* Two visual variants:
|
|
10
|
+
* - **default**: 8dp top/bottom padding between items (handled by items).
|
|
11
|
+
* - **border**: dividers drawn between items.
|
|
12
|
+
*
|
|
13
|
+
* Attributes:
|
|
14
|
+
* - variant: '' (default) | border
|
|
15
|
+
* - rounded: when set, items use a 4dp corner radius.
|
|
16
|
+
*
|
|
17
|
+
* Slots:
|
|
18
|
+
* - default: <moni-list-item> children.
|
|
19
|
+
*/
|
|
20
|
+
export declare class MoniList extends MoniElement {
|
|
21
|
+
variant: '' | 'border';
|
|
22
|
+
rounded: boolean;
|
|
23
|
+
static styles: import("lit").CSSResult[];
|
|
24
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
'moni-list': MoniList;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export default MoniList;
|
|
32
|
+
//# sourceMappingURL=moni-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moni-list.d.ts","sourceRoot":"","sources":["../../src/components/moni-list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAE7D;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,QAAS,SAAQ,WAAW;IACX,OAAO,EAAE,EAAE,GAAG,QAAQ,CAAM;IACb,OAAO,UAAS;IAE5D,OAAgB,MAAM,4BAkBpB;IAEO,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD;AAED,eAAe,QAAQ,CAAC"}
|