ngwr 14.8.0 → 14.9.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/README.md +66 -332
- package/alert/styles/_index.scss +10 -0
- package/avatar/styles/_index.scss +18 -7
- package/badge/styles/_index.scss +7 -0
- package/badge/styles/_tag.scss +7 -1
- package/button/styles/_index.scss +6 -0
- package/cascader/styles/_rules.scss +1 -1
- package/checkbox/styles/_index.scss +4 -0
- package/command-palette/styles/_index.scss +1 -1
- package/divider/styles/_index.scss +2 -0
- package/editor/styles/_index.scss +441 -0
- package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -1
- package/fesm2022/ngwr-action-sheet.mjs +3 -3
- package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-aurora.mjs +3 -3
- package/fesm2022/ngwr-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs +28 -13
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart.mjs +3 -3
- package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text.mjs +3 -3
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +3 -3
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +6 -6
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-burger.mjs.map +1 -1
- package/fesm2022/ngwr-button-testing.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +3 -3
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +4 -4
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +3 -3
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-click-spark.mjs +3 -3
- package/fesm2022/ngwr-click-spark.mjs.map +1 -1
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-clipboard.mjs.map +1 -1
- package/fesm2022/ngwr-collapse-testing.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-collapse.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +6 -6
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-confetti.mjs +3 -3
- package/fesm2022/ngwr-confetti.mjs.map +1 -1
- package/fesm2022/ngwr-config.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-cookie.mjs.map +1 -1
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapters-fns.mjs +3 -3
- package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapters-luxon.mjs +3 -3
- package/fesm2022/ngwr-date-adapters-luxon.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +21 -21
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +3 -3
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text.mjs +3 -3
- package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-density.mjs.map +1 -1
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs.map +1 -1
- package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +15 -15
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +12 -12
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +3 -3
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +6 -6
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +18 -18
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +9 -9
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor-testing.mjs +568 -0
- package/fesm2022/ngwr-editor-testing.mjs.map +1 -0
- package/fesm2022/ngwr-editor.mjs +2601 -0
- package/fesm2022/ngwr-editor.mjs.map +1 -0
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-empty.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +6 -6
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text.mjs +3 -3
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +3 -3
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form-testing.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +9 -9
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +3 -3
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gauge-testing.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +3 -3
- package/fesm2022/ngwr-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text.mjs +3 -3
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +3 -3
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +6 -6
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-hotkey.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +29 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +29 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +29 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +34 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +29 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +29 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +29 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +29 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +29 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +29 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +29 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +29 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +29 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +29 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +29 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +29 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +29 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +29 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +29 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +29 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-TW.mjs +29 -0
- package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +29 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +3 -3
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +3 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +3 -3
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-keyboard.mjs.map +1 -1
- package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +3 -3
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +3 -3
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +6 -6
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-markdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-markdown.mjs +798 -17
- package/fesm2022/ngwr-markdown.mjs.map +1 -1
- package/fesm2022/ngwr-marquee-testing.mjs.map +1 -1
- package/fesm2022/ngwr-marquee.mjs +3 -3
- package/fesm2022/ngwr-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-media.mjs +3 -3
- package/fesm2022/ngwr-media.mjs.map +1 -1
- package/fesm2022/ngwr-mention-testing.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +3 -3
- package/fesm2022/ngwr-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-page-header.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +3 -3
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +21 -21
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-platform.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +6 -6
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +12 -12
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +3 -3
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio-testing.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating-testing.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-rotating-text.mjs +3 -3
- package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +3 -3
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-segmented-testing.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select-testing.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +12 -12
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +6 -6
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +3 -3
- package/fesm2022/ngwr-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor.mjs +3 -3
- package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-split-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-split-text.mjs +3 -3
- package/fesm2022/ngwr-split-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card.mjs +6 -6
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
- package/fesm2022/ngwr-squircle.mjs +6 -6
- package/fesm2022/ngwr-squircle.mjs.map +1 -1
- package/fesm2022/ngwr-star-border-testing.mjs.map +1 -1
- package/fesm2022/ngwr-star-border.mjs +3 -3
- package/fesm2022/ngwr-star-border.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-stepper.mjs +6 -6
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-storage.mjs.map +1 -1
- package/fesm2022/ngwr-switch-testing.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +18 -18
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +3 -3
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +6 -6
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +3 -3
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-theme.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card.mjs +6 -6
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-timeline.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +9 -9
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-toolbar.mjs.map +1 -1
- package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +6 -6
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +3 -3
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +3 -3
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +3 -3
- package/fesm2022/ngwr-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +7 -3
- package/fesm2022/ngwr-typography.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-validators.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-waves-testing.mjs.map +1 -1
- package/fesm2022/ngwr-waves.mjs +3 -3
- package/fesm2022/ngwr-waves.mjs.map +1 -1
- package/fesm2022/ngwr-window-testing.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +12 -12
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/form/styles/_index.scss +5 -0
- package/i18n/ar.json +29 -0
- package/i18n/cs.json +29 -0
- package/i18n/de.json +29 -0
- package/i18n/en.json +29 -0
- package/i18n/es.json +29 -0
- package/i18n/fr.json +29 -0
- package/i18n/he.json +29 -0
- package/i18n/hi.json +29 -0
- package/i18n/id.json +29 -0
- package/i18n/it.json +29 -0
- package/i18n/ja.json +29 -0
- package/i18n/ko.json +29 -0
- package/i18n/nl.json +29 -0
- package/i18n/pl.json +29 -0
- package/i18n/pt.json +29 -0
- package/i18n/ru.json +29 -0
- package/i18n/sv.json +29 -0
- package/i18n/tr.json +29 -0
- package/i18n/uk.json +29 -0
- package/i18n/vi.json +29 -0
- package/i18n/zh-TW.json +29 -0
- package/i18n/zh.json +29 -0
- package/input/styles/_index.scss +5 -1
- package/input-otp/styles/_index.scss +5 -5
- package/llms-full.txt +11 -1
- package/llms.txt +188 -132
- package/mcp/providers.js +2 -2
- package/mcp/server.js +1 -1
- package/overlay/styles/_arrow.scss +3 -0
- package/package.json +43 -2
- package/progress/styles/_index.scss +4 -0
- package/radio/styles/_index.scss +4 -1
- package/schematics/use/symbol-map.json +1 -0
- package/select/styles/_index.scss +3 -3
- package/sidebar/styles/_index.scss +10 -0
- package/skeleton/styles/_index.scss +3 -0
- package/skills/ngwr/SKILL.md +5 -5
- package/skills/ngwr/references/catalog.md +2 -0
- package/skills/ngwr/references/setup.md +3 -3
- package/styles.scss +1 -0
- package/table/styles/_index.scss +7 -0
- package/textarea/styles/_index.scss +12 -3
- package/theme/styles/_colors.scss +39 -13
- package/theme/styles/_contrast.scss +9 -7
- package/toast/styles/_index.scss +4 -0
- package/tree/styles/_index.scss +1 -1
- package/types/ngwr-badge.d.ts +22 -7
- package/types/ngwr-config.d.ts +12 -0
- package/types/ngwr-editor-testing.d.ts +378 -0
- package/types/ngwr-editor.d.ts +449 -0
- package/types/ngwr-markdown.d.ts +61 -2
- package/types/ngwr-typography.d.ts +4 -0
- package/types/ngwr-version.d.ts +1 -1
- package/typography/styles/_index.scss +16 -0
|
@@ -94,6 +94,9 @@
|
|
|
94
94
|
--wr-checkbox-line-height: var(--wr-control-line-height-lg);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
// color-ok: the cue is the tick arriving — `.wr-checkbox__mark` (or a custom
|
|
98
|
+
// `__icon`) goes from `opacity: 0` at 70% scale to full in the nested rule
|
|
99
|
+
// below. The fill only backs it.
|
|
97
100
|
&--checked {
|
|
98
101
|
--wr-checkbox-bg: var(--wr-color-primary);
|
|
99
102
|
--wr-checkbox-border: var(--wr-color-primary);
|
|
@@ -109,6 +112,7 @@
|
|
|
109
112
|
// Indeterminate: same filled box as checked, but reveals the dash. Takes
|
|
110
113
|
// visual precedence over `--checked` (the two classes are mutually exclusive
|
|
111
114
|
// in the host binding).
|
|
115
|
+
// color-ok: the dash arriving is the cue, as the tick is for `--checked`.
|
|
112
116
|
&--indeterminate {
|
|
113
117
|
--wr-checkbox-bg: var(--wr-color-primary);
|
|
114
118
|
--wr-checkbox-border: var(--wr-color-primary);
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
flex: 0 0 var(--wr-divider-aside);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
// color-ok: decoration — a divider separates by being a line, which it is in
|
|
53
|
+
// every intent; the tint marks no state.
|
|
52
54
|
@each $name in theme.$colors {
|
|
53
55
|
&--#{$name} {
|
|
54
56
|
--wr-divider-color: var(--wr-color-#{$name});
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
@use '../../theme/styles' as theme;
|
|
2
|
+
|
|
3
|
+
.wr-editor {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
position: relative;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
|
|
9
|
+
// Defaults — modifiers only reassign these.
|
|
10
|
+
--wr-editor-color: var(--wr-color-on-surface);
|
|
11
|
+
--wr-editor-placeholder: var(--wr-color-placeholder);
|
|
12
|
+
--wr-editor-bg: var(--wr-color-surface);
|
|
13
|
+
--wr-editor-border: var(--wr-color-outline);
|
|
14
|
+
--wr-editor-radius: var(--wr-control-radius-md);
|
|
15
|
+
--wr-editor-ring: transparent;
|
|
16
|
+
--wr-editor-min-height: 8rem;
|
|
17
|
+
--wr-editor-max-height: none;
|
|
18
|
+
--wr-editor-padding-y: 0.5rem;
|
|
19
|
+
--wr-editor-padding-x: var(--wr-control-padding-x-md);
|
|
20
|
+
--wr-editor-font-size: var(--wr-text-sm);
|
|
21
|
+
--wr-editor-line-height: 1.6;
|
|
22
|
+
--wr-editor-toolbar-bg: var(--wr-color-fill-subtle);
|
|
23
|
+
--wr-editor-toolbar-border: var(--wr-color-outline);
|
|
24
|
+
--wr-editor-toolbar-gap: 0.125rem;
|
|
25
|
+
--wr-editor-tool-active-bg: var(--wr-color-primary-soft);
|
|
26
|
+
--wr-editor-tool-active-color: var(--wr-color-primary-ink);
|
|
27
|
+
|
|
28
|
+
background: var(--wr-editor-bg);
|
|
29
|
+
color: var(--wr-editor-color);
|
|
30
|
+
border: 1px solid var(--wr-editor-border);
|
|
31
|
+
@include theme.smooth-br(var(--wr-editor-radius));
|
|
32
|
+
box-shadow: 0 0 0 3px var(--wr-editor-ring);
|
|
33
|
+
transition:
|
|
34
|
+
border-color var(--wr-transition-base),
|
|
35
|
+
box-shadow var(--wr-transition-base),
|
|
36
|
+
background var(--wr-transition-base);
|
|
37
|
+
|
|
38
|
+
&--focused {
|
|
39
|
+
--wr-editor-border: var(--wr-color-primary);
|
|
40
|
+
--wr-editor-ring: rgba(var(--wr-color-primary-rgb), 0.15);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&--readonly &__surface {
|
|
44
|
+
cursor: default;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&--disabled {
|
|
48
|
+
--wr-editor-color: var(--wr-color-on-surface-muted);
|
|
49
|
+
--wr-editor-bg: var(--wr-color-fill);
|
|
50
|
+
cursor: not-allowed;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Toolbar
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
&__toolbar {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-wrap: wrap;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: var(--wr-editor-toolbar-gap);
|
|
62
|
+
padding: 0.25rem;
|
|
63
|
+
border-block-end: 1px solid var(--wr-editor-toolbar-border);
|
|
64
|
+
background: var(--wr-editor-toolbar-bg);
|
|
65
|
+
// The frame's corners, which the toolbar would otherwise square off.
|
|
66
|
+
border-start-start-radius: inherit;
|
|
67
|
+
border-start-end-radius: inherit;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&__separator {
|
|
71
|
+
align-self: stretch;
|
|
72
|
+
inline-size: 1px;
|
|
73
|
+
margin-block: 0.25rem;
|
|
74
|
+
margin-inline: 0.25rem;
|
|
75
|
+
background: var(--wr-editor-toolbar-border);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// A `wr-btn` with its frame taken away until it is hovered or pressed, and
|
|
79
|
+
// squared around its glyph — the label span is the square, since the button's
|
|
80
|
+
// own icon-only rule keys on an empty label and this one holds the SVG.
|
|
81
|
+
//
|
|
82
|
+
// Doubled with `.wr-btn` on purpose: the button's defaults are declared on
|
|
83
|
+
// `.wr-btn` itself, and at equal specificity the winner would depend on which
|
|
84
|
+
// stylesheet an app happened to load last.
|
|
85
|
+
&__tool.wr-btn {
|
|
86
|
+
--wr-btn-bg: transparent;
|
|
87
|
+
--wr-btn-border: transparent;
|
|
88
|
+
padding-inline: calc(var(--wr-btn-padding-y) * var(--wr-density-y, 1));
|
|
89
|
+
|
|
90
|
+
&:hover {
|
|
91
|
+
--wr-btn-bg: var(--wr-color-hover);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&__tool {
|
|
96
|
+
.wr-btn__label {
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
inline-size: var(--wr-btn-line-height);
|
|
101
|
+
block-size: var(--wr-btn-line-height);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// The pressed bar — drawn in every state so the width below is the only
|
|
105
|
+
// thing a modifier changes, and a border so `forced-colors` keeps it.
|
|
106
|
+
&::after {
|
|
107
|
+
position: absolute;
|
|
108
|
+
inset-inline: 0.375rem;
|
|
109
|
+
inset-block-end: 0.1875rem;
|
|
110
|
+
border-block-end: var(--wr-editor-tool-mark, 0) solid currentColor;
|
|
111
|
+
content: '';
|
|
112
|
+
pointer-events: none;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Pressed is told apart by SHAPE as well as tint: the bar under the glyph is
|
|
117
|
+
// the channel a reader who cannot tell the colours apart still sees, and the
|
|
118
|
+
// one `forced-colors` keeps. `aria-pressed` carries it to assistive tech.
|
|
119
|
+
&__tool--active.wr-btn,
|
|
120
|
+
&__tool--active.wr-btn:hover {
|
|
121
|
+
--wr-btn-bg: var(--wr-editor-tool-active-bg);
|
|
122
|
+
--wr-btn-color: var(--wr-editor-tool-active-color);
|
|
123
|
+
--wr-editor-tool-mark: 2px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&__icon {
|
|
127
|
+
inline-size: 1rem;
|
|
128
|
+
block-size: 1rem;
|
|
129
|
+
flex: 0 0 auto;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
// Surface and preview
|
|
134
|
+
// ---------------------------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
// The preview stands in for the surface until ProseMirror mounts, so the two
|
|
137
|
+
// share every metric — the swap must not move a line.
|
|
138
|
+
&__surface,
|
|
139
|
+
&__preview {
|
|
140
|
+
flex: 1 1 auto;
|
|
141
|
+
min-block-size: var(--wr-editor-min-height);
|
|
142
|
+
max-block-size: var(--wr-editor-max-height);
|
|
143
|
+
overflow-y: auto;
|
|
144
|
+
padding: calc(var(--wr-editor-padding-y) * var(--wr-density-y, 1))
|
|
145
|
+
calc(var(--wr-editor-padding-x) * var(--wr-density-x, 1));
|
|
146
|
+
font-family: var(--wr-font-family-base);
|
|
147
|
+
font-size: var(--wr-editor-font-size);
|
|
148
|
+
line-height: var(--wr-editor-line-height);
|
|
149
|
+
text-align: start;
|
|
150
|
+
outline: 0;
|
|
151
|
+
// ProseMirror's own base rules, restated rather than imported: an optional
|
|
152
|
+
// peer's stylesheet cannot be loaded from this entry point, and its copy
|
|
153
|
+
// hard-codes a colour and a physical offset.
|
|
154
|
+
position: relative;
|
|
155
|
+
overflow-wrap: break-word;
|
|
156
|
+
white-space: pre-wrap;
|
|
157
|
+
white-space: break-spaces;
|
|
158
|
+
font-variant-ligatures: none;
|
|
159
|
+
font-feature-settings: 'liga' 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&__surface[hidden] {
|
|
163
|
+
display: none;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&--disabled &__surface {
|
|
167
|
+
cursor: not-allowed;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// The placeholder is a node decoration on the empty paragraph: ProseMirror
|
|
171
|
+
// renders an empty textblock with a trailing `<br>`, so `:empty` never matches.
|
|
172
|
+
// `/ ''` gives the generated text an empty ALTERNATIVE, so assistive tech does
|
|
173
|
+
// not read it as content — `aria-placeholder` on the surface already says it.
|
|
174
|
+
&__placeholder::before {
|
|
175
|
+
float: inline-start;
|
|
176
|
+
block-size: 0;
|
|
177
|
+
color: var(--wr-editor-placeholder);
|
|
178
|
+
// Twice on purpose: an engine that does not know the alternative-text syntax
|
|
179
|
+
// drops the second declaration and keeps the first.
|
|
180
|
+
content: attr(data-placeholder);
|
|
181
|
+
content: attr(data-placeholder) / '';
|
|
182
|
+
pointer-events: none;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// ---------------------------------------------------------------------------
|
|
186
|
+
// Content — the same elements ProseMirror and the preview both render
|
|
187
|
+
// ---------------------------------------------------------------------------
|
|
188
|
+
|
|
189
|
+
&__content {
|
|
190
|
+
> :first-child {
|
|
191
|
+
margin-block-start: 0;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
> :last-child {
|
|
195
|
+
margin-block-end: 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
p {
|
|
199
|
+
margin-block: 0 0.75em;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
h1,
|
|
203
|
+
h2,
|
|
204
|
+
h3 {
|
|
205
|
+
margin-block: 1.25em 0.5em;
|
|
206
|
+
font-weight: var(--wr-font-weight-semibold);
|
|
207
|
+
line-height: 1.3;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
h1 {
|
|
211
|
+
font-size: var(--wr-text-2xl);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
h2 {
|
|
215
|
+
font-size: var(--wr-text-xl);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
h3 {
|
|
219
|
+
font-size: var(--wr-text-lg);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
strong {
|
|
223
|
+
font-weight: var(--wr-font-weight-semibold);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
a {
|
|
227
|
+
color: var(--wr-color-primary-ink);
|
|
228
|
+
text-decoration: underline;
|
|
229
|
+
text-underline-offset: 0.15em;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
code {
|
|
233
|
+
padding: 0.1em 0.3em;
|
|
234
|
+
border-radius: var(--wr-border-radius-sm);
|
|
235
|
+
background: var(--wr-color-fill);
|
|
236
|
+
// `-ink`: code on a tint is text, and the bare colour fails AA there.
|
|
237
|
+
color: var(--wr-color-dark-ink);
|
|
238
|
+
font-family: var(--wr-font-family-mono, ui-monospace, monospace);
|
|
239
|
+
font-size: 0.9em;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
pre {
|
|
243
|
+
margin-block: 0 0.75em;
|
|
244
|
+
padding: 0.75rem;
|
|
245
|
+
overflow-x: auto;
|
|
246
|
+
border-radius: var(--wr-border-radius-base);
|
|
247
|
+
background: var(--wr-color-fill);
|
|
248
|
+
white-space: pre-wrap;
|
|
249
|
+
tab-size: 2;
|
|
250
|
+
// Code is not prose: under RTL `foo();` would be reordered to `;foo()`.
|
|
251
|
+
direction: ltr;
|
|
252
|
+
text-align: left; // rtl-ok: pinned LTR above, so the physical side is the logical one
|
|
253
|
+
|
|
254
|
+
code {
|
|
255
|
+
padding: 0;
|
|
256
|
+
background: none;
|
|
257
|
+
font-size: 0.875em;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
blockquote {
|
|
262
|
+
margin-block: 0 0.75em;
|
|
263
|
+
margin-inline: 0;
|
|
264
|
+
padding-inline-start: 1em;
|
|
265
|
+
border-inline-start: 3px solid var(--wr-color-outline);
|
|
266
|
+
color: var(--wr-color-on-surface-muted);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
ul,
|
|
270
|
+
ol {
|
|
271
|
+
margin-block: 0 0.75em;
|
|
272
|
+
padding-inline-start: 1.5em;
|
|
273
|
+
|
|
274
|
+
ul,
|
|
275
|
+
ol {
|
|
276
|
+
margin-block-end: 0;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
li {
|
|
281
|
+
position: relative;
|
|
282
|
+
margin-block: 0.15em;
|
|
283
|
+
|
|
284
|
+
> p {
|
|
285
|
+
margin-block-end: 0;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
hr {
|
|
290
|
+
margin-block: 1.25em;
|
|
291
|
+
border: 0;
|
|
292
|
+
border-block-start: 1px solid var(--wr-color-outline);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
table {
|
|
296
|
+
border-collapse: collapse;
|
|
297
|
+
width: 100%;
|
|
298
|
+
margin-block: 0 0.75em;
|
|
299
|
+
font-size: var(--wr-text-sm);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
th,
|
|
303
|
+
td {
|
|
304
|
+
padding: 0.375rem 0.625rem;
|
|
305
|
+
border: 1px solid var(--wr-color-outline);
|
|
306
|
+
vertical-align: top;
|
|
307
|
+
|
|
308
|
+
> p {
|
|
309
|
+
margin: 0;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
th {
|
|
314
|
+
background: var(--wr-color-fill-subtle);
|
|
315
|
+
font-weight: var(--wr-font-weight-semibold);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
img {
|
|
319
|
+
max-width: 100%;
|
|
320
|
+
height: auto;
|
|
321
|
+
border-radius: var(--wr-border-radius-sm);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Task items — the box is presentational and the state is read from the words
|
|
326
|
+
// beside it, the way `<wr-markdown>` draws them.
|
|
327
|
+
&__item--task {
|
|
328
|
+
display: flex;
|
|
329
|
+
gap: 0.5em;
|
|
330
|
+
list-style: none;
|
|
331
|
+
margin-inline-start: -1.5em;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
&__task {
|
|
335
|
+
position: relative;
|
|
336
|
+
flex: 0 0 auto;
|
|
337
|
+
inline-size: 1em;
|
|
338
|
+
block-size: 1em;
|
|
339
|
+
margin-block-start: 0.3em;
|
|
340
|
+
border: 1px solid var(--wr-color-outline);
|
|
341
|
+
border-radius: var(--wr-border-radius-sm);
|
|
342
|
+
background: var(--wr-color-surface);
|
|
343
|
+
user-select: none;
|
|
344
|
+
|
|
345
|
+
// color-ok: the nested `&::after` draws a tick out of two borders, and the
|
|
346
|
+
// unchecked box has no pseudo-element at all — the glyph appears, the tint
|
|
347
|
+
// only backs it.
|
|
348
|
+
&--checked {
|
|
349
|
+
border-color: var(--wr-color-primary);
|
|
350
|
+
background: var(--wr-color-primary);
|
|
351
|
+
|
|
352
|
+
&::after {
|
|
353
|
+
position: absolute;
|
|
354
|
+
inset-block-start: 0.12em;
|
|
355
|
+
inset-inline-start: 0.3em;
|
|
356
|
+
width: 0.3em;
|
|
357
|
+
height: 0.55em;
|
|
358
|
+
border: solid var(--wr-color-primary-contrast);
|
|
359
|
+
border-width: 0 2px 2px 0; // rtl-ok: a tick is a glyph, not a layout — mirroring it would draw it backwards
|
|
360
|
+
content: '';
|
|
361
|
+
rotate: 45deg;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
&__task-body {
|
|
367
|
+
flex: 1 1 auto;
|
|
368
|
+
min-width: 0;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
&__sr-only {
|
|
372
|
+
position: absolute;
|
|
373
|
+
width: 1px;
|
|
374
|
+
height: 1px;
|
|
375
|
+
margin: -1px;
|
|
376
|
+
padding: 0;
|
|
377
|
+
overflow: hidden;
|
|
378
|
+
clip: rect(0, 0, 0, 0);
|
|
379
|
+
border: 0;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// ProseMirror's own state classes, which it names and this stylesheet can only
|
|
383
|
+
// answer to — hence the BEM exemption.
|
|
384
|
+
/* stylelint-disable selector-class-pattern */
|
|
385
|
+
&__surface.ProseMirror-hideselection {
|
|
386
|
+
caret-color: transparent;
|
|
387
|
+
|
|
388
|
+
*::selection {
|
|
389
|
+
background: transparent;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
&__surface .ProseMirror-selectednode {
|
|
394
|
+
@include theme.focus-ring;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
&__surface img.ProseMirror-separator {
|
|
398
|
+
display: inline !important;
|
|
399
|
+
border: none !important;
|
|
400
|
+
margin: 0 !important;
|
|
401
|
+
}
|
|
402
|
+
/* stylelint-enable selector-class-pattern */
|
|
403
|
+
|
|
404
|
+
&__surface [draggable][contenteditable='false'] {
|
|
405
|
+
user-select: text;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// ---------------------------------------------------------------------------
|
|
410
|
+
// Link panel — rendered in the overlay container, outside the editor's host,
|
|
411
|
+
// so it is a block of its own.
|
|
412
|
+
// ---------------------------------------------------------------------------
|
|
413
|
+
|
|
414
|
+
.wr-editor-link {
|
|
415
|
+
inline-size: min(22rem, calc(100vw - 2rem));
|
|
416
|
+
|
|
417
|
+
&__body {
|
|
418
|
+
display: flex;
|
|
419
|
+
flex-direction: column;
|
|
420
|
+
gap: 0.5rem;
|
|
421
|
+
padding: 0.75rem;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
&__label {
|
|
425
|
+
font-size: var(--wr-text-sm);
|
|
426
|
+
font-weight: var(--wr-font-weight-medium);
|
|
427
|
+
color: var(--wr-color-on-surface);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
&__error {
|
|
431
|
+
margin: 0;
|
|
432
|
+
font-size: var(--wr-text-xs);
|
|
433
|
+
color: var(--wr-color-danger-ink);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
&__actions {
|
|
437
|
+
display: flex;
|
|
438
|
+
justify-content: flex-end;
|
|
439
|
+
gap: 0.5rem;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-action-sheet-testing.mjs","sources":["../../../projects/lib/action-sheet/testing/wr-action-sheet-action-harness.ts","../../../projects/lib/action-sheet/testing/wr-action-sheet-harness.ts","../../../projects/lib/action-sheet/testing/ngwr-action-sheet-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrActionSheetAction } from 'ngwr/action-sheet';\n\nimport type { WrActionSheetActionHarnessFilters } from './interfaces';\n\n/**\n * Test harness for one row inside a {@link WrActionSheetHarness}.\n *\n * A row is a real `<button>`, not an ARIA-decorated div, so `disabled` is the\n * property rather than an attribute and the CDK refuses to click it — which is the\n * behaviour a spec wants asserted, since the component ALSO checks `disabled`\n * inside its own handler. Either guard alone would keep a disabled row inert; both\n * being there means removing one is invisible until the other is removed too, and\n * {@link click} is where that shows up.\n *\n * **Clicking a row closes the sheet.** The component emits `action` and clears\n * `open` in the same call, so a harness held across a {@link click} is pointed at a\n * detached element the moment it returns — read what you need first, and get a\n * fresh harness afterwards if the sheet was reopened.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrActionSheetActionHarness extends ComponentHarness {\n /** The class every row carries, cancel rows included. */\n static hostSelector = '.wr-action-sheet__action';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrActionSheetActionHarnessFilters = {}): HarnessPredicate<WrActionSheetActionHarness> {\n return new HarnessPredicate(WrActionSheetActionHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('role', options.role, async (harness, role) => (await harness.getRole()) === role)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n /**\n * The row's label, trimmed.\n *\n * Read from `.wr-action-sheet__label` rather than from the button, so a leading\n * icon can never join it. The icon contributes no text today — it is an `<svg>` —\n * but an icon set that ships a `<title>` for its own accessibility would, and the\n * label element is the thing that actually holds the string.\n */\n async getLabel(): Promise<string> {\n return (await this.locatorFor('.wr-action-sheet__label')()).text();\n }\n\n /**\n * The row's visual role, as the component painted it.\n *\n * `default` is returned for a row the caller left unroled, which is what the\n * component does with the value: only `destructive` and `cancel` change anything,\n * and everything else falls through to the plain row. The two modifiers are\n * mutually exclusive by construction — `cancel` rows are filtered into their own\n * group before the destructive class is ever considered — so reading them in\n * either order gives the same answer.\n */\n async getRole(): Promise<NonNullable<WrActionSheetAction['role']>> {\n const host = await this.host();\n if (await host.hasClass('wr-action-sheet__action--cancel')) return 'cancel';\n if (await host.hasClass('wr-action-sheet__action--destructive')) return 'destructive';\n return 'default';\n }\n\n /**\n * Whether the row refuses interaction, from the button's own `disabled` property\n * — the thing the CDK consults before dispatching a click, and the DOM before\n * delivering one.\n *\n * There is no `aria-disabled` to fall back to here, and none is wanted: the row is\n * a native button, where the property already carries the state to assistive tech.\n */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('disabled');\n }\n\n /** Whether the row draws a leading icon. */\n async hasIcon(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-action-sheet__icon')()) !== null;\n }\n\n /**\n * The icon's registered name, or `null` on a row without one.\n *\n * From `wr-icon`'s reflected `data-icon`, which is the only place the name reaches\n * the DOM — the rendered `<svg>` carries no trace of which entry of the set it\n * came from.\n */\n async getIconName(): Promise<string | null> {\n const icon = await this.locatorForOptional('.wr-action-sheet__icon')();\n return icon ? icon.getAttribute('data-icon') : null;\n }\n\n /**\n * Pick this row — emitting `action` and closing the sheet.\n *\n * Throws on a disabled row instead of quietly doing nothing. The click would not\n * land anyway (the DOM swallows it), so the alternative is a spec that reads as\n * \"picked the row\" and asserts a sheet that never moved.\n */\n async click(): Promise<void> {\n if (await this.isDisabled()) {\n throw new Error(\n `WrActionSheetActionHarness.click(): \"${await this.getLabel()}\" is disabled. The DOM swallows a click ` +\n 'on a disabled button and the component checks `disabled` again before emitting, so nothing would ' +\n 'happen — assert isDisabled() instead.'\n );\n }\n await (await this.host()).click();\n }\n\n /** Move keyboard focus to the row. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Whether the row currently holds focus. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrActionSheetActionHarnessFilters, WrActionSheetHarnessFilters } from './interfaces';\nimport { WrActionSheetActionHarness } from './wr-action-sheet-action-harness';\n\n/**\n * One `.wr-action-sheet__group` — internal, and the only way to read the rows of ONE\n * group: a `TestElement` cannot be queried into, so scoping to a child element means\n * a harness anchored on it.\n */\nclass GroupHarness extends ComponentHarness {\n static hostSelector = '.wr-action-sheet__group';\n\n async getLabels(): Promise<string[]> {\n const labels = await this.locatorForAll('.wr-action-sheet__label')();\n return Promise.all(labels.map(label => label.text()));\n }\n}\n\n/**\n * Test harness for an open `<wr-action-sheet>` — the iOS-style bottom sheet of\n * choices.\n *\n * The sheet renders through `<wr-drawer>`, so its rows are in the NGWR overlay\n * container rather than in the fixture: load this from\n * `TestbedHarnessEnvironment.documentRootLoader()`. A fixture-scoped loader finds\n * nothing at all — the `<wr-action-sheet>` host element itself holds no content and\n * the drawer it wraps is `display: none`.\n *\n * The anchor is `.wr-action-sheet`, the sheet's own root inside the drawer panel,\n * which makes each instance self-scoping: two sheets open at once are two hosts, and\n * every query here descends from one of them. That is worth stating because it is\n * NOT how the drawer harness underneath has to work — a drawer publishes no link to\n * the overlay it opened, so `WrDrawerHarness` anchors on the shared pane and scopes\n * by id.\n *\n * **What belongs to the drawer, not here.** Dismissal by backdrop click or by the ✕\n * button, the modal role, the focus trap and the panel's position are all the\n * drawer's surface, and `WrDrawerHarness` from the same root loader answers them.\n * {@link sendEscape} is the one exception, kept because dismissing without choosing\n * is a documented behaviour of the sheet itself: it closes and emits NOTHING, which\n * is the assertion most specs are actually after.\n *\n * @example\n * ```ts\n * const rootLoader = TestbedHarnessEnvironment.documentRootLoader(fixture);\n * const sheet = await rootLoader.getHarness(WrActionSheetHarness);\n *\n * expect(await sheet.getActionLabels()).toEqual(['Take Photo', 'Delete', 'Cancel']);\n * await sheet.select({ label: 'Delete' });\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrActionSheetHarness extends ComponentHarness {\n /** The sheet's root inside the drawer panel. A closed sheet renders none. */\n static hostSelector = '.wr-action-sheet';\n\n /** Build a predicate that narrows the query — sheets can be stacked. */\n static with(options: WrActionSheetHarnessFilters = {}): HarnessPredicate<WrActionSheetHarness> {\n return new HarnessPredicate(WrActionSheetHarness, options)\n .addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title))\n .addOption('message', options.message, (harness, message) =>\n HarnessPredicate.stringMatches(harness.getMessage(), message)\n )\n .addOption('accessibleName', options.accessibleName, (harness, name) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), name)\n );\n }\n\n /**\n * Whether this sheet is still open.\n *\n * A harness can only be obtained while the sheet is open — closing disposes the\n * overlay and everything in it — so this is the answer for a harness you are\n * already HOLDING: it flips to `false` after a pick or a dismissal, where a fresh\n * `getHarnessOrNull()` comes back `null`.\n *\n * Attachment is the test rather than a class, because disposal removes the element\n * without changing anything on it.\n */\n async isOpen(): Promise<boolean> {\n return (await this.host()).matchesSelector('body .wr-action-sheet');\n }\n\n /** The visible heading, or `null` when the sheet was opened without a `title`. */\n async getTitle(): Promise<string | null> {\n const title = await this.locatorForOptional('.wr-action-sheet__title')();\n return title ? title.text() : null;\n }\n\n /** The muted sub-heading, or `null` when the sheet has no `message`. */\n async getMessage(): Promise<string | null> {\n const message = await this.locatorForOptional('.wr-action-sheet__message')();\n return message ? message.text() : null;\n }\n\n /**\n * The name the dialog announces.\n *\n * The sheet always publishes one, and for an untitled sheet it is INVISIBLE: the\n * component renders a screen-reader-only `[wrDrawerTitle]` carrying\n * `actionSheet.label` (English default `Actions`), because a bottom sheet is an\n * `aria-modal` dialog and an unnamed one is announced as nothing at all. Nothing\n * on screen changes when that string is wrong or missing, which is exactly why it\n * is worth an assertion.\n *\n * Read from `.wr-drawer__title` — the class the title directive applies — so the\n * one query answers for both shapes: the visible heading carries it too.\n */\n async getAccessibleName(): Promise<string> {\n return (await this.locatorFor('.wr-drawer__title')()).text();\n }\n\n /** Whether the announced name comes from a visible heading rather than the fallback. */\n async isTitleVisible(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-action-sheet__title')()) !== null;\n }\n\n /**\n * Whether the dialog is actually WIRED to that name — the drawer panel's\n * `aria-labelledby` resolving to this sheet's own title element, and to nothing\n * else on the page.\n *\n * {@link getAccessibleName} only proves a string exists in the markup; a screen\n * reader reads it only if the reference points at it. The two are separate\n * failures and the second is silent: the title renders, the sheet looks right, and\n * the dialog is announced as unnamed. Worth its own assertion because the drawer\n * resolves the reference AFTER attaching the panel rather than while rendering it,\n * so a title that arrives late is named late or not at all.\n *\n * Counted across the document as well, because two panels answering to one id hand\n * every reference to whichever comes first — which is how a second sheet ends up\n * announcing the first one's title.\n */\n async isNamed(): Promise<boolean> {\n const id = await (await this.locatorFor('.wr-drawer__title')()).getAttribute('id');\n if (!id) return false;\n\n const root = this.documentRootLocatorFactory();\n const named = await root.locatorForAll(`[aria-labelledby=\"${id}\"]`)();\n const titles = await root.locatorForAll(`[id=\"${id}\"]`)();\n return named.length === 1 && titles.length === 1;\n }\n\n /** The rows this sheet offers, in DOM order — cancel rows last, in their own group. */\n async getActions(filters: WrActionSheetActionHarnessFilters = {}): Promise<WrActionSheetActionHarness[]> {\n return this.locatorForAll(WrActionSheetActionHarness.with(filters))();\n }\n\n /** The labels of every row, in DOM order. */\n async getActionLabels(): Promise<string[]> {\n const actions = await this.getActions();\n return Promise.all(actions.map(action => action.getLabel()));\n }\n\n /**\n * The labels grouped the way the sheet lays them out: the main group first, then\n * the cancel group when there is one.\n *\n * The grouping is the component's whole visual contract — a `cancel` row is pulled\n * out of the list and pinned to the bottom with a gap above it — and it is\n * invisible to {@link getActionLabels}, which flattens the two. A cancel row that\n * stopped being separated would still come last in DOM order, so the flat list\n * cannot catch it.\n */\n async getActionGroups(): Promise<string[][]> {\n const groups = await this.locatorForAll(GroupHarness)();\n return Promise.all(groups.map(group => group.getLabels()));\n }\n\n /**\n * Whether the sheet drew a separate bottom group — true exactly when at least one\n * row was given `role: 'cancel'`, since the component omits the group entirely\n * rather than rendering an empty one.\n */\n async hasCancelGroup(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-action-sheet__group--cancel')()) !== null;\n }\n\n /**\n * Pick the first row matching the filters.\n *\n * Throws when nothing matches, naming what the sheet does offer — the alternative\n * is a silent no-op followed by an assertion about a sheet that never moved. A\n * disabled match throws too, from the row harness.\n */\n async select(filters: WrActionSheetActionHarnessFilters): Promise<void> {\n const [action] = await this.getActions(filters);\n if (!action) {\n const offered = await this.getActionLabels();\n throw new Error(\n `WrActionSheetHarness.select(): no row matched ${JSON.stringify(filters)}. ` +\n `The sheet offers: ${offered.join(', ')}.`\n );\n }\n await action.click();\n }\n\n /**\n * Press Escape — dismissing the sheet WITHOUT emitting `action`.\n *\n * The key never needs to reach the sheet itself: the drawer underneath listens\n * through the CDK's keyboard dispatcher, which keeps one document listener and\n * hands the event to the top-most overlay. So with sheets stacked this dismisses\n * the top one whichever harness it is called on.\n */\n async sendEscape(): Promise<void> {\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAQH;;;;;;;;;;;;;;;;AAgBG;AACG,MAAO,0BAA2B,SAAQ,gBAAgB,CAAA;;AAE9D,IAAA,OAAO,YAAY,GAAG,0BAA0B;;AAGhD,IAAA,OAAO,IAAI,CAAC,OAAA,GAA6C,EAAE,EAAA;AACzD,QAAA,OAAO,IAAI,gBAAgB,CAAC,0BAA0B,EAAE,OAAO;aAC5D,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,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;IAC5D;AAEA;;;;AAIG;AACH,IAAA,MAAM,cAAc,GAAA;AAClB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,iCAAiC,CAAC,EAAE,MAAM,IAAI;IACtF;AAEA;;;;;;AAMG;IACH,MAAM,MAAM,CAAC,OAA0C,EAAA;QACrD,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QAC/C,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,eAAe,EAAE;YAC5C,MAAM,IAAI,KAAK,CACb,CAAA,8CAAA,EAAiD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA,EAAA,CAAI;gBAC1E,CAAA,kBAAA,EAAqB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAA,CAAG,CAC7C;QACH;AACA,QAAA,MAAM,MAAM,CAAC,KAAK,EAAE;IACtB;AAEA;;;;;;;AAOG;AACH,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACpD;;;ACxNF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-action-sheet-testing.mjs","sources":["../../../projects/lib/action-sheet/testing/wr-action-sheet-action-harness.ts","../../../projects/lib/action-sheet/testing/wr-action-sheet-harness.ts","../../../projects/lib/action-sheet/testing/ngwr-action-sheet-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrActionSheetAction } from 'ngwr/action-sheet';\n\nimport type { WrActionSheetActionHarnessFilters } from './interfaces';\n\n/**\n * Test harness for one row inside a {@link WrActionSheetHarness}.\n *\n * A row is a real `<button>`, not an ARIA-decorated div, so `disabled` is the\n * property rather than an attribute and the CDK refuses to click it — which is the\n * behaviour a spec wants asserted, since the component ALSO checks `disabled`\n * inside its own handler. Either guard alone would keep a disabled row inert; both\n * being there means removing one is invisible until the other is removed too, and\n * {@link click} is where that shows up.\n *\n * **Clicking a row closes the sheet.** The component emits `action` and clears\n * `open` in the same call, so a harness held across a {@link click} is pointed at a\n * detached element the moment it returns — read what you need first, and get a\n * fresh harness afterwards if the sheet was reopened.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrActionSheetActionHarness extends ComponentHarness {\n /** The class every row carries, cancel rows included. */\n static hostSelector = '.wr-action-sheet__action';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrActionSheetActionHarnessFilters = {}): HarnessPredicate<WrActionSheetActionHarness> {\n return new HarnessPredicate(WrActionSheetActionHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('role', options.role, async (harness, role) => (await harness.getRole()) === role)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n /**\n * The row's label, trimmed.\n *\n * Read from `.wr-action-sheet__label` rather than from the button, so a leading\n * icon can never join it. The icon contributes no text today — it is an `<svg>` —\n * but an icon set that ships a `<title>` for its own accessibility would, and the\n * label element is the thing that actually holds the string.\n */\n async getLabel(): Promise<string> {\n return (await this.locatorFor('.wr-action-sheet__label')()).text();\n }\n\n /**\n * The row's visual role, as the component painted it.\n *\n * `default` is returned for a row the caller left unroled, which is what the\n * component does with the value: only `destructive` and `cancel` change anything,\n * and everything else falls through to the plain row. The two modifiers are\n * mutually exclusive by construction — `cancel` rows are filtered into their own\n * group before the destructive class is ever considered — so reading them in\n * either order gives the same answer.\n */\n async getRole(): Promise<NonNullable<WrActionSheetAction['role']>> {\n const host = await this.host();\n if (await host.hasClass('wr-action-sheet__action--cancel')) return 'cancel';\n if (await host.hasClass('wr-action-sheet__action--destructive')) return 'destructive';\n return 'default';\n }\n\n /**\n * Whether the row refuses interaction, from the button's own `disabled` property\n * — the thing the CDK consults before dispatching a click, and the DOM before\n * delivering one.\n *\n * There is no `aria-disabled` to fall back to here, and none is wanted: the row is\n * a native button, where the property already carries the state to assistive tech.\n */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('disabled');\n }\n\n /** Whether the row draws a leading icon. */\n async hasIcon(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-action-sheet__icon')()) !== null;\n }\n\n /**\n * The icon's registered name, or `null` on a row without one.\n *\n * From `wr-icon`'s reflected `data-icon`, which is the only place the name reaches\n * the DOM — the rendered `<svg>` carries no trace of which entry of the set it\n * came from.\n */\n async getIconName(): Promise<string | null> {\n const icon = await this.locatorForOptional('.wr-action-sheet__icon')();\n return icon ? icon.getAttribute('data-icon') : null;\n }\n\n /**\n * Pick this row — emitting `action` and closing the sheet.\n *\n * Throws on a disabled row instead of quietly doing nothing. The click would not\n * land anyway (the DOM swallows it), so the alternative is a spec that reads as\n * \"picked the row\" and asserts a sheet that never moved.\n */\n async click(): Promise<void> {\n if (await this.isDisabled()) {\n throw new Error(\n `WrActionSheetActionHarness.click(): \"${await this.getLabel()}\" is disabled. The DOM swallows a click ` +\n 'on a disabled button and the component checks `disabled` again before emitting, so nothing would ' +\n 'happen — assert isDisabled() instead.'\n );\n }\n await (await this.host()).click();\n }\n\n /** Move keyboard focus to the row. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Whether the row currently holds focus. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrActionSheetActionHarnessFilters, WrActionSheetHarnessFilters } from './interfaces';\nimport { WrActionSheetActionHarness } from './wr-action-sheet-action-harness';\n\n/**\n * One `.wr-action-sheet__group` — internal, and the only way to read the rows of ONE\n * group: a `TestElement` cannot be queried into, so scoping to a child element means\n * a harness anchored on it.\n */\nclass GroupHarness extends ComponentHarness {\n static hostSelector = '.wr-action-sheet__group';\n\n async getLabels(): Promise<string[]> {\n const labels = await this.locatorForAll('.wr-action-sheet__label')();\n return Promise.all(labels.map(label => label.text()));\n }\n}\n\n/**\n * Test harness for an open `<wr-action-sheet>` — the iOS-style bottom sheet of\n * choices.\n *\n * The sheet renders through `<wr-drawer>`, so its rows are in the NGWR overlay\n * container rather than in the fixture: load this from\n * `TestbedHarnessEnvironment.documentRootLoader()`. A fixture-scoped loader finds\n * nothing at all — the `<wr-action-sheet>` host element itself holds no content and\n * the drawer it wraps is `display: none`.\n *\n * The anchor is `.wr-action-sheet`, the sheet's own root inside the drawer panel,\n * which makes each instance self-scoping: two sheets open at once are two hosts, and\n * every query here descends from one of them. That is worth stating because it is\n * NOT how the drawer harness underneath has to work — a drawer publishes no link to\n * the overlay it opened, so `WrDrawerHarness` anchors on the shared pane and scopes\n * by id.\n *\n * **What belongs to the drawer, not here.** Dismissal by backdrop click or by the ✕\n * button, the modal role, the focus trap and the panel's position are all the\n * drawer's surface, and `WrDrawerHarness` from the same root loader answers them.\n * {@link sendEscape} is the one exception, kept because dismissing without choosing\n * is a documented behaviour of the sheet itself: it closes and emits NOTHING, which\n * is the assertion most specs are actually after.\n *\n * @example\n * ```ts\n * const rootLoader = TestbedHarnessEnvironment.documentRootLoader(fixture);\n * const sheet = await rootLoader.getHarness(WrActionSheetHarness);\n *\n * expect(await sheet.getActionLabels()).toEqual(['Take Photo', 'Delete', 'Cancel']);\n * await sheet.select({ label: 'Delete' });\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrActionSheetHarness extends ComponentHarness {\n /** The sheet's root inside the drawer panel. A closed sheet renders none. */\n static hostSelector = '.wr-action-sheet';\n\n /** Build a predicate that narrows the query — sheets can be stacked. */\n static with(options: WrActionSheetHarnessFilters = {}): HarnessPredicate<WrActionSheetHarness> {\n return new HarnessPredicate(WrActionSheetHarness, options)\n .addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title))\n .addOption('message', options.message, (harness, message) =>\n HarnessPredicate.stringMatches(harness.getMessage(), message)\n )\n .addOption('accessibleName', options.accessibleName, (harness, name) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), name)\n );\n }\n\n /**\n * Whether this sheet is still open.\n *\n * A harness can only be obtained while the sheet is open — closing disposes the\n * overlay and everything in it — so this is the answer for a harness you are\n * already HOLDING: it flips to `false` after a pick or a dismissal, where a fresh\n * `getHarnessOrNull()` comes back `null`.\n *\n * Attachment is the test rather than a class, because disposal removes the element\n * without changing anything on it.\n */\n async isOpen(): Promise<boolean> {\n return (await this.host()).matchesSelector('body .wr-action-sheet');\n }\n\n /** The visible heading, or `null` when the sheet was opened without a `title`. */\n async getTitle(): Promise<string | null> {\n const title = await this.locatorForOptional('.wr-action-sheet__title')();\n return title ? title.text() : null;\n }\n\n /** The muted sub-heading, or `null` when the sheet has no `message`. */\n async getMessage(): Promise<string | null> {\n const message = await this.locatorForOptional('.wr-action-sheet__message')();\n return message ? message.text() : null;\n }\n\n /**\n * The name the dialog announces.\n *\n * The sheet always publishes one, and for an untitled sheet it is INVISIBLE: the\n * component renders a screen-reader-only `[wrDrawerTitle]` carrying\n * `actionSheet.label` (English default `Actions`), because a bottom sheet is an\n * `aria-modal` dialog and an unnamed one is announced as nothing at all. Nothing\n * on screen changes when that string is wrong or missing, which is exactly why it\n * is worth an assertion.\n *\n * Read from `.wr-drawer__title` — the class the title directive applies — so the\n * one query answers for both shapes: the visible heading carries it too.\n */\n async getAccessibleName(): Promise<string> {\n return (await this.locatorFor('.wr-drawer__title')()).text();\n }\n\n /** Whether the announced name comes from a visible heading rather than the fallback. */\n async isTitleVisible(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-action-sheet__title')()) !== null;\n }\n\n /**\n * Whether the dialog is actually WIRED to that name — the drawer panel's\n * `aria-labelledby` resolving to this sheet's own title element, and to nothing\n * else on the page.\n *\n * {@link getAccessibleName} only proves a string exists in the markup; a screen\n * reader reads it only if the reference points at it. The two are separate\n * failures and the second is silent: the title renders, the sheet looks right, and\n * the dialog is announced as unnamed. Worth its own assertion because the drawer\n * resolves the reference AFTER attaching the panel rather than while rendering it,\n * so a title that arrives late is named late or not at all.\n *\n * Counted across the document as well, because two panels answering to one id hand\n * every reference to whichever comes first — which is how a second sheet ends up\n * announcing the first one's title.\n */\n async isNamed(): Promise<boolean> {\n const id = await (await this.locatorFor('.wr-drawer__title')()).getAttribute('id');\n if (!id) return false;\n\n const root = this.documentRootLocatorFactory();\n const named = await root.locatorForAll(`[aria-labelledby=\"${id}\"]`)();\n const titles = await root.locatorForAll(`[id=\"${id}\"]`)();\n return named.length === 1 && titles.length === 1;\n }\n\n /** The rows this sheet offers, in DOM order — cancel rows last, in their own group. */\n async getActions(filters: WrActionSheetActionHarnessFilters = {}): Promise<WrActionSheetActionHarness[]> {\n return this.locatorForAll(WrActionSheetActionHarness.with(filters))();\n }\n\n /** The labels of every row, in DOM order. */\n async getActionLabels(): Promise<string[]> {\n const actions = await this.getActions();\n return Promise.all(actions.map(action => action.getLabel()));\n }\n\n /**\n * The labels grouped the way the sheet lays them out: the main group first, then\n * the cancel group when there is one.\n *\n * The grouping is the component's whole visual contract — a `cancel` row is pulled\n * out of the list and pinned to the bottom with a gap above it — and it is\n * invisible to {@link getActionLabels}, which flattens the two. A cancel row that\n * stopped being separated would still come last in DOM order, so the flat list\n * cannot catch it.\n */\n async getActionGroups(): Promise<string[][]> {\n const groups = await this.locatorForAll(GroupHarness)();\n return Promise.all(groups.map(group => group.getLabels()));\n }\n\n /**\n * Whether the sheet drew a separate bottom group — true exactly when at least one\n * row was given `role: 'cancel'`, since the component omits the group entirely\n * rather than rendering an empty one.\n */\n async hasCancelGroup(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-action-sheet__group--cancel')()) !== null;\n }\n\n /**\n * Pick the first row matching the filters.\n *\n * Throws when nothing matches, naming what the sheet does offer — the alternative\n * is a silent no-op followed by an assertion about a sheet that never moved. A\n * disabled match throws too, from the row harness.\n */\n async select(filters: WrActionSheetActionHarnessFilters): Promise<void> {\n const [action] = await this.getActions(filters);\n if (!action) {\n const offered = await this.getActionLabels();\n throw new Error(\n `WrActionSheetHarness.select(): no row matched ${JSON.stringify(filters)}. ` +\n `The sheet offers: ${offered.join(', ')}.`\n );\n }\n await action.click();\n }\n\n /**\n * Press Escape — dismissing the sheet WITHOUT emitting `action`.\n *\n * The key never needs to reach the sheet itself: the drawer underneath listens\n * through the CDK's keyboard dispatcher, which keeps one document listener and\n * hands the event to the top-most overlay. So with sheets stacked this dismisses\n * the top one whichever harness it is called on.\n */\n async sendEscape(): Promise<void> {\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAQH;;;;;;;;;;;;;;;;AAgBG;AACG,MAAO,0BAA2B,SAAQ,gBAAgB,CAAA;;AAE9D,IAAA,OAAO,YAAY,GAAG,0BAA0B;;AAGhD,IAAA,OAAO,IAAI,CAAC,OAAA,GAA6C,EAAE,EAAA;AACzD,QAAA,OAAO,IAAI,gBAAgB,CAAC,0BAA0B,EAAE,OAAO;aAC5D,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC;aAC/G,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,OAAO,EAAE,IAAI,KAAK,CAAC,MAAM,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI;aAC3F,SAAS,CAAC,UAAU,EAAE,OAAO,C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/C,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,eAAe,EAAE;YAC5C,MAAM,IAAI,KAAK,CACb,CAAA,8CAAA,EAAiD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA,EAAA,CAAI;gBAC1E,CAAA,kBAAA,EAAqB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAA,CAAG,CAC7C;QACH;AACA,QAAA,MAAM,MAAM,CAAC,KAAK,EAAE;IACtB;AAEA;;;;;;;AAOG;AACH,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACpD;;;ACxNF;;AAEG;;"}
|
|
@@ -75,10 +75,10 @@ class WrActionSheet {
|
|
|
75
75
|
this.action.emit(item);
|
|
76
76
|
this.open.set(false);
|
|
77
77
|
}
|
|
78
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
79
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
78
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrActionSheet, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
79
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: WrActionSheet, isStandalone: true, selector: "wr-action-sheet", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, titleFallback: { classPropertyName: "titleFallback", publicName: "titleFallback", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", action: "action" }, ngImport: i0, template: "<wr-drawer [(open)]=\"open\" position=\"bottom\" height=\"auto\" rounded showHandle safeArea maxHeight=\"90dvh\">\n <div class=\"wr-action-sheet\">\n @if (title() || message()) {\n <div class=\"wr-action-sheet__header\">\n @if (title()) {\n <div class=\"wr-action-sheet__title\" wrDrawerTitle>{{ title() }}</div>\n }\n @if (message()) {\n <div class=\"wr-action-sheet__message\">{{ message() }}</div>\n }\n </div>\n }\n <!-- The drawer opens as an aria-modal dialog; name it via wrDrawerTitle.\n When there is no visible title, a screen-reader-only fallback keeps the\n dialog from being announced as unnamed. -->\n @if (!title()) {\n <span class=\"wr-action-sheet__sr-only\" wrDrawerTitle>{{ resolvedTitleFallback() }}</span>\n }\n\n <div class=\"wr-action-sheet__group\">\n @for (item of mainActions(); track $index) {\n <button\n type=\"button\"\n class=\"wr-action-sheet__action\"\n [class.wr-action-sheet__action--destructive]=\"item.role === 'destructive'\"\n [disabled]=\"item.disabled\"\n (click)=\"select(item)\"\n >\n @if (item.icon) {\n <wr-icon class=\"wr-action-sheet__icon\" [name]=\"item.icon\" />\n }\n <span class=\"wr-action-sheet__label\">{{ item.label }}</span>\n </button>\n }\n </div>\n\n @if (cancelActions().length) {\n <div class=\"wr-action-sheet__group wr-action-sheet__group--cancel\">\n @for (item of cancelActions(); track $index) {\n <button\n type=\"button\"\n class=\"wr-action-sheet__action wr-action-sheet__action--cancel\"\n [disabled]=\"item.disabled\"\n (click)=\"select(item)\"\n >\n <span class=\"wr-action-sheet__label\">{{ item.label }}</span>\n </button>\n }\n </div>\n }\n </div>\n</wr-drawer>\n", dependencies: [{ kind: "component", type: WrDrawer, selector: "wr-drawer", inputs: ["open", "position", "width", "height", "maxHeight", "rounded", "showHandle", "safeArea", "hasBackdrop", "closeOnBackdropClick", "closeOnEscape", "closable", "closeLabel"], outputs: ["openChange"] }, { kind: "directive", type: WrDrawerTitle, selector: "[wrDrawerTitle]" }, { kind: "component", type: WrIcon, selector: "wr-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
80
80
|
}
|
|
81
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrActionSheet, decorators: [{
|
|
82
82
|
type: Component,
|
|
83
83
|
args: [{ selector: 'wr-action-sheet', encapsulation: ViewEncapsulation.None, imports: [WrDrawer, WrDrawerTitle, WrIcon], template: "<wr-drawer [(open)]=\"open\" position=\"bottom\" height=\"auto\" rounded showHandle safeArea maxHeight=\"90dvh\">\n <div class=\"wr-action-sheet\">\n @if (title() || message()) {\n <div class=\"wr-action-sheet__header\">\n @if (title()) {\n <div class=\"wr-action-sheet__title\" wrDrawerTitle>{{ title() }}</div>\n }\n @if (message()) {\n <div class=\"wr-action-sheet__message\">{{ message() }}</div>\n }\n </div>\n }\n <!-- The drawer opens as an aria-modal dialog; name it via wrDrawerTitle.\n When there is no visible title, a screen-reader-only fallback keeps the\n dialog from being announced as unnamed. -->\n @if (!title()) {\n <span class=\"wr-action-sheet__sr-only\" wrDrawerTitle>{{ resolvedTitleFallback() }}</span>\n }\n\n <div class=\"wr-action-sheet__group\">\n @for (item of mainActions(); track $index) {\n <button\n type=\"button\"\n class=\"wr-action-sheet__action\"\n [class.wr-action-sheet__action--destructive]=\"item.role === 'destructive'\"\n [disabled]=\"item.disabled\"\n (click)=\"select(item)\"\n >\n @if (item.icon) {\n <wr-icon class=\"wr-action-sheet__icon\" [name]=\"item.icon\" />\n }\n <span class=\"wr-action-sheet__label\">{{ item.label }}</span>\n </button>\n }\n </div>\n\n @if (cancelActions().length) {\n <div class=\"wr-action-sheet__group wr-action-sheet__group--cancel\">\n @for (item of cancelActions(); track $index) {\n <button\n type=\"button\"\n class=\"wr-action-sheet__action wr-action-sheet__action--cancel\"\n [disabled]=\"item.disabled\"\n (click)=\"select(item)\"\n >\n <span class=\"wr-action-sheet__label\">{{ item.label }}</span>\n </button>\n }\n </div>\n }\n </div>\n</wr-drawer>\n" }]
|
|
84
84
|
}], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], titleFallback: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleFallback", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], action: [{ type: i0.Output, args: ["action"] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-action-sheet.mjs","sources":["../../../projects/lib/action-sheet/action-sheet.ts","../../../projects/lib/action-sheet/action-sheet.html","../../../projects/lib/action-sheet/ngwr-action-sheet.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, computed, inject, input, model, output } from '@angular/core';\n\nimport { WrDrawer, WrDrawerTitle } from 'ngwr/drawer';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrIcon } from 'ngwr/icon';\nimport { WrHaptics } from 'ngwr/platform';\n\nimport type { WrActionSheetAction } from './interfaces';\n\n/**\n * iOS-style action sheet — a bottom sheet offering a short list of choices.\n * A thin preset over {@link WrDrawer} (bottom position, rounded, grab handle,\n * safe-area padding), driven by data rather than projected content.\n *\n * Pass `actions`; picking one emits `action` and closes the sheet. Rows with\n * `role: 'destructive'` are painted in the danger colour, and `role: 'cancel'`\n * rows drop to a separate group at the bottom. Dismissing via the backdrop,\n * `Escape`, or a swipe-down closes without emitting. Picking fires a light\n * {@link WrHaptics} tick.\n *\n * @example\n * ```html\n * <wr-action-sheet\n * [(open)]=\"sheetOpen\"\n * title=\"Photo\"\n * [actions]=\"[\n * { label: 'Take Photo', icon: 'camera', value: 'camera' },\n * { label: 'Choose from Library', icon: 'image', value: 'library' },\n * { label: 'Delete', role: 'destructive', value: 'delete' },\n * { label: 'Cancel', role: 'cancel' },\n * ]\"\n * (action)=\"onPick($event)\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/action-sheet\n */\n@Component({\n selector: 'wr-action-sheet',\n templateUrl: './action-sheet.html',\n encapsulation: ViewEncapsulation.None,\n imports: [WrDrawer, WrDrawerTitle, WrIcon],\n})\nexport class WrActionSheet {\n private readonly haptics = inject(WrHaptics);\n\n /** Whether the sheet is open. Two-way. @default false */\n readonly open = model<boolean>(false);\n\n /** The rows to offer. */\n readonly actions = input<readonly WrActionSheetAction[]>([]);\n\n /** Optional bold heading above the rows. */\n readonly title = input<string>('');\n\n /**\n * Name announced for the dialog when there is no visible `title`. Falls back to\n * `actionSheet.label`, then `'Actions'` — it used to be that English string,\n * written into the template of a component whose every other string comes from\n * the caller.\n */\n readonly titleFallback = input<string | null>(null);\n\n protected readonly resolvedTitleFallback = useI18nText(this.titleFallback, 'actionSheet.label', 'Actions');\n\n /** Optional muted sub-heading under the title. */\n readonly message = input<string>('');\n\n /** Fires with the chosen row (never fires on a dismiss). */\n readonly action = output<WrActionSheetAction>();\n\n protected readonly mainActions = computed(() => this.actions().filter(a => a.role !== 'cancel'));\n protected readonly cancelActions = computed(() => this.actions().filter(a => a.role === 'cancel'));\n\n protected select(item: WrActionSheetAction): void {\n if (item.disabled) return;\n this.haptics.selection();\n this.action.emit(item);\n this.open.set(false);\n }\n}\n","<wr-drawer [(open)]=\"open\" position=\"bottom\" height=\"auto\" rounded showHandle safeArea maxHeight=\"90dvh\">\n <div class=\"wr-action-sheet\">\n @if (title() || message()) {\n <div class=\"wr-action-sheet__header\">\n @if (title()) {\n <div class=\"wr-action-sheet__title\" wrDrawerTitle>{{ title() }}</div>\n }\n @if (message()) {\n <div class=\"wr-action-sheet__message\">{{ message() }}</div>\n }\n </div>\n }\n <!-- The drawer opens as an aria-modal dialog; name it via wrDrawerTitle.\n When there is no visible title, a screen-reader-only fallback keeps the\n dialog from being announced as unnamed. -->\n @if (!title()) {\n <span class=\"wr-action-sheet__sr-only\" wrDrawerTitle>{{ resolvedTitleFallback() }}</span>\n }\n\n <div class=\"wr-action-sheet__group\">\n @for (item of mainActions(); track $index) {\n <button\n type=\"button\"\n class=\"wr-action-sheet__action\"\n [class.wr-action-sheet__action--destructive]=\"item.role === 'destructive'\"\n [disabled]=\"item.disabled\"\n (click)=\"select(item)\"\n >\n @if (item.icon) {\n <wr-icon class=\"wr-action-sheet__icon\" [name]=\"item.icon\" />\n }\n <span class=\"wr-action-sheet__label\">{{ item.label }}</span>\n </button>\n }\n </div>\n\n @if (cancelActions().length) {\n <div class=\"wr-action-sheet__group wr-action-sheet__group--cancel\">\n @for (item of cancelActions(); track $index) {\n <button\n type=\"button\"\n class=\"wr-action-sheet__action wr-action-sheet__action--cancel\"\n [disabled]=\"item.disabled\"\n (click)=\"select(item)\"\n >\n <span class=\"wr-action-sheet__label\">{{ item.label }}</span>\n </button>\n }\n </div>\n }\n </div>\n</wr-drawer>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;AAKG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;MAOU,aAAa,CAAA;AACP,IAAA,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC;;IAGnC,IAAI,GAAG,KAAK,CAAU,KAAK;6EAAC;;IAG5B,OAAO,GAAG,KAAK,CAAiC,EAAE;gFAAC;;IAGnD,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;AAElC;;;;;AAKG;IACM,aAAa,GAAG,KAAK,CAAgB,IAAI;sFAAC;IAEhC,qBAAqB,GAAG,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,mBAAmB,EAAE,SAAS,CAAC;;IAGjG,OAAO,GAAG,KAAK,CAAS,EAAE;gFAAC;;IAG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,MAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAE9B,aAAa,EAAA,UAAA,EAAA,CAAA;kBANzB,SAAS;+BACE,iBAAiB,EAAA,aAAA,EAEZ,iBAAiB,CAAC,IAAI,EAAA,OAAA,EAC5B,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,CAAC,EAAA,QAAA,EAAA,+6DAAA,EAAA;;;AEhD5C;;AAEG
|
|
1
|
+
{"version":3,"file":"ngwr-action-sheet.mjs","sources":["../../../projects/lib/action-sheet/action-sheet.ts","../../../projects/lib/action-sheet/action-sheet.html","../../../projects/lib/action-sheet/ngwr-action-sheet.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, computed, inject, input, model, output } from '@angular/core';\n\nimport { WrDrawer, WrDrawerTitle } from 'ngwr/drawer';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrIcon } from 'ngwr/icon';\nimport { WrHaptics } from 'ngwr/platform';\n\nimport type { WrActionSheetAction } from './interfaces';\n\n/**\n * iOS-style action sheet — a bottom sheet offering a short list of choices.\n * A thin preset over {@link WrDrawer} (bottom position, rounded, grab handle,\n * safe-area padding), driven by data rather than projected content.\n *\n * Pass `actions`; picking one emits `action` and closes the sheet. Rows with\n * `role: 'destructive'` are painted in the danger colour, and `role: 'cancel'`\n * rows drop to a separate group at the bottom. Dismissing via the backdrop,\n * `Escape`, or a swipe-down closes without emitting. Picking fires a light\n * {@link WrHaptics} tick.\n *\n * @example\n * ```html\n * <wr-action-sheet\n * [(open)]=\"sheetOpen\"\n * title=\"Photo\"\n * [actions]=\"[\n * { label: 'Take Photo', icon: 'camera', value: 'camera' },\n * { label: 'Choose from Library', icon: 'image', value: 'library' },\n * { label: 'Delete', role: 'destructive', value: 'delete' },\n * { label: 'Cancel', role: 'cancel' },\n * ]\"\n * (action)=\"onPick($event)\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/action-sheet\n */\n@Component({\n selector: 'wr-action-sheet',\n templateUrl: './action-sheet.html',\n encapsulation: ViewEncapsulation.None,\n imports: [WrDrawer, WrDrawerTitle, WrIcon],\n})\nexport class WrActionSheet {\n private readonly haptics = inject(WrHaptics);\n\n /** Whether the sheet is open. Two-way. @default false */\n readonly open = model<boolean>(false);\n\n /** The rows to offer. */\n readonly actions = input<readonly WrActionSheetAction[]>([]);\n\n /** Optional bold heading above the rows. */\n readonly title = input<string>('');\n\n /**\n * Name announced for the dialog when there is no visible `title`. Falls back to\n * `actionSheet.label`, then `'Actions'` — it used to be that English string,\n * written into the template of a component whose every other string comes from\n * the caller.\n */\n readonly titleFallback = input<string | null>(null);\n\n protected readonly resolvedTitleFallback = useI18nText(this.titleFallback, 'actionSheet.label', 'Actions');\n\n /** Optional muted sub-heading under the title. */\n readonly message = input<string>('');\n\n /** Fires with the chosen row (never fires on a dismiss). */\n readonly action = output<WrActionSheetAction>();\n\n protected readonly mainActions = computed(() => this.actions().filter(a => a.role !== 'cancel'));\n protected readonly cancelActions = computed(() => this.actions().filter(a => a.role === 'cancel'));\n\n protected select(item: WrActionSheetAction): void {\n if (item.disabled) return;\n this.haptics.selection();\n this.action.emit(item);\n this.open.set(false);\n }\n}\n","<wr-drawer [(open)]=\"open\" position=\"bottom\" height=\"auto\" rounded showHandle safeArea maxHeight=\"90dvh\">\n <div class=\"wr-action-sheet\">\n @if (title() || message()) {\n <div class=\"wr-action-sheet__header\">\n @if (title()) {\n <div class=\"wr-action-sheet__title\" wrDrawerTitle>{{ title() }}</div>\n }\n @if (message()) {\n <div class=\"wr-action-sheet__message\">{{ message() }}</div>\n }\n </div>\n }\n <!-- The drawer opens as an aria-modal dialog; name it via wrDrawerTitle.\n When there is no visible title, a screen-reader-only fallback keeps the\n dialog from being announced as unnamed. -->\n @if (!title()) {\n <span class=\"wr-action-sheet__sr-only\" wrDrawerTitle>{{ resolvedTitleFallback() }}</span>\n }\n\n <div class=\"wr-action-sheet__group\">\n @for (item of mainActions(); track $index) {\n <button\n type=\"button\"\n class=\"wr-action-sheet__action\"\n [class.wr-action-sheet__action--destructive]=\"item.role === 'destructive'\"\n [disabled]=\"item.disabled\"\n (click)=\"select(item)\"\n >\n @if (item.icon) {\n <wr-icon class=\"wr-action-sheet__icon\" [name]=\"item.icon\" />\n }\n <span class=\"wr-action-sheet__label\">{{ item.label }}</span>\n </button>\n }\n </div>\n\n @if (cancelActions().length) {\n <div class=\"wr-action-sheet__group wr-action-sheet__group--cancel\">\n @for (item of cancelActions(); track $index) {\n <button\n type=\"button\"\n class=\"wr-action-sheet__action wr-action-sheet__action--cancel\"\n [disabled]=\"item.disabled\"\n (click)=\"select(item)\"\n >\n <span class=\"wr-action-sheet__label\">{{ item.label }}</span>\n </button>\n }\n </div>\n }\n </div>\n</wr-drawer>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;AAKG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;MAOU,aAAa,CAAA;AACP,IAAA,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC;;IAGnC,IAAI,GAAG,KAAK,CAAU,KAAK;6EAAC;;IAG5B,OAAO,GAAG,KAAK,CAAiC,EAAE;gFAAC;;IAGnD,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;AAElC;;;;;AAKG;IACM,aAAa,GAAG,KAAK,CAAgB,IAAI;sFAAC;IAEhC,qBAAqB,GAAG,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,mBAAmB,EAAE,SAAS,CAAC;;IAGjG,OAAO,GAAG,KAAK,CAAS,EAAE;gFAAC;;IAG3B,MAAM,GAAG,MAAM,EAAuB;IAE5B,WAAW,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAA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