@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,277 @@
|
|
|
1
|
+
import { html, css, nothing } from 'lit';
|
|
2
|
+
import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
|
|
3
|
+
import { MoniElement, sharedStyles } from './_base/index.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Visual-only button group. Organizes `moni-button` or `moni-icon-button`
|
|
7
|
+
* components in a row.
|
|
8
|
+
*
|
|
9
|
+
* **`variant="connected"`** is the Material Design 3 Expressive replacement
|
|
10
|
+
* for the deprecated `moni-segmented-button` (see
|
|
11
|
+
* `m3-docs/components/segmented-buttons/overview.md` § M3 Expressive update).
|
|
12
|
+
* In connected mode, segments share borders via propagated `shape` values
|
|
13
|
+
* (`left-round-flat`, `no-round`, `right-round-flat` for a gap-less row), and
|
|
14
|
+
* the group manages single/multi-select toggle state. This is the
|
|
15
|
+
* **only Moni component that intentionally uses `@click` listeners** —
|
|
16
|
+
* toggle behavior is essential to the M3 connected button group semantics.
|
|
17
|
+
*
|
|
18
|
+
* Accessibility:
|
|
19
|
+
* - The host renders `role="group"` (configurable via `role` attribute).
|
|
20
|
+
* - `aria-label` / `aria-labelledby` should be set by the consumer to
|
|
21
|
+
* identify the group to assistive technology.
|
|
22
|
+
*
|
|
23
|
+
* Attributes:
|
|
24
|
+
* - variant: standard (default) | connected
|
|
25
|
+
* - size: small | medium (default) | large | extra
|
|
26
|
+
* - multi: boolean (default false) — multiple toggles allowed
|
|
27
|
+
* - gap: custom gap space (e.g. "8px" or "1rem"); in `connected`
|
|
28
|
+
* variant the default is 0.125rem (2dp) per M3 spec
|
|
29
|
+
* - role: ARIA role override (default "group")
|
|
30
|
+
* - label: aria-label for the group
|
|
31
|
+
* - labelled-by: aria-labelledby reference
|
|
32
|
+
*/
|
|
33
|
+
@customElement('moni-button-group')
|
|
34
|
+
export class MoniButtonGroup extends MoniElement {
|
|
35
|
+
@property({ reflect: true })
|
|
36
|
+
variant: 'standard' | 'connected' = 'standard';
|
|
37
|
+
|
|
38
|
+
@property({ reflect: true })
|
|
39
|
+
size: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'extra' = 'medium';
|
|
40
|
+
|
|
41
|
+
@property({ type: Boolean, reflect: true })
|
|
42
|
+
multi = false;
|
|
43
|
+
|
|
44
|
+
@property()
|
|
45
|
+
gap = '';
|
|
46
|
+
|
|
47
|
+
@property({ reflect: true })
|
|
48
|
+
role: 'group' | 'toolbar' | 'radiogroup' = 'group';
|
|
49
|
+
|
|
50
|
+
@property({ reflect: true })
|
|
51
|
+
label = '';
|
|
52
|
+
|
|
53
|
+
@property({ reflect: true, attribute: 'labelled-by' })
|
|
54
|
+
labelledBy = '';
|
|
55
|
+
|
|
56
|
+
@queryAssignedElements({ flatten: true })
|
|
57
|
+
private slottedButtons!: HTMLElement[];
|
|
58
|
+
|
|
59
|
+
static override styles = [
|
|
60
|
+
sharedStyles,
|
|
61
|
+
css`
|
|
62
|
+
:host {
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
vertical-align: middle;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.group-container {
|
|
69
|
+
display: inline-flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
width: 100%;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host([variant='standard']) .group-container {
|
|
75
|
+
gap: 0.5rem;
|
|
76
|
+
}
|
|
77
|
+
:host([variant='standard'][size='xsmall']) .group-container {
|
|
78
|
+
gap: 1.125rem; /* 18dp */
|
|
79
|
+
}
|
|
80
|
+
:host([variant='standard'][size='small']) .group-container {
|
|
81
|
+
gap: 0.75rem; /* 12dp */
|
|
82
|
+
}
|
|
83
|
+
:host([variant='standard'][size='medium']) .group-container {
|
|
84
|
+
gap: 0.5rem; /* 8dp */
|
|
85
|
+
}
|
|
86
|
+
:host([variant='standard'][size='large']) .group-container {
|
|
87
|
+
gap: 0.5rem; /* 8dp */
|
|
88
|
+
}
|
|
89
|
+
:host([variant='standard'][size='xlarge']) .group-container,
|
|
90
|
+
:host([variant='standard'][size='extra']) .group-container {
|
|
91
|
+
gap: 0.5rem; /* 8dp */
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([variant='connected']) .group-container {
|
|
95
|
+
gap: 0.125rem; /* 2dp */
|
|
96
|
+
}
|
|
97
|
+
`
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
protected override updated(changedProperties: Map<string | number | symbol, unknown>) {
|
|
101
|
+
super.updated(changedProperties);
|
|
102
|
+
if (changedProperties.has('variant') || changedProperties.has('size') || changedProperties.has('gap')) {
|
|
103
|
+
this.updateChildren();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private handleSlotChange() {
|
|
108
|
+
this.updateChildren();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
private getGapValue(gap: string): string {
|
|
112
|
+
if (!gap) return '';
|
|
113
|
+
const preset = gap.toLowerCase();
|
|
114
|
+
if (preset === 'xs' || preset === 'xsmall') return '1.125rem';
|
|
115
|
+
if (preset === 's' || preset === 'small') return '0.75rem';
|
|
116
|
+
if (preset === 'm' || preset === 'medium') return '0.5rem';
|
|
117
|
+
if (preset === 'l' || preset === 'large') return '0.5rem';
|
|
118
|
+
if (preset === 'xl' || preset === 'xlarge') return '0.5rem';
|
|
119
|
+
return gap;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private updateChildren() {
|
|
123
|
+
const buttons = this.slottedButtons.filter(
|
|
124
|
+
(el) => el.tagName.toLowerCase() === 'moni-button' || el.tagName.toLowerCase() === 'moni-icon-button'
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
buttons.forEach((btn, index) => {
|
|
128
|
+
// Propagate size
|
|
129
|
+
btn.setAttribute('size', this.size);
|
|
130
|
+
|
|
131
|
+
// Propagate shape for connected variant
|
|
132
|
+
if (this.variant === 'connected') {
|
|
133
|
+
if (this.gap) {
|
|
134
|
+
if (buttons.length === 1) {
|
|
135
|
+
btn.setAttribute('shape', 'round');
|
|
136
|
+
} else if (index === 0) {
|
|
137
|
+
btn.setAttribute('shape', 'left-round');
|
|
138
|
+
} else if (index === buttons.length - 1) {
|
|
139
|
+
btn.setAttribute('shape', 'right-round');
|
|
140
|
+
} else {
|
|
141
|
+
btn.setAttribute('shape', 'inner-round');
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
if (buttons.length === 1) {
|
|
145
|
+
btn.setAttribute('shape', 'round');
|
|
146
|
+
} else if (index === 0) {
|
|
147
|
+
btn.setAttribute('shape', 'left-round-flat');
|
|
148
|
+
} else if (index === buttons.length - 1) {
|
|
149
|
+
btn.setAttribute('shape', 'right-round-flat');
|
|
150
|
+
} else {
|
|
151
|
+
btn.setAttribute('shape', 'no-round');
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
// Standard variant: buttons retain their own shapes or default round
|
|
156
|
+
const currentShape = btn.getAttribute('shape');
|
|
157
|
+
if (!currentShape || ['left-round-flat', 'right-round-flat', 'no-round', 'left-round', 'right-round', 'inner-round'].includes(currentShape)) {
|
|
158
|
+
btn.setAttribute('shape', 'round');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
private handlePointerDown(e: PointerEvent) {
|
|
165
|
+
if (this.variant !== 'standard') return;
|
|
166
|
+
const target = e.target as HTMLElement;
|
|
167
|
+
const button = target.closest('moni-button, moni-icon-button') as HTMLElement;
|
|
168
|
+
if (!button || button.hasAttribute('disabled')) return;
|
|
169
|
+
|
|
170
|
+
const buttons = this.slottedButtons.filter(
|
|
171
|
+
(el) => el.tagName.toLowerCase() === 'moni-button' || el.tagName.toLowerCase() === 'moni-icon-button'
|
|
172
|
+
);
|
|
173
|
+
const index = buttons.indexOf(button);
|
|
174
|
+
if (index === -1) return;
|
|
175
|
+
|
|
176
|
+
const prev = buttons[index - 1];
|
|
177
|
+
const next = buttons[index + 1];
|
|
178
|
+
|
|
179
|
+
if (prev) {
|
|
180
|
+
prev.style.transition = 'transform 200ms cubic-bezier(0.2, 0, 0, 1)';
|
|
181
|
+
prev.style.transform = 'translateX(-6px) scaleX(0.92)';
|
|
182
|
+
prev.style.transformOrigin = 'right center';
|
|
183
|
+
}
|
|
184
|
+
if (next) {
|
|
185
|
+
next.style.transition = 'transform 200ms cubic-bezier(0.2, 0, 0, 1)';
|
|
186
|
+
next.style.transform = 'translateX(6px) scaleX(0.92)';
|
|
187
|
+
next.style.transformOrigin = 'left center';
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
private handlePointerUp() {
|
|
192
|
+
const buttons = this.slottedButtons.filter(
|
|
193
|
+
(el) => el.tagName.toLowerCase() === 'moni-button' || el.tagName.toLowerCase() === 'moni-icon-button'
|
|
194
|
+
);
|
|
195
|
+
buttons.forEach((btn) => {
|
|
196
|
+
btn.style.transform = '';
|
|
197
|
+
btn.style.transformOrigin = '';
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
private handleClick(e: Event) {
|
|
202
|
+
const target = e.target as HTMLElement;
|
|
203
|
+
const clickedButton = target.closest('moni-button, moni-icon-button');
|
|
204
|
+
|
|
205
|
+
if (!clickedButton || clickedButton.hasAttribute('disabled')) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const buttons = this.slottedButtons.filter(
|
|
210
|
+
(el) => el.tagName.toLowerCase() === 'moni-button' || el.tagName.toLowerCase() === 'moni-icon-button'
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
if (!this.multi) {
|
|
214
|
+
buttons.forEach((btn) => {
|
|
215
|
+
if (btn !== clickedButton) {
|
|
216
|
+
btn.removeAttribute('active');
|
|
217
|
+
(btn as any).active = false;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Toggle clicked button active state
|
|
223
|
+
const wasActive = clickedButton.hasAttribute('active');
|
|
224
|
+
if (wasActive) {
|
|
225
|
+
clickedButton.removeAttribute('active');
|
|
226
|
+
(clickedButton as any).active = false;
|
|
227
|
+
} else {
|
|
228
|
+
clickedButton.setAttribute('active', '');
|
|
229
|
+
(clickedButton as any).active = true;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
this.dispatchEvent(
|
|
233
|
+
new CustomEvent('change', {
|
|
234
|
+
bubbles: true,
|
|
235
|
+
composed: true,
|
|
236
|
+
detail: {
|
|
237
|
+
button: clickedButton,
|
|
238
|
+
active: !wasActive
|
|
239
|
+
}
|
|
240
|
+
})
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
override render() {
|
|
245
|
+
const resolvedGap = this.getGapValue(this.gap);
|
|
246
|
+
const inlineStyles = resolvedGap
|
|
247
|
+
? `gap: ${resolvedGap}; --moni-button-group-connected-gap: 0px;`
|
|
248
|
+
: '';
|
|
249
|
+
// M3 connected button group a11y: role="group" by default. Consumers
|
|
250
|
+
// can override via the `role` attribute (e.g. "toolbar" for app
|
|
251
|
+
// actions) and provide an aria-label or aria-labelledby.
|
|
252
|
+
return html`
|
|
253
|
+
<div
|
|
254
|
+
class="group-container"
|
|
255
|
+
style=${inlineStyles}
|
|
256
|
+
part="container"
|
|
257
|
+
role=${this.role}
|
|
258
|
+
aria-label=${this.label || nothing}
|
|
259
|
+
aria-labelledby=${this.labelledBy || nothing}
|
|
260
|
+
@pointerdown=${this.handlePointerDown}
|
|
261
|
+
@pointerup=${this.handlePointerUp}
|
|
262
|
+
@pointercancel=${this.handlePointerUp}
|
|
263
|
+
@pointerleave=${this.handlePointerUp}
|
|
264
|
+
>
|
|
265
|
+
<slot @slotchange=${this.handleSlotChange} @click=${this.handleClick}></slot>
|
|
266
|
+
</div>
|
|
267
|
+
`;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
declare global {
|
|
272
|
+
interface HTMLElementTagNameMap {
|
|
273
|
+
'moni-button-group': MoniButtonGroup;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export default MoniButtonGroup;
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { html, css } from 'lit';
|
|
2
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
3
|
+
import { MoniElement, sharedStyles } from './_base/index.js';
|
|
4
|
+
import './moni-icon.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A selectable segment button designed to be grouped inside a `moni-segmented-button`.
|
|
8
|
+
*
|
|
9
|
+
* Attributes:
|
|
10
|
+
* - value: The value of the segment (default "on")
|
|
11
|
+
* - checked: Whether the segment is checked/selected
|
|
12
|
+
* - disabled: Whether the segment is disabled
|
|
13
|
+
* - position: Automatically set by the parent (first | middle | last | solo)
|
|
14
|
+
* - hide-check: Hides the checkmark when selected
|
|
15
|
+
*/
|
|
16
|
+
@customElement('moni-button-segment')
|
|
17
|
+
export class MoniButtonSegment extends MoniElement {
|
|
18
|
+
@property({ reflect: true })
|
|
19
|
+
value = 'on';
|
|
20
|
+
|
|
21
|
+
@property({ type: Boolean, reflect: true })
|
|
22
|
+
checked = false;
|
|
23
|
+
|
|
24
|
+
@property({ reflect: true })
|
|
25
|
+
size: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'extra' = 'medium';
|
|
26
|
+
|
|
27
|
+
@property({ type: Boolean, reflect: true })
|
|
28
|
+
disabled = false;
|
|
29
|
+
|
|
30
|
+
@property({ reflect: true })
|
|
31
|
+
position: 'first' | 'middle' | 'last' | 'solo' = 'solo';
|
|
32
|
+
|
|
33
|
+
@property({ type: Boolean, reflect: true, attribute: 'hide-check' })
|
|
34
|
+
hideCheck = false;
|
|
35
|
+
|
|
36
|
+
static override styles = [
|
|
37
|
+
sharedStyles,
|
|
38
|
+
css`
|
|
39
|
+
.label {
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
font-family: inherit;
|
|
44
|
+
font-size: inherit;
|
|
45
|
+
font-weight: inherit;
|
|
46
|
+
color: inherit;
|
|
47
|
+
text-align: center;
|
|
48
|
+
}
|
|
49
|
+
:host {
|
|
50
|
+
display: inline-flex;
|
|
51
|
+
vertical-align: middle;
|
|
52
|
+
position: relative;
|
|
53
|
+
z-index: 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Collapsing margins on host */
|
|
57
|
+
:host(:not([position='first'])) {
|
|
58
|
+
margin-inline-start: var(--moni-button-segment-gap, -0.0625rem);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([disabled]) {
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.button {
|
|
66
|
+
display: inline-flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
height: 2.5rem;
|
|
71
|
+
width: 100%;
|
|
72
|
+
padding: 0 1rem;
|
|
73
|
+
font-size: 0.875rem;
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
font-family: inherit;
|
|
76
|
+
color: var(--on-surface);
|
|
77
|
+
background-color: transparent;
|
|
78
|
+
border: 0.0625rem solid var(--outline-variant, var(--outline, #79747e));
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
user-select: none;
|
|
81
|
+
transition:
|
|
82
|
+
background-color var(--speed2),
|
|
83
|
+
color var(--speed2),
|
|
84
|
+
border-radius var(--speed2),
|
|
85
|
+
transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
86
|
+
box-shadow 250ms ease;
|
|
87
|
+
position: relative;
|
|
88
|
+
gap: 0.5rem;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.button::after {
|
|
92
|
+
content: '';
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 50%;
|
|
95
|
+
left: 50%;
|
|
96
|
+
min-width: 100%;
|
|
97
|
+
min-height: 3rem; /* 48px minimum touch target */
|
|
98
|
+
transform: translate(-50%, -50%);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Sizes */
|
|
102
|
+
.button.xsmall {
|
|
103
|
+
height: 1.75rem;
|
|
104
|
+
min-width: 3rem; /* 48px */
|
|
105
|
+
font-size: 0.75rem;
|
|
106
|
+
padding: 0 0.5rem;
|
|
107
|
+
}
|
|
108
|
+
.button.small {
|
|
109
|
+
height: 2rem;
|
|
110
|
+
min-width: 3rem; /* 48px */
|
|
111
|
+
padding: 0 0.75rem;
|
|
112
|
+
}
|
|
113
|
+
.button.large {
|
|
114
|
+
height: 3rem;
|
|
115
|
+
padding: 0 1.25rem;
|
|
116
|
+
}
|
|
117
|
+
.button.xlarge,
|
|
118
|
+
.button.extra {
|
|
119
|
+
height: 3.5rem;
|
|
120
|
+
font-size: 1rem;
|
|
121
|
+
padding: 0 1.5rem;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host([disabled]) .button {
|
|
125
|
+
opacity: 0.38;
|
|
126
|
+
cursor: not-allowed;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Border Radius positioning */
|
|
130
|
+
:host([position='first']) .button {
|
|
131
|
+
border-radius: var(--moni-button-segment-radius-left, 1.25rem 0.5rem 0.5rem 1.25rem);
|
|
132
|
+
}
|
|
133
|
+
:host([position='first']) .button.xsmall {
|
|
134
|
+
border-radius: var(--moni-button-segment-radius-left, 0.875rem 0.25rem 0.25rem 0.875rem);
|
|
135
|
+
}
|
|
136
|
+
:host([position='first']) .button.small {
|
|
137
|
+
border-radius: var(--moni-button-segment-radius-left, 1rem 0.5rem 0.5rem 1rem);
|
|
138
|
+
}
|
|
139
|
+
:host([position='first']) .button.large {
|
|
140
|
+
border-radius: var(--moni-button-segment-radius-left, 1.5rem 1rem 1rem 1.5rem);
|
|
141
|
+
}
|
|
142
|
+
:host([position='first']) .button.xlarge,
|
|
143
|
+
:host([position='first']) .button.extra {
|
|
144
|
+
border-radius: var(--moni-button-segment-radius-left, 1.75rem 1.25rem 1.25rem 1.75rem);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
:host([position='last']) .button {
|
|
148
|
+
border-radius: var(--moni-button-segment-radius-right, 0.5rem 1.25rem 1.25rem 0.5rem);
|
|
149
|
+
}
|
|
150
|
+
:host([position='last']) .button.xsmall {
|
|
151
|
+
border-radius: var(--moni-button-segment-radius-right, 0.25rem 0.875rem 0.875rem 0.25rem);
|
|
152
|
+
}
|
|
153
|
+
:host([position='last']) .button.small {
|
|
154
|
+
border-radius: var(--moni-button-segment-radius-right, 0.5rem 1rem 1rem 0.5rem);
|
|
155
|
+
}
|
|
156
|
+
:host([position='last']) .button.large {
|
|
157
|
+
border-radius: var(--moni-button-segment-radius-right, 1rem 1.5rem 1.5rem 1rem);
|
|
158
|
+
}
|
|
159
|
+
:host([position='last']) .button.xlarge,
|
|
160
|
+
:host([position='last']) .button.extra {
|
|
161
|
+
border-radius: var(--moni-button-segment-radius-right, 1.25rem 1.75rem 1.75rem 1.25rem);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host([position='middle']) .button {
|
|
165
|
+
border-radius: var(--moni-button-segment-radius-middle, 0.5rem);
|
|
166
|
+
}
|
|
167
|
+
:host([position='middle']) .button.xsmall {
|
|
168
|
+
border-radius: var(--moni-button-segment-radius-middle, 0.25rem);
|
|
169
|
+
}
|
|
170
|
+
:host([position='middle']) .button.small {
|
|
171
|
+
border-radius: var(--moni-button-segment-radius-middle, 0.5rem);
|
|
172
|
+
}
|
|
173
|
+
:host([position='middle']) .button.large {
|
|
174
|
+
border-radius: var(--moni-button-segment-radius-middle, 1rem);
|
|
175
|
+
}
|
|
176
|
+
:host([position='middle']) .button.xlarge,
|
|
177
|
+
:host([position='middle']) .button.extra {
|
|
178
|
+
border-radius: var(--moni-button-segment-radius-middle, 1.25rem);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:host([position='solo']) .button {
|
|
182
|
+
border-radius: 1.25rem;
|
|
183
|
+
}
|
|
184
|
+
:host([position='solo']) .button.xsmall {
|
|
185
|
+
border-radius: 0.875rem;
|
|
186
|
+
}
|
|
187
|
+
:host([position='solo']) .button.small {
|
|
188
|
+
border-radius: 1rem;
|
|
189
|
+
}
|
|
190
|
+
:host([position='solo']) .button.large {
|
|
191
|
+
border-radius: 1.5rem;
|
|
192
|
+
}
|
|
193
|
+
:host([position='solo']) .button.xlarge,
|
|
194
|
+
:host([position='solo']) .button.extra {
|
|
195
|
+
border-radius: 1.75rem;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* Hover and Active states */
|
|
199
|
+
:host(:hover:not([disabled])) {
|
|
200
|
+
z-index: 2;
|
|
201
|
+
}
|
|
202
|
+
:host(:hover:not([disabled])) .button {
|
|
203
|
+
transform: translateY(-0.0625rem);
|
|
204
|
+
}
|
|
205
|
+
:host(:hover:not([disabled]):not([checked])) .button {
|
|
206
|
+
background-color: var(--surface-container-high, rgba(0, 0, 0, 0.04));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
:host(:active:not([disabled])) .button {
|
|
210
|
+
transform: translateY(0.0625rem) scale(0.97);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* Checked state */
|
|
214
|
+
:host([checked]) {
|
|
215
|
+
z-index: 3;
|
|
216
|
+
}
|
|
217
|
+
:host([checked]) .button {
|
|
218
|
+
background-color: var(--secondary-container);
|
|
219
|
+
color: var(--on-secondary-container);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
:host([checked]:hover:not([disabled])) {
|
|
223
|
+
z-index: 3;
|
|
224
|
+
}
|
|
225
|
+
:host([checked]:hover:not([disabled])) .button {
|
|
226
|
+
background-color: var(--secondary-container);
|
|
227
|
+
opacity: 0.92;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* Checkmark Animation */
|
|
231
|
+
.checkmark {
|
|
232
|
+
display: inline-flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
justify-content: center;
|
|
235
|
+
font-size: 1.125rem;
|
|
236
|
+
inline-size: 0;
|
|
237
|
+
block-size: 1.125rem;
|
|
238
|
+
opacity: 0;
|
|
239
|
+
transform: scale(0);
|
|
240
|
+
margin-inline-end: -0.5rem; /* Cancels host gap when collapsed */
|
|
241
|
+
transition:
|
|
242
|
+
inline-size var(--speed2) var(--ease-standard),
|
|
243
|
+
margin-inline-end var(--speed2) var(--ease-standard),
|
|
244
|
+
opacity var(--speed2) var(--ease-standard),
|
|
245
|
+
transform var(--speed2) var(--ease-standard);
|
|
246
|
+
overflow: hidden;
|
|
247
|
+
color: inherit;
|
|
248
|
+
flex: none;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
:host([checked]:not([hide-check])) .checkmark {
|
|
252
|
+
inline-size: 1.125rem;
|
|
253
|
+
margin-inline-end: 0;
|
|
254
|
+
opacity: 1;
|
|
255
|
+
transform: scale(1);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* Icon slot */
|
|
259
|
+
::slotted([slot='icon']) {
|
|
260
|
+
display: inline-flex;
|
|
261
|
+
align-items: center;
|
|
262
|
+
justify-content: center;
|
|
263
|
+
font-size: 1.125rem;
|
|
264
|
+
inline-size: 1.125rem;
|
|
265
|
+
block-size: 1.125rem;
|
|
266
|
+
color: inherit;
|
|
267
|
+
flex: none;
|
|
268
|
+
}
|
|
269
|
+
`
|
|
270
|
+
];
|
|
271
|
+
|
|
272
|
+
override render() {
|
|
273
|
+
return html`
|
|
274
|
+
<button class="button ${this.size}" type="button" ?disabled=${this.disabled}>
|
|
275
|
+
<span class="checkmark" part="checkmark">
|
|
276
|
+
<moni-icon name="check"></moni-icon>
|
|
277
|
+
</span>
|
|
278
|
+
<slot name="icon"></slot>
|
|
279
|
+
<span class="label" part="label"><slot></slot></span>
|
|
280
|
+
</button>
|
|
281
|
+
`;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
declare global {
|
|
286
|
+
interface HTMLElementTagNameMap {
|
|
287
|
+
'moni-button-segment': MoniButtonSegment;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export default MoniButtonSegment;
|