@maggioli-design-system/magma 2.13.0 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +7 -0
- package/agents/mcp.md +12 -4
- package/agents/patterns/previews/actions/banner.dark.webp +0 -0
- package/agents/patterns/previews/actions/banner.light.webp +0 -0
- package/agents/patterns/previews/actions/confirm.dark.webp +0 -0
- package/agents/patterns/previews/actions/confirm.light.webp +0 -0
- package/agents/patterns/previews/actions/danger-zone.dark.webp +0 -0
- package/agents/patterns/previews/actions/danger-zone.light.webp +0 -0
- package/agents/patterns/previews/actions/destructive-in-menu.dark.webp +0 -0
- package/agents/patterns/previews/actions/dismiss-message.light.webp +0 -0
- package/agents/patterns/previews/actions/dismiss.dark.webp +0 -0
- package/agents/patterns/previews/actions/dismiss.light.webp +0 -0
- package/agents/patterns/previews/actions/part-primary.light.webp +0 -0
- package/agents/patterns/previews/actions/stacked.light.webp +0 -0
- package/agents/patterns/previews/app-shell/back-office.light.webp +0 -0
- package/agents/patterns/previews/app-shell/many-sections.dark.webp +0 -0
- package/agents/patterns/previews/app-shell/many-sections.light.webp +0 -0
- package/agents/patterns/previews/app-shell/public-service.dark.webp +0 -0
- package/agents/patterns/previews/app-shell/public-service.light.webp +0 -0
- package/agents/patterns/previews/app-shell/section-menus.dark.webp +0 -0
- package/agents/patterns/previews/app-shell/section-menus.light.webp +0 -0
- package/agents/patterns/previews/confirm-action/ask-before-sending.dark.webp +0 -0
- package/agents/patterns/previews/confirm-action/ask-before-sending.light.webp +0 -0
- package/agents/patterns/previews/confirm-action/ask-first-many.dark.webp +0 -0
- package/agents/patterns/previews/confirm-action/ask-first-many.light.webp +0 -0
- package/agents/patterns/previews/confirm-action/ask-first.dark.webp +0 -0
- package/agents/patterns/previews/confirm-action/ask-first.light.webp +0 -0
- package/agents/patterns/previews/confirm-action/make-reversible.dark.webp +0 -0
- package/agents/patterns/previews/confirm-action/make-reversible.light.webp +0 -0
- package/agents/patterns/previews/confirm-action/send-as-shown.dark.webp +0 -0
- package/agents/patterns/previews/confirm-action/send-as-shown.light.webp +0 -0
- package/agents/patterns/previews/empty-state/add-the-first.dark.webp +0 -0
- package/agents/patterns/previews/empty-state/add-the-first.light.webp +0 -0
- package/agents/patterns/previews/empty-state/all-done.dark.webp +0 -0
- package/agents/patterns/previews/empty-state/all-done.light.webp +0 -0
- package/agents/patterns/previews/empty-state/clear-filters.dark.webp +0 -0
- package/agents/patterns/previews/empty-state/clear-filters.light.webp +0 -0
- package/agents/patterns/previews/empty-state/filled-by-others.dark.webp +0 -0
- package/agents/patterns/previews/empty-state/filled-by-others.light.webp +0 -0
- package/agents/patterns/previews/empty-state/not-found.dark.webp +0 -0
- package/agents/patterns/previews/empty-state/not-found.light.webp +0 -0
- package/agents/patterns/previews/error-recovery/changed-meanwhile.dark.webp +0 -0
- package/agents/patterns/previews/error-recovery/changed-meanwhile.light.webp +0 -0
- package/agents/patterns/previews/error-recovery/check-or-repeat.light.webp +0 -0
- package/agents/patterns/previews/error-recovery/content-another-way.light.webp +0 -0
- package/agents/patterns/previews/error-recovery/partial.dark.webp +0 -0
- package/agents/patterns/previews/error-recovery/partial.light.webp +0 -0
- package/agents/patterns/previews/error-recovery/retry-action.light.webp +0 -0
- package/agents/patterns/previews/error-recovery/retry-content.dark.webp +0 -0
- package/agents/patterns/previews/error-recovery/sign-in-again.dark.webp +0 -0
- package/agents/patterns/previews/error-recovery/sign-in-again.light.webp +0 -0
- package/agents/patterns/previews/item-list/documents-of-a-request.dark.webp +0 -0
- package/agents/patterns/previews/item-list/documents-of-a-request.light.webp +0 -0
- package/agents/patterns/previews/item-list/queue-of-a-desk.dark.webp +0 -0
- package/agents/patterns/previews/item-list/queue-of-a-desk.light.webp +0 -0
- package/agents/patterns/previews/item-list/requests-of-an-office.dark.webp +0 -0
- package/agents/patterns/previews/item-list/requests-of-an-office.light.webp +0 -0
- package/agents/patterns/previews/item-list/requests-to-assign.dark.webp +0 -0
- package/agents/patterns/previews/item-list/requests-to-assign.light.webp +0 -0
- package/agents/patterns/previews/labels-and-values/payment-before-paying.dark.webp +0 -0
- package/agents/patterns/previews/labels-and-values/what-is-sent.dark.webp +0 -0
- package/agents/patterns/previews/labels-and-values/what-is-sent.light.webp +0 -0
- package/agents/patterns/previews/list-with-filters/act-on-many.dark.webp +0 -0
- package/agents/patterns/previews/list-with-filters/act-on-many.light.webp +0 -0
- package/agents/patterns/previews/list-with-filters/find-and-open.light.webp +0 -0
- package/agents/patterns/previews/list-with-filters/show-new-items.dark.webp +0 -0
- package/agents/patterns/previews/list-with-filters/show-new-items.light.webp +0 -0
- package/agents/patterns/previews/loading/await-and-say.dark.webp +0 -0
- package/agents/patterns/previews/loading/first-load.dark.webp +0 -0
- package/agents/patterns/previews/loading/first-load.light.webp +0 -0
- package/agents/patterns/previews/loading/keep-while-reloading.dark.webp +0 -0
- package/agents/patterns/previews/loading/keep-while-reloading.light.webp +0 -0
- package/agents/patterns/previews/loading/long-load-measured.dark.webp +0 -0
- package/agents/patterns/previews/loading/long-load-measured.light.webp +0 -0
- package/agents/patterns/previews/loading/long-load.dark.webp +0 -0
- package/agents/patterns/previews/loading/long-load.light.webp +0 -0
- package/agents/patterns/previews/loading/progress-in-place.light.webp +0 -0
- package/agents/patterns/previews/message-placement/action-failed-elsewhere.dark.webp +0 -0
- package/agents/patterns/previews/message-placement/action-partial-elsewhere.light.webp +0 -0
- package/agents/patterns/previews/message-placement/action-partial-in-place.dark.webp +0 -0
- package/agents/patterns/previews/message-placement/action-partial-in-place.light.webp +0 -0
- package/agents/patterns/previews/message-placement/app-failed.light.webp +0 -0
- package/agents/patterns/previews/message-placement/decision.dark.webp +0 -0
- package/agents/patterns/previews/message-placement/decision.light.webp +0 -0
- package/agents/patterns/previews/message-placement/field-hint.light.webp +0 -0
- package/agents/patterns/previews/message-placement/region-failed.dark.webp +0 -0
- package/agents/patterns/previews/message-placement/region-info.dark.webp +0 -0
- package/agents/patterns/previews/message-placement/region-info.light.webp +0 -0
- package/agents/patterns/previews/page-header/contact-being-edited.dark.webp +0 -0
- package/agents/patterns/previews/page-header/contact-being-edited.light.webp +0 -0
- package/agents/patterns/previews/page-header/members-of-a-group.light.webp +0 -0
- package/agents/patterns/previews/page-header/request-from-the-list.dark.webp +0 -0
- package/agents/patterns/previews/record-detail/ask-for-words.light.webp +0 -0
- package/agents/patterns/previews/record-detail/edit-data.light.webp +0 -0
- package/agents/patterns/previews/record-detail/read-the-data.dark.webp +0 -0
- package/agents/patterns/previews/record-detail/read-the-data.light.webp +0 -0
- package/agents/patterns/previews/record-detail/record-changed.dark.webp +0 -0
- package/agents/patterns/previews/record-detail/record-changed.light.webp +0 -0
- package/agents/patterns/previews/record-detail/run-at-once.dark.webp +0 -0
- package/agents/patterns/previews/record-detail/run-at-once.light.webp +0 -0
- package/agents/patterns/previews/record-detail/work-on-it.dark.webp +0 -0
- package/agents/patterns/previews/record-detail/work-on-it.light.webp +0 -0
- package/agents/patterns/previews/rhythm/between-containers.dark.webp +0 -0
- package/agents/patterns/previews/rhythm/between-containers.light.webp +0 -0
- package/agents/patterns/previews/rhythm/between-fields.dark.webp +0 -0
- package/agents/patterns/previews/rhythm/between-fields.light.webp +0 -0
- package/agents/patterns/previews/rhythm/between-groups.light.webp +0 -0
- package/agents/patterns/previews/rhythm/between-sections.dark.webp +0 -0
- package/agents/patterns/previews/rhythm/between-sections.light.webp +0 -0
- package/agents/patterns/previews/rhythm/inline.light.webp +0 -0
- package/agents/patterns/previews/rhythm/inset.dark.webp +0 -0
- package/agents/patterns/previews/rhythm/inset.light.webp +0 -0
- package/agents/patterns/previews/rhythm/title-content.dark.webp +0 -0
- package/agents/patterns/previews/rhythm/title-content.light.webp +0 -0
- package/agents/patterns/previews/surfaces/band.dark.webp +0 -0
- package/agents/patterns/previews/surfaces/band.light.webp +0 -0
- package/agents/patterns/previews/surfaces/canvas.dark.webp +0 -0
- package/agents/patterns/previews/surfaces/canvas.light.webp +0 -0
- package/agents/patterns/previews/surfaces/card.dark.webp +0 -0
- package/agents/patterns/previews/surfaces/card.light.webp +0 -0
- package/agents/patterns/previews/surfaces/dialog.dark.webp +0 -0
- package/agents/patterns/previews/surfaces/dialog.light.webp +0 -0
- package/agents/patterns/previews/surfaces/edit-actions.dark.webp +0 -0
- package/agents/patterns/previews/surfaces/edit-actions.light.webp +0 -0
- package/agents/patterns/previews/surfaces/intro-band.dark.webp +0 -0
- package/agents/patterns/previews/surfaces/intro-band.light.webp +0 -0
- package/agents/patterns/previews/surfaces/section.dark.webp +0 -0
- package/agents/patterns/previews/surfaces/section.light.webp +0 -0
- package/agents/patterns/previews/titles/dialog.dark.webp +0 -0
- package/agents/patterns/previews/titles/dialog.light.webp +0 -0
- package/agents/patterns/previews/titles/group.light.webp +0 -0
- package/agents/patterns/previews/titles/page.light.webp +0 -0
- package/agents/patterns/previews/titles/part.light.webp +0 -0
- package/agents/patterns/previews/titles/section.light.webp +0 -0
- package/agents/patterns/previews/widths/dialog.light.webp +0 -0
- package/agents/patterns/previews/widths/field.dark.webp +0 -0
- package/agents/patterns/previews/widths/field.light.webp +0 -0
- package/agents/patterns/previews/widths/form.dark.webp +0 -0
- package/agents/patterns/previews/widths/form.light.webp +0 -0
- package/agents/patterns/previews/widths/page.dark.webp +0 -0
- package/agents/patterns/previews/widths/page.light.webp +0 -0
- package/agents/patterns/previews/widths/reading.dark.webp +0 -0
- package/agents/patterns/previews/widths/reading.light.webp +0 -0
- package/agents/patterns.md +4 -3
- package/dist/cjs/mds-input-range.cjs.entry.js +27 -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-book/AGENTS.md +1 -1
- package/dist/collection/components/mds-book/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-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 +1 -1
- package/dist/collection/components/mds-input/documentation.json +1 -1
- 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 +3 -1
- package/dist/collection/components/mds-input-range/documentation.json +2 -2
- package/dist/collection/components/mds-input-range/mds-input-range.css +109 -1
- package/dist/collection/components/mds-input-range/mds-input-range.js +35 -5
- package/dist/collection/components/mds-input-range-value/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-range-value/documentation.json +1 -1
- package/dist/collection/components/mds-input-select/AGENTS.md +1 -1
- package/dist/collection/components/mds-input-select/documentation.json +1 -1
- 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 +1 -1
- package/dist/collection/components/mds-keyboard/documentation.json +1 -1
- 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-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-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-input-range.js +1 -1
- package/dist/documentation.json +2 -2
- package/dist/esm/mds-input-range.entry.js +27 -6
- package/dist/esm-es5/mds-input-range.entry.js +31 -24
- package/dist/hydrate/index.js +36 -6
- package/dist/hydrate/index.mjs +36 -6
- package/dist/lint/mcp/tools.json +21 -3
- package/dist/magma-components/magma-components.esm.js +1 -1
- package/dist/magma-components/p-1e43613e.entry.js +1 -0
- package/dist/magma-components/p-B7Jp0tqu.system.js +1 -1
- package/dist/magma-components/p-b20f811b.system.entry.js +120 -0
- package/dist/mcp/checks.js +49 -20
- package/dist/mcp/cli.js +8 -2
- package/dist/mcp/context.js +21 -0
- package/dist/mcp/guides.js +2 -1
- package/dist/mcp/patterns.js +19 -9
- package/dist/mcp/render.js +4 -4
- package/dist/mcp/root.js +63 -0
- package/dist/mcp/tools.json +21 -3
- package/dist/stats.json +21 -19
- package/dist/types/components/mds-input-range/mds-input-range.d.ts +9 -0
- package/package.json +1 -1
- package/dist/magma-components/p-ccb64689.system.entry.js +0 -113
- package/dist/magma-components/p-d32ca6ce.entry.js +0 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-url-view
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.14.0. Shadow DOM: style it only through the public CSS custom properties and the parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-url-view>` web component renders an embedded preview of an external web page inside a framed browser-like window, wrapping a native `<iframe>` with a titled header, an identifying icon, and a dismiss control. It is the Magma way to surface remote content (typically inside a `mds-modal`) without hand-building chrome around the raw iframe.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-usage
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.14.0. Shadow DOM: style it only through the public CSS custom properties and the parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-usage>` web component is a documentation-oriented annotation block of the Magma Design System used to frame example content as a recommendation, a warning, or an informational note. It wraps slotted content in a labelled, status-colored container and has no native HTML primitive equivalent - it is a presentational guidance device, typically used inside design-system docs and Storybook.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-video-wall
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.14.0. Shadow DOM: style it only through the public CSS custom properties and the parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-video-wall>` web component is the Magma Design System's full-bleed background video surface, used to render an autoplaying, looping ambient video behind foreground content. It wraps the native `<video>` element, adding an optional grain/noise overlay and a dedicated content layer for captions or call-to-action overlays.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# mds-zero
|
|
8
8
|
|
|
9
|
-
> `@maggioli-design-system/magma` 2.
|
|
9
|
+
> `@maggioli-design-system/magma` 2.14.0. Shadow DOM: style it only through the public CSS custom properties and the parts below.
|
|
10
10
|
|
|
11
11
|
The `<mds-zero>` web component is the empty-state (zero-data) panel of the Magma Design System: a centered, vertically stacked layout that pairs an illustration, explanatory copy, and a call-to-action to guide users when a list, search, or section has no content to show. It is a pure structural container with no props - composition happens entirely through its slots.
|
|
12
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as e,d as a,h as i,c as r,t as s,B as n}from"./p-g2_CekDc.js";import{s as o}from"./p-wI0alRSO.js";import{L as h}from"./p-BmlDGlcB.js";import{p as d}from"./p-AWCYh8Xe.js";import{d as u}from"./p-aZlZ1XB9.js";var l={position:"{{position}} από {{count}}"},m={position:"{{position}} of {{count}}"},c={position:"{{position}} de {{count}}"},p={position:"{{position}} di {{count}}"};const g="mds-input-range-value",b=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.changeEvent=a(this,"mdsInputRangeChange",7),this.valuesChangeEvent=a(this,"mdsInputRangeValuesChange",7),this.internals=this.attachInternals(),this.label="",this.thumbs=[],this.childLoadValues=new WeakMap,this.thumbKeys=new WeakMap,this.nextThumbKey=0,this.loaded=!1,this.singlePending=!1,this.t=new h({el:l,en:m,es:c,it:p}),this.formDisabled=!1,this.max=100,this.min=0,this.step=1,this.onInput=()=>{null!=this.inputElement&&(this.value=Number(this.inputElement.value))},this.syncChildren=()=>{if(!this.loaded)return;this.label=this.readLabel();const t=this.readThumbs();this.writeChildValues(t),this.sameThumbs(t)||(0===t.length&&this.thumbs.length>0&&(this.singlePending=!0),t.forEach((({element:t,value:e})=>{this.childLoadValues.has(t)||this.childLoadValues.set(t,e)})),this.updateThumbs(t))},this.onThumbInput=t=>{const e=t.target,a=this.thumbInputs().indexOf(e);a<0||this.moveThumb(a,Number(e.value))},this.onThumbKeyDown=t=>{const e=this.thumbInputs().indexOf(t.target);if(e<0||this.isDisabled())return;const{value:a}=this.thumbs[e],[i,r]=this.bounds(e),s=this.allowedStep(),n=Math.max((this.max-this.min)/10,s),o={ArrowDown:a-s,ArrowLeft:a-s,ArrowRight:a+s,ArrowUp:a+s,End:r,Home:i,PageDown:a-n,PageUp:a+n}[t.key];void 0!==o&&(t.preventDefault(),this.moveThumb(e,o))},this.onTrackPointerDown=t=>{var e;if(this.thumbs.length<2||this.isDisabled()||0!==t.button)return;if("INPUT"===t.target.tagName)return;const a=t.currentTarget,i=a.querySelector(".track-total");if(!i)return;const r=a.getBoundingClientRect(),s=i.getBoundingClientRect().height,n=this.normalize(this.min+Math.min(Math.max((t.clientX-r.left-s/2)/(r.width-s),0),1)*(this.max-this.min));let o=0;this.thumbs.forEach(((t,e)=>{const a=Math.abs(t.value-n),i=Math.abs(this.thumbs[o].value-n);(a<i||a===i&&n>t.value)&&(o=e)})),t.preventDefault(),null===(e=this.thumbInputs()[o])||void 0===e||e.focus(),this.moveThumb(o,n)},this.isDisabled=()=>!!this.disabled||this.formDisabled}allowedStep(){const t=Number(this.step);return t>0?t:1}normalize(t){const e=this.allowedStep(),a=Math.pow(10,Math.max(this.countDecimals(e),this.countDecimals(this.min))),i=Math.round(this.min*a),r=Math.round(this.max*a),s=Math.round(e*a);let n=Math.round((Math.min(Math.max(t*a,i),r)-i)/s)*s+i;return n>r&&(n-=s),n/a}middle(){return this.normalize(this.min+(this.max-this.min)/2)}percent(t){return this.max===this.min?0:(t-this.min)/(this.max-this.min)*100}calculateProgress(){null!=this.inputElement&&(this.value=this.normalize(Number(this.inputElement.value)),o(this.internals,""+this.value),this.progress=(this.value-this.min)/(this.max-this.min)*100)}countDecimals(t){return Math.floor(t)===t?0:(""+t).split(".")[1].length||0}readLabel(){return Array.from(this.element.childNodes).filter((t=>t.nodeName.toLowerCase()!==g)).map((t=>{var e;return null!==(e=t.textContent)&&void 0!==e?e:""})).join("").trim()}readThumbs(){const t=new Map(this.thumbs.map((({element:t},e)=>[t,e])));return Array.from(this.element.children).filter((t=>t.tagName.toLowerCase()===g)).map(((e,a)=>{var i,r,s,n;const o=null!==(i=e.value)&&void 0!==i?i:e.getAttribute("value"),h=null==o||""===(o+"").trim()?NaN:Number(o);let d=this.thumbKeys.get(e);return void 0===d&&(d=this.nextThumbKey++,this.thumbKeys.set(e,d)),{element:e,key:d,name:null!==(s=null===(r=e.textContent)||void 0===r?void 0:r.trim())&&void 0!==s?s:"",rank:null!==(n=t.get(e))&&void 0!==n?n:t.size+a,value:this.normalize(Number.isNaN(h)?this.middle():h)}})).sort(((t,e)=>t.value-e.value||t.rank-e.rank)).map((({element:t,key:e,name:a,value:i})=>({element:t,key:e,name:a,value:i})))}sameThumbs(t){return t.length===this.thumbs.length&&t.every((({element:t,name:e,value:a},i)=>{const r=this.thumbs[i];return t===r.element&&e===r.name&&a===r.value}))}writeChildValue(t,e){var a;(null===(a=globalThis.customElements)||void 0===a?void 0:a.get(g))?t.value=e:t.setAttribute("value",e+"")}writeChildValues(t){t.forEach((({element:t,value:e})=>{Number(t.value)!==e&&this.writeChildValue(t,e)}))}updateThumbs(t){this.thumbs=t,this.writeChildValues(t),this.updateFormValue(),this.emitValues()}emitValues(){const t=this.thumbs.map((({value:t})=>t)),e=JSON.stringify(t);if(e===this.emittedValues)return;const a=void 0===this.emittedValues;this.emittedValues=e,a||this.valuesChangeEvent.emit({values:t})}updateFormValue(){var t;if(0===this.thumbs.length)return void o(this.internals,null==this.value?null:""+this.value);const e=null!==(t=this.name)&&void 0!==t?t:"";if(""===e)return void o(this.internals,null);const a=new FormData;this.thumbs.forEach((({value:t})=>a.append(e,""+t))),o(this.internals,a)}bounds(t){return[t>0?this.thumbs[t-1].value:this.min,t<this.thumbs.length-1?this.thumbs[t+1].value:this.max]}thumbInputs(){var t,e;return Array.from(null!==(e=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelectorAll(".field"))&&void 0!==e?e:[])}moveThumb(t,e){const[a,i]=this.bounds(t),r=Math.min(Math.max(this.normalize(e),a),i),s=this.thumbInputs()[t];s&&Number(s.value)!==r&&(s.value=r+""),r!==this.thumbs[t].value&&this.updateThumbs(this.thumbs.map(((e,a)=>a===t?Object.assign(Object.assign({},e),{value:r}):e)))}thumbName(t){const{name:e}=this.thumbs[t];if(""!==e)return e;const a=this.t.get("position",{position:t+1,count:this.thumbs.length});return""===this.label?a:`${this.label}, ${a}`}displayValues(){const t=this.thumbs.map((({value:t})=>this.formatValue?this.formatValue(t):t+""));return t.join(2===t.length?" – ":" · ")}disabledChanged(t){t?o(this.internals,null):this.updateFormValue()}nameChanged(){this.updateFormValue()}valueChanged(t,e){t!==e&&(this.thumbs.length>0||null==this.inputElement||(this.inputElement.value=""+this.value,this.calculateProgress(),this.changeEvent.emit(this.value)))}limitsChanged(){this.thumbs.length>0?this.updateThumbs(this.readThumbs()):this.calculateProgress()}minChanged(){this.limitsChanged()}maxChanged(){this.limitsChanged()}stepChanged(){this.limitsChanged()}formDisabledCallback(t){this.formDisabled=t}formResetCallback(){if(this.thumbs.length>0)return this.thumbs.forEach((({element:t})=>{const e=this.childLoadValues.get(t);void 0!==e&&this.writeChildValue(t,e)})),void this.updateThumbs(this.readThumbs());null!=this.inputElement&&(this.inputElement.value=void 0===this.loadValue?"":this.loadValue+"",this.onInput())}connectedCallback(){var t;null===(t=this.childObserver)||void 0===t||t.disconnect(),n.isBrowser&&(this.childObserver=new MutationObserver(this.syncChildren),this.childObserver.observe(this.element,{attributeFilter:["value"],characterData:!0,childList:!0,subtree:!0}),this.syncChildren())}disconnectedCallback(){var t;null===(t=this.childObserver)||void 0===t||t.disconnect(),this.childObserver=void 0}componentWillLoad(){var t;const e=Number(null!==(t=this.value)&&void 0!==t?t:NaN);this.loadValue=Number.isNaN(e)?void 0:e,this.label=this.readLabel(),this.thumbs=this.readThumbs(),this.thumbs.forEach((({element:t,value:e})=>{this.childLoadValues.set(t,e)}))}componentDidLoad(){this.thumbs.length>0?this.updateThumbs(this.thumbs):(this.onInput(),this.calculateProgress()),this.emitValues(),this.loaded=!0,this.syncChildren()}componentDidRender(){this.singlePending&&null!=this.inputElement&&(this.singlePending=!1,this.onInput(),this.calculateProgress())}renderThumbs(){return this.thumbs.map(((t,e)=>{const[a,r]=this.bounds(e);return i("input",{key:t.key,class:{field:!0,"field--held":a===r},type:"range","aria-label":this.thumbName(e),"aria-valuetext":this.formatValue?this.formatValue(t.value):void 0,disabled:this.isDisabled(),max:this.max,min:this.min,onInput:this.onThumbInput,onKeyDown:this.onThumbKeyDown,step:this.allowedStep(),value:t.value})}))}render(){var t;const e=this.thumbs.length>0,a=this.thumbs.length>1,s=this.thumbs[0],n={"--mds-input-range-progress":""+(e?this.percent(this.thumbs[this.thumbs.length-1].value):null!==(t=this.progress)&&void 0!==t?t:0)};return a&&(n["--private-input-range-progress-start"]=""+this.percent(s.value)),i(r,{key:"462c99434783fc2516ddf6040484e2bc87cb3dba","pref-animation":d.state.animation,"pref-contrast":d.state.contrast,"pref-mode":d.state.mode,"pref-theme-scheme":d.state["theme-scheme"]},i("header",{key:"8b2c95e6cb75396e5d72a8547f7a35d833d2c977",class:"header",part:"header"},i("mds-text",{key:"6d5625b711e63b9b874c0f9f620650bc91eed8cb",class:"label",truncate:"word",typography:"label"},i("slot",{key:"6c635c0e3888d5fc0298c6fb185c4d1350a47e20"})),i("mds-text",{key:"c762c4e553cc3fcd347fd5efb26c6d43403104ff",class:"value",typography:"label"},e?this.displayValues():this.formatValue?this.formatValue(this.value):this.value)),i("div",{key:"70aced606c83cde6aab4e07314cffaab36052640",class:{range:!0,"range--several":a},role:e?"group":void 0,"aria-label":e&&""!==this.label?this.label:void 0,onPointerDown:this.onTrackPointerDown},i("div",{key:"8f33045f27c6e1e07aa941363349ba2a238dea92",class:"track",part:"track"},i("div",{key:"47277e1000e73b878894e792c423eda7bb4af267",class:"contrast-area"}),i("div",{key:"279d606dbfaca100339ad98329ba002aed415a6c",class:"track-total"},i("div",{key:"05bde12e5fff5a03ab8df028ff739f878a0c59b1",class:{"track-progress":!0,"track-progress--between":a},style:n}))),e?this.renderThumbs():i("input",{ref:t=>this.inputElement=t,class:"field","aria-label":this.label,"aria-valuetext":this.formatValue?this.formatValue(this.value):void 0,disabled:this.isDisabled(),max:this.max,min:this.min,onInput:this.onInput,step:this.step,type:"range",value:this.value,name:this.name})))}static get formAssociated(){return!0}get element(){return this}static get watchers(){return{disabled:[{disabledChanged:0}],name:[{nameChanged:0}],value:[{valueChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],step:[{stepChanged:0}]}}static get style(){return"@layer reset,vendor,theme,base,components,utilities;:host(:not(:is([hydrated],.hydrated))),mds-text:not(:is([hydrated],.hydrated)){animation-duration:0s;border-color:#0000;box-shadow:0 0 #0000;opacity:0;outline-color:#0000;transition-delay:.1s;transition-duration:0s;visibility:hidden}:host{--mds-input-range-transition-duration:var(--duration-300,.3s);--private-input-range-transition-duration:var(--mds-input-range-transition-duration);--mds-input-range-thumb-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-thumb-background:rgb(var(--magma-surface-overlay,var(--surface-neutral-overlay,255 255 255)));--mds-input-range-thumb-cursor:col-resize;--mds-input-range-thumb-size:calc(var(--spacing,.0025rem)*400);--mds-input-range-track-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-background:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-progress-background-disabled:rgb(var(--magma-border-strong,var(--border-neutral-strong,140 140 140)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis-hover,var(--variant-primary-03,7 76 204)));--mds-input-range-track-size:calc(var(--spacing,.0025rem)*600);--private-border-width:calc(var(--mds-input-range-track-size)/2 - var(--mds-input-range-thumb-size)/2);--private-thumb-size:calc(var(--mds-input-range-thumb-size) + var(--private-border-width)*2);display:grid;gap:calc(var(--spacing,.0025rem)*200);grid-template-columns:minmax(0,1fr);transition-duration:var(--private-input-range-transition-duration);transition-property:color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1))}.header{display:flex;gap:calc(var(--spacing,.0025rem)*200)}.label{min-width:0}::slotted(mds-input-range-value){display:none}.value{margin-left:auto}.range{align-items:center;display:flex;height:var(--private-thumb-size);position:relative}.track{box-sizing:border-box;position:absolute;width:100%}.field{appearance:none;background-color:#0000;border-radius:var(--magma-radius-full,var(--radius-full,1000px));flex-grow:1;height:calc(var(--spacing,.0025rem)*400);margin:0;min-width:0;outline:none;z-index:20}.field:focus-visible::-webkit-slider-thumb{--magma-outline-blur:var(--magma-outline-focus);animation-play-state:running}.field::-webkit-slider-thumb{animation-duration:var(--magma-outline-animation-duration,1s);animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:focus-bounce;animation-play-state:paused;animation-timing-function:var(--ease-out,cubic-bezier(0,0,.2,1));appearance:none;background-color:var(--mds-input-range-thumb-background);border-color:var(--mds-input-range-track-progress-background);border-radius:var(--mds-input-range-thumb-size);border-style:solid;border-width:var(--private-border-width);cursor:var(--mds-input-range-thumb-cursor);height:var(--private-thumb-size);line-height:0;outline:var(--magma-outline-blur,2px solid var(--magma-outline-blur-color,#0000));transform:translateY(-50%);transition-duration:.2s;transition-property:background-color,border-color,box-shadow,color,fill,outline,outline-offset,transform;transition-property:background-color,border;transition-timing-function:ease-in-out;width:var(--private-thumb-size)}.field::-webkit-slider-runnable-track{appearance:none;border:0;height:0;width:100%}.track-progress{background-color:var(--mds-input-range-track-progress-background);display:flex;height:var(--mds-input-range-track-size);transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0)*0.01) + var(--mds-input-range-track-size)/2)}.track-progress--between{margin-left:calc((100% - var(--mds-input-range-track-size))*(var(--private-input-range-progress-start,0)*0.01) + var(--mds-input-range-track-size)/2);width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0) - var(--private-input-range-progress-start,0))*.01)}.range--several .field{inset-inline:0;pointer-events:none;position:absolute}.range--several .field::-webkit-slider-thumb{pointer-events:auto}.range--several .field--held{z-index:10}.range--several .field:focus{z-index:30}.track-total{background-color:var(--mds-input-range-track-background);display:flex;height:var(--mds-input-range-track-size);overflow:hidden;transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1));width:100%}.contrast-area,.track-total{border-radius:var(--mds-input-range-track-size)}.contrast-area{margin-left:calc(var(--spacing,.0025rem)*100);margin-right:calc(var(--spacing,.0025rem)*100)}:host([pref-animation=reduce]),:host([pref-animation=reduce]) *,:host([pref-animation=reduce]) :after,:host([pref-animation=reduce]) :before{transition-duration:.01ms!important}:host([pref-animation=reduce]){--private-input-range-transition-duration:0s}:host([pref-mode=dark]:not([pref-theme-scheme=light])),:host([pref-theme-scheme=dark]){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}:host([pref-contrast=more]){color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}:host(:disabled:not([disabled=false])),:host([disabled]:not([disabled=false])){--mds-input-range-thumb-background:var(--mds-input-range-thumb-background-disabled);--mds-input-range-track-background:var(--mds-input-range-track-background-disabled);--mds-input-range-track-progress-background:var(--mds-input-range-track-progress-background-disabled)}:host([disabled]:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}:host(:disabled:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}@media (prefers-reduced-motion:reduce){:host(:not([pref-animation])),:host(:not([pref-animation])) *,:host(:not([pref-animation])) :after,:host(:not([pref-animation])) :before,:host([pref-animation=system]),:host([pref-animation=system]) *,:host([pref-animation=system]) :after,:host([pref-animation=system]) :before{transition-duration:.01ms!important}:host(:not([pref-animation])),:host([pref-animation=system]){--private-input-range-transition-duration:0s}}@media (prefers-color-scheme:dark){:host(:not([pref-mode]):not([pref-theme-scheme=light])),:host([pref-mode=system]:not([pref-theme-scheme=light])){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}}@media (prefers-contrast:more){:host(:not([pref-contrast])),:host([pref-contrast=system]){color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}}"}},[321,"mds-input-range",{formatValue:[16],name:[513],max:[2],min:[2],step:[2],disabled:[1540],value:[1538],progress:[32],label:[32],thumbs:[32],formDisabled:[32]},void 0,{disabled:[{disabledChanged:0}],name:[{nameChanged:0}],value:[{valueChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],step:[{stepChanged:0}]}]),v=b,f=function(){"undefined"!=typeof customElements&&["mds-input-range","mds-text"].forEach((t=>{switch(t){case"mds-input-range":customElements.get(s(t))||customElements.define(s(t),b);break;case"mds-text":customElements.get(s(t))||u()}}))};export{v as MdsInputRange,f as defineCustomElement}
|
|
1
|
+
import{p as t,H as a,d as e,h as i,c as r,t as s,B as n}from"./p-g2_CekDc.js";import{s as o}from"./p-wI0alRSO.js";import{L as h}from"./p-BmlDGlcB.js";import{p as d}from"./p-AWCYh8Xe.js";import{d as l}from"./p-aZlZ1XB9.js";var u={position:"{{position}} από {{count}}"},c={position:"{{position}} of {{count}}"},m={position:"{{position}} de {{count}}"},p={position:"{{position}} di {{count}}"};const g="mds-input-range-value",v=t(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.changeEvent=e(this,"mdsInputRangeChange",7),this.valuesChangeEvent=e(this,"mdsInputRangeValuesChange",7),this.internals=this.attachInternals(),this.label="",this.thumbs=[],this.childLoadValues=new WeakMap,this.thumbKeys=new WeakMap,this.nextThumbKey=0,this.loaded=!1,this.singlePending=!1,this.t=new h({el:u,en:c,es:m,it:p}),this.formDisabled=!1,this.max=100,this.min=0,this.step=1,this.onInput=()=>{null!=this.inputElement&&(this.value=Number(this.inputElement.value))},this.syncChildren=()=>{if(!this.loaded)return;this.label=this.readLabel();const t=this.readThumbs();this.writeChildValues(t),this.sameThumbs(t)||(0===t.length&&this.thumbs.length>0&&(this.singlePending=!0),t.forEach((({element:t,value:a})=>{this.childLoadValues.has(t)||this.childLoadValues.set(t,a)})),this.updateThumbs(t))},this.onThumbInput=t=>{const a=t.target,e=this.thumbInputs().indexOf(a);e<0||this.moveThumb(e,Number(a.value))},this.onThumbKeyDown=t=>{const a=this.thumbInputs().indexOf(t.target);if(a<0||this.isDisabled())return;const{value:e}=this.thumbs[a],[i,r]=this.bounds(a),s=this.allowedStep(),n=Math.max((this.max-this.min)/10,s),o={ArrowDown:e-s,ArrowLeft:e-s,ArrowRight:e+s,ArrowUp:e+s,End:r,Home:i,PageDown:e-n,PageUp:e+n}[t.key];void 0!==o&&(t.preventDefault(),this.moveThumb(a,o))},this.onTrackPointerDown=t=>{var a;if(this.thumbs.length<2||this.isDisabled()||0!==t.button)return;if("INPUT"===t.target.tagName)return;const e=t.currentTarget,i=e.querySelector(".track-total");if(!i)return;const r=e.getBoundingClientRect(),s=i.getBoundingClientRect().height,n=this.normalize(this.min+Math.min(Math.max((t.clientX-r.left-s/2)/(r.width-s),0),1)*(this.max-this.min));let o=0;this.thumbs.forEach(((t,a)=>{const e=Math.abs(t.value-n),i=Math.abs(this.thumbs[o].value-n);(e<i||e===i&&n>t.value)&&(o=a)})),t.preventDefault(),null===(a=this.thumbInputs()[o])||void 0===a||a.focus(),this.moveThumb(o,n)},this.isDisabled=()=>!!this.disabled||this.formDisabled}allowedStep(){const t=Number(this.step);return t>0?t:1}normalize(t){const a=this.allowedStep(),e=Math.pow(10,Math.max(this.countDecimals(a),this.countDecimals(this.min))),i=Math.round(this.min*e),r=Math.round(this.max*e),s=Math.round(a*e);let n=Math.round((Math.min(Math.max(t*e,i),r)-i)/s)*s+i;return n>r&&(n-=s),n/e}middle(){return this.normalize(this.min+(this.max-this.min)/2)}percent(t){return this.max===this.min?0:(t-this.min)/(this.max-this.min)*100}calculateProgress(){null!=this.inputElement&&(this.value=this.normalize(Number(this.inputElement.value)),o(this.internals,""+this.value),this.progress=(this.value-this.min)/(this.max-this.min)*100)}countDecimals(t){return Math.floor(t)===t?0:(""+t).split(".")[1].length||0}readLabel(){return Array.from(this.element.childNodes).filter((t=>t.nodeName.toLowerCase()!==g)).map((t=>{var a;return null!==(a=t.textContent)&&void 0!==a?a:""})).join("").trim()}readThumbs(){const t=new Map(this.thumbs.map((({element:t},a)=>[t,a])));return Array.from(this.element.children).filter((t=>t.tagName.toLowerCase()===g)).map(((a,e)=>{var i,r,s,n;const o=null!==(i=a.value)&&void 0!==i?i:a.getAttribute("value"),h=null==o||""===(o+"").trim()?NaN:Number(o);let d=this.thumbKeys.get(a);return void 0===d&&(d=this.nextThumbKey++,this.thumbKeys.set(a,d)),{element:a,key:d,name:null!==(s=null===(r=a.textContent)||void 0===r?void 0:r.trim())&&void 0!==s?s:"",rank:null!==(n=t.get(a))&&void 0!==n?n:t.size+e,value:this.normalize(Number.isNaN(h)?this.middle():h)}})).sort(((t,a)=>t.value-a.value||t.rank-a.rank)).map((({element:t,key:a,name:e,value:i})=>({element:t,key:a,name:e,value:i})))}sameThumbs(t){return t.length===this.thumbs.length&&t.every((({element:t,name:a,value:e},i)=>{const r=this.thumbs[i];return t===r.element&&a===r.name&&e===r.value}))}writeChildValue(t,a){var e;(null===(e=globalThis.customElements)||void 0===e?void 0:e.get(g))?t.value=a:t.setAttribute("value",a+"")}writeChildValues(t){t.forEach((({element:t,value:a})=>{Number(t.value)!==a&&this.writeChildValue(t,a)}))}updateThumbs(t){this.thumbs=t,this.writeChildValues(t),this.updateFormValue(),this.emitValues()}emitValues(){const t=this.thumbs.map((({value:t})=>t)),a=JSON.stringify(t);if(a===this.emittedValues)return;const e=void 0===this.emittedValues;this.emittedValues=a,e||this.valuesChangeEvent.emit({values:t})}updateFormValue(){var t;if(0===this.thumbs.length)return void o(this.internals,null==this.value?null:""+this.value);const a=null!==(t=this.name)&&void 0!==t?t:"";if(""===a)return void o(this.internals,null);const e=new FormData;this.thumbs.forEach((({value:t})=>e.append(a,""+t))),o(this.internals,e)}bounds(t){return[t>0?this.thumbs[t-1].value:this.min,t<this.thumbs.length-1?this.thumbs[t+1].value:this.max]}thumbInputs(){var t,a;return Array.from(null!==(a=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelectorAll(".field"))&&void 0!==a?a:[])}moveThumb(t,a){const[e,i]=this.bounds(t),r=Math.min(Math.max(this.normalize(a),e),i),s=this.thumbInputs()[t];s&&Number(s.value)!==r&&(s.value=r+""),r!==this.thumbs[t].value&&this.updateThumbs(this.thumbs.map(((a,e)=>e===t?Object.assign(Object.assign({},a),{value:r}):a)))}thumbName(t){const{name:a}=this.thumbs[t];if(""!==a)return a;const e=this.t.get("position",{position:t+1,count:this.thumbs.length});return""===this.label?e:`${this.label}, ${e}`}displayValues(){const t=this.thumbs.map((({value:t})=>this.formatted(t)));return t.join(2===t.length?" – ":" · ")}formatted(t){return this.formatValue?this.formatValue(t):t+""}disabledChanged(t){t?o(this.internals,null):this.updateFormValue()}nameChanged(){this.updateFormValue()}valueChanged(t,a){t!==a&&(this.thumbs.length>0||null==this.inputElement||(this.inputElement.value=""+this.value,this.calculateProgress(),this.changeEvent.emit(this.value)))}limitsChanged(){this.thumbs.length>0?this.updateThumbs(this.readThumbs()):this.calculateProgress()}minChanged(){this.limitsChanged()}maxChanged(){this.limitsChanged()}stepChanged(){this.limitsChanged()}formDisabledCallback(t){this.formDisabled=t}formResetCallback(){if(this.thumbs.length>0)return this.thumbs.forEach((({element:t})=>{const a=this.childLoadValues.get(t);void 0!==a&&this.writeChildValue(t,a)})),void this.updateThumbs(this.readThumbs());null!=this.inputElement&&(this.inputElement.value=void 0===this.loadValue?"":this.loadValue+"",this.onInput())}connectedCallback(){var t;null===(t=this.childObserver)||void 0===t||t.disconnect(),n.isBrowser&&(this.childObserver=new MutationObserver(this.syncChildren),this.childObserver.observe(this.element,{attributeFilter:["value"],characterData:!0,childList:!0,subtree:!0}),this.syncChildren())}disconnectedCallback(){var t;null===(t=this.childObserver)||void 0===t||t.disconnect(),this.childObserver=void 0}componentWillLoad(){var t;const a=Number(null!==(t=this.value)&&void 0!==t?t:NaN);this.loadValue=Number.isNaN(a)?void 0:a,this.label=this.readLabel(),this.thumbs=this.readThumbs(),this.thumbs.forEach((({element:t,value:a})=>{this.childLoadValues.set(t,a)}))}componentDidLoad(){this.thumbs.length>0?this.updateThumbs(this.thumbs):(this.onInput(),this.calculateProgress()),this.emitValues(),this.loaded=!0,this.syncChildren()}componentDidRender(){this.singlePending&&null!=this.inputElement&&(this.singlePending=!1,this.onInput(),this.calculateProgress())}renderTip(t,a,e){return i("div",{key:e,class:"tip","aria-hidden":"true",style:{"--private-input-range-tip-position":""+t}},i("span",{class:"tip-bubble"},i("mds-text",{class:"tip-value",typography:"label"},a)),i("span",{class:"tip-arrow"}))}renderThumbs(){return this.thumbs.map(((t,a)=>{const[e,r]=this.bounds(a);return[i("input",{key:t.key,class:{field:!0,"field--held":e===r},type:"range","aria-label":this.thumbName(a),"aria-valuetext":this.formatValue?this.formatValue(t.value):void 0,disabled:this.isDisabled(),max:this.max,min:this.min,onInput:this.onThumbInput,onKeyDown:this.onThumbKeyDown,step:this.allowedStep(),value:t.value}),this.renderTip(this.percent(t.value),this.formatted(t.value),"tip-"+t.key)]}))}render(){var t,a;const e=this.thumbs.length>0,s=this.thumbs.length>1,n=this.thumbs[0],o={"--mds-input-range-progress":""+(e?this.percent(this.thumbs[this.thumbs.length-1].value):null!==(t=this.progress)&&void 0!==t?t:0)};return s&&(o["--private-input-range-progress-start"]=""+this.percent(n.value)),i(r,{key:"26a7ec9fdca1190c60a031c122d4726caba0dc09","pref-animation":d.state.animation,"pref-contrast":d.state.contrast,"pref-mode":d.state.mode,"pref-theme-scheme":d.state["theme-scheme"]},i("header",{key:"eac882dc3793792bd88e100e295b70ffcbfc41ea",class:"header",part:"header"},i("mds-text",{key:"4cd4bc7b76cc7014520dd805930900e358ec2876",class:"label",truncate:"word",typography:"label"},i("slot",{key:"28afcfce8b82d8288c8b61e4e461c566c0778c73"})),i("mds-text",{key:"c12a80857ec6ff4961e8a294c3e43c4bbce2cecb",class:"value",typography:"label"},e?this.displayValues():this.formatValue?this.formatValue(this.value):this.value)),i("div",{key:"a1745566763926db65a8daa6dd0f786ebb41bca5",class:{range:!0,"range--several":s},role:e?"group":void 0,"aria-label":e&&""!==this.label?this.label:void 0,onPointerDown:this.onTrackPointerDown},i("div",{key:"22a55f00ab4fb181744595ddeef84b48d308e9ce",class:"track",part:"track"},i("div",{key:"27a45042881334d1ec9082c93b209eb306904642",class:"contrast-area"}),i("div",{key:"3a58b1a75392d4c7c907fc1029d7b60d396b1a71",class:"track-total"},i("div",{key:"ea616e7ab8b5084978cb3d8763f5f3c5b49101cf",class:{"track-progress":!0,"track-progress--between":s},style:o}))),e?this.renderThumbs():[i("input",{ref:t=>this.inputElement=t,class:"field","aria-label":this.label,"aria-valuetext":this.formatValue?this.formatValue(this.value):void 0,disabled:this.isDisabled(),max:this.max,min:this.min,onInput:this.onInput,step:this.step,type:"range",value:this.value,name:this.name}),this.renderTip(null!==(a=this.progress)&&void 0!==a?a:0,null==this.value?"":this.formatted(this.value))]))}static get formAssociated(){return!0}get element(){return this}static get watchers(){return{disabled:[{disabledChanged:0}],name:[{nameChanged:0}],value:[{valueChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],step:[{stepChanged:0}]}}static get style(){return"@layer reset,vendor,theme,base,components,utilities;:host(:not(:is([hydrated],.hydrated))),mds-text:not(:is([hydrated],.hydrated)){animation-duration:0s;border-color:#0000;box-shadow:0 0 #0000;opacity:0;outline-color:#0000;transition-delay:.1s;transition-duration:0s;visibility:hidden}:host{--mds-input-range-transition-duration:var(--duration-300,.3s);--private-input-range-transition-duration:var(--mds-input-range-transition-duration);--mds-input-range-thumb-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-thumb-background:rgb(var(--magma-surface-overlay,var(--surface-neutral-overlay,255 255 255)));--mds-input-range-thumb-cursor:col-resize;--mds-input-range-thumb-size:calc(var(--spacing,.0025rem)*400);--mds-input-range-track-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-background:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-progress-background-disabled:rgb(var(--magma-border-strong,var(--border-neutral-strong,140 140 140)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis-hover,var(--variant-primary-03,7 76 204)));--mds-input-range-track-size:calc(var(--spacing,.0025rem)*600);--private-border-width:calc(var(--mds-input-range-track-size)/2 - var(--mds-input-range-thumb-size)/2);--private-thumb-size:calc(var(--mds-input-range-thumb-size) + var(--private-border-width)*2);--private-input-range-tip-shadow:drop-shadow(0 calc(var(--spacing,.0025rem)*250) calc(var(--spacing,.0025rem)*200) rgb(var(--magma-shadow-ink,var(--tone-neutral-01,5 5 5))/.04)) drop-shadow(0 calc(var(--spacing,.0025rem)*100) calc(var(--spacing,.0025rem)*75) rgb(var(--magma-shadow-ink,var(--tone-neutral-01,5 5 5))/.1)) drop-shadow(0 0 1px rgb(var(--magma-shadow-ink,var(--tone-neutral-01,5 5 5))/.1));display:grid;gap:calc(var(--spacing,.0025rem)*200);grid-template-columns:minmax(0,1fr);transition-duration:var(--private-input-range-transition-duration);transition-property:color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1))}.header{display:flex;gap:calc(var(--spacing,.0025rem)*200)}.label{min-width:0}::slotted(mds-input-range-value){display:none}.value{margin-left:auto}.range{align-items:center;display:flex;height:var(--private-thumb-size);position:relative}.track{box-sizing:border-box;position:absolute;width:100%}.field{appearance:none;background-color:#0000;border-radius:var(--magma-radius-full,var(--radius-full,1000px));flex-grow:1;height:calc(var(--spacing,.0025rem)*400);margin:0;min-width:0;outline:none;z-index:20}.field:focus-visible::-webkit-slider-thumb{--magma-outline-blur:var(--magma-outline-focus);animation-play-state:running}.field::-webkit-slider-thumb{animation-duration:var(--magma-outline-animation-duration,1s);animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:focus-bounce;animation-play-state:paused;animation-timing-function:var(--ease-out,cubic-bezier(0,0,.2,1));appearance:none;background-color:var(--mds-input-range-thumb-background);border-color:var(--mds-input-range-track-progress-background);border-radius:var(--mds-input-range-thumb-size);border-style:solid;border-width:var(--private-border-width);cursor:var(--mds-input-range-thumb-cursor);height:var(--private-thumb-size);line-height:0;outline:var(--magma-outline-blur,2px solid var(--magma-outline-blur-color,#0000));transform:translateY(-50%);transition-duration:.2s;transition-property:background-color,border-color,box-shadow,color,fill,outline,outline-offset,transform;transition-property:background-color,border;transition-timing-function:ease-in-out;width:var(--private-thumb-size)}.field::-webkit-slider-runnable-track{appearance:none;border:0;height:0;width:100%}.track-progress{background-color:var(--mds-input-range-track-progress-background);display:flex;height:var(--mds-input-range-track-size);transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0)*0.01) + var(--mds-input-range-track-size)/2)}.track-progress--between{margin-left:calc((100% - var(--mds-input-range-track-size))*(var(--private-input-range-progress-start,0)*0.01) + var(--mds-input-range-track-size)/2);width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0) - var(--private-input-range-progress-start,0))*.01)}.range--several .field{inset-inline:0;pointer-events:none;position:absolute}.range--several .field::-webkit-slider-thumb{pointer-events:auto}.range--several .field--held{z-index:10}.range--several .field:focus{z-index:30}.tip{--private-input-range-tip-centre:calc((100cqi - var(--mds-input-range-track-size))*(var(--private-input-range-tip-position,0)*0.01) + var(--mds-input-range-track-size)/2);bottom:100%;container-type:inline-size;filter:var(--private-input-range-tip-shadow);height:0;inset-inline:0;opacity:0;pointer-events:none;position:absolute;transition-duration:var(--private-input-range-transition-duration);transition-property:opacity;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1));z-index:40}.field:active:not(:disabled)+.tip,.field:focus-visible+.tip,.field:hover:not(:disabled)+.tip{opacity:1}.tip-bubble{border-radius:var(--magma-radius-3xs,var(--radius-squircle-3xs,6px));bottom:calc(var(--spacing,.0025rem)*100);box-sizing:border-box;color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)));corner-shape:var(--magma-corner-shape,squircle);display:flex;padding-block:calc(var(--spacing,.0025rem)*100);padding-inline:calc(var(--spacing,.0025rem)*200);translate:clamp(calc(var(--private-input-range-tip-centre)*-1),-50%,calc(100cqi - 100% - var(--private-input-range-tip-centre))) 0;white-space:nowrap;width:max-content}.tip-arrow,.tip-bubble{background-color:rgb(var(--magma-surface-overlay,var(--surface-neutral-overlay,255 255 255)));left:var(--private-input-range-tip-centre);position:absolute}.tip-arrow{bottom:0;clip-path:polygon(0 0,100% 0,50% 100%);height:calc(var(--spacing,.0025rem)*100);translate:-50%;width:calc(var(--spacing,.0025rem)*250)}.track-total{background-color:var(--mds-input-range-track-background);display:flex;height:var(--mds-input-range-track-size);overflow:hidden;transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1));width:100%}.contrast-area,.track-total{border-radius:var(--mds-input-range-track-size)}.contrast-area{margin-left:calc(var(--spacing,.0025rem)*100);margin-right:calc(var(--spacing,.0025rem)*100)}:host([pref-animation=reduce]),:host([pref-animation=reduce]) *,:host([pref-animation=reduce]) :after,:host([pref-animation=reduce]) :before{transition-duration:.01ms!important}:host([pref-animation=reduce]){--private-input-range-transition-duration:0s}:host([pref-mode=dark]:not([pref-theme-scheme=light])),:host([pref-theme-scheme=dark]){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}:host([pref-contrast=more]){--private-input-range-tip-shadow:drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.05)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3));color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}:host(:disabled:not([disabled=false])),:host([disabled]:not([disabled=false])){--mds-input-range-thumb-background:var(--mds-input-range-thumb-background-disabled);--mds-input-range-track-background:var(--mds-input-range-track-background-disabled);--mds-input-range-track-progress-background:var(--mds-input-range-track-progress-background-disabled)}:host([disabled]:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}:host(:disabled:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}@media (prefers-reduced-motion:reduce){:host(:not([pref-animation])),:host(:not([pref-animation])) *,:host(:not([pref-animation])) :after,:host(:not([pref-animation])) :before,:host([pref-animation=system]),:host([pref-animation=system]) *,:host([pref-animation=system]) :after,:host([pref-animation=system]) :before{transition-duration:.01ms!important}:host(:not([pref-animation])),:host([pref-animation=system]){--private-input-range-transition-duration:0s}}@media (prefers-color-scheme:dark){:host(:not([pref-mode]):not([pref-theme-scheme=light])),:host([pref-mode=system]:not([pref-theme-scheme=light])){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}}@media (prefers-contrast:more){:host(:not([pref-contrast])),:host([pref-contrast=system]){--private-input-range-tip-shadow:drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.05)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3));color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}}"}},[321,"mds-input-range",{formatValue:[16],name:[513],max:[2],min:[2],step:[2],disabled:[1540],value:[1538],progress:[32],label:[32],thumbs:[32],formDisabled:[32]},void 0,{disabled:[{disabledChanged:0}],name:[{nameChanged:0}],value:[{valueChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],step:[{stepChanged:0}]}]),b=v,f=function(){"undefined"!=typeof customElements&&["mds-input-range","mds-text"].forEach((t=>{switch(t){case"mds-input-range":customElements.get(s(t))||customElements.define(s(t),v);break;case"mds-text":customElements.get(s(t))||l()}}))};export{b as MdsInputRange,f as defineCustomElement}
|
package/dist/documentation.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-11-
|
|
2
|
+
"timestamp": "2026-11-12T16:08:51",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.45.3",
|
|
@@ -17486,7 +17486,7 @@
|
|
|
17486
17486
|
}
|
|
17487
17487
|
],
|
|
17488
17488
|
"usage": {
|
|
17489
|
-
"1. Description": "The `<mds-input-range>` web component is the Magma Design System slider control for picking a numeric value from a continuous interval, or several values on one track. It wraps a native `<input type=\"range\">` per thumb, adding a labelled header, a styled track with a live progress fill, form association, and value formatting.\n\n#### Semantic Behavior\n\n- **Form association**: Inside a `<form>` the selected number is reported under `name` with no extra wiring. A form reset brings back the value of load, thumb and progress included, or the middle of the range when the markup sets no `value`, like a native input.\n- **Value clamping and snapping**: On input the value is clamped into `[min, max]` and snapped to the nearest `step` increment, so the committed `value` is always valid even when set programmatically out of range.\n- **Decimal awareness**: The number of decimal places is derived from `step`, letting fractional steps snap correctly; as on a native input, a `step` that is not a positive number, from the start or set later, falls back to the default step, `1`.\n- **Disabled state**: Blocks interaction and clears the reported form value while disabled; enabled again, the range reports its value again. A disabled `<fieldset>` around the component does the same, as it does a native input.\n- **Emitted event**: `mdsInputRangeChange` carries the new numeric value whenever `value` actually changes.\n- **Accessibility**: The control takes its accessible name from the slotted label text; with `formatValue` it also announces the formatted value (`aria-valuetext`). The ring of the focus goes round the thumb.\n- **Default slot is the label**: The default slot holds the field's text label, rendered in the header alongside the formatted current value.\n- **Width**: The slider takes the width its container gives it, a narrow grid cell too: the track gets shorter and a label longer than the room left by the value ends in an ellipsis.\n\n#### Several Values on One Track\n\nAn [`<mds-input-range-value>`](../mds-input-range-value/AGENTS.md) child per value turns the range into a slider with a thumb per value, as an `<option>` per choice turns a `<select>` into a list: a minimum and a maximum, or the stops of a scale.\n\n- **From the first child on**: with one child or more, the values are the children's, one child included; `value` and `mdsInputRangeChange` are left out, and keep the one value of a range without children.\n- **One native input per thumb**: each thumb is a native range input, all of them stacked on the track. The native input gives the slider role, the value, the name, the focus and the drag; a component of `role=\"slider\"` elements would rewrite them, and leave the one value on another control.\n- **Neighbours bound each other**: a thumb never passes the thumbs next to it, but can reach them. The arrows move the thumb with the focus by one `step`, Page Up and Page Down by a tenth of the range, Home and End take it to its neighbours (or to `min` and `max`): the component handles these keys itself, because a native input knows only `min` and `max`.\n- **Order and limits of the markup**: the thumbs follow the values from the lowest, whatever the order of the children; each keeps the name of its own child. A value outside `min` and `max`, or off the step, is brought inside and onto the step, as a native input sanitizes it, and written back on its child; a child without a value starts in the middle.\n- **Names**: the text of the range names the group of thumbs, the text of each child names its thumb, as in the multi-thumb slider of the WAI-ARIA APG. A child without text gets the label and the position of its thumb (\"Prezzo, 1 di 2\", in the language of the page).\n- **Header**: the values in order, formatted as the one value: two are an interval joined by an en dash (\"20 - 80\" with a long dash), more a list joined by a middle dot.\n- **Fill**: from the first thumb to the last.\n- **Overlap**: a thumb is as wide as the track is tall, so two near values lie on each other: the thumb with the focus lies on top and the keys move it alone. Without the focus, a thumb held by its neighbours lies under them, so that the one on top can move.\n- **Pointer**: a thumb drags itself; a press on the track moves the nearest thumb there.\n- **Adding and removing**: adding a value is adding a child, removing one is removing it; the range watches its children, their values and their text.\n- **Form**: an entry per value under `name`, in order, as a native `<select multiple>`; a form reset gives each child back the value it had when the range first read it.\n- **Event**: `mdsInputRangeValuesChange` carries `{ values }`, in order, whenever the list changes: from a thumb, from code, as a child comes or goes, on a reset. The values of load are not a change.\n\n#### Properties & Visual Configurations\n\n- **`min` / `max` / `step`** define the permitted interval and granularity; `step` also controls how fractional values are snapped and how many decimals are preserved.\n- **`value`** is the committed numeric selection of a range without `<mds-input-range-value>` children, kept clamped and snapped - set it programmatically to move the thumb. With children, each child holds the value of its thumb.\n- **`formatValue`** is a function `(value: number) => string` for presentation only: use it to render the header value as currency, a percentage, or a unit-suffixed label without changing the underlying numeric `value`.\n\nThis component does not use the shared `variant` / `tone` ladders ([`agents/variants.md`](../../../../agents/variants.md)); it has no public CSS custom property: the thumb and the track follow the theme, and the `header` and `track` parts listed in [`AGENTS.md`](AGENTS.md) are its styling hooks.\n",
|
|
17489
|
+
"1. Description": "The `<mds-input-range>` web component is the Magma Design System slider control for picking a numeric value from a continuous interval, or several values on one track. It wraps a native `<input type=\"range\">` per thumb, adding a labelled header, a styled track with a live progress fill, form association, and value formatting.\n\n#### Semantic Behavior\n\n- **Form association**: Inside a `<form>` the selected number is reported under `name` with no extra wiring. A form reset brings back the value of load, thumb and progress included, or the middle of the range when the markup sets no `value`, like a native input.\n- **Value clamping and snapping**: On input the value is clamped into `[min, max]` and snapped to the nearest `step` increment, so the committed `value` is always valid even when set programmatically out of range.\n- **Decimal awareness**: The number of decimal places is derived from `step`, letting fractional steps snap correctly; as on a native input, a `step` that is not a positive number, from the start or set later, falls back to the default step, `1`.\n- **Disabled state**: Blocks interaction and clears the reported form value while disabled; enabled again, the range reports its value again. A disabled `<fieldset>` around the component does the same, as it does a native input.\n- **Emitted event**: `mdsInputRangeChange` carries the new numeric value whenever `value` actually changes.\n- **Accessibility**: The control takes its accessible name from the slotted label text; with `formatValue` it also announces the formatted value (`aria-valuetext`). The ring of the focus goes round the thumb.\n- **Default slot is the label**: The default slot holds the field's text label, rendered in the header alongside the formatted current value.\n- **Tip over the thumb**: while the pointer is on the slider, while the thumb is dragged and while it has the focus of the keyboard, the thumb shows its value, formatted as in the header, in a tip over it; the header keeps the value, for when nothing moves, and a header hidden through its `header` part leaves the tip. The tip follows its thumb, its arrow on the thumb and its bubble inside the track at the ends; it lies on the line of the header, its value on the line of the header value, and covers whole the part of the header it meets. It is drawn only, since the thumb already announces its value.\n- **Width**: The slider takes the width its container gives it, a narrow grid cell too: the track gets shorter and a label longer than the room left by the value ends in an ellipsis.\n\n#### Several Values on One Track\n\nAn [`<mds-input-range-value>`](../mds-input-range-value/AGENTS.md) child per value turns the range into a slider with a thumb per value, as an `<option>` per choice turns a `<select>` into a list: a minimum and a maximum, or the stops of a scale.\n\n- **From the first child on**: with one child or more, the values are the children's, one child included; `value` and `mdsInputRangeChange` are left out, and keep the one value of a range without children.\n- **One native input per thumb**: each thumb is a native range input, all of them stacked on the track. The native input gives the slider role, the value, the name, the focus and the drag; a component of `role=\"slider\"` elements would rewrite them, and leave the one value on another control.\n- **Neighbours bound each other**: a thumb never passes the thumbs next to it, but can reach them. The arrows move the thumb with the focus by one `step`, Page Up and Page Down by a tenth of the range, Home and End take it to its neighbours (or to `min` and `max`): the component handles these keys itself, because a native input knows only `min` and `max`.\n- **Order and limits of the markup**: the thumbs follow the values from the lowest, whatever the order of the children; each keeps the name of its own child. A value outside `min` and `max`, or off the step, is brought inside and onto the step, as a native input sanitizes it, and written back on its child; a child without a value starts in the middle.\n- **Names**: the text of the range names the group of thumbs, the text of each child names its thumb, as in the multi-thumb slider of the WAI-ARIA APG. A child without text gets the label and the position of its thumb (\"Prezzo, 1 di 2\", in the language of the page).\n- **Header**: the values in order, formatted as the one value: two are an interval joined by an en dash (\"20 - 80\" with a long dash), more a list joined by a middle dot.\n- **Tip over each thumb**: each thumb has its own tip, with its own value. The one value shows its tip with the pointer anywhere on the track, its input taking the whole track; with two thumbs or more, the pointer finds a thumb only on the thumb, and its tip shows then.\n- **Fill**: from the first thumb to the last.\n- **Overlap**: a thumb is as wide as the track is tall, so two near values lie on each other: the thumb with the focus lies on top and the keys move it alone. Without the focus, a thumb held by its neighbours lies under them, so that the one on top can move.\n- **Pointer**: a thumb drags itself; a press on the track moves the nearest thumb there.\n- **Adding and removing**: adding a value is adding a child, removing one is removing it; the range watches its children, their values and their text.\n- **Form**: an entry per value under `name`, in order, as a native `<select multiple>`; a form reset gives each child back the value it had when the range first read it.\n- **Event**: `mdsInputRangeValuesChange` carries `{ values }`, in order, whenever the list changes: from a thumb, from code, as a child comes or goes, on a reset. The values of load are not a change.\n\n#### Properties & Visual Configurations\n\n- **`min` / `max` / `step`** define the permitted interval and granularity; `step` also controls how fractional values are snapped and how many decimals are preserved.\n- **`value`** is the committed numeric selection of a range without `<mds-input-range-value>` children, kept clamped and snapped - set it programmatically to move the thumb. With children, each child holds the value of its thumb.\n- **`formatValue`** is a function `(value: number) => string` for presentation only: use it to render the header value as currency, a percentage, or a unit-suffixed label without changing the underlying numeric `value`.\n\nThis component does not use the shared `variant` / `tone` ladders ([`agents/variants.md`](../../../../agents/variants.md)); it has no public CSS custom property: the thumb and the track follow the theme, and the `header` and `track` parts listed in [`AGENTS.md`](AGENTS.md) are its styling hooks.\n",
|
|
17490
17490
|
"2. Examples": "Correct and idiomatic ways to use the `<mds-input-range>` component, ordered from most common to most specialized. The examples assume a working knowledge of the shared component rules in [`agents/conventions.md`](../../../../agents/conventions.md).\n\n#### Basic Slider with a Label\n\nThe minimum viable form. Put the field's text label in the default slot - it is rendered in the header and used as the accessible name for the underlying input. The default range is 0-100 with a step of 1.\n\n```html\n<mds-input-range name=\"volume\">Volume</mds-input-range>\n```\n\n#### Setting `min`, `max`, and `step`\n\nConstrain the range to a meaningful interval. Use `step` to enforce granularity - the component snaps the selected value to the nearest multiple automatically.\n\n```html\n<!-- Percentage slider, 5-point increments -->\n<mds-input-range name=\"completamento\" min=\"0\" max=\"100\" step=\"5\">Completamento (%)</mds-input-range>\n\n<!-- Temperature slider, half-degree steps -->\n<mds-input-range name=\"temperatura\" min=\"16\" max=\"30\" step=\"0.5\">Temperatura (C)</mds-input-range>\n```\n\n#### Pre-selected Value via `value`\n\nPass `value` to initialize the thumb at a specific position. The prop is reflected, so it also stays in sync when the user drags.\n\n```html\n<mds-input-range name=\"priorita\" min=\"1\" max=\"10\" value=\"7\">Priorita</mds-input-range>\n```\n\n#### Listening to `mdsInputRangeChange`\n\nThe component emits `mdsInputRangeChange` with the new numeric value in `event.detail` whenever the committed value changes. Do not listen to the raw `input` or `change` events - they may not bubble out of shadow DOM as expected.\n\n```html\n<mds-input-range id=\"rating\" name=\"valutazione\" min=\"1\" max=\"5\">Valutazione</mds-input-range>\n\n<script>\n document.querySelector('#rating').addEventListener('mdsInputRangeChange', (event) => {\n console.log('Nuovo valore:', event.detail);\n });\n</script>\n```\n\n#### Custom Value Display with `formatValue`\n\nSupply a `(value: number) => string` function to `formatValue` to change how the current value is shown in the header label - for example to add a unit suffix, format as currency, or humanize byte counts. The underlying numeric `value` is not affected.\n\n```html\n<mds-input-range id=\"prezzo\" name=\"prezzo\" min=\"0\" max=\"10000\" step=\"50\">Prezzo massimo</mds-input-range>\n\n<script>\n document.querySelector('#prezzo').formatValue = (v) =>\n v.toLocaleString('it-IT', { style: 'currency', currency: 'EUR' });\n</script>\n```\n\n#### Disabled Slider\n\nSet the boolean `disabled` attribute to prevent interaction. The component applies disabled visual tokens and clears the reported form value automatically. Do not use `disabled=\"false\"` to re-enable - remove the attribute instead.\n\n```html\n<mds-input-range name=\"soglia\" min=\"0\" max=\"100\" value=\"40\" disabled>Soglia (disabilitato)</mds-input-range>\n```\n\n#### Form Participation\n\n`<mds-input-range>` is form-associated. Place it inside a `<form>` with a `name` attribute and the selected value is submitted automatically alongside other fields.\n\n```html\n<form action=\"/impostazioni\" method=\"post\">\n <mds-input-range name=\"luminosita\" min=\"0\" max=\"100\" value=\"75\">Luminosita</mds-input-range>\n <mds-input-range name=\"contrasto\" min=\"0\" max=\"100\" value=\"50\">Contrasto</mds-input-range>\n\n <mds-button type=\"submit\" label=\"Salva impostazioni\" variant=\"primary\" tone=\"strong\"></mds-button>\n</form>\n```\n\n#### Several Values: an Interval\n\nPut an [`<mds-input-range-value>`](../mds-input-range-value/AGENTS.md) per value inside the range: a thumb each. The text of the range is the label of the group, the text of each value names its thumb. The header shows the two values as an interval, formatted by `formatValue` as the one value.\n\n```html\n<mds-input-range id=\"prezzo-intervallo\" min=\"0\" max=\"500\" step=\"10\" name=\"prezzo\">\n Prezzo\n <mds-input-range-value value=\"100\">Minimo</mds-input-range-value>\n <mds-input-range-value value=\"400\">Massimo</mds-input-range-value>\n</mds-input-range>\n\n<script>\n document.querySelector('#prezzo-intervallo').formatValue = (v) =>\n v.toLocaleString('it-IT', { style: 'currency', currency: 'EUR' });\n</script>\n```\n\nThe form receives one entry per value under `name`, in order: `prezzo=100&prezzo=400`, read on the server as a list, as the entries of a `<select multiple>`.\n\n#### Several Values: Listening to `mdsInputRangeValuesChange`\n\nWith values, the range emits `mdsInputRangeValuesChange`, whose `detail.values` lists them in order from the lowest. It fires whenever the list changes: a thumb moved, a value set from code, a value added or removed, a form reset.\n\n```html\n<mds-input-range id=\"scala\" min=\"1\" max=\"21\" step=\"0.5\" name=\"contrasto\">\n Scala di contrasto\n <mds-input-range-value value=\"3\"></mds-input-range-value>\n <mds-input-range-value value=\"4.5\"></mds-input-range-value>\n <mds-input-range-value value=\"7\"></mds-input-range-value>\n <mds-input-range-value value=\"12\"></mds-input-range-value>\n</mds-input-range>\n\n<script>\n document.querySelector('#scala').addEventListener('mdsInputRangeValuesChange', (event) => {\n console.log('Passi:', event.detail.values); // [3, 4.5, 7, 12]\n });\n</script>\n```\n\nThe values without text are named after the label and their position (\"Scala di contrasto, 2 di 4\"). Adding a stop is appending an `<mds-input-range-value>`, removing one is removing it.\n\n#### Hiding the Header via `::part(header)`\n\nUse `::part(header)` to hide the label-and-value header when the surrounding UI already provides that context - for example in a compact settings row where the label lives outside the component.\n\n```css\n.slider-compatto mds-input-range::part(header) {\n display: none;\n}\n```\n\n#### Styling Customization\n\n`<mds-input-range>` has no public CSS custom property: the thumb and the track take their sizes from the component and their colours from the semantic color roles ([`agents/color.md`](../../../../agents/color.md)), the progress from the accent, so themes and dark mode recolour it without overrides. Adjust the slider only through its documented `header` and `track` parts, as in the example above.\n",
|
|
17491
17491
|
"3. Mistakes": "Common incorrect uses of `<mds-input-range>`. 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/mistakes.md`](../../../../agents/mistakes.md) - they apply here too but are not repeated.\n\n#### Do Not Use a Raw `<input type=\"range\">` Instead of the Component\n\nReaching for the native element bypasses the Magma-styled track, the progress fill, the labelled header, form association wiring, and the snapping logic.\n\n```html\n<!-- INCORRECT -->\n<label for=\"v\">Volume</label>\n<input type=\"range\" id=\"v\" name=\"volume\" min=\"0\" max=\"100\">\n\n<!-- CORRECT -->\n<mds-input-range name=\"volume\" min=\"0\" max=\"100\">Volume</mds-input-range>\n```\n\n#### Do Not Omit the Label Slot\n\nWithout slotted text the slider has no accessible name - screen readers cannot announce the control's purpose. Always put a meaningful text label in the default slot.\n\n```html\n<!-- INCORRECT -->\n<mds-input-range name=\"luminosita\" min=\"0\" max=\"100\"></mds-input-range>\n\n<!-- CORRECT -->\n<mds-input-range name=\"luminosita\" min=\"0\" max=\"100\">Luminosita</mds-input-range>\n```\n\n#### Do Not Use `disabled=\"false\"` to Enable the Slider\n\n`disabled` is a boolean attribute and `mds-input-range` is form-associated: as on a native control, any value turns it on, `\"false\"` included, so this markup disables the slider. Remove the attribute entirely to enable it.\n\n```html\n<!-- INCORRECT -->\n<mds-input-range name=\"soglia\" disabled=\"false\">Soglia</mds-input-range>\n\n<!-- CORRECT -->\n<mds-input-range name=\"soglia\">Soglia</mds-input-range>\n```\n\n#### Do Not Listen to Raw `input` / `change` Events\n\nNative events may not bubble out of shadow DOM the way you expect. Listen to `mdsInputRangeChange`, which the component emits on every committed value change.\n\n```html\n<!-- INCORRECT -->\n<mds-input-range id=\"r\" name=\"valore\">Valore</mds-input-range>\n<script>\n document.querySelector('#r').addEventListener('change', (e) => {\n console.log(e.target.value); // unreliable across shadow DOM\n });\n</script>\n\n<!-- CORRECT -->\n<mds-input-range id=\"r\" name=\"valore\">Valore</mds-input-range>\n<script>\n document.querySelector('#r').addEventListener('mdsInputRangeChange', (e) => {\n console.log(e.detail); // numeric value, always reliable\n });\n</script>\n```\n\n#### Do Not Set `step` to Zero or a Negative Number\n\nA `step` of zero or negative is invalid: as on a native input it is ignored and the default step, `1`, applies instead, which is rarely the granularity you meant. Use a positive integer or decimal.\n\n```html\n<!-- INCORRECT -->\n<mds-input-range name=\"q\" step=\"0\">Quantita</mds-input-range>\n<mds-input-range name=\"q\" step=\"-1\">Quantita</mds-input-range>\n\n<!-- CORRECT -->\n<mds-input-range name=\"q\" step=\"1\">Quantita</mds-input-range>\n```\n\n#### Do Not Put Several Ranges Side by Side for One Interval\n\nTwo ranges for a minimum and a maximum let the minimum pass the maximum, and give the form two names. Put both values on one range.\n\n```html\n<!-- INCORRECT -->\n<mds-input-range name=\"prezzo-min\" value=\"100\">Prezzo minimo</mds-input-range>\n<mds-input-range name=\"prezzo-max\" value=\"400\">Prezzo massimo</mds-input-range>\n\n<!-- CORRECT -->\n<mds-input-range name=\"prezzo\">\n Prezzo\n <mds-input-range-value value=\"100\">Minimo</mds-input-range-value>\n <mds-input-range-value value=\"400\">Massimo</mds-input-range-value>\n</mds-input-range>\n```\n\n#### Do Not Set `value` on a Range with Values\n\nWith `<mds-input-range-value>` children, the values are theirs: `value` of the range and `mdsInputRangeChange` are left out. Set and read the values on the children, or listen to `mdsInputRangeValuesChange`.\n\n```html\n<!-- INCORRECT -->\n<mds-input-range value=\"20\">\n Prezzo\n <mds-input-range-value>Minimo</mds-input-range-value>\n <mds-input-range-value>Massimo</mds-input-range-value>\n</mds-input-range>\n\n<!-- CORRECT -->\n<mds-input-range>\n Prezzo\n <mds-input-range-value value=\"20\">Minimo</mds-input-range-value>\n <mds-input-range-value value=\"80\">Massimo</mds-input-range-value>\n</mds-input-range>\n```\n\n#### Do Not Pierce the Shadow DOM to Style the Track or Thumb\n\nThe component exposes `::part(header)` and `::part(track)` for all supported customization; it has no public CSS custom property, and the thumb and the track take their colours from the theme. Targeting internal class names via `>>>` or undocumented `::part()` names couples your code to the implementation and will break on minor releases.\n\n```css\n/* INCORRECT */\nmds-input-range >>> .track-progress {\n background-color: hotpink;\n}\nmds-input-range::part(thumb) { /* \"thumb\" is not a documented part */\n border-radius: 0;\n}\n\n/* CORRECT */\nmds-input-range::part(track) { /* \"track\" is a documented part */\n opacity: 0.8;\n}\n```\n\n#### Do Not Use `formatValue` to Change the Submitted Form Value\n\n`formatValue` is purely presentational - it only changes the header display string. The submitted form value is always the raw number. Do not rely on it for data transformation.\n\n```html\n<!-- INCORRECT: expecting the form to submit the formatted string -->\n<mds-input-range id=\"p\" name=\"prezzo\">Prezzo</mds-input-range>\n<script>\n // This changes what is shown but NOT what is submitted\n document.querySelector('#p').formatValue = (v) => v + ' EUR';\n // form.submit() still sends a plain number for \"prezzo\"\n</script>\n\n<!-- CORRECT: format on the server or in a submit handler using event.detail -->\n<mds-input-range id=\"p\" name=\"prezzo\">Prezzo</mds-input-range>\n<script>\n document.querySelector('#p').formatValue = (v) =>\n v.toLocaleString('it-IT', { style: 'currency', currency: 'EUR' });\n // The display is formatted; handle raw numeric value on submit separately\n</script>\n```\n"
|
|
17492
17492
|
},
|
|
@@ -23,7 +23,7 @@ var localeIt = {
|
|
|
23
23
|
position: position
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const mdsInputRangeCss = () => `@layer reset,vendor,theme,base,components,utilities;:host(:not(:is([hydrated],.hydrated))),mds-text:not(:is([hydrated],.hydrated)){animation-duration:0s;border-color:#0000;box-shadow:0 0 #0000;opacity:0;outline-color:#0000;transition-delay:.1s;transition-duration:0s;visibility:hidden}:host{--mds-input-range-transition-duration:var(--duration-300,.3s);--private-input-range-transition-duration:var(--mds-input-range-transition-duration);--mds-input-range-thumb-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-thumb-background:rgb(var(--magma-surface-overlay,var(--surface-neutral-overlay,255 255 255)));--mds-input-range-thumb-cursor:col-resize;--mds-input-range-thumb-size:calc(var(--spacing,.0025rem)*400);--mds-input-range-track-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-background:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-progress-background-disabled:rgb(var(--magma-border-strong,var(--border-neutral-strong,140 140 140)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis-hover,var(--variant-primary-03,7 76 204)));--mds-input-range-track-size:calc(var(--spacing,.0025rem)*600);--private-border-width:calc(var(--mds-input-range-track-size)/2 - var(--mds-input-range-thumb-size)/2);--private-thumb-size:calc(var(--mds-input-range-thumb-size) + var(--private-border-width)*2);display:grid;gap:calc(var(--spacing,.0025rem)*200);grid-template-columns:minmax(0,1fr);transition-duration:var(--private-input-range-transition-duration);transition-property:color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1))}.header{display:flex;gap:calc(var(--spacing,.0025rem)*200)}.label{min-width:0}::slotted(mds-input-range-value){display:none}.value{margin-left:auto}.range{align-items:center;display:flex;height:var(--private-thumb-size);position:relative}.track{box-sizing:border-box;position:absolute;width:100%}.field{appearance:none;background-color:#0000;border-radius:var(--magma-radius-full,var(--radius-full,1000px));flex-grow:1;height:calc(var(--spacing,.0025rem)*400);margin:0;min-width:0;outline:none;z-index:20}.field:focus-visible::-webkit-slider-thumb{--magma-outline-blur:var(--magma-outline-focus);animation-play-state:running}.field::-webkit-slider-thumb{animation-duration:var(--magma-outline-animation-duration,1s);animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:focus-bounce;animation-play-state:paused;animation-timing-function:var(--ease-out,cubic-bezier(0,0,.2,1));appearance:none;background-color:var(--mds-input-range-thumb-background);border-color:var(--mds-input-range-track-progress-background);border-radius:var(--mds-input-range-thumb-size);border-style:solid;border-width:var(--private-border-width);cursor:var(--mds-input-range-thumb-cursor);height:var(--private-thumb-size);line-height:0;outline:var(--magma-outline-blur,2px solid var(--magma-outline-blur-color,#0000));transform:translateY(-50%);transition-duration:.2s;transition-property:background-color,border-color,box-shadow,color,fill,outline,outline-offset,transform;transition-property:background-color,border;transition-timing-function:ease-in-out;width:var(--private-thumb-size)}.field::-webkit-slider-runnable-track{appearance:none;border:0;height:0;width:100%}.track-progress{background-color:var(--mds-input-range-track-progress-background);display:flex;height:var(--mds-input-range-track-size);transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0)*0.01) + var(--mds-input-range-track-size)/2)}.track-progress--between{margin-left:calc((100% - var(--mds-input-range-track-size))*(var(--private-input-range-progress-start,0)*0.01) + var(--mds-input-range-track-size)/2);width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0) - var(--private-input-range-progress-start,0))*.01)}.range--several .field{inset-inline:0;pointer-events:none;position:absolute}.range--several .field::-webkit-slider-thumb{pointer-events:auto}.range--several .field--held{z-index:10}.range--several .field:focus{z-index:30}.track-total{background-color:var(--mds-input-range-track-background);display:flex;height:var(--mds-input-range-track-size);overflow:hidden;transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1));width:100%}.contrast-area,.track-total{border-radius:var(--mds-input-range-track-size)}.contrast-area{margin-left:calc(var(--spacing,.0025rem)*100);margin-right:calc(var(--spacing,.0025rem)*100)}:host([pref-animation=reduce]),:host([pref-animation=reduce]) *,:host([pref-animation=reduce]) :after,:host([pref-animation=reduce]) :before{transition-duration:.01ms!important}:host([pref-animation=reduce]){--private-input-range-transition-duration:0s}:host([pref-mode=dark]:not([pref-theme-scheme=light])),:host([pref-theme-scheme=dark]){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}:host([pref-contrast=more]){color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}:host(:disabled:not([disabled=false])),:host([disabled]:not([disabled=false])){--mds-input-range-thumb-background:var(--mds-input-range-thumb-background-disabled);--mds-input-range-track-background:var(--mds-input-range-track-background-disabled);--mds-input-range-track-progress-background:var(--mds-input-range-track-progress-background-disabled)}:host([disabled]:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}:host(:disabled:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}@media (prefers-reduced-motion:reduce){:host(:not([pref-animation])),:host(:not([pref-animation])) *,:host(:not([pref-animation])) :after,:host(:not([pref-animation])) :before,:host([pref-animation=system]),:host([pref-animation=system]) *,:host([pref-animation=system]) :after,:host([pref-animation=system]) :before{transition-duration:.01ms!important}:host(:not([pref-animation])),:host([pref-animation=system]){--private-input-range-transition-duration:0s}}@media (prefers-color-scheme:dark){:host(:not([pref-mode]):not([pref-theme-scheme=light])),:host([pref-mode=system]:not([pref-theme-scheme=light])){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}}@media (prefers-contrast:more){:host(:not([pref-contrast])),:host([pref-contrast=system]){color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}}`;
|
|
26
|
+
const mdsInputRangeCss = () => `@layer reset,vendor,theme,base,components,utilities;:host(:not(:is([hydrated],.hydrated))),mds-text:not(:is([hydrated],.hydrated)){animation-duration:0s;border-color:#0000;box-shadow:0 0 #0000;opacity:0;outline-color:#0000;transition-delay:.1s;transition-duration:0s;visibility:hidden}:host{--mds-input-range-transition-duration:var(--duration-300,.3s);--private-input-range-transition-duration:var(--mds-input-range-transition-duration);--mds-input-range-thumb-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-thumb-background:rgb(var(--magma-surface-overlay,var(--surface-neutral-overlay,255 255 255)));--mds-input-range-thumb-cursor:col-resize;--mds-input-range-thumb-size:calc(var(--spacing,.0025rem)*400);--mds-input-range-track-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-background:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-progress-background-disabled:rgb(var(--magma-border-strong,var(--border-neutral-strong,140 140 140)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis-hover,var(--variant-primary-03,7 76 204)));--mds-input-range-track-size:calc(var(--spacing,.0025rem)*600);--private-border-width:calc(var(--mds-input-range-track-size)/2 - var(--mds-input-range-thumb-size)/2);--private-thumb-size:calc(var(--mds-input-range-thumb-size) + var(--private-border-width)*2);--private-input-range-tip-shadow:drop-shadow(0 calc(var(--spacing,.0025rem)*250) calc(var(--spacing,.0025rem)*200) rgb(var(--magma-shadow-ink,var(--tone-neutral-01,5 5 5))/.04)) drop-shadow(0 calc(var(--spacing,.0025rem)*100) calc(var(--spacing,.0025rem)*75) rgb(var(--magma-shadow-ink,var(--tone-neutral-01,5 5 5))/.1)) drop-shadow(0 0 1px rgb(var(--magma-shadow-ink,var(--tone-neutral-01,5 5 5))/.1));display:grid;gap:calc(var(--spacing,.0025rem)*200);grid-template-columns:minmax(0,1fr);transition-duration:var(--private-input-range-transition-duration);transition-property:color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1))}.header{display:flex;gap:calc(var(--spacing,.0025rem)*200)}.label{min-width:0}::slotted(mds-input-range-value){display:none}.value{margin-left:auto}.range{align-items:center;display:flex;height:var(--private-thumb-size);position:relative}.track{box-sizing:border-box;position:absolute;width:100%}.field{appearance:none;background-color:#0000;border-radius:var(--magma-radius-full,var(--radius-full,1000px));flex-grow:1;height:calc(var(--spacing,.0025rem)*400);margin:0;min-width:0;outline:none;z-index:20}.field:focus-visible::-webkit-slider-thumb{--magma-outline-blur:var(--magma-outline-focus);animation-play-state:running}.field::-webkit-slider-thumb{animation-duration:var(--magma-outline-animation-duration,1s);animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:focus-bounce;animation-play-state:paused;animation-timing-function:var(--ease-out,cubic-bezier(0,0,.2,1));appearance:none;background-color:var(--mds-input-range-thumb-background);border-color:var(--mds-input-range-track-progress-background);border-radius:var(--mds-input-range-thumb-size);border-style:solid;border-width:var(--private-border-width);cursor:var(--mds-input-range-thumb-cursor);height:var(--private-thumb-size);line-height:0;outline:var(--magma-outline-blur,2px solid var(--magma-outline-blur-color,#0000));transform:translateY(-50%);transition-duration:.2s;transition-property:background-color,border-color,box-shadow,color,fill,outline,outline-offset,transform;transition-property:background-color,border;transition-timing-function:ease-in-out;width:var(--private-thumb-size)}.field::-webkit-slider-runnable-track{appearance:none;border:0;height:0;width:100%}.track-progress{background-color:var(--mds-input-range-track-progress-background);display:flex;height:var(--mds-input-range-track-size);transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0)*0.01) + var(--mds-input-range-track-size)/2)}.track-progress--between{margin-left:calc((100% - var(--mds-input-range-track-size))*(var(--private-input-range-progress-start,0)*0.01) + var(--mds-input-range-track-size)/2);width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0) - var(--private-input-range-progress-start,0))*.01)}.range--several .field{inset-inline:0;pointer-events:none;position:absolute}.range--several .field::-webkit-slider-thumb{pointer-events:auto}.range--several .field--held{z-index:10}.range--several .field:focus{z-index:30}.tip{--private-input-range-tip-centre:calc((100cqi - var(--mds-input-range-track-size))*(var(--private-input-range-tip-position,0)*0.01) + var(--mds-input-range-track-size)/2);bottom:100%;container-type:inline-size;filter:var(--private-input-range-tip-shadow);height:0;inset-inline:0;opacity:0;pointer-events:none;position:absolute;transition-duration:var(--private-input-range-transition-duration);transition-property:opacity;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1));z-index:40}.field:active:not(:disabled)+.tip,.field:focus-visible+.tip,.field:hover:not(:disabled)+.tip{opacity:1}.tip-bubble{border-radius:var(--magma-radius-3xs,var(--radius-squircle-3xs,6px));bottom:calc(var(--spacing,.0025rem)*100);box-sizing:border-box;color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)));corner-shape:var(--magma-corner-shape,squircle);display:flex;padding-block:calc(var(--spacing,.0025rem)*100);padding-inline:calc(var(--spacing,.0025rem)*200);translate:clamp(calc(var(--private-input-range-tip-centre)*-1),-50%,calc(100cqi - 100% - var(--private-input-range-tip-centre))) 0;white-space:nowrap;width:max-content}.tip-arrow,.tip-bubble{background-color:rgb(var(--magma-surface-overlay,var(--surface-neutral-overlay,255 255 255)));left:var(--private-input-range-tip-centre);position:absolute}.tip-arrow{bottom:0;clip-path:polygon(0 0,100% 0,50% 100%);height:calc(var(--spacing,.0025rem)*100);translate:-50%;width:calc(var(--spacing,.0025rem)*250)}.track-total{background-color:var(--mds-input-range-track-background);display:flex;height:var(--mds-input-range-track-size);overflow:hidden;transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1));width:100%}.contrast-area,.track-total{border-radius:var(--mds-input-range-track-size)}.contrast-area{margin-left:calc(var(--spacing,.0025rem)*100);margin-right:calc(var(--spacing,.0025rem)*100)}:host([pref-animation=reduce]),:host([pref-animation=reduce]) *,:host([pref-animation=reduce]) :after,:host([pref-animation=reduce]) :before{transition-duration:.01ms!important}:host([pref-animation=reduce]){--private-input-range-transition-duration:0s}:host([pref-mode=dark]:not([pref-theme-scheme=light])),:host([pref-theme-scheme=dark]){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}:host([pref-contrast=more]){--private-input-range-tip-shadow:drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.05)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3));color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}:host(:disabled:not([disabled=false])),:host([disabled]:not([disabled=false])){--mds-input-range-thumb-background:var(--mds-input-range-thumb-background-disabled);--mds-input-range-track-background:var(--mds-input-range-track-background-disabled);--mds-input-range-track-progress-background:var(--mds-input-range-track-progress-background-disabled)}:host([disabled]:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}:host(:disabled:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}@media (prefers-reduced-motion:reduce){:host(:not([pref-animation])),:host(:not([pref-animation])) *,:host(:not([pref-animation])) :after,:host(:not([pref-animation])) :before,:host([pref-animation=system]),:host([pref-animation=system]) *,:host([pref-animation=system]) :after,:host([pref-animation=system]) :before{transition-duration:.01ms!important}:host(:not([pref-animation])),:host([pref-animation=system]){--private-input-range-transition-duration:0s}}@media (prefers-color-scheme:dark){:host(:not([pref-mode]):not([pref-theme-scheme=light])),:host([pref-mode=system]:not([pref-theme-scheme=light])){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}}@media (prefers-contrast:more){:host(:not([pref-contrast])),:host([pref-contrast=system]){--private-input-range-tip-shadow:drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.05)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3));color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}}`;
|
|
27
27
|
|
|
28
28
|
const VALUE_TAG = 'mds-input-range-value';
|
|
29
29
|
const MdsInputRange = class {
|
|
@@ -352,9 +352,13 @@ const MdsInputRange = class {
|
|
|
352
352
|
* between spaces.
|
|
353
353
|
*/
|
|
354
354
|
displayValues() {
|
|
355
|
-
const texts = this.thumbs.map(({ value }) => this.
|
|
355
|
+
const texts = this.thumbs.map(({ value }) => this.formatted(value));
|
|
356
356
|
return texts.join(texts.length === 2 ? ' \u2013 ' : ' \u00b7 ');
|
|
357
357
|
}
|
|
358
|
+
/** A value as the range shows it: through `formatValue`, or as it is. */
|
|
359
|
+
formatted(value) {
|
|
360
|
+
return this.formatValue ? this.formatValue(value) : String(value);
|
|
361
|
+
}
|
|
358
362
|
disabledChanged(newValue) {
|
|
359
363
|
/**
|
|
360
364
|
* This is related to ALL disabled attributes set on Magma input components
|
|
@@ -475,14 +479,26 @@ const MdsInputRange = class {
|
|
|
475
479
|
this.onInput();
|
|
476
480
|
this.calculateProgress();
|
|
477
481
|
}
|
|
482
|
+
/**
|
|
483
|
+
* The tip of a value, right after the input of its thumb: the CSS shows it while that input is
|
|
484
|
+
* under the pointer, pressed or focused from the keyboard (`.field:hover + .tip`), and places it
|
|
485
|
+
* from `position`, where the value sits on the track (0 to 100).
|
|
486
|
+
*/
|
|
487
|
+
renderTip(position, text, key) {
|
|
488
|
+
return (h("div", { key: key, class: "tip", "aria-hidden": "true", style: { '--private-input-range-tip-position': `${position}` } }, h("span", { class: "tip-bubble" }, h("mds-text", { class: "tip-value", typography: "label" }, text)), h("span", { class: "tip-arrow" })));
|
|
489
|
+
}
|
|
490
|
+
/** A native input per thumb, each followed by the tip of its value. */
|
|
478
491
|
renderThumbs() {
|
|
479
492
|
return this.thumbs.map((thumb, index) => {
|
|
480
493
|
const [low, high] = this.bounds(index);
|
|
481
|
-
return
|
|
494
|
+
return [
|
|
495
|
+
h("input", { key: thumb.key, class: { field: true, 'field--held': low === high }, type: "range", "aria-label": this.thumbName(index), "aria-valuetext": this.formatValue ? this.formatValue(thumb.value) : undefined, disabled: this.isDisabled(), max: this.max, min: this.min, onInput: this.onThumbInput, onKeyDown: this.onThumbKeyDown, step: this.allowedStep(), value: thumb.value }),
|
|
496
|
+
this.renderTip(this.percent(thumb.value), this.formatted(thumb.value), `tip-${thumb.key}`),
|
|
497
|
+
];
|
|
482
498
|
});
|
|
483
499
|
}
|
|
484
500
|
render() {
|
|
485
|
-
var _a;
|
|
501
|
+
var _a, _b;
|
|
486
502
|
const children = this.thumbs.length > 0;
|
|
487
503
|
const several = this.thumbs.length > 1;
|
|
488
504
|
const first = this.thumbs[0];
|
|
@@ -493,11 +509,16 @@ const MdsInputRange = class {
|
|
|
493
509
|
};
|
|
494
510
|
if (several)
|
|
495
511
|
progress['--private-input-range-progress-start'] = `${this.percent(first.value)}`;
|
|
496
|
-
return (h(Host, { key: '
|
|
512
|
+
return (h(Host, { key: '26a7ec9fdca1190c60a031c122d4726caba0dc09', "pref-animation": preferenceStore.state.animation, "pref-contrast": preferenceStore.state.contrast, "pref-mode": preferenceStore.state.mode, "pref-theme-scheme": preferenceStore.state['theme-scheme'] }, h("header", { key: 'eac882dc3793792bd88e100e295b70ffcbfc41ea', class: "header", part: "header" }, h("mds-text", { key: '4cd4bc7b76cc7014520dd805930900e358ec2876', class: "label", truncate: "word", typography: "label" }, h("slot", { key: '28afcfce8b82d8288c8b61e4e461c566c0778c73' })), h("mds-text", { key: 'c12a80857ec6ff4961e8a294c3e43c4bbce2cecb', class: "value", typography: "label" }, children
|
|
497
513
|
? this.displayValues()
|
|
498
514
|
: this.formatValue
|
|
499
515
|
? this.formatValue(this.value)
|
|
500
|
-
: this.value)), h("div", { key: '
|
|
516
|
+
: this.value)), h("div", { key: 'a1745566763926db65a8daa6dd0f786ebb41bca5', class: { range: true, 'range--several': several }, role: children ? 'group' : undefined, "aria-label": children && this.label !== '' ? this.label : undefined, onPointerDown: this.onTrackPointerDown }, h("div", { key: '22a55f00ab4fb181744595ddeef84b48d308e9ce', class: "track", part: "track" }, h("div", { key: '27a45042881334d1ec9082c93b209eb306904642', class: "contrast-area" }), h("div", { key: '3a58b1a75392d4c7c907fc1029d7b60d396b1a71', class: "track-total" }, h("div", { key: 'ea616e7ab8b5084978cb3d8763f5f3c5b49101cf', class: { 'track-progress': true, 'track-progress--between': several }, style: progress }))), children
|
|
517
|
+
? this.renderThumbs()
|
|
518
|
+
: [
|
|
519
|
+
h("input", { ref: (el) => (this.inputElement = el), class: "field", "aria-label": this.label, "aria-valuetext": this.formatValue ? this.formatValue(this.value) : undefined, disabled: this.isDisabled(), max: this.max, min: this.min, onInput: this.onInput, step: this.step, type: "range", value: this.value, name: this.name }),
|
|
520
|
+
this.renderTip((_b = this.progress) !== null && _b !== void 0 ? _b : 0, this.value == null ? '' : this.formatted(this.value)),
|
|
521
|
+
])));
|
|
501
522
|
}
|
|
502
523
|
static get formAssociated() { return true; }
|
|
503
524
|
get element() { return getElement(this); }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as registerInstance,d as createEvent,h,e as Host,g as getElement,B as Build}from"./index-CPibDZjX.js";import{s as setFormValue}from"./form-wI0alRSO.js";import{L as Locale}from"./locale-B7Hw4niB.js";import{p as preferenceStore}from"./preference-CBMLGSf7.js";var position$3="{{position}} από {{count}}";var localeEl={position:position$3};var position$2="{{position}} of {{count}}";var localeEn={position:position$2};var position$1="{{position}} de {{count}}";var localeEs={position:position$1};var position="{{position}} di {{count}}";var localeIt={position:position};var mdsInputRangeCss=function(){return"@layer reset,vendor,theme,base,components,utilities;:host(:not(:is([hydrated],.hydrated))),mds-text:not(:is([hydrated],.hydrated)){animation-duration:0s;border-color:#0000;box-shadow:0 0 #0000;opacity:0;outline-color:#0000;transition-delay:.1s;transition-duration:0s;visibility:hidden}:host{--mds-input-range-transition-duration:var(--duration-300,.3s);--private-input-range-transition-duration:var(--mds-input-range-transition-duration);--mds-input-range-thumb-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-thumb-background:rgb(var(--magma-surface-overlay,var(--surface-neutral-overlay,255 255 255)));--mds-input-range-thumb-cursor:col-resize;--mds-input-range-thumb-size:calc(var(--spacing,.0025rem)*400);--mds-input-range-track-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-background:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-progress-background-disabled:rgb(var(--magma-border-strong,var(--border-neutral-strong,140 140 140)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis-hover,var(--variant-primary-03,7 76 204)));--mds-input-range-track-size:calc(var(--spacing,.0025rem)*600);--private-border-width:calc(var(--mds-input-range-track-size)/2 - var(--mds-input-range-thumb-size)/2);--private-thumb-size:calc(var(--mds-input-range-thumb-size) + var(--private-border-width)*2);display:grid;gap:calc(var(--spacing,.0025rem)*200);grid-template-columns:minmax(0,1fr);transition-duration:var(--private-input-range-transition-duration);transition-property:color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1))}.header{display:flex;gap:calc(var(--spacing,.0025rem)*200)}.label{min-width:0}::slotted(mds-input-range-value){display:none}.value{margin-left:auto}.range{align-items:center;display:flex;height:var(--private-thumb-size);position:relative}.track{box-sizing:border-box;position:absolute;width:100%}.field{appearance:none;background-color:#0000;border-radius:var(--magma-radius-full,var(--radius-full,1000px));flex-grow:1;height:calc(var(--spacing,.0025rem)*400);margin:0;min-width:0;outline:none;z-index:20}.field:focus-visible::-webkit-slider-thumb{--magma-outline-blur:var(--magma-outline-focus);animation-play-state:running}.field::-webkit-slider-thumb{animation-duration:var(--magma-outline-animation-duration,1s);animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:focus-bounce;animation-play-state:paused;animation-timing-function:var(--ease-out,cubic-bezier(0,0,.2,1));appearance:none;background-color:var(--mds-input-range-thumb-background);border-color:var(--mds-input-range-track-progress-background);border-radius:var(--mds-input-range-thumb-size);border-style:solid;border-width:var(--private-border-width);cursor:var(--mds-input-range-thumb-cursor);height:var(--private-thumb-size);line-height:0;outline:var(--magma-outline-blur,2px solid var(--magma-outline-blur-color,#0000));transform:translateY(-50%);transition-duration:.2s;transition-property:background-color,border-color,box-shadow,color,fill,outline,outline-offset,transform;transition-property:background-color,border;transition-timing-function:ease-in-out;width:var(--private-thumb-size)}.field::-webkit-slider-runnable-track{appearance:none;border:0;height:0;width:100%}.track-progress{background-color:var(--mds-input-range-track-progress-background);display:flex;height:var(--mds-input-range-track-size);transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0)*0.01) + var(--mds-input-range-track-size)/2)}.track-progress--between{margin-left:calc((100% - var(--mds-input-range-track-size))*(var(--private-input-range-progress-start,0)*0.01) + var(--mds-input-range-track-size)/2);width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0) - var(--private-input-range-progress-start,0))*.01)}.range--several .field{inset-inline:0;pointer-events:none;position:absolute}.range--several .field::-webkit-slider-thumb{pointer-events:auto}.range--several .field--held{z-index:10}.range--several .field:focus{z-index:30}.track-total{background-color:var(--mds-input-range-track-background);display:flex;height:var(--mds-input-range-track-size);overflow:hidden;transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1));width:100%}.contrast-area,.track-total{border-radius:var(--mds-input-range-track-size)}.contrast-area{margin-left:calc(var(--spacing,.0025rem)*100);margin-right:calc(var(--spacing,.0025rem)*100)}:host([pref-animation=reduce]),:host([pref-animation=reduce]) *,:host([pref-animation=reduce]) :after,:host([pref-animation=reduce]) :before{transition-duration:.01ms!important}:host([pref-animation=reduce]){--private-input-range-transition-duration:0s}:host([pref-mode=dark]:not([pref-theme-scheme=light])),:host([pref-theme-scheme=dark]){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}:host([pref-contrast=more]){color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}:host(:disabled:not([disabled=false])),:host([disabled]:not([disabled=false])){--mds-input-range-thumb-background:var(--mds-input-range-thumb-background-disabled);--mds-input-range-track-background:var(--mds-input-range-track-background-disabled);--mds-input-range-track-progress-background:var(--mds-input-range-track-progress-background-disabled)}:host([disabled]:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}:host(:disabled:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}@media (prefers-reduced-motion:reduce){:host(:not([pref-animation])),:host(:not([pref-animation])) *,:host(:not([pref-animation])) :after,:host(:not([pref-animation])) :before,:host([pref-animation=system]),:host([pref-animation=system]) *,:host([pref-animation=system]) :after,:host([pref-animation=system]) :before{transition-duration:.01ms!important}:host(:not([pref-animation])),:host([pref-animation=system]){--private-input-range-transition-duration:0s}}@media (prefers-color-scheme:dark){:host(:not([pref-mode]):not([pref-theme-scheme=light])),:host([pref-mode=system]:not([pref-theme-scheme=light])){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}}@media (prefers-contrast:more){:host(:not([pref-contrast])),:host([pref-contrast=system]){color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}}"};var VALUE_TAG="mds-input-range-value";var MdsInputRange=/** @class */function(){function t(r){var e=this.constructor;var a=this;if(e===t)registerInstance(this,r);this.changeEvent=createEvent(this,"mdsInputRangeChange",7);this.valuesChangeEvent=createEvent(this,"mdsInputRangeValuesChange",7);if(r.$hostElement$["s-ei"]){this.internals=r.$hostElement$["s-ei"]}else{this.internals=r.$hostElement$.attachInternals();r.$hostElement$["s-ei"]=this.internals}
|
|
1
|
+
import{r as registerInstance,d as createEvent,h,e as Host,g as getElement,B as Build}from"./index-CPibDZjX.js";import{s as setFormValue}from"./form-wI0alRSO.js";import{L as Locale}from"./locale-B7Hw4niB.js";import{p as preferenceStore}from"./preference-CBMLGSf7.js";var position$3="{{position}} από {{count}}";var localeEl={position:position$3};var position$2="{{position}} of {{count}}";var localeEn={position:position$2};var position$1="{{position}} de {{count}}";var localeEs={position:position$1};var position="{{position}} di {{count}}";var localeIt={position:position};var mdsInputRangeCss=function(){return"@layer reset,vendor,theme,base,components,utilities;:host(:not(:is([hydrated],.hydrated))),mds-text:not(:is([hydrated],.hydrated)){animation-duration:0s;border-color:#0000;box-shadow:0 0 #0000;opacity:0;outline-color:#0000;transition-delay:.1s;transition-duration:0s;visibility:hidden}:host{--mds-input-range-transition-duration:var(--duration-300,.3s);--private-input-range-transition-duration:var(--mds-input-range-transition-duration);--mds-input-range-thumb-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-thumb-background:rgb(var(--magma-surface-overlay,var(--surface-neutral-overlay,255 255 255)));--mds-input-range-thumb-cursor:col-resize;--mds-input-range-thumb-size:calc(var(--spacing,.0025rem)*400);--mds-input-range-track-background-disabled:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-background:rgb(var(--magma-wash-strong,var(--tone-neutral-08,208 208 208)));--mds-input-range-track-progress-background-disabled:rgb(var(--magma-border-strong,var(--border-neutral-strong,140 140 140)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis-hover,var(--variant-primary-03,7 76 204)));--mds-input-range-track-size:calc(var(--spacing,.0025rem)*600);--private-border-width:calc(var(--mds-input-range-track-size)/2 - var(--mds-input-range-thumb-size)/2);--private-thumb-size:calc(var(--mds-input-range-thumb-size) + var(--private-border-width)*2);--private-input-range-tip-shadow:drop-shadow(0 calc(var(--spacing,.0025rem)*250) calc(var(--spacing,.0025rem)*200) rgb(var(--magma-shadow-ink,var(--tone-neutral-01,5 5 5))/.04)) drop-shadow(0 calc(var(--spacing,.0025rem)*100) calc(var(--spacing,.0025rem)*75) rgb(var(--magma-shadow-ink,var(--tone-neutral-01,5 5 5))/.1)) drop-shadow(0 0 1px rgb(var(--magma-shadow-ink,var(--tone-neutral-01,5 5 5))/.1));display:grid;gap:calc(var(--spacing,.0025rem)*200);grid-template-columns:minmax(0,1fr);transition-duration:var(--private-input-range-transition-duration);transition-property:color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1))}.header{display:flex;gap:calc(var(--spacing,.0025rem)*200)}.label{min-width:0}::slotted(mds-input-range-value){display:none}.value{margin-left:auto}.range{align-items:center;display:flex;height:var(--private-thumb-size);position:relative}.track{box-sizing:border-box;position:absolute;width:100%}.field{appearance:none;background-color:#0000;border-radius:var(--magma-radius-full,var(--radius-full,1000px));flex-grow:1;height:calc(var(--spacing,.0025rem)*400);margin:0;min-width:0;outline:none;z-index:20}.field:focus-visible::-webkit-slider-thumb{--magma-outline-blur:var(--magma-outline-focus);animation-play-state:running}.field::-webkit-slider-thumb{animation-duration:var(--magma-outline-animation-duration,1s);animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:focus-bounce;animation-play-state:paused;animation-timing-function:var(--ease-out,cubic-bezier(0,0,.2,1));appearance:none;background-color:var(--mds-input-range-thumb-background);border-color:var(--mds-input-range-track-progress-background);border-radius:var(--mds-input-range-thumb-size);border-style:solid;border-width:var(--private-border-width);cursor:var(--mds-input-range-thumb-cursor);height:var(--private-thumb-size);line-height:0;outline:var(--magma-outline-blur,2px solid var(--magma-outline-blur-color,#0000));transform:translateY(-50%);transition-duration:.2s;transition-property:background-color,border-color,box-shadow,color,fill,outline,outline-offset,transform;transition-property:background-color,border;transition-timing-function:ease-in-out;width:var(--private-thumb-size)}.field::-webkit-slider-runnable-track{appearance:none;border:0;height:0;width:100%}.track-progress{background-color:var(--mds-input-range-track-progress-background);display:flex;height:var(--mds-input-range-track-size);transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0)*0.01) + var(--mds-input-range-track-size)/2)}.track-progress--between{margin-left:calc((100% - var(--mds-input-range-track-size))*(var(--private-input-range-progress-start,0)*0.01) + var(--mds-input-range-track-size)/2);width:calc((100% - var(--mds-input-range-track-size))*(var(--mds-input-range-progress,0) - var(--private-input-range-progress-start,0))*.01)}.range--several .field{inset-inline:0;pointer-events:none;position:absolute}.range--several .field::-webkit-slider-thumb{pointer-events:auto}.range--several .field--held{z-index:10}.range--several .field:focus{z-index:30}.tip{--private-input-range-tip-centre:calc((100cqi - var(--mds-input-range-track-size))*(var(--private-input-range-tip-position,0)*0.01) + var(--mds-input-range-track-size)/2);bottom:100%;container-type:inline-size;filter:var(--private-input-range-tip-shadow);height:0;inset-inline:0;opacity:0;pointer-events:none;position:absolute;transition-duration:var(--private-input-range-transition-duration);transition-property:opacity;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1));z-index:40}.field:active:not(:disabled)+.tip,.field:focus-visible+.tip,.field:hover:not(:disabled)+.tip{opacity:1}.tip-bubble{border-radius:var(--magma-radius-3xs,var(--radius-squircle-3xs,6px));bottom:calc(var(--spacing,.0025rem)*100);box-sizing:border-box;color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)));corner-shape:var(--magma-corner-shape,squircle);display:flex;padding-block:calc(var(--spacing,.0025rem)*100);padding-inline:calc(var(--spacing,.0025rem)*200);translate:clamp(calc(var(--private-input-range-tip-centre)*-1),-50%,calc(100cqi - 100% - var(--private-input-range-tip-centre))) 0;white-space:nowrap;width:max-content}.tip-arrow,.tip-bubble{background-color:rgb(var(--magma-surface-overlay,var(--surface-neutral-overlay,255 255 255)));left:var(--private-input-range-tip-centre);position:absolute}.tip-arrow{bottom:0;clip-path:polygon(0 0,100% 0,50% 100%);height:calc(var(--spacing,.0025rem)*100);translate:-50%;width:calc(var(--spacing,.0025rem)*250)}.track-total{background-color:var(--mds-input-range-track-background);display:flex;height:var(--mds-input-range-track-size);overflow:hidden;transition-duration:var(--private-input-range-transition-duration);transition-property:background-color;transition-timing-function:var(--ease-out-sine,cubic-bezier(.39,.575,.565,1));width:100%}.contrast-area,.track-total{border-radius:var(--mds-input-range-track-size)}.contrast-area{margin-left:calc(var(--spacing,.0025rem)*100);margin-right:calc(var(--spacing,.0025rem)*100)}:host([pref-animation=reduce]),:host([pref-animation=reduce]) *,:host([pref-animation=reduce]) :after,:host([pref-animation=reduce]) :before{transition-duration:.01ms!important}:host([pref-animation=reduce]){--private-input-range-transition-duration:0s}:host([pref-mode=dark]:not([pref-theme-scheme=light])),:host([pref-theme-scheme=dark]){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}:host([pref-contrast=more]){--private-input-range-tip-shadow:drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.05)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3));color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}:host(:disabled:not([disabled=false])),:host([disabled]:not([disabled=false])){--mds-input-range-thumb-background:var(--mds-input-range-thumb-background-disabled);--mds-input-range-track-background:var(--mds-input-range-track-background-disabled);--mds-input-range-track-progress-background:var(--mds-input-range-track-progress-background-disabled)}:host([disabled]:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}:host(:disabled:not([disabled=false])) .field::-webkit-slider-thumb{cursor:not-allowed}@media (prefers-reduced-motion:reduce){:host(:not([pref-animation])),:host(:not([pref-animation])) *,:host(:not([pref-animation])) :after,:host(:not([pref-animation])) :before,:host([pref-animation=system]),:host([pref-animation=system]) *,:host([pref-animation=system]) :after,:host([pref-animation=system]) :before{transition-duration:.01ms!important}:host(:not([pref-animation])),:host([pref-animation=system]){--private-input-range-transition-duration:0s}}@media (prefers-color-scheme:dark){:host(:not([pref-mode]):not([pref-theme-scheme=light])),:host([pref-mode=system]:not([pref-theme-scheme=light])){--mds-input-range-thumb-background:rgb(var(--magma-text-on-emphasis,var(--tone-neutral-seed,255 255 255)));--mds-input-range-track-progress-background:rgb(var(--magma-accent-emphasis,var(--variant-primary-04,36 103 231)))}}@media (prefers-contrast:more){:host(:not([pref-contrast])),:host([pref-contrast=system]){--private-input-range-tip-shadow:drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.05)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3)) drop-shadow(0 0 calc(var(--spacing,.0025rem)*100) rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5))/.3));color:rgb(var(--magma-text-default,var(--text-neutral-default,5 5 5)))}}"};var VALUE_TAG="mds-input-range-value";var MdsInputRange=/** @class */function(){function t(r){var a=this.constructor;var e=this;if(a===t)registerInstance(this,r);this.changeEvent=createEvent(this,"mdsInputRangeChange",7);this.valuesChangeEvent=createEvent(this,"mdsInputRangeValuesChange",7);if(r.$hostElement$["s-ei"]){this.internals=r.$hostElement$["s-ei"]}else{this.internals=r.$hostElement$.attachInternals();r.$hostElement$["s-ei"]=this.internals}
|
|
2
2
|
// the label of the range: its text, the mds-input-range-value children left out
|
|
3
3
|
this.label="";
|
|
4
4
|
// the thumbs of the mds-input-range-value children, in order of value; empty without children,
|
|
@@ -21,33 +21,33 @@ this.formDisabled=false;
|
|
|
21
21
|
/**
|
|
22
22
|
* The step attribute is a number that specifies the granularity that
|
|
23
23
|
* the value must adhere to, or the special value any, which is described below.
|
|
24
|
-
*/this.step=1;this.onInput=function(){if(
|
|
24
|
+
*/this.step=1;this.onInput=function(){if(e.inputElement==null)return;
|
|
25
25
|
// a range input always holds a number: the browser sanitizes anything else
|
|
26
26
|
// trigger valueChanged that update progress and emit event
|
|
27
|
-
|
|
28
|
-
/** Reads the children again: the label, the values and their names, the children that came and went. */this.syncChildren=function(){if(!
|
|
27
|
+
e.value=Number(e.inputElement.value)};
|
|
28
|
+
/** Reads the children again: the label, the values and their names, the children that came and went. */this.syncChildren=function(){if(!e.loaded)return;e.label=e.readLabel();var t=e.readThumbs();
|
|
29
29
|
// a value brought inside the range goes back on its child, even when its thumb stays put
|
|
30
|
-
|
|
30
|
+
e.writeChildValues(t);if(e.sameThumbs(t))return;if(t.length===0&&e.thumbs.length>0)e.singlePending=true;t.forEach((function(t){var r=t.element,a=t.value;if(!e.childLoadValues.has(r))e.childLoadValues.set(r,a)}));e.updateThumbs(t)};
|
|
31
31
|
// the drag of the pointer: the native input knows only min and max, the neighbours stop it here
|
|
32
|
-
this.onThumbInput=function(t){var r=t.target;var e
|
|
32
|
+
this.onThumbInput=function(t){var r=t.target;var a=e.thumbInputs().indexOf(r);if(a<0)return;e.moveThumb(a,Number(r.value))};this.onThumbKeyDown=function(t){var r=e.thumbInputs().indexOf(t.target);if(r<0||e.isDisabled())return;var a=e.thumbs[r].value;var i=e.bounds(r),n=i[0],s=i[1];var o=e.allowedStep();
|
|
33
33
|
// a page is a tenth of the range, at least a step, as on a native range input
|
|
34
|
-
var u=Math.max((
|
|
34
|
+
var u=Math.max((e.max-e.min)/10,o);var c={ArrowDown:a-o,ArrowLeft:a-o,ArrowRight:a+o,ArrowUp:a+o,End:s,Home:n,PageDown:a-u,PageUp:a+u};var d=c[t.key];if(d===undefined)return;t.preventDefault();e.moveThumb(r,d)};
|
|
35
35
|
/**
|
|
36
36
|
* A press on the track between several thumbs moves the nearest one there, as a press on the
|
|
37
37
|
* track of a native range input moves its thumb. Of two thumbs as near, the one with room
|
|
38
38
|
* toward the pointer moves. The thumbs themselves catch the pointer, which the inputs let
|
|
39
39
|
* through to the track.
|
|
40
|
-
*/this.onTrackPointerDown=function(t){var r;if(
|
|
40
|
+
*/this.onTrackPointerDown=function(t){var r;if(e.thumbs.length<2||e.isDisabled()||t.button!==0)return;if(t.target.tagName==="INPUT")return;var a=t.currentTarget;var i=a.querySelector(".track-total");if(!i)return;var n=a.getBoundingClientRect();
|
|
41
41
|
// the thumb is as large as the track is tall, and its centre travels the track less one thumb
|
|
42
|
-
var s=i.getBoundingClientRect().height;var o=Math.min(Math.max((t.clientX-n.left-s/2)/(n.width-s),0),1);var u=
|
|
42
|
+
var s=i.getBoundingClientRect().height;var o=Math.min(Math.max((t.clientX-n.left-s/2)/(n.width-s),0),1);var u=e.normalize(e.min+o*(e.max-e.min));var c=0;e.thumbs.forEach((function(t,r){var a=Math.abs(t.value-u);var i=Math.abs(e.thumbs[c].value-u);if(a<i||a===i&&u>t.value)c=r}));
|
|
43
43
|
// no mousedown after this: it would take the focus back from the thumb
|
|
44
|
-
t.preventDefault();(r=
|
|
44
|
+
t.preventDefault();(r=e.thumbInputs()[c])===null||r===void 0?void 0:r.focus();e.moveThumb(c,u)};this.isDisabled=function(){return!!e.disabled||e.formDisabled}}
|
|
45
45
|
/** As on a native input, a step that is not a positive number falls back to the default, 1. */t.prototype.allowedStep=function(){var t=Number(this.step);return t>0?t:1};
|
|
46
46
|
/**
|
|
47
47
|
* A value inside `min` and `max`, on the nearest step from `min`, as a native range input
|
|
48
48
|
* sanitizes it; a step past `max` falls back one step. The values are scaled to integers by
|
|
49
49
|
* the decimals of the step and of `min`, so that a decimal step snaps without float errors.
|
|
50
|
-
*/t.prototype.normalize=function(t){var r=this.allowedStep();var
|
|
50
|
+
*/t.prototype.normalize=function(t){var r=this.allowedStep();var a=Math.pow(10,Math.max(this.countDecimals(r),this.countDecimals(this.min)));var e=Math.round(this.min*a);var i=Math.round(this.max*a);var n=Math.round(r*a);var s=Math.min(Math.max(t*a,e),i);var o=Math.round((s-e)/n)*n+e;if(o>i)o-=n;return o/a};
|
|
51
51
|
/** The default of a native range input: the middle of the range, on the step. */t.prototype.middle=function(){return this.normalize(this.min+(this.max-this.min)/2)};
|
|
52
52
|
/** Where a value sits on the track, from 0 at `min` to 100 at `max`. */t.prototype.percent=function(t){return this.max===this.min?0:(t-this.min)/(this.max-this.min)*100};t.prototype.calculateProgress=function(){if(this.inputElement==null)return;this.value=this.normalize(Number(this.inputElement.value));setFormValue(this.internals,this.value.toString());var t=this.max-this.min;var r=this.value-this.min;this.progress=r/t*100};t.prototype.countDecimals=function(t){if(Math.floor(t)===t)return 0;return t.toString().split(".")[1].length||0};
|
|
53
53
|
/** The label of the range: its text, without the names of its values. */t.prototype.readLabel=function(){return Array.from(this.element.childNodes).filter((function(t){return t.nodeName.toLowerCase()!==VALUE_TAG})).map((function(t){var r;return(r=t.textContent)!==null&&r!==void 0?r:""})).join("").trim()};
|
|
@@ -55,31 +55,32 @@ t.preventDefault();(r=a.thumbInputs()[h])===null||r===void 0?void 0:r.focus();a.
|
|
|
55
55
|
* The mds-input-range-value children as thumbs, each value inside the range and on its step, in
|
|
56
56
|
* order of value. Two thumbs on one value keep the order they had, so that a thumb that reaches
|
|
57
57
|
* its neighbour does not take its place; a new one comes after them, in the order of the markup.
|
|
58
|
-
*/t.prototype.readThumbs=function(){var t=this;var r=new Map(this.thumbs.map((function(t,r){var
|
|
58
|
+
*/t.prototype.readThumbs=function(){var t=this;var r=new Map(this.thumbs.map((function(t,r){var a=t.element;return[a,r]})));var a=Array.from(this.element.children).filter((function(t){return t.tagName.toLowerCase()===VALUE_TAG}));return a.map((function(a,e){var i,n,s,o;
|
|
59
59
|
// the prop, or the attribute of a child not defined yet
|
|
60
|
-
var u=(i=
|
|
61
|
-
/** Writes a value on its child: through the prop, or the attribute until the child is defined. */t.prototype.writeChildValue=function(t,r){var
|
|
60
|
+
var u=(i=a.value)!==null&&i!==void 0?i:a.getAttribute("value");var c=u==null||String(u).trim()===""?NaN:Number(u);var d=t.thumbKeys.get(a);if(d===undefined){d=t.nextThumbKey++;t.thumbKeys.set(a,d)}return{element:a,key:d,name:(s=(n=a.textContent)===null||n===void 0?void 0:n.trim())!==null&&s!==void 0?s:"",rank:(o=r.get(a))!==null&&o!==void 0?o:r.size+e,value:t.normalize(Number.isNaN(c)?t.middle():c)}})).sort((function(t,r){return t.value-r.value||t.rank-r.rank})).map((function(t){var r=t.element,a=t.key,e=t.name,i=t.value;return{element:r,key:a,name:e,value:i}}))};t.prototype.sameThumbs=function(t){var r=this;return t.length===this.thumbs.length&&t.every((function(t,a){var e=t.element,i=t.name,n=t.value;var s=r.thumbs[a];return e===s.element&&i===s.name&&n===s.value}))};
|
|
61
|
+
/** Writes a value on its child: through the prop, or the attribute until the child is defined. */t.prototype.writeChildValue=function(t,r){var a;if((a=globalThis.customElements)===null||a===void 0?void 0:a.get(VALUE_TAG)){t.value=r}else{t.setAttribute("value",String(r))}};t.prototype.writeChildValues=function(t){var r=this;t.forEach((function(t){var a=t.element,e=t.value;if(Number(a.value)!==e)r.writeChildValue(a,e)}))};
|
|
62
62
|
/** Takes a new list of thumbs: their values on the children, in the form and in the event. */t.prototype.updateThumbs=function(t){this.thumbs=t;this.writeChildValues(t);this.updateFormValue();this.emitValues()};
|
|
63
63
|
/**
|
|
64
64
|
* Emits mdsInputRangeValuesChange once per list of values. The first list, the one of load, is
|
|
65
65
|
* recorded without an event: nothing has moved yet.
|
|
66
|
-
*/t.prototype.emitValues=function(){var t=this.thumbs.map((function(t){var r=t.value;return r}));var r=JSON.stringify(t);if(r===this.emittedValues)return;var
|
|
66
|
+
*/t.prototype.emitValues=function(){var t=this.thumbs.map((function(t){var r=t.value;return r}));var r=JSON.stringify(t);if(r===this.emittedValues)return;var a=this.emittedValues===undefined;this.emittedValues=r;if(a)return;this.valuesChangeEvent.emit({values:t})};
|
|
67
67
|
/**
|
|
68
68
|
* Reports the values to the form: the one value without children; with children an entry per
|
|
69
69
|
* value under `name`, in order, as a native `<select multiple>` and `mds-input-select multiple`.
|
|
70
|
-
*/t.prototype.updateFormValue=function(){var t;if(this.thumbs.length===0){setFormValue(this.internals,this.value==null?null:this.value.toString());return}var r=(t=this.name)!==null&&t!==void 0?t:"";if(r===""){setFormValue(this.internals,null);return}var
|
|
71
|
-
/** The values a thumb can take: from the one before it to the one after it, both included. */t.prototype.bounds=function(t){var r=t>0?this.thumbs[t-1].value:this.min;var
|
|
72
|
-
/** Moves a thumb to a value on the step, which stops at its neighbours: it reaches them, never passes them. */t.prototype.moveThumb=function(t,r){var
|
|
70
|
+
*/t.prototype.updateFormValue=function(){var t;if(this.thumbs.length===0){setFormValue(this.internals,this.value==null?null:this.value.toString());return}var r=(t=this.name)!==null&&t!==void 0?t:"";if(r===""){setFormValue(this.internals,null);return}var a=new FormData;this.thumbs.forEach((function(t){var e=t.value;return a.append(r,e.toString())}));setFormValue(this.internals,a)};
|
|
71
|
+
/** The values a thumb can take: from the one before it to the one after it, both included. */t.prototype.bounds=function(t){var r=t>0?this.thumbs[t-1].value:this.min;var a=t<this.thumbs.length-1?this.thumbs[t+1].value:this.max;return[r,a]};t.prototype.thumbInputs=function(){var t,r;return Array.from((r=(t=this.element.shadowRoot)===null||t===void 0?void 0:t.querySelectorAll(".field"))!==null&&r!==void 0?r:[])};
|
|
72
|
+
/** Moves a thumb to a value on the step, which stops at its neighbours: it reaches them, never passes them. */t.prototype.moveThumb=function(t,r){var a=this.bounds(t),e=a[0],i=a[1];var n=Math.min(Math.max(this.normalize(r),e),i);var s=this.thumbInputs()[t];if(s&&Number(s.value)!==n)s.value=String(n);if(n===this.thumbs[t].value)return;this.updateThumbs(this.thumbs.map((function(r,a){return a===t?Object.assign(Object.assign({},r),{value:n}):r})))};
|
|
73
73
|
/**
|
|
74
74
|
* The accessible name of a thumb: the text of its child, as each thumb of the multi-thumb
|
|
75
75
|
* slider of the WAI-ARIA APG; without text, the label of the range and the position of the
|
|
76
76
|
* thumb ("Prezzo, 1 di 2").
|
|
77
|
-
*/t.prototype.thumbName=function(t){var r=this.thumbs[t].name;if(r!=="")return r;var
|
|
77
|
+
*/t.prototype.thumbName=function(t){var r=this.thumbs[t].name;if(r!=="")return r;var a=this.t.get("position",{position:t+1,count:this.thumbs.length});return this.label===""?a:"".concat(this.label,", ").concat(a)};
|
|
78
78
|
/**
|
|
79
79
|
* The values in the header, in order and formatted as the one value: two are an interval,
|
|
80
80
|
* joined by an en dash (U+2013) between spaces, more are a list, joined by a middle dot (U+00B7)
|
|
81
81
|
* between spaces.
|
|
82
|
-
*/t.prototype.displayValues=function(){var t=this;var r=this.thumbs.map((function(r){var
|
|
82
|
+
*/t.prototype.displayValues=function(){var t=this;var r=this.thumbs.map((function(r){var a=r.value;return t.formatted(a)}));return r.join(r.length===2?" – ":" · ")};
|
|
83
|
+
/** A value as the range shows it: through `formatValue`, or as it is. */t.prototype.formatted=function(t){return this.formatValue?this.formatValue(t):String(t)};t.prototype.disabledChanged=function(t){
|
|
83
84
|
/**
|
|
84
85
|
* This is related to ALL disabled attributes set on Magma input components
|
|
85
86
|
* if solved, please check mds-button, mds-input, mds-input-*
|
|
@@ -94,20 +95,26 @@ if(this.thumbs.length>0||this.inputElement==null)return;this.inputElement.value=
|
|
|
94
95
|
/**
|
|
95
96
|
* Like a native input, a form reset brings back the value of load, thumb included; with
|
|
96
97
|
* children, each child gets back its value of load.
|
|
97
|
-
*/t.prototype.formResetCallback=function(){var t=this;if(this.thumbs.length>0){this.thumbs.forEach((function(r){var
|
|
98
|
+
*/t.prototype.formResetCallback=function(){var t=this;if(this.thumbs.length>0){this.thumbs.forEach((function(r){var a=r.element;var e=t.childLoadValues.get(a);if(e!==undefined)t.writeChildValue(a,e)}));this.updateThumbs(this.readThumbs());return}if(this.inputElement==null)return;
|
|
98
99
|
// an empty value makes the native input take its default, the middle of the range
|
|
99
100
|
this.inputElement.value=this.loadValue===undefined?"":String(this.loadValue);this.onInput()};t.prototype.connectedCallback=function(){var t;(t=this.childObserver)===null||t===void 0?void 0:t.disconnect();if(!Build.isBrowser)return;
|
|
100
101
|
// adding or removing a value is adding or removing a child, and a child's value or text
|
|
101
102
|
// can change from code: the range follows them all
|
|
102
103
|
this.childObserver=new MutationObserver(this.syncChildren);this.childObserver.observe(this.element,{attributeFilter:["value"],characterData:true,childList:true,subtree:true});
|
|
103
104
|
// what changed while the range was out of the page
|
|
104
|
-
this.syncChildren()};t.prototype.disconnectedCallback=function(){var t;(t=this.childObserver)===null||t===void 0?void 0:t.disconnect();this.childObserver=undefined};t.prototype.componentWillLoad=function(){var t=this;var r;var
|
|
105
|
+
this.syncChildren()};t.prototype.disconnectedCallback=function(){var t;(t=this.childObserver)===null||t===void 0?void 0:t.disconnect();this.childObserver=undefined};t.prototype.componentWillLoad=function(){var t=this;var r;var a=Number((r=this.value)!==null&&r!==void 0?r:NaN);this.loadValue=Number.isNaN(a)?undefined:a;this.label=this.readLabel();this.thumbs=this.readThumbs();this.thumbs.forEach((function(r){var a=r.element,e=r.value;t.childLoadValues.set(a,e)}))};t.prototype.componentDidLoad=function(){if(this.thumbs.length>0){
|
|
105
106
|
// the values of the children, brought inside the range, go back on them and to the form
|
|
106
107
|
this.updateThumbs(this.thumbs)}else{this.onInput();// define value
|
|
107
108
|
this.calculateProgress()}
|
|
108
109
|
// the values of load, recorded without an event
|
|
109
110
|
this.emitValues();this.loaded=true;
|
|
110
111
|
// the children that came while the range was loading
|
|
111
|
-
this.syncChildren()};t.prototype.componentDidRender=function(){if(!this.singlePending||this.inputElement==null)return;this.singlePending=false;this.onInput();this.calculateProgress()};
|
|
112
|
+
this.syncChildren()};t.prototype.componentDidRender=function(){if(!this.singlePending||this.inputElement==null)return;this.singlePending=false;this.onInput();this.calculateProgress()};
|
|
113
|
+
/**
|
|
114
|
+
* The tip of a value, right after the input of its thumb: the CSS shows it while that input is
|
|
115
|
+
* under the pointer, pressed or focused from the keyboard (`.field:hover + .tip`), and places it
|
|
116
|
+
* from `position`, where the value sits on the track (0 to 100).
|
|
117
|
+
*/t.prototype.renderTip=function(t,r,a){return h("div",{key:a,class:"tip","aria-hidden":"true",style:{"--private-input-range-tip-position":"".concat(t)}},h("span",{class:"tip-bubble"},h("mds-text",{class:"tip-value",typography:"label"},r)),h("span",{class:"tip-arrow"}))};
|
|
118
|
+
/** A native input per thumb, each followed by the tip of its value. */t.prototype.renderThumbs=function(){var t=this;return this.thumbs.map((function(r,a){var e=t.bounds(a),i=e[0],n=e[1];return[h("input",{key:r.key,class:{field:true,"field--held":i===n},type:"range","aria-label":t.thumbName(a),"aria-valuetext":t.formatValue?t.formatValue(r.value):undefined,disabled:t.isDisabled(),max:t.max,min:t.min,onInput:t.onThumbInput,onKeyDown:t.onThumbKeyDown,step:t.allowedStep(),value:r.value}),t.renderTip(t.percent(r.value),t.formatted(r.value),"tip-".concat(r.key))]}))};t.prototype.render=function(){var t=this;var r,a;var e=this.thumbs.length>0;var i=this.thumbs.length>1;var n=this.thumbs[0];var s=this.thumbs[this.thumbs.length-1];
|
|
112
119
|
// the fill runs from the start to the one thumb, or from the first thumb to the last
|
|
113
|
-
var
|
|
120
|
+
var o={"--mds-input-range-progress":"".concat(e?this.percent(s.value):(r=this.progress)!==null&&r!==void 0?r:0)};if(i)o["--private-input-range-progress-start"]="".concat(this.percent(n.value));return h(Host,{key:"26a7ec9fdca1190c60a031c122d4726caba0dc09","pref-animation":preferenceStore.state.animation,"pref-contrast":preferenceStore.state.contrast,"pref-mode":preferenceStore.state.mode,"pref-theme-scheme":preferenceStore.state["theme-scheme"]},h("header",{key:"eac882dc3793792bd88e100e295b70ffcbfc41ea",class:"header",part:"header"},h("mds-text",{key:"4cd4bc7b76cc7014520dd805930900e358ec2876",class:"label",truncate:"word",typography:"label"},h("slot",{key:"28afcfce8b82d8288c8b61e4e461c566c0778c73"})),h("mds-text",{key:"c12a80857ec6ff4961e8a294c3e43c4bbce2cecb",class:"value",typography:"label"},e?this.displayValues():this.formatValue?this.formatValue(this.value):this.value)),h("div",{key:"a1745566763926db65a8daa6dd0f786ebb41bca5",class:{range:true,"range--several":i},role:e?"group":undefined,"aria-label":e&&this.label!==""?this.label:undefined,onPointerDown:this.onTrackPointerDown},h("div",{key:"22a55f00ab4fb181744595ddeef84b48d308e9ce",class:"track",part:"track"},h("div",{key:"27a45042881334d1ec9082c93b209eb306904642",class:"contrast-area"}),h("div",{key:"3a58b1a75392d4c7c907fc1029d7b60d396b1a71",class:"track-total"},h("div",{key:"ea616e7ab8b5084978cb3d8763f5f3c5b49101cf",class:{"track-progress":true,"track-progress--between":i},style:o}))),e?this.renderThumbs():[h("input",{ref:function(r){return t.inputElement=r},class:"field","aria-label":this.label,"aria-valuetext":this.formatValue?this.formatValue(this.value):undefined,disabled:this.isDisabled(),max:this.max,min:this.min,onInput:this.onInput,step:this.step,type:"range",value:this.value,name:this.name}),this.renderTip((a=this.progress)!==null&&a!==void 0?a:0,this.value==null?"":this.formatted(this.value))]))};Object.defineProperty(t,"formAssociated",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:[{disabledChanged:0}],name:[{nameChanged:0}],value:[{valueChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],step:[{stepChanged:0}]}},enumerable:false,configurable:true});return t}();MdsInputRange.style=mdsInputRangeCss();export{MdsInputRange as mds_input_range};
|