@maggioli-design-system/magma 2.5.0 → 2.5.1
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/AGENTS.md +1 -1
- package/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/agents/conventions.md +7 -0
- package/dist/cjs/{index-CWTZb9W2.js → index-Bg68W-da.js} +1 -1
- package/dist/cjs/{locale-Os4wg65H.js → locale-CaR39iYg.js} +12 -6
- package/dist/cjs/mds-banner_3.cjs.entry.js +1 -1
- package/dist/cjs/mds-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/mds-button-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/mds-calendar_2.cjs.entry.js +1 -1
- package/dist/cjs/mds-emoji.cjs.entry.js +1 -1
- package/dist/cjs/mds-file-preview.cjs.entry.js +1 -1
- package/dist/cjs/mds-file.cjs.entry.js +1 -1
- package/dist/cjs/mds-filter-item.cjs.entry.js +1 -1
- package/dist/cjs/mds-filter.cjs.entry.js +1 -1
- package/dist/cjs/mds-header-bar.cjs.entry.js +1 -1
- package/dist/cjs/mds-horizontal-scroll.cjs.entry.js +1 -1
- package/dist/cjs/mds-img.cjs.entry.js +1 -1
- package/dist/cjs/mds-input-date-range.cjs.entry.js +1 -1
- package/dist/cjs/mds-input-date.cjs.entry.js +2 -2
- package/dist/cjs/mds-input-otp.cjs.entry.js +1 -1
- package/dist/cjs/mds-input-range.cjs.entry.js +1 -1
- package/dist/cjs/mds-input-select.cjs.entry.js +9 -5
- package/dist/cjs/mds-input-switch_2.cjs.entry.js +1 -1
- package/dist/cjs/mds-input-tip_2.cjs.entry.js +1 -1
- package/dist/cjs/mds-input-upload.cjs.entry.js +1 -1
- package/dist/cjs/mds-input.cjs.entry.js +154 -37
- package/dist/cjs/mds-keyboard-key.cjs.entry.js +1 -1
- package/dist/cjs/mds-keyboard.cjs.entry.js +7 -3
- package/dist/cjs/mds-label.cjs.entry.js +1 -1
- package/dist/cjs/mds-link.cjs.entry.js +1 -1
- package/dist/cjs/mds-mention.cjs.entry.js +1 -1
- package/dist/cjs/mds-modal.cjs.entry.js +1 -1
- package/dist/cjs/mds-note.cjs.entry.js +1 -1
- package/dist/cjs/mds-paginator.cjs.entry.js +1 -1
- package/dist/cjs/mds-policy-ai.cjs.entry.js +1 -1
- package/dist/cjs/mds-pref-animation.cjs.entry.js +1 -1
- package/dist/cjs/mds-pref-consumption.cjs.entry.js +1 -1
- package/dist/cjs/mds-pref-contrast.cjs.entry.js +1 -1
- package/dist/cjs/mds-pref-language-item.cjs.entry.js +1 -1
- package/dist/cjs/mds-pref-language.cjs.entry.js +1 -1
- package/dist/cjs/mds-pref-mode.cjs.entry.js +1 -1
- package/dist/cjs/mds-pref-theme.cjs.entry.js +1 -1
- package/dist/cjs/mds-pref.cjs.entry.js +1 -1
- package/dist/cjs/mds-push-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/mds-push-notification.cjs.entry.js +1 -1
- package/dist/cjs/mds-radial-menu.cjs.entry.js +1 -1
- package/dist/cjs/mds-status-bar.cjs.entry.js +1 -1
- package/dist/cjs/mds-stepper-bar-item.cjs.entry.js +7 -5
- package/dist/cjs/mds-table-header.cjs.entry.js +1 -1
- package/dist/cjs/mds-table-row.cjs.entry.js +1 -1
- package/dist/cjs/mds-table.cjs.entry.js +1 -1
- package/dist/cjs/mds-toast.cjs.entry.js +1 -1
- package/dist/cjs/mds-tree-item.cjs.entry.js +1 -1
- package/dist/cjs/mds-url-view.cjs.entry.js +1 -1
- package/dist/cjs/mds-usage.cjs.entry.js +1 -1
- package/dist/collection/common/locale.js +12 -6
- package/dist/collection/components/mds-accordion/AGENTS.md +1 -1
- package/dist/collection/components/mds-accordion/documentation.json +1 -1
- package/dist/collection/components/mds-accordion-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-accordion-item/documentation.json +1 -1
- package/dist/collection/components/mds-accordion-timer/AGENTS.md +1 -1
- package/dist/collection/components/mds-accordion-timer/documentation.json +1 -1
- package/dist/collection/components/mds-accordion-timer-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-accordion-timer-item/documentation.json +1 -1
- package/dist/collection/components/mds-author/AGENTS.md +1 -1
- package/dist/collection/components/mds-author/documentation.json +1 -1
- package/dist/collection/components/mds-avatar/AGENTS.md +1 -1
- package/dist/collection/components/mds-avatar/documentation.json +1 -1
- package/dist/collection/components/mds-avatar-stack/AGENTS.md +1 -1
- package/dist/collection/components/mds-avatar-stack/documentation.json +1 -1
- package/dist/collection/components/mds-avatar-stack-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-avatar-stack-item/documentation.json +1 -1
- package/dist/collection/components/mds-badge/AGENTS.md +1 -1
- package/dist/collection/components/mds-badge/documentation.json +1 -1
- package/dist/collection/components/mds-banner/AGENTS.md +1 -1
- package/dist/collection/components/mds-banner/documentation.json +1 -1
- package/dist/collection/components/mds-benchmark-bar/AGENTS.md +1 -1
- package/dist/collection/components/mds-benchmark-bar/documentation.json +1 -1
- package/dist/collection/components/mds-bibliography/AGENTS.md +1 -1
- package/dist/collection/components/mds-bibliography/documentation.json +1 -1
- package/dist/collection/components/mds-breadcrumb/AGENTS.md +1 -1
- package/dist/collection/components/mds-breadcrumb/documentation.json +1 -1
- package/dist/collection/components/mds-breadcrumb-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-breadcrumb-item/documentation.json +1 -1
- package/dist/collection/components/mds-button/AGENTS.md +1 -1
- package/dist/collection/components/mds-button/documentation.json +1 -1
- package/dist/collection/components/mds-button-dropdown/AGENTS.md +1 -1
- package/dist/collection/components/mds-button-dropdown/documentation.json +1 -1
- package/dist/collection/components/mds-button-group/AGENTS.md +1 -1
- package/dist/collection/components/mds-button-group/documentation.json +1 -1
- package/dist/collection/components/mds-calendar/AGENTS.md +1 -1
- package/dist/collection/components/mds-calendar/documentation.json +1 -1
- package/dist/collection/components/mds-calendar-cell/AGENTS.md +1 -1
- package/dist/collection/components/mds-calendar-cell/documentation.json +1 -1
- package/dist/collection/components/mds-card/AGENTS.md +1 -1
- package/dist/collection/components/mds-card/documentation.json +1 -1
- package/dist/collection/components/mds-card-content/AGENTS.md +1 -1
- package/dist/collection/components/mds-card-content/documentation.json +1 -1
- package/dist/collection/components/mds-card-footer/AGENTS.md +1 -1
- package/dist/collection/components/mds-card-footer/documentation.json +1 -1
- package/dist/collection/components/mds-card-header/AGENTS.md +1 -1
- package/dist/collection/components/mds-card-header/documentation.json +1 -1
- package/dist/collection/components/mds-card-media/AGENTS.md +1 -1
- package/dist/collection/components/mds-card-media/documentation.json +1 -1
- package/dist/collection/components/mds-chip/AGENTS.md +1 -1
- package/dist/collection/components/mds-chip/documentation.json +1 -1
- package/dist/collection/components/mds-details/AGENTS.md +1 -1
- package/dist/collection/components/mds-details/documentation.json +1 -1
- package/dist/collection/components/mds-dropdown/AGENTS.md +1 -1
- package/dist/collection/components/mds-dropdown/documentation.json +1 -1
- package/dist/collection/components/mds-emoji/AGENTS.md +1 -1
- package/dist/collection/components/mds-emoji/documentation.json +1 -1
- package/dist/collection/components/mds-emoji/mds-emoji.css +0 -1
- package/dist/collection/components/mds-entity/AGENTS.md +1 -1
- package/dist/collection/components/mds-entity/documentation.json +1 -1
- package/dist/collection/components/mds-file/AGENTS.md +1 -1
- package/dist/collection/components/mds-file/documentation.json +1 -1
- package/dist/collection/components/mds-file-preview/AGENTS.md +1 -1
- package/dist/collection/components/mds-file-preview/documentation.json +1 -1
- package/dist/collection/components/mds-filter/AGENTS.md +1 -1
- package/dist/collection/components/mds-filter/documentation.json +1 -1
- package/dist/collection/components/mds-filter-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-filter-item/documentation.json +1 -1
- package/dist/collection/components/mds-header/AGENTS.md +1 -1
- package/dist/collection/components/mds-header/documentation.json +1 -1
- package/dist/collection/components/mds-header-bar/AGENTS.md +1 -1
- package/dist/collection/components/mds-header-bar/documentation.json +1 -1
- package/dist/collection/components/mds-help/AGENTS.md +1 -1
- package/dist/collection/components/mds-help/documentation.json +1 -1
- package/dist/collection/components/mds-horizontal-scroll/AGENTS.md +1 -1
- package/dist/collection/components/mds-horizontal-scroll/documentation.json +1 -1
- package/dist/collection/components/mds-hr/AGENTS.md +1 -1
- package/dist/collection/components/mds-hr/documentation.json +1 -1
- package/dist/collection/components/mds-icon/AGENTS.md +1 -1
- package/dist/collection/components/mds-icon/documentation.json +1 -1
- package/dist/collection/components/mds-img/AGENTS.md +1 -1
- package/dist/collection/components/mds-img/documentation.json +1 -1
- package/dist/collection/components/mds-input/AGENTS.md +4 -2
- package/dist/collection/components/mds-input/documentation.json +2 -2
- package/dist/collection/components/mds-input/mds-input.js +12 -7
- package/dist/collection/components/mds-input/meta/input-type/InputValidationManager.js +3 -3
- package/dist/collection/components/mds-input/meta/validators.js +28 -13
- package/dist/collection/components/mds-input/meta/validity.js +8 -10
- package/dist/collection/components/mds-input-date/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-date/documentation.json +1 -1
- package/dist/collection/components/mds-input-date-range/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-date-range/documentation.json +1 -1
- package/dist/collection/components/mds-input-date-range-preselection/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-date-range-preselection/documentation.json +1 -1
- package/dist/collection/components/mds-input-field/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-field/documentation.json +1 -1
- package/dist/collection/components/mds-input-otp/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-otp/documentation.json +1 -1
- package/dist/collection/components/mds-input-range/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-range/documentation.json +1 -1
- package/dist/collection/components/mds-input-range/mds-input-range.css +26 -19
- package/dist/collection/components/mds-input-select/AGENTS.md +2 -2
- package/dist/collection/components/mds-input-select/documentation.json +2 -2
- package/dist/collection/components/mds-input-select/mds-input-select.js +7 -3
- package/dist/collection/components/mds-input-switch/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-switch/documentation.json +1 -1
- package/dist/collection/components/mds-input-tip/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-tip/documentation.json +1 -1
- package/dist/collection/components/mds-input-tip-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-tip-item/documentation.json +1 -1
- package/dist/collection/components/mds-input-upload/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-upload/documentation.json +1 -1
- package/dist/collection/components/mds-keyboard/AGENTS.md +2 -2
- package/dist/collection/components/mds-keyboard/documentation.json +2 -2
- package/dist/collection/components/mds-keyboard/mds-keyboard.js +6 -2
- package/dist/collection/components/mds-keyboard-key/AGENTS.md +1 -1
- package/dist/collection/components/mds-keyboard-key/documentation.json +1 -1
- package/dist/collection/components/mds-kpi/AGENTS.md +1 -1
- package/dist/collection/components/mds-kpi/documentation.json +1 -1
- package/dist/collection/components/mds-kpi-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-kpi-item/documentation.json +1 -1
- package/dist/collection/components/mds-label/AGENTS.md +1 -1
- package/dist/collection/components/mds-label/documentation.json +1 -1
- package/dist/collection/components/mds-link/AGENTS.md +1 -1
- package/dist/collection/components/mds-link/documentation.json +1 -1
- package/dist/collection/components/mds-list/AGENTS.md +1 -1
- package/dist/collection/components/mds-list/documentation.json +1 -1
- package/dist/collection/components/mds-list-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-list-item/documentation.json +1 -1
- package/dist/collection/components/mds-mention/AGENTS.md +1 -1
- package/dist/collection/components/mds-mention/documentation.json +1 -1
- package/dist/collection/components/mds-modal/AGENTS.md +1 -1
- package/dist/collection/components/mds-modal/documentation.json +1 -1
- package/dist/collection/components/mds-note/AGENTS.md +1 -1
- package/dist/collection/components/mds-note/documentation.json +1 -1
- package/dist/collection/components/mds-notification/AGENTS.md +1 -1
- package/dist/collection/components/mds-notification/documentation.json +1 -1
- package/dist/collection/components/mds-paginator/AGENTS.md +1 -1
- package/dist/collection/components/mds-paginator/documentation.json +1 -1
- package/dist/collection/components/mds-paginator-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-paginator-item/documentation.json +1 -1
- package/dist/collection/components/mds-policy-ai/AGENTS.md +1 -1
- package/dist/collection/components/mds-policy-ai/documentation.json +1 -1
- package/dist/collection/components/mds-pref/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref/documentation.json +1 -1
- package/dist/collection/components/mds-pref-animation/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-animation/documentation.json +1 -1
- package/dist/collection/components/mds-pref-consumption/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-consumption/documentation.json +1 -1
- package/dist/collection/components/mds-pref-contrast/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-contrast/documentation.json +1 -1
- package/dist/collection/components/mds-pref-language/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-language/documentation.json +1 -1
- package/dist/collection/components/mds-pref-language-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-language-item/documentation.json +1 -1
- package/dist/collection/components/mds-pref-mode/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-mode/documentation.json +1 -1
- package/dist/collection/components/mds-pref-theme/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-theme/documentation.json +1 -1
- package/dist/collection/components/mds-pref-theme-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-pref-theme-item/documentation.json +1 -1
- package/dist/collection/components/mds-price-table/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-features/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-features/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-features-cell/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-features-cell/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-features-row/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-features-row/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-header/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-header/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-list/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-list/documentation.json +1 -1
- package/dist/collection/components/mds-price-table-list-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-price-table-list-item/documentation.json +1 -1
- package/dist/collection/components/mds-progress/AGENTS.md +1 -1
- package/dist/collection/components/mds-progress/documentation.json +1 -1
- package/dist/collection/components/mds-push-notification/AGENTS.md +1 -1
- package/dist/collection/components/mds-push-notification/documentation.json +1 -1
- package/dist/collection/components/mds-push-notification-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-push-notification-item/documentation.json +1 -1
- package/dist/collection/components/mds-quote/AGENTS.md +1 -1
- package/dist/collection/components/mds-quote/documentation.json +1 -1
- package/dist/collection/components/mds-radial-menu/AGENTS.md +1 -1
- package/dist/collection/components/mds-radial-menu/documentation.json +1 -1
- package/dist/collection/components/mds-radial-menu-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-radial-menu-item/documentation.json +1 -1
- package/dist/collection/components/mds-radial-progress/AGENTS.md +1 -1
- package/dist/collection/components/mds-radial-progress/documentation.json +1 -1
- package/dist/collection/components/mds-separator/AGENTS.md +1 -1
- package/dist/collection/components/mds-separator/documentation.json +1 -1
- package/dist/collection/components/mds-spinner/AGENTS.md +1 -1
- package/dist/collection/components/mds-spinner/documentation.json +1 -1
- package/dist/collection/components/mds-status-bar/AGENTS.md +1 -1
- package/dist/collection/components/mds-status-bar/documentation.json +1 -1
- package/dist/collection/components/mds-status-bar/mds-status-bar.css +1 -0
- package/dist/collection/components/mds-stepper-bar/AGENTS.md +1 -1
- package/dist/collection/components/mds-stepper-bar/documentation.json +1 -1
- package/dist/collection/components/mds-stepper-bar-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-stepper-bar-item/documentation.json +1 -1
- package/dist/collection/components/mds-stepper-bar-item/mds-stepper-bar-item.js +6 -4
- package/dist/collection/components/mds-tab/AGENTS.md +1 -1
- package/dist/collection/components/mds-tab/documentation.json +1 -1
- package/dist/collection/components/mds-tab-bar/AGENTS.md +1 -1
- package/dist/collection/components/mds-tab-bar/documentation.json +1 -1
- package/dist/collection/components/mds-tab-bar-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-tab-bar-item/documentation.json +1 -1
- package/dist/collection/components/mds-tab-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-tab-item/documentation.json +1 -1
- package/dist/collection/components/mds-table/AGENTS.md +1 -1
- package/dist/collection/components/mds-table/documentation.json +1 -1
- package/dist/collection/components/mds-table-body/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-body/documentation.json +1 -1
- package/dist/collection/components/mds-table-cell/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-cell/documentation.json +1 -1
- package/dist/collection/components/mds-table-footer/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-footer/documentation.json +1 -1
- package/dist/collection/components/mds-table-header/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-header/documentation.json +1 -1
- package/dist/collection/components/mds-table-header-cell/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-header-cell/documentation.json +1 -1
- package/dist/collection/components/mds-table-row/AGENTS.md +1 -1
- package/dist/collection/components/mds-table-row/documentation.json +1 -1
- package/dist/collection/components/mds-text/AGENTS.md +1 -1
- package/dist/collection/components/mds-text/documentation.json +1 -1
- package/dist/collection/components/mds-toast/AGENTS.md +1 -1
- package/dist/collection/components/mds-toast/documentation.json +1 -1
- package/dist/collection/components/mds-toast-region/AGENTS.md +1 -1
- package/dist/collection/components/mds-toast-region/documentation.json +1 -1
- package/dist/collection/components/mds-tooltip/AGENTS.md +1 -1
- package/dist/collection/components/mds-tooltip/documentation.json +1 -1
- package/dist/collection/components/mds-tree/AGENTS.md +1 -1
- package/dist/collection/components/mds-tree/documentation.json +1 -1
- package/dist/collection/components/mds-tree-item/AGENTS.md +1 -1
- package/dist/collection/components/mds-tree-item/documentation.json +1 -1
- package/dist/collection/components/mds-url-view/AGENTS.md +1 -1
- package/dist/collection/components/mds-url-view/documentation.json +1 -1
- package/dist/collection/components/mds-usage/AGENTS.md +1 -1
- package/dist/collection/components/mds-usage/documentation.json +1 -1
- package/dist/collection/components/mds-video-wall/AGENTS.md +1 -1
- package/dist/collection/components/mds-video-wall/documentation.json +1 -1
- package/dist/collection/components/mds-zero/AGENTS.md +1 -1
- package/dist/collection/components/mds-zero/documentation.json +1 -1
- package/dist/components/mds-avatar-stack-item.js +1 -1
- package/dist/components/mds-avatar-stack.js +1 -1
- package/dist/components/mds-avatar.js +1 -1
- package/dist/components/mds-banner.js +1 -1
- package/dist/components/mds-breadcrumb.js +1 -1
- package/dist/components/mds-button-dropdown.js +1 -1
- package/dist/components/mds-calendar.js +1 -1
- package/dist/components/mds-chip.js +1 -1
- package/dist/components/mds-emoji.js +1 -1
- package/dist/components/mds-entity.js +1 -1
- package/dist/components/mds-file-preview.js +1 -1
- package/dist/components/mds-file.js +1 -1
- package/dist/components/mds-filter-item.js +1 -1
- package/dist/components/mds-filter.js +1 -1
- package/dist/components/mds-header-bar.js +1 -1
- package/dist/components/mds-header.js +1 -1
- package/dist/components/mds-horizontal-scroll.js +1 -1
- package/dist/components/mds-img.js +1 -1
- package/dist/components/mds-input-date-range.js +1 -1
- package/dist/components/mds-input-date.js +1 -1
- package/dist/components/mds-input-otp.js +1 -1
- package/dist/components/mds-input-range.js +1 -1
- package/dist/components/mds-input-select.js +1 -1
- package/dist/components/mds-input-switch.js +1 -1
- package/dist/components/mds-input-tip-item.js +1 -1
- package/dist/components/mds-input-upload.js +1 -1
- package/dist/components/mds-input.js +1 -1
- package/dist/components/mds-keyboard-key.js +1 -1
- package/dist/components/mds-keyboard.js +1 -1
- package/dist/components/mds-label.js +1 -1
- package/dist/components/mds-link.js +1 -1
- package/dist/components/mds-mention.js +1 -1
- package/dist/components/mds-modal.js +1 -1
- package/dist/components/mds-note.js +1 -1
- package/dist/components/mds-paginator.js +1 -1
- package/dist/components/mds-policy-ai.js +1 -1
- package/dist/components/mds-pref-animation.js +1 -1
- package/dist/components/mds-pref-consumption.js +1 -1
- package/dist/components/mds-pref-contrast.js +1 -1
- package/dist/components/mds-pref-language-item.js +1 -1
- package/dist/components/mds-pref-language.js +1 -1
- package/dist/components/mds-pref-mode.js +1 -1
- package/dist/components/mds-pref-theme.js +1 -1
- package/dist/components/mds-pref.js +1 -1
- package/dist/components/mds-push-notification-item.js +1 -1
- package/dist/components/mds-push-notification.js +1 -1
- package/dist/components/mds-radial-menu.js +1 -1
- package/dist/components/mds-status-bar.js +1 -1
- package/dist/components/mds-stepper-bar-item.js +1 -1
- package/dist/components/mds-table-header.js +1 -1
- package/dist/components/mds-table-row.js +1 -1
- package/dist/components/mds-table.js +1 -1
- package/dist/components/mds-toast.js +1 -1
- package/dist/components/mds-tree-item.js +1 -1
- package/dist/components/mds-url-view.js +1 -1
- package/dist/components/mds-usage.js +1 -1
- package/dist/components/{p-DF3PrYBI.js → p-5lLueiFt.js} +1 -1
- package/dist/components/{p-CLe_N2_H.js → p-BO-jHv-F.js} +1 -1
- package/dist/components/{p-CNZ8_QvE.js → p-BbgQG1UL.js} +2 -2
- package/dist/components/{p-DCrdKrky.js → p-CJYY4da7.js} +1 -1
- package/dist/components/{p-C1CTahjH.js → p-CPvuXO7s.js} +1 -1
- package/dist/components/{p-B8x-d2fx.js → p-CZjwSwe5.js} +1 -1
- package/dist/components/{p-Cd8id3Br.js → p-CaROqeeK.js} +1 -1
- package/dist/components/{p-CfQETwAK.js → p-Cu5nEwMu.js} +1 -1
- package/dist/components/{p-nsbhb0lz.js → p-D0A8gS-P.js} +1 -1
- package/dist/components/{p-C99SMdU_.js → p-DFD4E9zJ.js} +1 -1
- package/dist/components/{p-DiUUZ7ZA.js → p-DTtmr_Y9.js} +1 -1
- package/dist/components/{p-D2d9eOLi.js → p-DkYDXDkD.js} +1 -1
- package/dist/components/{p-uqwixjju.js → p-DucY18_e.js} +1 -1
- package/dist/components/p-yNPPTJ7i.js +1 -0
- package/dist/documentation.json +4 -4
- package/dist/esm/{index-D2_gI0qp.js → index-BJVvHlvf.js} +1 -1
- package/dist/esm/{locale-BQmO6K_S.js → locale-B6cOkl4I.js} +12 -6
- package/dist/esm/mds-banner_3.entry.js +1 -1
- package/dist/esm/mds-breadcrumb.entry.js +1 -1
- package/dist/esm/mds-button-dropdown.entry.js +1 -1
- package/dist/esm/mds-calendar_2.entry.js +1 -1
- package/dist/esm/mds-emoji.entry.js +1 -1
- package/dist/esm/mds-file-preview.entry.js +1 -1
- package/dist/esm/mds-file.entry.js +1 -1
- package/dist/esm/mds-filter-item.entry.js +1 -1
- package/dist/esm/mds-filter.entry.js +1 -1
- package/dist/esm/mds-header-bar.entry.js +1 -1
- package/dist/esm/mds-horizontal-scroll.entry.js +1 -1
- package/dist/esm/mds-img.entry.js +1 -1
- package/dist/esm/mds-input-date-range.entry.js +1 -1
- package/dist/esm/mds-input-date.entry.js +2 -2
- package/dist/esm/mds-input-otp.entry.js +1 -1
- package/dist/esm/mds-input-range.entry.js +1 -1
- package/dist/esm/mds-input-select.entry.js +9 -5
- package/dist/esm/mds-input-switch_2.entry.js +1 -1
- package/dist/esm/mds-input-tip_2.entry.js +1 -1
- package/dist/esm/mds-input-upload.entry.js +1 -1
- package/dist/esm/mds-input.entry.js +154 -37
- package/dist/esm/mds-keyboard-key.entry.js +1 -1
- package/dist/esm/mds-keyboard.entry.js +7 -3
- package/dist/esm/mds-label.entry.js +1 -1
- package/dist/esm/mds-link.entry.js +1 -1
- package/dist/esm/mds-mention.entry.js +1 -1
- package/dist/esm/mds-modal.entry.js +1 -1
- package/dist/esm/mds-note.entry.js +1 -1
- package/dist/esm/mds-paginator.entry.js +1 -1
- package/dist/esm/mds-policy-ai.entry.js +1 -1
- package/dist/esm/mds-pref-animation.entry.js +1 -1
- package/dist/esm/mds-pref-consumption.entry.js +1 -1
- package/dist/esm/mds-pref-contrast.entry.js +1 -1
- package/dist/esm/mds-pref-language-item.entry.js +1 -1
- package/dist/esm/mds-pref-language.entry.js +1 -1
- package/dist/esm/mds-pref-mode.entry.js +1 -1
- package/dist/esm/mds-pref-theme.entry.js +1 -1
- package/dist/esm/mds-pref.entry.js +1 -1
- package/dist/esm/mds-push-notification-item.entry.js +1 -1
- package/dist/esm/mds-push-notification.entry.js +1 -1
- package/dist/esm/mds-radial-menu.entry.js +1 -1
- package/dist/esm/mds-status-bar.entry.js +1 -1
- package/dist/esm/mds-stepper-bar-item.entry.js +7 -5
- package/dist/esm/mds-table-header.entry.js +1 -1
- package/dist/esm/mds-table-row.entry.js +1 -1
- package/dist/esm/mds-table.entry.js +1 -1
- package/dist/esm/mds-toast.entry.js +1 -1
- package/dist/esm/mds-tree-item.entry.js +1 -1
- package/dist/esm/mds-url-view.entry.js +1 -1
- package/dist/esm/mds-usage.entry.js +1 -1
- package/dist/esm-es5/{index-D2_gI0qp.js → index-BJVvHlvf.js} +1 -1
- package/dist/esm-es5/{locale-BQmO6K_S.js → locale-B6cOkl4I.js} +22 -18
- package/dist/esm-es5/mds-banner_3.entry.js +1 -1
- package/dist/esm-es5/mds-breadcrumb.entry.js +1 -1
- package/dist/esm-es5/mds-button-dropdown.entry.js +1 -1
- package/dist/esm-es5/mds-calendar_2.entry.js +1 -1
- package/dist/esm-es5/mds-emoji.entry.js +1 -1
- package/dist/esm-es5/mds-file-preview.entry.js +5 -5
- package/dist/esm-es5/mds-file.entry.js +1 -1
- package/dist/esm-es5/mds-filter-item.entry.js +1 -1
- package/dist/esm-es5/mds-filter.entry.js +1 -1
- package/dist/esm-es5/mds-header-bar.entry.js +1 -1
- package/dist/esm-es5/mds-horizontal-scroll.entry.js +1 -1
- package/dist/esm-es5/mds-img.entry.js +1 -1
- package/dist/esm-es5/mds-input-date-range.entry.js +1 -1
- package/dist/esm-es5/mds-input-date.entry.js +1 -1
- package/dist/esm-es5/mds-input-otp.entry.js +1 -1
- package/dist/esm-es5/mds-input-range.entry.js +7 -7
- package/dist/esm-es5/mds-input-select.entry.js +5 -4
- package/dist/esm-es5/mds-input-switch_2.entry.js +1 -1
- package/dist/esm-es5/mds-input-tip_2.entry.js +1 -1
- package/dist/esm-es5/mds-input-upload.entry.js +1 -1
- package/dist/esm-es5/mds-input.entry.js +53 -50
- package/dist/esm-es5/mds-keyboard-key.entry.js +1 -1
- package/dist/esm-es5/mds-keyboard.entry.js +6 -3
- package/dist/esm-es5/mds-label.entry.js +1 -1
- package/dist/esm-es5/mds-link.entry.js +1 -1
- package/dist/esm-es5/mds-mention.entry.js +1 -1
- package/dist/esm-es5/mds-modal.entry.js +1 -1
- package/dist/esm-es5/mds-note.entry.js +1 -1
- package/dist/esm-es5/mds-paginator.entry.js +1 -1
- package/dist/esm-es5/mds-policy-ai.entry.js +1 -1
- package/dist/esm-es5/mds-pref-animation.entry.js +1 -1
- package/dist/esm-es5/mds-pref-consumption.entry.js +1 -1
- package/dist/esm-es5/mds-pref-contrast.entry.js +1 -1
- package/dist/esm-es5/mds-pref-language-item.entry.js +1 -1
- package/dist/esm-es5/mds-pref-language.entry.js +1 -1
- package/dist/esm-es5/mds-pref-mode.entry.js +1 -1
- package/dist/esm-es5/mds-pref-theme.entry.js +1 -1
- package/dist/esm-es5/mds-pref.entry.js +1 -1
- package/dist/esm-es5/mds-push-notification-item.entry.js +1 -1
- package/dist/esm-es5/mds-push-notification.entry.js +1 -1
- package/dist/esm-es5/mds-radial-menu.entry.js +1 -1
- package/dist/esm-es5/mds-status-bar.entry.js +1 -1
- package/dist/esm-es5/mds-stepper-bar-item.entry.js +6 -3
- package/dist/esm-es5/mds-table-header.entry.js +1 -1
- package/dist/esm-es5/mds-table-row.entry.js +1 -1
- package/dist/esm-es5/mds-table.entry.js +1 -1
- package/dist/esm-es5/mds-toast.entry.js +1 -1
- package/dist/esm-es5/mds-tree-item.entry.js +1 -1
- package/dist/esm-es5/mds-url-view.entry.js +1 -1
- package/dist/esm-es5/mds-usage.entry.js +1 -1
- package/dist/hydrate/index.js +190 -57
- package/dist/hydrate/index.mjs +190 -57
- package/dist/magma-components/magma-components.esm.js +1 -1
- package/dist/magma-components/{p-2a964578.entry.js → p-0193734e.entry.js} +1 -1
- package/dist/magma-components/{p-ae3bf24c.system.entry.js → p-046697e4.system.entry.js} +1 -1
- package/dist/magma-components/{p-81e02997.system.entry.js → p-071f5c7b.system.entry.js} +2 -2
- package/dist/magma-components/{p-a9ba496d.entry.js → p-075acd04.entry.js} +1 -1
- package/dist/magma-components/{p-94289f3d.system.entry.js → p-07a3c63c.system.entry.js} +5 -5
- package/dist/magma-components/{p-57839384.system.entry.js → p-093b8fbc.system.entry.js} +9 -6
- package/dist/magma-components/{p-a8e1ce2f.entry.js → p-0e2cd21e.entry.js} +1 -1
- package/dist/magma-components/{p-0eb3558a.entry.js → p-11320427.entry.js} +1 -1
- package/dist/magma-components/p-14635a8f.entry.js +1 -0
- package/dist/magma-components/{p-23c057a9.entry.js → p-168d5fad.entry.js} +1 -1
- package/dist/magma-components/{p-254ee71d.entry.js → p-17ec24dc.entry.js} +1 -1
- package/dist/magma-components/{p-f670ed20.entry.js → p-198ea5d8.entry.js} +1 -1
- package/dist/magma-components/p-1c2c4670.entry.js +1 -0
- package/dist/magma-components/{p-42e50f25.system.entry.js → p-1ea582a9.system.entry.js} +3 -3
- package/dist/magma-components/{p-2d3b5eb5.entry.js → p-227f57e6.entry.js} +1 -1
- package/dist/magma-components/{p-5c4e41d3.system.entry.js → p-2752b45a.system.entry.js} +1 -1
- package/dist/magma-components/{p-068e30a5.entry.js → p-29971e1d.entry.js} +1 -1
- package/dist/magma-components/{p-8d6470fb.system.entry.js → p-2a4d22c9.system.entry.js} +1 -1
- package/dist/magma-components/{p-d0a93a14.system.entry.js → p-2c3f518c.system.entry.js} +6 -3
- package/dist/magma-components/{p-1908f808.entry.js → p-2d9c9ef9.entry.js} +1 -1
- package/dist/magma-components/p-35528bdd.system.entry.js +225 -0
- package/dist/magma-components/{p-74f515c3.system.entry.js → p-37487e8b.system.entry.js} +2 -2
- package/dist/magma-components/{p-47717251.system.entry.js → p-38b16983.system.entry.js} +3 -3
- package/dist/magma-components/{p-ca1969c5.entry.js → p-3c669cfb.entry.js} +1 -1
- package/dist/magma-components/{p-4bc47ff0.system.entry.js → p-3e18b181.system.entry.js} +1 -1
- package/dist/magma-components/{p-000c315c.entry.js → p-3f68ddca.entry.js} +1 -1
- package/dist/magma-components/{p-0d32e196.system.entry.js → p-44333d50.system.entry.js} +5 -4
- package/dist/magma-components/{p-2eb4efcd.system.entry.js → p-44998584.system.entry.js} +2 -2
- package/dist/magma-components/{p-84777b38.system.entry.js → p-50705d36.system.entry.js} +2 -2
- package/dist/magma-components/{p-0148cf0a.entry.js → p-521ba3a8.entry.js} +1 -1
- package/dist/magma-components/{p-577ae081.system.entry.js → p-5472f18d.system.entry.js} +1 -1
- package/dist/magma-components/{p-396d95a1.system.entry.js → p-55b10b70.system.entry.js} +2 -2
- package/dist/magma-components/{p-617370e7.system.entry.js → p-624a3909.system.entry.js} +6 -6
- package/dist/magma-components/{p-5533b60d.system.entry.js → p-62e94d78.system.entry.js} +1 -1
- package/dist/magma-components/{p-b738d3c1.entry.js → p-69badbba.entry.js} +1 -1
- package/dist/magma-components/{p-29ab84bf.system.entry.js → p-6af00399.system.entry.js} +4 -4
- package/dist/magma-components/{p-3dc81ab9.system.entry.js → p-6dff107d.system.entry.js} +2 -2
- package/dist/magma-components/{p-70d38284.entry.js → p-770b3c4b.entry.js} +1 -1
- package/dist/magma-components/p-77545238.entry.js +1 -0
- package/dist/magma-components/{p-05ed801b.system.entry.js → p-79f543fc.system.entry.js} +1 -1
- package/dist/magma-components/p-7ad68b2f.entry.js +1 -0
- package/dist/magma-components/{p-336f56a4.entry.js → p-7b300282.entry.js} +1 -1
- package/dist/magma-components/{p-e5950aee.entry.js → p-7be0d28b.entry.js} +1 -1
- package/dist/magma-components/{p-15ffdcf6.entry.js → p-7ca73c56.entry.js} +1 -1
- package/dist/magma-components/{p-358aa5e7.entry.js → p-7d0c8177.entry.js} +1 -1
- package/dist/magma-components/{p-80eea067.system.entry.js → p-803957de.system.entry.js} +1 -1
- package/dist/magma-components/{p-cbb80188.entry.js → p-85a31141.entry.js} +1 -1
- package/dist/magma-components/{p-dbd34e3b.entry.js → p-85fb1d08.entry.js} +1 -1
- package/dist/magma-components/{p-5da14e81.entry.js → p-87baf82a.entry.js} +1 -1
- package/dist/magma-components/{p-3fd8ff0e.system.entry.js → p-88460d31.system.entry.js} +1 -1
- package/dist/magma-components/{p-fc2d1134.entry.js → p-8b501f92.entry.js} +1 -1
- package/dist/magma-components/{p-d980c3d2.system.entry.js → p-8ca2e879.system.entry.js} +1 -1
- package/dist/magma-components/{p-8680f63e.entry.js → p-8d14f146.entry.js} +1 -1
- package/dist/magma-components/{p-244676d3.system.entry.js → p-8f47eb63.system.entry.js} +1 -1
- package/dist/magma-components/{p-8173ed07.entry.js → p-93d7485d.entry.js} +2 -2
- package/dist/magma-components/{p-1eee93c8.system.entry.js → p-94439d8b.system.entry.js} +1 -1
- package/dist/magma-components/{p-4c6da1db.system.entry.js → p-947fcf74.system.entry.js} +3 -3
- package/dist/magma-components/{p-458eb34c.system.entry.js → p-97eb734a.system.entry.js} +2 -2
- package/dist/magma-components/{p-835d79e5.system.entry.js → p-99bfa07e.system.entry.js} +1 -1
- package/dist/magma-components/{p-26b9f2b7.system.entry.js → p-9cf81575.system.entry.js} +1 -1
- package/dist/magma-components/{p-8645533a.entry.js → p-9f6c502b.entry.js} +1 -1
- package/dist/magma-components/p-B8zYiZQY.system.js +1 -1
- package/dist/magma-components/{p-OOCOFWC0.system.js → p-CuHZXISO.system.js} +7 -3
- package/dist/magma-components/{p-DXAjcaHM.system.js → p-CxTugGM9.system.js} +1 -1
- package/dist/magma-components/{p-U5iXN1wy.js → p-Dx_cCOTw.js} +1 -1
- package/dist/magma-components/{p-Raj-urIN.js → p-OafT80hV.js} +1 -1
- package/dist/magma-components/{p-2cbd532a.system.entry.js → p-a0612465.system.entry.js} +1 -1
- package/dist/magma-components/{p-26451eb6.entry.js → p-a8a0a9ba.entry.js} +1 -1
- package/dist/magma-components/{p-d37fe692.system.entry.js → p-a987086b.system.entry.js} +1 -1
- package/dist/magma-components/{p-2cdf450c.system.entry.js → p-ad05ef26.system.entry.js} +1 -1
- package/dist/magma-components/{p-29162c98.entry.js → p-b01118cc.entry.js} +1 -1
- package/dist/magma-components/{p-791a6a6f.entry.js → p-b373cc32.entry.js} +1 -1
- package/dist/magma-components/{p-8279056b.system.entry.js → p-b4633c9c.system.entry.js} +1 -1
- package/dist/magma-components/{p-55746791.entry.js → p-b467f737.entry.js} +1 -1
- package/dist/magma-components/{p-bf0cb77d.system.entry.js → p-b5cc09c7.system.entry.js} +1 -1
- package/dist/magma-components/{p-87ce9d6c.entry.js → p-b69c3126.entry.js} +1 -1
- package/dist/magma-components/{p-29450db3.entry.js → p-b8a59768.entry.js} +1 -1
- package/dist/magma-components/{p-ab00b7b9.entry.js → p-b9ca6c2e.entry.js} +1 -1
- package/dist/magma-components/{p-77939a25.system.entry.js → p-bb282bc1.system.entry.js} +1 -1
- package/dist/magma-components/{p-6f81c9ef.system.entry.js → p-be6e156a.system.entry.js} +2 -2
- package/dist/magma-components/{p-729c89f9.system.entry.js → p-c03fc4fe.system.entry.js} +1 -1
- package/dist/magma-components/{p-2aac4003.entry.js → p-c40ad03a.entry.js} +1 -1
- package/dist/magma-components/{p-471227f2.system.entry.js → p-cc954b22.system.entry.js} +2 -2
- package/dist/magma-components/{p-1faa4f71.entry.js → p-ced3ebb8.entry.js} +1 -1
- package/dist/magma-components/{p-41a28f2a.system.entry.js → p-d254de66.system.entry.js} +2 -2
- package/dist/magma-components/{p-a76a9f92.system.entry.js → p-d3491226.system.entry.js} +1 -1
- package/dist/magma-components/{p-919f9dce.entry.js → p-d608b79c.entry.js} +1 -1
- package/dist/magma-components/{p-f2f992c2.system.entry.js → p-da93a00b.system.entry.js} +2 -2
- package/dist/magma-components/{p-287601bb.entry.js → p-dbca23af.entry.js} +1 -1
- package/dist/magma-components/{p-9855b517.entry.js → p-de1ae02c.entry.js} +1 -1
- package/dist/magma-components/{p-f1aafe07.entry.js → p-dedbf8d6.entry.js} +1 -1
- package/dist/magma-components/{p-0b3e4a97.system.entry.js → p-e2fa6300.system.entry.js} +1 -1
- package/dist/magma-components/{p-860bce85.system.entry.js → p-eb92312f.system.entry.js} +3 -3
- package/dist/magma-components/{p-b5789a7c.entry.js → p-ec635255.entry.js} +1 -1
- package/dist/magma-components/{p-d561062f.system.entry.js → p-f0285a1e.system.entry.js} +1 -1
- package/dist/magma-components/{p-b476435f.entry.js → p-f09b08f9.entry.js} +1 -1
- package/dist/magma-components/{p-481897a7.entry.js → p-f306b5c1.entry.js} +1 -1
- package/dist/magma-components/{p-d0bfdb44.system.entry.js → p-f39416e9.system.entry.js} +1 -1
- package/dist/magma-components/{p-f889d413.system.entry.js → p-f5326224.system.entry.js} +1 -1
- package/dist/magma-components/{p-73833405.entry.js → p-f5a33058.entry.js} +1 -1
- package/dist/magma-components/{p-96bb36b9.entry.js → p-f616f467.entry.js} +1 -1
- package/dist/magma-components/{p-34c2daa9.system.entry.js → p-f75935ed.system.entry.js} +1 -1
- package/dist/magma-components/{p-71cbc840.entry.js → p-f901c844.entry.js} +1 -1
- package/dist/magma-components/{p-656b00df.system.entry.js → p-fc22f5e0.system.entry.js} +8 -8
- package/dist/magma-components/{p-357724ab.entry.js → p-ffbf7448.entry.js} +1 -1
- package/dist/stats.json +777 -771
- package/dist/types/common/locale.d.ts +5 -0
- package/dist/types/components/mds-input/meta/validators.d.ts +7 -2
- package/dist/types/components/mds-input/meta/validity.d.ts +3 -2
- package/dist/types/components/mds-input-select/mds-input-select.d.ts +2 -1
- package/package.json +1 -1
- package/dist/components/p-BbTcXgbr.js +0 -1
- package/dist/magma-components/p-632ad925.system.entry.js +0 -222
- package/dist/magma-components/p-644e64a0.entry.js +0 -1
- package/dist/magma-components/p-7ec1ea2e.entry.js +0 -1
- package/dist/magma-components/p-da24a265.entry.js +0 -1
- package/dist/magma-components/p-f78c1699.entry.js +0 -1
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import { Locale } from "../../../common/locale";
|
|
2
|
+
import localeEl from "./locale.el.json";
|
|
3
|
+
import localeEn from "./locale.en.json";
|
|
4
|
+
import localeEs from "./locale.es.json";
|
|
5
|
+
import localeIt from "./locale.it.json";
|
|
6
|
+
const messages = new Locale({ el: localeEl, en: localeEn, es: localeEs, it: localeIt });
|
|
7
|
+
/**
|
|
8
|
+
* The message of a failed validation, in the language of the page when the value is validated: a
|
|
9
|
+
* validator is built once, and the language can change after that.
|
|
10
|
+
*/
|
|
11
|
+
export const validationMessage = (tag, context) => messages.get(tag, context);
|
|
1
12
|
export const NullValidator = () => null;
|
|
2
13
|
export const requiredValidor = (input) => {
|
|
3
14
|
return input.length > 0 ? null : { required: '' };
|
|
@@ -10,7 +21,9 @@ export const maxValidator = (max) => {
|
|
|
10
21
|
const value = parseFloat(input);
|
|
11
22
|
// Controls with NaN values after parsing should be treated as not having a
|
|
12
23
|
// maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max
|
|
13
|
-
return !isNaN(value) && value > max
|
|
24
|
+
return !isNaN(value) && value > max
|
|
25
|
+
? { max: validationMessage('validationMax', { max }) }
|
|
26
|
+
: null;
|
|
14
27
|
};
|
|
15
28
|
};
|
|
16
29
|
export const minValidator = (min) => {
|
|
@@ -21,26 +34,28 @@ export const minValidator = (min) => {
|
|
|
21
34
|
const value = parseFloat(input);
|
|
22
35
|
// Controls with NaN values after parsing should be treated as not having a
|
|
23
36
|
// minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min
|
|
24
|
-
return !isNaN(value) && value < min
|
|
37
|
+
return !isNaN(value) && value < min
|
|
38
|
+
? { min: validationMessage('validationMin', { min }) }
|
|
39
|
+
: null;
|
|
25
40
|
};
|
|
26
41
|
};
|
|
27
|
-
export const
|
|
42
|
+
export const maxLengthValidator = (length) => {
|
|
28
43
|
return (input) => {
|
|
29
44
|
if (input === '' || length === null) {
|
|
30
45
|
return null; // don't validate empty values to allow optional controls
|
|
31
46
|
}
|
|
32
47
|
return input.length > length
|
|
33
|
-
? {
|
|
48
|
+
? { maxlength: validationMessage('validationMaxlength', { maxlength: length }) }
|
|
34
49
|
: null;
|
|
35
50
|
};
|
|
36
51
|
};
|
|
37
|
-
export const
|
|
52
|
+
export const minLengthValidator = (length) => {
|
|
38
53
|
return (input) => {
|
|
39
54
|
if (input === '' || length === null) {
|
|
40
55
|
return null; // don't validate empty values to allow optional controls
|
|
41
56
|
}
|
|
42
57
|
return input.length < length
|
|
43
|
-
? {
|
|
58
|
+
? { minlength: validationMessage('validationMinlength', { minlength: length }) }
|
|
44
59
|
: null;
|
|
45
60
|
};
|
|
46
61
|
};
|
|
@@ -68,7 +83,7 @@ export const patternValidator = (pattern) => {
|
|
|
68
83
|
return (input) => {
|
|
69
84
|
if (input === '')
|
|
70
85
|
return null; // don't validate empty values to allow optional controls
|
|
71
|
-
return expression.test(input) ? null : { pattern: '
|
|
86
|
+
return expression.test(input) ? null : { pattern: validationMessage('validationPattern') };
|
|
72
87
|
};
|
|
73
88
|
};
|
|
74
89
|
// the valid email address of the HTML spec, the one a native type="email" checks
|
|
@@ -76,7 +91,7 @@ const emailExpression = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z
|
|
|
76
91
|
export const emailValidatorFn = (input) => {
|
|
77
92
|
if (input === '')
|
|
78
93
|
return null; // don't validate empty values to allow optional controls
|
|
79
|
-
return emailExpression.test(input) ? null : { email: '
|
|
94
|
+
return emailExpression.test(input) ? null : { email: validationMessage('validationEmail') };
|
|
80
95
|
};
|
|
81
96
|
// a native type="url" accepts an absolute URL, the one the URL parser reads without a base
|
|
82
97
|
export const urlValidatorFn = (input) => {
|
|
@@ -87,7 +102,7 @@ export const urlValidatorFn = (input) => {
|
|
|
87
102
|
return null;
|
|
88
103
|
}
|
|
89
104
|
catch (_a) {
|
|
90
|
-
return { url: '
|
|
105
|
+
return { url: validationMessage('validationUrl') };
|
|
91
106
|
}
|
|
92
107
|
};
|
|
93
108
|
/**
|
|
@@ -97,7 +112,7 @@ export const urlValidatorFn = (input) => {
|
|
|
97
112
|
export const pivaValidatorFn = (input) => {
|
|
98
113
|
if (input === '')
|
|
99
114
|
return null; // don't validate empty values to allow optional controls
|
|
100
|
-
const error = { piva: '
|
|
115
|
+
const error = { piva: validationMessage('validationPiva') };
|
|
101
116
|
if (!/^\d{11}$/.test(input))
|
|
102
117
|
return error;
|
|
103
118
|
const digits = input.split('').map(Number);
|
|
@@ -116,7 +131,7 @@ export const pivaValidatorFn = (input) => {
|
|
|
116
131
|
export const ccValidatorFn = (input) => {
|
|
117
132
|
if (input === '')
|
|
118
133
|
return null; // don't validate empty values to allow optional controls
|
|
119
|
-
const error = { cc: '
|
|
134
|
+
const error = { cc: validationMessage('validationCc') };
|
|
120
135
|
if (!/^\d+(?:[ -]\d+)*$/.test(input))
|
|
121
136
|
return error;
|
|
122
137
|
const digits = input.replace(/[ -]/g, '');
|
|
@@ -139,7 +154,7 @@ export const isbnValidatorFn = (input) => {
|
|
|
139
154
|
if (input === '')
|
|
140
155
|
return null; // don't validate empty values to allow optional controls
|
|
141
156
|
if (Number.isNaN(input.slice(0, -1)) || (input.length !== 10 && input.length !== 13))
|
|
142
|
-
return { 'isbn-error': '
|
|
157
|
+
return { 'isbn-error': validationMessage('validationIsbnFormat') };
|
|
143
158
|
const v = input.split('').map((v) => (v === 'X' ? 10 : Number(v)));
|
|
144
159
|
let check = 0;
|
|
145
160
|
// check isbn-10
|
|
@@ -157,7 +172,7 @@ export const isbnValidatorFn = (input) => {
|
|
|
157
172
|
}, 0);
|
|
158
173
|
check = numVerify % 10;
|
|
159
174
|
}
|
|
160
|
-
return check === 0 ? null : { 'isbn-error': '
|
|
175
|
+
return check === 0 ? null : { 'isbn-error': validationMessage('validationIsbn') };
|
|
161
176
|
};
|
|
162
177
|
export class Validator {
|
|
163
178
|
constructor() {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
// the validators of the type carry an Italian message: the form gets the localized one instead
|
|
2
|
-
const typeErrors = ['cf-length', 'cf-regex', 'isbn-error'];
|
|
3
1
|
/**
|
|
4
2
|
* The problem reported to the form for the errors of a value. The first validator that fails
|
|
5
3
|
* decides it: the ones of the type come first, then required, max, min, maxlength, minlength,
|
|
6
|
-
* pattern and the custom ones last,
|
|
4
|
+
* pattern and the custom ones last. The codice fiscale and ISBN validators, like the custom ones,
|
|
5
|
+
* give the form their own message, already in the language of the page.
|
|
7
6
|
*/
|
|
8
|
-
export const validityProblem = (errors,
|
|
7
|
+
export const validityProblem = (errors, constraints) => {
|
|
9
8
|
const [key] = Object.keys(errors);
|
|
10
9
|
switch (key) {
|
|
11
10
|
case 'required':
|
|
@@ -14,11 +13,10 @@ export const validityProblem = (errors, value, constraints) => {
|
|
|
14
13
|
return { rule: 'max', context: { max: constraints.max } };
|
|
15
14
|
case 'min':
|
|
16
15
|
return { rule: 'min', context: { min: constraints.min } };
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
: { rule: 'minlength', context: { minlength: constraints.minlength } };
|
|
16
|
+
case 'maxlength':
|
|
17
|
+
return { rule: 'maxlength', context: { maxlength: constraints.maxlength } };
|
|
18
|
+
case 'minlength':
|
|
19
|
+
return { rule: 'minlength', context: { minlength: constraints.minlength } };
|
|
22
20
|
case 'pattern':
|
|
23
21
|
return { rule: 'pattern' };
|
|
24
22
|
case 'email':
|
|
@@ -30,6 +28,6 @@ export const validityProblem = (errors, value, constraints) => {
|
|
|
30
28
|
case 'cc':
|
|
31
29
|
return { rule: 'cardNumber' };
|
|
32
30
|
default:
|
|
33
|
-
return { rule: 'invalid', message:
|
|
31
|
+
return { rule: 'invalid', message: errors[key] };
|
|
34
32
|
}
|
|
35
33
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-input-date
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-input-date>` web component is the Magma Design System control for capturing a single calendar date. It wraps a native `<input type="date">`, adding form association, ISO value validation against an optional `min`/`max` range, contextual tips, and a button-triggered calendar dropdown for visual date picking.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-input-date-range
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-input-date-range>` web component is the Magma Design System control for capturing a start/end date pair, composing two slotted `<mds-input-date>` fields with a shared pop-up `mds-calendar` (in range mode) and optional quick-pick presets. It is a form-associated compound parent that orchestrates its children rather than rendering its own native inputs.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-input-date-range-preselection
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-input-date-range-preselection>` web component is a compound child of [`<mds-input-date-range>`](../mds-input-date-range/AGENTS.md). It renders a clickable shortcut button (a quick range like "Last 7 days" or "This month") that, when activated, fills the parent's date range with a predefined `start`/`end` pair instead of requiring the user to pick dates manually on the calendar.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-input-field
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-input-field>` web component is the form-field wrapper of the Magma Design System. It does not render an input itself; instead it decorates a slotted `<mds-input>` (or similar control) with a top label and a bottom message area, and reacts to the control's validation lifecycle. It plays the role the native `<label>` + helper-text grouping plays around an `<input>`.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-input-otp
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-input-otp>` web component is the Magma Design System control for entering one-time passcodes, rendering a row of single-digit fields that together compose a single form value. It is form-associated, so it behaves like a native input whose value is the concatenated OTP code.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-input-range
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-input-range>` web component is the Magma Design System slider control for picking a single numeric value from a continuous interval. It wraps a native `<input type="range">`, adding a labelled header, a styled track with a live progress fill, form association, and value formatting.
|
|
12
12
|
|
|
@@ -151,22 +151,6 @@ mds-text {
|
|
|
151
151
|
margin-right: --spacing(100);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
/* :disabled also covers a disabled fieldset around the range, which sets no attribute */
|
|
155
|
-
|
|
156
|
-
:host([disabled]:not([disabled='false'])),
|
|
157
|
-
:host(:disabled:not([disabled='false'])) {
|
|
158
|
-
--mds-input-range-thumb-background: var(--mds-input-range-thumb-background-disabled);
|
|
159
|
-
--mds-input-range-track-background: var(--mds-input-range-track-background-disabled);
|
|
160
|
-
--mds-input-range-track-progress-background: var(
|
|
161
|
-
--mds-input-range-track-progress-background-disabled
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
:host([disabled]:not([disabled='false'])) .field::-webkit-slider-thumb,
|
|
166
|
-
:host(:disabled:not([disabled='false'])) .field::-webkit-slider-thumb {
|
|
167
|
-
cursor: not-allowed;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
154
|
/* Motion, held back.
|
|
171
155
|
*
|
|
172
156
|
* Every component zeroes the private durations its own base CSS reads, which composes
|
|
@@ -233,17 +217,21 @@ mds-text {
|
|
|
233
217
|
* from <html> onto its host as pref-mode + pref-theme-scheme (see
|
|
234
218
|
* subscribePreference in @common/preference); these plain shadow selectors refine
|
|
235
219
|
* for dark. `dark` is the explicit choice; `system` and no controller follow the
|
|
236
|
-
* OS via @media; the scheme axis gates it. Cross-browser, no :host-context.
|
|
220
|
+
* OS via @media; the scheme axis gates it. Cross-browser, no :host-context.
|
|
221
|
+
*
|
|
222
|
+
* The thumb is light in dark, as the off knob of mds-input-switch: text-default, 5.19:1 on the
|
|
223
|
+
* empty track. It used to take accent-emphasis, the colour of its own ring and of the progress,
|
|
224
|
+
* so the three were one shape and the thumb could not be seen. */
|
|
237
225
|
|
|
238
226
|
:host([pref-mode='dark']:not([pref-theme-scheme='light'])) {
|
|
239
|
-
--mds-input-range-thumb-background: rgb(var(--magma-
|
|
227
|
+
--mds-input-range-thumb-background: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
|
|
240
228
|
--mds-input-range-track-progress-background: rgb(var(--magma-accent-emphasis, var(--variant-primary-04, 36 103 231)));
|
|
241
229
|
}
|
|
242
230
|
|
|
243
231
|
@media (prefers-color-scheme: dark) {
|
|
244
232
|
:host([pref-mode='system']:not([pref-theme-scheme='light'])),
|
|
245
233
|
:host(:not([pref-mode])) {
|
|
246
|
-
--mds-input-range-thumb-background: rgb(var(--magma-
|
|
234
|
+
--mds-input-range-thumb-background: rgb(var(--magma-text-default, var(--text-neutral-default, 5 5 5)));
|
|
247
235
|
--mds-input-range-track-progress-background: rgb(var(--magma-accent-emphasis, var(--variant-primary-04, 36 103 231)));
|
|
248
236
|
}
|
|
249
237
|
}
|
|
@@ -264,3 +252,22 @@ mds-text {
|
|
|
264
252
|
}
|
|
265
253
|
}
|
|
266
254
|
|
|
255
|
+
|
|
256
|
+
/* after the pref-* sheets, whose selectors weigh the same: a disabled range keeps its colours in
|
|
257
|
+
* dark too */
|
|
258
|
+
/* :disabled also covers a disabled fieldset around the range, which sets no attribute */
|
|
259
|
+
|
|
260
|
+
:host([disabled]:not([disabled='false'])),
|
|
261
|
+
:host(:disabled:not([disabled='false'])) {
|
|
262
|
+
--mds-input-range-thumb-background: var(--mds-input-range-thumb-background-disabled);
|
|
263
|
+
--mds-input-range-track-background: var(--mds-input-range-track-background-disabled);
|
|
264
|
+
--mds-input-range-track-progress-background: var(
|
|
265
|
+
--mds-input-range-track-progress-background-disabled
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
:host([disabled]:not([disabled='false'])) .field::-webkit-slider-thumb,
|
|
270
|
+
:host(:disabled:not([disabled='false'])) .field::-webkit-slider-thumb {
|
|
271
|
+
cursor: not-allowed;
|
|
272
|
+
}
|
|
273
|
+
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-input-select
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-input-select>` web component is the Magma Design System single- and multi-choice dropdown control. It wraps a native `<select>` element, adding form association, accessible status feedback, and themed chrome while accepting plain `<option>` elements through its default slot.
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ The `<mds-input-select>` web component is the Magma Design System single- and mu
|
|
|
17
17
|
- **Form association**: The selection is pushed to the host form: a single select submits its `value`, a `multiple` one an entry per selected option under `name`, as a native select. A form reset brings back the selection of load, like a native select: the options the markup marks `selected` (or the placeholder), with the `value` of load on top. Toggling `disabled` removes the value from the submitted form data.
|
|
18
18
|
- **Disabled fieldset**: A disabled `<fieldset>` around the component disables it as `disabled` does, like a native control: it cannot be changed and its value is left out of the form, until the fieldset is enabled.
|
|
19
19
|
- **Form validity**: A `required` select left empty is reported to the form as a native one: it matches `:invalid` and stops the submit, with a message in the page language. A disabled select is left out, and `novalidate` on the `<form>` turns the check off.
|
|
20
|
-
- **Value syncing**: Changing the selection (by user input, the `setValue()` method, or the prop) emits `mdsInputSelectChange` with `{ value, values }` in `detail`: `value` is the first selected option as a string, `values` the values of every selected option, the placeholder left out. A `value` set by code selects its `<option>` alone, as `select.value` does, and a value cleared by code goes back to the placeholder.
|
|
20
|
+
- **Value syncing**: Changing the selection (by user input, the `setValue()` method, or the prop) emits `mdsInputSelectChange` with `{ value, values }` in `detail`: `value` is the first selected option as a string, `values` the values of every selected option, the placeholder left out. Like a native `<select>`, it is not emitted on load: the selection the component starts with reaches the form, not the event. A `value` set by code selects its `<option>` alone, as `select.value` does, and a value cleared by code goes back to the placeholder.
|
|
21
21
|
- **Placeholder option**: When `placeholder` is set, a leading empty-value `<option>` is injected as the first entry; if `required` is set that placeholder is disabled so it cannot be re-selected after a valid choice.
|
|
22
22
|
- **Default selection fallback**: With no explicit value, the options the markup marks `selected` become the selection; without them, the placeholder or, with no placeholder, the first option of a single select. A `defaultValue` seeds `value` at load.
|
|
23
23
|
- **Status tip**: A status tip surfaces verbose state - a disabled notice, and for required fields a `required` / `required-success` message that expands while the control has focus.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-10-
|
|
2
|
+
"timestamp": "2026-10-22T13:02:36",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.45.2",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
],
|
|
28
28
|
"usage": {
|
|
29
|
-
"1. Description": "The `<mds-input-select>` web component is the Magma Design System single- and multi-choice dropdown control. It wraps a native `<select>` element, adding form association, accessible status feedback, and themed chrome while accepting plain `<option>` elements through its default slot.\n\n#### Semantic Behavior\n\n- **Native select wrapping**: It renders a real `<select>` (exposed as the `select` part) so keyboard, type-ahead, and platform option lists work natively; the host owns theming and status only.\n- **Slotted options**: The default slot accepts `<option>` (and `<optgroup>`) markup; the current selection re-syncs whenever the slotted content changes.\n- **Form association**: The selection is pushed to the host form: a single select submits its `value`, a `multiple` one an entry per selected option under `name`, as a native select. A form reset brings back the selection of load, like a native select: the options the markup marks `selected` (or the placeholder), with the `value` of load on top. Toggling `disabled` removes the value from the submitted form data.\n- **Disabled fieldset**: A disabled `<fieldset>` around the component disables it as `disabled` does, like a native control: it cannot be changed and its value is left out of the form, until the fieldset is enabled.\n- **Form validity**: A `required` select left empty is reported to the form as a native one: it matches `:invalid` and stops the submit, with a message in the page language. A disabled select is left out, and `novalidate` on the `<form>` turns the check off.\n- **Value syncing**: Changing the selection (by user input, the `setValue()` method, or the prop) emits `mdsInputSelectChange` with `{ value, values }` in `detail`: `value` is the first selected option as a string, `values` the values of every selected option, the placeholder left out. A `value` set by code selects its `<option>` alone, as `select.value` does, and a value cleared by code goes back to the placeholder.\n- **Placeholder option**: When `placeholder` is set, a leading empty-value `<option>` is injected as the first entry; if `required` is set that placeholder is disabled so it cannot be re-selected after a valid choice.\n- **Default selection fallback**: With no explicit value, the options the markup marks `selected` become the selection; without them, the placeholder or, with no placeholder, the first option of a single select. A `defaultValue` seeds `value` at load.\n- **Status tip**: A status tip surfaces verbose state - a disabled notice, and for required fields a `required` / `required-success` message that expands while the control has focus.\n\n#### Properties & Visual Configurations\n\nThe `variant` prop applies a status appearance drawn from the shared status ladder in [`agents/variants.md`](../../../../agents/variants.md) - use it to reflect validation outcome (`'error'`, `'success'`, `'warning'`, `'info'`) rather than decorative styling. This component exposes no separate `tone` prop.\n\n- **`size`** sets the height of the field, the same as [`<mds-button>`](../mds-button/AGENTS.md): `sm` 28px, `md` 36px, `lg` 48px (default). Match it to the buttons next to the field, or go smaller in dense layouts (filter bars, table toolbars); the text style stays the same, the padding and the inner arrow scale with it.\n\n#### Other behavioral props\n\n- **`multiple`** turns the control into a multi-select list box: the form gets an entry per selected option and `values` in the `mdsInputSelectChange` detail lists them all, while `value` holds the first one, as `select.value` does. **`rows`** sets how many option rows are visible at once, as the `size` of a native `<select>`: above `1` it shows a list box even without `multiple`. A number in `size`, the row count it used to set, still works as `rows` but warns: it is deprecated and goes in the next major.\n- **`defaultValue`** is the initial selection used to seed the value at load (notably for the React wrapper), distinct from the live `value` that reflects the current choice.\n- **`required`** both enforces a non-empty submission and locks the placeholder option so the empty entry cannot be chosen again.\n",
|
|
29
|
+
"1. Description": "The `<mds-input-select>` web component is the Magma Design System single- and multi-choice dropdown control. It wraps a native `<select>` element, adding form association, accessible status feedback, and themed chrome while accepting plain `<option>` elements through its default slot.\n\n#### Semantic Behavior\n\n- **Native select wrapping**: It renders a real `<select>` (exposed as the `select` part) so keyboard, type-ahead, and platform option lists work natively; the host owns theming and status only.\n- **Slotted options**: The default slot accepts `<option>` (and `<optgroup>`) markup; the current selection re-syncs whenever the slotted content changes.\n- **Form association**: The selection is pushed to the host form: a single select submits its `value`, a `multiple` one an entry per selected option under `name`, as a native select. A form reset brings back the selection of load, like a native select: the options the markup marks `selected` (or the placeholder), with the `value` of load on top. Toggling `disabled` removes the value from the submitted form data.\n- **Disabled fieldset**: A disabled `<fieldset>` around the component disables it as `disabled` does, like a native control: it cannot be changed and its value is left out of the form, until the fieldset is enabled.\n- **Form validity**: A `required` select left empty is reported to the form as a native one: it matches `:invalid` and stops the submit, with a message in the page language. A disabled select is left out, and `novalidate` on the `<form>` turns the check off.\n- **Value syncing**: Changing the selection (by user input, the `setValue()` method, or the prop) emits `mdsInputSelectChange` with `{ value, values }` in `detail`: `value` is the first selected option as a string, `values` the values of every selected option, the placeholder left out. Like a native `<select>`, it is not emitted on load: the selection the component starts with reaches the form, not the event. A `value` set by code selects its `<option>` alone, as `select.value` does, and a value cleared by code goes back to the placeholder.\n- **Placeholder option**: When `placeholder` is set, a leading empty-value `<option>` is injected as the first entry; if `required` is set that placeholder is disabled so it cannot be re-selected after a valid choice.\n- **Default selection fallback**: With no explicit value, the options the markup marks `selected` become the selection; without them, the placeholder or, with no placeholder, the first option of a single select. A `defaultValue` seeds `value` at load.\n- **Status tip**: A status tip surfaces verbose state - a disabled notice, and for required fields a `required` / `required-success` message that expands while the control has focus.\n\n#### Properties & Visual Configurations\n\nThe `variant` prop applies a status appearance drawn from the shared status ladder in [`agents/variants.md`](../../../../agents/variants.md) - use it to reflect validation outcome (`'error'`, `'success'`, `'warning'`, `'info'`) rather than decorative styling. This component exposes no separate `tone` prop.\n\n- **`size`** sets the height of the field, the same as [`<mds-button>`](../mds-button/AGENTS.md): `sm` 28px, `md` 36px, `lg` 48px (default). Match it to the buttons next to the field, or go smaller in dense layouts (filter bars, table toolbars); the text style stays the same, the padding and the inner arrow scale with it.\n\n#### Other behavioral props\n\n- **`multiple`** turns the control into a multi-select list box: the form gets an entry per selected option and `values` in the `mdsInputSelectChange` detail lists them all, while `value` holds the first one, as `select.value` does. **`rows`** sets how many option rows are visible at once, as the `size` of a native `<select>`: above `1` it shows a list box even without `multiple`. A number in `size`, the row count it used to set, still works as `rows` but warns: it is deprecated and goes in the next major.\n- **`defaultValue`** is the initial selection used to seed the value at load (notably for the React wrapper), distinct from the live `value` that reflects the current choice.\n- **`required`** both enforces a non-empty submission and locks the placeholder option so the empty entry cannot be chosen again.\n",
|
|
30
30
|
"2. Pattern": "Correct and idiomatic ways to use the `<mds-input-select>` component, ordered from most common to most specialized. Patterns assume a working knowledge of the variant / tone ladders documented in [`agents/variants.md`](../../../../agents/variants.md) and the shared component rules in [`agents/conventions.md`](../../../../agents/conventions.md).\n\n#### Basic Select with Placeholder\n\nThe canonical form. Slot plain `<option>` elements as direct children. Set `placeholder` to inject a leading empty-value entry that prompts the user before a choice is made.\n\n```html\n<mds-input-select name=\"categoria\" placeholder=\"Seleziona una categoria...\">\n <option value=\"news\">Notizie</option>\n <option value=\"eventi\">Eventi</option>\n <option value=\"avvisi\">Avvisi</option>\n</mds-input-select>\n```\n\n#### Required Select Inside a Form\n\nAdding `required` enforces a non-empty submission - an empty select stops the submit like a native one - and disables the placeholder option once a valid choice exists, so users cannot revert to the empty entry. Place the component inside a `<form>` - it is form-associated and submits natively.\n\n```html\n<form action=\"/salva\" method=\"post\">\n <mds-input-select name=\"regione\" required placeholder=\"Scegli la regione...\">\n <option value=\"lombardia\">Lombardia</option>\n <option value=\"veneto\">Veneto</option>\n <option value=\"toscana\">Toscana</option>\n </mds-input-select>\n <mds-button type=\"submit\" label=\"Invia\" variant=\"primary\" tone=\"strong\"></mds-button>\n</form>\n```\n\n#### Pre-selected Value via `value`\n\nPass `value` to open the component with a specific option already chosen. The matching `<option>` is marked selected automatically. Use `default-value` instead when the initial selection is set once at load and you do not need live two-way binding (notably in the React wrapper).\n\n```html\n<!-- Live controlled value -->\n<mds-input-select name=\"priorita\" value=\"alta\">\n <option value=\"bassa\">Bassa</option>\n <option value=\"media\">Media</option>\n <option value=\"alta\">Alta</option>\n</mds-input-select>\n\n<!-- Initial seed value for React / SSR -->\n<mds-input-select name=\"priorita\" default-value=\"media\">\n <option value=\"bassa\">Bassa</option>\n <option value=\"media\">Media</option>\n <option value=\"alta\">Alta</option>\n</mds-input-select>\n```\n\n#### Listening to Value Changes\n\nListen to `mdsInputSelectChange` - do not rely on the native `change` event, which may not bubble out of shadow DOM reliably. The event detail carries the chosen value as a string in `value`, and the values of every selected option in `values`.\n\n```html\n<mds-input-select id=\"stato-pratica\" name=\"stato\" placeholder=\"Seleziona stato...\">\n <option value=\"bozza\">Bozza</option>\n <option value=\"in-lavorazione\">In lavorazione</option>\n <option value=\"chiusa\">Chiusa</option>\n</mds-input-select>\n\n<script>\n document.getElementById('stato-pratica')\n .addEventListener('mdsInputSelectChange', (event) => {\n console.log('Nuovo stato:', event.detail.value);\n });\n</script>\n```\n\n#### Programmatic Value via `setValue()`\n\nUse the `setValue()` async method when you need to change the selection from JavaScript after the component has rendered - for example when a related control resets the form state.\n\n```html\n<mds-input-select id=\"provincia\" name=\"provincia\" placeholder=\"Seleziona provincia...\">\n <option value=\"MI\">Milano</option>\n <option value=\"RM\">Roma</option>\n <option value=\"TO\">Torino</option>\n</mds-input-select>\n\n<script>\n async function resetSelezione() {\n const el = document.getElementById('provincia');\n await el.setValue('MI');\n }\n</script>\n```\n\n#### Disabled State\n\nSet `disabled` as a boolean attribute to block interaction and remove the value from the submitted form data. A status tip is shown automatically while the component is disabled.\n\n```html\n<mds-input-select name=\"tipo-contratto\" disabled placeholder=\"Non disponibile\">\n <option value=\"td\">Tempo determinato</option>\n <option value=\"ti\">Tempo indeterminato</option>\n</mds-input-select>\n```\n\n#### Multi-select List Box\n\n`multiple` switches the component to a scrollable list that allows zero or more simultaneous selections. Use `rows` to control how many rows are visible without scrolling (`size` sets the height of the field). Mark the options to preselect with `selected`, as in a native `<select multiple>`. The form submits an entry per selected option under `name`, and `values` in the `mdsInputSelectChange` detail lists them all; `value` holds only the first one, as `select.value` does.\n\n```html\n<mds-input-select name=\"competenze\" multiple rows=\"4\">\n <option value=\"js\" selected>JavaScript</option>\n <option value=\"ts\" selected>TypeScript</option>\n <option value=\"css\">CSS</option>\n <option value=\"html\">HTML</option>\n <option value=\"react\">React</option>\n</mds-input-select>\n```\n\n#### Grouped Options via `<optgroup>`\n\nThe default slot also accepts `<optgroup>` elements. Use them to group related options under a visible label.\n\n```html\n<mds-input-select name=\"comune\" placeholder=\"Seleziona comune...\">\n <optgroup label=\"Lombardia\">\n <option value=\"MI\">Milano</option>\n <option value=\"BS\">Brescia</option>\n </optgroup>\n <optgroup label=\"Veneto\">\n <option value=\"VE\">Venezia</option>\n <option value=\"VR\">Verona</option>\n </optgroup>\n</mds-input-select>\n```\n\n#### Variant for Validation Feedback\n\nSet `variant` to one of the status values (`error`, `success`, `warning`, `info`) to communicate the validation outcome visually. Use this after a form submission or inline validation, not as decorative styling.\n\n```html\n<!-- Errore di validazione -->\n<mds-input-select name=\"tipologia\" variant=\"error\" required placeholder=\"Seleziona tipologia...\">\n <option value=\"A\">Tipo A</option>\n <option value=\"B\">Tipo B</option>\n</mds-input-select>\n\n<!-- Selezione valida confermata -->\n<mds-input-select name=\"tipologia\" variant=\"success\" value=\"A\">\n <option value=\"A\">Tipo A</option>\n <option value=\"B\">Tipo B</option>\n</mds-input-select>\n```\n\n#### Styling Customization\n\nCustomize the component only through its documented `--mds-input-select-*` CSS custom properties. Set them on the host or a parent selector; use the semantic color roles ([`agents/color.md`](../../../../agents/color.md)) so dark mode and high-contrast modes continue to work correctly. `--mds-input-select-variant-color-rgb` takes a bare RGB triplet (`var(--magma-<role>)`, no `rgb()`); the other properties take a color (`rgb(var(--magma-<role>))`). `--mds-input-select-ring` is the ring at rest: on hover and focus the select draws its own 3px ring in the variant color, so the focus stays visible whatever the ring at rest, in dark mode and with more contrast too; change its color through `--mds-input-select-variant-color-rgb`.\n\n```css\n.sidebar-filter mds-input-select {\n --mds-input-select-variant-color-rgb: var(--magma-accent-emphasis);\n --mds-input-select-arrow-icon-hover-color: rgb(var(--magma-accent-fg));\n --mds-input-select-arrow-icon-hover-background-color: rgb(var(--magma-accent-surface-hover));\n --mds-input-select-ring: 0 0 0 2px rgb(var(--magma-accent-emphasis) / 0.8);\n}\n```\n",
|
|
31
31
|
"3. Antipattern": "Common incorrect uses of `<mds-input-select>`. Each entry pairs the wrong form with the right one and a one-line reason. System-wide rules (boolean-as-string, shadow piercing, Tailwind color utilities, raw native event listening) live in [`agents/anti-patterns.md`](../../../../agents/anti-patterns.md) - they apply here too but are not repeated.\n\n#### Do Not Slot Non-Option Elements\n\nThe default slot is reserved for `<option>` and `<optgroup>` elements. The component clones slot children into the inner `<select>`; any other element is copied verbatim and makes the native select malformed.\n\n```html\n<!-- INCORRECT -->\n<mds-input-select name=\"categoria\">\n <div class=\"option-group\">\n <span>Notizie</span>\n <span>Eventi</span>\n </div>\n</mds-input-select>\n\n<!-- CORRECT -->\n<mds-input-select name=\"categoria\" placeholder=\"Seleziona...\">\n <option value=\"news\">Notizie</option>\n <option value=\"eventi\">Eventi</option>\n</mds-input-select>\n```\n\n#### Do Not Listen to the Native `change` Event\n\n`<mds-input-select>` wraps a shadow-DOM `<select>`; the native `change` event does not bubble out of shadow DOM reliably. Always listen to the documented `mdsInputSelectChange` custom event instead.\n\n```html\n<!-- INCORRECT -->\n<mds-input-select id=\"sel\" name=\"tipo\"></mds-input-select>\n<script>\n document.getElementById('sel').addEventListener('change', (e) => {\n console.log(e.target.value); // may be undefined or stale\n });\n</script>\n\n<!-- CORRECT -->\n<mds-input-select id=\"sel\" name=\"tipo\"></mds-input-select>\n<script>\n document.getElementById('sel').addEventListener('mdsInputSelectChange', (e) => {\n console.log(e.detail.value);\n });\n</script>\n```\n\n#### Do Not Use `variant` for Decorative Styling\n\n`variant` maps to `ThemeStatusVariantType` (`error`, `success`, `warning`, `info`). It is meant to communicate a validation outcome, not to apply a brand color. Using a status variant to make the component visually match a section's color theme misleads users about the control's validation state.\n\n```html\n<!-- INCORRECT - using 'info' just for a blue accent -->\n<mds-input-select name=\"argomento\" variant=\"info\">\n <option value=\"A\">Argomento A</option>\n</mds-input-select>\n\n<!-- CORRECT - set variant only to reflect real validation state -->\n<mds-input-select name=\"argomento\" variant=\"error\" required placeholder=\"Obbligatorio\">\n <option value=\"A\">Argomento A</option>\n</mds-input-select>\n```\n\n#### Do Not Pierce the Shadow DOM to Style the Inner `<select>`\n\nThe supported customization surface is the documented `--mds-input-select-*` CSS custom properties and the two shadow parts (`select`, `tip-top`). Targeting internal elements with `>>>` or undocumented selectors couples your code to the implementation and breaks on minor releases.\n\n```css\n/* INCORRECT */\nmds-input-select >>> select {\n font-size: 1rem;\n border: 2px solid red;\n}\n\n/* CORRECT */\nmds-input-select {\n --mds-input-select-ring: 0 0 0 2px rgb(var(--magma-danger-emphasis));\n --mds-input-select-variant-color-rgb: var(--magma-danger-emphasis);\n}\nmds-input-select::part(select) {\n font-size: 1rem;\n}\n```\n\n#### Do Not Set `placeholder` When You Need a Real Default Selection\n\n`placeholder` injects an empty-value leading option that disappears from valid choices once `required` is set. If you want the component to open with a specific option pre-selected, use `value` or `default-value` instead.\n\n```html\n<!-- INCORRECT - a real value supplied as placeholder text -->\n<mds-input-select name=\"priorita\" placeholder=\"Media\">\n <option value=\"bassa\">Bassa</option>\n <option value=\"media\">Media</option>\n <option value=\"alta\">Alta</option>\n</mds-input-select>\n\n<!-- CORRECT - use value to pre-select a real option -->\n<mds-input-select name=\"priorita\" value=\"media\">\n <option value=\"bassa\">Bassa</option>\n <option value=\"media\">Media</option>\n <option value=\"alta\">Alta</option>\n</mds-input-select>\n```\n\n#### Do Not Replace with a Raw `<select>`\n\n`<mds-input-select>` provides theming, accessible status tips, form-reset integration, and dark/high-contrast support. Reaching for a plain `<select>` bypasses all of that and breaks visual consistency across themes.\n\n```html\n<!-- INCORRECT -->\n<select name=\"categoria\" class=\"form-select\">\n <option value=\"\">Seleziona...</option>\n <option value=\"A\">Categoria A</option>\n</select>\n\n<!-- CORRECT -->\n<mds-input-select name=\"categoria\" placeholder=\"Seleziona...\">\n <option value=\"A\">Categoria A</option>\n</mds-input-select>\n```\n"
|
|
32
32
|
},
|
|
@@ -131,7 +131,8 @@ export class MdsInputSelect {
|
|
|
131
131
|
/**
|
|
132
132
|
* Reports the selection to the form and emits the change, once per selection: a single select
|
|
133
133
|
* submits its value, a multiple one an entry per selected option under `name`, as a native
|
|
134
|
-
* select.
|
|
134
|
+
* select. The first selection, the one of load, is recorded without a change: as on a native
|
|
135
|
+
* select, nothing has been chosen yet.
|
|
135
136
|
*/
|
|
136
137
|
syncSelection() {
|
|
137
138
|
var _a;
|
|
@@ -142,7 +143,10 @@ export class MdsInputSelect {
|
|
|
142
143
|
const selection = JSON.stringify([value, values]);
|
|
143
144
|
if (selection === this.emittedSelection)
|
|
144
145
|
return;
|
|
146
|
+
const loading = this.emittedSelection === undefined;
|
|
145
147
|
this.emittedSelection = selection;
|
|
148
|
+
if (loading)
|
|
149
|
+
return;
|
|
146
150
|
this.changeEvent.emit({ value, values });
|
|
147
151
|
}
|
|
148
152
|
updateFormValue(values) {
|
|
@@ -311,12 +315,12 @@ export class MdsInputSelect {
|
|
|
311
315
|
}
|
|
312
316
|
render() {
|
|
313
317
|
var _a;
|
|
314
|
-
return (h(Host, { key: '
|
|
318
|
+
return (h(Host, { key: '8f7131a5ac5e7e6c398d060d1cf17de1b65d0b95', "pref-animation": preferenceStore.state.animation, "pref-contrast": preferenceStore.state.contrast, "pref-mode": preferenceStore.state.mode, "pref-theme-scheme": preferenceStore.state['theme-scheme'] }, h("select", { key: '40850af3aea61f82c8cf95e5b7e8559524ec37cb', "aria-label": this.accessibleName, class: "input", onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, name: this.name, required: this.required, disabled: this.isDisabled(), multiple: this.multiple, size: this.rows || this.legacyRows() || 0, part: "select", ref: (el) => (this.selectEl = el) }, h("option", { key: '02dd4058f848557e9e44a0b13694df8ea29f5f09', class: "placeholder-option", value: "", disabled: !this.required ? undefined : true, selected: this.defaultValue != null &&
|
|
315
319
|
this.defaultValue !== '' &&
|
|
316
320
|
this.defaultValue !== 0 &&
|
|
317
321
|
!Number.isNaN(this.defaultValue)
|
|
318
322
|
? undefined
|
|
319
|
-
: true }, this.placeholder)), h("div", { key: '
|
|
323
|
+
: true }, this.placeholder)), h("div", { key: '606ce4acbc43476392c3d65d9bdf73d45c5d7da2', class: "icon-container" }, h("mds-icon", { key: '844fe12e9494c7baaf11306090a5475e5041aab9', class: "icon", name: miBaselineKeyboardArrowDown })), h("div", { key: 'ccb1fc6353ea3e62b7baa65f05fee83ad19c2745', class: "option-container" }, h("slot", { key: '466546a17018cf6658fa6035048990afee0a4097', onSlotchange: this.onSlotChangeHandler })), h("mds-input-tip", { key: '72f16cbf02d298614cb36fde62a9cba23b836071', position: "top", active: this.hasFocus, part: "tip-top" }, this.isDisabled() && (h("mds-input-tip-item", { key: '4be88932616cae7f72f043006b36267c8b4e3fdc', expanded: true, variant: "disabled" })), this.required && (h("mds-input-tip-item", { key: '5686e299d11f8622c2a5e7d12b497db5d3c097d2', expanded: this.hasFocus, variant: ((_a = this.value) !== null && _a !== void 0 ? _a : '') === '' ? 'required' : 'required-success' })))));
|
|
320
324
|
}
|
|
321
325
|
static get is() { return "mds-input-select"; }
|
|
322
326
|
static get encapsulation() { return "shadow"; }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-input-switch
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-input-switch>` web component is the binary/selectable input control of the Magma Design System. A single tag covers three native primitives - it renders as a toggle switch by default and re-renders as a native `checkbox` or `radio` depending on `type`, wrapping `<input type="checkbox|radio">` with form association, accessibility, and iconography handled natively.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-input-tip
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-input-tip>` web component is the floating helper container of the Magma Design System input family: it overlays an input field and carries supplementary content (slotted `mds-input-tip-item` chips: status labels, hints, counters) that slides into place when the field becomes active. It is a presentational compound child positioned against its parent input rather than a standalone control.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-input-tip-item
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-input-tip-item>` web component is a single contextual hint row rendered inside the [`<mds-input-tip>`](../mds-input-tip/AGENTS.md) container. It represents one validation/status message of a form field (required, read-only, disabled, character count, or free text) and is orchestrated by the input components (`<mds-input>`, `<mds-input-date>`, `<mds-input-select>`) that own the tip; it has no standalone HTML equivalent.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-input-upload
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-input-upload>` web component is the Magma Design System file-upload control. It wraps a hidden native `<input type="file">` in a drag-and-drop drop zone with progress, per-file previews, validation and optional sorting, exposing the selected files to a surrounding `<form>` through form association.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-keyboard
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.5.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.5.1. Shadow DOM: style it only through the CSS custom properties and parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-keyboard>` web component renders a keyboard shortcut as a row of physical-looking keycaps, acting as the compound parent for one or more slotted `<mds-keyboard-key>` children. It has no direct HTML equivalent; it visualizes a key combination (e.g. `Ctrl + C`) and can optionally let the user verify that combination by typing it.
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ The `<mds-keyboard>` web component renders a keyboard shortcut as a row of physi
|
|
|
14
14
|
|
|
15
15
|
- **Default slot is the key sequence**: The component projects slotted `<mds-keyboard-key>` elements and automatically inserts a `+` separator between consecutive keys.
|
|
16
16
|
- **Compound parent**: It reads each child key's `name` to build the expected combination; during a test the children are toggled to their `pressed` state.
|
|
17
|
-
- **Test mode (`try`)**: When enabled the component appends a trigger button and a tooltip; clicking the button captures keystrokes and, at the first key
|
|
17
|
+
- **Test mode (`try`)**: When enabled the component appends a trigger button and a tooltip; clicking the button (or pressing Enter or Space on it) captures keystrokes and, at the first release of a key pressed during the test, compares the typed combination against the slotted keys, in any order. The release of the key that started the test is not part of it.
|
|
18
18
|
- **Result feedback**: A pass shows a "done" icon, a fail shows a "close" icon, and the tooltip surfaces the localized success or error message; the outcome is also reflected on the host via the `test` attribute.
|
|
19
19
|
- **Localization**: Trigger label, tooltip copy, and error messages resolve through the locale system (el/en/es/it).
|
|
20
20
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-10-
|
|
2
|
+
"timestamp": "2026-10-22T13:02:36",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.45.2",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
],
|
|
20
20
|
"usage": {
|
|
21
|
-
"1. Description": "The `<mds-keyboard>` web component renders a keyboard shortcut as a row of physical-looking keycaps, acting as the compound parent for one or more slotted `<mds-keyboard-key>` children. It has no direct HTML equivalent; it visualizes a key combination (e.g. `Ctrl + C`) and can optionally let the user verify that combination by typing it.\n\n#### Semantic Behavior\n\n- **Default slot is the key sequence**: The component projects slotted `<mds-keyboard-key>` elements and automatically inserts a `+` separator between consecutive keys.\n- **Compound parent**: It reads each child key's `name` to build the expected combination; during a test the children are toggled to their `pressed` state.\n- **Test mode (`try`)**: When enabled the component appends a trigger button and a tooltip; clicking the button captures keystrokes and, at the first key
|
|
21
|
+
"1. Description": "The `<mds-keyboard>` web component renders a keyboard shortcut as a row of physical-looking keycaps, acting as the compound parent for one or more slotted `<mds-keyboard-key>` children. It has no direct HTML equivalent; it visualizes a key combination (e.g. `Ctrl + C`) and can optionally let the user verify that combination by typing it.\n\n#### Semantic Behavior\n\n- **Default slot is the key sequence**: The component projects slotted `<mds-keyboard-key>` elements and automatically inserts a `+` separator between consecutive keys.\n- **Compound parent**: It reads each child key's `name` to build the expected combination; during a test the children are toggled to their `pressed` state.\n- **Test mode (`try`)**: When enabled the component appends a trigger button and a tooltip; clicking the button (or pressing Enter or Space on it) captures keystrokes and, at the first release of a key pressed during the test, compares the typed combination against the slotted keys, in any order. The release of the key that started the test is not part of it.\n- **Result feedback**: A pass shows a \"done\" icon, a fail shows a \"close\" icon, and the tooltip surfaces the localized success or error message; the outcome is also reflected on the host via the `test` attribute.\n- **Localization**: Trigger label, tooltip copy, and error messages resolve through the locale system (el/en/es/it).\n\n#### Properties & Visual Configurations\n\nThis component does not use the shared `variant` / `tone` ladders from [`agents/variants.md`](../../../../agents/variants.md).\n\n#### Other behavioral props\n\n- **`try`** opts the keyboard into interactive verification mode. Enable it only when you want the user to be able to confirm a shortcut by typing it; leave it unset for a purely presentational shortcut display.\n- **`test`** reflects the verification outcome (`'pass'` / `'fail'`) onto the host. It is primarily driven by the test flow and is mainly useful as a styling/state hook rather than a value you set yourself.\n",
|
|
22
22
|
"2. Pattern": "Correct and idiomatic ways to use the `<mds-keyboard>` component, ordered from most common to most specialized. Patterns assume a working knowledge of the shared component rules in [`agents/conventions.md`](../../../../agents/conventions.md).\n\n#### Single Key Display\n\nThe simplest use: one `<mds-keyboard-key>` child inside `<mds-keyboard>`. The `name` attribute selects a key from the built-in key dictionary; the component renders the physical-looking keycap with the key's alias (e.g. `F1`, `Ctrl`).\n\n```html\n<mds-keyboard>\n <mds-keyboard-key name=\"f1\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Multi-Key Shortcut Combination\n\nSlot two or more `<mds-keyboard-key>` elements. The component automatically inserts a `+` separator between consecutive keys, so you never need to add it manually.\n\n```html\n<mds-keyboard>\n <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n <mds-keyboard-key name=\"s\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Specifying Key Side (Left / Right Modifier)\n\nUse the side-specific `name` values (`controlleft`, `controlright`, `shiftleft`, `shiftright`, `commandleft`, `commandright`, etc.) when the shortcut must be typed with a specific hand. The keycap renders a small positional indicator.\n\n```html\n<!-- Only the left Shift key is accepted during a test -->\n<mds-keyboard try>\n <mds-keyboard-key name=\"shiftleft\"></mds-keyboard-key>\n <mds-keyboard-key name=\"d\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Interactive Verification Mode (`try`)\n\nAdd the `try` attribute to let the user confirm the shortcut by typing it. A trigger button appears; clicking it puts the component into capture mode. The keys can be pressed in any order, all held down together: at the first key release the component reflects the outcome (`pass` / `fail`) on the `test` attribute and shows a localized tooltip.\n\n```html\n<mds-keyboard try>\n <mds-keyboard-key name=\"command\"></mds-keyboard-key>\n <mds-keyboard-key name=\"z\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Shortcut Reference Table\n\nEmbed `<mds-keyboard>` inside a `<mds-table>` to build a keyboard-shortcut reference sheet. Each row pairs the visual shortcut with its description.\n\n```html\n<mds-table>\n <mds-table-header>\n <mds-table-header-cell label=\"Combinazione\"></mds-table-header-cell>\n <mds-table-header-cell label=\"Azione\"></mds-table-header-cell>\n </mds-table-header>\n <mds-table-body>\n <mds-table-row>\n <mds-table-cell>\n <mds-keyboard>\n <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n <mds-keyboard-key name=\"c\"></mds-keyboard-key>\n </mds-keyboard>\n </mds-table-cell>\n <mds-table-cell><mds-text>Copia</mds-text></mds-table-cell>\n </mds-table-row>\n <mds-table-row>\n <mds-table-cell>\n <mds-keyboard>\n <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n <mds-keyboard-key name=\"v\"></mds-keyboard-key>\n </mds-keyboard>\n </mds-table-cell>\n <mds-table-cell><mds-text>Incolla</mds-text></mds-table-cell>\n </mds-table-row>\n <mds-table-row>\n <mds-table-cell>\n <mds-keyboard>\n <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n <mds-keyboard-key name=\"z\"></mds-keyboard-key>\n </mds-keyboard>\n </mds-table-cell>\n <mds-table-cell><mds-text>Annulla</mds-text></mds-table-cell>\n </mds-table-row>\n </mds-table-body>\n</mds-table>\n```\n\n#### Reading the `test` Outcome Attribute\n\nWhen `try` is set the `test` attribute is reflected onto the host as `\"pass\"` or `\"fail\"` after each attempt. Use it as a CSS attribute selector, or observe the attribute from JavaScript to drive follow-on UI (the component emits no event).\n\n```html\n<mds-keyboard id=\"shortcut-ctrl-s\" try>\n <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n <mds-keyboard-key name=\"s\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n```javascript\nconst keyboard = document.querySelector('#shortcut-ctrl-s');\nnew MutationObserver(() => {\n if (keyboard.getAttribute('test') === 'pass') {\n console.log('Combinazione corretta!');\n }\n}).observe(keyboard, { attributes: true, attributeFilter: ['test'] });\n```\n\n#### Styling Customization\n\nAdjust colors and lighting only through the documented `--mds-keyboard-*` CSS custom properties. Use the semantic color roles via `rgb(var(--magma-<role>))` ([`agents/color.md`](../../../../agents/color.md)) so dark mode continues to work.\n\n```css\n.custom-keyboard mds-keyboard {\n --mds-keyboard-background: rgb(var(--magma-surface-inverse));\n --mds-keyboard-color: rgb(var(--magma-on-inverse));\n --mds-keyboard-key-background: rgb(var(--magma-surface-inverse-muted));\n --mds-keyboard-padding: calc(var(--spacing) * 300);\n}\n```\n",
|
|
23
23
|
"3. Antipattern": "Common incorrect uses of `<mds-keyboard>`. Each entry pairs the wrong form with the right one and a one-line reason. System-wide rules (boolean-as-string, shadow piercing, Tailwind color utilities, raw native event listening) live in [`agents/anti-patterns.md`](../../../../agents/anti-patterns.md) - they apply here too but are not repeated.\n\n#### Do Not Slot Raw Text or `<kbd>` Elements\n\nThe default slot expects `<mds-keyboard-key>` children only. Slotting plain text, `<kbd>`, or other HTML breaks the separator injection logic and the test-mode key matching.\n\n```html\n<!-- INCORRECT -->\n<mds-keyboard>\n <kbd>Ctrl</kbd>\n <kbd>S</kbd>\n</mds-keyboard>\n\n<!-- CORRECT -->\n<mds-keyboard>\n <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n <mds-keyboard-key name=\"s\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Do Not Add `+` Separators Manually\n\nThe component inserts a styled `+` between consecutive keys automatically. Adding your own separator duplicates it and breaks the visual rhythm.\n\n```html\n<!-- INCORRECT -->\n<mds-keyboard>\n <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n <span>+</span>\n <mds-keyboard-key name=\"c\"></mds-keyboard-key>\n</mds-keyboard>\n\n<!-- CORRECT -->\n<mds-keyboard>\n <mds-keyboard-key name=\"control\"></mds-keyboard-key>\n <mds-keyboard-key name=\"c\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Do Not Set `try=\"false\"` to Disable Test Mode\n\n`try` is a boolean attribute: remove it (or leave it unset) to keep the component in display-only mode. A string value is fragile: `\"false\"` is read as `false` on this component, but the attribute stays on the element until the component renders (attribute selectors and scripts reading it see it set). Never write a boolean as a string.\n\n```html\n<!-- INCORRECT -->\n<mds-keyboard try=\"false\">\n <mds-keyboard-key name=\"escape\"></mds-keyboard-key>\n</mds-keyboard>\n\n<!-- CORRECT -->\n<mds-keyboard>\n <mds-keyboard-key name=\"escape\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Do Not Set `test` as a Static Attribute to Signal State\n\n`test` is a reflected output prop driven by the component's own verification flow. Setting it as a static HTML attribute paints the pass / fail state without any attempt behind it, and the next attempt overwrites it.\n\n```html\n<!-- INCORRECT -->\n<mds-keyboard test=\"pass\">\n <mds-keyboard-key name=\"enter\"></mds-keyboard-key>\n</mds-keyboard>\n\n<!-- CORRECT -->\n<mds-keyboard try>\n <mds-keyboard-key name=\"enter\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Do Not Use `<mds-keyboard-key>` Outside `<mds-keyboard>`\n\n`<mds-keyboard-key>` is a compound child and communicates with the parent via the Stencil DOM tree. Rendering it standalone loses the compound layout, the `+` separator, and test-mode driven `pressed` toggling.\n\n```html\n<!-- INCORRECT -->\n<mds-keyboard-key name=\"tab\"></mds-keyboard-key>\n\n<!-- CORRECT -->\n<mds-keyboard>\n <mds-keyboard-key name=\"tab\"></mds-keyboard-key>\n</mds-keyboard>\n```\n\n#### Do Not Customize Colors with Raw CSS Values Instead of Tokens\n\nSetting `--mds-keyboard-background` or `--mds-keyboard-key-background` to a raw hex or `rgba()` literal bypasses the palette layer and breaks dark mode. Always use a semantic color role, `rgb(var(--magma-<role>))` ([`agents/color.md`](../../../../agents/color.md)).\n\n```css\n/* INCORRECT */\nmds-keyboard {\n --mds-keyboard-background: #1a1a2e;\n --mds-keyboard-key-background: #16213e;\n}\n\n/* CORRECT */\nmds-keyboard {\n --mds-keyboard-background: rgb(var(--magma-surface-inverse));\n --mds-keyboard-key-background: rgb(var(--magma-surface-inverse-muted));\n}\n```\n"
|
|
24
24
|
},
|