@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,122 @@
|
|
|
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, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
+
import { MoniElement, sharedStyles } from './_base/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Visual-only split button. Combines a primary action button and a dropdown menu trigger.
|
|
12
|
+
*
|
|
13
|
+
* Attributes:
|
|
14
|
+
* - variant: filled (default) | tonal | outlined | elevated
|
|
15
|
+
* - size: small | medium (default) | large | extra
|
|
16
|
+
* - gap: custom gap space (e.g. "8px" or "1rem")
|
|
17
|
+
*
|
|
18
|
+
* Slots:
|
|
19
|
+
* - leading-button: The main action button
|
|
20
|
+
* - trailing-button: The menu dropdown button
|
|
21
|
+
*/
|
|
22
|
+
let MoniSplitButton = class MoniSplitButton extends MoniElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.variant = 'filled';
|
|
26
|
+
this.size = 'medium';
|
|
27
|
+
this.gap = '';
|
|
28
|
+
}
|
|
29
|
+
static { this.styles = [
|
|
30
|
+
sharedStyles,
|
|
31
|
+
css `
|
|
32
|
+
:host {
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
vertical-align: middle;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.wrapper {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: 0;
|
|
42
|
+
width: 100%;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
::slotted(*:not(:first-child)) {
|
|
46
|
+
margin-inline-start: var(--moni-button-group-connected-gap, -0.0625rem);
|
|
47
|
+
}
|
|
48
|
+
`
|
|
49
|
+
]; }
|
|
50
|
+
updated(changedProperties) {
|
|
51
|
+
super.updated(changedProperties);
|
|
52
|
+
if (changedProperties.has('variant') || changedProperties.has('size') || changedProperties.has('gap')) {
|
|
53
|
+
this.updateChildren();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
handleSlotChange() {
|
|
57
|
+
this.updateChildren();
|
|
58
|
+
}
|
|
59
|
+
getGapValue(gap) {
|
|
60
|
+
if (!gap)
|
|
61
|
+
return '';
|
|
62
|
+
const preset = gap.toLowerCase();
|
|
63
|
+
if (preset === 'xs' || preset === 'xsmall')
|
|
64
|
+
return '1.125rem';
|
|
65
|
+
if (preset === 's' || preset === 'small')
|
|
66
|
+
return '0.75rem';
|
|
67
|
+
if (preset === 'm' || preset === 'medium')
|
|
68
|
+
return '0.5rem';
|
|
69
|
+
if (preset === 'l' || preset === 'large')
|
|
70
|
+
return '0.5rem';
|
|
71
|
+
if (preset === 'xl' || preset === 'xlarge')
|
|
72
|
+
return '0.5rem';
|
|
73
|
+
return gap;
|
|
74
|
+
}
|
|
75
|
+
updateChildren() {
|
|
76
|
+
const leading = this.leadingElements.find((el) => el.tagName.toLowerCase() === 'moni-button' || el.tagName.toLowerCase() === 'moni-icon-button');
|
|
77
|
+
const trailing = this.trailingElements.find((el) => el.tagName.toLowerCase() === 'moni-button' || el.tagName.toLowerCase() === 'moni-icon-button');
|
|
78
|
+
const hasGap = !!this.gap;
|
|
79
|
+
if (leading) {
|
|
80
|
+
leading.setAttribute('shape', hasGap ? 'left-round' : 'left-round-flat');
|
|
81
|
+
leading.setAttribute('size', this.size);
|
|
82
|
+
leading.setAttribute('variant', this.variant);
|
|
83
|
+
}
|
|
84
|
+
if (trailing) {
|
|
85
|
+
trailing.setAttribute('shape', hasGap ? 'right-round' : 'right-round-flat');
|
|
86
|
+
trailing.setAttribute('size', this.size);
|
|
87
|
+
trailing.setAttribute('variant', this.variant);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
render() {
|
|
91
|
+
const resolvedGap = this.getGapValue(this.gap);
|
|
92
|
+
const inlineStyles = resolvedGap
|
|
93
|
+
? `gap: ${resolvedGap}; --moni-button-group-connected-gap: 0px;`
|
|
94
|
+
: '';
|
|
95
|
+
return html `
|
|
96
|
+
<div class="wrapper" style=${inlineStyles} part="wrapper">
|
|
97
|
+
<slot name="leading-button" @slotchange=${this.handleSlotChange}></slot>
|
|
98
|
+
<slot name="trailing-button" @slotchange=${this.handleSlotChange}></slot>
|
|
99
|
+
</div>
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
__decorate([
|
|
104
|
+
property({ reflect: true })
|
|
105
|
+
], MoniSplitButton.prototype, "variant", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
property({ reflect: true })
|
|
108
|
+
], MoniSplitButton.prototype, "size", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
property()
|
|
111
|
+
], MoniSplitButton.prototype, "gap", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
queryAssignedElements({ slot: 'leading-button', flatten: true })
|
|
114
|
+
], MoniSplitButton.prototype, "leadingElements", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
queryAssignedElements({ slot: 'trailing-button', flatten: true })
|
|
117
|
+
], MoniSplitButton.prototype, "trailingElements", void 0);
|
|
118
|
+
MoniSplitButton = __decorate([
|
|
119
|
+
customElement('moni-split-button')
|
|
120
|
+
], MoniSplitButton);
|
|
121
|
+
export { MoniSplitButton };
|
|
122
|
+
export default MoniSplitButton;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { MoniElement } from './_base/index.js';
|
|
2
|
+
import './moni-icon.js';
|
|
3
|
+
/**
|
|
4
|
+
* Visual-only step. Renders an icon/number, a title, and a description.
|
|
5
|
+
*
|
|
6
|
+
* Attributes:
|
|
7
|
+
* - title: step heading
|
|
8
|
+
* - description: step secondary text
|
|
9
|
+
* - active: present → primary color highlight
|
|
10
|
+
* - completed: present → filled circle with check
|
|
11
|
+
* - icon: Material Symbols name (overrides the number)
|
|
12
|
+
* - index: numeric label (auto-set by parent stepper, optional)
|
|
13
|
+
*/
|
|
14
|
+
export declare class MoniStep extends MoniElement {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
active: boolean;
|
|
18
|
+
completed: boolean;
|
|
19
|
+
icon: string;
|
|
20
|
+
index: number;
|
|
21
|
+
static styles: import("lit").CSSResult[];
|
|
22
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
23
|
+
}
|
|
24
|
+
declare global {
|
|
25
|
+
interface HTMLElementTagNameMap {
|
|
26
|
+
'moni-step': MoniStep;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export default MoniStep;
|
|
30
|
+
//# sourceMappingURL=moni-step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moni-step.d.ts","sourceRoot":"","sources":["../../src/components/moni-step.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,qBACa,QAAS,SAAQ,WAAW;IACX,KAAK,SAAM;IACX,WAAW,SAAM;IACF,MAAM,UAAS;IACf,SAAS,UAAS;IACjC,IAAI,SAAM;IACI,KAAK,SAAK;IAErD,OAAgB,MAAM,4BAqGpB;IAEO,MAAM;CAkBf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,175 @@
|
|
|
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
|
+
import './moni-icon.js';
|
|
11
|
+
/**
|
|
12
|
+
* Visual-only step. Renders an icon/number, a title, and a description.
|
|
13
|
+
*
|
|
14
|
+
* Attributes:
|
|
15
|
+
* - title: step heading
|
|
16
|
+
* - description: step secondary text
|
|
17
|
+
* - active: present → primary color highlight
|
|
18
|
+
* - completed: present → filled circle with check
|
|
19
|
+
* - icon: Material Symbols name (overrides the number)
|
|
20
|
+
* - index: numeric label (auto-set by parent stepper, optional)
|
|
21
|
+
*/
|
|
22
|
+
let MoniStep = class MoniStep extends MoniElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.title = '';
|
|
26
|
+
this.description = '';
|
|
27
|
+
this.active = false;
|
|
28
|
+
this.completed = false;
|
|
29
|
+
this.icon = '';
|
|
30
|
+
this.index = 0;
|
|
31
|
+
}
|
|
32
|
+
static { this.styles = [
|
|
33
|
+
sharedStyles,
|
|
34
|
+
css `
|
|
35
|
+
:host {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
align-items: center;
|
|
39
|
+
text-align: center;
|
|
40
|
+
gap: 0.5rem;
|
|
41
|
+
font-family: var(--font);
|
|
42
|
+
color: var(--on-surface-variant);
|
|
43
|
+
position: relative;
|
|
44
|
+
flex: 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host(:not(:last-child))::after {
|
|
48
|
+
content: '';
|
|
49
|
+
position: absolute;
|
|
50
|
+
inset-inline-start: calc(50% + 1.25rem);
|
|
51
|
+
inset-inline-end: calc(-50% + 1.25rem);
|
|
52
|
+
inset-block-start: 1rem;
|
|
53
|
+
block-size: 0.0625rem;
|
|
54
|
+
background-color: var(--outline-variant);
|
|
55
|
+
z-index: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host-context(moni-stepper[orientation='vertical']) {
|
|
59
|
+
flex-direction: row;
|
|
60
|
+
align-items: flex-start;
|
|
61
|
+
text-align: start;
|
|
62
|
+
gap: 1rem;
|
|
63
|
+
min-block-size: 4rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Vertical connector. Geometry: the dot occupies y=0 to y=2rem at
|
|
67
|
+
the top of the step (host is column flex with min-block-size 4rem).
|
|
68
|
+
The connector runs from the BOTTOM of the current dot (y=2rem) to
|
|
69
|
+
the BOTTOM of the current step (y=100%). This formula stays
|
|
70
|
+
calibrated regardless of step height. */
|
|
71
|
+
:host-context(moni-stepper[orientation='vertical']):host(:not(:last-child))::after {
|
|
72
|
+
position: absolute;
|
|
73
|
+
inset-inline-start: calc(1rem - 0.03125rem);
|
|
74
|
+
inset-block-start: 2rem;
|
|
75
|
+
inset-inline-end: auto;
|
|
76
|
+
inline-size: 0.0625rem;
|
|
77
|
+
block-size: calc(100% - 2rem);
|
|
78
|
+
z-index: 0;
|
|
79
|
+
margin: 0;
|
|
80
|
+
background-color: var(--outline-variant);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.dot {
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
inline-size: 2rem;
|
|
88
|
+
block-size: 2rem;
|
|
89
|
+
border-radius: 50%;
|
|
90
|
+
background-color: var(--surface-container);
|
|
91
|
+
color: var(--on-surface-variant);
|
|
92
|
+
font-size: 0.875rem;
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
flex: none;
|
|
95
|
+
z-index: 1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host([active]) .dot {
|
|
99
|
+
background-color: var(--primary);
|
|
100
|
+
color: var(--on-primary);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host([completed]) .dot {
|
|
104
|
+
background-color: var(--primary);
|
|
105
|
+
color: var(--on-primary);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([active]) .text {
|
|
109
|
+
color: var(--on-surface);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.text {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
min-inline-size: 0;
|
|
116
|
+
z-index: 1;
|
|
117
|
+
}
|
|
118
|
+
.title {
|
|
119
|
+
font-size: 0.875rem;
|
|
120
|
+
font-weight: 500;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
text-overflow: ellipsis;
|
|
123
|
+
white-space: nowrap;
|
|
124
|
+
}
|
|
125
|
+
.description {
|
|
126
|
+
font-size: 0.75rem;
|
|
127
|
+
opacity: 0.7;
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
text-overflow: ellipsis;
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
}
|
|
132
|
+
`
|
|
133
|
+
]; }
|
|
134
|
+
render() {
|
|
135
|
+
const dot = this.completed
|
|
136
|
+
? html `<moni-icon name="check"></moni-icon>`
|
|
137
|
+
: this.icon
|
|
138
|
+
? html `<moni-icon name="${this.icon}"></moni-icon>`
|
|
139
|
+
: html `${this.index + 1}`;
|
|
140
|
+
return html `
|
|
141
|
+
<span class="dot" part="dot">${dot}</span>
|
|
142
|
+
<div class="text" part="text">
|
|
143
|
+
<span class="title" part="title"
|
|
144
|
+
><slot>${this.title}</slot></span
|
|
145
|
+
>
|
|
146
|
+
<span class="description" part="description"
|
|
147
|
+
>${this.description}</span
|
|
148
|
+
>
|
|
149
|
+
</div>
|
|
150
|
+
`;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
__decorate([
|
|
154
|
+
property({ reflect: true })
|
|
155
|
+
], MoniStep.prototype, "title", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
property({ reflect: true })
|
|
158
|
+
], MoniStep.prototype, "description", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
property({ type: Boolean, reflect: true })
|
|
161
|
+
], MoniStep.prototype, "active", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
property({ type: Boolean, reflect: true })
|
|
164
|
+
], MoniStep.prototype, "completed", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
property({ reflect: true })
|
|
167
|
+
], MoniStep.prototype, "icon", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
property({ type: Number, reflect: true })
|
|
170
|
+
], MoniStep.prototype, "index", void 0);
|
|
171
|
+
MoniStep = __decorate([
|
|
172
|
+
customElement('moni-step')
|
|
173
|
+
], MoniStep);
|
|
174
|
+
export { MoniStep };
|
|
175
|
+
export default MoniStep;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MoniElement } from './_base/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Visual-only stepper. Wraps a list of <moni-step> children, propagates the
|
|
4
|
+
* `current` index to each child, and styles the connectors between them.
|
|
5
|
+
*
|
|
6
|
+
* Attributes:
|
|
7
|
+
* - orientation: horizontal (default) | vertical
|
|
8
|
+
* - current: zero-based index of the active step
|
|
9
|
+
*/
|
|
10
|
+
export declare class MoniStepper extends MoniElement {
|
|
11
|
+
orientation: 'horizontal' | 'vertical';
|
|
12
|
+
current: number;
|
|
13
|
+
private _steps;
|
|
14
|
+
updated(changed: Map<string, unknown>): void;
|
|
15
|
+
/**
|
|
16
|
+
* Propagate the `current` index to each child <moni-step>:
|
|
17
|
+
* - sets `index` from the child's position
|
|
18
|
+
* - sets `completed` on every step before `current`
|
|
19
|
+
* - sets `active` on the step at `current`
|
|
20
|
+
*
|
|
21
|
+
* Deferred to a microtask so that slotted children are guaranteed
|
|
22
|
+
* to have finished their first update cycle before we write to them.
|
|
23
|
+
*/
|
|
24
|
+
private _syncSteps;
|
|
25
|
+
static styles: import("lit").CSSResult[];
|
|
26
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
27
|
+
private _onSlotChange;
|
|
28
|
+
}
|
|
29
|
+
declare global {
|
|
30
|
+
interface HTMLElementTagNameMap {
|
|
31
|
+
'moni-stepper': MoniStepper;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export default MoniStepper;
|
|
35
|
+
//# sourceMappingURL=moni-stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moni-stepper.d.ts","sourceRoot":"","sources":["../../src/components/moni-stepper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAG7D;;;;;;;GAOG;AACH,qBACa,WAAY,SAAQ,WAAW;IAE3C,WAAW,EAAE,YAAY,GAAG,UAAU,CAAgB;IACX,OAAO,SAAK;IAGvD,OAAO,CAAC,MAAM,CAAc;IAEnB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAU9C;;;;;;;;OAQG;IACH,OAAO,CAAC,UAAU;IAclB,OAAgB,MAAM,4BAwBpB;IAEO,MAAM;IAMf,OAAO,CAAC,aAAa,CAGnB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,WAAW,CAAC;KAC5B;CACD;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
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, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
+
import { MoniElement, sharedStyles } from './_base/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Visual-only stepper. Wraps a list of <moni-step> children, propagates the
|
|
12
|
+
* `current` index to each child, and styles the connectors between them.
|
|
13
|
+
*
|
|
14
|
+
* Attributes:
|
|
15
|
+
* - orientation: horizontal (default) | vertical
|
|
16
|
+
* - current: zero-based index of the active step
|
|
17
|
+
*/
|
|
18
|
+
let MoniStepper = class MoniStepper extends MoniElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.orientation = 'horizontal';
|
|
22
|
+
this.current = 0;
|
|
23
|
+
this._onSlotChange = () => {
|
|
24
|
+
// Steps may have been added/removed; re-sync.
|
|
25
|
+
this._syncSteps();
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
updated(changed) {
|
|
29
|
+
if (changed.has('current') ||
|
|
30
|
+
changed.has('orientation') ||
|
|
31
|
+
changed.size === 0) {
|
|
32
|
+
this._syncSteps();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Propagate the `current` index to each child <moni-step>:
|
|
37
|
+
* - sets `index` from the child's position
|
|
38
|
+
* - sets `completed` on every step before `current`
|
|
39
|
+
* - sets `active` on the step at `current`
|
|
40
|
+
*
|
|
41
|
+
* Deferred to a microtask so that slotted children are guaranteed
|
|
42
|
+
* to have finished their first update cycle before we write to them.
|
|
43
|
+
*/
|
|
44
|
+
_syncSteps() {
|
|
45
|
+
Promise.resolve().then(() => {
|
|
46
|
+
let steps = this._steps || [];
|
|
47
|
+
if (steps.length === 0) {
|
|
48
|
+
steps = Array.from(this.querySelectorAll('moni-step'));
|
|
49
|
+
}
|
|
50
|
+
steps.forEach((step, i) => {
|
|
51
|
+
step.index = i;
|
|
52
|
+
step.completed = i < this.current;
|
|
53
|
+
step.active = i === this.current;
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
static { this.styles = [
|
|
58
|
+
sharedStyles,
|
|
59
|
+
css `
|
|
60
|
+
:host {
|
|
61
|
+
display: block;
|
|
62
|
+
font-family: var(--font);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.list {
|
|
66
|
+
display: flex;
|
|
67
|
+
gap: 0.5rem;
|
|
68
|
+
padding: 0;
|
|
69
|
+
margin: 0;
|
|
70
|
+
list-style: none;
|
|
71
|
+
}
|
|
72
|
+
:host([orientation='vertical']) .list {
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
::slotted(*) {
|
|
77
|
+
flex: 1;
|
|
78
|
+
min-inline-size: 0;
|
|
79
|
+
}
|
|
80
|
+
`
|
|
81
|
+
]; }
|
|
82
|
+
render() {
|
|
83
|
+
return html `<ol class="list" part="stepper">
|
|
84
|
+
<slot @slotchange=${this._onSlotChange}></slot>
|
|
85
|
+
</ol>`;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
__decorate([
|
|
89
|
+
property({ reflect: true })
|
|
90
|
+
], MoniStepper.prototype, "orientation", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
property({ type: Number, reflect: true })
|
|
93
|
+
], MoniStepper.prototype, "current", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
queryAssignedElements({ selector: 'moni-step' })
|
|
96
|
+
], MoniStepper.prototype, "_steps", void 0);
|
|
97
|
+
MoniStepper = __decorate([
|
|
98
|
+
customElement('moni-stepper')
|
|
99
|
+
], MoniStepper);
|
|
100
|
+
export { MoniStepper };
|
|
101
|
+
export default MoniStepper;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { MoniElement } from './_base/index.js';
|
|
2
|
+
import './moni-icon.js';
|
|
3
|
+
/**
|
|
4
|
+
* Switch styled per Material Design 3 specs.
|
|
5
|
+
*
|
|
6
|
+
* M3 measurements (`m3-docs/components/switch/specs.md`):
|
|
7
|
+
* - Track: 52dp × 32dp, 2dp outline, full corner radius
|
|
8
|
+
* - Handle (thumb): 16dp unselected, 24dp selected, 28dp pressed
|
|
9
|
+
* - State layer: 40dp circular ripple on hover/focus/pressed
|
|
10
|
+
* - Icon (optional): 16dp on selected and/or unselected handle
|
|
11
|
+
*
|
|
12
|
+
* Attributes:
|
|
13
|
+
* - label: text label (displayed to the right of the switch)
|
|
14
|
+
* - checked: present
|
|
15
|
+
* - disabled: present
|
|
16
|
+
* - icon: present → renders check/close icons inside the thumb
|
|
17
|
+
* - name: forwarded to input.name
|
|
18
|
+
* - value: forwarded to input.value
|
|
19
|
+
*/
|
|
20
|
+
export declare class MoniSwitch extends MoniElement {
|
|
21
|
+
label: string;
|
|
22
|
+
checked: boolean;
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
icon: boolean;
|
|
25
|
+
name: string;
|
|
26
|
+
value: string;
|
|
27
|
+
private _input;
|
|
28
|
+
updated(changed: Map<string, unknown>): void;
|
|
29
|
+
private _onChange;
|
|
30
|
+
static styles: import("lit").CSSResult[];
|
|
31
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
32
|
+
}
|
|
33
|
+
declare global {
|
|
34
|
+
interface HTMLElementTagNameMap {
|
|
35
|
+
'moni-switch': MoniSwitch;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export default MoniSwitch;
|
|
39
|
+
//# sourceMappingURL=moni-switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moni-switch.d.ts","sourceRoot":"","sources":["../../src/components/moni-switch.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,UAAW,SAAQ,WAAW;IACb,KAAK,SAAM;IACI,OAAO,UAAS;IAChB,QAAQ,UAAS;IACjB,IAAI,UAAS;IAC5B,IAAI,SAAM;IACV,KAAK,SAAM;IAExB,OAAO,CAAC,MAAM,CAAoB;IAEzC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAO9C,OAAO,CAAC,SAAS;IAKjB,OAAgB,MAAM,4BAiKpB;IAEO,MAAM;CAmBf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,aAAa,EAAE,UAAU,CAAC;KAC1B;CACD;AAED,eAAe,UAAU,CAAC"}
|