@mediquo/elements 0.0.0-pr-383-20261029152148
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 +386 -0
- package/dist/chunks/addDays-CdyO-PRI.js +1 -0
- package/dist/chunks/addSeconds-fO5orJrt.js +1 -0
- package/dist/chunks/api-chat-client-CcYgqPdC.js +1 -0
- package/dist/chunks/api-client-context-BXGqBAlO.js +1 -0
- package/dist/chunks/apple-pay-outcomes-D8hSE_oM.js +1 -0
- package/dist/chunks/appointment-details-Blo6OsLN.js +1 -0
- package/dist/chunks/appointment-details-KL9fK6vG.d.ts +23 -0
- package/dist/chunks/blob-to-base64-CUL1trde.js +1 -0
- package/dist/chunks/ca_ES-BHS8BUwp.js +1 -0
- package/dist/chunks/checkout-bridge-BFpVxNww.js +1 -0
- package/dist/chunks/chunk-5EJXDIGT-Bb4_pfDr.js +1 -0
- package/dist/chunks/chunk-6CCJWPGL-TiaqZaPV.js +1 -0
- package/dist/chunks/chunk-BUV4MGML-CkhBbfUu.js +1 -0
- package/dist/chunks/chunk-FUCSYDW7-Duj5hy8S.js +1 -0
- package/dist/chunks/chunk-NIAGR3ZC-BDlNUZa1.js +1 -0
- package/dist/chunks/chunk-RCFIJTXZ-C6Ir0-sM.js +1 -0
- package/dist/chunks/chunk-S5RWG6G2-CQJ38pW6.js +1 -0
- package/dist/chunks/chunk-Y4EKUX25-Bix9r5ry.js +1 -0
- package/dist/chunks/chunk-YTQUGGS3-DH0H7ld7.js +1 -0
- package/dist/chunks/class-map-CXGDNDhW.js +1 -0
- package/dist/chunks/consume-CovVqBjI.js +1 -0
- package/dist/chunks/context-consumer-ESdICVAb.js +1 -0
- package/dist/chunks/context-request-event-Dfydf1ub.js +1 -0
- package/dist/chunks/create-component-BB-6Gu6l.js +1 -0
- package/dist/chunks/create-context-DqP79qjF.js +1 -0
- package/dist/chunks/custom-element-CiOhPWP1-DPpsGZrV.js +1 -0
- package/dist/chunks/custom-element-D2ziPxYE.js +1 -0
- package/dist/chunks/de_DE-CveFSuUP.js +1 -0
- package/dist/chunks/default-IpEn36CA.d.ts +5 -0
- package/dist/chunks/directive-DrycXrFV.js +1 -0
- package/dist/chunks/directive-helpers-m2qHStQ1.js +1 -0
- package/dist/chunks/document.model.d-DIzMiOmd.d.ts +6 -0
- package/dist/chunks/documentation-view-CAU1T5j3.js +1 -0
- package/dist/chunks/en_US-B_aQeYjm.js +1 -0
- package/dist/chunks/ensure-context-root-DbdqwnKB.js +1 -0
- package/dist/chunks/external-JLtsAfi6.js +1 -0
- package/dist/chunks/format-tMwfQwDf.js +1 -0
- package/dist/chunks/get-appointment-query-DuHrjd8L.js +1 -0
- package/dist/chunks/get-organization-setup-query-De7eM6V3.js +1 -0
- package/dist/chunks/get-patient-profile-query-D9btgcxl.js +1 -0
- package/dist/chunks/get-schedule-services-query-Io2aQ_7G.js +1 -0
- package/dist/chunks/if-defined-DgEoHV04.js +1 -0
- package/dist/chunks/index-BO2YvuaV.d.ts +54 -0
- package/dist/chunks/index-BeyZqqE9.d.ts +31 -0
- package/dist/chunks/index-BkDanNQg.js +1 -0
- package/dist/chunks/index-BlRNICIU.js +1 -0
- package/dist/chunks/index-CSn2VnHN.js +1 -0
- package/dist/chunks/index-Cp5_a_ei.js +329 -0
- package/dist/chunks/index-Cu-DpEFM.js +1 -0
- package/dist/chunks/index-DTEtqjQF.d.ts +15 -0
- package/dist/chunks/index-DoKSSg_l.js +1 -0
- package/dist/chunks/index-DwlJg2um.d.ts +187 -0
- package/dist/chunks/index-IcMN_Zy_.js +1 -0
- package/dist/chunks/index-Nf3nZ9O3.d.ts +16 -0
- package/dist/chunks/index-_XIb963s.js +1 -0
- package/dist/chunks/index-mf2T4jWX.js +1 -0
- package/dist/chunks/index-ov4Ad6vl.d.ts +55 -0
- package/dist/chunks/index-xi0bxKot.js +341 -0
- package/dist/chunks/index.d-k8r5vUZn.d.ts +3353 -0
- package/dist/chunks/index.d-yyTprZdj.d.ts +84 -0
- package/dist/chunks/isBefore-DBi1CiNR.js +1 -0
- package/dist/chunks/keyed-c1C5T7e_.js +1 -0
- package/dist/chunks/lit-element-B5-nYi7k.js +1 -0
- package/dist/chunks/localized-decorator-BlOuLhym.js +1 -0
- package/dist/chunks/login-token-task-KxmMdqVo.js +1 -0
- package/dist/chunks/mq-chat-room-CwN_aR5x.js +1 -0
- package/dist/chunks/mq-chat-room-D2O_3Zur.d.ts +292 -0
- package/dist/chunks/mq-layout-D8Mak16a.d.ts +21 -0
- package/dist/chunks/mq-layout-qMP-lpxw.js +1 -0
- package/dist/chunks/mq-next-appointments-CZ1eKA8t.js +1 -0
- package/dist/chunks/mq-professional-presence-sync-Cw8kVtpC.d.ts +22 -0
- package/dist/chunks/mq-recent-documents-C2_iUYKT.js +1 -0
- package/dist/chunks/mq-schedule-9rEQK6SJ.js +1 -0
- package/dist/chunks/mq-support-chat-DWz3EZ9j.js +1 -0
- package/dist/chunks/mq-unread-count-sync-BviIsMJy.d.ts +22 -0
- package/dist/chunks/mq-videocall-CcRWCujw.js +870 -0
- package/dist/chunks/mutation-controller-CR2qcqhH.js +1 -0
- package/dist/chunks/next-appointment-card-DMCNzLUc.js +1 -0
- package/dist/chunks/next-appointment-card-Dhu45fRq.d.ts +123 -0
- package/dist/chunks/parseISO-CEksKisk.js +1 -0
- package/dist/chunks/price-DU3YLTpk.js +1 -0
- package/dist/chunks/price.d-CwLosdAN.d.ts +10 -0
- package/dist/chunks/professional-overview-QVHl_ITk.d.ts +26 -0
- package/dist/chunks/professional-overview-yVZgXRCU.js +1 -0
- package/dist/chunks/property-C1CmBSnw.js +1 -0
- package/dist/chunks/provide-BwI4DDGF.js +1 -0
- package/dist/chunks/pt_PT-D1CvMEpH.js +1 -0
- package/dist/chunks/query-CeeutdfT.js +1 -0
- package/dist/chunks/query-controller-B1byDHlF.js +1 -0
- package/dist/chunks/refund-cancel-policy-DoMzcLlL.js +1 -0
- package/dist/chunks/runtime-Bg1WXVCx.js +1 -0
- package/dist/chunks/schemas.d-b6_AekBb.d.ts +145 -0
- package/dist/chunks/state-Br45Av8Z.js +1 -0
- package/dist/chunks/style-map-MoXKugLp.js +1 -0
- package/dist/chunks/task-BYPV1iNw.js +1 -0
- package/dist/chunks/telemetry-client-DA2_SZBC.js +1 -0
- package/dist/env.d.ts +21 -0
- package/dist/env.js +1 -0
- package/dist/events.d.ts +134 -0
- package/dist/events.js +1 -0
- package/dist/i18n.d.ts +11 -0
- package/dist/i18n.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -0
- package/dist/mq-api-client-provider.d.ts +39 -0
- package/dist/mq-api-client-provider.js +1 -0
- package/dist/mq-apple-pay-checkout.d.ts +94 -0
- package/dist/mq-apple-pay-checkout.js +1 -0
- package/dist/mq-appointment-checkout.d.ts +65 -0
- package/dist/mq-appointment-checkout.js +1 -0
- package/dist/mq-appointment-documentation.d.ts +59 -0
- package/dist/mq-appointment-documentation.js +1 -0
- package/dist/mq-chat-room.d.ts +23 -0
- package/dist/mq-chat-room.js +1 -0
- package/dist/mq-checkout.d.ts +111 -0
- package/dist/mq-checkout.js +1 -0
- package/dist/mq-dashboard.d.ts +96 -0
- package/dist/mq-dashboard.js +1 -0
- package/dist/mq-documents.d.ts +96 -0
- package/dist/mq-documents.js +1 -0
- package/dist/mq-google-pay-checkout.d.ts +129 -0
- package/dist/mq-google-pay-checkout.js +1 -0
- package/dist/mq-immediate-videocall-checkout.d.ts +51 -0
- package/dist/mq-immediate-videocall-checkout.js +1 -0
- package/dist/mq-my-appointments.d.ts +172 -0
- package/dist/mq-my-appointments.js +1 -0
- package/dist/mq-next-appointments.d.ts +59 -0
- package/dist/mq-next-appointments.js +1 -0
- package/dist/mq-payment-poller.d.ts +71 -0
- package/dist/mq-payment-poller.js +1 -0
- package/dist/mq-professional-presence-sync.d.ts +32 -0
- package/dist/mq-professional-presence-sync.js +1 -0
- package/dist/mq-query-client-provider.d.ts +20 -0
- package/dist/mq-query-client-provider.js +1 -0
- package/dist/mq-recent-documents.d.ts +49 -0
- package/dist/mq-recent-documents.js +1 -0
- package/dist/mq-schedule-success.d.ts +100 -0
- package/dist/mq-schedule-success.js +4 -0
- package/dist/mq-schedule.d.ts +812 -0
- package/dist/mq-schedule.js +1 -0
- package/dist/mq-session-provider.d.ts +28 -0
- package/dist/mq-session-provider.js +1 -0
- package/dist/mq-socket-provider.d.ts +103 -0
- package/dist/mq-socket-provider.js +1 -0
- package/dist/mq-support-chat.d.ts +97 -0
- package/dist/mq-support-chat.js +1 -0
- package/dist/mq-terms-and-conditions.d.ts +27 -0
- package/dist/mq-terms-and-conditions.js +1 -0
- package/dist/mq-theme-provider.d.ts +33 -0
- package/dist/mq-theme-provider.js +1 -0
- package/dist/mq-unread-count-sync.d.ts +24 -0
- package/dist/mq-unread-count-sync.js +1 -0
- package/dist/mq-videocall.d.ts +698 -0
- package/dist/mq-videocall.js +1 -0
- package/dist/react/mq-api-client-provider.d.ts +26 -0
- package/dist/react/mq-api-client-provider.js +2 -0
- package/dist/react/mq-apple-pay-checkout.d.ts +35 -0
- package/dist/react/mq-apple-pay-checkout.js +2 -0
- package/dist/react/mq-appointment-checkout.d.ts +39 -0
- package/dist/react/mq-appointment-checkout.js +2 -0
- package/dist/react/mq-appointment-documentation.d.ts +43 -0
- package/dist/react/mq-appointment-documentation.js +2 -0
- package/dist/react/mq-chat-room.d.ts +47 -0
- package/dist/react/mq-chat-room.js +2 -0
- package/dist/react/mq-checkout.d.ts +38 -0
- package/dist/react/mq-checkout.js +2 -0
- package/dist/react/mq-dashboard.d.ts +62 -0
- package/dist/react/mq-dashboard.js +2 -0
- package/dist/react/mq-documents-page.d.ts +35 -0
- package/dist/react/mq-documents-page.js +2 -0
- package/dist/react/mq-documents.d.ts +32 -0
- package/dist/react/mq-documents.js +2 -0
- package/dist/react/mq-google-pay-checkout.d.ts +40 -0
- package/dist/react/mq-google-pay-checkout.js +2 -0
- package/dist/react/mq-immediate-videocall-checkout.d.ts +31 -0
- package/dist/react/mq-immediate-videocall-checkout.js +2 -0
- package/dist/react/mq-my-appointments.d.ts +51 -0
- package/dist/react/mq-my-appointments.js +2 -0
- package/dist/react/mq-next-appointments.d.ts +43 -0
- package/dist/react/mq-next-appointments.js +2 -0
- package/dist/react/mq-payment-poller.d.ts +37 -0
- package/dist/react/mq-payment-poller.js +2 -0
- package/dist/react/mq-professional-presence-sync.d.ts +13 -0
- package/dist/react/mq-professional-presence-sync.js +2 -0
- package/dist/react/mq-query-client-provider.d.ts +24 -0
- package/dist/react/mq-query-client-provider.js +2 -0
- package/dist/react/mq-recent-documents.d.ts +32 -0
- package/dist/react/mq-recent-documents.js +2 -0
- package/dist/react/mq-schedule-success.d.ts +54 -0
- package/dist/react/mq-schedule-success.js +2 -0
- package/dist/react/mq-schedule.d.ts +70 -0
- package/dist/react/mq-schedule.js +2 -0
- package/dist/react/mq-session-provider.d.ts +19 -0
- package/dist/react/mq-session-provider.js +2 -0
- package/dist/react/mq-socket-provider.d.ts +20 -0
- package/dist/react/mq-socket-provider.js +2 -0
- package/dist/react/mq-support-chat.d.ts +50 -0
- package/dist/react/mq-support-chat.js +2 -0
- package/dist/react/mq-terms-and-conditions.d.ts +34 -0
- package/dist/react/mq-terms-and-conditions.js +2 -0
- package/dist/react/mq-theme-provider.d.ts +19 -0
- package/dist/react/mq-theme-provider.js +2 -0
- package/dist/react/mq-toast-container.d.ts +17 -0
- package/dist/react/mq-toast-container.js +2 -0
- package/dist/react/mq-unread-count-sync.d.ts +13 -0
- package/dist/react/mq-unread-count-sync.js +2 -0
- package/dist/react/mq-videocall.d.ts +76 -0
- package/dist/react/mq-videocall.js +2 -0
- package/dist/theme.d.ts +218 -0
- package/dist/theme.js +11 -0
- package/dist/toast.d.ts +4 -0
- package/dist/toast.js +1 -0
- package/dist/ui/back-link.d.ts +24 -0
- package/dist/ui/back-link.js +1 -0
- package/dist/ui/icons/alert-circle-icon.d.ts +6 -0
- package/dist/ui/icons/alert-circle-icon.js +1 -0
- package/dist/ui/icons/annotation-question-icon.d.ts +6 -0
- package/dist/ui/icons/annotation-question-icon.js +1 -0
- package/dist/ui/icons/arrow-narrow-left-icon.d.ts +6 -0
- package/dist/ui/icons/arrow-narrow-left-icon.js +1 -0
- package/dist/ui/icons/arrow-right-icon.d.ts +6 -0
- package/dist/ui/icons/arrow-right-icon.js +1 -0
- package/dist/ui/icons/briefcase-icon.d.ts +6 -0
- package/dist/ui/icons/briefcase-icon.js +1 -0
- package/dist/ui/icons/calendar-icon.d.ts +6 -0
- package/dist/ui/icons/calendar-icon.js +1 -0
- package/dist/ui/icons/chat-bubble-icon.d.ts +6 -0
- package/dist/ui/icons/chat-bubble-icon.js +1 -0
- package/dist/ui/icons/check-circle-icon.d.ts +6 -0
- package/dist/ui/icons/check-circle-icon.js +1 -0
- package/dist/ui/icons/check-double-icon.d.ts +6 -0
- package/dist/ui/icons/check-double-icon.js +1 -0
- package/dist/ui/icons/check-icon.d.ts +6 -0
- package/dist/ui/icons/check-icon.js +1 -0
- package/dist/ui/icons/chevron-down-icon.d.ts +6 -0
- package/dist/ui/icons/chevron-down-icon.js +1 -0
- package/dist/ui/icons/chevron-left-icon.d.ts +6 -0
- package/dist/ui/icons/chevron-left-icon.js +1 -0
- package/dist/ui/icons/chevron-right-icon.d.ts +6 -0
- package/dist/ui/icons/chevron-right-icon.js +1 -0
- package/dist/ui/icons/clock-icon.d.ts +6 -0
- package/dist/ui/icons/clock-icon.js +1 -0
- package/dist/ui/icons/dots-horizontal-icon.d.ts +6 -0
- package/dist/ui/icons/dots-horizontal-icon.js +1 -0
- package/dist/ui/icons/download-02-icon.d.ts +6 -0
- package/dist/ui/icons/download-02-icon.js +1 -0
- package/dist/ui/icons/download-icon.d.ts +6 -0
- package/dist/ui/icons/download-icon.js +1 -0
- package/dist/ui/icons/file-icon.d.ts +6 -0
- package/dist/ui/icons/file-icon.js +1 -0
- package/dist/ui/icons/heartbeat-icon.d.ts +5 -0
- package/dist/ui/icons/heartbeat-icon.js +1 -0
- package/dist/ui/icons/help-circle-icon.d.ts +6 -0
- package/dist/ui/icons/help-circle-icon.js +1 -0
- package/dist/ui/icons/info-circle-outine-icon.d.ts +6 -0
- package/dist/ui/icons/info-circle-outine-icon.js +1 -0
- package/dist/ui/icons/message-bubble-icon.d.ts +6 -0
- package/dist/ui/icons/message-bubble-icon.js +1 -0
- package/dist/ui/icons/message-square-icon.d.ts +6 -0
- package/dist/ui/icons/message-square-icon.js +1 -0
- package/dist/ui/icons/mic-icon.d.ts +6 -0
- package/dist/ui/icons/mic-icon.js +1 -0
- package/dist/ui/icons/mic-off-icon.d.ts +6 -0
- package/dist/ui/icons/mic-off-icon.js +1 -0
- package/dist/ui/icons/phone-icon.d.ts +6 -0
- package/dist/ui/icons/phone-icon.js +1 -0
- package/dist/ui/icons/refresh-ccw-icon.d.ts +7 -0
- package/dist/ui/icons/refresh-ccw-icon.js +1 -0
- package/dist/ui/icons/refresh-icon.d.ts +6 -0
- package/dist/ui/icons/refresh-icon.js +1 -0
- package/dist/ui/icons/settings-icon.d.ts +6 -0
- package/dist/ui/icons/settings-icon.js +1 -0
- package/dist/ui/icons/spinner-icon.d.ts +6 -0
- package/dist/ui/icons/spinner-icon.js +1 -0
- package/dist/ui/icons/tag-icon.d.ts +6 -0
- package/dist/ui/icons/tag-icon.js +1 -0
- package/dist/ui/icons/time-left-icon.d.ts +5 -0
- package/dist/ui/icons/time-left-icon.js +1 -0
- package/dist/ui/icons/types.d.ts +10 -0
- package/dist/ui/icons/types.js +1 -0
- package/dist/ui/icons/upload-icon.d.ts +6 -0
- package/dist/ui/icons/upload-icon.js +1 -0
- package/dist/ui/icons/video-icon.d.ts +6 -0
- package/dist/ui/icons/video-icon.js +1 -0
- package/dist/ui/icons/video-off-icon.d.ts +6 -0
- package/dist/ui/icons/video-off-icon.js +1 -0
- package/dist/ui/icons/volume-icon.d.ts +6 -0
- package/dist/ui/icons/volume-icon.js +1 -0
- package/dist/ui/icons/x-icon.d.ts +6 -0
- package/dist/ui/icons/x-icon.js +1 -0
- package/dist/ui/mq-avatar.d.ts +37 -0
- package/dist/ui/mq-avatar.js +1 -0
- package/dist/ui/mq-badge.d.ts +18 -0
- package/dist/ui/mq-badge.js +4 -0
- package/dist/ui/mq-button.d.ts +37 -0
- package/dist/ui/mq-button.js +1 -0
- package/dist/ui/mq-calendar.d.ts +68 -0
- package/dist/ui/mq-calendar.js +1 -0
- package/dist/ui/mq-callout.d.ts +23 -0
- package/dist/ui/mq-callout.js +1 -0
- package/dist/ui/mq-card.d.ts +18 -0
- package/dist/ui/mq-card.js +1 -0
- package/dist/ui/mq-checkbox.d.ts +41 -0
- package/dist/ui/mq-checkbox.js +1 -0
- package/dist/ui/mq-clamped-text.d.ts +46 -0
- package/dist/ui/mq-clamped-text.js +1 -0
- package/dist/ui/mq-dialog.d.ts +98 -0
- package/dist/ui/mq-dialog.js +1 -0
- package/dist/ui/mq-floating-bubble.d.ts +42 -0
- package/dist/ui/mq-floating-bubble.js +1 -0
- package/dist/ui/mq-input.d.ts +42 -0
- package/dist/ui/mq-input.js +1 -0
- package/dist/ui/mq-page-title.d.ts +31 -0
- package/dist/ui/mq-page-title.js +1 -0
- package/dist/ui/mq-rating.d.ts +30 -0
- package/dist/ui/mq-rating.js +1 -0
- package/dist/ui/mq-select.d.ts +83 -0
- package/dist/ui/mq-select.js +1 -0
- package/dist/ui/mq-skeleton.d.ts +18 -0
- package/dist/ui/mq-skeleton.js +1 -0
- package/dist/ui/mq-tabs.d.ts +76 -0
- package/dist/ui/mq-tabs.js +106 -0
- package/dist/ui/mq-text-button.d.ts +39 -0
- package/dist/ui/mq-text-button.js +1 -0
- package/dist/ui/mq-textarea.d.ts +38 -0
- package/dist/ui/mq-textarea.js +1 -0
- package/dist/ui/mq-time-slot-picker.d.ts +85 -0
- package/dist/ui/mq-time-slot-picker.js +1 -0
- package/dist/ui/mq-toast.d.ts +20 -0
- package/dist/ui/mq-toast.js +1 -0
- package/dist/ui/mq-unread-badge.d.ts +15 -0
- package/dist/ui/mq-unread-badge.js +1 -0
- package/package.json +247 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{e as i}from"./provide-BwI4DDGF.js";import{c as o}from"./consume-CovVqBjI.js";import{A as n}from"./api-client-context-BXGqBAlO.js";import{i as a,a as s,x as r}from"./lit-element-B5-nYi7k.js";import{n as l}from"./property-C1CmBSnw.js";import{r as h}from"./state-Br45Av8Z.js";import"../ui/mq-checkbox.js";import"../ui/mq-button.js";import{M as c}from"./mutation-controller-CR2qcqhH.js";import{setEnv as d}from"../env.js";import{c as m,n as p}from"./api-chat-client-CcYgqPdC.js";const g=a`.page-header{box-sizing:border-box;width:100%;display:none}.page-title{font-family:var(--font-body);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.page-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.page-subtitle{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-subtle)}.page-subtitle ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-section{box-sizing:border-box;width:100%;display:flex;flex-direction:column;gap:var(--sp-6);background-color:var(--color-neutrals-background-weak);padding:var(--sp-6);border-radius:var(--border-radius-md)}.terms-title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.terms-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-description{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}.terms-description ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.checkbox-container{display:flex;gap:var(--sp-3);align-items:flex-start;cursor:pointer}.checkbox-label{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);flex:1}@media (min-width:768px){.page-header{display:block;margin-bottom:var(--sp-10)}.page-title{font-size:var(--text-3xl);line-height:var(--text-3xl--line-height)}.page-title ::slotted(*){font-size:inherit;line-height:inherit}.page-subtitle{font-size:var(--text-base);line-height:var(--text-base--line-height)}.page-subtitle ::slotted(*){font-size:inherit;line-height:inherit}.terms-title{font-size:var(--text-2xl);line-height:var(--text-2xl--line-height)}.terms-title ::slotted(*){font-size:inherit;line-height:inherit}.terms-description{font-size:var(--text-base);line-height:var(--text-base--line-height)}.terms-description ::slotted(*){font-size:inherit;line-height:inherit}.checkbox-label{font-size:var(--text-base);line-height:var(--text-base--line-height)}}`;let v=class MqTermsAndConditions extends s{constructor(){super(...arguments),this.disabled=!1,this.hasCommercialCommunications=!1,this._accepted=!1,this.apiClient=m(),this.acceptLegalConsentMutation=new c(this,{mutationFn:async t=>this.apiClient.profile.acceptLegalConsent(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("continue"))}})}static{this.styles=g}willUpdate(t){t.has("env")&&this.env&&d(this.env);const e=p(t,{env:this.env,apiKey:this.apiKey,token:this.token},this.inheritedApiClient);e&&(this.apiClient=e)}handleCheckboxChange(t){this._accepted=t.detail.checked}handleContinue(){this._accepted&&!this.disabled&&this.acceptLegalConsentMutation.run({terms_accepted:!0,privacy_accepted:!0,commercial_accepted:this.hasCommercialCommunications})}render(){const t=!this._accepted||this.disabled;return r`<div class="page-header"><div class="page-title"><slot name="page-title"></slot></div><div class="page-subtitle"><slot name="page-subtitle"></slot></div></div><div class="terms-section"><div><div class="terms-title"><slot name="terms-title"></slot></div><div class="terms-description"><slot name="terms-description"></slot></div></div><div class="checkbox-container"><mq-checkbox id="terms-checkbox" @change="${this.handleCheckboxChange}" ?disabled="${this.disabled}"></mq-checkbox><label class="checkbox-label" for="terms-checkbox"><slot name="checkbox-label"></slot></label></div><mq-button variant="primary" size="md" fullwidth ?disabled="${this.acceptLegalConsentMutation.isPending||t}" @click="${this.handleContinue}"><slot name="button-text"></slot></mq-button></div>`}};t([l({type:Boolean})],v.prototype,"disabled",void 0),t([l({type:Boolean})],v.prototype,"hasCommercialCommunications",void 0),t([l({type:String,attribute:"api-key"})],v.prototype,"apiKey",void 0),t([l({type:String,attribute:"token"})],v.prototype,"token",void 0),t([l({type:String,attribute:"env"})],v.prototype,"env",void 0),t([h()],v.prototype,"_accepted",void 0),t([o({context:n,subscribe:!0}),h()],v.prototype,"inheritedApiClient",void 0),t([i({context:n}),h()],v.prototype,"apiClient",void 0),v=t([e("mq-terms-and-conditions")],v);export{v as M};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
4
|
+
import { M as MediquoApiChatClient } from './index.d-k8r5vUZn.js';
|
|
5
|
+
import '../ui/mq-checkbox.js';
|
|
6
|
+
import '../ui/mq-button.js';
|
|
7
|
+
import { Env } from '../env.js';
|
|
8
|
+
|
|
9
|
+
type TermsAndConditionsAcceptEvent = CustomEvent<{
|
|
10
|
+
accepted: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
type TermsAndConditionsContinueEvent = CustomEvent<void>;
|
|
13
|
+
/**
|
|
14
|
+
* @fires continue - Fired when the continue button is clicked
|
|
15
|
+
*
|
|
16
|
+
* @slot - Default slot for checkbox label content (can include links)
|
|
17
|
+
* @slot page-title - Slot for the main page title (can include any HTML)
|
|
18
|
+
* @slot page-subtitle - Slot for the main page subtitle (can include any HTML)
|
|
19
|
+
* @slot terms-title - Slot for the terms section title (can include any HTML)
|
|
20
|
+
* @slot terms-description - Slot for the terms section description (can include any HTML)
|
|
21
|
+
* @slot checkbox-label - Slot for the checkbox label (can include any HTML)
|
|
22
|
+
* @slot button-text - Slot for the button text (can include any HTML)
|
|
23
|
+
*/
|
|
24
|
+
declare class MqTermsAndConditions extends LitElement {
|
|
25
|
+
static styles: lit.CSSResult;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
hasCommercialCommunications: boolean;
|
|
28
|
+
/** Mediquo API key. Required when used standalone (outside mq-router). */
|
|
29
|
+
apiKey?: string;
|
|
30
|
+
/** Already-exchanged access token. Required when used standalone. */
|
|
31
|
+
token?: string;
|
|
32
|
+
/** Environment override ("development" | "production"). Optional. */
|
|
33
|
+
env?: Env;
|
|
34
|
+
private _accepted;
|
|
35
|
+
/** The organization scope this element was mounted under, if any. */
|
|
36
|
+
private inheritedApiClient?;
|
|
37
|
+
/**
|
|
38
|
+
* This element's own transport, bound to its `api-key` and provided to every
|
|
39
|
+
* descendant. Never shared with another element.
|
|
40
|
+
*/
|
|
41
|
+
apiClient: MediquoApiChatClient;
|
|
42
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
43
|
+
private handleCheckboxChange;
|
|
44
|
+
private acceptLegalConsentMutation;
|
|
45
|
+
private handleContinue;
|
|
46
|
+
render(): lit_html.TemplateResult<1>;
|
|
47
|
+
}
|
|
48
|
+
declare global {
|
|
49
|
+
interface HTMLElementTagNameMap {
|
|
50
|
+
"mq-terms-and-conditions": MqTermsAndConditions;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { MqTermsAndConditions as M };
|
|
55
|
+
export type { TermsAndConditionsContinueEvent as T, TermsAndConditionsAcceptEvent as a };
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import{e,t}from"./custom-element-CiOhPWP1-DPpsGZrV.js";import{i,a as o,E as s,x as a,r}from"./lit-element-B5-nYi7k.js";import{n}from"./property-C1CmBSnw.js";import{r as l}from"./state-Br45Av8Z.js";const d="rgb(0 0 0 / 0.5)",h="4px",c="0px 8px 16px 0px rgb(0 0 0 / 0.1)",m="rgb(0 0 0 / 0.05)",g="200ms",u="0.5rem",b="3.75rem",p="0.75rem",v="1.25rem",f="1rem",y="0.625rem",w="25rem",x="12rem",q=["a[href]","area[href]","button",'input:not([type="hidden"])',"select","textarea","iframe","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function S(e){if(!e)return 0;const t=getComputedStyle(e).transitionDuration.split(",");return Math.max(0,...t.map(e=>{const t=Number.parseFloat(e);return Number.isNaN(t)?0:e.trim().endsWith("ms")?t:1e3*t}))}let $=0,k="",C="";function N(){if(0===$){const e=document.documentElement,t=window.innerWidth-e.clientWidth;if(k=e.style.overflow,C=e.style.paddingRight,e.style.overflow="hidden",e.clientWidth>0&&t>0){const i=Number.parseFloat(getComputedStyle(e).paddingRight);e.style.paddingRight=`${(Number.isNaN(i)?0:i)+t}px`}}$+=1}function E(){if(0!==$&&($-=1,0===$)){const e=document.documentElement;e.style.overflow=k,e.style.paddingRight=C}}function A(e,t){(function(e){if(!(e instanceof HTMLElement))return!1;if(!e.matches(q))return!1;if(e.hasAttribute("disabled")||e.hasAttribute("inert"))return!1;if("true"===e.getAttribute("aria-hidden"))return!1;const t=e.getAttribute("tabindex");return!(null!==t&&Number(t)<0)&&(null!==e.offsetParent||e.getClientRects().length>0)})(e)&&t.push(e);const i=e.shadowRoot?e.shadowRoot.children:e instanceof HTMLSlotElement?e.assignedElements({flatten:!0}):e.children;for(const e of i)A(e,t)}function D(e,t){if("Tab"!==e.key||!t)return;const i=[];A(t,i);const o=i[0],s=i[i.length-1];if(!o||!s)return void e.preventDefault();const a=function(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}();e.shiftKey||a!==s?e.shiftKey&&a===o&&(e.preventDefault(),s.focus()):(e.preventDefault(),o.focus())}const M=(e,t)=>r(`var(--dialog-${e}, ${t})`),F=M("underlay",d),T=M("underlay-blur",h),z=M("shadow",c),O=M("close-hover-bg",m),R=M("transition-duration",g),H=M("radius",u),j=M("header-height",b),P=M("padding-inline",p),L=M("padding-block",v),W=M("gap",f),I=M("actions-gap",y),B=i`
|
|
2
|
+
:host {
|
|
3
|
+
display: contents;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
[hidden] {
|
|
7
|
+
display: none !important;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
dialog.root {
|
|
11
|
+
/* Reset user-agent dialog styles */
|
|
12
|
+
padding: 0;
|
|
13
|
+
border: none;
|
|
14
|
+
margin: 0;
|
|
15
|
+
max-width: none;
|
|
16
|
+
max-height: none;
|
|
17
|
+
/* Full-viewport underlay so clicks outside the card hit the dialog */
|
|
18
|
+
position: fixed;
|
|
19
|
+
inset: 0;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
background: ${F};
|
|
24
|
+
backdrop-filter: blur(${T});
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
transition: opacity ${R} ease;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
dialog.root:not([open]) {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* The dim is the dialog's own background, so it can animate via .active */
|
|
37
|
+
dialog.root::backdrop {
|
|
38
|
+
background: transparent;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dialog {
|
|
42
|
+
position: relative;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
/* 1rem of air on each side on phones, inside the safe area */
|
|
47
|
+
width: calc(
|
|
48
|
+
100% - 2rem - var(--mq-safe-left, 0px) - var(--mq-safe-right, 0px)
|
|
49
|
+
);
|
|
50
|
+
max-width: ${M("max-width",w)};
|
|
51
|
+
/* vh first for browsers without dvh; dvh wins where it exists, so the
|
|
52
|
+
card never grows under a mobile browser's toolbars. */
|
|
53
|
+
max-height: calc(
|
|
54
|
+
100vh - 2rem - var(--mq-safe-top, 0px) - var(--mq-safe-bottom, 0px)
|
|
55
|
+
);
|
|
56
|
+
max-height: calc(
|
|
57
|
+
100dvh - 2rem - var(--mq-safe-top, 0px) - var(--mq-safe-bottom, 0px)
|
|
58
|
+
);
|
|
59
|
+
margin-top: var(--mq-safe-top, 0px);
|
|
60
|
+
margin-bottom: var(--mq-safe-bottom, 0px);
|
|
61
|
+
margin-left: var(--mq-safe-left, 0px);
|
|
62
|
+
margin-right: var(--mq-safe-right, 0px);
|
|
63
|
+
border: none;
|
|
64
|
+
border-radius: ${H};
|
|
65
|
+
background: var(
|
|
66
|
+
--mq-surface-surface,
|
|
67
|
+
var(--color-neutrals-background-extraWeak, #ffffff)
|
|
68
|
+
);
|
|
69
|
+
color: var(--mq-text-primary, var(--color-neutrals-text-default, #0a0a23));
|
|
70
|
+
font-family: var(--mq-typography-family-sans, var(--font-body, inherit));
|
|
71
|
+
box-shadow: ${z};
|
|
72
|
+
outline: none;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
opacity: 0;
|
|
75
|
+
transform: scale(0.95);
|
|
76
|
+
transition:
|
|
77
|
+
opacity ${R} ease,
|
|
78
|
+
transform ${R} ease;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
dialog.root.active {
|
|
82
|
+
opacity: 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
dialog.root.active .dialog {
|
|
86
|
+
opacity: 1;
|
|
87
|
+
transform: scale(1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Image, header and body scroll together; the close button and the actions
|
|
91
|
+
stay put. */
|
|
92
|
+
.scroll {
|
|
93
|
+
flex: 1;
|
|
94
|
+
min-height: 0;
|
|
95
|
+
overflow-y: auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Focusable only while it overflows, so a keyboard user can scroll it —
|
|
99
|
+
Safari does not make scrollers focusable on its own. */
|
|
100
|
+
.scroll:focus-visible {
|
|
101
|
+
outline: 2px solid var(--mq-border-focus, var(--color-primary, #4a1ea7));
|
|
102
|
+
outline-offset: -2px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.image {
|
|
106
|
+
line-height: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.image ::slotted(img),
|
|
110
|
+
.image ::slotted(picture),
|
|
111
|
+
.image ::slotted(video),
|
|
112
|
+
.image ::slotted(svg) {
|
|
113
|
+
display: block;
|
|
114
|
+
width: 100%;
|
|
115
|
+
max-height: ${M("image-max-height",x)};
|
|
116
|
+
object-fit: cover;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.header {
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
box-sizing: border-box;
|
|
123
|
+
min-height: ${j};
|
|
124
|
+
/* The end side leaves room for the close button sitting in the band. */
|
|
125
|
+
padding: var(--mq-spacing-2, 0.5rem) var(--mq-spacing-12, 3rem)
|
|
126
|
+
var(--mq-spacing-2, 0.5rem) ${P};
|
|
127
|
+
background: var(--mq-surface-surface-raised, var(--color-muted, #f8f7fa));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Over an image the close button sits on the image, not in the band. */
|
|
131
|
+
.dialog.with-image .header {
|
|
132
|
+
padding-inline-end: ${P};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.heading {
|
|
136
|
+
font-family: var(--mq-typography-family-sans, var(--font-titles, inherit));
|
|
137
|
+
font-size: var(--mq-typography-size-base, 1rem);
|
|
138
|
+
font-weight: var(--mq-typography-weight-medium, 500);
|
|
139
|
+
line-height: 1.25rem;
|
|
140
|
+
color: var(--mq-text-brand, var(--color-primary, #4a1ea7));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.body {
|
|
144
|
+
display: grid;
|
|
145
|
+
gap: ${W};
|
|
146
|
+
padding: ${L} ${P};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* No header band to hold the close button: keep the body clear of it. */
|
|
150
|
+
.dialog:not(.with-heading):not(.with-image) .body {
|
|
151
|
+
padding-inline-end: var(--mq-spacing-12, 3rem);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.subheading {
|
|
155
|
+
font-size: var(--mq-typography-size-xs, 0.75rem);
|
|
156
|
+
font-weight: var(--mq-typography-weight-normal, 400);
|
|
157
|
+
line-height: 1rem;
|
|
158
|
+
/* ≈ Figma's #6d658b on white, and still readable in dark mode;
|
|
159
|
+
--mq-text-secondary would fall under 4.5:1. */
|
|
160
|
+
color: var(
|
|
161
|
+
--color-neutrals-text-medium,
|
|
162
|
+
color-mix(in srgb, var(--mq-text-primary, #0a0a23) 64%, transparent)
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* Headings bring their own UA margins and sizes; start from the design's.
|
|
167
|
+
Styles the owner gives its own heading still win over these. */
|
|
168
|
+
.heading ::slotted(*),
|
|
169
|
+
.subheading ::slotted(*) {
|
|
170
|
+
margin: 0;
|
|
171
|
+
font-family: inherit;
|
|
172
|
+
font-size: inherit;
|
|
173
|
+
font-weight: inherit;
|
|
174
|
+
line-height: inherit;
|
|
175
|
+
color: inherit;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.footer {
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-wrap: wrap;
|
|
181
|
+
flex-shrink: 0;
|
|
182
|
+
align-items: center;
|
|
183
|
+
justify-content: flex-end;
|
|
184
|
+
gap: ${I};
|
|
185
|
+
padding: var(--mq-spacing-3, 0.75rem) ${P}
|
|
186
|
+
var(--mq-spacing-4, 1rem);
|
|
187
|
+
border-top: var(--mq-size-border-default, 1px) solid
|
|
188
|
+
var(--mq-border-default, var(--color-border, #edecf1));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.close-btn {
|
|
192
|
+
position: absolute;
|
|
193
|
+
/* Centred in the header band: (band - button) / 2 */
|
|
194
|
+
top: calc((${j} - var(--mq-size-control-sm, 2rem)) / 2);
|
|
195
|
+
right: var(--mq-spacing-2, 0.5rem);
|
|
196
|
+
z-index: 1;
|
|
197
|
+
display: inline-flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
box-sizing: border-box;
|
|
201
|
+
width: var(--mq-size-control-sm, 2rem);
|
|
202
|
+
height: var(--mq-size-control-sm, 2rem);
|
|
203
|
+
margin: 0;
|
|
204
|
+
padding: 0;
|
|
205
|
+
border: none;
|
|
206
|
+
border-radius: var(--mq-radius-md, 0.375rem);
|
|
207
|
+
background: transparent;
|
|
208
|
+
/* Not --mq-text-secondary: grey.500 is 2.79:1 on the band, under the 3:1 a
|
|
209
|
+
control's icon needs. Same derivation as the subheading. */
|
|
210
|
+
color: var(
|
|
211
|
+
--color-neutrals-text-medium,
|
|
212
|
+
color-mix(in srgb, var(--mq-text-primary, #0a0a23) 64%, transparent)
|
|
213
|
+
);
|
|
214
|
+
cursor: pointer;
|
|
215
|
+
transition: background-color ${R} ease;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.close-btn svg {
|
|
219
|
+
width: var(--mq-size-icon-lg, 1.5rem);
|
|
220
|
+
height: var(--mq-size-icon-lg, 1.5rem);
|
|
221
|
+
pointer-events: none;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.close-btn:hover {
|
|
225
|
+
background: ${O};
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.close-btn:focus-visible {
|
|
229
|
+
outline: 2px solid var(--mq-border-focus, var(--color-primary, #4a1ea7));
|
|
230
|
+
outline-offset: 2px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* Over a photo the bare glyph can vanish; give it a chip to sit on. */
|
|
234
|
+
.dialog.with-image .close-btn {
|
|
235
|
+
top: var(--mq-spacing-3, 0.75rem);
|
|
236
|
+
right: var(--mq-spacing-3, 0.75rem);
|
|
237
|
+
border-radius: var(--mq-radius-full, 9999px);
|
|
238
|
+
background: var(
|
|
239
|
+
--mq-surface-surface,
|
|
240
|
+
var(--color-neutrals-background-extraWeak, #ffffff)
|
|
241
|
+
);
|
|
242
|
+
opacity: 0.9;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.dialog.with-image .close-btn:hover {
|
|
246
|
+
opacity: 1;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.close-btn:disabled {
|
|
250
|
+
opacity: 0.4;
|
|
251
|
+
cursor: default;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@media (forced-colors: active) {
|
|
255
|
+
.dialog {
|
|
256
|
+
border: 1px solid CanvasText;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
@media (prefers-reduced-motion: reduce) {
|
|
261
|
+
dialog.root,
|
|
262
|
+
.dialog,
|
|
263
|
+
.close-btn {
|
|
264
|
+
transition: none;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.dialog {
|
|
268
|
+
transform: none;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
`;class MqDialogCloseEvent extends Event{static{this.eventName="mq-close"}constructor(){super(MqDialogCloseEvent.eventName,{bubbles:!0,composed:!0,cancelable:!0})}}let K=class MqDialog extends o{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.alert=!1,this.label="",this.closeLabel="Close dialog",this.isActive=!1,this.hasImage=!1,this.hasHeading=!1,this.hasSubheading=!1,this.hasFooter=!1,this.isModal=!1,this.scrollable=!1,this.enterFrame=null,this.slotObserver=null,this.scrollObserver=null,this.closeTimer=null,this.lockedScroll=!1,this.backdropPointerDown=!1,this.warnedAboutName=!1,this.detaching=!1,this.onSlotChange=()=>{this.readSlots()},this.onDialogPointerDown=e=>{this.backdropPointerDown=e.target===this.dialogEl},this.onDialogClick=e=>{const t=this.backdropPointerDown&&e.target===this.dialogEl;this.backdropPointerDown=!1,t&&this.dismissable&&this.requestClose()},this.onCancel=e=>{e.preventDefault(),this.dismissable&&this.requestClose()},this.onNativeClose=()=>{this.detaching||(this.open?this.dismissable||!this.isConnected?(this.releaseScroll(),this.dispatchEvent(new MqDialogCloseEvent),this.open=!1):this.openNative():this.releaseScroll())},this.onCloseClick=()=>{this.dismissable&&this.requestClose()},this.onKeyDown=e=>{D(e,this.shadowRoot?.querySelector(".dialog")??null)}}static{this.styles=[B]}get dialogEl(){return this.shadowRoot?.querySelector("dialog")??null}connectedCallback(){super.connectedCallback(),this.readSlots(),this.slotObserver=new MutationObserver(()=>this.readSlots()),this.slotObserver.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["slot"]}),this.hasUpdated&&(this.observeScroll(),this.open&&this.openNative())}disconnectedCallback(){this.slotObserver?.disconnect(),this.slotObserver=null,this.scrollObserver?.disconnect(),this.scrollObserver=null,this.cancelEnterFrame(),this.closeTimer&&(window.clearTimeout(this.closeTimer),this.closeTimer=null),this.detaching=!0,this.closeNative(),this.detaching=!1,this.isActive=!1,super.disconnectedCallback()}firstUpdated(){this.observeScroll()}observeScroll(){if(this.scrollObserver||"undefined"==typeof ResizeObserver)return;const e=this.shadowRoot?.querySelector(".scroll");if(!e)return;this.scrollObserver=new ResizeObserver(()=>this.measureScroll()),this.scrollObserver.observe(e);const t=this.shadowRoot?.querySelector(".scroll > .body");t&&this.scrollObserver.observe(t)}updated(e){if(!e.has("open"))return;if(!this.dialogEl)return;if(this.open)return this.closeTimer&&(window.clearTimeout(this.closeTimer),this.closeTimer=null),this.openNative(),void this.warnAboutMissingName();if(this.cancelEnterFrame(),this.isActive=!1,!this.dialogEl.open)return void this.releaseScroll();this.closeTimer&&window.clearTimeout(this.closeTimer);const t=this.shadowRoot?.querySelector(".dialog");this.closeTimer=window.setTimeout(()=>{this.closeNative(),this.closeTimer=null},S(t))}openNative(){const e=this.dialogEl;e&&(e.open||("function"==typeof e.showModal?(e.showModal(),this.isModal=!0):(e.setAttribute("open",""),this.isModal=!1)),this.holdScroll(),this.measureScroll(),this.cancelEnterFrame(),this.enterFrame=requestAnimationFrame(()=>{this.enterFrame=null,this.open&&(this.isActive=!0)}))}cancelEnterFrame(){null!==this.enterFrame&&(cancelAnimationFrame(this.enterFrame),this.enterFrame=null)}measureScroll(){const e=this.shadowRoot?.querySelector(".scroll");e&&(this.scrollable=e.scrollHeight>e.clientHeight+1)}closeNative(){const e=this.dialogEl;e?.open&&("function"==typeof e.close?e.close():e.removeAttribute("open")),this.releaseScroll()}holdScroll(){this.lockedScroll||(N(),this.lockedScroll=!0)}releaseScroll(){this.lockedScroll&&(E(),this.lockedScroll=!1)}warnAboutMissingName(){this.hasHeading||this.label||this.warnedAboutName||(this.warnedAboutName=!0,console.warn('mq-dialog: nothing is in the "heading" slot and no label was set, so the dialog has no accessible name and a screen reader will announce it as just "dialog". Add a heading or pass a label attribute.'))}hasSlotted(e,t){const i=Array.from(this.querySelectorAll(`:scope > [slot="${e}"]`));return t?i.some(e=>""!==(e.textContent??"").trim()):i.length>0}readSlots(){this.hasImage=this.hasSlotted("image",!1),this.hasHeading=this.hasSlotted("heading",!0),this.hasSubheading=this.hasSlotted("subheading",!0),this.hasFooter=this.hasSlotted("footer",!1),this.measureScroll(),this.open&&this.warnAboutMissingName()}requestClose(){this.dispatchEvent(new MqDialogCloseEvent)&&(this.open=!1)}render(){const e=["dialog",this.hasImage?"with-image":"",this.hasHeading?"with-heading":""].filter(Boolean).join(" ");return a`
|
|
272
|
+
<dialog
|
|
273
|
+
class="root ${this.isActive?"active":""}"
|
|
274
|
+
role=${this.alert?"alertdialog":s}
|
|
275
|
+
aria-modal=${this.isModal?"true":s}
|
|
276
|
+
closedby=${this.dismissable?"closerequest":"none"}
|
|
277
|
+
aria-labelledby=${this.hasHeading?"dialog-heading":s}
|
|
278
|
+
aria-label=${!this.hasHeading&&this.label?this.label:s}
|
|
279
|
+
aria-describedby=${this.hasSubheading?"dialog-subheading":s}
|
|
280
|
+
@pointerdown=${this.onDialogPointerDown}
|
|
281
|
+
@click=${this.onDialogClick}
|
|
282
|
+
@keydown=${this.onKeyDown}
|
|
283
|
+
@cancel=${this.onCancel}
|
|
284
|
+
@close=${this.onNativeClose}
|
|
285
|
+
>
|
|
286
|
+
<div class=${e} part="dialog">
|
|
287
|
+
<button
|
|
288
|
+
class="close-btn"
|
|
289
|
+
part="close"
|
|
290
|
+
type="button"
|
|
291
|
+
aria-label=${this.closeLabel}
|
|
292
|
+
title=${this.closeLabel}
|
|
293
|
+
?disabled=${!this.dismissable}
|
|
294
|
+
@click=${this.onCloseClick}
|
|
295
|
+
>
|
|
296
|
+
<svg
|
|
297
|
+
aria-hidden="true"
|
|
298
|
+
viewBox="0 0 24 24"
|
|
299
|
+
fill="none"
|
|
300
|
+
stroke="currentColor"
|
|
301
|
+
stroke-width="2"
|
|
302
|
+
stroke-linecap="round"
|
|
303
|
+
stroke-linejoin="round"
|
|
304
|
+
>
|
|
305
|
+
<path d="M18 6 6 18M6 6l12 12" />
|
|
306
|
+
</svg>
|
|
307
|
+
</button>
|
|
308
|
+
<div
|
|
309
|
+
class="scroll"
|
|
310
|
+
part="scroll"
|
|
311
|
+
tabindex=${this.scrollable?"0":s}
|
|
312
|
+
role=${this.scrollable?"region":s}
|
|
313
|
+
aria-labelledby=${this.scrollable&&this.hasHeading?"dialog-heading":s}
|
|
314
|
+
aria-label=${this.scrollable&&!this.hasHeading&&this.label?this.label:s}
|
|
315
|
+
>
|
|
316
|
+
<div class="image" part="image" ?hidden=${!this.hasImage}>
|
|
317
|
+
<slot name="image" @slotchange=${this.onSlotChange}></slot>
|
|
318
|
+
</div>
|
|
319
|
+
<div class="header" part="header" ?hidden=${!this.hasHeading}>
|
|
320
|
+
<div class="heading" part="heading" id="dialog-heading">
|
|
321
|
+
<slot name="heading" @slotchange=${this.onSlotChange}></slot>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
<div class="body" part="body">
|
|
325
|
+
<div
|
|
326
|
+
class="subheading"
|
|
327
|
+
part="subheading"
|
|
328
|
+
id="dialog-subheading"
|
|
329
|
+
?hidden=${!this.hasSubheading}
|
|
330
|
+
>
|
|
331
|
+
<slot name="subheading" @slotchange=${this.onSlotChange}></slot>
|
|
332
|
+
</div>
|
|
333
|
+
<div class="content" part="content"><slot></slot></div>
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
<div class="footer" part="footer" ?hidden=${!this.hasFooter}>
|
|
337
|
+
<slot name="footer" @slotchange=${this.onSlotChange}></slot>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
</dialog>
|
|
341
|
+
`}};e([n({type:Boolean,reflect:!0})],K.prototype,"open",void 0),e([n({type:Boolean,reflect:!0})],K.prototype,"dismissable",void 0),e([n({type:Boolean,reflect:!0})],K.prototype,"alert",void 0),e([n({type:String})],K.prototype,"label",void 0),e([n({type:String,attribute:"close-label"})],K.prototype,"closeLabel",void 0),e([l()],K.prototype,"isActive",void 0),e([l()],K.prototype,"hasImage",void 0),e([l()],K.prototype,"hasHeading",void 0),e([l()],K.prototype,"hasSubheading",void 0),e([l()],K.prototype,"hasFooter",void 0),e([l()],K.prototype,"isModal",void 0),e([l()],K.prototype,"scrollable",void 0),K=e([t("mq-dialog")],K);export{K as D,MqDialogCloseEvent as M,E as a,S as e,D as l,N as r};
|