@prolibu-suite/cobalt-core 0.7.0 → 0.8.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/custom-elements.json +8266 -5138
- package/dist/cjs/co-action-bar.cjs.entry.js +89 -0
- package/dist/cjs/co-app-shell.cjs.entry.js +2 -2
- package/dist/cjs/co-audio-player.cjs.entry.js +279 -0
- package/dist/cjs/co-avatar_2.cjs.entry.js +3 -3
- package/dist/cjs/co-badge.cjs.entry.js +1 -1
- package/dist/cjs/co-bottom-sheet.cjs.entry.js +3 -3
- package/dist/cjs/co-breadcrumb-item.cjs.entry.js +2 -2
- package/dist/cjs/co-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/co-button-group.cjs.entry.js +2 -2
- package/dist/cjs/co-button.cjs.entry.js +12 -5
- package/dist/cjs/co-calendar-month_2.cjs.entry.js +1601 -0
- package/dist/cjs/co-calendar_3.cjs.entry.js +9 -9
- package/dist/cjs/co-card.cjs.entry.js +2 -2
- package/dist/cjs/co-carousel-item.cjs.entry.js +1 -1
- package/dist/cjs/co-carousel.cjs.entry.js +3 -3
- package/dist/cjs/co-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/co-chip_2.cjs.entry.js +95 -6
- package/dist/cjs/co-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/co-column-picker.cjs.entry.js +2 -2
- package/dist/cjs/co-data-table-pagination.cjs.entry.js +4 -4
- package/dist/cjs/co-data-table.cjs.entry.js +1 -1
- package/dist/cjs/co-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/co-date-range-picker.cjs.entry.js +2 -2
- package/dist/cjs/co-date-range.cjs.entry.js +1 -1
- package/dist/cjs/co-date-time-picker.cjs.entry.js +409 -0
- package/dist/cjs/co-drive-card.cjs.entry.js +1 -1
- package/dist/cjs/co-drop-zone.cjs.entry.js +1 -1
- package/dist/cjs/co-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/co-event-calendar.cjs.entry.js +118 -17
- package/dist/cjs/co-event-popover.cjs.entry.js +132 -0
- package/dist/cjs/co-fab.cjs.entry.js +2 -2
- package/dist/cjs/co-file-field.cjs.entry.js +5 -5
- package/dist/cjs/co-file-type-tile.cjs.entry.js +2 -2
- package/dist/cjs/co-helper-text.cjs.entry.js +2 -2
- package/dist/cjs/co-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/co-icon.cjs.entry.js +2 -2
- package/dist/cjs/co-json-field.cjs.entry.js +3 -3
- package/dist/cjs/co-lightbox.cjs.entry.js +5 -5
- package/dist/cjs/co-list-footer.cjs.entry.js +1 -1
- package/dist/cjs/co-list-item.cjs.entry.js +4 -4
- package/dist/cjs/co-media-thumb.cjs.entry.js +2 -2
- package/dist/cjs/co-menu-divider.cjs.entry.js +1 -1
- package/dist/cjs/co-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/co-menu.cjs.entry.js +1 -1
- package/dist/cjs/co-modal.cjs.entry.js +2 -2
- package/dist/cjs/co-navbar.cjs.entry.js +2 -2
- package/dist/cjs/co-number-field.cjs.entry.js +2 -2
- package/dist/cjs/co-overlay.cjs.entry.js +1 -1
- package/dist/cjs/co-page-header.cjs.entry.js +1 -1
- package/dist/cjs/co-phone-field.cjs.entry.js +1 -1
- package/dist/cjs/co-popover.cjs.entry.js +1 -1
- package/dist/cjs/co-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/co-progress-circle.cjs.entry.js +2 -2
- package/dist/cjs/co-provider-logo_2.cjs.entry.js +72 -0
- package/dist/cjs/co-radio.cjs.entry.js +3 -3
- package/dist/cjs/co-rating.cjs.entry.js +3 -3
- package/dist/cjs/co-ref-field.cjs.entry.js +6 -2
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +4 -4
- package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/co-row.cjs.entry.js +2 -2
- package/dist/cjs/co-select.cjs.entry.js +1 -1
- package/dist/cjs/co-separator.cjs.entry.js +1 -1
- package/dist/cjs/co-sidebar-nav.cjs.entry.js +12 -2
- package/dist/cjs/co-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/co-slider.cjs.entry.js +2 -2
- package/dist/cjs/co-switch.cjs.entry.js +3 -3
- package/dist/cjs/co-tab-group.cjs.entry.js +19 -3
- package/dist/cjs/co-tab.cjs.entry.js +2 -2
- package/dist/cjs/co-tags-field.cjs.entry.js +5 -5
- package/dist/cjs/co-textarea.cjs.entry.js +4 -4
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +2 -2
- package/dist/cjs/co-toggle-button.cjs.entry.js +2 -2
- package/dist/cjs/co-video.cjs.entry.js +2 -2
- package/dist/cjs/cobalt.cjs.js +1 -1
- package/dist/cjs/{dateI18n-BdiNAl0_.js → dateI18n-wblvKRq_.js} +21 -0
- package/dist/cjs/{dates-D8D-aS5d.js → dates-TQLHlFd2.js} +64 -13
- package/dist/cjs/index-kBiXCEE7.js +28 -12
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{positioning-DwHW399W.js → positioning-DCj_AJ2T.js} +10 -0
- package/dist/cjs/time-LBHtzLHe.js +42 -0
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-616e4286.entry.js → p-00830b8c.entry.js} +1 -1
- package/dist/cobalt/{p-9994fcd8.entry.js → p-0769eee9.entry.js} +1 -1
- package/dist/cobalt/{p-9bf42bf4.entry.js → p-0f18c4d2.entry.js} +1 -1
- package/dist/cobalt/{p-cdedaa82.entry.js → p-0fc1edca.entry.js} +1 -1
- package/dist/cobalt/p-15852fec.entry.js +1 -0
- package/dist/cobalt/{p-eec1c44c.entry.js → p-195c67ee.entry.js} +1 -1
- package/dist/cobalt/{p-B6JZk8fL.js → p-1EK-COrb.js} +1 -1
- package/dist/cobalt/{p-2da09948.entry.js → p-1e9c9d46.entry.js} +1 -1
- package/dist/cobalt/{p-e1b468c1.entry.js → p-20bd3702.entry.js} +1 -1
- package/dist/cobalt/p-25f59046.entry.js +1 -0
- package/dist/cobalt/{p-b06af5c6.entry.js → p-260196cb.entry.js} +1 -1
- package/dist/cobalt/p-2bf44b2b.entry.js +1 -0
- package/dist/cobalt/{p-8155d781.entry.js → p-2c100914.entry.js} +1 -1
- package/dist/cobalt/p-2e1d930f.entry.js +1 -0
- package/dist/cobalt/{p-080f62e4.entry.js → p-35518aee.entry.js} +1 -1
- package/dist/cobalt/{p-28ab9cef.entry.js → p-38ae8bff.entry.js} +1 -1
- package/dist/cobalt/{p-f0a98453.entry.js → p-38cf47b6.entry.js} +1 -1
- package/dist/cobalt/p-39dea0c0.entry.js +1 -0
- package/dist/cobalt/{p-3c681e3a.entry.js → p-3a746267.entry.js} +1 -1
- package/dist/cobalt/p-3ae69426.entry.js +1 -0
- package/dist/cobalt/{p-9211e794.entry.js → p-3d4e697e.entry.js} +1 -1
- package/dist/cobalt/{p-264508ae.entry.js → p-445acc4c.entry.js} +1 -1
- package/dist/cobalt/p-4de9232a.entry.js +1 -0
- package/dist/cobalt/{p-7f78e45c.entry.js → p-50bbfad8.entry.js} +1 -1
- package/dist/cobalt/{p-54f8c68c.entry.js → p-51a1ad38.entry.js} +1 -1
- package/dist/cobalt/{p-75515a8e.entry.js → p-523aca9f.entry.js} +1 -1
- package/dist/cobalt/{p-2f6c7eb5.entry.js → p-52af222b.entry.js} +1 -1
- package/dist/cobalt/{p-0b7359bb.entry.js → p-59f7d44b.entry.js} +1 -1
- package/dist/cobalt/{p-4f615cbd.entry.js → p-5b984323.entry.js} +1 -1
- package/dist/cobalt/{p-8fe5b07e.entry.js → p-5bfaca70.entry.js} +1 -1
- package/dist/cobalt/p-5c1328ff.entry.js +1 -0
- package/dist/cobalt/p-5e21ca17.entry.js +1 -0
- package/dist/cobalt/p-61d5ca3c.entry.js +1 -0
- package/dist/cobalt/{p-64115d66.entry.js → p-6357d9dd.entry.js} +1 -1
- package/dist/cobalt/{p-0a294205.entry.js → p-6985a964.entry.js} +1 -1
- package/dist/cobalt/p-69b8d98e.entry.js +1 -0
- package/dist/cobalt/{p-532baca4.entry.js → p-6b089060.entry.js} +1 -1
- package/dist/cobalt/{p-ceb85838.entry.js → p-6b256d01.entry.js} +1 -1
- package/dist/cobalt/{p-c9528a5f.entry.js → p-7c6b3175.entry.js} +1 -1
- package/dist/cobalt/{p-431cec34.entry.js → p-7d077a7c.entry.js} +1 -1
- package/dist/cobalt/{p-cbac0a11.entry.js → p-7f4bf341.entry.js} +1 -1
- package/dist/cobalt/p-869c338a.entry.js +1 -0
- package/dist/cobalt/p-890296f9.entry.js +1 -0
- package/dist/cobalt/{p-7178113f.entry.js → p-8fe08257.entry.js} +1 -1
- package/dist/cobalt/p-913b2a14.entry.js +1 -0
- package/dist/cobalt/{p-5b84cf37.entry.js → p-959556f4.entry.js} +1 -1
- package/dist/cobalt/{p-331a0108.entry.js → p-99c1ff0f.entry.js} +1 -1
- package/dist/cobalt/p-BMdapAL8.js +1 -0
- package/dist/cobalt/p-BU7SQCje.js +1 -0
- package/dist/cobalt/p-CF8OB_TM.js +1 -0
- package/dist/cobalt/p-CnNpoKwg.js +1 -0
- package/dist/cobalt/{p-ba5c6aa7.entry.js → p-a04feb70.entry.js} +1 -1
- package/dist/cobalt/p-a4f39ba2.entry.js +1 -0
- package/dist/cobalt/{p-d3a1a604.entry.js → p-a7c23027.entry.js} +1 -1
- package/dist/cobalt/p-ab8e150e.entry.js +1 -0
- package/dist/cobalt/{p-69ce2269.entry.js → p-acdb68a7.entry.js} +1 -1
- package/dist/cobalt/{p-3b9be8a8.entry.js → p-afd957c0.entry.js} +1 -1
- package/dist/cobalt/{p-c3004e1c.entry.js → p-b45ea918.entry.js} +1 -1
- package/dist/cobalt/{p-eeed80ac.entry.js → p-bad7ce84.entry.js} +1 -1
- package/dist/cobalt/{p-bcd38114.entry.js → p-bebacee2.entry.js} +1 -1
- package/dist/cobalt/{p-ec9dd3a3.entry.js → p-c32949a5.entry.js} +1 -1
- package/dist/cobalt/p-cd5555d2.entry.js +1 -0
- package/dist/cobalt/p-cd96aabf.entry.js +1 -0
- package/dist/cobalt/{p-2661557c.entry.js → p-ce961fba.entry.js} +1 -1
- package/dist/cobalt/p-d56b8a1f.entry.js +1 -0
- package/dist/cobalt/{p-c7d9ff39.entry.js → p-d6fff135.entry.js} +1 -1
- package/dist/cobalt/{p-6b38e8fb.entry.js → p-d71b87d3.entry.js} +1 -1
- package/dist/cobalt/{p-ff581807.entry.js → p-d83e5189.entry.js} +1 -1
- package/dist/cobalt/{p-741cf623.entry.js → p-dc269096.entry.js} +1 -1
- package/dist/cobalt/{p-e4555fda.entry.js → p-dc8e88f4.entry.js} +1 -1
- package/dist/cobalt/p-de5a05fc.entry.js +1 -0
- package/dist/cobalt/{p-0110108f.entry.js → p-df63f23c.entry.js} +1 -1
- package/dist/cobalt/{p-9fab9c1f.entry.js → p-e2188319.entry.js} +1 -1
- package/dist/cobalt/p-f0c589ad.entry.js +1 -0
- package/dist/cobalt/p-f4370423.entry.js +1 -0
- package/dist/cobalt/{p-b87a2e7a.entry.js → p-f4e4bebf.entry.js} +1 -1
- package/dist/cobalt/p-f53b9536.entry.js +1 -0
- package/dist/cobalt/{p-bb00ae4a.entry.js → p-f7ae0228.entry.js} +1 -1
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/co-action-bar/co-action-bar.css +148 -0
- package/dist/collection/components/co-action-bar/co-action-bar.js +247 -0
- package/dist/collection/components/co-app-shell/co-app-shell.js +2 -2
- package/dist/collection/components/co-audio-player/co-audio-player.css +58 -0
- package/dist/collection/components/co-audio-player/co-audio-player.js +453 -0
- package/dist/collection/components/co-audio-player/co-audio-player.utils.js +44 -0
- package/dist/collection/components/co-badge/co-badge.js +1 -1
- package/dist/collection/components/co-bottom-sheet/co-bottom-sheet.js +3 -3
- package/dist/collection/components/co-breadcrumb/co-breadcrumb.js +1 -1
- package/dist/collection/components/co-breadcrumb-item/co-breadcrumb-item.js +2 -2
- package/dist/collection/components/co-button/co-button.css +19 -0
- package/dist/collection/components/co-button/co-button.js +31 -5
- package/dist/collection/components/co-button-group/co-button-group.js +2 -2
- package/dist/collection/components/co-calendar/co-calendar.js +1 -1
- package/dist/collection/components/co-calendar-month/co-calendar-month.css +52 -3
- package/dist/collection/components/co-calendar-month/co-calendar-month.js +238 -55
- package/dist/collection/components/co-calendar-timegrid/co-calendar-timegrid.css +265 -0
- package/dist/collection/components/co-calendar-timegrid/co-calendar-timegrid.js +1305 -0
- package/dist/collection/components/co-card/co-card.js +2 -2
- package/dist/collection/components/co-carousel/co-carousel.js +2 -2
- package/dist/collection/components/co-carousel-item/co-carousel-item.js +1 -1
- package/dist/collection/components/co-checkbox/co-checkbox.css +1 -1
- package/dist/collection/components/co-checkbox/co-checkbox.js +3 -3
- package/dist/collection/components/co-chip/co-chip.js +2 -2
- package/dist/collection/components/co-color-picker/co-color-picker.js +2 -2
- package/dist/collection/components/co-column-picker/co-column-picker.js +2 -2
- package/dist/collection/components/co-data-table/co-data-table.css +4 -4
- package/dist/collection/components/co-data-table-pagination/co-data-table-pagination.js +4 -4
- package/dist/collection/components/co-date-field/co-date-field.js +4 -4
- package/dist/collection/components/co-date-range/co-date-range.js +1 -1
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.css +325 -0
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.js +1079 -0
- package/dist/collection/components/co-drawer/co-drawer.css +46 -0
- package/dist/collection/components/co-drawer/co-drawer.js +1 -1
- package/dist/collection/components/co-drive-card/co-drive-card.js +1 -1
- package/dist/collection/components/co-drop-zone/co-drop-zone.js +1 -1
- package/dist/collection/components/co-empty-state/co-empty-state.js +2 -2
- package/dist/collection/components/co-event-calendar/co-event-calendar.css +19 -7
- package/dist/collection/components/co-event-calendar/co-event-calendar.js +342 -39
- package/dist/collection/components/co-event-popover/co-event-popover.css +26 -0
- package/dist/collection/components/co-event-popover/co-event-popover.js +326 -0
- package/dist/collection/components/co-fab/co-fab.js +2 -2
- package/dist/collection/components/co-file-field/co-file-field.js +5 -5
- package/dist/collection/components/co-file-type-tile/co-file-type-tile.js +2 -2
- package/dist/collection/components/co-helper-text/co-helper-text.js +2 -2
- package/dist/collection/components/co-icon/co-icon.js +2 -2
- package/dist/collection/components/co-icon-button/co-icon-button.js +1 -1
- package/dist/collection/components/co-json-field/co-json-field.js +3 -3
- package/dist/collection/components/co-lightbox/co-lightbox.js +4 -4
- package/dist/collection/components/co-list-footer/co-list-footer.js +1 -1
- package/dist/collection/components/co-list-item/co-list-item.js +4 -4
- package/dist/collection/components/co-media-thumb/co-media-thumb.js +2 -2
- package/dist/collection/components/co-menu/co-menu.js +1 -1
- package/dist/collection/components/co-menu-divider/co-menu-divider.js +1 -1
- package/dist/collection/components/co-menu-item/co-menu-item.css +21 -0
- package/dist/collection/components/co-menu-item/co-menu-item.js +20 -1
- package/dist/collection/components/co-modal/co-modal.js +2 -2
- package/dist/collection/components/co-navbar/co-navbar.js +2 -2
- package/dist/collection/components/co-number-field/co-number-field.js +2 -2
- package/dist/collection/components/co-option-list/co-option-list.css +18 -0
- package/dist/collection/components/co-option-list/co-option-list.js +127 -5
- package/dist/collection/components/co-option-list/optionListLogic.js +13 -0
- package/dist/collection/components/co-overlay/co-overlay.js +1 -1
- package/dist/collection/components/co-page-header/co-page-header.js +1 -1
- package/dist/collection/components/co-phone-field/co-phone-field.js +1 -1
- package/dist/collection/components/co-progress-bar/co-progress-bar.js +2 -2
- package/dist/collection/components/co-progress-circle/co-progress-circle.js +2 -2
- package/dist/collection/components/co-provider-logo/co-provider-logo.css +23 -0
- package/dist/collection/components/co-provider-logo/co-provider-logo.js +124 -0
- package/dist/collection/components/co-radio/co-radio.js +3 -3
- package/dist/collection/components/co-rating/co-rating.js +3 -3
- package/dist/collection/components/co-ref-field/co-ref-field.js +6 -2
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.css +11 -0
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +3 -3
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.css +8 -0
- package/dist/collection/components/co-row/co-row.js +2 -2
- package/dist/collection/components/co-select/co-select.js +1 -1
- package/dist/collection/components/co-separator/co-separator.js +1 -1
- package/dist/collection/components/co-sidebar/co-sidebar.js +2 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +12 -2
- package/dist/collection/components/co-skeleton/co-skeleton.js +1 -1
- package/dist/collection/components/co-slider/co-slider.js +2 -2
- package/dist/collection/components/co-switch/co-switch.js +3 -3
- package/dist/collection/components/co-tab/co-tab.js +2 -2
- package/dist/collection/components/co-tab-group/co-tab-group.css +25 -0
- package/dist/collection/components/co-tab-group/co-tab-group.js +18 -2
- package/dist/collection/components/co-tags-field/co-tags-field.js +5 -5
- package/dist/collection/components/co-textarea/co-textarea.js +4 -4
- package/dist/collection/components/co-toggle-button/co-toggle-button.js +2 -2
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +2 -2
- package/dist/collection/components/co-tooltip/co-tooltip.js +2 -2
- package/dist/collection/components/co-video/co-video.js +2 -2
- package/dist/collection/utils/dateI18n.js +21 -0
- package/dist/collection/utils/eventColor.js +52 -0
- package/dist/collection/utils/positioning.js +10 -0
- package/dist/components/co-accordion.js +1 -1
- package/dist/components/co-action-bar.d.ts +11 -0
- package/dist/components/co-action-bar.js +1 -0
- package/dist/components/co-app-shell.js +1 -1
- package/dist/components/co-audio-player.d.ts +11 -0
- package/dist/components/co-audio-player.js +1 -0
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-avatar-group.js +1 -1
- package/dist/components/co-avatar.js +1 -1
- package/dist/components/co-badge.js +1 -1
- package/dist/components/co-bottom-sheet.js +1 -1
- package/dist/components/co-breadcrumb-item.js +1 -1
- package/dist/components/co-breadcrumb.js +1 -1
- package/dist/components/co-button-group.js +1 -1
- package/dist/components/co-button.js +1 -1
- package/dist/components/co-calendar-month.js +1 -1
- package/dist/components/co-calendar-timegrid.d.ts +11 -0
- package/dist/components/co-calendar-timegrid.js +1 -0
- package/dist/components/co-calendar.js +1 -1
- package/dist/components/co-card.js +1 -1
- package/dist/components/co-carousel-item.js +1 -1
- package/dist/components/co-carousel.js +1 -1
- package/dist/components/co-checkbox-group.js +1 -1
- package/dist/components/co-checkbox.js +1 -1
- package/dist/components/co-chip.js +1 -1
- package/dist/components/co-color-picker.js +1 -1
- package/dist/components/co-column-picker.js +1 -1
- package/dist/components/co-combobox.js +1 -1
- package/dist/components/co-command-search.js +1 -1
- package/dist/components/co-data-table-pagination.js +1 -1
- package/dist/components/co-data-table.js +1 -1
- package/dist/components/co-date-field.js +1 -1
- package/dist/components/co-date-picker.js +1 -1
- package/dist/components/co-date-range-picker.js +1 -1
- package/dist/components/co-date-range.js +1 -1
- package/dist/components/co-date-time-picker.d.ts +11 -0
- package/dist/components/co-date-time-picker.js +1 -0
- package/dist/components/co-drawer.js +1 -1
- package/dist/components/co-drive-card.js +1 -1
- package/dist/components/co-drop-zone.js +1 -1
- package/dist/components/co-empty-state.js +1 -1
- package/dist/components/co-event-calendar.js +1 -1
- package/dist/components/co-event-popover.d.ts +11 -0
- package/dist/components/co-event-popover.js +1 -0
- package/dist/components/co-fab.js +1 -1
- package/dist/components/co-file-field.js +1 -1
- package/dist/components/co-file-type-tile.js +1 -1
- package/dist/components/co-helper-text.js +1 -1
- package/dist/components/co-icon-button.js +1 -1
- package/dist/components/co-icon.js +1 -1
- package/dist/components/co-input.js +1 -1
- package/dist/components/co-json-field.js +1 -1
- package/dist/components/co-lightbox.js +1 -1
- package/dist/components/co-list-footer.js +1 -1
- package/dist/components/co-list-item.js +1 -1
- package/dist/components/co-media-thumb.js +1 -1
- package/dist/components/co-menu-divider.js +1 -1
- package/dist/components/co-menu-item.js +1 -1
- package/dist/components/co-menu.js +1 -1
- package/dist/components/co-modal.js +1 -1
- package/dist/components/co-navbar.js +1 -1
- package/dist/components/co-number-field.js +1 -1
- package/dist/components/co-option-list.js +1 -1
- package/dist/components/co-overlay.js +1 -1
- package/dist/components/co-page-header.js +1 -1
- package/dist/components/co-phone-field.js +1 -1
- package/dist/components/co-popover.js +1 -1
- package/dist/components/co-progress-bar.js +1 -1
- package/dist/components/co-progress-circle.js +1 -1
- package/dist/components/co-provider-logo.d.ts +11 -0
- package/dist/components/co-provider-logo.js +1 -0
- package/dist/components/co-radio-group.js +1 -1
- package/dist/components/co-radio.js +1 -1
- package/dist/components/co-rating.js +1 -1
- package/dist/components/co-ref-field.js +1 -1
- package/dist/components/co-rich-text-editor.js +1 -1
- package/dist/components/co-rich-text-toolbar.js +1 -1
- package/dist/components/co-row.js +1 -1
- package/dist/components/co-select.js +1 -1
- package/dist/components/co-separator.js +1 -1
- package/dist/components/co-sidebar-nav.js +1 -1
- package/dist/components/co-sidebar.js +1 -1
- package/dist/components/co-skeleton.js +1 -1
- package/dist/components/co-slider.js +1 -1
- package/dist/components/co-switch.js +1 -1
- package/dist/components/co-tab-group.js +1 -1
- package/dist/components/co-tab.js +1 -1
- package/dist/components/co-tags-field.js +1 -1
- package/dist/components/co-textarea.js +1 -1
- package/dist/components/co-toast.js +1 -1
- package/dist/components/co-toggle-button-group.js +1 -1
- package/dist/components/co-toggle-button.js +1 -1
- package/dist/components/co-tooltip.js +1 -1
- package/dist/components/co-transfer-list.js +1 -1
- package/dist/components/co-video.js +1 -1
- package/dist/components/p-B21rOC2Y.js +1 -0
- package/dist/components/{p-Cd3inFSL.js → p-BC6sxVVr.js} +1 -1
- package/dist/components/p-BMdapAL8.js +1 -0
- package/dist/components/p-BQFperIX.js +1 -0
- package/dist/components/{p-CQ-8domm.js → p-BXtiFFM2.js} +1 -1
- package/dist/components/{p-CmCsm4L-.js → p-BdArvV6T.js} +1 -1
- package/dist/components/p-BnkGlFYy.js +1 -0
- package/dist/components/p-C-5cLeKr.js +1 -0
- package/dist/components/p-CDWXNRpo.js +1 -0
- package/dist/components/p-CF8OB_TM.js +1 -0
- package/dist/components/{p-oV_1MoAN.js → p-CIWoKlGj.js} +1 -1
- package/dist/components/{p-Bul6EdDX.js → p-CVCEiwOS.js} +1 -1
- package/dist/components/{p-B0b9Etx4.js → p-CfeNhAHW.js} +1 -1
- package/dist/components/p-Ch837Ggl.js +1 -0
- package/dist/components/p-ChLib-si.js +1 -0
- package/dist/components/{p-DfpOEXHC.js → p-ChPooamL.js} +1 -1
- package/dist/components/p-CnNpoKwg.js +1 -0
- package/dist/components/{p-B7Yv00g9.js → p-D-3BTFRs.js} +1 -1
- package/dist/components/p-D0wrmRH8.js +1 -0
- package/dist/components/p-DZX7cEqP.js +1 -0
- package/dist/components/{p-B3U63yZw.js → p-DbISGXT_.js} +1 -1
- package/dist/components/p-Dxa7c4Ap.js +1 -0
- package/dist/components/p-T0MdU7sb.js +1 -0
- package/dist/components/{p-DwwxS5bY.js → p-W8Y8ZuPs.js} +1 -1
- package/dist/components/{p-9aNhJfTT.js → p-cteJszd-.js} +1 -1
- package/dist/components/p-e5KibEs8.js +1 -0
- package/dist/components/{p-Bzg5FPSA.js → p-mUoTCiYa.js} +1 -1
- package/dist/components/p-uZ2D6ESV.js +1 -0
- package/dist/components/{p-BtpRnpaF.js → p-ySi6UG0O.js} +1 -1
- package/dist/esm/co-action-bar.entry.js +87 -0
- package/dist/esm/co-app-shell.entry.js +2 -2
- package/dist/esm/co-audio-player.entry.js +277 -0
- package/dist/esm/co-avatar_2.entry.js +3 -3
- package/dist/esm/co-badge.entry.js +1 -1
- package/dist/esm/co-bottom-sheet.entry.js +3 -3
- package/dist/esm/co-breadcrumb-item.entry.js +2 -2
- package/dist/esm/co-breadcrumb.entry.js +1 -1
- package/dist/esm/co-button-group.entry.js +2 -2
- package/dist/esm/co-button.entry.js +12 -5
- package/dist/esm/co-calendar-month_2.entry.js +1598 -0
- package/dist/esm/co-calendar_3.entry.js +9 -9
- package/dist/esm/co-card.entry.js +2 -2
- package/dist/esm/co-carousel-item.entry.js +1 -1
- package/dist/esm/co-carousel.entry.js +3 -3
- package/dist/esm/co-checkbox.entry.js +4 -4
- package/dist/esm/co-chip_2.entry.js +95 -6
- package/dist/esm/co-color-picker.entry.js +2 -2
- package/dist/esm/co-column-picker.entry.js +2 -2
- package/dist/esm/co-data-table-pagination.entry.js +4 -4
- package/dist/esm/co-data-table.entry.js +1 -1
- package/dist/esm/co-date-picker.entry.js +1 -1
- package/dist/esm/co-date-range-picker.entry.js +2 -2
- package/dist/esm/co-date-range.entry.js +1 -1
- package/dist/esm/co-date-time-picker.entry.js +407 -0
- package/dist/esm/co-drive-card.entry.js +1 -1
- package/dist/esm/co-drop-zone.entry.js +1 -1
- package/dist/esm/co-empty-state.entry.js +2 -2
- package/dist/esm/co-event-calendar.entry.js +120 -19
- package/dist/esm/co-event-popover.entry.js +130 -0
- package/dist/esm/co-fab.entry.js +2 -2
- package/dist/esm/co-file-field.entry.js +5 -5
- package/dist/esm/co-file-type-tile.entry.js +2 -2
- package/dist/esm/co-helper-text.entry.js +2 -2
- package/dist/esm/co-icon-button.entry.js +1 -1
- package/dist/esm/co-icon.entry.js +2 -2
- package/dist/esm/co-json-field.entry.js +3 -3
- package/dist/esm/co-lightbox.entry.js +5 -5
- package/dist/esm/co-list-footer.entry.js +1 -1
- package/dist/esm/co-list-item.entry.js +4 -4
- package/dist/esm/co-media-thumb.entry.js +2 -2
- package/dist/esm/co-menu-divider.entry.js +1 -1
- package/dist/esm/co-menu-item.entry.js +2 -2
- package/dist/esm/co-menu.entry.js +1 -1
- package/dist/esm/co-modal.entry.js +2 -2
- package/dist/esm/co-navbar.entry.js +2 -2
- package/dist/esm/co-number-field.entry.js +2 -2
- package/dist/esm/co-overlay.entry.js +1 -1
- package/dist/esm/co-page-header.entry.js +1 -1
- package/dist/esm/co-phone-field.entry.js +1 -1
- package/dist/esm/co-popover.entry.js +1 -1
- package/dist/esm/co-progress-bar.entry.js +2 -2
- package/dist/esm/co-progress-circle.entry.js +2 -2
- package/dist/esm/co-provider-logo_2.entry.js +69 -0
- package/dist/esm/co-radio.entry.js +3 -3
- package/dist/esm/co-rating.entry.js +3 -3
- package/dist/esm/co-ref-field.entry.js +6 -2
- package/dist/esm/co-rich-text-editor.entry.js +4 -4
- package/dist/esm/co-rich-text-toolbar.entry.js +1 -1
- package/dist/esm/co-row.entry.js +2 -2
- package/dist/esm/co-select.entry.js +1 -1
- package/dist/esm/co-separator.entry.js +1 -1
- package/dist/esm/co-sidebar-nav.entry.js +12 -2
- package/dist/esm/co-sidebar.entry.js +2 -2
- package/dist/esm/co-slider.entry.js +2 -2
- package/dist/esm/co-switch.entry.js +3 -3
- package/dist/esm/co-tab-group.entry.js +19 -3
- package/dist/esm/co-tab.entry.js +2 -2
- package/dist/esm/co-tags-field.entry.js +5 -5
- package/dist/esm/co-textarea.entry.js +4 -4
- package/dist/esm/co-toggle-button-group.entry.js +2 -2
- package/dist/esm/co-toggle-button.entry.js +2 -2
- package/dist/esm/co-video.entry.js +2 -2
- package/dist/esm/cobalt.js +1 -1
- package/dist/esm/{dateI18n-C1DCLOEl.js → dateI18n-CnNpoKwg.js} +21 -0
- package/dist/esm/{dates-tPYikBRJ.js → dates-BU7SQCje.js} +64 -13
- package/dist/esm/index-BCEz3S-z.js +28 -12
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{positioning-C2mZ7x_Y.js → positioning-BMdapAL8.js} +10 -0
- package/dist/esm/time-CF8OB_TM.js +37 -0
- package/dist/esm/{tz-B6JZk8fL.js → tz-1EK-COrb.js} +1 -1
- package/dist/types/components/co-action-bar/co-action-bar.d.ts +66 -0
- package/dist/types/components/co-audio-player/co-audio-player.d.ts +62 -0
- package/dist/types/components/co-audio-player/co-audio-player.utils.d.ts +11 -0
- package/dist/types/components/co-button/co-button.d.ts +18 -1
- package/dist/types/components/co-calendar-month/co-calendar-month.d.ts +33 -1
- package/dist/types/components/co-calendar-timegrid/co-calendar-timegrid.d.ts +178 -0
- package/dist/types/components/co-date-time-picker/co-date-time-picker.d.ts +131 -0
- package/dist/types/components/co-event-calendar/co-event-calendar.d.ts +61 -8
- package/dist/types/components/co-event-popover/co-event-popover.d.ts +45 -0
- package/dist/types/components/co-menu-item/co-menu-item.d.ts +3 -0
- package/dist/types/components/co-option-list/co-option-list.d.ts +23 -0
- package/dist/types/components/co-option-list/optionListLogic.d.ts +3 -0
- package/dist/types/components/co-provider-logo/co-provider-logo.d.ts +17 -0
- package/dist/types/components/co-ref-field/co-ref-field.d.ts +1 -0
- package/dist/types/components/co-tab-group/co-tab-group.d.ts +5 -0
- package/dist/types/components.d.ts +1245 -76
- package/dist/types/utils/dateI18n.d.ts +7 -0
- package/dist/types/utils/eventColor.d.ts +20 -0
- package/package.json +2 -2
- package/dist/cjs/co-calendar-month.cjs.entry.js +0 -381
- package/dist/cjs/co-skeleton.cjs.entry.js +0 -26
- package/dist/cobalt/p-037cc571.entry.js +0 -1
- package/dist/cobalt/p-0b92167a.entry.js +0 -1
- package/dist/cobalt/p-0bc5a962.entry.js +0 -1
- package/dist/cobalt/p-30c80e3a.entry.js +0 -1
- package/dist/cobalt/p-36ad3a96.entry.js +0 -1
- package/dist/cobalt/p-3ecbbe93.entry.js +0 -1
- package/dist/cobalt/p-3f1030fb.entry.js +0 -1
- package/dist/cobalt/p-3f7215e7.entry.js +0 -1
- package/dist/cobalt/p-54857f78.entry.js +0 -1
- package/dist/cobalt/p-585c132d.entry.js +0 -1
- package/dist/cobalt/p-59b114ab.entry.js +0 -1
- package/dist/cobalt/p-5d0510a5.entry.js +0 -1
- package/dist/cobalt/p-5e246304.entry.js +0 -1
- package/dist/cobalt/p-C1DCLOEl.js +0 -1
- package/dist/cobalt/p-C2mZ7x_Y.js +0 -1
- package/dist/cobalt/p-c589ae25.entry.js +0 -1
- package/dist/cobalt/p-c635417b.entry.js +0 -1
- package/dist/cobalt/p-cd28aa6d.entry.js +0 -1
- package/dist/cobalt/p-d71b800a.entry.js +0 -1
- package/dist/cobalt/p-df752f6e.entry.js +0 -1
- package/dist/cobalt/p-fffeb610.entry.js +0 -1
- package/dist/cobalt/p-tPYikBRJ.js +0 -1
- package/dist/components/p-BTa6ss5i.js +0 -1
- package/dist/components/p-C1DCLOEl.js +0 -1
- package/dist/components/p-C2mZ7x_Y.js +0 -1
- package/dist/components/p-CVeEoHr7.js +0 -1
- package/dist/components/p-CYi6V_Ss.js +0 -1
- package/dist/components/p-CuQjKAf5.js +0 -1
- package/dist/components/p-CyYF8IJE.js +0 -1
- package/dist/components/p-DKvTqEaf.js +0 -1
- package/dist/components/p-T0UfY6rA.js +0 -1
- package/dist/esm/co-calendar-month.entry.js +0 -379
- package/dist/esm/co-skeleton.entry.js +0 -24
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { formatTime, resamplePeaks, fallbackPeaks, scrubFraction } from "./co-audio-player.utils";
|
|
3
|
+
export class CoAudioPlayer {
|
|
4
|
+
constructor() {
|
|
5
|
+
/** Compact variant: narrower, hides the download button. */
|
|
6
|
+
this.compact = false;
|
|
7
|
+
/** Fallback bar count used before the container width is measured. Once
|
|
8
|
+
* measured, the real bar count is derived from the width via `barDensity`
|
|
9
|
+
* (V1 parity: a dense, detail-rich waveform rather than a fixed count). */
|
|
10
|
+
this.bars = 64;
|
|
11
|
+
/** Pixels per waveform bar (bar + gap). Lower = denser/more detailed, like V1
|
|
12
|
+
* (`SkAudioPlayer` used 3). The measured bar count = floor(width / barDensity). */
|
|
13
|
+
this.barDensity = 3;
|
|
14
|
+
/** Passthrough to the underlying <audio> preload. */
|
|
15
|
+
this.preload = 'metadata';
|
|
16
|
+
/** Filename for the download button. */
|
|
17
|
+
this.downloadFilename = 'audio';
|
|
18
|
+
/** Hide the download button even in full mode. */
|
|
19
|
+
this.noDownload = false;
|
|
20
|
+
this.isPlaying = false;
|
|
21
|
+
this.isLoading = false;
|
|
22
|
+
this.hasError = false;
|
|
23
|
+
this.currentTime = 0;
|
|
24
|
+
this.duration = 0;
|
|
25
|
+
this.peaks = [];
|
|
26
|
+
/** Measured wave width (px); 0 until the ResizeObserver reports it. */
|
|
27
|
+
this.containerWidth = 0;
|
|
28
|
+
/** Current playback rate; the speed control cycles through `SPEEDS`. */
|
|
29
|
+
this.playbackRate = 1;
|
|
30
|
+
// Decoded mono PCM, kept so bars can be re-resampled on resize without re-fetching.
|
|
31
|
+
this.rawChannelData = null;
|
|
32
|
+
this.onMeta = () => { var _a; this.duration = ((_a = this.audio) === null || _a === void 0 ? void 0 : _a.duration) || 0; };
|
|
33
|
+
this.onCanPlay = () => { this.isLoading = false; };
|
|
34
|
+
this.onWaiting = () => { this.isLoading = true; };
|
|
35
|
+
this.onTime = () => { var _a; this.currentTime = ((_a = this.audio) === null || _a === void 0 ? void 0 : _a.currentTime) || 0; };
|
|
36
|
+
this.onEnded = () => { this.isPlaying = false; this.currentTime = 0; this.coEnded.emit(); };
|
|
37
|
+
this.onErr = (e) => { this.isLoading = false; this.hasError = true; this.coError.emit(e); };
|
|
38
|
+
this.toggle = () => {
|
|
39
|
+
if (!this.audio || this.hasError)
|
|
40
|
+
return;
|
|
41
|
+
if (this.isPlaying) {
|
|
42
|
+
this.audio.pause();
|
|
43
|
+
this.isPlaying = false;
|
|
44
|
+
this.coPause.emit();
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.audio.play().then(() => { this.isPlaying = true; this.coPlay.emit(); }).catch(() => { });
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
// Playback-speed cycle (V1 SkAudioPlayer parity): the label shows the current
|
|
51
|
+
// rate and clicking it advances to the next.
|
|
52
|
+
this.SPEEDS = [1, 1.5, 2, 0.5];
|
|
53
|
+
this.cycleSpeed = () => {
|
|
54
|
+
const i = this.SPEEDS.indexOf(this.playbackRate);
|
|
55
|
+
this.playbackRate = this.SPEEDS[(i + 1) % this.SPEEDS.length];
|
|
56
|
+
if (this.audio)
|
|
57
|
+
this.audio.playbackRate = this.playbackRate;
|
|
58
|
+
};
|
|
59
|
+
this.seekAt = (clientX) => {
|
|
60
|
+
if (!this.audio || !this.waveEl || !this.duration)
|
|
61
|
+
return;
|
|
62
|
+
const frac = scrubFraction(clientX, this.waveEl.getBoundingClientRect());
|
|
63
|
+
this.audio.currentTime = frac * this.duration;
|
|
64
|
+
this.currentTime = this.audio.currentTime;
|
|
65
|
+
};
|
|
66
|
+
this.onWaveKey = (e) => {
|
|
67
|
+
if (e.key === ' ' || e.key === 'Enter') {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
this.toggle();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (!this.audio || !this.duration)
|
|
73
|
+
return;
|
|
74
|
+
if (e.key === 'ArrowRight')
|
|
75
|
+
this.audio.currentTime = Math.min(this.duration, this.audio.currentTime + 5);
|
|
76
|
+
else if (e.key === 'ArrowLeft')
|
|
77
|
+
this.audio.currentTime = Math.max(0, this.audio.currentTime - 5);
|
|
78
|
+
else
|
|
79
|
+
return;
|
|
80
|
+
this.currentTime = this.audio.currentTime;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** Bar count: derived from the measured width (V1-style density) once known,
|
|
84
|
+
* else the `bars` fallback. Floored at 24 so a narrow player still reads as a wave. */
|
|
85
|
+
get effectiveBars() {
|
|
86
|
+
return this.containerWidth > 0
|
|
87
|
+
? Math.max(24, Math.floor(this.containerWidth / this.barDensity))
|
|
88
|
+
: this.bars;
|
|
89
|
+
}
|
|
90
|
+
// componentWillLoad (not componentDidLoad) so `init()` seeds @State before the
|
|
91
|
+
// FIRST render pass. Under @stencil/vitest's test-bundle transform, class-field
|
|
92
|
+
// defaults for @Prop/@State are not seeded on the element ahead of render (see
|
|
93
|
+
// the co-tab-group.spec.tsx comment on this repo's harness gap) — running before
|
|
94
|
+
// the first render, not after, is what keeps this.peaks/duration/etc. defined.
|
|
95
|
+
componentWillLoad() { this.init(); }
|
|
96
|
+
// Measure the wave width so the bar count tracks it (V1 density). The wave
|
|
97
|
+
// element exists only after the first render, hence componentDidLoad.
|
|
98
|
+
componentDidLoad() {
|
|
99
|
+
if (typeof ResizeObserver === 'undefined' || !this.waveEl)
|
|
100
|
+
return;
|
|
101
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
102
|
+
var _a;
|
|
103
|
+
for (const entry of entries) {
|
|
104
|
+
const w = ((_a = entry.contentRect) === null || _a === void 0 ? void 0 : _a.width) || entry.target.clientWidth || 0;
|
|
105
|
+
if (w > 2 && Math.abs(w - this.containerWidth) > 2) {
|
|
106
|
+
this.containerWidth = w;
|
|
107
|
+
this.rebuildBars();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
this.resizeObserver.observe(this.waveEl);
|
|
112
|
+
const w0 = this.waveEl.clientWidth || 0;
|
|
113
|
+
if (w0 > 2) {
|
|
114
|
+
this.containerWidth = w0;
|
|
115
|
+
this.rebuildBars();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
disconnectedCallback() {
|
|
119
|
+
var _a;
|
|
120
|
+
this.teardown();
|
|
121
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
122
|
+
this.resizeObserver = undefined;
|
|
123
|
+
}
|
|
124
|
+
onSrcChange() { this.init(); }
|
|
125
|
+
// Re-derive bars for the current width: from cached PCM if decoded, else the
|
|
126
|
+
// deterministic fallback shape. Reassign the array so Stencil re-renders.
|
|
127
|
+
rebuildBars() {
|
|
128
|
+
this.peaks = this.rawChannelData
|
|
129
|
+
? resamplePeaks(this.rawChannelData, this.effectiveBars)
|
|
130
|
+
: fallbackPeaks(this.effectiveBars);
|
|
131
|
+
}
|
|
132
|
+
init() {
|
|
133
|
+
this.teardown();
|
|
134
|
+
this.rawChannelData = null;
|
|
135
|
+
this.peaks = fallbackPeaks(this.effectiveBars); // draw immediately; refine with real peaks
|
|
136
|
+
this.currentTime = 0;
|
|
137
|
+
this.duration = 0;
|
|
138
|
+
this.playbackRate = 1; // a fresh source starts at 1x (new <audio> defaults to 1)
|
|
139
|
+
this.hasError = false;
|
|
140
|
+
if (!this.src)
|
|
141
|
+
return;
|
|
142
|
+
this.isLoading = true;
|
|
143
|
+
this.extractPeaks(this.src);
|
|
144
|
+
if (typeof Audio === 'undefined')
|
|
145
|
+
return; // test/SSR guard
|
|
146
|
+
const el = new Audio();
|
|
147
|
+
el.preload = this.preload;
|
|
148
|
+
el.crossOrigin = 'anonymous';
|
|
149
|
+
el.src = this.src;
|
|
150
|
+
el.addEventListener('loadedmetadata', this.onMeta);
|
|
151
|
+
el.addEventListener('timeupdate', this.onTime);
|
|
152
|
+
el.addEventListener('ended', this.onEnded);
|
|
153
|
+
el.addEventListener('error', this.onErr);
|
|
154
|
+
el.addEventListener('canplay', this.onCanPlay);
|
|
155
|
+
el.addEventListener('waiting', this.onWaiting);
|
|
156
|
+
this.audio = el;
|
|
157
|
+
}
|
|
158
|
+
teardown() {
|
|
159
|
+
if (this.audio) {
|
|
160
|
+
this.audio.pause();
|
|
161
|
+
this.audio.removeEventListener('loadedmetadata', this.onMeta);
|
|
162
|
+
this.audio.removeEventListener('timeupdate', this.onTime);
|
|
163
|
+
this.audio.removeEventListener('ended', this.onEnded);
|
|
164
|
+
this.audio.removeEventListener('error', this.onErr);
|
|
165
|
+
this.audio.removeEventListener('canplay', this.onCanPlay);
|
|
166
|
+
this.audio.removeEventListener('waiting', this.onWaiting);
|
|
167
|
+
this.audio.src = '';
|
|
168
|
+
this.audio = undefined;
|
|
169
|
+
}
|
|
170
|
+
this.isPlaying = false;
|
|
171
|
+
}
|
|
172
|
+
async extractPeaks(url) {
|
|
173
|
+
try {
|
|
174
|
+
const Ctx = window.AudioContext || window.webkitAudioContext;
|
|
175
|
+
if (!Ctx || typeof fetch === 'undefined')
|
|
176
|
+
return; // keep fallback
|
|
177
|
+
const ctx = new Ctx();
|
|
178
|
+
const buf = await (await fetch(url)).arrayBuffer();
|
|
179
|
+
const audioBuf = await ctx.decodeAudioData(buf);
|
|
180
|
+
this.rawChannelData = audioBuf.getChannelData(0);
|
|
181
|
+
this.peaks = resamplePeaks(this.rawChannelData, this.effectiveBars);
|
|
182
|
+
ctx.close();
|
|
183
|
+
}
|
|
184
|
+
catch (_a) {
|
|
185
|
+
this.rawChannelData = null;
|
|
186
|
+
this.peaks = fallbackPeaks(this.effectiveBars); // stays functional
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
async download() {
|
|
190
|
+
if (!this.src || typeof fetch === 'undefined')
|
|
191
|
+
return;
|
|
192
|
+
try {
|
|
193
|
+
const blob = await (await fetch(this.src)).blob();
|
|
194
|
+
const url = URL.createObjectURL(blob);
|
|
195
|
+
const a = document.createElement('a');
|
|
196
|
+
a.href = url;
|
|
197
|
+
a.download = this.downloadFilename;
|
|
198
|
+
document.body.appendChild(a);
|
|
199
|
+
a.click();
|
|
200
|
+
a.remove();
|
|
201
|
+
URL.revokeObjectURL(url);
|
|
202
|
+
}
|
|
203
|
+
catch ( /* ignore */_a) { /* ignore */ }
|
|
204
|
+
}
|
|
205
|
+
render() {
|
|
206
|
+
const H = 40, UNIT = 3, W = 1.8, R = 0.6;
|
|
207
|
+
const vbW = Math.max(1, this.peaks.length * UNIT);
|
|
208
|
+
const pct = this.duration ? (this.currentTime / this.duration) * 100 : 0;
|
|
209
|
+
const bar = (hFrac, i, played = false) => (h("rect", { key: 'ffe5ce97626e52c12e60b953b62d237f14acb582', x: i * UNIT, y: H / 2 - (hFrac * H) / 2, width: W, height: Math.max(hFrac * H, 2), rx: R, class: { 'co-audio-player__bar': true, 'co-audio-player__bar--played': played } }));
|
|
210
|
+
return (h("div", { key: '012710aded6ca183e80d7fde087cb0fdf413249b', class: {
|
|
211
|
+
'co-audio-player': true,
|
|
212
|
+
'co-audio-player--compact': this.compact,
|
|
213
|
+
'co-audio-player--error': this.hasError,
|
|
214
|
+
'co-audio-player--playing': this.isPlaying,
|
|
215
|
+
}, part: "player" }, h("button", { key: '2505b88e97e73fd39aa31e3dad5e7fe0c1b94c80', type: "button", class: "co-audio-player__play", part: "play", "aria-label": this.hasError ? 'Audio no disponible' : this.isPlaying ? 'Pausar' : 'Reproducir', "aria-busy": this.isLoading ? 'true' : 'false', disabled: this.hasError || !this.src, onClick: this.toggle }, h("co-icon", { key: 'e0e0d2dd5f6e0578ba80a3c235e5c221a6e8fe21', name: this.hasError ? 'warning-circle' : this.isPlaying ? 'pause' : 'play', weight: "fill", size: this.compact ? 12 : 14 })), h("div", { key: 'd2b32119c69c64d2f68d469fe4ae056780446322', class: "co-audio-player__wave", part: "wave", role: "slider", tabindex: "0", "aria-label": "Progreso de reproducci\u00F3n", "aria-valuemin": 0, "aria-valuemax": Math.floor(this.duration), "aria-valuenow": Math.floor(this.currentTime), ref: (el) => (this.waveEl = el), onClick: (e) => this.seekAt(e.clientX), onKeyDown: this.onWaveKey }, h("svg", { key: 'fb9643df152d2d0b119580954f639cb3a9c2cd66', class: "co-audio-player__svg", viewBox: `0 0 ${vbW} ${H}`, preserveAspectRatio: "none", "aria-hidden": "true" }, this.peaks.map((hFrac, i) => bar(hFrac, i)), h("clipPath", { key: 'c2901cfe7c7e910bd53c8c92894b2d2395cde270', id: "co-ap-clip" }, h("rect", { key: '8129a85201e09ba6646b08ed0075798b0a0b0dfc', x: "0", y: "0", width: (pct / 100) * vbW, height: H })), h("g", { key: '69bc1780122d48f1a545d1c59bf7ed6536285ed2', "clip-path": "url(#co-ap-clip)" }, this.peaks.map((hFrac, i) => bar(hFrac, i, true))))), h("span", { key: '3747622619bd81545f85e7eb2f9c19b1aca6e7c2', class: "co-audio-player__time", part: "time" }, formatTime(this.currentTime), " / ", formatTime(this.duration)), !this.compact && (h("button", { key: '84341856fb2e0b6a094c673a727370b148190e30', type: "button", class: "co-audio-player__speed", part: "speed", "aria-label": `Velocidad de reproducción ${this.playbackRate}x`, onClick: this.cycleSpeed }, this.playbackRate, "x")), !this.compact && !this.noDownload && (h("button", { key: 'd6767d185317f20299b40c4050a806d88165682f', type: "button", class: "co-audio-player__dl", part: "download", "aria-label": "Descargar", onClick: () => this.download() }, h("co-icon", { key: 'a0f0a09cdf705ecf15e0156cf93011f89f41ffa5', name: "download-simple", size: 14 })))));
|
|
216
|
+
}
|
|
217
|
+
static get is() { return "co-audio-player"; }
|
|
218
|
+
static get encapsulation() { return "shadow"; }
|
|
219
|
+
static get originalStyleUrls() {
|
|
220
|
+
return {
|
|
221
|
+
"$": ["co-audio-player.css"]
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
static get styleUrls() {
|
|
225
|
+
return {
|
|
226
|
+
"$": ["co-audio-player.css"]
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
static get properties() {
|
|
230
|
+
return {
|
|
231
|
+
"src": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"mutable": false,
|
|
234
|
+
"complexType": {
|
|
235
|
+
"original": "string",
|
|
236
|
+
"resolved": "string | undefined",
|
|
237
|
+
"references": {}
|
|
238
|
+
},
|
|
239
|
+
"required": false,
|
|
240
|
+
"optional": true,
|
|
241
|
+
"docs": {
|
|
242
|
+
"tags": [],
|
|
243
|
+
"text": "Audio URL (use a signedUrl for private buckets)."
|
|
244
|
+
},
|
|
245
|
+
"getter": false,
|
|
246
|
+
"setter": false,
|
|
247
|
+
"reflect": false,
|
|
248
|
+
"attribute": "src"
|
|
249
|
+
},
|
|
250
|
+
"compact": {
|
|
251
|
+
"type": "boolean",
|
|
252
|
+
"mutable": false,
|
|
253
|
+
"complexType": {
|
|
254
|
+
"original": "boolean",
|
|
255
|
+
"resolved": "boolean",
|
|
256
|
+
"references": {}
|
|
257
|
+
},
|
|
258
|
+
"required": false,
|
|
259
|
+
"optional": false,
|
|
260
|
+
"docs": {
|
|
261
|
+
"tags": [],
|
|
262
|
+
"text": "Compact variant: narrower, hides the download button."
|
|
263
|
+
},
|
|
264
|
+
"getter": false,
|
|
265
|
+
"setter": false,
|
|
266
|
+
"reflect": false,
|
|
267
|
+
"attribute": "compact",
|
|
268
|
+
"defaultValue": "false"
|
|
269
|
+
},
|
|
270
|
+
"bars": {
|
|
271
|
+
"type": "number",
|
|
272
|
+
"mutable": false,
|
|
273
|
+
"complexType": {
|
|
274
|
+
"original": "number",
|
|
275
|
+
"resolved": "number",
|
|
276
|
+
"references": {}
|
|
277
|
+
},
|
|
278
|
+
"required": false,
|
|
279
|
+
"optional": false,
|
|
280
|
+
"docs": {
|
|
281
|
+
"tags": [],
|
|
282
|
+
"text": "Fallback bar count used before the container width is measured. Once\nmeasured, the real bar count is derived from the width via `barDensity`\n(V1 parity: a dense, detail-rich waveform rather than a fixed count)."
|
|
283
|
+
},
|
|
284
|
+
"getter": false,
|
|
285
|
+
"setter": false,
|
|
286
|
+
"reflect": false,
|
|
287
|
+
"attribute": "bars",
|
|
288
|
+
"defaultValue": "64"
|
|
289
|
+
},
|
|
290
|
+
"barDensity": {
|
|
291
|
+
"type": "number",
|
|
292
|
+
"mutable": false,
|
|
293
|
+
"complexType": {
|
|
294
|
+
"original": "number",
|
|
295
|
+
"resolved": "number",
|
|
296
|
+
"references": {}
|
|
297
|
+
},
|
|
298
|
+
"required": false,
|
|
299
|
+
"optional": false,
|
|
300
|
+
"docs": {
|
|
301
|
+
"tags": [],
|
|
302
|
+
"text": "Pixels per waveform bar (bar + gap). Lower = denser/more detailed, like V1\n(`SkAudioPlayer` used 3). The measured bar count = floor(width / barDensity)."
|
|
303
|
+
},
|
|
304
|
+
"getter": false,
|
|
305
|
+
"setter": false,
|
|
306
|
+
"reflect": false,
|
|
307
|
+
"attribute": "bar-density",
|
|
308
|
+
"defaultValue": "3"
|
|
309
|
+
},
|
|
310
|
+
"preload": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"mutable": false,
|
|
313
|
+
"complexType": {
|
|
314
|
+
"original": "'none' | 'metadata'",
|
|
315
|
+
"resolved": "\"metadata\" | \"none\"",
|
|
316
|
+
"references": {}
|
|
317
|
+
},
|
|
318
|
+
"required": false,
|
|
319
|
+
"optional": false,
|
|
320
|
+
"docs": {
|
|
321
|
+
"tags": [],
|
|
322
|
+
"text": "Passthrough to the underlying <audio> preload."
|
|
323
|
+
},
|
|
324
|
+
"getter": false,
|
|
325
|
+
"setter": false,
|
|
326
|
+
"reflect": false,
|
|
327
|
+
"attribute": "preload",
|
|
328
|
+
"defaultValue": "'metadata'"
|
|
329
|
+
},
|
|
330
|
+
"downloadFilename": {
|
|
331
|
+
"type": "string",
|
|
332
|
+
"mutable": false,
|
|
333
|
+
"complexType": {
|
|
334
|
+
"original": "string",
|
|
335
|
+
"resolved": "string",
|
|
336
|
+
"references": {}
|
|
337
|
+
},
|
|
338
|
+
"required": false,
|
|
339
|
+
"optional": false,
|
|
340
|
+
"docs": {
|
|
341
|
+
"tags": [],
|
|
342
|
+
"text": "Filename for the download button."
|
|
343
|
+
},
|
|
344
|
+
"getter": false,
|
|
345
|
+
"setter": false,
|
|
346
|
+
"reflect": false,
|
|
347
|
+
"attribute": "download-filename",
|
|
348
|
+
"defaultValue": "'audio'"
|
|
349
|
+
},
|
|
350
|
+
"noDownload": {
|
|
351
|
+
"type": "boolean",
|
|
352
|
+
"mutable": false,
|
|
353
|
+
"complexType": {
|
|
354
|
+
"original": "boolean",
|
|
355
|
+
"resolved": "boolean",
|
|
356
|
+
"references": {}
|
|
357
|
+
},
|
|
358
|
+
"required": false,
|
|
359
|
+
"optional": false,
|
|
360
|
+
"docs": {
|
|
361
|
+
"tags": [],
|
|
362
|
+
"text": "Hide the download button even in full mode."
|
|
363
|
+
},
|
|
364
|
+
"getter": false,
|
|
365
|
+
"setter": false,
|
|
366
|
+
"reflect": false,
|
|
367
|
+
"attribute": "no-download",
|
|
368
|
+
"defaultValue": "false"
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
static get states() {
|
|
373
|
+
return {
|
|
374
|
+
"isPlaying": {},
|
|
375
|
+
"isLoading": {},
|
|
376
|
+
"hasError": {},
|
|
377
|
+
"currentTime": {},
|
|
378
|
+
"duration": {},
|
|
379
|
+
"peaks": {},
|
|
380
|
+
"containerWidth": {},
|
|
381
|
+
"playbackRate": {}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
static get events() {
|
|
385
|
+
return [{
|
|
386
|
+
"method": "coPlay",
|
|
387
|
+
"name": "coPlay",
|
|
388
|
+
"bubbles": true,
|
|
389
|
+
"cancelable": true,
|
|
390
|
+
"composed": true,
|
|
391
|
+
"docs": {
|
|
392
|
+
"tags": [],
|
|
393
|
+
"text": ""
|
|
394
|
+
},
|
|
395
|
+
"complexType": {
|
|
396
|
+
"original": "void",
|
|
397
|
+
"resolved": "void",
|
|
398
|
+
"references": {}
|
|
399
|
+
}
|
|
400
|
+
}, {
|
|
401
|
+
"method": "coPause",
|
|
402
|
+
"name": "coPause",
|
|
403
|
+
"bubbles": true,
|
|
404
|
+
"cancelable": true,
|
|
405
|
+
"composed": true,
|
|
406
|
+
"docs": {
|
|
407
|
+
"tags": [],
|
|
408
|
+
"text": ""
|
|
409
|
+
},
|
|
410
|
+
"complexType": {
|
|
411
|
+
"original": "void",
|
|
412
|
+
"resolved": "void",
|
|
413
|
+
"references": {}
|
|
414
|
+
}
|
|
415
|
+
}, {
|
|
416
|
+
"method": "coEnded",
|
|
417
|
+
"name": "coEnded",
|
|
418
|
+
"bubbles": true,
|
|
419
|
+
"cancelable": true,
|
|
420
|
+
"composed": true,
|
|
421
|
+
"docs": {
|
|
422
|
+
"tags": [],
|
|
423
|
+
"text": ""
|
|
424
|
+
},
|
|
425
|
+
"complexType": {
|
|
426
|
+
"original": "void",
|
|
427
|
+
"resolved": "void",
|
|
428
|
+
"references": {}
|
|
429
|
+
}
|
|
430
|
+
}, {
|
|
431
|
+
"method": "coError",
|
|
432
|
+
"name": "coError",
|
|
433
|
+
"bubbles": true,
|
|
434
|
+
"cancelable": true,
|
|
435
|
+
"composed": true,
|
|
436
|
+
"docs": {
|
|
437
|
+
"tags": [],
|
|
438
|
+
"text": ""
|
|
439
|
+
},
|
|
440
|
+
"complexType": {
|
|
441
|
+
"original": "unknown",
|
|
442
|
+
"resolved": "unknown",
|
|
443
|
+
"references": {}
|
|
444
|
+
}
|
|
445
|
+
}];
|
|
446
|
+
}
|
|
447
|
+
static get watchers() {
|
|
448
|
+
return [{
|
|
449
|
+
"propName": "src",
|
|
450
|
+
"methodName": "onSrcChange"
|
|
451
|
+
}];
|
|
452
|
+
}
|
|
453
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Seconds → "m:ss" (floors; 0 for NaN/negative). */
|
|
2
|
+
export function formatTime(seconds) {
|
|
3
|
+
const s = Math.max(0, Math.floor(seconds || 0));
|
|
4
|
+
const m = Math.floor(s / 60);
|
|
5
|
+
const sec = s % 60;
|
|
6
|
+
return `${m}:${sec.toString().padStart(2, '0')}`;
|
|
7
|
+
}
|
|
8
|
+
/** Downsample raw PCM to `bars` peak heights, each normalized to a 0..1 fraction. */
|
|
9
|
+
export function resamplePeaks(channelData, bars) {
|
|
10
|
+
const len = channelData.length;
|
|
11
|
+
if (!len || bars <= 0)
|
|
12
|
+
return [];
|
|
13
|
+
const step = Math.max(1, Math.floor(len / bars));
|
|
14
|
+
const peaks = [];
|
|
15
|
+
for (let i = 0; i < bars; i++) {
|
|
16
|
+
let max = 0;
|
|
17
|
+
const start = i * step;
|
|
18
|
+
for (let j = start; j < start + step && j < len; j++) {
|
|
19
|
+
const abs = Math.abs(channelData[j]);
|
|
20
|
+
if (abs > max)
|
|
21
|
+
max = abs;
|
|
22
|
+
}
|
|
23
|
+
peaks.push(0.12 + max * 0.88); // floor of 0.12 so silent buckets still show a sliver
|
|
24
|
+
}
|
|
25
|
+
return peaks;
|
|
26
|
+
}
|
|
27
|
+
/** Deterministic pseudo-waveform (stable render + testable — no Math.random). */
|
|
28
|
+
export function fallbackPeaks(bars) {
|
|
29
|
+
if (bars <= 0)
|
|
30
|
+
return [];
|
|
31
|
+
const peaks = [];
|
|
32
|
+
for (let i = 0; i < bars; i++) {
|
|
33
|
+
const envelope = Math.sin((i / Math.max(1, bars)) * Math.PI) * 0.6 + 0.3;
|
|
34
|
+
const wobble = 0.75 + 0.25 * Math.abs(Math.sin(i * 1.7));
|
|
35
|
+
peaks.push(0.12 + envelope * wobble * 0.88);
|
|
36
|
+
}
|
|
37
|
+
return peaks;
|
|
38
|
+
}
|
|
39
|
+
/** Clamped 0..1 position of a click within a track rect. */
|
|
40
|
+
export function scrubFraction(clientX, rect) {
|
|
41
|
+
if (!rect.width)
|
|
42
|
+
return 0;
|
|
43
|
+
return Math.max(0, Math.min(1, (clientX - rect.left) / rect.width));
|
|
44
|
+
}
|
|
@@ -10,7 +10,7 @@ export class CoBadge {
|
|
|
10
10
|
this.color = 'default';
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (h("span", { key: '
|
|
13
|
+
return (h("span", { key: 'f0a6e6e5bd63a5ce3ffac291312880ab7baad1be', class: {
|
|
14
14
|
'co-badge': true,
|
|
15
15
|
[`co-badge--${this.size}`]: true,
|
|
16
16
|
[`co-badge--${this.color}`]: true,
|
|
@@ -255,13 +255,13 @@ export class CoBottomSheet {
|
|
|
255
255
|
(_a = this.bodyEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('touchmove', this.touchBlocker);
|
|
256
256
|
}
|
|
257
257
|
render() {
|
|
258
|
-
return (h("div", { key: '
|
|
258
|
+
return (h("div", { key: 'ba3db3d99801b70af3d5adc93c83868e2b2df3e2', class: { 'co-bottom-sheet-root': true, 'co-bottom-sheet-root--open': this.open } }, h("div", { key: '1003cdf6554d5594a3cd6ce51850cf767e76f5e2', class: "co-bottom-sheet__backdrop", part: "backdrop", onClick: this.handleBackdropClick, ref: (el) => (this.backdropEl = el) }), h("section", { key: '8474a75c0b2bcf05e91f56274bbeef93e471b28f', class: { 'co-bottom-sheet': true, 'co-bottom-sheet--open': this.open }, part: "sheet", role: "dialog", "aria-modal": "true", "aria-labelledby": this.heading ? 'co-bottom-sheet-heading' : undefined, style: { '--co-bottom-sheet-max-height': this.maxHeight }, onTransitionEnd: this.handleTransitionEnd, ref: (el) => (this.sheetEl = el) }, h("div", { key: 'a0c45bd9389353b7c28a85cf02002e417e9295cd', class: "co-bottom-sheet__grip", onPointerDown: this.handleGripPointerDown, onPointerMove: this.handlePointerMove, onPointerUp: this.handlePointerUp, onPointerCancel: this.handlePointerCancel }, this.showHandle && (h("div", { key: '36251f7b8031cb20ac95b9b8f674d094a5240789', class: "co-bottom-sheet__handle", part: "handle", "aria-hidden": "true" })), h("header", { key: 'f6533a7ed9bf8985cf3712f6587fd129557aed75', class: {
|
|
259
259
|
'co-bottom-sheet__header': true,
|
|
260
260
|
'co-bottom-sheet__header--show': this.hasHeaderSlot || !!this.heading,
|
|
261
|
-
}, part: "header" }, h("slot", { key: '
|
|
261
|
+
}, part: "header" }, h("slot", { key: 'b7061e6c4d48b1a221805962ab55153e06edecf7', name: "header", onSlotchange: this.handleHeaderSlotChange }, this.heading && (h("h2", { key: '8180cb9cc8e1c234475cc02d7fdab3bc94fa7f31', class: "co-bottom-sheet__heading", id: "co-bottom-sheet-heading" }, this.heading))))), h("div", { key: 'e8094b7c7c0919b0cc724404b2c97c4c18b031c9', class: "co-bottom-sheet__body", part: "body", onPointerDown: this.handleBodyPointerDown, onPointerMove: this.handlePointerMove, onPointerUp: this.handlePointerUp, onPointerCancel: this.handlePointerCancel, ref: (el) => (this.bodyEl = el) }, h("slot", { key: '0b9271b2ad92c1a8f7bcfde66955ceb026b0fffd' })), h("footer", { key: '016e2c9974dc2a1c88aacfd0d5a7a6b6e10f1033', class: {
|
|
262
262
|
'co-bottom-sheet__footer': true,
|
|
263
263
|
'co-bottom-sheet__footer--show': this.hasFooter,
|
|
264
|
-
}, part: "footer" }, h("slot", { key: '
|
|
264
|
+
}, part: "footer" }, h("slot", { key: '5d571808b9b49eca346b7ce30525cab841b3ff4a', name: "footer", onSlotchange: this.handleFooterSlotChange })))));
|
|
265
265
|
}
|
|
266
266
|
static get is() { return "co-bottom-sheet"; }
|
|
267
267
|
static get encapsulation() { return "shadow"; }
|
|
@@ -42,7 +42,7 @@ export class CoBreadcrumb {
|
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
44
|
const data = this.parseItems();
|
|
45
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: '8ab383589f78948c7f11d38d4e25fa5509a56dbc', part: "breadcrumb", role: "navigation", "aria-label": "Breadcrumb" }, data
|
|
46
46
|
? data.map((it, i) => (h("co-breadcrumb-item", { key: i, label: it.label, value: it.value, icon: it.icon, separator: this.separator, current: i === data.length - 1 })))
|
|
47
47
|
: h("slot", { onSlotchange: this.handleSlotChange })));
|
|
48
48
|
}
|
|
@@ -29,10 +29,10 @@ export class CoBreadcrumbItem {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
return (h(Host, { key: '
|
|
32
|
+
return (h(Host, { key: '16deecfc675429362263d3afb7257025e9170b26', part: "breadcrumb-item", class: {
|
|
33
33
|
'co-breadcrumb-item': true,
|
|
34
34
|
'co-breadcrumb-item--current': this.current,
|
|
35
|
-
} }, h("span", { key: '
|
|
35
|
+
} }, h("span", { key: '795723b3d89d48356ffe8f9a35df63d9d5dea836', class: "co-breadcrumb-item__sep", "aria-hidden": "true" }, h("co-icon", { key: 'a1bc3a756d0b2ead8a9f150f60688ae19f46cae0', name: this.separator, size: 13 })), h("span", { key: '6dada7bc4a556af7f3b9dc63d2b2d001c13e173e', class: "co-breadcrumb-item__content", part: "content", role: "link", tabindex: "0", "aria-current": this.current ? 'page' : undefined, onClick: this.handleClick, onKeyDown: this.handleKeydown }, this.icon && (h("span", { key: '63424dc201114b2a589559ee10324ee4cc9cc305', class: "co-breadcrumb-item__icon" }, h("co-icon", { key: 'be25f19369d9f6d0459acd255793782c1580256e', name: this.icon, size: 16 }))), h("span", { key: 'e8f0919b4ab1ba60ae632ccd21e3f353b04deac7', class: "co-breadcrumb-item__label" }, this.label, h("slot", { key: '0ac8d7d59e7828f939f637ef73ab7787a5c820d8' })))));
|
|
36
36
|
}
|
|
37
37
|
static get is() { return "co-breadcrumb-item"; }
|
|
38
38
|
static get encapsulation() { return "shadow"; }
|
|
@@ -160,6 +160,25 @@
|
|
|
160
160
|
backdrop-filter: none;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
/* ─── ON-DARK SURFACE · danger ───────────────────────────────────
|
|
164
|
+
surface="dark" + variant="danger": Eliminar sobre una barra oscura
|
|
165
|
+
(selection bar). El fill sólido de status-error ya lee bien en dark;
|
|
166
|
+
lo que rompe es (a) el hover por defecto (opacity .88 deja sangrar la
|
|
167
|
+
barra negra y APAGA el rojo — acá se ACLARA el fondo en su lugar) y
|
|
168
|
+
(b) el foco invisible (outline:none base, dark-on-dark) — anillo
|
|
169
|
+
blanco translúcido. Espejo del bloque ghost/stroke de arriba: misma
|
|
170
|
+
jugada de especificidad (variant + surface) para ganarle a la regla
|
|
171
|
+
:hover compartida de danger/success.
|
|
172
|
+
Receta oficial de botones de barra: ghost|stroke surface="dark";
|
|
173
|
+
Eliminar = danger surface="dark". */
|
|
174
|
+
.co-button--danger.co-button--surface-dark:hover:not(:disabled) {
|
|
175
|
+
opacity: 1;
|
|
176
|
+
background: color-mix(in srgb, var(--co-semantic-status-error) 84%, var(--co-color-base-blanco, #fff));
|
|
177
|
+
}
|
|
178
|
+
.co-button--danger.co-button--surface-dark:focus-visible {
|
|
179
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--co-color-base-blanco, #fff) 45%, transparent);
|
|
180
|
+
}
|
|
181
|
+
|
|
163
182
|
/* ─── ICON SLOTS ─────────────────────────────────────────────── */
|
|
164
183
|
::slotted([slot="icon-left"]),
|
|
165
184
|
::slotted([slot="icon-right"]) {
|
|
@@ -13,7 +13,14 @@ export class CoButton {
|
|
|
13
13
|
this.size = 'm';
|
|
14
14
|
/** Raised elevation — with variant="secondary" renders a white raised button (shadow-sm + inset hairline). */
|
|
15
15
|
this.elevated = false;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Surface the button sits on. On "dark", ghost/stroke variants switch to
|
|
18
|
+
* white ink + blanco-16 hover; danger keeps its solid error fill but swaps
|
|
19
|
+
* the fade-hover for a lighten-hover + white focus ring (dark bars dim a
|
|
20
|
+
* faded red). Receta oficial de acciones de barra (co-action-bar):
|
|
21
|
+
* `variant="ghost"|"stroke" surface="dark"`; Eliminar =
|
|
22
|
+
* `variant="danger" surface="dark"`.
|
|
23
|
+
*/
|
|
17
24
|
this.surface = 'light';
|
|
18
25
|
/** Disabled state */
|
|
19
26
|
this.disabled = false;
|
|
@@ -46,7 +53,7 @@ export class CoButton {
|
|
|
46
53
|
customStyle.background = this.color;
|
|
47
54
|
if (this.textColor)
|
|
48
55
|
customStyle.color = this.textColor;
|
|
49
|
-
return (h("button", { key: '
|
|
56
|
+
return (h("button", { key: 'e765a1fcb3b4efcc7c43e155015b3c178a536d3c', class: {
|
|
50
57
|
'co-button': true,
|
|
51
58
|
[`co-button--${this.variant}`]: true,
|
|
52
59
|
[`co-button--${this.shape}`]: true,
|
|
@@ -54,9 +61,9 @@ export class CoButton {
|
|
|
54
61
|
[`co-button--surface-${this.surface}`]: true,
|
|
55
62
|
'co-button--elevated': this.elevated,
|
|
56
63
|
'co-button--disabled': this.disabled,
|
|
57
|
-
}, style: Object.keys(customStyle).length ? customStyle : undefined, type: this.type, disabled: this.disabled, onClick: this.handleClick, part: "button" }, this.iconLeft
|
|
64
|
+
}, style: Object.keys(customStyle).length ? customStyle : undefined, type: this.type, disabled: this.disabled, "aria-label": this.ariaLabelText || undefined, onClick: this.handleClick, part: "button" }, this.iconLeft
|
|
58
65
|
? h("co-icon", { name: this.iconLeft, weight: this.iconWeight, size: iconSize })
|
|
59
|
-
: null, h("slot", { key: '
|
|
66
|
+
: null, h("slot", { key: '8dd3e816276a67ba6072eeed1ad34a982b60389e' }, this.label), this.iconRight
|
|
60
67
|
? h("co-icon", { name: this.iconRight, weight: this.iconWeight, size: iconSize })
|
|
61
68
|
: null));
|
|
62
69
|
}
|
|
@@ -166,7 +173,7 @@ export class CoButton {
|
|
|
166
173
|
"optional": false,
|
|
167
174
|
"docs": {
|
|
168
175
|
"tags": [],
|
|
169
|
-
"text": "Surface the button sits on. On \"dark\", ghost/stroke variants switch to
|
|
176
|
+
"text": "Surface the button sits on. On \"dark\", ghost/stroke variants switch to\nwhite ink + blanco-16 hover; danger keeps its solid error fill but swaps\nthe fade-hover for a lighten-hover + white focus ring (dark bars dim a\nfaded red). Receta oficial de acciones de barra (co-action-bar):\n`variant=\"ghost\"|\"stroke\" surface=\"dark\"`; Eliminar =\n`variant=\"danger\" surface=\"dark\"`."
|
|
170
177
|
},
|
|
171
178
|
"getter": false,
|
|
172
179
|
"setter": false,
|
|
@@ -213,6 +220,25 @@ export class CoButton {
|
|
|
213
220
|
"reflect": false,
|
|
214
221
|
"attribute": "label"
|
|
215
222
|
},
|
|
223
|
+
"ariaLabelText": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"mutable": false,
|
|
226
|
+
"complexType": {
|
|
227
|
+
"original": "string",
|
|
228
|
+
"resolved": "string | undefined",
|
|
229
|
+
"references": {}
|
|
230
|
+
},
|
|
231
|
+
"required": false,
|
|
232
|
+
"optional": true,
|
|
233
|
+
"docs": {
|
|
234
|
+
"tags": [],
|
|
235
|
+
"text": "Accessible name override for icon-only buttons (no visible `label`/slot\ntext, e.g. an icon-only action inside `co-action-bar`) \u2014 the shadow\n`<button>` otherwise has no accessible name. Mirrors the exact\n`ariaLabelText` precedent of `co-fab`/`co-icon-button`. Only sets\n`aria-label` when THIS prop is passed \u2014 when a visible `label`/slot IS\npresent, its text content already gives the button an accessible name,\nso leaving `ariaLabelText` unset avoids a duplicate/overriding aria-label."
|
|
236
|
+
},
|
|
237
|
+
"getter": false,
|
|
238
|
+
"setter": false,
|
|
239
|
+
"reflect": false,
|
|
240
|
+
"attribute": "aria-label-text"
|
|
241
|
+
},
|
|
216
242
|
"iconLeft": {
|
|
217
243
|
"type": "string",
|
|
218
244
|
"mutable": false,
|