@prolibu-suite/cobalt-core 0.10.4 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/custom-elements.json +7034 -1203
- package/dist/cjs/co-accordion.cjs.entry.js +3 -3
- package/dist/cjs/co-action-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-app-shell.cjs.entry.js +3 -3
- package/dist/cjs/co-audio-player.cjs.entry.js +4 -4
- package/dist/cjs/co-autocomplete.cjs.entry.js +12 -5
- package/dist/cjs/co-avatar-group.cjs.entry.js +3 -3
- package/dist/cjs/co-avatar.cjs.entry.js +7 -4
- package/dist/cjs/co-badge.cjs.entry.js +2 -2
- package/dist/cjs/co-bottom-sheet.cjs.entry.js +5 -5
- package/dist/cjs/co-breadcrumb-item.cjs.entry.js +3 -3
- package/dist/cjs/co-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/co-button-group.cjs.entry.js +4 -3
- package/dist/cjs/co-button.cjs.entry.js +9 -7
- package/dist/cjs/co-calendar-month_2.cjs.entry.js +16 -4
- package/dist/cjs/co-calendar_3.cjs.entry.js +76 -27
- package/dist/cjs/co-card.cjs.entry.js +3 -3
- package/dist/cjs/co-carousel-item.cjs.entry.js +2 -2
- package/dist/cjs/co-carousel.cjs.entry.js +6 -3
- package/dist/cjs/co-checkbox-group.cjs.entry.js +4 -4
- package/dist/cjs/co-checkbox.cjs.entry.js +13 -5
- package/dist/cjs/co-chip_2.cjs.entry.js +20 -7
- package/dist/cjs/co-color-area.cjs.entry.js +169 -0
- package/dist/cjs/co-color-picker.cjs.entry.js +5 -5
- package/dist/cjs/co-color-slider.cjs.entry.js +189 -0
- package/dist/cjs/co-column-picker.cjs.entry.js +23 -3
- package/dist/cjs/co-combobox.cjs.entry.js +5 -5
- package/dist/cjs/co-command-search.cjs.entry.js +5 -5
- package/dist/cjs/co-data-table-pagination.cjs.entry.js +5 -5
- package/dist/cjs/co-data-table.cjs.entry.js +3 -3
- package/dist/cjs/co-date-picker.cjs.entry.js +10 -2
- package/dist/cjs/co-date-range-picker.cjs.entry.js +11 -2
- package/dist/cjs/co-date-range.cjs.entry.js +8 -2
- package/dist/cjs/co-date-time-picker.cjs.entry.js +11 -4
- package/dist/cjs/co-document-editor.cjs.entry.js +1167 -0
- package/dist/cjs/co-drive-card.cjs.entry.js +2 -2
- package/dist/cjs/co-drop-zone.cjs.entry.js +2 -2
- package/dist/cjs/co-emoji-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-empty-state.cjs.entry.js +3 -3
- package/dist/cjs/co-event-calendar.cjs.entry.js +5 -3
- package/dist/cjs/co-event-popover.cjs.entry.js +7 -3
- package/dist/cjs/co-fab.cjs.entry.js +7 -3
- package/dist/cjs/co-file-field.cjs.entry.js +12 -8
- package/dist/cjs/co-file-type-tile.cjs.entry.js +3 -3
- package/dist/cjs/co-gradient-bar.cjs.entry.js +220 -0
- package/dist/cjs/co-helper-text.cjs.entry.js +3 -3
- package/dist/cjs/co-icon-button.cjs.entry.js +48 -9
- package/dist/cjs/co-icon.cjs.entry.js +3 -3
- package/dist/cjs/co-input.cjs.entry.js +14 -8
- package/dist/cjs/co-json-field.cjs.entry.js +10 -5
- package/dist/cjs/{co-tooltip.cjs.entry.js → co-kbd_2.cjs.entry.js} +194 -6
- package/dist/cjs/co-lightbox.cjs.entry.js +5 -5
- package/dist/cjs/co-list-footer.cjs.entry.js +2 -2
- package/dist/cjs/co-list-item.cjs.entry.js +5 -5
- package/dist/cjs/co-loader.cjs.entry.js +1 -1
- package/dist/cjs/co-media-thumb.cjs.entry.js +3 -3
- package/dist/cjs/co-menu-divider.cjs.entry.js +3 -3
- package/dist/cjs/co-menu-item.cjs.entry.js +41 -43
- package/dist/cjs/co-menu.cjs.entry.js +81 -5
- package/dist/cjs/co-modal.cjs.entry.js +350 -7
- package/dist/cjs/co-navbar.cjs.entry.js +3 -3
- package/dist/cjs/co-number-field.cjs.entry.js +11 -5
- package/dist/cjs/co-overlay.cjs.entry.js +8 -4
- package/dist/cjs/co-page-header.cjs.entry.js +2 -2
- package/dist/cjs/co-phone-field.cjs.entry.js +3 -3
- package/dist/cjs/co-popover.cjs.entry.js +69 -6
- package/dist/cjs/co-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-progress-circle.cjs.entry.js +3 -3
- package/dist/cjs/co-provider-logo_2.cjs.entry.js +2 -2
- package/dist/cjs/co-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/co-radio.cjs.entry.js +4 -4
- package/dist/cjs/co-rating.cjs.entry.js +11 -4
- package/dist/cjs/co-ref-field.cjs.entry.js +14 -5
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +40 -92
- package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +80 -20
- package/dist/cjs/co-rich-text-viewer.cjs.entry.js +9 -2
- package/dist/cjs/co-row.cjs.entry.js +3 -3
- package/dist/cjs/co-segmented-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-select.cjs.entry.js +171 -29
- package/dist/cjs/co-separator.cjs.entry.js +2 -2
- package/dist/cjs/co-sidebar-nav.cjs.entry.js +20 -5
- package/dist/cjs/co-sidebar.cjs.entry.js +3 -3
- package/dist/cjs/co-slider.cjs.entry.js +209 -23
- package/dist/cjs/co-swatch-grid.cjs.entry.js +121 -0
- package/dist/cjs/co-switch.cjs.entry.js +5 -5
- package/dist/cjs/co-tab-group.cjs.entry.js +113 -4
- package/dist/cjs/co-tab.cjs.entry.js +15 -5
- package/dist/cjs/co-tags-field.cjs.entry.js +13 -8
- package/dist/cjs/co-textarea.cjs.entry.js +6 -6
- package/dist/cjs/co-tile.cjs.entry.js +61 -0
- package/dist/cjs/co-time-field.cjs.entry.js +5 -2
- package/dist/cjs/co-toast.cjs.entry.js +3 -3
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +29 -5
- package/dist/cjs/co-toggle-button.cjs.entry.js +70 -6
- package/dist/cjs/co-transfer-list.cjs.entry.js +7 -3
- package/dist/cjs/co-tree-item.cjs.entry.js +110 -0
- package/dist/cjs/co-video.cjs.entry.js +11 -3
- package/dist/cjs/cobalt.cjs.js +2 -2
- package/dist/cjs/{color-CML2Cfdh.js → color-DQVrQGi0.js} +10 -5
- package/dist/cjs/{fieldChip-B6YIGU1V.js → fieldChip-C7MxxBVO.js} +1 -1
- package/dist/cjs/gradientStops-CMpH4fB_.js +153 -0
- package/dist/cjs/hsv-DpfSF3M2.js +95 -0
- package/dist/cjs/{index-MDAnKsze.js → index-bHoidDwv.js} +67 -27
- package/dist/cjs/index-oMHzCXm6.js +144 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{index-2kMmd5-a.js → pagination-DV43TRj9.js} +1780 -297
- package/dist/cjs/{positioning-CyatXeT_.js → positioning-CILo5esi.js} +45 -18
- package/dist/cjs/{requiredMark-D-t-IPN0.js → requiredMark-21yHvvZS.js} +1 -1
- package/dist/cjs/rich-text-host-ueFSfW-6.js +119 -0
- package/dist/cjs/{richTextI18n-B28uAhh4.js → richTextI18n-DXGIv5w1.js} +45 -0
- package/dist/cjs/submenu-RlaX6irw.js +65 -0
- package/dist/cjs/{toolbar-config-CYACt9hh.js → toolbar-config-DczL6C4W.js} +32 -0
- package/dist/cobalt/cobalt.css +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-76249983.entry.js → p-019eed8e.entry.js} +1 -1
- package/dist/cobalt/p-04e3e1f6.entry.js +1 -0
- package/dist/cobalt/p-06689166.entry.js +1 -0
- package/dist/cobalt/p-0d046d98.entry.js +1 -0
- package/dist/cobalt/{p-28764b8e.entry.js → p-0e4c2234.entry.js} +1 -1
- package/dist/cobalt/{p-b90d41e4.entry.js → p-1348d5ca.entry.js} +1 -1
- package/dist/cobalt/{p-49834b8e.entry.js → p-13e5b724.entry.js} +1 -1
- package/dist/cobalt/p-1a5bec8c.entry.js +1 -0
- package/dist/cobalt/p-21b4a830.entry.js +1 -0
- package/dist/cobalt/p-2231bacc.entry.js +1 -0
- package/dist/cobalt/{p-b437eff6.entry.js → p-26cbdc33.entry.js} +1 -1
- package/dist/cobalt/{p-aa9400bf.entry.js → p-28cf05f3.entry.js} +1 -1
- package/dist/cobalt/{p-eadfd661.entry.js → p-358a6c2a.entry.js} +1 -1
- package/dist/cobalt/p-3b5024ce.entry.js +1 -0
- package/dist/cobalt/p-3b6efb79.entry.js +1 -0
- package/dist/cobalt/p-3d1a48e5.entry.js +1 -0
- package/dist/cobalt/p-47eca182.entry.js +1 -0
- package/dist/cobalt/{p-eb82358d.entry.js → p-4bcdd422.entry.js} +1 -1
- package/dist/cobalt/{p-17244412.entry.js → p-4d743628.entry.js} +1 -1
- package/dist/cobalt/{p-011dc80b.entry.js → p-4e81e580.entry.js} +1 -1
- package/dist/cobalt/{p-ee9a623d.entry.js → p-53a251ca.entry.js} +1 -1
- package/dist/cobalt/{p-11c5ce78.entry.js → p-56176aa0.entry.js} +1 -1
- package/dist/cobalt/{p-a32b20eb.entry.js → p-58ebb303.entry.js} +1 -1
- package/dist/cobalt/{p-4592ca00.entry.js → p-5a32b9a2.entry.js} +1 -1
- package/dist/cobalt/{p-2636b7eb.entry.js → p-5e678e88.entry.js} +1 -1
- package/dist/cobalt/{p-996f4e38.entry.js → p-60f948c4.entry.js} +1 -1
- package/dist/cobalt/p-63908a8d.entry.js +1 -0
- package/dist/cobalt/p-65c191aa.entry.js +1 -0
- package/dist/cobalt/{p-c2ebf0ec.entry.js → p-65d44da2.entry.js} +1 -1
- package/dist/cobalt/p-67a024dd.entry.js +1 -0
- package/dist/cobalt/{p-ee149fd2.entry.js → p-6974df59.entry.js} +1 -1
- package/dist/cobalt/{p-000a15b8.entry.js → p-69ecc933.entry.js} +1 -1
- package/dist/cobalt/p-6c1992c9.entry.js +1 -0
- package/dist/cobalt/{p-b821d9de.entry.js → p-6d4a660c.entry.js} +1 -1
- package/dist/cobalt/{p-f57dffca.entry.js → p-713637f2.entry.js} +1 -1
- package/dist/cobalt/{p-292b0389.entry.js → p-71ae1551.entry.js} +1 -1
- package/dist/cobalt/{p-91e73a92.entry.js → p-71dc8e4a.entry.js} +1 -1
- package/dist/cobalt/{p-aaca6dab.entry.js → p-71ee36a8.entry.js} +1 -1
- package/dist/cobalt/p-71fe35c4.entry.js +1 -0
- package/dist/cobalt/{p-08e42e00.entry.js → p-73313cbe.entry.js} +1 -1
- package/dist/cobalt/{p-7b5c555c.entry.js → p-763698b3.entry.js} +1 -1
- package/dist/cobalt/p-77e0d401.entry.js +1 -0
- package/dist/cobalt/{p-c91d4fc6.entry.js → p-78412feb.entry.js} +1 -1
- package/dist/cobalt/p-7beface1.entry.js +1 -0
- package/dist/cobalt/{p-f4e1c3c3.entry.js → p-7d1718ed.entry.js} +1 -1
- package/dist/cobalt/{p-826ee074.entry.js → p-7df18a52.entry.js} +1 -1
- package/dist/cobalt/p-7e678cbd.entry.js +1 -0
- package/dist/cobalt/{p-d0b2c418.entry.js → p-7fabd8ba.entry.js} +1 -1
- package/dist/cobalt/{p-23ab0cc5.entry.js → p-848f5ca4.entry.js} +1 -1
- package/dist/cobalt/{p-623cc195.entry.js → p-8680559b.entry.js} +1 -1
- package/dist/cobalt/p-87de5469.entry.js +1 -0
- package/dist/cobalt/p-87e62e2b.entry.js +1 -0
- package/dist/cobalt/{p-1861fe41.entry.js → p-8a2a2b6c.entry.js} +1 -1
- package/dist/cobalt/p-903237f9.entry.js +1 -0
- package/dist/cobalt/{p-2c9dba2f.entry.js → p-95f2ebb1.entry.js} +1 -1
- package/dist/cobalt/{p-24196410.entry.js → p-99df434b.entry.js} +1 -1
- package/dist/cobalt/{p-290066ef.entry.js → p-9adbab95.entry.js} +1 -1
- package/dist/cobalt/p-9dc01092.entry.js +1 -0
- package/dist/cobalt/p-9ee5bef3.entry.js +1 -0
- package/dist/cobalt/p-B1JT7us1.js +1 -0
- package/dist/cobalt/{p-BRbgGqLw.js → p-BVGGRfNG.js} +1 -1
- package/dist/cobalt/p-BmdKHBZP.js +1 -0
- package/dist/cobalt/p-BtliEQAT.js +1 -0
- package/dist/cobalt/p-COJdaKBU.js +1 -0
- package/dist/cobalt/{p-BAYo-RBt.js → p-CRxTFT_z.js} +1 -1
- package/dist/cobalt/p-CYN5B3IQ.js +1 -0
- package/dist/cobalt/p-DJkaRtbb.js +2 -0
- package/dist/cobalt/p-DU-KOQ8L.js +1 -0
- package/dist/cobalt/p-DXLeDZvr.js +1 -0
- package/dist/cobalt/{p-D_zA1Pv4.js → p-DgJovDdy.js} +1 -1
- package/dist/cobalt/p-RVQJEYxa.js +1 -0
- package/dist/cobalt/{p-ee2023da.entry.js → p-a27013e6.entry.js} +1 -1
- package/dist/cobalt/{p-2f9cbbd5.entry.js → p-a4eb298c.entry.js} +1 -1
- package/dist/cobalt/p-a56bd4a8.entry.js +1 -0
- package/dist/cobalt/{p-59963937.entry.js → p-a5eabecb.entry.js} +1 -1
- package/dist/cobalt/p-a5ee1fc2.entry.js +1 -0
- package/dist/cobalt/{p-fb2d1144.entry.js → p-a7cd61ce.entry.js} +1 -1
- package/dist/cobalt/{p-39a50e7f.entry.js → p-ad752791.entry.js} +1 -1
- package/dist/cobalt/{p-07416e31.entry.js → p-ae999b94.entry.js} +1 -1
- package/dist/cobalt/{p-4d65e713.entry.js → p-aed832d5.entry.js} +1 -1
- package/dist/cobalt/p-b2457431.entry.js +1 -0
- package/dist/cobalt/{p-6dd220e0.entry.js → p-b39a4999.entry.js} +1 -1
- package/dist/cobalt/p-b5dabdc3.entry.js +1 -0
- package/dist/cobalt/{p-8471abe2.entry.js → p-b67fb616.entry.js} +1 -1
- package/dist/cobalt/{p-f7eb1a40.entry.js → p-b9b73dcb.entry.js} +1 -1
- package/dist/cobalt/{p-f9a7b7c6.entry.js → p-ba39a965.entry.js} +1 -1
- package/dist/cobalt/{p-58d9b650.entry.js → p-be520bd5.entry.js} +1 -1
- package/dist/cobalt/{p-1dc55e43.entry.js → p-bee30373.entry.js} +1 -1
- package/dist/cobalt/{p-44c4e4a3.entry.js → p-c220362c.entry.js} +1 -1
- package/dist/cobalt/p-c4c997f3.entry.js +1 -0
- package/dist/cobalt/{p-a2462d7a.entry.js → p-c5464a98.entry.js} +1 -1
- package/dist/cobalt/p-c567533e.entry.js +1 -0
- package/dist/cobalt/{p-c30b4cb5.entry.js → p-cf5b91be.entry.js} +1 -1
- package/dist/cobalt/p-cfaaa684.entry.js +1 -0
- package/dist/cobalt/p-d00c3894.entry.js +1 -0
- package/dist/cobalt/p-d1e83525.entry.js +1 -0
- package/dist/cobalt/{p-44ea675f.entry.js → p-d5d8fa8b.entry.js} +1 -1
- package/dist/cobalt/p-d6215d80.entry.js +1 -0
- package/dist/cobalt/p-d6e7c258.entry.js +1 -0
- package/dist/cobalt/p-dabcbba7.entry.js +1 -0
- package/dist/cobalt/p-db623519.entry.js +1 -0
- package/dist/cobalt/{p-c7d7d7f7.entry.js → p-df529110.entry.js} +1 -1
- package/dist/cobalt/{p-1cc818ca.entry.js → p-ea24eea8.entry.js} +1 -1
- package/dist/cobalt/{p-d29bb0fa.entry.js → p-efb3cbb0.entry.js} +1 -1
- package/dist/cobalt/{p-f6691108.entry.js → p-f0898e21.entry.js} +1 -1
- package/dist/cobalt/{p-0c004735.entry.js → p-f2fa2ac0.entry.js} +1 -1
- package/dist/cobalt/p-f403eeec.entry.js +1 -0
- package/dist/cobalt/{p-e4264532.entry.js → p-f69804a6.entry.js} +1 -1
- package/dist/cobalt/p-xnrKkNWQ.js +1 -0
- package/dist/collection/collection-manifest.json +8 -0
- package/dist/collection/components/co-accordion/co-accordion.js +12 -2
- package/dist/collection/components/co-action-bar/co-action-bar.css +6 -0
- package/dist/collection/components/co-action-bar/co-action-bar.js +3 -2
- package/dist/collection/components/co-app-shell/co-app-shell.css +6 -0
- package/dist/collection/components/co-app-shell/co-app-shell.js +13 -2
- package/dist/collection/components/co-audio-player/co-audio-player.js +19 -7
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +30 -17
- package/dist/collection/components/co-avatar/co-avatar.css +16 -2
- package/dist/collection/components/co-avatar/co-avatar.js +14 -4
- package/dist/collection/components/co-avatar-group/co-avatar-group.css +4 -0
- package/dist/collection/components/co-avatar-group/co-avatar-group.js +8 -3
- package/dist/collection/components/co-badge/co-badge.js +8 -1
- package/dist/collection/components/co-bottom-sheet/co-bottom-sheet.js +13 -4
- package/dist/collection/components/co-breadcrumb/co-breadcrumb.js +5 -1
- package/dist/collection/components/co-breadcrumb-item/co-breadcrumb-item.js +8 -2
- package/dist/collection/components/co-button/co-button.css +81 -6
- package/dist/collection/components/co-button/co-button.js +39 -11
- package/dist/collection/components/co-button-group/co-button-group.js +10 -3
- package/dist/collection/components/co-calendar/calendarMarks.js +40 -0
- package/dist/collection/components/co-calendar/co-calendar.css +19 -1
- package/dist/collection/components/co-calendar/co-calendar.js +84 -20
- package/dist/collection/components/co-calendar-month/co-calendar-month.js +1 -1
- package/dist/collection/components/co-calendar-timegrid/co-calendar-timegrid.js +36 -19
- package/dist/collection/components/co-card/co-card.js +11 -2
- package/dist/collection/components/co-carousel/co-carousel.css +10 -0
- package/dist/collection/components/co-carousel/co-carousel.js +17 -5
- package/dist/collection/components/co-carousel-item/co-carousel-item.js +1 -1
- package/dist/collection/components/co-checkbox/co-checkbox.css +43 -1
- package/dist/collection/components/co-checkbox/co-checkbox.js +39 -3
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +9 -4
- package/dist/collection/components/co-chip/co-chip.css +9 -0
- package/dist/collection/components/co-chip/co-chip.js +15 -2
- package/dist/collection/components/co-color-area/co-color-area.css +87 -0
- package/dist/collection/components/co-color-area/co-color-area.js +342 -0
- package/dist/collection/components/co-color-picker/co-color-picker.js +4 -2
- package/dist/collection/components/co-color-slider/co-color-slider.css +115 -0
- package/dist/collection/components/co-color-slider/co-color-slider.js +354 -0
- package/dist/collection/components/co-column-picker/co-column-picker.js +51 -25
- package/dist/collection/components/co-combobox/co-combobox.js +18 -4
- package/dist/collection/components/co-command-search/co-command-search.js +19 -8
- package/dist/collection/components/co-data-table/co-data-table.js +8 -3
- package/dist/collection/components/co-data-table-pagination/co-data-table-pagination.js +16 -4
- package/dist/collection/components/co-date-field/co-date-field.js +19 -13
- package/dist/collection/components/co-date-picker/co-date-picker.js +38 -25
- package/dist/collection/components/co-date-range/co-date-range.js +19 -10
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +44 -30
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.js +31 -22
- package/dist/collection/components/co-document-editor/change-throttle.js +30 -0
- package/dist/collection/components/co-document-editor/co-document-editor.css +438 -0
- package/dist/collection/components/co-document-editor/co-document-editor.js +1549 -0
- package/dist/collection/components/co-document-editor/document-props.js +40 -0
- package/dist/collection/components/co-document-editor/header-tools.js +11 -0
- package/dist/collection/components/co-document-editor/image-bar.js +66 -0
- package/dist/collection/components/co-document-editor/page-styles.js +90 -0
- package/dist/collection/components/co-document-editor/zoom.js +45 -0
- package/dist/collection/components/co-drawer/co-drawer.css +5 -0
- package/dist/collection/components/co-drawer/co-drawer.js +13 -0
- package/dist/collection/components/co-drive-card/co-drive-card.js +14 -1
- package/dist/collection/components/co-drop-zone/co-drop-zone.js +7 -2
- package/dist/collection/components/co-emoji-picker/co-emoji-picker.css +4 -0
- package/dist/collection/components/co-emoji-picker/co-emoji-picker.js +11 -2
- package/dist/collection/components/co-empty-state/co-empty-state.js +4 -2
- package/dist/collection/components/co-event-calendar/co-event-calendar.js +16 -4
- package/dist/collection/components/co-event-popover/co-event-popover.js +18 -6
- package/dist/collection/components/co-fab/co-fab.css +8 -0
- package/dist/collection/components/co-fab/co-fab.js +17 -8
- package/dist/collection/components/co-file-field/co-file-field.js +16 -11
- package/dist/collection/components/co-file-type-tile/co-file-type-tile.js +9 -2
- package/dist/collection/components/co-gradient-bar/co-gradient-bar.css +143 -0
- package/dist/collection/components/co-gradient-bar/co-gradient-bar.js +412 -0
- package/dist/collection/components/co-helper-text/co-helper-text.js +4 -2
- package/dist/collection/components/co-icon/co-icon.js +6 -2
- package/dist/collection/components/co-icon-button/co-icon-button.css +104 -19
- package/dist/collection/components/co-icon-button/co-icon-button.js +125 -10
- package/dist/collection/components/co-input/co-input.css +125 -0
- package/dist/collection/components/co-input/co-input.js +48 -11
- package/dist/collection/components/co-json-field/co-json-field.js +19 -12
- package/dist/collection/components/co-kbd/co-kbd.css +99 -0
- package/dist/collection/components/co-kbd/co-kbd.js +298 -0
- package/dist/collection/components/co-lightbox/co-lightbox.js +4 -4
- package/dist/collection/components/co-list-footer/co-list-footer.js +4 -1
- package/dist/collection/components/co-list-item/co-list-item.js +7 -4
- package/dist/collection/components/co-loader/co-loader.js +5 -0
- package/dist/collection/components/co-media-thumb/co-media-thumb.js +9 -2
- package/dist/collection/components/co-menu/co-menu.css +70 -0
- package/dist/collection/components/co-menu/co-menu.js +146 -6
- package/dist/collection/components/co-menu-divider/co-menu-divider.css +21 -0
- package/dist/collection/components/co-menu-divider/co-menu-divider.js +2 -1
- package/dist/collection/components/co-menu-item/co-menu-item.css +56 -6
- package/dist/collection/components/co-menu-item/co-menu-item.js +60 -4
- package/dist/collection/components/co-modal/co-modal.css +218 -1
- package/dist/collection/components/co-modal/co-modal.js +354 -12
- package/dist/collection/components/co-navbar/co-navbar.css +7 -0
- package/dist/collection/components/co-navbar/co-navbar.js +4 -2
- package/dist/collection/components/co-number-field/co-number-field.js +29 -15
- package/dist/collection/components/co-option-list/co-option-list.css +102 -21
- package/dist/collection/components/co-option-list/co-option-list.js +37 -16
- package/dist/collection/components/co-overlay/co-overlay.css +4 -0
- package/dist/collection/components/co-overlay/co-overlay.js +17 -3
- package/dist/collection/components/co-page-header/co-page-header.js +4 -1
- package/dist/collection/components/co-phone-field/co-phone-field.js +1 -1
- package/dist/collection/components/co-popover/co-popover.css +20 -2
- package/dist/collection/components/co-popover/co-popover.js +148 -10
- package/dist/collection/components/co-progress-bar/co-progress-bar.js +5 -2
- package/dist/collection/components/co-progress-circle/co-progress-circle.js +5 -2
- package/dist/collection/components/co-provider-logo/co-provider-logo.js +3 -0
- package/dist/collection/components/co-radio/co-radio.js +11 -3
- package/dist/collection/components/co-radio-group/co-radio-group.js +9 -4
- package/dist/collection/components/co-rating/co-rating.js +25 -13
- package/dist/collection/components/co-ref-field/co-ref-field.css +14 -0
- package/dist/collection/components/co-ref-field/co-ref-field.js +55 -27
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +66 -111
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.css +12 -0
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.js +127 -19
- package/dist/collection/components/co-rich-text-viewer/co-rich-text-viewer.js +16 -1
- package/dist/collection/components/co-row/co-row.js +5 -2
- package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +9 -3
- package/dist/collection/components/co-select/co-select.css +207 -11
- package/dist/collection/components/co-select/co-select.js +198 -48
- package/dist/collection/components/co-select/virtualRows.js +57 -0
- package/dist/collection/components/co-separator/co-separator.js +8 -1
- package/dist/collection/components/co-sidebar/co-sidebar.js +10 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.css +15 -0
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +20 -4
- package/dist/collection/components/co-skeleton/co-skeleton.js +4 -1
- package/dist/collection/components/co-slider/co-slider.css +155 -5
- package/dist/collection/components/co-slider/co-slider.js +263 -32
- package/dist/collection/components/co-swatch-grid/co-swatch-grid.css +56 -0
- package/dist/collection/components/co-swatch-grid/co-swatch-grid.js +293 -0
- package/dist/collection/components/co-switch/co-switch.css +4 -0
- package/dist/collection/components/co-switch/co-switch.js +12 -3
- package/dist/collection/components/co-tab/co-tab.css +60 -0
- package/dist/collection/components/co-tab/co-tab.js +44 -6
- package/dist/collection/components/co-tab-group/co-tab-group.css +24 -0
- package/dist/collection/components/co-tab-group/co-tab-group.js +133 -2
- package/dist/collection/components/co-tab-group/revealTab.js +26 -0
- package/dist/collection/components/co-tags-field/co-tags-field.js +21 -14
- package/dist/collection/components/co-textarea/co-textarea.js +4 -4
- package/dist/collection/components/co-tile/co-tile.css +63 -0
- package/dist/collection/components/co-tile/co-tile.js +167 -0
- package/dist/collection/components/co-time-field/co-time-field.js +9 -4
- package/dist/collection/components/co-toast/co-toast.css +11 -0
- package/dist/collection/components/co-toast/co-toast.js +13 -4
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +106 -0
- package/dist/collection/components/co-toggle-button/co-toggle-button.js +91 -15
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.css +21 -0
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +41 -11
- package/dist/collection/components/co-tooltip/co-tooltip.css +36 -0
- package/dist/collection/components/co-tooltip/co-tooltip.js +61 -3
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +19 -10
- package/dist/collection/components/co-tree-item/co-tree-item.css +235 -0
- package/dist/collection/components/co-tree-item/co-tree-item.js +355 -0
- package/dist/collection/components/co-tree-item/treeItemI18n.js +16 -0
- package/dist/collection/components/co-video/co-video.css +11 -0
- package/dist/collection/components/co-video/co-video.js +41 -22
- package/dist/collection/utils/color.js +9 -5
- package/dist/collection/utils/dragMove.js +95 -0
- package/dist/collection/utils/gradientBarI18n.js +24 -0
- package/dist/collection/utils/gradientStops.js +142 -0
- package/dist/collection/utils/hsv.js +114 -0
- package/dist/collection/utils/kbdI18n.js +29 -0
- package/dist/collection/utils/positioning.js +44 -18
- package/dist/collection/utils/rich-text-host.js +109 -0
- package/dist/collection/utils/richTextI18n.js +45 -0
- package/dist/collection/utils/submenu.js +23 -3
- package/dist/collection/utils/swatchGridI18n.js +14 -0
- package/dist/collection/utils/test/fake-block-layout.js +41 -0
- package/dist/collection/utils/test/prosemirror-dom-shim.js +17 -0
- package/dist/collection/utils/test/shared-contract-css.js +9 -0
- package/dist/components/co-accordion.js +1 -1
- package/dist/components/co-action-bar.js +1 -1
- package/dist/components/co-app-shell.js +1 -1
- package/dist/components/co-audio-player.js +1 -1
- 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.js +1 -1
- 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-area.d.ts +11 -0
- package/dist/components/co-color-area.js +1 -0
- package/dist/components/co-color-picker.js +1 -1
- package/dist/components/co-color-slider.d.ts +11 -0
- package/dist/components/co-color-slider.js +1 -0
- 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.js +1 -1
- package/dist/components/co-document-editor.d.ts +11 -0
- package/dist/components/co-document-editor.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-emoji-picker.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.js +1 -1
- 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-gradient-bar.d.ts +11 -0
- package/dist/components/co-gradient-bar.js +1 -0
- 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-kbd.d.ts +11 -0
- package/dist/components/co-kbd.js +1 -0
- 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-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-rich-text-viewer.js +1 -1
- package/dist/components/co-row.js +1 -1
- package/dist/components/co-segmented-bar.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-swatch-grid.d.ts +11 -0
- package/dist/components/co-swatch-grid.js +1 -0
- 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-tile.d.ts +11 -0
- package/dist/components/co-tile.js +1 -0
- package/dist/components/co-time-field.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-tree-item.d.ts +11 -0
- package/dist/components/co-tree-item.js +1 -0
- package/dist/components/co-video.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-8XzG8pzY.js +1 -0
- package/dist/components/p-9VoFSbIH.js +1 -0
- package/dist/components/p-B1JT7us1.js +1 -0
- package/dist/components/{p-Dc_Kbari.js → p-B3Egz082.js} +1 -1
- package/dist/components/p-B9wdMd_0.js +1 -0
- package/dist/components/p-BRZci8B3.js +1 -0
- package/dist/components/{p-BRbgGqLw.js → p-BVGGRfNG.js} +1 -1
- package/dist/components/{p-B56LX2SH.js → p-BVdCvEza.js} +1 -1
- package/dist/components/p-BdmzslA5.js +1 -0
- package/dist/components/p-BmdKHBZP.js +1 -0
- package/dist/components/p-BtliEQAT.js +1 -0
- package/dist/components/{p-CT2enQ6h.js → p-Bw_b_czs.js} +1 -1
- package/dist/components/{p-NNxjElcX.js → p-C4sZjIDj.js} +1 -1
- package/dist/components/{p-Nt4JJxbL.js → p-C6WHpL5X.js} +1 -1
- package/dist/components/p-COJdaKBU.js +1 -0
- package/dist/components/p-COozgrEk.js +1 -0
- package/dist/components/{p-BAYo-RBt.js → p-CRxTFT_z.js} +1 -1
- package/dist/components/{p-uxdXViMV.js → p-CiYPJW0B.js} +1 -1
- package/dist/components/p-Cnfd6Zze.js +1 -0
- package/dist/components/{p-BhCVadcA.js → p-CxWo3qDo.js} +1 -1
- package/dist/components/p-D4XP17VP.js +1 -0
- package/dist/components/{p-e5KibEs8.js → p-DJ468fPu.js} +1 -1
- package/dist/components/p-DU-KOQ8L.js +1 -0
- package/dist/components/p-DXLeDZvr.js +1 -0
- package/dist/components/{p-DvR45CLa.js → p-Dn2wblrA.js} +1 -1
- package/dist/components/p-Dnz99Ox_.js +1 -0
- package/dist/components/p-DsuFNmTI.js +1 -0
- package/dist/components/{p-Du_CgT5E.js → p-Du8EpQb-.js} +1 -1
- package/dist/components/{p-DFlJMEJ-.js → p-DymSqdlK.js} +1 -1
- package/dist/components/p-Hi57w2_2.js +1 -0
- package/dist/components/{p-DNJAIVfI.js → p-KK2vAKs-.js} +1 -1
- package/dist/components/p-RVQJEYxa.js +1 -0
- package/dist/components/p-TGRbLkLz.js +1 -0
- package/dist/components/p-VcrjNCew.js +1 -0
- package/dist/components/{p-Dxa7c4Ap.js → p-dnaee7fS.js} +1 -1
- package/dist/components/p-nrwDl_gx.js +1 -0
- package/dist/components/{p-P4HlMBlL.js → p-zJ3pjFzW.js} +1 -1
- package/dist/esm/co-accordion.entry.js +3 -3
- package/dist/esm/co-action-bar.entry.js +3 -3
- package/dist/esm/co-app-shell.entry.js +3 -3
- package/dist/esm/co-audio-player.entry.js +4 -4
- package/dist/esm/co-autocomplete.entry.js +12 -5
- package/dist/esm/co-avatar-group.entry.js +3 -3
- package/dist/esm/co-avatar.entry.js +7 -4
- package/dist/esm/co-badge.entry.js +2 -2
- package/dist/esm/co-bottom-sheet.entry.js +5 -5
- package/dist/esm/co-breadcrumb-item.entry.js +3 -3
- package/dist/esm/co-breadcrumb.entry.js +2 -2
- package/dist/esm/co-button-group.entry.js +4 -3
- package/dist/esm/co-button.entry.js +9 -7
- package/dist/esm/co-calendar-month_2.entry.js +16 -4
- package/dist/esm/co-calendar_3.entry.js +76 -27
- package/dist/esm/co-card.entry.js +3 -3
- package/dist/esm/co-carousel-item.entry.js +2 -2
- package/dist/esm/co-carousel.entry.js +6 -3
- package/dist/esm/co-checkbox-group.entry.js +4 -4
- package/dist/esm/co-checkbox.entry.js +13 -5
- package/dist/esm/co-chip_2.entry.js +20 -7
- package/dist/esm/co-color-area.entry.js +167 -0
- package/dist/esm/co-color-picker.entry.js +5 -5
- package/dist/esm/co-color-slider.entry.js +187 -0
- package/dist/esm/co-column-picker.entry.js +23 -3
- package/dist/esm/co-combobox.entry.js +5 -5
- package/dist/esm/co-command-search.entry.js +5 -5
- package/dist/esm/co-data-table-pagination.entry.js +5 -5
- package/dist/esm/co-data-table.entry.js +3 -3
- package/dist/esm/co-date-picker.entry.js +10 -2
- package/dist/esm/co-date-range-picker.entry.js +11 -2
- package/dist/esm/co-date-range.entry.js +8 -2
- package/dist/esm/co-date-time-picker.entry.js +11 -4
- package/dist/esm/co-document-editor.entry.js +1165 -0
- package/dist/esm/co-drive-card.entry.js +2 -2
- package/dist/esm/co-drop-zone.entry.js +2 -2
- package/dist/esm/co-emoji-picker.entry.js +3 -3
- package/dist/esm/co-empty-state.entry.js +3 -3
- package/dist/esm/co-event-calendar.entry.js +5 -3
- package/dist/esm/co-event-popover.entry.js +7 -3
- package/dist/esm/co-fab.entry.js +7 -3
- package/dist/esm/co-file-field.entry.js +12 -8
- package/dist/esm/co-file-type-tile.entry.js +3 -3
- package/dist/esm/co-gradient-bar.entry.js +218 -0
- package/dist/esm/co-helper-text.entry.js +3 -3
- package/dist/esm/co-icon-button.entry.js +48 -9
- package/dist/esm/co-icon.entry.js +3 -3
- package/dist/esm/co-input.entry.js +14 -8
- package/dist/esm/co-json-field.entry.js +10 -5
- package/dist/esm/{co-tooltip.entry.js → co-kbd_2.entry.js} +194 -7
- package/dist/esm/co-lightbox.entry.js +5 -5
- package/dist/esm/co-list-footer.entry.js +2 -2
- package/dist/esm/co-list-item.entry.js +5 -5
- package/dist/esm/co-loader.entry.js +1 -1
- package/dist/esm/co-media-thumb.entry.js +3 -3
- package/dist/esm/co-menu-divider.entry.js +3 -3
- package/dist/esm/co-menu-item.entry.js +39 -41
- package/dist/esm/co-menu.entry.js +81 -5
- package/dist/esm/co-modal.entry.js +350 -7
- package/dist/esm/co-navbar.entry.js +3 -3
- package/dist/esm/co-number-field.entry.js +11 -5
- package/dist/esm/co-overlay.entry.js +8 -4
- package/dist/esm/co-page-header.entry.js +2 -2
- package/dist/esm/co-phone-field.entry.js +3 -3
- package/dist/esm/co-popover.entry.js +69 -6
- package/dist/esm/co-progress-bar.entry.js +3 -3
- package/dist/esm/co-progress-circle.entry.js +3 -3
- package/dist/esm/co-provider-logo_2.entry.js +2 -2
- package/dist/esm/co-radio-group.entry.js +4 -4
- package/dist/esm/co-radio.entry.js +4 -4
- package/dist/esm/co-rating.entry.js +11 -4
- package/dist/esm/co-ref-field.entry.js +14 -5
- package/dist/esm/co-rich-text-editor.entry.js +40 -92
- package/dist/esm/co-rich-text-toolbar.entry.js +80 -20
- package/dist/esm/co-rich-text-viewer.entry.js +9 -2
- package/dist/esm/co-row.entry.js +3 -3
- package/dist/esm/co-segmented-bar.entry.js +3 -3
- package/dist/esm/co-select.entry.js +171 -29
- package/dist/esm/co-separator.entry.js +2 -2
- package/dist/esm/co-sidebar-nav.entry.js +20 -5
- package/dist/esm/co-sidebar.entry.js +3 -3
- package/dist/esm/co-slider.entry.js +209 -23
- package/dist/esm/co-swatch-grid.entry.js +119 -0
- package/dist/esm/co-switch.entry.js +5 -5
- package/dist/esm/co-tab-group.entry.js +113 -4
- package/dist/esm/co-tab.entry.js +15 -5
- package/dist/esm/co-tags-field.entry.js +13 -8
- package/dist/esm/co-textarea.entry.js +6 -6
- package/dist/esm/co-tile.entry.js +59 -0
- package/dist/esm/co-time-field.entry.js +5 -2
- package/dist/esm/co-toast.entry.js +3 -3
- package/dist/esm/co-toggle-button-group.entry.js +29 -5
- package/dist/esm/co-toggle-button.entry.js +70 -6
- package/dist/esm/co-transfer-list.entry.js +7 -3
- package/dist/esm/co-tree-item.entry.js +108 -0
- package/dist/esm/co-video.entry.js +11 -3
- package/dist/esm/cobalt.js +3 -3
- package/dist/esm/{color-BRbgGqLw.js → color-BVGGRfNG.js} +10 -6
- package/dist/esm/{fieldChip-uyggU8VV.js → fieldChip-B2ctp2m6.js} +1 -1
- package/dist/esm/gradientStops-DDK0y8ra.js +145 -0
- package/dist/esm/hsv-COJdaKBU.js +90 -0
- package/dist/esm/index-Cpo8HTwr.js +142 -0
- package/dist/esm/{index-DH5lfRNj.js → index-DJkaRtbb.js} +67 -28
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{index-BBIYyvq-.js → pagination-D9OfZUnY.js} +1728 -297
- package/dist/esm/{positioning-DFHRS9cJ.js → positioning-BtliEQAT.js} +45 -19
- package/dist/esm/{requiredMark-BCJUuZvC.js → requiredMark-D5C5NzOE.js} +1 -1
- package/dist/esm/rich-text-host-BmdKHBZP.js +111 -0
- package/dist/esm/{richTextI18n-BYKAgwq3.js → richTextI18n-xnrKkNWQ.js} +45 -0
- package/dist/esm/submenu-DU-KOQ8L.js +57 -0
- package/dist/esm/{toolbar-config-BAYo-RBt.js → toolbar-config-CRxTFT_z.js} +32 -0
- package/dist/types/components/co-accordion/co-accordion.d.ts +10 -0
- package/dist/types/components/co-action-bar/co-action-bar.d.ts +1 -0
- package/dist/types/components/co-app-shell/co-app-shell.d.ts +11 -0
- package/dist/types/components/co-audio-player/co-audio-player.d.ts +16 -0
- package/dist/types/components/co-autocomplete/co-autocomplete.d.ts +21 -0
- package/dist/types/components/co-avatar/co-avatar.d.ts +11 -2
- package/dist/types/components/co-avatar-group/co-avatar-group.d.ts +5 -0
- package/dist/types/components/co-badge/co-badge.d.ts +7 -0
- package/dist/types/components/co-bottom-sheet/co-bottom-sheet.d.ts +9 -0
- package/dist/types/components/co-breadcrumb/co-breadcrumb.d.ts +4 -0
- package/dist/types/components/co-breadcrumb-item/co-breadcrumb-item.d.ts +6 -0
- package/dist/types/components/co-button/co-button.d.ts +12 -4
- package/dist/types/components/co-button-group/co-button-group.d.ts +7 -0
- package/dist/types/components/co-calendar/calendarMarks.d.ts +15 -0
- package/dist/types/components/co-calendar/co-calendar.d.ts +18 -0
- package/dist/types/components/co-calendar-timegrid/co-calendar-timegrid.d.ts +23 -0
- package/dist/types/components/co-card/co-card.d.ts +9 -0
- package/dist/types/components/co-carousel/co-carousel.d.ts +12 -0
- package/dist/types/components/co-checkbox/co-checkbox.d.ts +15 -0
- package/dist/types/components/co-checkbox-group/co-checkbox-group.d.ts +5 -0
- package/dist/types/components/co-chip/co-chip.d.ts +13 -0
- package/dist/types/components/co-color-area/co-color-area.d.ts +65 -0
- package/dist/types/components/co-color-picker/co-color-picker.d.ts +2 -0
- package/dist/types/components/co-color-slider/co-color-slider.d.ts +62 -0
- package/dist/types/components/co-column-picker/co-column-picker.d.ts +32 -0
- package/dist/types/components/co-combobox/co-combobox.d.ts +14 -0
- package/dist/types/components/co-command-search/co-command-search.d.ts +15 -0
- package/dist/types/components/co-data-table/co-data-table.d.ts +5 -0
- package/dist/types/components/co-data-table-pagination/co-data-table-pagination.d.ts +12 -0
- package/dist/types/components/co-date-field/co-date-field.d.ts +11 -0
- package/dist/types/components/co-date-picker/co-date-picker.d.ts +30 -0
- package/dist/types/components/co-date-range/co-date-range.d.ts +12 -0
- package/dist/types/components/co-date-range-picker/co-date-range-picker.d.ts +33 -0
- package/dist/types/components/co-date-time-picker/co-date-time-picker.d.ts +22 -1
- package/dist/types/components/co-document-editor/change-throttle.d.ts +9 -0
- package/dist/types/components/co-document-editor/co-document-editor.d.ts +284 -0
- package/dist/types/components/co-document-editor/document-props.d.ts +6 -0
- package/dist/types/components/co-document-editor/header-tools.d.ts +11 -0
- package/dist/types/components/co-document-editor/image-bar.d.ts +50 -0
- package/dist/types/components/co-document-editor/page-styles.d.ts +1 -0
- package/dist/types/components/co-document-editor/zoom.d.ts +26 -0
- package/dist/types/components/co-drawer/co-drawer.d.ts +13 -0
- package/dist/types/components/co-drive-card/co-drive-card.d.ts +13 -0
- package/dist/types/components/co-drop-zone/co-drop-zone.d.ts +6 -1
- package/dist/types/components/co-emoji-picker/co-emoji-picker.d.ts +9 -0
- package/dist/types/components/co-empty-state/co-empty-state.d.ts +2 -0
- package/dist/types/components/co-event-calendar/co-event-calendar.d.ts +12 -16
- package/dist/types/components/co-event-popover/co-event-popover.d.ts +13 -0
- package/dist/types/components/co-fab/co-fab.d.ts +11 -0
- package/dist/types/components/co-file-field/co-file-field.d.ts +6 -0
- package/dist/types/components/co-file-type-tile/co-file-type-tile.d.ts +7 -0
- package/dist/types/components/co-gradient-bar/co-gradient-bar.d.ts +77 -0
- package/dist/types/components/co-helper-text/co-helper-text.d.ts +2 -0
- package/dist/types/components/co-icon/co-icon.d.ts +4 -0
- package/dist/types/components/co-icon-button/co-icon-button.d.ts +39 -2
- package/dist/types/components/co-input/co-input.d.ts +25 -5
- package/dist/types/components/co-json-field/co-json-field.d.ts +11 -0
- package/dist/types/components/co-kbd/co-kbd.d.ts +50 -0
- package/dist/types/components/co-list-footer/co-list-footer.d.ts +3 -0
- package/dist/types/components/co-list-item/co-list-item.d.ts +3 -0
- package/dist/types/components/co-loader/co-loader.d.ts +5 -0
- package/dist/types/components/co-media-thumb/co-media-thumb.d.ts +7 -0
- package/dist/types/components/co-menu/co-menu.d.ts +42 -1
- package/dist/types/components/co-menu-divider/co-menu-divider.d.ts +1 -0
- package/dist/types/components/co-menu-item/co-menu-item.d.ts +19 -0
- package/dist/types/components/co-modal/co-modal.d.ts +126 -5
- package/dist/types/components/co-navbar/co-navbar.d.ts +2 -0
- package/dist/types/components/co-number-field/co-number-field.d.ts +20 -0
- package/dist/types/components/co-option-list/co-option-list.d.ts +29 -1
- package/dist/types/components/co-option-list/optionListLogic.d.ts +3 -0
- package/dist/types/components/co-overlay/co-overlay.d.ts +10 -0
- package/dist/types/components/co-page-header/co-page-header.d.ts +3 -0
- package/dist/types/components/co-popover/co-popover.d.ts +51 -0
- package/dist/types/components/co-progress-bar/co-progress-bar.d.ts +3 -0
- package/dist/types/components/co-progress-circle/co-progress-circle.d.ts +3 -0
- package/dist/types/components/co-provider-logo/co-provider-logo.d.ts +3 -0
- package/dist/types/components/co-radio/co-radio.d.ts +8 -0
- package/dist/types/components/co-radio-group/co-radio-group.d.ts +5 -0
- package/dist/types/components/co-rating/co-rating.d.ts +15 -0
- package/dist/types/components/co-ref-field/co-ref-field.d.ts +42 -0
- package/dist/types/components/co-rich-text-editor/co-rich-text-editor.d.ts +31 -5
- package/dist/types/components/co-rich-text-toolbar/co-rich-text-toolbar.d.ts +20 -2
- package/dist/types/components/co-rich-text-viewer/co-rich-text-viewer.d.ts +8 -0
- package/dist/types/components/co-row/co-row.d.ts +3 -0
- package/dist/types/components/co-segmented-bar/co-segmented-bar.d.ts +6 -0
- package/dist/types/components/co-select/co-select.d.ts +73 -5
- package/dist/types/components/co-select/virtualRows.d.ts +44 -0
- package/dist/types/components/co-separator/co-separator.d.ts +7 -0
- package/dist/types/components/co-sidebar/co-sidebar.d.ts +8 -0
- package/dist/types/components/co-sidebar-nav/co-sidebar-nav.d.ts +1 -0
- package/dist/types/components/co-skeleton/co-skeleton.d.ts +3 -0
- package/dist/types/components/co-slider/co-slider.d.ts +160 -1
- package/dist/types/components/co-swatch-grid/co-swatch-grid.d.ts +38 -0
- package/dist/types/components/co-switch/co-switch.d.ts +9 -0
- package/dist/types/components/co-tab/co-tab.d.ts +20 -2
- package/dist/types/components/co-tab-group/co-tab-group.d.ts +46 -0
- package/dist/types/components/co-tab-group/revealTab.d.ts +29 -0
- package/dist/types/components/co-tags-field/co-tags-field.d.ts +11 -0
- package/dist/types/components/co-tile/co-tile.d.ts +45 -0
- package/dist/types/components/co-time-field/co-time-field.d.ts +5 -0
- package/dist/types/components/co-toast/co-toast.d.ts +9 -0
- package/dist/types/components/co-toggle-button/co-toggle-button.d.ts +45 -2
- package/dist/types/components/co-toggle-button-group/co-toggle-button-group.d.ts +30 -2
- package/dist/types/components/co-tooltip/co-tooltip.d.ts +22 -0
- package/dist/types/components/co-transfer-list/co-transfer-list.d.ts +12 -0
- package/dist/types/components/co-tree-item/co-tree-item.d.ts +75 -0
- package/dist/types/components/co-tree-item/treeItemI18n.d.ts +6 -0
- package/dist/types/components/co-video/co-video.d.ts +31 -0
- package/dist/types/components.d.ts +3905 -85
- package/dist/types/utils/color.d.ts +9 -1
- package/dist/types/utils/dragMove.d.ts +63 -0
- package/dist/types/utils/gradientBarI18n.d.ts +8 -0
- package/dist/types/utils/gradientStops.d.ts +63 -0
- package/dist/types/utils/hsv.d.ts +44 -0
- package/dist/types/utils/kbdI18n.d.ts +25 -0
- package/dist/types/utils/positioning.d.ts +24 -0
- package/dist/types/utils/rich-text-host.d.ts +41 -0
- package/dist/types/utils/richTextI18n.d.ts +15 -0
- package/dist/types/utils/submenu.d.ts +16 -2
- package/dist/types/utils/swatchGridI18n.d.ts +6 -0
- package/dist/types/utils/test/fake-block-layout.d.ts +7 -0
- package/dist/types/utils/test/prosemirror-dom-shim.d.ts +1 -0
- package/dist/types/utils/test/shared-contract-css.d.ts +9 -0
- package/package.json +5 -5
- package/dist/cobalt/p-0678c797.entry.js +0 -1
- package/dist/cobalt/p-1d3a79af.entry.js +0 -1
- package/dist/cobalt/p-216a63ee.entry.js +0 -1
- package/dist/cobalt/p-3d31c575.entry.js +0 -1
- package/dist/cobalt/p-416795f5.entry.js +0 -1
- package/dist/cobalt/p-56551580.entry.js +0 -1
- package/dist/cobalt/p-58137c9e.entry.js +0 -1
- package/dist/cobalt/p-5a3e4c81.entry.js +0 -1
- package/dist/cobalt/p-5c756787.entry.js +0 -1
- package/dist/cobalt/p-67f3b9d6.entry.js +0 -1
- package/dist/cobalt/p-6a4f3179.entry.js +0 -1
- package/dist/cobalt/p-71cbc53c.entry.js +0 -1
- package/dist/cobalt/p-72e52af7.entry.js +0 -1
- package/dist/cobalt/p-8530ad16.entry.js +0 -1
- package/dist/cobalt/p-8a74bf7d.entry.js +0 -1
- package/dist/cobalt/p-8e05b979.entry.js +0 -1
- package/dist/cobalt/p-8ebc0c12.entry.js +0 -1
- package/dist/cobalt/p-8f2199ff.entry.js +0 -1
- package/dist/cobalt/p-9246e09c.entry.js +0 -1
- package/dist/cobalt/p-99a655f6.entry.js +0 -1
- package/dist/cobalt/p-BYKAgwq3.js +0 -1
- package/dist/cobalt/p-CJW9H3Gi.js +0 -1
- package/dist/cobalt/p-DFHRS9cJ.js +0 -1
- package/dist/cobalt/p-DH5lfRNj.js +0 -2
- package/dist/cobalt/p-a1b422ca.entry.js +0 -1
- package/dist/cobalt/p-ade07307.entry.js +0 -1
- package/dist/cobalt/p-b0762fd8.entry.js +0 -1
- package/dist/cobalt/p-b698188c.entry.js +0 -1
- package/dist/cobalt/p-bde32f8b.entry.js +0 -1
- package/dist/cobalt/p-d375014b.entry.js +0 -1
- package/dist/cobalt/p-db805569.entry.js +0 -1
- package/dist/cobalt/p-e3aae282.entry.js +0 -1
- package/dist/cobalt/p-e49a564c.entry.js +0 -1
- package/dist/cobalt/p-ef301976.entry.js +0 -1
- package/dist/cobalt/p-fMqVDypp.js +0 -1
- package/dist/components/p-2EOI1nrz.js +0 -1
- package/dist/components/p-7TncUlLN.js +0 -1
- package/dist/components/p-B4NCaKrR.js +0 -1
- package/dist/components/p-BGDqldEg.js +0 -1
- package/dist/components/p-BJh68Jqe.js +0 -1
- package/dist/components/p-BrAFTkAn.js +0 -1
- package/dist/components/p-Bsh0JMGf.js +0 -1
- package/dist/components/p-CJW9H3Gi.js +0 -1
- package/dist/components/p-CWCYYQrF.js +0 -1
- package/dist/components/p-D9T7zKeL.js +0 -1
- package/dist/components/p-DFHRS9cJ.js +0 -1
- package/dist/components/p-DTPYZwaZ.js +0 -1
- package/dist/components/p-Dcg4krSX.js +0 -1
- package/dist/components/p-Dh8ffSjK.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as i,H as o,c as t,h as r}from"./index.js";import{R as a}from"./p-CWneqh4n.js";import{g as s,f as c}from"./p-gKnOhsd2.js";import{d as l}from"./p-DNJAIVfI.js";import{d as n}from"./p-Dc_Kbari.js";import{d}from"./p-Bsh0JMGf.js";import{d as f}from"./p-DFlJMEJ-.js";function h(e){if(null==e||isNaN(e))return"";if(e<1024)return e+" B";const i=e=>e.toFixed(2).replace(/\.?0+$/,"");return e<1048576?i(e/1024)+" KB":i(e/1048576)+" MB"}const p=new Set(["png","jpg","jpeg","gif","webp","svg","avif","bmp"]),u=new Set(["mp4","mov","webm","m4v","ogv"]);function v(e){const i=(e||"").split("?")[0],o=i.lastIndexOf(".");return o>=0?i.slice(o+1).toLowerCase():""}function m(e){return v(e.name)||v(e.url)}function _(e){return p.has(m(e))}function b(e){return u.has(m(e))}function g(e){return"done"===e.status&&!!e.url&&b(e)}function y(e){return b(e)||_(e)?e.url||e.thumbnail:e.thumbnail||e.url}const x=i(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coFilesSelected=t(this,"coFilesSelected",3),this.coRemove=t(this,"coRemove",3),this.coClear=t(this,"coClear",3),this.coReorder=t(this,"coReorder",3),this.coCopy=t(this,"coCopy",3),this.coPreviewOpen=t(this,"coPreviewOpen",3),this.disabled=!1,this.readonly=!1,this.required=!1,this.multiple=!1,this.maxFiles=100,this.status="default",this.layout="vertical",this.reorderable=!0,this.files="[]",this.dragOver=!1,this.localError="",this.copiedKey="",this.armedKey="",this.dragKey="",this.overKey="",this.failedPreviews=new Set,this.tempSeq=0,this.lastFilesStr="",this.lastParsed=[],this.handleDragOver=e=>{this.disabled||this.readonly||this.dragKey||(e.preventDefault(),this.dragOver=!0)},this.handleDragLeave=e=>{const i=e.relatedTarget;i&&e.currentTarget instanceof Node&&e.currentTarget.contains(i)||(this.dragOver=!1)},this.handleDrop=e=>{var i;e.preventDefault(),this.dragOver=!1,this.dragKey||(null===(i=e.dataTransfer)||void 0===i?void 0:i.files)&&this.handleFiles(e.dataTransfer.files)},this.handleBrowse=e=>{var i;this.disabled||this.readonly||e&&this.fromActionsSlot(e)||null===(i=this.inputEl)||void 0===i||i.click()},this.handleInputChange=e=>{const i=e.target;i.files&&this.handleFiles(i.files),i.value=""},this.disarmDrag=()=>{this.armedKey&&!this.dragKey&&(this.armedKey="")},this.handleRowDragEnd=()=>{this.resetDragState()}}componentWillLoad(){this.failedPreviews||(this.failedPreviews=new Set)}connectedCallback(){window.addEventListener("mouseup",this.disarmDrag)}disconnectedCallback(){window.removeEventListener("mouseup",this.disarmDrag),clearTimeout(this.copiedTimer),this.closeLightbox()}get parsedFiles(){const e=this.files;if("string"!=typeof e||!e.trim())return[];if(e===this.lastFilesStr)return this.lastParsed;let i=[];try{const o=JSON.parse(e);Array.isArray(o)&&(i=o)}catch(e){}return this.lastFilesStr=e,this.lastParsed=i,i}get strings(){return s(this.locale)}get acceptList(){const e=this.accept;if(!e)return[];let i=[];try{const o=JSON.parse(e);Array.isArray(o)&&(i=o.map(String))}catch(o){i=e.split(",")}return i.map((e=>e.trim().toLowerCase().replace(/^\./,""))).filter((e=>e&&"*"!==e))}get isInvalid(){return"error"===this.status||!!this.localError}get inputAccept(){const e=this.acceptList;if(e.length)return e.map((e=>e.includes("/")?e:"."+e)).join(",")}extOf(e){const i=e.lastIndexOf(".");return i>=0?e.slice(i+1).toLowerCase():""}validate(e){const i=this.acceptList;if(i.length){const o=this.extOf(e.name),t=i.includes(o),r=i.some((i=>i.includes("/")&&e.type===i));if(!t&&!r)return c(this.strings.errInvalidFormat,{x:o})}return this.maxBytes&&e.size>this.maxBytes?c(this.strings.errTooLarge,{x:h(e.size)}):null}handleFiles(e){if(this.disabled||this.readonly)return;this.localError="";const i=Array.from(e);if(!i.length)return;const o=this.multiple?i:i.slice(0,1);if(this.multiple){const e=this.maxFiles-this.parsedFiles.length;if(e<=0)return void(this.localError=c(this.strings.errMaxFiles,{n:this.maxFiles}));o.length>e&&(o.length=e)}const t=[],r=[];for(const e of o){const i=this.validate(e);i?this.localError=i:(t.push(e),r.push(`tmp-${Date.now()}-${this.tempSeq++}`))}t.length&&this.coFilesSelected.emit({files:t,tempIds:r})}fromActionsSlot(e){return e.composedPath().some((e=>{var i,o;return"actions"===(null===(o=(i=e).getAttribute)||void 0===o?void 0:o.call(i,"slot"))}))}keyFor(e){var i;return e.id||e.tempId||`${e.name}:${null!==(i=e.size)&&void 0!==i?i:""}`}handleCopy(e){var i;const o=e.url||"";if(!o)return;const t=this.keyFor(e);this.coCopy.emit({id:t,url:o}),(null===(i=navigator.clipboard)||void 0===i?void 0:i.writeText)&&navigator.clipboard.writeText(o).then((()=>{this.copiedKey=t,clearTimeout(this.copiedTimer),this.copiedTimer=setTimeout((()=>this.copiedKey=""),1500)})).catch((()=>{}))}previewItems(){return this.parsedFiles.filter((e=>function(e){return function(e){return"done"===e.status&&!g(e)&&!(!e.thumbnail&&!e.url)&&(!!e.thumbnail||_(e))}(e)||g(e)}(e)&&(g(e)||!this.failedPreviews.has(this.keyFor(e)))))}handlePreviewOpen(e){const i=e.url||e.thumbnail;if(!i)return;this.coPreviewOpen.emit({id:this.keyFor(e),url:i});const o=this.previewItems(),t=o.map((e=>g(e)?{src:y(e),thumbnail:e.thumbnail,alt:e.name,kind:"video",poster:e.thumbnail}:{src:y(e),thumbnail:e.thumbnail,alt:e.name})),r=Math.max(0,o.findIndex((i=>this.keyFor(i)===this.keyFor(e))));this.closeLightbox();const a=document.createElement("co-lightbox");a.images=JSON.stringify(t),a.startIndex=r,this.locale&&(a.locale=this.locale),a.addEventListener("coClose",(()=>this.closeLightbox())),document.body.appendChild(a),this.lightboxEl=a,requestAnimationFrame((()=>{a.open=!0}))}closeLightbox(){const e=this.lightboxEl;this.lightboxEl=void 0,e&&(e.open=!1,setTimeout((()=>e.remove()),220))}handlePreviewError(e){this.failedPreviews=new Set([...this.failedPreviews,this.keyFor(e)])}handleRowDragStart(e,i){this.armedKey===i?(this.dragKey=i,e.dataTransfer&&(e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",i))):e.preventDefault()}handleRowDragOver(e,i){this.dragKey&&this.dragKey!==i&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move"),this.overKey=i)}handleRowDrop(e,i){e.preventDefault(),e.stopPropagation();const o=this.parsedFiles.map((e=>this.keyFor(e))),t=o.indexOf(this.dragKey),r=o.indexOf(i);this.resetDragState(),t<0||r<0||t===r||(o.splice(r,0,...o.splice(t,1)),this.coReorder.emit(o))}resetDragState(){this.armedKey="",this.dragKey="",this.overKey=""}capacityHint(e){const i=this.maxBytes?h(this.maxBytes):"";return this.multiple&&this.maxBytes?c(e.helperBoth,{n:this.maxFiles,x:i}):this.multiple?c(e.helperFiles,{n:this.maxFiles}):this.maxBytes?c(e.helperBytes,{x:i}):""}render(){const e=this.strings,i=this.parsedFiles,o=this.localError||this.helperText,t=!(this.readonly||(this.multiple?this.multiple&&i.length>=this.maxFiles:0!==i.length)),s="default"!==this.status?"co-file-field--"+this.status:"",c=this.previewItems(),l=this.reorderable&&this.multiple&&!this.disabled&&!this.readonly&&i.length>1,n=this.capacityHint(e);return r("div",{key:"47a8258c141901fcb3621a24d638f0849946172e",class:{"co-file-field":!0,"co-file-field--disabled":this.disabled,"co-file-field--invalid":this.isInvalid,[s]:!!s},part:"wrapper"},this.label&&r("div",{key:"603d04815a5730f45a2462d6c2904de4c7aa83af",class:"co-file-field__labels"},r("label",{key:"e280970feef1f6fad7c9ce336a5002746231a7c6",class:"co-file-field__label",part:"label"},this.label,r(a,{key:"075b35392df1a5be556dcc9dcbd2130d0a3c91a1",required:this.required}))),t&&r("div",{key:"d9dec9f08bc063239bd7b75acc43813ab3f9aebb",class:{"co-file-field__dropzone":!0,"co-file-field__dropzone--drag":this.dragOver},part:"dropzone",role:"button",tabIndex:this.disabled?-1:0,onClick:this.handleBrowse,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||this.fromActionsSlot(e)||(e.preventDefault(),this.handleBrowse())},onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},r("button",{key:"61afb508be3e46257e2ffdb2bdc62d66e37055ed",class:"co-file-field__upload-btn",part:"upload-button",type:"button",tabIndex:-1},r("co-icon",{key:"96bb8ef3107abbee44fb5bd7c80ff2cbf39915ec",name:"file-arrow-up",size:18}),r("span",{key:"53950664f09064e29d1427530058e0634b287a92"},this.uploadButtonText||e.uploadButton)),r("span",{key:"de085f9dac492ea1b7db278a34e25ec2a8baa1d3",class:"co-file-field__dropzone-text"},this.dropText||e.dropHint),n&&r("span",{key:"1617a52c9773a31ff8617e7310401a95911ecc2f",class:"co-file-field__dropzone-hint"},n),r("div",{key:"f6f07691b5ec339f2ae0fa302415dd3dba04fe69",class:"co-file-field__actions",part:"actions"},r("slot",{key:"b5332b03438a34a82ffb565b1d2901a69729af61",name:"actions"})),r("input",{key:"5d0089ebcd857f1fa97bedcd743ab0530e75715a",ref:e=>this.inputEl=e,class:"co-file-field__input",type:"file",multiple:this.multiple,accept:this.inputAccept,disabled:this.disabled,onChange:this.handleInputChange,"aria-hidden":"true",tabIndex:-1})),i.length>0&&r("div",{key:"cec19c438ec510dbae564c33dd3e6b739e156294",class:"co-file-field__uploaded"},this.multiple&&r("div",{key:"e97f2fe09fb30521d5b22238d2714d8f1002a2ed",class:"co-file-field__uploaded-title",part:"uploaded-title"},`${this.uploadedTitle||e.uploadedTitle} (${i.length})`),c.length>0&&r("div",{key:"569f37799d34182ff00996dd011232daf7f141a8",class:"co-file-field__previews",part:"previews"},c.map((i=>{const o=this.keyFor(i),t=g(i),a=this.failedPreviews.has(o)?"":i.thumbnail;return r("button",{class:{"co-file-field__preview":!0,"co-file-field__preview--video":t},part:"preview",type:"button",key:"prev-"+o,title:i.name,"aria-label":`${t?e.playVideo:e.openPreview}: ${i.name}`,onClick:()=>this.handlePreviewOpen(i)},(!t||!!a)&&r("img",{src:t?a:i.thumbnail||i.url,alt:i.name,loading:"lazy",onError:()=>this.handlePreviewError(i)}),t&&r("span",{class:"co-file-field__preview-play","aria-hidden":"true"},r("span",{class:"co-file-field__preview-play-badge"},r("co-icon",{name:"play",size:20,weight:"fill"})),!a&&r("span",{class:"co-file-field__preview-ext"},m(i).toUpperCase())))}))),r("ul",{key:"2de5c71b79f82cd50c5aea5818d9848956eeb1eb",class:"co-file-field__list",part:"list"},i.map((i=>{const o=this.keyFor(i),t=l&&"done"===i.status;return r("li",{class:{"co-file-field__row":!0,["co-file-field__row--"+i.status]:!0,"co-file-field__row--dragging":this.dragKey===o,"co-file-field__row--drop-target":this.overKey===o},part:"row",key:o,draggable:this.armedKey===o,onDragStart:e=>this.handleRowDragStart(e,o),onDragOver:e=>this.handleRowDragOver(e,o),onDrop:e=>this.handleRowDrop(e,o),onDragEnd:this.handleRowDragEnd},t?r("co-tooltip",{content:e.dragToReorder},r("span",{class:"co-file-field__drag-handle",part:"drag-handle",onMouseDown:()=>this.armedKey=o},r("co-icon",{name:"list",size:18}))):r("co-icon",{name:"error"===i.status?"warning-circle":"uploading"===i.status?"spinner-gap":"file",size:18,class:{"co-file-field__row-icon":!0,"co-file-field__row-icon--spin":"uploading"===i.status}}),r("div",{class:"co-file-field__row-body"},r("span",{class:"co-file-field__row-name",title:i.name},function(e,i=35){return!e||e.length<=i?e:"..."+e.slice(-i)}(i.name)),"uploading"===i.status&&r("div",{class:"co-file-field__progress"},r("div",{class:"co-file-field__progress-bar",style:"number"==typeof i.progress?{width:i.progress+"%"}:void 0})),"error"===i.status&&i.error&&r("span",{class:"co-file-field__row-error"},i.error)),null!=i.size&&r("span",{class:"co-file-field__row-size"},h(i.size)),"done"===i.status&&!!i.url&&r("co-tooltip",{content:e.downloadFile},r("a",{class:"co-file-field__action",href:i.url,target:"_blank",rel:"noopener noreferrer",download:i.name,tabIndex:-1,"aria-label":e.downloadFile},r("co-icon",{name:"download",size:18}))),"done"===i.status&&!!i.url&&r("co-tooltip",{content:this.copiedKey===o?e.copied:e.copyUrl},r("button",{class:{"co-file-field__action":!0,"co-file-field__action--copied":this.copiedKey===o},type:"button",tabIndex:-1,"aria-label":e.copyUrl,onClick:()=>this.handleCopy(i)},r("co-icon",{name:this.copiedKey===o?"check":"copy",size:18}))),!this.disabled&&!this.readonly&&r("co-tooltip",{content:e.removeFile},r("button",{class:"co-file-field__action",type:"button",tabIndex:-1,"aria-label":e.removeFile,onClick:()=>this.coRemove.emit(o)},r("co-icon",{name:"trash",size:18}))))})))),o&&r("div",{key:"a6a14de91f12490b54717153520e3f59b9c9ef10",class:{"co-file-field__helper":!0,"co-file-field__helper--error":this.isInvalid},part:"helper"},this.isInvalid&&r("co-icon",{key:"500ff53b0e1b4f894891bfc3f442ca170a2da2d0",name:"warning-circle",size:14,class:"co-file-field__helper-icon"}),r("span",{key:"c723bcbf23a6bcecb9f781aede09120f78fe9b55",class:"co-file-field__helper-text"},o)))}get el(){return this}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1}.co-file-field{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-file-field__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs)}.co-file-field__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;cursor:default}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}.co-file-field__dropzone{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--co-spacing-md);padding:var(--co-spacing-4xl) var(--co-spacing-2xl);background:color-mix(in srgb, var(--co-semantic-surface-hover) 55%, transparent);border:1px dashed var(--co-semantic-border-field);border-radius:var(--co-border-radius-sm);cursor:pointer;text-align:center;transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-file-field__dropzone:hover{border-color:var(--co-semantic-border-focus)}.co-file-field__dropzone--drag{border-color:var(--co-semantic-border-focus);background:var(--co-semantic-surface-hover)}.co-file-field__upload-btn{display:inline-flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-md) var(--co-spacing-xl);margin-bottom:var(--co-spacing-xs);background:var(--co-semantic-surface-secondary);color:var(--co-semantic-text-default);border:none;border-radius:var(--co-border-radius-full);box-shadow:var(--co-shadow-lg);font-family:inherit;font-size:var(--co-font-size-16);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;cursor:pointer;transition:box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-file-field__upload-btn:hover{box-shadow:var(--co-shadow-xl, var(--co-shadow-lg));transform:translateY(-1px)}.co-file-field__upload-btn co-icon{display:inline-flex;flex-shrink:0}.co-file-field__dropzone-text{color:var(--co-semantic-text-default);font-size:var(--co-font-size-18);line-height:1.25}.co-file-field__dropzone-hint{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);line-height:1.25}.co-file-field__actions{display:contents}.co-file-field__input{display:none}.co-file-field__uploaded{display:flex;flex-direction:column;gap:var(--co-spacing-lg);margin-top:var(--co-spacing-sm2)}.co-file-field__uploaded-title{color:var(--co-semantic-text-default);font-size:var(--co-font-size-22);font-weight:500;letter-spacing:-0.03em;line-height:1.25}.co-file-field__previews{display:grid;grid-template-columns:repeat(auto-fill, minmax(150px, 180px));gap:var(--co-spacing-md)}.co-file-field__preview{padding:0;border:none;border-radius:var(--co-border-radius-sm);overflow:hidden;aspect-ratio:3 / 2;background:var(--co-semantic-surface-hover);cursor:pointer}.co-file-field__preview img{display:block;width:100%;height:100%;object-fit:cover;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-file-field__preview:hover img{transform:scale(1.02)}.co-file-field__preview--video{position:relative;background:var(--co-color-base-negro)}.co-file-field__preview-play{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--co-spacing-sm2);color:var(--co-color-base-blanco);pointer-events:none}.co-file-field__preview-play-badge{display:flex;width:40px;height:40px;align-items:center;justify-content:center;border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-negro-80);box-shadow:inset 0 0 0 1px var(--co-color-opacity-blanco-25);transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-file-field__preview--video:hover .co-file-field__preview-play-badge{transform:scale(1.08)}.co-file-field__preview-play-badge co-icon{transform:translateX(1px)}.co-file-field__preview-ext{font-family:var(--co-font-family-primary);font-size:var(--co-font-size-12);font-weight:var(--co-font-weight-medium);letter-spacing:var(--co-font-letter-spacing-overline);color:var(--co-color-opacity-blanco-80)}.co-file-field__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-file-field__row{display:flex;align-items:center;gap:var(--co-spacing-lg);padding:var(--co-spacing-xl);background:var(--co-semantic-surface-hover);border:1px solid transparent;border-radius:var(--co-border-radius-sm)}.co-file-field__row--error{border-color:var(--co-semantic-status-error)}.co-file-field__row--dragging{opacity:0.5}.co-file-field__row--drop-target{border-color:var(--co-semantic-border-focus);background:var(--co-semantic-surface-hover)}.co-file-field__drag-handle{flex-shrink:0;display:flex;align-items:center;color:var(--co-semantic-text-secondary);cursor:grab}.co-file-field__drag-handle:active{cursor:grabbing}.co-file-field__row-icon{flex-shrink:0;color:var(--co-semantic-text-secondary);display:flex;align-items:center}.co-file-field__row--error .co-file-field__row-icon{color:var(--co-semantic-status-error)}.co-file-field__row-icon--spin{animation:co-file-spin 0.8s linear infinite}@keyframes co-file-spin{to{transform:rotate(360deg)}}.co-file-field__row-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--co-spacing-xs)}.co-file-field__row-name{color:var(--co-semantic-text-default);font-size:var(--co-font-size-14);line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-file-field__row-error{color:var(--co-semantic-status-error);font-size:var(--co-font-size-12)}.co-file-field__row-size{flex-shrink:0;color:var(--co-semantic-text-default);font-size:var(--co-font-size-14);line-height:1;white-space:nowrap}.co-file-field__progress{position:relative;height:4px;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-hover);overflow:hidden}.co-file-field__progress-bar{position:absolute;inset:0;width:40%;border-radius:var(--co-border-radius-full);background:var(--co-semantic-status-info);transition:width var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-file-field__progress-bar:not([style]){animation:co-file-indeterminate 1.2s ease-in-out infinite}@keyframes co-file-indeterminate{0%{left:-40%}100%{left:100%}}.co-file-field__action{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;cursor:pointer;text-decoration:none;color:var(--co-semantic-text-secondary);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-file-field__action:hover{color:var(--co-semantic-text-default)}.co-file-field__action--copied,.co-file-field__action--copied:hover{color:var(--co-color-primary-verde)}.co-file-field__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-file-field__helper-icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-file-field__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);line-height:1}.co-file-field--disabled{opacity:0.6;pointer-events:none}.co-file-field--invalid .co-file-field__dropzone,.co-file-field--error .co-file-field__dropzone{border-color:var(--co-semantic-status-error)}.co-file-field__helper--error .co-file-field__helper-icon,.co-file-field__helper--error .co-file-field__helper-text{color:var(--co-semantic-status-error)}:host([layout='horizontal']) .co-file-field{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-file-field__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-file-field__label{white-space:normal}:host([layout='horizontal']) .co-file-field>:not(.co-file-field__labels){grid-column:2;min-width:0}@supports not (background: color-mix(in srgb, red, transparent)){.co-file-field__dropzone{background:var(--co-semantic-surface-hover)}}"}},[257,"co-file-field",{label:[1],disabled:[4],readonly:[4],required:[4],multiple:[4],accept:[1],maxFiles:[2,"max-files"],maxBytes:[2,"max-bytes"],status:[1],helperText:[1,"helper-text"],layout:[513],locale:[1],uploadButtonText:[1,"upload-button-text"],dropText:[1,"drop-text"],uploadedTitle:[1,"uploaded-title"],reorderable:[4],files:[1],dragOver:[32],localError:[32],copiedKey:[32],armedKey:[32],dragKey:[32],overKey:[32],failedPreviews:[32]}]);function w(){"undefined"!=typeof customElements&&["co-file-field","co-icon","co-lightbox","co-tooltip","co-video"].forEach((i=>{switch(i){case"co-file-field":customElements.get(e(i))||customElements.define(e(i),x);break;case"co-icon":customElements.get(e(i))||l();break;case"co-lightbox":customElements.get(e(i))||n();break;case"co-tooltip":customElements.get(e(i))||d();break;case"co-video":customElements.get(e(i))||f()}}))}w();const k=x,z=w;export{k as CoFileField,z as defineCustomElement}
|
|
1
|
+
import{t as e,p as i,H as o,c as t,h as r}from"./index.js";import{R as a}from"./p-CWneqh4n.js";import{g as s,f as c}from"./p-gKnOhsd2.js";import{d as l}from"./p-KK2vAKs-.js";import{d as n}from"./p-8XzG8pzY.js";import{d}from"./p-B3Egz082.js";import{d as f}from"./p-9VoFSbIH.js";import{d as h}from"./p-DymSqdlK.js";function p(e){if(null==e||isNaN(e))return"";if(e<1024)return e+" B";const i=e=>e.toFixed(2).replace(/\.?0+$/,"");return e<1048576?i(e/1024)+" KB":i(e/1048576)+" MB"}const u=new Set(["png","jpg","jpeg","gif","webp","svg","avif","bmp"]),v=new Set(["mp4","mov","webm","m4v","ogv"]);function m(e){const i=(e||"").split("?")[0],o=i.lastIndexOf(".");return o>=0?i.slice(o+1).toLowerCase():""}function _(e){return m(e.name)||m(e.url)}function g(e){return u.has(_(e))}function b(e){return v.has(_(e))}function y(e){return"done"===e.status&&!!e.url&&b(e)}function x(e){return b(e)||g(e)?e.url||e.thumbnail:e.thumbnail||e.url}const w=i(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coFilesSelected=t(this,"coFilesSelected",3),this.coRemove=t(this,"coRemove",3),this.coClear=t(this,"coClear",3),this.coReorder=t(this,"coReorder",3),this.coCopy=t(this,"coCopy",3),this.coPreviewOpen=t(this,"coPreviewOpen",3),this.disabled=!1,this.readonly=!1,this.required=!1,this.multiple=!1,this.maxFiles=100,this.status="default",this.layout="vertical",this.reorderable=!0,this.files="[]",this.dragOver=!1,this.localError="",this.copiedKey="",this.armedKey="",this.dragKey="",this.overKey="",this.failedPreviews=new Set,this.tempSeq=0,this.lastFilesStr="",this.lastParsed=[],this.handleDragOver=e=>{this.disabled||this.readonly||this.dragKey||(e.preventDefault(),this.dragOver=!0)},this.handleDragLeave=e=>{const i=e.relatedTarget;i&&e.currentTarget instanceof Node&&e.currentTarget.contains(i)||(this.dragOver=!1)},this.handleDrop=e=>{var i;e.preventDefault(),this.dragOver=!1,this.dragKey||(null===(i=e.dataTransfer)||void 0===i?void 0:i.files)&&this.handleFiles(e.dataTransfer.files)},this.handleBrowse=e=>{var i;this.disabled||this.readonly||e&&this.fromActionsSlot(e)||null===(i=this.inputEl)||void 0===i||i.click()},this.handleInputChange=e=>{const i=e.target;i.files&&this.handleFiles(i.files),i.value=""},this.disarmDrag=()=>{this.armedKey&&!this.dragKey&&(this.armedKey="")},this.handleRowDragEnd=()=>{this.resetDragState()}}componentWillLoad(){this.failedPreviews||(this.failedPreviews=new Set)}connectedCallback(){window.addEventListener("mouseup",this.disarmDrag)}disconnectedCallback(){window.removeEventListener("mouseup",this.disarmDrag),clearTimeout(this.copiedTimer),this.closeLightbox()}get parsedFiles(){const e=this.files;if("string"!=typeof e||!e.trim())return[];if(e===this.lastFilesStr)return this.lastParsed;let i=[];try{const o=JSON.parse(e);Array.isArray(o)&&(i=o)}catch(e){}return this.lastFilesStr=e,this.lastParsed=i,i}get strings(){return s(this.locale)}get acceptList(){const e=this.accept;if(!e)return[];let i=[];try{const o=JSON.parse(e);Array.isArray(o)&&(i=o.map(String))}catch(o){i=e.split(",")}return i.map((e=>e.trim().toLowerCase().replace(/^\./,""))).filter((e=>e&&"*"!==e))}get isInvalid(){return"error"===this.status||!!this.localError}get inputAccept(){const e=this.acceptList;if(e.length)return e.map((e=>e.includes("/")?e:"."+e)).join(",")}extOf(e){const i=e.lastIndexOf(".");return i>=0?e.slice(i+1).toLowerCase():""}validate(e){const i=this.acceptList;if(i.length){const o=this.extOf(e.name),t=i.includes(o),r=i.some((i=>i.includes("/")&&e.type===i));if(!t&&!r)return c(this.strings.errInvalidFormat,{x:o})}return this.maxBytes&&e.size>this.maxBytes?c(this.strings.errTooLarge,{x:p(e.size)}):null}handleFiles(e){if(this.disabled||this.readonly)return;this.localError="";const i=Array.from(e);if(!i.length)return;const o=this.multiple?i:i.slice(0,1);if(this.multiple){const e=this.maxFiles-this.parsedFiles.length;if(e<=0)return void(this.localError=c(this.strings.errMaxFiles,{n:this.maxFiles}));o.length>e&&(o.length=e)}const t=[],r=[];for(const e of o){const i=this.validate(e);i?this.localError=i:(t.push(e),r.push(`tmp-${Date.now()}-${this.tempSeq++}`))}t.length&&this.coFilesSelected.emit({files:t,tempIds:r})}fromActionsSlot(e){return e.composedPath().some((e=>{var i,o;return"actions"===(null===(o=(i=e).getAttribute)||void 0===o?void 0:o.call(i,"slot"))}))}keyFor(e){var i;return e.id||e.tempId||`${e.name}:${null!==(i=e.size)&&void 0!==i?i:""}`}handleCopy(e){var i;const o=e.url||"";if(!o)return;const t=this.keyFor(e);this.coCopy.emit({id:t,url:o}),(null===(i=navigator.clipboard)||void 0===i?void 0:i.writeText)&&navigator.clipboard.writeText(o).then((()=>{this.copiedKey=t,clearTimeout(this.copiedTimer),this.copiedTimer=setTimeout((()=>this.copiedKey=""),1500)})).catch((()=>{}))}previewItems(){return this.parsedFiles.filter((e=>function(e){return function(e){return"done"===e.status&&!y(e)&&!(!e.thumbnail&&!e.url)&&(!!e.thumbnail||g(e))}(e)||y(e)}(e)&&(y(e)||!this.failedPreviews.has(this.keyFor(e)))))}handlePreviewOpen(e){const i=e.url||e.thumbnail;if(!i)return;this.coPreviewOpen.emit({id:this.keyFor(e),url:i});const o=this.previewItems(),t=o.map((e=>y(e)?{src:x(e),thumbnail:e.thumbnail,alt:e.name,kind:"video",poster:e.thumbnail}:{src:x(e),thumbnail:e.thumbnail,alt:e.name})),r=Math.max(0,o.findIndex((i=>this.keyFor(i)===this.keyFor(e))));this.closeLightbox();const a=document.createElement("co-lightbox");a.images=JSON.stringify(t),a.startIndex=r,this.locale&&(a.locale=this.locale),a.addEventListener("coClose",(()=>this.closeLightbox())),document.body.appendChild(a),this.lightboxEl=a,requestAnimationFrame((()=>{a.open=!0}))}closeLightbox(){const e=this.lightboxEl;this.lightboxEl=void 0,e&&(e.open=!1,setTimeout((()=>e.remove()),220))}handlePreviewError(e){this.failedPreviews=new Set([...this.failedPreviews,this.keyFor(e)])}handleRowDragStart(e,i){this.armedKey===i?(this.dragKey=i,e.dataTransfer&&(e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",i))):e.preventDefault()}handleRowDragOver(e,i){this.dragKey&&this.dragKey!==i&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move"),this.overKey=i)}handleRowDrop(e,i){e.preventDefault(),e.stopPropagation();const o=this.parsedFiles.map((e=>this.keyFor(e))),t=o.indexOf(this.dragKey),r=o.indexOf(i);this.resetDragState(),t<0||r<0||t===r||(o.splice(r,0,...o.splice(t,1)),this.coReorder.emit(o))}resetDragState(){this.armedKey="",this.dragKey="",this.overKey=""}capacityHint(e){const i=this.maxBytes?p(this.maxBytes):"";return this.multiple&&this.maxBytes?c(e.helperBoth,{n:this.maxFiles,x:i}):this.multiple?c(e.helperFiles,{n:this.maxFiles}):this.maxBytes?c(e.helperBytes,{x:i}):""}render(){const e=this.strings,i=this.parsedFiles,o=this.localError||this.helperText,t=!(this.readonly||(this.multiple?this.multiple&&i.length>=this.maxFiles:0!==i.length)),s="default"!==this.status?"co-file-field--"+this.status:"",c=this.previewItems(),l=this.reorderable&&this.multiple&&!this.disabled&&!this.readonly&&i.length>1,n=this.capacityHint(e);return r("div",{key:"ee6fa70ea7fd466ec315eff1b6f3d044b1c6c6d9",class:{"co-file-field":!0,"co-file-field--disabled":this.disabled,"co-file-field--invalid":this.isInvalid,[s]:!!s},part:"wrapper"},this.label&&r("div",{key:"48a181a0cb1e0c53da9d61a856f3d2cc5e97d079",class:"co-file-field__labels"},r("label",{key:"47f162d9fdad44d4c8c8f7756c901eea216b7627",class:"co-file-field__label",part:"label"},this.label,r(a,{key:"4549d57f016e2874ea7b141d9dc83e09c38bdbf3",required:this.required}))),t&&r("div",{key:"3d16ff2e38de335e5fba78931cd6b1b009603a70",class:{"co-file-field__dropzone":!0,"co-file-field__dropzone--drag":this.dragOver},part:"dropzone",role:"button",tabIndex:this.disabled?-1:0,onClick:this.handleBrowse,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||this.fromActionsSlot(e)||(e.preventDefault(),this.handleBrowse())},onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},r("button",{key:"e9a2c51a238455e7887e8310c02ac739ebf89e4e",class:"co-file-field__upload-btn",part:"upload-button",type:"button",tabIndex:-1},r("co-icon",{key:"5a6fe016b2e26896a8b788bb1473c5434d71e85f",name:"file-arrow-up",size:18}),r("span",{key:"e69793c228fef62c5c0aec07f5f038aa3e931b3b"},this.uploadButtonText||e.uploadButton)),r("span",{key:"7343bd26d1132ac6b0b0ded57f1a2a32f228d0e8",class:"co-file-field__dropzone-text"},this.dropText||e.dropHint),n&&r("span",{key:"d7b68c8723c91b80b124298e29c9165c2489f59f",class:"co-file-field__dropzone-hint"},n),r("div",{key:"38318d6e86a90cc8faf6955ea480b39d242d8122",class:"co-file-field__actions",part:"actions"},r("slot",{key:"ad9f134cd0f01b1ed61d8d8966d5a7d40bda0812",name:"actions"})),r("input",{key:"8a3b769794a89213a1f02f0b82899e624a5578d6",ref:e=>this.inputEl=e,class:"co-file-field__input",type:"file",multiple:this.multiple,accept:this.inputAccept,disabled:this.disabled,onChange:this.handleInputChange,"aria-hidden":"true",tabIndex:-1})),i.length>0&&r("div",{key:"8040d77615d29a691bc2087eddd7298b3922066c",class:"co-file-field__uploaded"},this.multiple&&r("div",{key:"e4660cdfe20c1b4669b57a4474234161bac4c812",class:"co-file-field__uploaded-title",part:"uploaded-title"},`${this.uploadedTitle||e.uploadedTitle} (${i.length})`),c.length>0&&r("div",{key:"636e3e35dcb8ad263361e1b652dca23b499e5354",class:"co-file-field__previews",part:"previews"},c.map((i=>{const o=this.keyFor(i),t=y(i),a=this.failedPreviews.has(o)?"":i.thumbnail;return r("button",{class:{"co-file-field__preview":!0,"co-file-field__preview--video":t},part:"preview",type:"button",key:"prev-"+o,title:i.name,"aria-label":`${t?e.playVideo:e.openPreview}: ${i.name}`,onClick:()=>this.handlePreviewOpen(i)},(!t||!!a)&&r("img",{src:t?a:i.thumbnail||i.url,alt:i.name,loading:"lazy",onError:()=>this.handlePreviewError(i)}),t&&r("span",{class:"co-file-field__preview-play","aria-hidden":"true"},r("span",{class:"co-file-field__preview-play-badge"},r("co-icon",{name:"play",size:20,weight:"fill"})),!a&&r("span",{class:"co-file-field__preview-ext"},_(i).toUpperCase())))}))),r("ul",{key:"b67b8c43f8c02c65e780b3fa644123bf0f29d69b",class:"co-file-field__list",part:"list"},i.map((i=>{const o=this.keyFor(i),t=l&&"done"===i.status;return r("li",{class:{"co-file-field__row":!0,["co-file-field__row--"+i.status]:!0,"co-file-field__row--dragging":this.dragKey===o,"co-file-field__row--drop-target":this.overKey===o},part:"row",key:o,draggable:this.armedKey===o,onDragStart:e=>this.handleRowDragStart(e,o),onDragOver:e=>this.handleRowDragOver(e,o),onDrop:e=>this.handleRowDrop(e,o),onDragEnd:this.handleRowDragEnd},t?r("co-tooltip",{content:e.dragToReorder},r("span",{class:"co-file-field__drag-handle",part:"drag-handle",onMouseDown:()=>this.armedKey=o},r("co-icon",{name:"list",size:18}))):r("co-icon",{name:"error"===i.status?"warning-circle":"uploading"===i.status?"spinner-gap":"file",size:18,class:{"co-file-field__row-icon":!0,"co-file-field__row-icon--spin":"uploading"===i.status}}),r("div",{class:"co-file-field__row-body"},r("span",{class:"co-file-field__row-name",title:i.name},function(e,i=35){return!e||e.length<=i?e:"..."+e.slice(-i)}(i.name)),"uploading"===i.status&&r("div",{class:"co-file-field__progress"},r("div",{class:"co-file-field__progress-bar",style:"number"==typeof i.progress?{width:i.progress+"%"}:void 0})),"error"===i.status&&i.error&&r("span",{class:"co-file-field__row-error"},i.error)),null!=i.size&&r("span",{class:"co-file-field__row-size"},p(i.size)),"done"===i.status&&!!i.url&&r("co-tooltip",{content:e.downloadFile},r("a",{class:"co-file-field__action",href:i.url,target:"_blank",rel:"noopener noreferrer",download:i.name,tabIndex:-1,"aria-label":e.downloadFile},r("co-icon",{name:"download",size:18}))),"done"===i.status&&!!i.url&&r("co-tooltip",{content:this.copiedKey===o?e.copied:e.copyUrl},r("button",{class:{"co-file-field__action":!0,"co-file-field__action--copied":this.copiedKey===o},type:"button",tabIndex:-1,"aria-label":e.copyUrl,onClick:()=>this.handleCopy(i)},r("co-icon",{name:this.copiedKey===o?"check":"copy",size:18}))),!this.disabled&&!this.readonly&&r("co-tooltip",{content:e.removeFile},r("button",{class:"co-file-field__action",type:"button",tabIndex:-1,"aria-label":e.removeFile,onClick:()=>this.coRemove.emit(o)},r("co-icon",{name:"trash",size:18}))))})))),o&&r("div",{key:"ff75602503a198d8598d2b35fd881c848a7b76d6",class:{"co-file-field__helper":!0,"co-file-field__helper--error":this.isInvalid},part:"helper"},this.isInvalid&&r("co-icon",{key:"af79e0b999c781560c316023897aaa850b1d6ae0",name:"warning-circle",size:14,class:"co-file-field__helper-icon"}),r("span",{key:"b5af4dab0d3c7dc317265604159a95f3bf8d200d",class:"co-file-field__helper-text"},o)))}get el(){return this}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1}.co-file-field{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-file-field__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs)}.co-file-field__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;cursor:default}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}.co-file-field__dropzone{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--co-spacing-md);padding:var(--co-spacing-4xl) var(--co-spacing-2xl);background:color-mix(in srgb, var(--co-semantic-surface-hover) 55%, transparent);border:1px dashed var(--co-semantic-border-field);border-radius:var(--co-border-radius-sm);cursor:pointer;text-align:center;transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-file-field__dropzone:hover{border-color:var(--co-semantic-border-focus)}.co-file-field__dropzone--drag{border-color:var(--co-semantic-border-focus);background:var(--co-semantic-surface-hover)}.co-file-field__upload-btn{display:inline-flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-md) var(--co-spacing-xl);margin-bottom:var(--co-spacing-xs);background:var(--co-semantic-surface-secondary);color:var(--co-semantic-text-default);border:none;border-radius:var(--co-border-radius-full);box-shadow:var(--co-shadow-lg);font-family:inherit;font-size:var(--co-font-size-16);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;cursor:pointer;transition:box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-file-field__upload-btn:hover{box-shadow:var(--co-shadow-xl, var(--co-shadow-lg));transform:translateY(-1px)}.co-file-field__upload-btn co-icon{display:inline-flex;flex-shrink:0}.co-file-field__dropzone-text{color:var(--co-semantic-text-default);font-size:var(--co-font-size-18);line-height:1.25}.co-file-field__dropzone-hint{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);line-height:1.25}.co-file-field__actions{display:contents}.co-file-field__input{display:none}.co-file-field__uploaded{display:flex;flex-direction:column;gap:var(--co-spacing-lg);margin-top:var(--co-spacing-sm2)}.co-file-field__uploaded-title{color:var(--co-semantic-text-default);font-size:var(--co-font-size-22);font-weight:500;letter-spacing:-0.03em;line-height:1.25}.co-file-field__previews{display:grid;grid-template-columns:repeat(auto-fill, minmax(150px, 180px));gap:var(--co-spacing-md)}.co-file-field__preview{padding:0;border:none;border-radius:var(--co-border-radius-sm);overflow:hidden;aspect-ratio:3 / 2;background:var(--co-semantic-surface-hover);cursor:pointer}.co-file-field__preview img{display:block;width:100%;height:100%;object-fit:cover;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-file-field__preview:hover img{transform:scale(1.02)}.co-file-field__preview--video{position:relative;background:var(--co-color-base-negro)}.co-file-field__preview-play{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--co-spacing-sm2);color:var(--co-color-base-blanco);pointer-events:none}.co-file-field__preview-play-badge{display:flex;width:40px;height:40px;align-items:center;justify-content:center;border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-negro-80);box-shadow:inset 0 0 0 1px var(--co-color-opacity-blanco-25);transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-file-field__preview--video:hover .co-file-field__preview-play-badge{transform:scale(1.08)}.co-file-field__preview-play-badge co-icon{transform:translateX(1px)}.co-file-field__preview-ext{font-family:var(--co-font-family-primary);font-size:var(--co-font-size-12);font-weight:var(--co-font-weight-medium);letter-spacing:var(--co-font-letter-spacing-overline);color:var(--co-color-opacity-blanco-80)}.co-file-field__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-file-field__row{display:flex;align-items:center;gap:var(--co-spacing-lg);padding:var(--co-spacing-xl);background:var(--co-semantic-surface-hover);border:1px solid transparent;border-radius:var(--co-border-radius-sm)}.co-file-field__row--error{border-color:var(--co-semantic-status-error)}.co-file-field__row--dragging{opacity:0.5}.co-file-field__row--drop-target{border-color:var(--co-semantic-border-focus);background:var(--co-semantic-surface-hover)}.co-file-field__drag-handle{flex-shrink:0;display:flex;align-items:center;color:var(--co-semantic-text-secondary);cursor:grab}.co-file-field__drag-handle:active{cursor:grabbing}.co-file-field__row-icon{flex-shrink:0;color:var(--co-semantic-text-secondary);display:flex;align-items:center}.co-file-field__row--error .co-file-field__row-icon{color:var(--co-semantic-status-error)}.co-file-field__row-icon--spin{animation:co-file-spin 0.8s linear infinite}@keyframes co-file-spin{to{transform:rotate(360deg)}}.co-file-field__row-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--co-spacing-xs)}.co-file-field__row-name{color:var(--co-semantic-text-default);font-size:var(--co-font-size-14);line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-file-field__row-error{color:var(--co-semantic-status-error);font-size:var(--co-font-size-12)}.co-file-field__row-size{flex-shrink:0;color:var(--co-semantic-text-default);font-size:var(--co-font-size-14);line-height:1;white-space:nowrap}.co-file-field__progress{position:relative;height:4px;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-hover);overflow:hidden}.co-file-field__progress-bar{position:absolute;inset:0;width:40%;border-radius:var(--co-border-radius-full);background:var(--co-semantic-status-info);transition:width var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-file-field__progress-bar:not([style]){animation:co-file-indeterminate 1.2s ease-in-out infinite}@keyframes co-file-indeterminate{0%{left:-40%}100%{left:100%}}.co-file-field__action{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;cursor:pointer;text-decoration:none;color:var(--co-semantic-text-secondary);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-file-field__action:hover{color:var(--co-semantic-text-default)}.co-file-field__action--copied,.co-file-field__action--copied:hover{color:var(--co-color-primary-verde)}.co-file-field__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-file-field__helper-icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-file-field__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);line-height:1}.co-file-field--disabled{opacity:0.6;pointer-events:none}.co-file-field--invalid .co-file-field__dropzone,.co-file-field--error .co-file-field__dropzone{border-color:var(--co-semantic-status-error)}.co-file-field__helper--error .co-file-field__helper-icon,.co-file-field__helper--error .co-file-field__helper-text{color:var(--co-semantic-status-error)}:host([layout='horizontal']) .co-file-field{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-file-field__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-file-field__label{white-space:normal}:host([layout='horizontal']) .co-file-field>:not(.co-file-field__labels){grid-column:2;min-width:0}@supports not (background: color-mix(in srgb, red, transparent)){.co-file-field__dropzone{background:var(--co-semantic-surface-hover)}}"}},[257,"co-file-field",{label:[1],disabled:[4],readonly:[4],required:[4],multiple:[4],accept:[1],maxFiles:[2,"max-files"],maxBytes:[2,"max-bytes"],status:[1],helperText:[1,"helper-text"],layout:[513],locale:[1],uploadButtonText:[1,"upload-button-text"],dropText:[1,"drop-text"],uploadedTitle:[1,"uploaded-title"],reorderable:[4],files:[1],dragOver:[32],localError:[32],copiedKey:[32],armedKey:[32],dragKey:[32],overKey:[32],failedPreviews:[32]}]);function k(){"undefined"!=typeof customElements&&["co-file-field","co-icon","co-kbd","co-lightbox","co-tooltip","co-video"].forEach((i=>{switch(i){case"co-file-field":customElements.get(e(i))||customElements.define(e(i),w);break;case"co-icon":customElements.get(e(i))||l();break;case"co-kbd":customElements.get(e(i))||n();break;case"co-lightbox":customElements.get(e(i))||d();break;case"co-tooltip":customElements.get(e(i))||f();break;case"co-video":customElements.get(e(i))||h()}}))}k();const z=w,j=k;export{z as CoFileField,j as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as o,d as s}from"./p-
|
|
1
|
+
import{C as o,d as s}from"./p-CxWo3qDo.js";const p=o,r=s;export{p as CoFileTypeTile,r as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CoGradientBar extends Components.CoGradientBar, HTMLElement {}
|
|
4
|
+
export const CoGradientBar: {
|
|
5
|
+
prototype: CoGradientBar;
|
|
6
|
+
new (): CoGradientBar;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as i,H as r,c as o,h as a}from"./index.js";import{i as e,p as n,g as s,o as d,h as c,s as l}from"./p-DXLeDZvr.js";import{l as h}from"./p-jYd9gu_c.js";const b={es:{barLabel:"Degradado",stopLabel:"Parada {i} de {n}, {p}%"},en:{barLabel:"Gradient",stopLabel:"Stop {i} of {n}, {p}%"},pt:{barLabel:"Degradê",stopLabel:"Parada {i} de {n}, {p}%"}},p=i(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coStopMove=o(this,"coStopMove",7),this.coStopsChange=o(this,"coStopsChange",7),this.coStopSelect=o(this,"coStopSelect",7),this.coStopAdd=o(this,"coStopAdd",7),this.stops=[],this.disabled=!1,this.dragIndex=-1,this.dragPosition=0,this.pointerId=-1,this.grabOffset=0,this.dragMoved=!1,this.handleTrackClick=t=>{var i;if(this.disabled)return;const r=t.target;if(null===(i=null==r?void 0:r.closest)||void 0===i?void 0:i.call(r,".co-gradient-bar__handle"))return;const o=this.positionAt(t.clientX);this.coStopAdd.emit({position:o,color:e(this.stopList,o)})},this.handleHandlePointerDown=(t,i)=>{var r,o,a,e,n,s;if(this.disabled)return;if(this.dragIndex>=0)return;if(void 0!==i.button&&0!==i.button)return;i.preventDefault();const d=i.currentTarget;if(null===(r=null==d?void 0:d.focus)||void 0===r||r.call(d),this.selected=t,this.coStopSelect.emit(t),null==d?void 0:d.setPointerCapture)try{d.setPointerCapture(i.pointerId)}catch(t){}const c=null!==(a=null===(o=this.stopList[t])||void 0===o?void 0:o.position)&&void 0!==a?a:0,l=null===(e=this.trackEl)||void 0===e?void 0:e.getBoundingClientRect(),h=(null!==(n=null==l?void 0:l.left)&&void 0!==n?n:0)+(null!==(s=null==l?void 0:l.width)&&void 0!==s?s:0)*c/100;this.grabOffset=l&&l.width>0?i.clientX-h:0,this.pointerId=i.pointerId,this.dragIndex=t,this.dragPosition=c,this.dragMoved=!1,this.bindWindow()},this.handleWindowPointerMove=t=>{if(t.pointerId!==this.pointerId||this.dragIndex<0)return;const i=this.positionAt(t.clientX-this.grabOffset);i!==this.dragPosition&&(this.dragPosition=i,this.dragMoved=!0,this.coStopMove.emit({index:this.dragIndex,position:i}))},this.handleWindowPointerUp=t=>{t.pointerId===this.pointerId&&this.endDrag()},this.handleHandleKeyDown=(t,i)=>{var r,o;if(this.disabled)return;const a=null!==(o=null===(r=this.stopList[t])||void 0===r?void 0:r.position)&&void 0!==o?o:0;let e;if("ArrowRight"===i.key||"ArrowLeft"===i.key)e=l(a,("ArrowRight"===i.key?1:-1)*(i.shiftKey?10:1));else if("Home"===i.key)e=0;else{if("End"!==i.key)return;e=100}i.preventDefault(),e!==a&&this.coStopsChange.emit(this.withPosition(t,e))}}disconnectedCallback(){this.unbindWindow()}positionAt(t){var i,r,o;const a=null===(i=this.trackEl)||void 0===i?void 0:i.getBoundingClientRect();return n(t,null!==(r=null==a?void 0:a.left)&&void 0!==r?r:0,null!==(o=null==a?void 0:a.width)&&void 0!==o?o:0)}get stopList(){var t;return null!==(t=this.stops)&&void 0!==t?t:[]}withPosition(t,i){return this.stopList.map(((r,o)=>o===t?Object.assign(Object.assign({},r),{position:i}):r))}liveStops(){return this.dragIndex>=0?this.withPosition(this.dragIndex,this.dragPosition):this.stopList}endDrag(){this.unbindWindow();const t=this.dragIndex,i=this.dragPosition,r=this.dragMoved;this.pointerId=-1,this.dragIndex=-1,this.dragMoved=!1,t>=0&&r&&this.coStopsChange.emit(this.withPosition(t,i))}bindWindow(){window.addEventListener("pointermove",this.handleWindowPointerMove),window.addEventListener("pointerup",this.handleWindowPointerUp),window.addEventListener("pointercancel",this.handleWindowPointerUp)}unbindWindow(){window.removeEventListener("pointermove",this.handleWindowPointerMove),window.removeEventListener("pointerup",this.handleWindowPointerUp),window.removeEventListener("pointercancel",this.handleWindowPointerUp)}render(){const t=function(t){return b[h(t)]}(this.locale),i=this.liveStops(),r=i.length,o=null!=this.selected&&this.selected>=0&&this.selected<r;return a("div",{key:"10e1f78165d061dd08141de0a0ca885f15b7ff83",class:{"co-gradient-bar":!0,"co-gradient-bar--disabled":this.disabled,"co-gradient-bar--dragging":this.dragIndex>=0,"co-gradient-bar--transparent":c(i)},role:"group","aria-label":this.label||t.barLabel,"aria-disabled":this.disabled?"true":void 0},a("div",{key:"e591b6e6d74ee9c9f3b9992f6d12cfd360f9fa49",class:"co-gradient-bar__track",part:"track",ref:t=>this.trackEl=t,onClick:this.handleTrackClick},a("div",{key:"fd5b93939df8988a08b8ab9f1fab36cc3eb24096",class:"co-gradient-bar__fill",style:{background:s(i)}}),i.map(((i,e)=>{const n=e===this.selected,s=o?n:0===e;return a("div",{key:e,class:{"co-gradient-bar__handle":!0,"co-gradient-bar__handle--selected":n},part:"handle",role:"slider","aria-label":t.stopLabel.replace("{i}",e+1+"").replace("{n}",r+"").replace("{p}",i.position+""),"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":i.position+"","aria-disabled":this.disabled?"true":void 0,tabIndex:this.disabled||!s?-1:0,style:{left:i.position+"%","--co-gradient-bar-stop-color":i.color,"--co-gradient-bar-stop-opaque":d(i.color)},onPointerDown:t=>this.handleHandlePointerDown(e,t),onKeyDown:t=>this.handleHandleKeyDown(e,t)})}))))}get el(){return this}static get style(){return":host{display:block;width:100%}:host([hidden]){display:none}.co-gradient-bar{position:relative;padding:9px 8px 0;box-sizing:border-box}.co-gradient-bar__track{position:relative;height:24px;border-radius:6px;cursor:copy;touch-action:none;user-select:none;-webkit-user-select:none}.co-gradient-bar--transparent .co-gradient-bar__track{background:conic-gradient(var(--co-color-gray-200) 25%, #ffffff 0 50%, var(--co-color-gray-200) 0 75%, #ffffff 0) 0 0 / 12px 12px}.co-gradient-bar__fill{position:absolute;inset:0;border-radius:6px;pointer-events:none}.co-gradient-bar__track::after{content:'';position:absolute;inset:0;border-radius:6px;box-shadow:inset 0 0 0 1px var(--co-semantic-border-hairline);pointer-events:none}.co-gradient-bar__handle{position:absolute;top:0;left:0;width:16px;height:16px;box-sizing:border-box;transform:translate(-50%, -50%);border-radius:3px;border:2px solid var(--co-color-opacity-negro-16);background:linear-gradient(to right, var(--co-gradient-bar-stop-opaque, var(--co-gradient-bar-stop-color)) 50%, transparent 50%), linear-gradient(var(--co-gradient-bar-stop-color), var(--co-gradient-bar-stop-color)), conic-gradient(var(--co-color-gray-200) 25%, #ffffff 0 50%, var(--co-color-gray-200) 0 75%, #ffffff 0) 0 0 / 6px 6px;box-shadow:0 0 0 1px var(--co-gradient-bar-handle-halo, transparent), var(--co-gradient-bar-handle-shadow, var(--co-shadow-sm2));cursor:grab;outline:none;touch-action:none;z-index:1}.co-gradient-bar__handle::after{content:'';position:absolute;left:50%;top:calc(100% + 2px);width:6px;height:2px;transform:translateX(-50%);border-radius:1px;background:var(--co-color-opacity-negro-16)}.co-gradient-bar__handle--selected{border-color:var(--co-semantic-accent);z-index:2}.co-gradient-bar__handle--selected::after{background:var(--co-semantic-accent)}.co-gradient-bar__handle:focus-visible{box-shadow:0 0 0 1px var(--co-gradient-bar-handle-halo, transparent), 0 0 0 2px var(--co-semantic-border-focus), var(--co-gradient-bar-handle-shadow, var(--co-shadow-sm2))}.co-gradient-bar--dragging .co-gradient-bar__handle{cursor:grabbing}.co-gradient-bar--disabled{opacity:0.4}.co-gradient-bar--disabled .co-gradient-bar__track,.co-gradient-bar--disabled .co-gradient-bar__handle{cursor:not-allowed}"}},[1,"co-gradient-bar",{stops:[16],selected:[1026],disabled:[516],label:[1],locale:[1],dragIndex:[32],dragPosition:[32]}]);function g(){"undefined"!=typeof customElements&&["co-gradient-bar"].forEach((i=>{"co-gradient-bar"===i&&(customElements.get(t(i))||customElements.define(t(i),p))}))}g();const u=p,f=g;export{u as CoGradientBar,f as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as c,h as s}from"./index.js";import{d as o}from"./p-
|
|
1
|
+
import{t as e,p as t,H as c,h as s}from"./index.js";import{d as o}from"./p-KK2vAKs-.js";const r=t(class extends c{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.status="default",this.STATUS_ICON={default:"info",error:"x-circle",success:"check-circle",warning:"warning",info:"info"}}render(){return s("div",{key:"12a67e485fed5d931c4325a0139d3ae7669b8de4",class:{"co-helper-text":!0,["co-helper-text--"+this.status]:!0},part:"helper-text"},s("co-icon",{key:"5bdb8635fa1654a9e10176c9818ba4197fc252e8",name:this.STATUS_ICON[this.status],size:14,weight:"fill",class:"co-helper-text__icon"}),s("span",{key:"c2f165cc0226ea1d799c62d0929d6acbf5cc1b98",class:"co-helper-text__message"},s("slot",{key:"d8315ea3ea6c002f83f1d936f9a3521831593b3d"},this.message)))}static get style(){return":host{display:block}.co-helper-text{display:flex;align-items:center;gap:var(--co-spacing-xs);font-family:var(--co-font-family-primary);font-size:var(--co-font-size-12);line-height:1.4}.co-helper-text__icon{flex-shrink:0}.co-helper-text--default{color:var(--co-semantic-text-muted)}.co-helper-text--error{color:var(--co-semantic-status-error)}.co-helper-text--success{color:var(--co-semantic-status-success)}.co-helper-text--warning{color:var(--co-semantic-status-warning)}.co-helper-text--info{color:var(--co-semantic-status-info)}"}},[257,"co-helper-text",{status:[1],message:[1]}]);function a(){"undefined"!=typeof customElements&&["co-helper-text","co-icon"].forEach((t=>{switch(t){case"co-helper-text":customElements.get(e(t))||customElements.define(e(t),r);break;case"co-icon":customElements.get(e(t))||o()}}))}a();const i=r,n=a;export{i as CoHelperText,n as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as
|
|
1
|
+
import{C as s,d as o}from"./p-DsuFNmTI.js";const m=s,p=o;export{m as CoIconButton,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as
|
|
1
|
+
import{C as s,d as o}from"./p-KK2vAKs-.js";const p=s,r=o;export{p as CoIcon,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as i,H as o,c as n,h as e}from"./index.js";import{R as c}from"./p-CWneqh4n.js";import{d as a}from"./p-DNJAIVfI.js";const s=i(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coInput=n(this,"coInput",7),this.coChange=n(this,"coChange",7),this.coClear=n(this,"coClear",7),this.coFocus=n(this,"coFocus",7),this.coBlur=n(this,"coBlur",7),this.coAction=n(this,"coAction",7),this.placeholder="",this.value="",this.disabled=!1,this.readonly=!1,this.clearable=!1,this.layout="vertical",this.type="text",this.required=!1,this.autoFocus=!1,this.status="default",this.size="md",this.variant="default",this.fill=!1,this.hasFocus=!1,this.shaking=!1,this.handleInput=t=>{this.value=t.target.value,this.coInput.emit(this.value)},this.handleChange=()=>{this.coChange.emit(this.value)},this.handleFocus=()=>{this.hasFocus=!0,this.coFocus.emit()},this.handleBlur=()=>{this.hasFocus=!1,this.coBlur.emit()},this.handleKeyDown=t=>{if("Enter"===t.key){const t=this.el.closest("form");t&&t.requestSubmit()}},this.handleClear=()=>{var t;this.value="",this.coClear.emit(),this.coInput.emit(""),null===(t=this.inputEl)||void 0===t||t.focus()},this.handleAction=()=>{this.coAction.emit()},this.handleShakeEnd=t=>{"co-input-shake"===t.animationName&&(this.shaking=!1)}}onValueChange(t){if(!this.inputEl||this.hasFocus)return;const i=null==t?"":t+"";this.inputEl.value!==i&&(this.inputEl.value=i)}onStatusChange(t,i){"error"===t&&"error"!==i?this.shaking=!0:"error"!==t&&(this.shaking=!1)}async setFocus(t){var i;null===(i=this.inputEl)||void 0===i||i.focus(t)}componentDidLoad(){var t;this.autoFocus&&(null===(t=this.inputEl)||void 0===t||t.focus())}get hasAction(){return!(!this.actionLabel&&!this.actionIcon)}get hasValue(){return null!=this.value&&""!==this.value}get statusFieldIcon(){switch(this.status){case"success":return"check";case"error":case"warning":return"warning";case"info":return"info";default:return null}}get helperIcon(){switch(this.status){case"error":case"warning":return"warning-circle";case"success":return"check-circle";case"info":return"info";default:return null}}renderFill(){const t=this.clearable&&this.hasValue&&!this.disabled&&!this.readonly,i=this.iconLeft||"magnifying-glass";return e("div",{class:{"co-input":!0,"co-input--fill":!0,["co-input--"+this.size]:!0,"co-input--disabled":this.disabled,"co-input--focused":this.hasFocus,"co-input--filled":this.hasValue},part:"wrapper"},e("div",{class:"co-input__field-row"},e("div",{class:"co-input__field",part:"field"},e("co-icon",{name:i,size:17,class:"co-input__icon co-input__icon--left"}),e("div",{class:"co-input__input-wrapper"},e("input",{ref:t=>this.inputEl=t,class:"co-input__native",type:this.type,name:this.name,value:this.value,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,required:this.required,autoComplete:this.autocomplete,onInput:this.handleInput,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,part:"input"})),this.clearable&&e("button",{class:{"co-input__clear":!0,"co-input__clear--hidden":!t},type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear input",part:"clear"},e("co-icon",{name:"x",size:14})))))}render(){if(this.fill)return this.renderFill();const t=this.clearable&&this.hasValue&&!this.disabled&&!this.readonly;return e("div",{class:{"co-input":!0,["co-input--"+this.layout]:!0,["co-input--"+this.size]:!0,"co-input--disabled":this.disabled,"co-input--focused":this.hasFocus,"co-input--filled":this.hasValue,["co-input--"+this.status]:"default"!==this.status,"co-input--has-action":this.hasAction,"co-input--flat":"flat"===this.variant,"co-input--shake":this.shaking},part:"wrapper"},(this.label||this.secondaryLabel)&&e("div",{class:"co-input__labels"},this.label&&e("label",{class:"co-input__label",part:"label"},this.label,e(c,{required:this.required})),this.secondaryLabel&&e("span",{class:"co-input__secondary-label",part:"secondary-label"},this.secondaryLabel)),e("div",{class:"co-input__field-row"},e("div",{class:"co-input__field",part:"field",onAnimationEnd:this.handleShakeEnd},this.iconLeft&&e("co-icon",{name:this.iconLeft,size:16,class:"co-input__icon co-input__icon--left"}),e("slot",{name:"chips"}),e("div",{class:"co-input__input-wrapper"},e("input",{ref:t=>this.inputEl=t,class:"co-input__native",type:this.type,name:this.name,value:this.value,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,required:this.required,autoComplete:this.autocomplete,onInput:this.handleInput,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,part:"input"})),this.clearable&&e("button",{class:{"co-input__clear":!0,"co-input__clear--hidden":!t},type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear input",part:"clear"},e("co-icon",{name:"x-circle",size:16,weight:"fill"})),this.iconRight&&e("co-icon",{name:this.iconRight,size:16,class:"co-input__icon co-input__icon--right"}),this.statusFieldIcon&&e("co-icon",{name:this.statusFieldIcon,size:16,class:"co-input__status-icon"}),e("slot",{name:"suffix"}),e("slot",null),e("slot",{name:"action"})),this.hasAction&&e("button",{class:"co-input__action",type:"button",onClick:this.handleAction,disabled:this.disabled,part:"action"},this.actionIcon&&e("co-icon",{name:this.actionIcon,size:16,class:"co-input__action-icon"}),this.actionLabel&&e("span",{class:"co-input__action-label"},this.actionLabel))),this.helperText&&e("div",{class:"co-input__helper co-input__helper--"+this.status,part:"helper"},this.helperIcon&&e("co-icon",{name:this.helperIcon,size:14,class:"co-input__helper-icon"}),e("span",{class:"co-input__helper-text"},this.helperText)))}get el(){return this}static get watchers(){return{value:[{onValueChange:0}],status:[{onStatusChange:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1}.co-input{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-input{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-input__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-input__label{white-space:normal}:host([layout='horizontal']) .co-input>:not(.co-input__labels){grid-column:2;min-width:0}.co-input__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-input__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;cursor:default}.co-input__secondary-label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;text-align:right}.co-input__field-row{display:flex;align-items:stretch}.co-input__field{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out);min-height:40px;box-sizing:border-box;overflow:hidden;flex:1;min-width:0}.co-input--flat .co-input__field{background:transparent;border-color:transparent}.co-input--s .co-input__field{min-height:28px;padding:var(--co-spacing-xxs) var(--co-spacing-sm);font-size:var(--co-font-size-12)}.co-input--sm .co-input__field{min-height:32px;padding:var(--co-spacing-xs) var(--co-spacing-sm);font-size:var(--co-font-size-14)}.co-input--lg .co-input__field{min-height:48px;padding:var(--co-spacing-sm) var(--co-spacing-lg);font-size:var(--co-font-size-16)}.co-input--has-action .co-input__field{border-radius:var(--co-border-radius-xs) 0 0 var(--co-border-radius-xs);border-right:none}.co-input__field ::slotted([slot=\"action\"]){margin-left:auto;margin-right:calc(-1 * var(--co-spacing-md));margin-top:calc(-1 * var(--co-spacing-sm2));margin-bottom:calc(-1 * var(--co-spacing-sm2));border-radius:0 var(--co-border-radius-xs) var(--co-border-radius-xs) 0;flex-shrink:0}.co-input__field ::slotted([slot=\"chips\"]){display:flex;gap:var(--co-spacing-xxs);align-items:center;flex-wrap:wrap;min-width:0}.co-input__input-wrapper{flex:1;display:flex;align-items:center;min-width:0;min-height:22px;padding:0}.co-input__native{width:100%;border:none;outline:none;background:transparent;font-family:inherit;font-size:inherit;font-weight:400;letter-spacing:inherit;line-height:1;color:var(--co-semantic-text-default);padding:0;margin:0}.co-input__native::placeholder{color:var(--co-semantic-text-muted)}.co-input__native[type='number']::-webkit-inner-spin-button,.co-input__native[type='number']::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.co-input__native[type='number']{-moz-appearance:textfield;appearance:textfield}.co-input__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-input__clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:16px;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-input__clear--hidden{visibility:hidden;pointer-events:none}.co-input__clear:hover{color:var(--co-semantic-text-default)}.co-input__action{display:flex;align-items:center;gap:var(--co-spacing-sm);padding:var(--co-spacing-sm2) var(--co-spacing-md) var(--co-spacing-sm2) var(--co-spacing-sm2);background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border:none;border-radius:0 var(--co-border-radius-xs) var(--co-border-radius-xs) 0;cursor:pointer;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;flex-shrink:0;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box}.co-input__action:hover{opacity:0.85}.co-input__action:disabled{opacity:0.4;cursor:not-allowed}.co-input__action-icon{display:flex;align-items:center;flex-shrink:0}.co-input__action-label{display:flex;align-items:center}.co-input__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-input__helper-icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-input__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body)}.co-input--focused .co-input__field{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-input--disabled .co-input__labels .co-input__label,.co-input--disabled .co-input__labels .co-input__secondary-label{color:var(--co-semantic-text-disabled)}.co-input--disabled .co-input__field{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-input--disabled .co-input__native{color:var(--co-semantic-text-disabled);cursor:not-allowed}.co-input--disabled .co-input__native::placeholder{color:var(--co-semantic-text-disabled)}.co-input--disabled .co-input__icon{color:var(--co-semantic-text-disabled)}.co-input__status-icon{flex-shrink:0;display:flex;align-items:center}.co-input--success .co-input__status-icon{color:var(--co-semantic-status-success)}.co-input--error .co-input__status-icon{color:var(--co-semantic-status-error)}.co-input--warning .co-input__status-icon{color:var(--co-color-status-review)}.co-input--info .co-input__status-icon{color:var(--co-semantic-status-info)}.co-input--error .co-input__field{border-color:var(--co-semantic-status-error)}.co-input--error.co-input--focused .co-input__field{border-color:var(--co-semantic-status-error);box-shadow:0 0 0 2px rgba(170, 46, 27, 0.12)}.co-input__helper--error .co-input__helper-icon,.co-input__helper--error .co-input__helper-text{color:var(--co-semantic-status-error)}.co-input--shake .co-input__field{animation:co-input-shake calc(var(--co-motion-duration-instant) * 3.5) var(--co-motion-ease-out) both}@keyframes co-input-shake{0%{transform:translateX(0);animation-timing-function:var(--co-motion-ease-out)}28.57%{transform:translateX(-6px);animation-timing-function:var(--co-motion-ease-out)}57.14%{transform:translateX(6px);animation-timing-function:var(--co-motion-ease-out)}78.57%{transform:translateX(-4px);animation-timing-function:var(--co-motion-ease-out)}100%{transform:translateX(0)}}.co-input--success .co-input__field{border-color:var(--co-semantic-status-success)}.co-input--success.co-input--focused .co-input__field{border-color:var(--co-semantic-status-success);box-shadow:0 0 0 2px rgba(10, 119, 36, 0.12)}.co-input__helper--success .co-input__helper-icon,.co-input__helper--success .co-input__helper-text{color:var(--co-semantic-status-success)}.co-input--warning .co-input__field{border-color:var(--co-color-status-review)}.co-input--warning.co-input--focused .co-input__field{border-color:var(--co-color-status-review);box-shadow:0 0 0 2px rgba(133, 87, 31, 0.12)}.co-input__helper--warning .co-input__helper-icon,.co-input__helper--warning .co-input__helper-text{color:var(--co-color-status-review)}.co-input--info .co-input__field{border-color:var(--co-semantic-status-info)}.co-input--info.co-input--focused .co-input__field{border-color:var(--co-semantic-status-info);box-shadow:0 0 0 2px rgba(45, 108, 197, 0.12)}.co-input__helper--info .co-input__helper-icon,.co-input__helper--info .co-input__helper-text{color:var(--co-semantic-status-info)}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}@supports not (background: color-mix(in srgb, red, transparent)){.co-input__field{background:var(--co-semantic-surface-secondary)}}.co-input--fill .co-input__field{background:var(--co-color-gray-100, #f6f6f6);border:none;box-shadow:none;border-radius:10px;padding:0 12px;gap:var(--co-spacing-sm2);min-height:46px;font-size:13.5px;-webkit-backdrop-filter:none;backdrop-filter:none}.co-input--fill.co-input--s .co-input__field{min-height:38px}.co-input--fill.co-input--sm .co-input__field{min-height:42px}.co-input--fill.co-input--lg .co-input__field{min-height:52px}.co-input--fill .co-input__native{font-size:13.5px;font-family:var(--co-font-family-primary);letter-spacing:var(--co-font-letter-spacing-body)}.co-input--fill .co-input__native::placeholder{color:var(--co-color-gray-400, #a0a0a0)}.co-input--fill .co-input__icon{color:var(--co-color-gray-400, #a0a0a0)}.co-input--fill .co-input__clear{color:var(--co-color-gray-400, #a0a0a0)}.co-input--fill .co-input__clear:hover{color:var(--co-color-gray-600, #585858)}.co-input--fill.co-input--focused .co-input__field{border-color:transparent;box-shadow:none}"}},[257,"co-input",{label:[1],secondaryLabel:[1,"secondary-label"],placeholder:[1],value:[1025],helperText:[1,"helper-text"],disabled:[4],readonly:[4],clearable:[4],iconLeft:[1,"icon-left"],iconRight:[1,"icon-right"],layout:[513],type:[1],name:[1],required:[4],autoFocus:[4,"auto-focus"],autocomplete:[1],status:[1],size:[513],variant:[513],fill:[4],actionLabel:[1,"action-label"],actionIcon:[1,"action-icon"],hasFocus:[32],shaking:[32],setFocus:[64]},void 0,{value:[{onValueChange:0}],status:[{onStatusChange:0}]}]);function r(){"undefined"!=typeof customElements&&["co-input","co-icon"].forEach((i=>{switch(i){case"co-input":customElements.get(t(i))||customElements.define(t(i),s);break;case"co-icon":customElements.get(t(i))||a()}}))}r();const l=s,p=r;export{l as CoInput,p as defineCustomElement}
|
|
1
|
+
import{t,p as i,H as o,c as n,h as e}from"./index.js";import{R as c}from"./p-CWneqh4n.js";import{d as a}from"./p-KK2vAKs-.js";const s=i(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coInput=n(this,"coInput",7),this.coChange=n(this,"coChange",7),this.coClear=n(this,"coClear",7),this.coFocus=n(this,"coFocus",7),this.coBlur=n(this,"coBlur",7),this.coAction=n(this,"coAction",7),this.placeholder="",this.value="",this.disabled=!1,this.readonly=!1,this.clearable=!1,this.layout="vertical",this.type="text",this.required=!1,this.autoFocus=!1,this.status="default",this.size="md",this.variant="default",this.fill=!1,this.hasFocus=!1,this.shaking=!1,this.handleInput=t=>{this.value=t.target.value,this.coInput.emit(this.value)},this.handleChange=()=>{this.coChange.emit(this.value)},this.handleFocus=()=>{this.hasFocus=!0,this.coFocus.emit()},this.handleBlur=()=>{this.hasFocus=!1,this.coBlur.emit()},this.handleKeyDown=t=>{if("Enter"===t.key){const t=this.el.closest("form");t&&t.requestSubmit()}},this.handleClear=()=>{var t;this.value="",this.coClear.emit(),this.coInput.emit(""),null===(t=this.inputEl)||void 0===t||t.focus()},this.handleAction=()=>{this.coAction.emit()},this.handleShakeEnd=t=>{"co-input-shake"===t.animationName&&(this.shaking=!1)}}onValueChange(t){if(!this.inputEl||this.hasFocus)return;const i=null==t?"":t+"";this.inputEl.value!==i&&(this.inputEl.value=i)}onStatusChange(t,i){"error"===t&&"error"!==i?this.shaking=!0:"error"!==t&&(this.shaking=!1)}async setFocus(t){var i;null===(i=this.inputEl)||void 0===i||i.focus(t)}componentDidLoad(){var t;this.autoFocus&&(null===(t=this.inputEl)||void 0===t||t.focus())}get hasAction(){return!(!this.actionLabel&&!this.actionIcon)}get hasValue(){return null!=this.value&&""!==this.value}get statusFieldIcon(){switch(this.status){case"success":return"check";case"error":case"warning":return"warning";case"info":return"info";default:return null}}get helperIcon(){switch(this.status){case"error":case"warning":return"warning-circle";case"success":return"check-circle";case"info":return"info";default:return null}}renderFill(){const t=this.clearable&&this.hasValue&&!this.disabled&&!this.readonly,i=this.iconLeft||"magnifying-glass";return e("div",{class:{"co-input":!0,"co-input--fill":!0,["co-input--"+this.size]:!0,"co-input--disabled":this.disabled,"co-input--focused":this.hasFocus,"co-input--filled":this.hasValue},part:"wrapper"},e("div",{class:"co-input__field-row"},e("div",{class:"co-input__field",part:"field"},e("co-icon",{name:i,size:17,class:"co-input__icon co-input__icon--left"}),e("div",{class:"co-input__input-wrapper"},e("input",{ref:t=>this.inputEl=t,class:"co-input__native",type:this.type,name:this.name,value:this.value,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,required:this.required,autoComplete:this.autocomplete,onInput:this.handleInput,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,part:"input"})),this.clearable&&e("button",{class:{"co-input__clear":!0,"co-input__clear--hidden":!t},type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear input",part:"clear"},e("co-icon",{name:"x",size:14})))))}render(){var t,i;if(this.fill)return this.renderFill();const o=this.clearable&&this.hasValue&&!this.disabled&&!this.readonly;return e("div",{class:{"co-input":!0,["co-input--"+this.layout]:!0,["co-input--"+this.size]:!0,"co-input--disabled":this.disabled,"co-input--focused":this.hasFocus,"co-input--filled":this.hasValue,["co-input--"+this.status]:"default"!==this.status,"co-input--has-action":this.hasAction,"co-input--flat":"flat"===this.variant,"co-input--soft":"soft"===this.variant,"co-input--shake":this.shaking},part:"wrapper"},(this.label||this.secondaryLabel)&&e("div",{class:"co-input__labels"},this.label&&e("label",{class:"co-input__label",part:"label"},this.label,e(c,{required:this.required})),this.secondaryLabel&&e("span",{class:"co-input__secondary-label",part:"secondary-label"},this.secondaryLabel)),e("div",{class:"co-input__field-row"},e("div",{class:"co-input__field",part:"field",onAnimationEnd:this.handleShakeEnd},this.iconLeft&&e("co-icon",{name:this.iconLeft,size:null!==(t=this.iconSize)&&void 0!==t?t:16,class:"co-input__icon co-input__icon--left"}),e("slot",{name:"chips"}),e("div",{class:"co-input__input-wrapper"},e("slot",{name:"prefix"}),e("input",{ref:t=>this.inputEl=t,class:"co-input__native",type:this.type,name:this.name,value:this.value,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,required:this.required,autoComplete:this.autocomplete,onInput:this.handleInput,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,part:"input"})),this.clearable&&e("button",{class:{"co-input__clear":!0,"co-input__clear--hidden":!o},type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear input",part:"clear"},e("co-icon",{name:"x-circle",size:16,weight:"fill"})),this.iconRight&&e("co-icon",{name:this.iconRight,size:null!==(i=this.iconSize)&&void 0!==i?i:16,class:"co-input__icon co-input__icon--right"}),this.statusFieldIcon&&e("co-icon",{name:this.statusFieldIcon,size:16,class:"co-input__status-icon"}),e("slot",{name:"suffix"}),e("slot",null),e("slot",{name:"action"})),this.hasAction&&e("button",{class:"co-input__action",type:"button",onClick:this.handleAction,disabled:this.disabled,part:"action"},this.actionIcon&&e("co-icon",{name:this.actionIcon,size:16,class:"co-input__action-icon"}),this.actionLabel&&e("span",{class:"co-input__action-label"},this.actionLabel))),this.helperText&&e("div",{class:"co-input__helper co-input__helper--"+this.status,part:"helper"},this.helperIcon&&e("co-icon",{name:this.helperIcon,size:14,class:"co-input__helper-icon"}),e("span",{class:"co-input__helper-text"},this.helperText)))}get el(){return this}static get watchers(){return{value:[{onValueChange:0}],status:[{onStatusChange:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1}.co-input{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-input{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-input__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-input__label{white-space:normal}:host([layout='horizontal']) .co-input>:not(.co-input__labels){grid-column:2;min-width:0}.co-input__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-input__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;cursor:default}.co-input__secondary-label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;text-align:right}.co-input__field-row{display:flex;align-items:stretch}.co-input__field{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out);min-height:40px;box-sizing:border-box;overflow:hidden;flex:1;min-width:0}.co-input--flat .co-input__field{background:transparent;border-color:transparent}.co-input--soft .co-input__field{background:var(--co-semantic-surface-control, #f6f6f6);border-color:transparent;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none;color:var(--co-semantic-text-default)}.co-input--s .co-input__field{min-height:28px;padding:var(--co-spacing-xxs) var(--co-spacing-sm);font-size:var(--co-font-size-12)}.co-input--sm .co-input__field{min-height:32px;padding:var(--co-spacing-xs) var(--co-spacing-sm);font-size:var(--co-font-size-14)}.co-input--lg .co-input__field{min-height:48px;padding:var(--co-spacing-sm) var(--co-spacing-lg);font-size:var(--co-font-size-16)}.co-input--has-action .co-input__field{border-radius:var(--co-border-radius-xs) 0 0 var(--co-border-radius-xs);border-right:none}.co-input__field ::slotted([slot=\"action\"]){margin-left:auto;margin-right:calc(-1 * var(--co-spacing-md));margin-top:calc(-1 * var(--co-spacing-sm2));margin-bottom:calc(-1 * var(--co-spacing-sm2));border-radius:0 var(--co-border-radius-xs) var(--co-border-radius-xs) 0;flex-shrink:0}.co-input__field ::slotted([slot=\"chips\"]){display:flex;gap:var(--co-spacing-xxs);align-items:center;flex-wrap:wrap;min-width:0}.co-input__input-wrapper{flex:1;display:flex;align-items:center;min-width:0;min-height:22px;padding:0}.co-input__native{width:100%;border:none;outline:none;background:transparent;font-family:inherit;font-size:inherit;font-weight:400;letter-spacing:inherit;line-height:1;color:var(--co-semantic-text-default);padding:0;margin:0}.co-input__native::placeholder{color:var(--co-semantic-text-muted)}.co-input__native[type='number']::-webkit-inner-spin-button,.co-input__native[type='number']::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.co-input__native[type='number']{-moz-appearance:textfield;appearance:textfield}.co-input__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-input__clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:16px;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-input__clear--hidden{visibility:hidden;pointer-events:none}.co-input__clear:hover{color:var(--co-semantic-text-default)}.co-input__action{display:flex;align-items:center;gap:var(--co-spacing-sm);padding:var(--co-spacing-sm2) var(--co-spacing-md) var(--co-spacing-sm2) var(--co-spacing-sm2);background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border:none;border-radius:0 var(--co-border-radius-xs) var(--co-border-radius-xs) 0;cursor:pointer;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;flex-shrink:0;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box}.co-input__action:hover{opacity:0.85}.co-input__action:disabled{opacity:0.4;cursor:not-allowed}.co-input__action-icon{display:flex;align-items:center;flex-shrink:0}.co-input__action-label{display:flex;align-items:center}.co-input__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-input__helper-icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-input__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body)}.co-input--focused .co-input__field{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-input--disabled .co-input__labels .co-input__label,.co-input--disabled .co-input__labels .co-input__secondary-label{color:var(--co-semantic-text-disabled)}.co-input--disabled .co-input__field{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-input--disabled .co-input__native{color:var(--co-semantic-text-disabled);cursor:not-allowed}.co-input--disabled .co-input__native::placeholder{color:var(--co-semantic-text-disabled)}.co-input--disabled .co-input__icon{color:var(--co-semantic-text-disabled)}.co-input__status-icon{flex-shrink:0;display:flex;align-items:center}.co-input--success .co-input__status-icon{color:var(--co-semantic-status-success)}.co-input--error .co-input__status-icon{color:var(--co-semantic-status-error)}.co-input--warning .co-input__status-icon{color:var(--co-color-status-review)}.co-input--info .co-input__status-icon{color:var(--co-semantic-status-info)}.co-input--error .co-input__field{border-color:var(--co-semantic-status-error)}.co-input--error.co-input--focused .co-input__field{border-color:var(--co-semantic-status-error);box-shadow:0 0 0 2px rgba(170, 46, 27, 0.12)}.co-input__helper--error .co-input__helper-icon,.co-input__helper--error .co-input__helper-text{color:var(--co-semantic-status-error)}.co-input--shake .co-input__field{animation:co-input-shake calc(var(--co-motion-duration-instant) * 3.5) var(--co-motion-ease-out) both}@keyframes co-input-shake{0%{transform:translateX(0);animation-timing-function:var(--co-motion-ease-out)}28.57%{transform:translateX(-6px);animation-timing-function:var(--co-motion-ease-out)}57.14%{transform:translateX(6px);animation-timing-function:var(--co-motion-ease-out)}78.57%{transform:translateX(-4px);animation-timing-function:var(--co-motion-ease-out)}100%{transform:translateX(0)}}.co-input--success .co-input__field{border-color:var(--co-semantic-status-success)}.co-input--success.co-input--focused .co-input__field{border-color:var(--co-semantic-status-success);box-shadow:0 0 0 2px rgba(10, 119, 36, 0.12)}.co-input__helper--success .co-input__helper-icon,.co-input__helper--success .co-input__helper-text{color:var(--co-semantic-status-success)}.co-input--warning .co-input__field{border-color:var(--co-color-status-review)}.co-input--warning.co-input--focused .co-input__field{border-color:var(--co-color-status-review);box-shadow:0 0 0 2px rgba(133, 87, 31, 0.12)}.co-input__helper--warning .co-input__helper-icon,.co-input__helper--warning .co-input__helper-text{color:var(--co-color-status-review)}.co-input--info .co-input__field{border-color:var(--co-semantic-status-info)}.co-input--info.co-input--focused .co-input__field{border-color:var(--co-semantic-status-info);box-shadow:0 0 0 2px rgba(45, 108, 197, 0.12)}.co-input__helper--info .co-input__helper-icon,.co-input__helper--info .co-input__helper-text{color:var(--co-semantic-status-info)}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}@supports not (background: color-mix(in srgb, red, transparent)){.co-input__field{background:var(--co-semantic-surface-secondary)}}.co-input--fill .co-input__field{background:var(--co-color-gray-100, #f6f6f6);border:none;box-shadow:none;border-radius:10px;padding:0 12px;gap:var(--co-spacing-sm2);min-height:46px;font-size:13.5px;-webkit-backdrop-filter:none;backdrop-filter:none}.co-input--fill.co-input--s .co-input__field{min-height:38px}.co-input--fill.co-input--sm .co-input__field{min-height:42px}.co-input--fill.co-input--lg .co-input__field{min-height:52px}.co-input--fill .co-input__native{font-size:13.5px;font-family:var(--co-font-family-primary);letter-spacing:var(--co-font-letter-spacing-body)}.co-input--fill .co-input__native::placeholder{color:var(--co-color-gray-400, #a0a0a0)}.co-input--fill .co-input__icon{color:var(--co-color-gray-400, #a0a0a0)}.co-input--fill .co-input__clear{color:var(--co-color-gray-400, #a0a0a0)}.co-input--fill .co-input__clear:hover{color:var(--co-color-gray-600, #585858)}.co-input--fill.co-input--focused .co-input__field{border-color:transparent;box-shadow:none}.co-input--xs .co-input__field{min-height:24px;padding:0 var(--co-spacing-md);font-size:var(--co-font-size-12);border-radius:var(--co-border-radius-xxs);gap:var(--co-spacing-sm)}.co-input--soft.co-input--disabled .co-input__field{background:var(--co-semantic-surface-control, #f6f6f6);border-color:transparent}.co-input--soft.co-input--disabled .co-input__field>.co-input__icon,.co-input--soft.co-input--disabled .co-input__field>.co-input__input-wrapper,.co-input--soft.co-input--disabled .co-input__field>.co-input__clear,.co-input--soft.co-input--disabled .co-input__field>.co-input__status-icon,.co-input--soft.co-input--disabled .co-input__field ::slotted(:not([slot=\"prefix\"])){opacity:0.35}.co-input__input-wrapper{gap:var(--co-spacing-xs)}.co-input__input-wrapper ::slotted([slot=\"prefix\"]){display:flex;align-items:center;flex-shrink:0;color:var(--co-semantic-text-muted)}.co-input--xs .co-input__input-wrapper ::slotted([slot=\"prefix\"]){font-size:var(--co-font-size-12);font-weight:400;color:var(--co-color-gray-600, #585858)}.co-input__field ::slotted([slot=\"suffix\"]){color:var(--co-input-suffix-color, inherit)}.co-input--xs .co-input__field ::slotted([slot=\"suffix\"]){font-size:var(--co-font-size-12)}"}},[257,"co-input",{label:[1],secondaryLabel:[1,"secondary-label"],placeholder:[1],value:[1025],helperText:[1,"helper-text"],disabled:[4],readonly:[4],clearable:[4],iconLeft:[1,"icon-left"],iconRight:[1,"icon-right"],layout:[513],type:[1],name:[1],required:[4],autoFocus:[4,"auto-focus"],autocomplete:[1],status:[1],size:[513],variant:[513],iconSize:[2,"icon-size"],fill:[4],actionLabel:[1,"action-label"],actionIcon:[1,"action-icon"],hasFocus:[32],shaking:[32],setFocus:[64]},void 0,{value:[{onValueChange:0}],status:[{onStatusChange:0}]}]);function r(){"undefined"!=typeof customElements&&["co-input","co-icon"].forEach((i=>{switch(i){case"co-input":customElements.get(t(i))||customElements.define(t(i),s);break;case"co-icon":customElements.get(t(i))||a()}}))}r();const l=s,p=r;export{l as CoInput,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as o,H as i,c as s,h as t}from"./index.js";import{R as a}from"./p-CWneqh4n.js";import{d as c}from"./p-
|
|
1
|
+
import{t as e,p as o,H as i,c as s,h as t}from"./index.js";import{R as a}from"./p-CWneqh4n.js";import{d as c}from"./p-KK2vAKs-.js";const n=o(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coInput=s(this,"coInput",7),this.coChange=s(this,"coChange",7),this.coValidity=s(this,"coValidity",7),this.coFocus=s(this,"coFocus",7),this.coBlur=s(this,"coBlur",7),this.value="",this.placeholder="{ }",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=8,this.status="default",this.invalidMessage="Invalid JSON",this.layout="vertical",this.size="md",this.draft="",this.internalInvalid=!1,this.hasFocus=!1,this.handleInput=e=>{this.draft=e.target.value,this.validate(!0),this.coInput.emit(this.draft)},this.handleFocus=()=>{this.hasFocus=!0,this.coFocus.emit()},this.handleBlur=()=>{this.hasFocus=!1,this.value=this.draft,this.coChange.emit(this.draft),this.coBlur.emit()}}componentWillLoad(){var e;this.draft=null!==(e=this.value)&&void 0!==e?e:"",this.validate(!1)}onValueChange(){var e;this.hasFocus||(this.draft=null!==(e=this.value)&&void 0!==e?e:"",this.validate(!1))}get isInvalid(){return"error"===this.status||this.internalInvalid}validate(e){const o=this.draft.trim(),i=""===o||this.tryParse(o);return!i!==this.internalInvalid&&(this.internalInvalid=!i,e&&this.coValidity.emit({valid:i,message:i?void 0:this.invalidMessage})),i}tryParse(e){try{return JSON.parse(e),!0}catch(e){return!1}}render(){const e=this.internalInvalid?this.invalidMessage:this.helperText,o="default"!==this.status?"co-json-field--"+this.status:"";return t("div",{key:"116c07e036c670e20dd461a907a3bc46e0120b74",class:{"co-json-field":!0,"co-json-field--disabled":this.disabled,"co-json-field--focused":this.hasFocus,"co-json-field--invalid":this.isInvalid,["co-json-field--"+this.size]:!0,[o]:!!o},part:"wrapper"},this.label&&t("div",{key:"aecaf5025db4a5fe4030e513b57df1b98121b62e",class:"co-json-field__labels"},t("label",{key:"2f23f19d1fa5cd9f324c67a6fe93ac3d5df98c66",class:"co-json-field__label",part:"label"},this.label,t(a,{key:"cf1dad000ccfd9de7598c2891413f2564d5e3f6e",required:this.required}))),t("div",{key:"0c43c4df775b1a854f10db5a0531d5e0817a916c",class:"co-json-field__field",part:"field"},t("textarea",{key:"f9472a1dbc02388214d0c51277dcc838289e2b79",class:"co-json-field__native",rows:this.rows,spellcheck:!1,autocomplete:"off",value:this.draft,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,required:this.required,"aria-invalid":this.isInvalid?"true":"false","aria-label":this.label?void 0:"JSON",onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,part:"input"})),this.name&&t("input",{key:"6c365c240716d857fc026e4c58c08c59722b95f9",type:"hidden",name:this.name,value:this.draft}),e&&t("div",{key:"e97c531fbd3a1c3dbec67d0de3f90ba632fe64cb",class:{"co-json-field__helper":!0,"co-json-field__helper--error":this.isInvalid},part:"helper"},this.isInvalid&&t("co-icon",{key:"ae9751723abb04b19127d93a4fd798f5e03e8b90",name:"warning-circle",size:14,class:"co-json-field__helper-icon"}),t("span",{key:"8d44b589ba7d923476e7fd94f572d04452585977",class:"co-json-field__helper-text"},e)))}get el(){return this}static get watchers(){return{value:[{onValueChange:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1}.co-json-field{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-json-field__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-json-field__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;cursor:default}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}.co-json-field__field{display:flex;background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box;overflow:hidden}.co-json-field__native{width:100%;resize:vertical;border:none;outline:none;background:transparent;font-family:var(--co-font-family-mono, monospace);font-size:var(--co-font-size-13, 13px);font-weight:400;line-height:1.5;color:var(--co-semantic-text-default);padding:var(--co-spacing-sm2) var(--co-spacing-md);margin:0;box-sizing:border-box;tab-size:2}.co-json-field__native::placeholder{color:var(--co-semantic-text-muted)}.co-json-field--s .co-json-field__native{padding:var(--co-spacing-xxs) var(--co-spacing-sm);font-size:var(--co-font-size-12, 12px)}.co-json-field--sm .co-json-field__native{padding:var(--co-spacing-xs) var(--co-spacing-sm)}.co-json-field--lg .co-json-field__native{padding:var(--co-spacing-sm) var(--co-spacing-lg);font-size:var(--co-font-size-14)}.co-json-field__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-json-field__helper-icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-json-field__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body)}.co-json-field--focused .co-json-field__field{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-json-field--disabled{opacity:0.6;pointer-events:none}.co-json-field--disabled .co-json-field__field{background:var(--co-semantic-surface-disabled);border-color:transparent}.co-json-field--invalid .co-json-field__field,.co-json-field--error .co-json-field__field{border-color:var(--co-semantic-status-error)}.co-json-field--invalid.co-json-field--focused .co-json-field__field,.co-json-field--error.co-json-field--focused .co-json-field__field{border-color:var(--co-semantic-status-error);box-shadow:0 0 0 2px rgba(170, 46, 27, 0.12)}.co-json-field__helper--error .co-json-field__helper-icon,.co-json-field__helper--error .co-json-field__helper-text{color:var(--co-semantic-status-error)}:host([layout='horizontal']) .co-json-field{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-json-field__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-json-field__label{white-space:normal}:host([layout='horizontal']) .co-json-field>:not(.co-json-field__labels){grid-column:2;min-width:0}"}},[1,"co-json-field",{value:[1025],label:[1],placeholder:[1],name:[1],required:[4],disabled:[4],readonly:[4],rows:[2],status:[1],helperText:[1,"helper-text"],invalidMessage:[1,"invalid-message"],layout:[513],size:[513],draft:[32],internalInvalid:[32],hasFocus:[32]},void 0,{value:[{onValueChange:0}]}]);function r(){"undefined"!=typeof customElements&&["co-json-field","co-icon"].forEach((o=>{switch(o){case"co-json-field":customElements.get(e(o))||customElements.define(e(o),n);break;case"co-icon":customElements.get(e(o))||c()}}))}r();const l=n,d=r;export{l as CoJsonField,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CoKbd extends Components.CoKbd, HTMLElement {}
|
|
4
|
+
export const CoKbd: {
|
|
5
|
+
prototype: CoKbd;
|
|
6
|
+
new (): CoKbd;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as o,d as p}from"./p-8XzG8pzY.js";const s=o,r=p;export{s as CoKbd,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as o,d as
|
|
1
|
+
import{C as o,d as s}from"./p-B3Egz082.js";const p=o,r=s;export{p as CoLightbox,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as
|
|
1
|
+
import{C as s,d as o}from"./p-Bw_b_czs.js";const p=s,r=o;export{p as CoListFooter,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as i,c as s,h as o}from"./index.js";import{d as c}from"./p-
|
|
1
|
+
import{t as e,p as t,H as i,c as s,h as o}from"./index.js";import{d as c}from"./p-KK2vAKs-.js";import{d as a}from"./p-8XzG8pzY.js";import{d as n}from"./p-9VoFSbIH.js";const l=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coSelect=s(this,"coSelect",7),this.selected=!1,this.disabled=!1,this.dense=!1,this.labelTruncated=!1,this.descTruncated=!1,this.measureTruncation=()=>{const e=!!this.labelEl&&this.labelEl.scrollWidth>this.labelEl.clientWidth+1,t=!!this.descEl&&this.descEl.scrollWidth>this.descEl.clientWidth+1;e!==this.labelTruncated&&(this.labelTruncated=e),t!==this.descTruncated&&(this.descTruncated=t)},this.handleClick=()=>{this.disabled||this.coSelect.emit()},this.handleKeyDown=e=>{this.disabled||"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),this.coSelect.emit())}}componentDidLoad(){"undefined"!=typeof ResizeObserver&&(this.ro=new ResizeObserver((()=>this.measureTruncation())),this.labelEl&&this.ro.observe(this.labelEl),this.descEl&&this.ro.observe(this.descEl)),this.measureTruncation()}disconnectedCallback(){var e;null===(e=this.ro)||void 0===e||e.disconnect(),this.ro=void 0}onTextChange(){requestAnimationFrame(this.measureTruncation)}render(){return o("div",{key:"b00bba3c362b7fded6dbb54a3a77204fd6f12f06",class:{"co-list-item":!0,"co-list-item--selected":this.selected,"co-list-item--disabled":this.disabled,"co-list-item--dense":this.dense,"co-list-item--has-description":!!this.description},part:"item",role:"option",tabindex:this.disabled?-1:0,"aria-selected":this.selected?"true":"false","aria-disabled":this.disabled?"true":"false",onClick:this.handleClick,onKeyDown:this.handleKeyDown},o("span",{key:"12df4e650ce79eb1a1081cbaa8d8a0df472bd60f",class:"co-list-item__prefix"},this.icon&&o("co-icon",{key:"6d0b024a833e411784c6c1aec18d2e170657bff5",name:this.icon,size:18}),o("slot",{key:"6d920565296d083b5ebd1683452b54cb18d7cc02",name:"prefix"})),o("div",{key:"9f1ee9f1a8d09ede38cdf56fe6f34bb389d3a008",class:"co-list-item__content"},this.label&&o("co-tooltip",{key:"320ce0919f79ed00a189c19c890cdd31ec8f4fad",block:!0,class:"co-list-item__tip",content:this.label,placement:"top",disabled:!this.labelTruncated},o("span",{key:"c735e984ef6b50d4b075829e496282123463b20a",class:"co-list-item__label",ref:e=>{this.labelEl=e,e&&this.ro&&this.ro.observe(e)}},this.label)),this.description&&o("co-tooltip",{key:"729e862dc61a4c342e850b4453916bc3c477bdd2",block:!0,class:"co-list-item__tip",content:this.description,placement:"top",disabled:!this.descTruncated},o("span",{key:"b593f33d3b0122ab535a94c7ce259add9069323c",class:"co-list-item__description",ref:e=>{this.descEl=e,e&&this.ro&&this.ro.observe(e)}},this.description)),o("slot",{key:"55c7bc86e9aea170a37862642531d01203071e0a"})),o("span",{key:"bef781667653254040abbfbdc518ce6086c17248",class:"co-list-item__suffix"},o("slot",{key:"349cde2b81c10eb9e9c425b96808ad6bcb86d527",name:"suffix"})))}get el(){return this}static get watchers(){return{label:[{onTextChange:0}],description:[{onTextChange:0}]}}static get style(){return":host{display:block}.co-list-item{display:flex;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-md) var(--co-spacing-lg);font-family:var(--co-font-family-primary);cursor:pointer;border-radius:var(--co-border-radius-sm);transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box;min-height:40px}.co-list-item--dense{gap:var(--co-spacing-sm);padding:6px var(--co-spacing-sm);border-radius:var(--co-border-radius-xxs);min-height:32px}.co-list-item--dense .co-list-item__label{font-size:var(--co-font-size-14)}.co-list-item:hover:not(.co-list-item--disabled){background:var(--co-semantic-surface-hover)}.co-list-item:focus-visible{outline:none;box-shadow:0 0 0 2px var(--co-semantic-border-focus)}.co-list-item--selected{background:var(--co-semantic-surface-muted)}.co-list-item--disabled{opacity:0.4;cursor:not-allowed}.co-list-item__prefix,.co-list-item__suffix{display:flex;align-items:center;gap:var(--co-spacing-sm);flex-shrink:0;color:var(--co-semantic-text-muted)}.co-list-item__prefix:empty,.co-list-item__suffix:empty{display:none}.co-list-item__content{display:flex;flex-direction:column;flex:1;min-width:0}.co-list-item__content>.co-list-item__tip{min-width:0;max-width:100%}.co-list-item__label{display:block;font-size:var(--co-font-size-14);font-weight:400;color:var(--co-semantic-text-default);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-list-item__description{display:block;font-size:var(--co-font-size-12);color:var(--co-semantic-text-muted);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"}},[257,"co-list-item",{label:[1],description:[1],icon:[1],selected:[516],disabled:[4],dense:[516],labelTruncated:[32],descTruncated:[32]},void 0,{label:[{onTextChange:0}],description:[{onTextChange:0}]}]);function d(){"undefined"!=typeof customElements&&["co-list-item","co-icon","co-kbd","co-tooltip"].forEach((t=>{switch(t){case"co-list-item":customElements.get(e(t))||customElements.define(e(t),l);break;case"co-icon":customElements.get(e(t))||c();break;case"co-kbd":customElements.get(e(t))||a();break;case"co-tooltip":customElements.get(e(t))||n()}}))}d();const r=l,h=d;export{r as CoListItem,h as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as i,h as
|
|
1
|
+
import{t as e,p as t,H as i,h as a}from"./index.js";const s=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.video=!1,this.height="132px",this.radius=10}toCss(e){if("number"==typeof e)return e+"px";const t=(e+"").trim();return/^-?\d*\.?\d+$/.test(t)?t+"px":t}render(){var e;return a("div",{key:"715a75c2d9bf586503838952ce1db8ba0a3b74ea",class:{"co-media-thumb":!0,"co-media-thumb--video":this.video},part:"thumb",style:{height:this.toCss(this.height),borderRadius:this.radius+"px"}},this.src?a("img",{class:"co-media-thumb__img",src:this.src,alt:null!==(e=this.alt)&&void 0!==e?e:"",part:"img"}):a("slot",null),this.video&&a("div",{key:"8a6e21bb26be30746d05a00b5fffca7c6992abd1",class:"co-media-thumb__scrim",part:"scrim"},a("div",{key:"67bf73c8a6a14581b47809efac7e1d4b2628324d",class:"co-media-thumb__play",part:"play"},a("svg",{key:"a0f530d26561a4e7256d5f5ee20e6a7d91d8f6e0",class:"co-media-thumb__play-icon",width:"16",height:"18",viewBox:"0 0 16 18",fill:"none","aria-hidden":"true"},a("path",{key:"86ef92454cdcca6096cd3dc435833138c46e2e39",d:"M2 2l12 7-12 7z",fill:"var(--co-color-base-negro, #1f1c1b)"})))))}static get style(){return":host{display:block}.co-media-thumb{position:relative;overflow:hidden;width:100%;background:var(--co-color-gray-100, #f6f6f6);box-sizing:border-box}.co-media-thumb__img{width:100%;height:100%;object-fit:cover;display:block}.co-media-thumb__scrim{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(31, 28, 27, 0.28)}.co-media-thumb__play{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:50%;background:rgba(255, 255, 255, 0.92)}.co-media-thumb__play-icon{display:block;margin-left:2px;}"}},[257,"co-media-thumb",{src:[1],video:[4],height:[8],radius:[2],alt:[1]}]);function c(){"undefined"!=typeof customElements&&["co-media-thumb"].forEach((t=>{"co-media-thumb"===t&&(customElements.get(e(t))||customElements.define(e(t),s))}))}c();const o=s,d=c;export{o as CoMediaThumb,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as r,H as
|
|
1
|
+
import{t as e,p as r,H as o,h as s}from"./index.js";const c=r(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}render(){return s("hr",{key:"08a30fe0fba8fbbab4a6fce1bc92c700aa767b2d",class:"co-menu-divider",role:"separator"})}static get style(){return":host{display:block}.co-menu-divider{border:0;border-top:1px solid var(--co-semantic-border-subtle, rgba(31, 28, 27, 0.08));margin:var(--co-spacing-xs, 4px) 0}.co-menu-divider{border-top-color:var(--co-menu-divider-color, var(--co-semantic-border-subtle, rgba(31, 28, 27, 0.08)));margin:var(--co-menu-divider-margin, var(--co-spacing-xs, 4px) 0)}"}},[1,"co-menu-divider"]);function i(){"undefined"!=typeof customElements&&["co-menu-divider"].forEach((r=>{"co-menu-divider"===r&&(customElements.get(e(r))||customElements.define(e(r),c))}))}i();const t=c,n=i;export{t as CoMenuDivider,n as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as i,c as o,h as
|
|
1
|
+
import{t as e,p as t,H as i,c as o,h as n}from"./index.js";import{s,S as c,a,b as m,i as r}from"./p-DU-KOQ8L.js";import{d as u}from"./p-KK2vAKs-.js";import{d as l}from"./p-TGRbLkLz.js";const h=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coSelect=o(this,"coSelect",7),this.coMenuSelect=o(this,"coMenuSelect",7),this.dense=!1,this.selected=!1,this.trailingCheck=!1,this.leadingCheck=!1,this.disabled=!1,this.variant="default",this.hasSubmenu=!1,this.submenuOpen=!1,this.submenuPlacementValue="right-start",this.handleClick=e=>{if(!this.disabled){if(this.hasSubmenu)return e.stopPropagation(),void this.openSubmenu();this.coSelect.emit(),this.coMenuSelect.emit()}},this.handleKeydown=e=>{var t;this.disabled||("Enter"===e.key||" "===e.key?(e.preventDefault(),this.handleClick(e)):"ArrowRight"===e.key&&this.hasSubmenu?(e.preventDefault(),this.openSubmenu(),requestAnimationFrame((()=>{var e;const t=this.el.querySelector("co-menu-item");null===(e=null==t?void 0:t.focusItem)||void 0===e||e.call(t)}))):"ArrowLeft"===e.key&&this.submenuOpen&&(e.preventDefault(),this.submenuOpen=!1,null===(t=this.rowEl)||void 0===t||t.focus()))},this.handleMouseEnter=()=>{!this.disabled&&this.hasSubmenu&&(this.cancelClose(),this.openSubmenu())},this.handleMouseLeave=()=>{this.hasSubmenu&&this.scheduleClose()},this.handlePlacement=e=>{const t=s(e.detail.placement);t&&this.el.setAttribute(c,t)},this.cancelClose=()=>{this.closeTimer&&(window.clearTimeout(this.closeTimer),this.closeTimer=void 0)}}onSubmenuOpenChange(e){e?this.el.setAttribute("data-submenu-open",""):this.el.removeAttribute("data-submenu-open")}async focusItem(){var e;null===(e=this.rowEl)||void 0===e||e.focus()}componentWillLoad(){this.hasSubmenu=this.detectSubmenu()}disconnectedCallback(){this.cancelClose()}detectSubmenu(){for(const e of Array.from(this.el.children)){const t=e.tagName.toLowerCase();if("co-menu-item"===t||"co-menu-divider"===t)return!0}return!1}openSubmenu(){this.submenuOpen||this.closeSiblingSubmenus(),this.submenuPlacementValue=a(r(this.el),m(this.el)),this.submenuOpen=!0}async closeSubmenu(){this.cancelClose(),this.submenuOpen=!1}closeSiblingSubmenus(){var e,t;const i=this.el.parentElement;if(i)for(const o of Array.from(i.children))o!==this.el&&"co-menu-item"===o.tagName.toLowerCase()&&(null===(t=(e=o).closeSubmenu)||void 0===t||t.call(e))}scheduleClose(){this.cancelClose(),this.closeTimer=window.setTimeout((()=>{this.submenuOpen=!1}),260)}render(){var e;const t=n("button",{ref:e=>this.rowEl=e,class:{"co-menu-item":!0,"co-menu-item--dense":this.dense,"co-menu-item--selected":this.selected,"co-menu-item--disabled":this.disabled,"co-menu-item--danger":"danger"===this.variant,"co-menu-item--submenu":this.hasSubmenu,"co-menu-item--submenu-open":this.hasSubmenu&&this.submenuOpen},type:"button",role:"menuitem","aria-haspopup":this.hasSubmenu?"menu":void 0,"aria-expanded":this.hasSubmenu?this.submenuOpen?"true":"false":void 0,disabled:this.disabled,onClick:this.handleClick,onKeyDown:this.handleKeydown,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},this.leadingCheck&&n("span",{class:"co-menu-item__check co-menu-item__check--leading"},this.selected&&n("co-icon",{name:"check",size:12})),this.icon&&n("span",{class:"co-menu-item__icon"},n("co-icon",{name:this.icon,size:null!==(e=this.iconSize)&&void 0!==e?e:16})),n("span",{class:{"co-menu-item__label":!0,"co-menu-item__label--stacked":!!this.caption}},n("span",{class:"co-menu-item__label-main"},this.label,n("slot",{name:"label"})),this.caption&&n("span",{class:"co-menu-item__caption"},this.caption)),this.trailingCheck&&n("span",{class:"co-menu-item__check"},n("co-icon",{name:"check",size:15})),n("span",{class:"co-menu-item__suffix"},n("slot",{name:"suffix"}),this.hasSubmenu&&n("co-icon",{name:"caret-right",size:14})));return this.hasSubmenu?n("div",{class:"co-menu-item__wrap co-menu-item__wrap--submenu",onMouseEnter:this.cancelClose,onMouseLeave:this.handleMouseLeave},n("co-popover",{placement:this.submenuPlacementValue,offset:4,open:this.submenuOpen,bare:!0,onCoOpen:()=>this.openSubmenu(),onCoClose:()=>{this.submenuOpen=!1},onCoPlacement:this.handlePlacement},n("div",{slot:"trigger",class:"co-menu-item__trigger-wrap"},t),n("div",{class:"co-menu-item__submenu",role:"menu",onMouseEnter:this.cancelClose,onMouseLeave:this.handleMouseLeave},n("slot",null)))):n("div",{class:"co-menu-item__wrap"},t)}get el(){return this}static get watchers(){return{submenuOpen:[{onSubmenuOpenChange:0}]}}static get style(){return":host{display:block}.co-menu-item__wrap{display:block}.co-menu-item{width:100%;display:flex;align-items:center;gap:var(--co-menu-item-gap, var(--co-spacing-sm, 8px));padding:var(--co-menu-item-padding, var(--co-spacing-sm, 8px) var(--co-spacing-md, 12px));background:transparent;border:0;border-radius:var(--co-border-radius-xs, 8px);font-family:var(--co-font-family-primary);font-size:var(--co-menu-item-font-size, var(--co-font-size-14, 14px));font-weight:var(--co-menu-item-font-weight, normal);letter-spacing:var(--co-menu-item-letter-spacing, normal);line-height:var(--co-menu-item-line-height, normal);color:var(--co-menu-item-color, var(--co-semantic-text-default));text-align:left;cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), color var(--co-motion-duration-fast) var(--co-motion-ease-out);min-height:var(--co-menu-item-height, 36px);box-sizing:border-box}.co-menu-item--dense{padding:var(--co-spacing-xs, 4px) var(--co-spacing-md, 12px);min-height:32px}.co-menu-item--selected{background:var(--co-menu-item-selected-bg, var(--co-color-gray-100, #f6f6f6))}.co-menu-item:hover,.co-menu-item--submenu-open{background:var(--co-menu-item-hover-bg, var(--co-semantic-surface-hover, rgba(31, 28, 27, 0.04)))}.co-menu-item:focus-visible{outline:2px solid var(--co-semantic-border-focus, #2563eb);outline-offset:-2px}.co-menu-item--disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}.co-menu-item--danger{color:var(--co-color-status-error, #aa2e1b)}.co-menu-item--danger:hover{background:var(--co-color-status-bg-error, #ffefef)}.co-menu-item__icon{display:inline-flex;align-items:center;flex-shrink:0;color:var(--co-menu-item-icon-color, currentColor)}.co-menu-item__check{display:inline-flex;align-items:center;flex-shrink:0;color:var(--co-menu-item-color, var(--co-semantic-text-default))}.co-menu-item__label{flex:1;display:inline-flex;align-items:center;gap:var(--co-spacing-xs, 4px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-menu-item__label--stacked{flex-direction:column;align-items:flex-start;gap:1px}.co-menu-item__label-main{display:inline-flex;align-items:center;gap:var(--co-spacing-xs, 4px)}.co-menu-item__caption{font-size:var(--co-font-size-11, 11px);color:var(--co-semantic-text-muted);line-height:1.3;white-space:nowrap}.co-menu-item__suffix{display:inline-flex;align-items:center;gap:var(--co-spacing-xs, 4px);flex-shrink:0;color:var(--co-semantic-text-muted)}.co-menu-item--submenu-open .co-menu-item__suffix{color:var(--co-semantic-text-default)}.co-menu-item__trigger-wrap{display:block}.co-menu-item__wrap--submenu>co-popover{display:block;width:100%}.co-menu-item__submenu{background:var(--co-semantic-surface-secondary, #fff);border-radius:var(--co-border-radius-sm, 12px);box-shadow:var(--co-shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04)), inset 0 0 0 1px var(--co-color-opacity-negro-8, rgba(31, 28, 27, 0.08));padding:var(--co-menu-padding, var(--co-spacing-xs, 4px));min-width:180px;display:flex;flex-direction:column;gap:2px;position:relative}.co-menu-item__submenu::before,.co-menu-item__submenu::after{content:'';position:absolute;top:0;bottom:0;width:6px;}.co-menu-item__submenu::before{left:-6px}.co-menu-item__submenu::after{right:-6px}.co-menu-item__check--leading{width:12px;justify-content:center}"}},[257,"co-menu-item",{icon:[1],iconSize:[2,"icon-size"],label:[1],caption:[1],dense:[4],selected:[4],trailingCheck:[4,"trailing-check"],leadingCheck:[4,"leading-check"],disabled:[4],variant:[1],hasSubmenu:[32],submenuOpen:[32],submenuPlacementValue:[32],focusItem:[64],closeSubmenu:[64]},void 0,{submenuOpen:[{onSubmenuOpenChange:0}]}]);function p(){"undefined"!=typeof customElements&&["co-menu-item","co-icon","co-popover"].forEach((t=>{switch(t){case"co-menu-item":customElements.get(e(t))||customElements.define(e(t),h);break;case"co-icon":customElements.get(e(t))||u();break;case"co-popover":customElements.get(e(t))||l()}}))}p();const d=h,f=p;export{d as CoMenuItem,f as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as
|
|
1
|
+
import{t as e,p as o,H as t,c as s,h as n}from"./index.js";import{M as r,m as a}from"./p-DU-KOQ8L.js";import{d as i}from"./p-TGRbLkLz.js";const c=o(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coOpen=s(this,"coOpen",3),this.coClose=s(this,"coClose",3),this.placement="bottom-end",this.offset=4,this.autoClose=!0,this.open=!1,this.surface="light",this.shift=0,this.handleKeydown=e=>{if(this.open)switch(e.key){case"Escape":e.preventDefault(),e.stopPropagation(),this.open=!1;break;case"ArrowDown":case"ArrowUp":e.preventDefault(),this.moveFocus("ArrowDown"===e.key?1:-1)}},this.handlePopoverOpen=()=>{this.open=!0,this.coOpen.emit()},this.handlePlacement=e=>{this.el.setAttribute(r,a(e.detail.placement))},this.handlePopoverClose=()=>{this.open=!1,this.coClose.emit()}}handleMenuSelect(){this.autoClose&&(this.open=!1)}onOpenChange(e){e?(document.addEventListener("keydown",this.handleKeydown,!0),requestAnimationFrame((()=>this.focusFirstItem()))):document.removeEventListener("keydown",this.handleKeydown,!0)}componentDidLoad(){this.open&&this.onOpenChange(!0)}disconnectedCallback(){document.removeEventListener("keydown",this.handleKeydown,!0)}async focusFirstItem(){var e,o;null===(o=null===(e=this.getMenuItems()[0])||void 0===e?void 0:e.focusItem)||void 0===o||o.call(e)}getMenuItems(){return d(this.activePanel())}activePanel(){let e=this.el;for(;;){const o=d(e).find((e=>e.hasAttribute("data-submenu-open")));if(!o)return e;e=o}}moveFocus(e){var o,t;const s=this.getMenuItems().filter((e=>!e.disabled));if(0===s.length)return;const n=document.activeElement;let r=s.findIndex((e=>e===n||e.contains(n)));-1===r&&(r=e>0?-1:s.length),null===(t=null===(o=s[(r+e+s.length)%s.length])||void 0===o?void 0:o.focusItem)||void 0===t||t.call(o)}render(){return n("co-popover",{key:"66b0e90463829343152d2a9bdb821e19e70fa4d4",placement:this.placement,offset:this.offset,open:this.open,anchor:this.anchor,shift:this.shift,bare:!0,onCoOpen:this.handlePopoverOpen,onCoClose:this.handlePopoverClose,onCoPlacement:this.handlePlacement},n("slot",{key:"b78bcba7bc9542a82c78c1b8026bd4aa56629667",name:"trigger",slot:"trigger"}),n("div",{key:"0515763cb0b89320d4831befe1b6d984029ce309",class:"co-menu",role:"menu",style:this.width?{width:this.width,minWidth:this.width}:void 0},n("slot",{key:"baf72944333c4e912fe0a0aa58d8affb8e923a3e"})))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return":host{display:contents}.co-menu{background:var(--co-semantic-surface-secondary, #fff);border-radius:var(--co-border-radius-sm, 12px);box-shadow:var(--co-shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04)), inset 0 0 0 1px var(--co-color-opacity-negro-8, rgba(31, 28, 27, 0.08));padding:var(--co-menu-padding, var(--co-spacing-xs, 4px));min-width:200px;display:flex;flex-direction:column;gap:2px;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14, 14px);color:var(--co-semantic-text-default)}.co-menu{gap:var(--co-menu-gap, 2px);min-width:var(--co-menu-min-width, 200px);box-shadow:var(--co-shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04)), inset 0 0 0 1px var(--co-menu-border-color, var(--co-color-opacity-negro-8, rgba(31, 28, 27, 0.08)))}.co-menu{border-radius:var(--co-menu-radius, var(--co-border-radius-sm, 12px));max-height:var(--co-menu-max-height, none);overflow:var(--co-menu-overflow, visible)}:host([surface='dark']) .co-menu{background:var(--co-semantic-surface-primary);color:var(--co-semantic-text-inverse);box-shadow:var(--co-menu-shadow, none);border-radius:var(--co-menu-radius, var(--co-border-radius-xs, 8px));min-width:auto}:host([surface='dark']) ::slotted(co-menu-item){--co-menu-item-color:var(--co-semantic-text-inverse);--co-menu-item-hover-bg:var(--co-color-opacity-blanco-16, rgba(255, 255, 255, 0.16));--co-menu-item-selected-bg:transparent}:host([surface='dark']) ::slotted(co-menu-divider){--co-menu-divider-color:var(--co-color-opacity-blanco-16, rgba(255, 255, 255, 0.16))}"}},[257,"co-menu",{placement:[1],offset:[2],autoClose:[4,"auto-close"],open:[1540],width:[1],surface:[513],anchor:[1],shift:[2],focusFirstItem:[64]},[[0,"coMenuSelect","handleMenuSelect"]],{open:[{onOpenChange:0}]}]);function d(e){const o="co-menu-item"===e.tagName.toLowerCase();return Array.from(e.querySelectorAll("co-menu-item")).filter((t=>{var s,n;const r=null!==(n=null===(s=t.parentElement)||void 0===s?void 0:s.closest("co-menu-item"))&&void 0!==n?n:null;return o?r===e:null===r}))}function u(){"undefined"!=typeof customElements&&["co-menu","co-popover"].forEach((o=>{switch(o){case"co-menu":customElements.get(e(o))||customElements.define(e(o),c);break;case"co-popover":customElements.get(e(o))||i()}}))}u();const m=c,h=u;export{m as CoMenu,h as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as o,p as a,H as e,c as r,h as s}from"./index.js";import{d as t,a as c}from"./p-BJh68Jqe.js";import{s as i}from"./p-CBX_oabB.js";import{d}from"./p-DNJAIVfI.js";const n=a(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.coClose=r(this,"coClose",7),this.coAfterClose=r(this,"coAfterClose",3),this.coAfterOpen=r(this,"coAfterOpen",3),this.open=!1,this.heading="",this.closable=!0,this.closeOnOverlay=!0,this.closeOnEscape=!1,this.size="md",this.noDividers=!1,this.headerDivider=!0,this.hasFooter=!1,this.handleFooterSlotChange=o=>{this.hasFooter=i(o)},this.handleOverlayClick=()=>{this.closeOnOverlay&&this.coClose.emit()},this.handleCloseClick=()=>{this.coClose.emit()},this.stopPropagation=o=>{o.stopPropagation()},this.handleTransitionEnd=o=>{if(o.target!==this.modalEl)return;const a=c(o.propertyName,this.open,"transform");"after-open"===a?this.coAfterOpen.emit():"after-close"===a&&this.coAfterClose.emit()}}handleKeydown(o){this.open&&this.closeOnEscape&&"Escape"===o.key&&this.coClose.emit()}render(){return s("co-overlay",{key:"9b796364a697af4d4a0ede50e5dd5516ccaa299f",open:this.open,onCoClose:this.handleOverlayClick},s("div",{key:"bea863aedb405cdc492277add25e2c08ea7ef258",class:"co-modal__frame co-sq-elevation-fallback"},s("div",{key:"05f9e86f7a813243913f60c6a042fb93ed65a463",class:{"co-modal":!0,"co-sq-clip":!0,"co-sq-elevation":!0,"co-modal--open":this.open,"co-modal--sm":"sm"===this.size,"co-modal--lg":"lg"===this.size,"co-modal--full":"full"===this.size,"co-modal--no-dividers":this.noDividers,"co-modal--no-header-divider":!this.headerDivider},part:"modal",ref:o=>this.modalEl=o,role:"dialog","aria-modal":"true","aria-labelledby":this.heading?"modal-heading":void 0,onClick:this.stopPropagation,onTransitionEnd:this.handleTransitionEnd},s("div",{key:"8ecd9f7f4413339e484710e2abef1c21fc7f25d0",class:"co-modal__header",part:"header"},s("slot",{key:"09df61b3aac8a26e0eb85a6a6aa48f9a7f547dbf",name:"header-leading"}),s("div",{key:"8e9a55561a1b5615f77eb3eb96284ddc68eddbc3",class:"co-modal__header-text",part:"header-text"},s("h2",{key:"65c083247543448d9f527592cd8614a4c713cf4c",class:"co-modal__heading",part:"heading",id:"modal-heading"},this.heading),this.description&&s("p",{key:"c871aa6549cf56265a02048ca18f736d92d1a482",class:"co-modal__description",part:"description"},this.description)),s("slot",{key:"106a5be71c8c03736313c1084c61d3b836ebb495",name:"header-actions"}),this.closable&&s("button",{key:"a0df67cd09e5f414c58f9f67f6a92c58b9f4773b",class:"co-modal__close",type:"button","aria-label":"Close",onClick:this.handleCloseClick},s("co-icon",{key:"e766981fff30de0c79599756dde74c5981d5c9fd",name:"x",size:20}))),!this.noDividers&&s("div",{key:"355e455c19cbc4a0783c0e0c2689265e6f599484",class:"co-modal__body",part:"body"},s("slot",{key:"fa6d3310464ff33de17618561182736bc6cef0e5"})),s("div",{key:"43b89751fac3fd1b707a284d260e91dd7d7ea8a6",class:{"co-modal__footer":!0,"co-modal__footer--empty":!this.hasFooter},part:"footer"},s("slot",{key:"e9821b0712a6903c923f9bb50393e4b85545c211",name:"footer",onSlotchange:this.handleFooterSlotChange})))))}static get style(){return'.co-sq-elevation{border-radius:var(--co-sq-r);corner-shape:squircle;box-shadow:var(--co-sq-shadow)}.co-sq-clip{overflow:hidden;border-radius:var(--co-sq-r);corner-shape:squircle}@supports not (corner-shape: squircle){.co-sq-elevation{box-shadow:none}.co-sq-elevation-fallback{filter:var(--co-sq-drop-shadow)}.co-sq-clip{border-radius:0;--co-sq-tl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 0L95 0L92.5 0L90 0L87.5 0.01L85 0.01L82.5 0.02L80 0.04L77.5 0.06L75 0.1L72.5 0.14L70 0.2L67.5 0.28L65 0.38L62.5 0.5L60 0.65L57.5 0.83L55 1.04L52.5 1.3L50 1.6L47.5 1.96L45 2.37L42.5 2.85L40 3.41L37.5 4.05L35 4.8L32.5 5.65L30 6.63L27.5 7.77L25 9.07L22.5 10.58L20 12.34L17.5 14.41L15 16.85L12.5 19.79L10 23.42L7.5 28.06L5 34.37L2.5 44.29L0 100L100 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-tr:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 0L5 0L7.5 0L10 0L12.5 0.01L15 0.01L17.5 0.02L20 0.04L22.5 0.06L25 0.1L27.5 0.14L30 0.2L32.5 0.28L35 0.38L37.5 0.5L40 0.65L42.5 0.83L45 1.04L47.5 1.3L50 1.6L52.5 1.96L55 2.37L57.5 2.85L60 3.41L62.5 4.05L65 4.8L67.5 5.65L70 6.63L72.5 7.77L75 9.07L77.5 10.58L80 12.34L82.5 14.41L85 16.85L87.5 19.79L90 23.42L92.5 28.06L95 34.37L97.5 44.29L100 100L0 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-bl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 55.71L5 65.63L7.5 71.94L10 76.58L12.5 80.21L15 83.15L17.5 85.59L20 87.66L22.5 89.42L25 90.93L27.5 92.23L30 93.37L32.5 94.35L35 95.2L37.5 95.95L40 96.59L42.5 97.15L45 97.63L47.5 98.04L50 98.4L52.5 98.7L55 98.96L57.5 99.17L60 99.35L62.5 99.5L65 99.62L67.5 99.72L70 99.8L72.5 99.86L75 99.9L77.5 99.94L80 99.96L82.5 99.98L85 99.99L87.5 99.99L90 100L92.5 100L95 100L97.5 100L100 100L100 0Z%27 fill=%27%23fff%27/></svg>");--co-sq-br:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 55.71L95 65.63L92.5 71.94L90 76.58L87.5 80.21L85 83.15L82.5 85.59L80 87.66L77.5 89.42L75 90.93L72.5 92.23L70 93.37L67.5 94.35L65 95.2L62.5 95.95L60 96.59L57.5 97.15L55 97.63L52.5 98.04L50 98.4L47.5 98.7L45 98.96L42.5 99.17L40 99.35L37.5 99.5L35 99.62L32.5 99.72L30 99.8L27.5 99.86L25 99.9L22.5 99.94L20 99.96L17.5 99.98L15 99.99L12.5 99.99L10 100L7.5 100L5 100L2.5 100L0 100L0 0Z%27 fill=%27%23fff%27/></svg>");-webkit-mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat;mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat}}:host{display:contents;--co-overlay-blur:8px;--co-overlay-bg:rgba(31, 28, 27, 0.35)}.co-modal__frame{display:flex;contain:layout;--co-sq-drop-shadow:drop-shadow(0 1px 2px rgba(31, 28, 27, 0.06)) drop-shadow(0 14px 34px rgba(31, 28, 27, 0.16))}.co-modal{display:flex;flex-direction:column;background:var(--co-semantic-surface-secondary);--co-modal-r:var(--co-border-radius-xl);--co-sq-r:var(--co-modal-r);--co-sq-shadow:0 1px 4px rgba(31, 28, 27, 0.06), 0 14px 68px rgba(31, 28, 27, 0.16);max-width:540px;width:90vw;max-height:80vh;font-family:var(--co-font-family-primary);transform:scale(0.96);opacity:0;transition:transform var(--co-motion-duration-fast) var(--co-motion-ease-in), opacity var(--co-motion-duration-fast) var(--co-motion-ease-in)}.co-modal--sm{max-width:400px}.co-modal--lg{max-width:680px}.co-modal--full{max-width:min(1400px, 95vw);width:95vw;height:92vh;max-height:92vh}.co-modal--full .co-modal__body{flex:1;min-height:0;padding:0;overflow:hidden}.co-modal--open{transform:scale(1);opacity:1;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out), opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-modal__header{display:flex;align-items:flex-start;gap:var(--co-spacing-md);padding:var(--co-spacing-xl) var(--co-spacing-xl) var(--co-spacing-md)}.co-modal__header-text{display:flex;flex-direction:column;gap:var(--co-spacing-sm);flex:1}.co-modal__heading{margin:0;font-size:var(--co-font-size-20);font-weight:700;color:var(--co-semantic-text-default);line-height:1.3}.co-modal__description{margin:0;font-size:var(--co-font-size-14);color:var(--co-semantic-text-secondary);line-height:1.5}.co-modal__close{display:flex;align-items:center;justify-content:center;padding:var(--co-spacing-xs);margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);border-radius:var(--co-border-radius-sm);flex-shrink:0;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-modal__close:hover{background:var(--co-semantic-surface-hover)}.co-modal__body{padding:var(--co-spacing-lg) var(--co-spacing-xl);overflow-y:auto;overscroll-behavior:contain;font-size:var(--co-font-size-14);color:var(--co-semantic-text-secondary);line-height:1.6;border-top:1px solid var(--co-semantic-border-default)}.co-modal__body:empty{display:none}.co-modal__footer{display:flex;justify-content:flex-end;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl) var(--co-spacing-xl);border-top:1px solid var(--co-semantic-border-default);--co-button-radius:var(--co-border-radius-xs)}.co-modal__footer--empty{display:none}.co-modal--no-dividers .co-modal__footer{border-top:none}.co-modal--no-header-divider .co-modal__body{border-top:none;padding-top:0}'}},[257,"co-modal",{open:[1540],heading:[1],description:[1],closable:[4],closeOnOverlay:[4,"close-on-overlay"],closeOnEscape:[4,"close-on-escape"],size:[513],noDividers:[516,"no-dividers"],headerDivider:[4,"header-divider"],hasFooter:[32]},[[4,"keydown","handleKeydown"]]]);function l(){"undefined"!=typeof customElements&&["co-modal","co-icon","co-overlay"].forEach((a=>{switch(a){case"co-modal":customElements.get(o(a))||customElements.define(o(a),n);break;case"co-icon":customElements.get(o(a))||d();break;case"co-overlay":customElements.get(o(a))||t()}}))}l();const L=n,f=l;export{L as CoModal,f as defineCustomElement}
|
|
1
|
+
import{t as o,p as a,H as t,c as e,h as i}from"./index.js";import{d as r,a as s}from"./p-nrwDl_gx.js";import{s as n}from"./p-CBX_oabB.js";import{d as c}from"./p-KK2vAKs-.js";function d(o,a,t){const e=Math.min(a,0),i=Math.max(t,0);return Math.min(Math.max(o,e),i)}const l=a(class extends t{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.coClose=e(this,"coClose",7),this.coAfterClose=e(this,"coAfterClose",3),this.coAfterOpen=e(this,"coAfterOpen",3),this.open=!1,this.heading="",this.closable=!0,this.closeOnOverlay=!0,this.closeOnEscape=!1,this.size="md",this.noDividers=!1,this.headerDivider=!0,this.appearance="default",this.backdrop="default",this.inline=!1,this.movable=!1,this.hasFooter=!1,this.handleFooterSlotChange=o=>{this.hasFooter=n(o)},this.handleOverlayClick=()=>{this.closeOnOverlay&&this.coClose.emit()},this.handleCloseClick=()=>{this.coClose.emit()},this.stopPropagation=o=>{o.stopPropagation()},this.handleTransitionEnd=o=>{if(o.target!==this.modalEl)return;const a=s(o.propertyName,this.open,"transform");"after-open"===a?this.coAfterOpen.emit():"after-close"===a&&this.coAfterClose.emit()},this.dragging=!1,this.committedOffset={x:0,y:0},this.liveOffset={x:0,y:0},this.handleDragDown=o=>{var a;if(!this.movable||this.dragging||0!==o.button)return;if(function(o,a){const t="function"==typeof o.composedPath?o.composedPath():[o.target];for(const o of t){if(a&&o===a)return!1;if(o&&"function"==typeof o.matches&&o.matches('button, a[href], input, select, textarea, [role="button"], [role="checkbox"], [role="radio"], [role="switch"], [role="combobox"], [role="option"], [role="menuitem"], [role="slider"], [role="tab"], [role="separator"], [data-no-drag]'))return!0}return!1}(o,this.headerEl))return;const t=null===(a=this.modalEl)||void 0===a?void 0:a.getBoundingClientRect();t&&(o.preventDefault(),this.dragging=!0,this.dragPointerId=o.pointerId,this.dragStart={x:o.clientX,y:o.clientY},this.dragRect={left:t.left-this.committedOffset.x,top:t.top-this.committedOffset.y,width:t.width,height:t.height},this.dragViewport={width:window.innerWidth,height:window.innerHeight},this.capturePointer(o),window.addEventListener("blur",this.handleWindowBlur))},this.handleDragMove=o=>{if(!this.isActiveDragPointer(o))return;if(!this.dragStart||!this.dragRect||!this.dragViewport)return;const a=function(o,a,t){return{x:o.x+t.x-a.x,y:o.y+t.y-a.y}}(this.committedOffset,this.dragStart,{x:o.clientX,y:o.clientY});this.writeOffset(function(o,a,t,e=48){const i=Math.min(e,a.width),r=Math.min(e,a.height);return{x:d(o.x,i-a.left-a.width,t.width-i-a.left),y:d(o.y,-a.top,t.height-r-a.top)}}(a,this.dragRect,this.dragViewport))},this.handleDragUp=o=>{this.isActiveDragPointer(o)&&(this.committedOffset=this.liveOffset,this.releasePointer(o),this.endDrag())},this.handleDragCancel=o=>{this.isActiveDragPointer(o)&&(this.releasePointer(o),this.writeOffset(this.committedOffset),this.endDrag())},this.handleWindowBlur=()=>{this.dragging&&(this.writeOffset(this.committedOffset),this.endDrag())}}get usesOverlay(){return"none"!==this.backdrop&&!this.inline}handleKeydown(o){this.open&&this.closeOnEscape&&"Escape"===o.key&&this.coClose.emit()}resetPositionOnOpen(o){this.endDrag(),o&&(this.committedOffset={x:0,y:0},this.writeOffset({x:0,y:0}))}disconnectedCallback(){window.removeEventListener("blur",this.handleWindowBlur)}endDrag(){window.removeEventListener("blur",this.handleWindowBlur),this.dragging=!1,this.dragPointerId=void 0,this.dragStart=void 0,this.dragRect=void 0,this.dragViewport=void 0}isActiveDragPointer(o){return this.dragging&&o.pointerId==this.dragPointerId}capturePointer(o){const a=this.headerEl;if(a&&"function"==typeof a.setPointerCapture&&null!=o.pointerId)try{a.setPointerCapture(o.pointerId)}catch(o){}}releasePointer(o){const a=this.headerEl;if(a&&"function"==typeof a.releasePointerCapture&&null!=o.pointerId)try{a.releasePointerCapture(o.pointerId)}catch(o){}}writeOffset(o){this.liveOffset=o;const a=this.modalEl;a&&(0===o.x&&0===o.y?a.style.removeProperty("--co-modal-translate"):a.style.setProperty("--co-modal-translate",`${o.x}px ${o.y}px`))}render(){const o="panel"!==this.appearance&&"dialog"!==this.appearance,a=o?20:18,t=i("div",{class:{"co-modal__frame":!0,"co-sq-elevation-fallback":o,"co-modal__frame--standalone":!this.usesOverlay}},i("div",{class:{"co-modal":!0,"co-sq-clip":o,"co-sq-elevation":o,"co-modal--open":this.open,"co-modal--xs":"xs"===this.size,"co-modal--sm":"sm"===this.size,"co-modal--lg":"lg"===this.size,"co-modal--full":"full"===this.size,"co-modal--no-dividers":this.noDividers,"co-modal--no-header-divider":!this.headerDivider,"co-modal--panel":"panel"===this.appearance,"co-modal--dialog":"dialog"===this.appearance,"co-modal--movable":this.movable},part:"modal",ref:o=>this.modalEl=o,role:"dialog","aria-modal":"true","aria-labelledby":this.heading?"modal-heading":void 0,onClick:this.usesOverlay?this.stopPropagation:void 0,onTransitionEnd:this.handleTransitionEnd},i("div",{class:{"co-modal__header":!0,"co-modal__header--movable":this.movable,"co-modal__header--dragging":this.dragging},part:"header",ref:o=>this.headerEl=o,onPointerDown:this.movable?this.handleDragDown:void 0,onPointerMove:this.movable?this.handleDragMove:void 0,onPointerUp:this.movable?this.handleDragUp:void 0,onPointerCancel:this.movable?this.handleDragCancel:void 0},i("slot",{name:"header-leading"}),i("div",{class:"co-modal__header-text",part:"header-text"},i("h2",{class:"co-modal__heading",part:"heading",id:"modal-heading"},this.heading),this.description&&i("p",{class:"co-modal__description",part:"description"},this.description)),i("slot",{name:"header-actions"}),this.closable&&i("button",{class:"co-modal__close",type:"button","aria-label":"Close",onClick:this.handleCloseClick},i("co-icon",{name:"x",size:a}))),!this.noDividers&&i("div",{class:"co-modal__body",part:"body"},i("slot",null)),i("div",{class:{"co-modal__footer":!0,"co-modal__footer--empty":!this.hasFooter},part:"footer"},i("slot",{name:"footer",onSlotchange:this.handleFooterSlotChange}))));return this.usesOverlay?i("co-overlay",{open:this.open,onCoClose:this.handleOverlayClick},t):t}static get watchers(){return{open:[{resetPositionOnOpen:0}]}}static get style(){return'.co-sq-elevation{border-radius:var(--co-sq-r);corner-shape:squircle;box-shadow:var(--co-sq-shadow)}.co-sq-clip{overflow:hidden;border-radius:var(--co-sq-r);corner-shape:squircle}@supports not (corner-shape: squircle){.co-sq-elevation{box-shadow:none}.co-sq-elevation-fallback{filter:var(--co-sq-drop-shadow)}.co-sq-clip{border-radius:0;--co-sq-tl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 0L95 0L92.5 0L90 0L87.5 0.01L85 0.01L82.5 0.02L80 0.04L77.5 0.06L75 0.1L72.5 0.14L70 0.2L67.5 0.28L65 0.38L62.5 0.5L60 0.65L57.5 0.83L55 1.04L52.5 1.3L50 1.6L47.5 1.96L45 2.37L42.5 2.85L40 3.41L37.5 4.05L35 4.8L32.5 5.65L30 6.63L27.5 7.77L25 9.07L22.5 10.58L20 12.34L17.5 14.41L15 16.85L12.5 19.79L10 23.42L7.5 28.06L5 34.37L2.5 44.29L0 100L100 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-tr:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 0L5 0L7.5 0L10 0L12.5 0.01L15 0.01L17.5 0.02L20 0.04L22.5 0.06L25 0.1L27.5 0.14L30 0.2L32.5 0.28L35 0.38L37.5 0.5L40 0.65L42.5 0.83L45 1.04L47.5 1.3L50 1.6L52.5 1.96L55 2.37L57.5 2.85L60 3.41L62.5 4.05L65 4.8L67.5 5.65L70 6.63L72.5 7.77L75 9.07L77.5 10.58L80 12.34L82.5 14.41L85 16.85L87.5 19.79L90 23.42L92.5 28.06L95 34.37L97.5 44.29L100 100L0 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-bl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 55.71L5 65.63L7.5 71.94L10 76.58L12.5 80.21L15 83.15L17.5 85.59L20 87.66L22.5 89.42L25 90.93L27.5 92.23L30 93.37L32.5 94.35L35 95.2L37.5 95.95L40 96.59L42.5 97.15L45 97.63L47.5 98.04L50 98.4L52.5 98.7L55 98.96L57.5 99.17L60 99.35L62.5 99.5L65 99.62L67.5 99.72L70 99.8L72.5 99.86L75 99.9L77.5 99.94L80 99.96L82.5 99.98L85 99.99L87.5 99.99L90 100L92.5 100L95 100L97.5 100L100 100L100 0Z%27 fill=%27%23fff%27/></svg>");--co-sq-br:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 55.71L95 65.63L92.5 71.94L90 76.58L87.5 80.21L85 83.15L82.5 85.59L80 87.66L77.5 89.42L75 90.93L72.5 92.23L70 93.37L67.5 94.35L65 95.2L62.5 95.95L60 96.59L57.5 97.15L55 97.63L52.5 98.04L50 98.4L47.5 98.7L45 98.96L42.5 99.17L40 99.35L37.5 99.5L35 99.62L32.5 99.72L30 99.8L27.5 99.86L25 99.9L22.5 99.94L20 99.96L17.5 99.98L15 99.99L12.5 99.99L10 100L7.5 100L5 100L2.5 100L0 100L0 0Z%27 fill=%27%23fff%27/></svg>");-webkit-mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat;mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat}}:host{display:contents;--co-overlay-blur:8px;--co-overlay-bg:rgba(31, 28, 27, 0.35)}.co-modal__frame{display:flex;contain:layout;--co-sq-drop-shadow:drop-shadow(0 1px 2px rgba(31, 28, 27, 0.06)) drop-shadow(0 14px 34px rgba(31, 28, 27, 0.16))}.co-modal{display:flex;flex-direction:column;background:var(--co-semantic-surface-secondary);--co-modal-r:var(--co-border-radius-xl);--co-sq-r:var(--co-modal-r);--co-sq-shadow:0 1px 4px rgba(31, 28, 27, 0.06), 0 14px 68px rgba(31, 28, 27, 0.16);max-width:540px;width:90vw;max-height:80vh;font-family:var(--co-font-family-primary);transform:scale(0.96);opacity:0;transition:transform var(--co-motion-duration-fast) var(--co-motion-ease-in), opacity var(--co-motion-duration-fast) var(--co-motion-ease-in)}.co-modal--sm{max-width:400px}.co-modal--lg{max-width:680px}.co-modal--full{max-width:min(1400px, 95vw);width:95vw;height:92vh;max-height:92vh}.co-modal--full .co-modal__body{flex:1;min-height:0;padding:0;overflow:hidden}.co-modal--open{transform:scale(1);opacity:1;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out), opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-modal__header{display:flex;align-items:flex-start;gap:var(--co-spacing-md);padding:var(--co-spacing-xl) var(--co-spacing-xl) var(--co-spacing-md)}.co-modal__header-text{display:flex;flex-direction:column;gap:var(--co-spacing-sm);flex:1}.co-modal__heading{margin:0;font-size:var(--co-font-size-20);font-weight:700;color:var(--co-semantic-text-default);line-height:1.3}.co-modal__description{margin:0;font-size:var(--co-font-size-14);color:var(--co-semantic-text-secondary);line-height:1.5}.co-modal__close{display:flex;align-items:center;justify-content:center;padding:var(--co-spacing-xs);margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);border-radius:var(--co-border-radius-sm);flex-shrink:0;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-modal__close:hover{background:var(--co-semantic-surface-hover)}.co-modal__body{padding:var(--co-spacing-lg) var(--co-spacing-xl);overflow-y:auto;overscroll-behavior:contain;font-size:var(--co-font-size-14);color:var(--co-semantic-text-secondary);line-height:1.6;border-top:1px solid var(--co-semantic-border-default)}.co-modal__body:empty{display:none}.co-modal__footer{display:flex;justify-content:flex-end;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl) var(--co-spacing-xl);border-top:1px solid var(--co-semantic-border-default);--co-button-radius:var(--co-border-radius-xs)}.co-modal__footer--empty{display:none}.co-modal--no-dividers .co-modal__footer{border-top:none}.co-modal--no-header-divider .co-modal__body{border-top:none;padding-top:0}.co-modal--xs{width:var(--co-modal-width, 369px);max-width:var(--co-modal-width, 369px)}.co-modal--panel{border-radius:var(--co-border-radius-sm);border:1px solid var(--co-semantic-border-subtle);box-shadow:var(--co-shadow-lg)}.co-modal--panel .co-modal__header{padding:16px 20px 16px 24px;align-items:center;border-bottom:1px solid var(--co-semantic-border-subtle)}.co-modal--panel .co-modal__heading{font-size:var(--co-font-size-20);font-weight:500;line-height:1.25;letter-spacing:var(--co-font-letter-spacing-body)}.co-modal--panel .co-modal__close{width:32px;height:32px;padding:0;border-radius:var(--co-border-radius-full);color:var(--co-semantic-text-default)}.co-modal--panel .co-modal__body{padding:24px;border-top:none}.co-modal--panel .co-modal__footer{padding:12px 24px;gap:12px;border-top:1px solid var(--co-semantic-border-subtle)}.co-modal__frame--standalone{position:fixed;inset:0;z-index:var(--co-modal-z-index, 1000);display:flex;align-items:center;justify-content:center;pointer-events:none}.co-modal__frame--standalone .co-modal--open{pointer-events:auto}.co-modal__frame--standalone .co-modal:not(.co-modal--open){visibility:hidden;transition:transform var(--co-motion-duration-fast) var(--co-motion-ease-in), opacity var(--co-motion-duration-fast) var(--co-motion-ease-in), visibility 0s linear var(--co-motion-duration-fast)}.co-modal--dialog{border-radius:var(--co-border-radius-lg)}.co-modal--dialog .co-modal__header{padding:var(--co-spacing-3xl) var(--co-spacing-3xl) 0;align-items:flex-start;gap:var(--co-spacing-lg)}.co-modal--dialog .co-modal__header-text{gap:var(--co-spacing-lg)}.co-modal--dialog .co-modal__heading{font-size:var(--co-font-size-22);font-weight:500;line-height:1.25;letter-spacing:var(--co-font-letter-spacing-body)}.co-modal--dialog .co-modal__description{font-size:var(--co-font-size-16);line-height:1.5;letter-spacing:var(--co-font-letter-spacing-body)}.co-modal--dialog .co-modal__close{width:32px;height:32px;padding:0;margin:-3px -6px 0 0;border-radius:var(--co-border-radius-full);color:var(--co-semantic-text-default)}.co-modal--dialog .co-modal__body{padding:var(--co-spacing-lg) var(--co-spacing-3xl) var(--co-spacing-3xl);border-top:none;font-size:var(--co-font-size-16);line-height:1.5;letter-spacing:var(--co-font-letter-spacing-body)}.co-modal--dialog.co-modal--full .co-modal__body{padding:0}.co-modal--dialog .co-modal__footer{padding:var(--co-spacing-lg) var(--co-spacing-2xl);gap:var(--co-spacing-md);border-top-color:var(--co-semantic-border-subtle);--co-button-radius:var(--co-border-radius-sm)}.co-modal--movable{translate:var(--co-modal-translate, none)}.co-modal__header--movable{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}.co-modal__header--movable .co-modal__close{cursor:pointer}.co-modal__header--dragging{cursor:grabbing}'}},[257,"co-modal",{open:[1540],heading:[1],description:[1],closable:[4],closeOnOverlay:[4,"close-on-overlay"],closeOnEscape:[4,"close-on-escape"],size:[513],noDividers:[516,"no-dividers"],headerDivider:[4,"header-divider"],appearance:[513],backdrop:[513],inline:[516],movable:[516],hasFooter:[32],dragging:[32]},[[4,"keydown","handleKeydown"]],{open:[{resetPositionOnOpen:0}]}]);function h(){"undefined"!=typeof customElements&&["co-modal","co-icon","co-overlay"].forEach((a=>{switch(a){case"co-modal":customElements.get(o(a))||customElements.define(o(a),l);break;case"co-icon":customElements.get(o(a))||c();break;case"co-overlay":customElements.get(o(a))||r()}}))}h();const p=l,m=h;export{p as CoModal,m as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as a,p as o,H as r,h as n}from"./index.js";const c=o(class extends r{constructor(a){super(),!1!==a&&this.__registerHost(),this.__attachShadow(),this.variant="default",this.size="md",this.rounded=!1}render(){return n("div",{key:"
|
|
1
|
+
import{t as a,p as o,H as r,h as n}from"./index.js";const c=o(class extends r{constructor(a){super(),!1!==a&&this.__registerHost(),this.__attachShadow(),this.variant="default",this.size="md",this.rounded=!1}render(){return n("div",{key:"68c78b33434a32372eef9763b0c11c9a185f6ef8",class:{"co-navbar":!0,["co-navbar--"+this.variant]:!0,["co-navbar--"+this.size]:!0,"co-navbar--rounded":this.rounded},part:"navbar",role:"toolbar"},n("slot",{key:"a9d05ff60065f85dc24e941478a18fa40466143f"}))}static get style(){return":host{display:block}.co-navbar{display:flex;align-items:center;justify-content:space-between;width:100%;font-family:var(--co-font-family-primary);box-sizing:border-box;background:var(--co-navbar-bg);color:var(--co-navbar-color)}.co-navbar--default{--co-navbar-bg:transparent}.co-navbar--filled{--co-navbar-bg:var(--co-semantic-surface-primary, #1f1c1b);--co-navbar-color:var(--co-semantic-on-primary, #fff)}.co-navbar--bordered{--co-navbar-bg:var(--co-semantic-surface-page, #fff);--co-navbar-color:inherit;border-bottom:1px solid var(--co-semantic-border-subtle, rgba(31,28,27,0.08))}.co-navbar--dark{--co-navbar-bg:var(--co-theme-navbar-bg, var(--co-color-base-negro, #1F1C1B));--co-navbar-color:var(--co-theme-on-navbar, #fff);--co-icon-button-bg:var(--co-theme-on-navbar-surface, var(--co-color-opacity-blanco-16, rgba(255,255,255,0.16)));--co-icon-button-color:var(--co-theme-on-navbar, #fff);--co-icon-button-border:transparent}.co-navbar--rounded{border-radius:var(--co-border-radius-sm, 12px);overflow:hidden}.co-navbar--sm{min-height:40px;padding:0 var(--co-navbar-padding-x, var(--co-spacing-md, 12px));gap:var(--co-spacing-sm2, 8px);font-size:var(--co-font-size-12, 12px)}.co-navbar--md{min-height:48px;padding:0 var(--co-navbar-padding-x, var(--co-spacing-lg, 16px));gap:var(--co-spacing-md, 12px);font-size:var(--co-font-size-14, 14px)}.co-navbar--lg{min-height:56px;padding:0 var(--co-navbar-padding-x-end, var(--co-spacing-2xl, 24px)) 0 var(--co-navbar-padding-x-start, var(--co-spacing-md, 12px));gap:var(--co-spacing-sm2, 8px);font-size:var(--co-font-size-14, 14px)}::slotted([slot-spacer]),::slotted(.co-spacer){flex:1}"}},[257,"co-navbar",{variant:[1],size:[1],rounded:[4]}]);function e(){"undefined"!=typeof customElements&&["co-navbar"].forEach((o=>{"co-navbar"===o&&(customElements.get(a(o))||customElements.define(a(o),c))}))}e();const t=c,s=e;export{t as CoNavbar,s as defineCustomElement}
|