@nylas/react 1.3.6 → 1.4.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/dist/add-circle-icon_2.entry-04909861.cjs +1 -0
- package/dist/add-circle-icon_2.entry-0d9ba871.js +26 -0
- package/dist/archive-icon.entry-3d6d9d3f.js +16 -0
- package/dist/archive-icon.entry-88459432.cjs +1 -0
- package/dist/{arrow-icon.entry-9cfd86a1.js → arrow-icon.entry-789ee889.js} +3 -2
- package/dist/arrow-icon.entry-c35e1933.cjs +1 -0
- package/dist/bold-icon.entry-827e95bf.cjs +1 -0
- package/dist/{bold-icon.entry-eab3420d.js → bold-icon.entry-fbb382d2.js} +7 -6
- package/dist/{button-component_2.entry-7cd5f9c0.js → button-component_2.entry-6c012ee4.js} +10 -9
- package/dist/button-component_2.entry-acd13f45.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_36.entry-1bb3b1a8.js +4689 -0
- package/dist/calendar-agenda-fill-icon_36.entry-fa8121df.cjs +6 -0
- package/dist/calendar-cancel-icon.entry-2e97f7d8.cjs +1 -0
- package/dist/{calendar-cancel-icon.entry-299d6fba.js → calendar-cancel-icon.entry-a4d040db.js} +6 -5
- package/dist/{calendar-check-icon_2.entry-08ef8d2f.js → calendar-check-icon_2.entry-a48a358d.js} +12 -11
- package/dist/calendar-check-icon_2.entry-bca4821d.cjs +1 -0
- package/dist/{calendar-icon.entry-53b54115.js → calendar-icon.entry-57727659.js} +6 -5
- package/dist/calendar-icon.entry-a289313a.cjs +1 -0
- package/dist/checkbox-component.entry-af3e7005.cjs +1 -0
- package/dist/checkbox-component.entry-f4f98226.js +43 -0
- package/dist/checkmark-icon_15.entry-dace1b62.cjs +5 -0
- package/dist/checkmark-icon_15.entry-f43549b3.js +1337 -0
- package/dist/chevron-icon_3.entry-219b42e6.cjs +1 -0
- package/dist/chevron-icon_3.entry-25533d13.js +148 -0
- package/dist/clock-icon_4.entry-3917c667.cjs +1 -0
- package/dist/{clock-icon_4.entry-0e809dcb.js → clock-icon_4.entry-76f29f7e.js} +9 -8
- package/dist/{constants-6da0ede7-49c32ba7.js → constants-3d8016e3-3c080f00.js} +110 -41
- package/dist/constants-3d8016e3-fd6c3848.cjs +1 -0
- package/dist/customParseFormat-6c652dbb-8a42d5b0.js +135 -0
- package/dist/customParseFormat-6c652dbb-ba81ab97.cjs +1 -0
- package/dist/{delete-icon.entry-802084f6.js → delete-icon.entry-3b61864e.js} +8 -7
- package/dist/delete-icon.entry-96420b21.cjs +1 -0
- package/dist/{document-refresh-icon.entry-d1604f53.js → document-refresh-icon.entry-7333b7c9.js} +6 -5
- package/dist/document-refresh-icon.entry-8b5c6b9b.cjs +1 -0
- package/dist/elements/index.d.ts +10 -0
- package/dist/{feedbackSync-c040f483-2b6476c4.js → feedbackSync-352aaf4a-b2b83cfa.js} +1 -1
- package/dist/{feedbackSync-c040f483-d6dd0560.cjs → feedbackSync-352aaf4a-ba1bf452.cjs} +1 -1
- package/dist/{folder-icon.entry-6c0c09ed.js → folder-icon.entry-bb5e2452.js} +5 -4
- package/dist/folder-icon.entry-d2e46d3a.cjs +1 -0
- package/dist/forward-icon.entry-1fcf5a6b.cjs +1 -0
- package/dist/forward-icon.entry-af8d2147.js +16 -0
- package/dist/globe-icon_2.entry-b4b55760.cjs +1 -0
- package/dist/globe-icon_2.entry-cc6d9d67.js +200 -0
- package/dist/google-logo-icon_6.entry-aa7b5b42.js +1484 -0
- package/dist/google-logo-icon_6.entry-eefdec63.cjs +2 -0
- package/dist/google-meet-icon_5.entry-9758e527.js +56 -0
- package/dist/google-meet-icon_5.entry-c545537a.cjs +1 -0
- package/dist/inbox-icon.entry-b9640d5a.cjs +1 -0
- package/dist/inbox-icon.entry-c005ebc5.js +16 -0
- package/dist/index-05630f15.cjs +57 -0
- package/dist/index-78390f2e.js +17607 -0
- package/dist/index.d.ts +1 -3
- package/dist/{index.es-2b014ec7-72557487.js → index.es-4a203e8e-cf485db5.js} +818 -804
- package/dist/{index.es-2b014ec7-0589e68a.cjs → index.es-4a203e8e-f668b8c2.cjs} +6 -6
- package/dist/info-icon_2.entry-b17298b6.js +35 -0
- package/dist/info-icon_2.entry-ecbc6605.cjs +1 -0
- package/dist/input-component.entry-24366ab8.cjs +1 -0
- package/dist/input-component.entry-9da5da6c.js +84 -0
- package/dist/input-dropdown_2.entry-0109b06c.cjs +1 -0
- package/dist/input-dropdown_2.entry-d65f7152.js +231 -0
- package/dist/italic-icon.entry-afa4332a.cjs +1 -0
- package/dist/{italic-icon.entry-d610e66f.js → italic-icon.entry-d0a536f2.js} +3 -2
- package/dist/multi-select-dropdown_2.entry-2c7a1a06.cjs +1 -0
- package/dist/multi-select-dropdown_2.entry-c56b5fd2.js +187 -0
- package/dist/notebook-store-b61693cd-0877e7a2.js +14 -0
- package/dist/notebook-store-b61693cd-a7b8ae37.cjs +5 -0
- package/dist/nylas-booked-event-card_12.entry-827c7fb4.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-960fdfe2.js +1422 -0
- package/dist/nylas-call-summary.entry-1cce1446.js +16 -0
- package/dist/nylas-call-summary.entry-f10f3c54.cjs +1 -0
- package/dist/nylas-event-calendar_3.entry-8bb08ed3.js +9705 -0
- package/dist/nylas-event-calendar_3.entry-b656237b.cjs +6 -0
- package/dist/nylas-form-card.entry-62578338.cjs +1 -0
- package/dist/nylas-form-card.entry-7455b8f1.js +58 -0
- package/dist/nylas-if-state.entry-0897dc70.cjs +1 -0
- package/dist/{nylas-if-state.entry-ee7d92b0.js → nylas-if-state.entry-7fa6d392.js} +4 -3
- package/dist/nylas-key-points.entry-449e1be0.js +29 -0
- package/dist/nylas-key-points.entry-693f33a1.cjs +1 -0
- package/dist/nylas-login.entry-36544dc8.cjs +1 -0
- package/dist/{nylas-login.entry-265f9d0f.js → nylas-login.entry-d7082306.js} +4 -3
- package/dist/{nylas-provider.entry-5605a3e0.js → nylas-provider.entry-a0e7ce4d.js} +6 -5
- package/dist/nylas-provider.entry-b93d2a62.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-332d27e0.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-b3e085b3.js → nylas-scheduler-editor.entry-78fe5abf.js} +524 -266
- package/dist/nylas-scheduling.entry-1d80c349.cjs +1 -0
- package/dist/nylas-scheduling.entry-fa9ff55b.js +439 -0
- package/dist/nylas-transcript.entry-570d3abe.cjs +6 -0
- package/dist/nylas-transcript.entry-b129565c.js +128 -0
- package/dist/nylas-video-player.entry-9c7c9792.cjs +1 -0
- package/dist/nylas-video-player.entry-e208d443.js +39 -0
- package/dist/nylas-video-preview.entry-a3f542ad.js +16 -0
- package/dist/nylas-video-preview.entry-bd9bdda7.cjs +1 -0
- package/dist/{person-icon.entry-85660f98.js → person-icon.entry-82fbc43e.js} +8 -7
- package/dist/person-icon.entry-e4d11400.cjs +1 -0
- package/dist/play-icon.entry-68bc660a.js +16 -0
- package/dist/play-icon.entry-9cab598b.cjs +1 -0
- package/dist/radio-button-group.entry-6a2adf11.cjs +1 -0
- package/dist/radio-button-group.entry-f7679911.js +47 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +134 -125
- package/dist/refresh-icon.entry-0f1e5f20.cjs +1 -0
- package/dist/{refresh-icon.entry-d8644f5d.js → refresh-icon.entry-394b0814.js} +6 -5
- package/dist/{register-component-e9c10e19-80bbc4dd.cjs → register-component-1027b769-62812558.cjs} +1 -1
- package/dist/{register-component-e9c10e19-099fb50f.js → register-component-1027b769-dd21b16d.js} +1 -1
- package/dist/{reply-all-icon.entry-f209daeb.js → reply-all-icon.entry-0fad8f2f.js} +5 -4
- package/dist/reply-all-icon.entry-1680f1e5.cjs +1 -0
- package/dist/{reply-icon.entry-d37a129b.js → reply-icon.entry-5f4b7837.js} +5 -4
- package/dist/reply-icon.entry-77342442.cjs +1 -0
- package/dist/scheduler-config-store-d6729d8d-06a3a314.cjs +1 -0
- package/dist/{scheduler-config-store-ed4a8dfd-35ec90c6.js → scheduler-config-store-d6729d8d-854b5da8.js} +4 -1
- package/dist/scheduler-store-f3e2a26f-7cee436f.cjs +1 -0
- package/dist/scheduler-store-f3e2a26f-85df53f7.js +533 -0
- package/dist/sent-icon.entry-20a8945d.cjs +1 -0
- package/dist/sent-icon.entry-2d122865.js +16 -0
- package/dist/spam-icon.entry-86178cc5.cjs +1 -0
- package/dist/spam-icon.entry-9e374d44.js +16 -0
- package/dist/star-icon.entry-1b94c861.cjs +1 -0
- package/dist/{star-icon.entry-9b22bb32.js → star-icon.entry-bb1b517d.js} +7 -6
- package/dist/stop-icon.entry-7b21833b.cjs +1 -0
- package/dist/{stop-icon.entry-1f7918b2.js → stop-icon.entry-e4d3526d.js} +3 -2
- package/dist/textarea-component.entry-ba3c9311.js +39 -0
- package/dist/textarea-component.entry-fdba933d.cjs +1 -0
- package/dist/toggle-switch.entry-4a980d1d.js +34 -0
- package/dist/toggle-switch.entry-9142a3d3.cjs +1 -0
- package/dist/{translate-icon.entry-8cffa646.js → translate-icon.entry-1657aa04.js} +5 -4
- package/dist/translate-icon.entry-b4908cf3.cjs +1 -0
- package/dist/trash-fill-icon.entry-a6791185.cjs +1 -0
- package/dist/trash-fill-icon.entry-c9e1769e.js +16 -0
- package/dist/{underline-icon.entry-afd9c78b.js → underline-icon.entry-1ba4d923.js} +5 -4
- package/dist/underline-icon.entry-d1f91e63.cjs +1 -0
- package/dist/warning-icon.entry-b1480f57.cjs +1 -0
- package/dist/{warning-icon.entry-53441175.js → warning-icon.entry-fe155c15.js} +5 -4
- package/package.json +12 -4
- package/dist/add-circle-icon.entry-25aecb13.js +0 -15
- package/dist/add-circle-icon.entry-5c49ba96.cjs +0 -1
- package/dist/archive-icon.entry-0a9e8ec3.cjs +0 -1
- package/dist/archive-icon.entry-89e31121.js +0 -15
- package/dist/arrow-icon.entry-19e5237c.cjs +0 -1
- package/dist/bold-icon.entry-d591e701.cjs +0 -1
- package/dist/button-component_2.entry-ce4314bf.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_54.entry-7099138a.js +0 -5865
- package/dist/calendar-agenda-fill-icon_54.entry-9228dbe7.cjs +0 -8
- package/dist/calendar-cancel-icon.entry-6e3d20f1.cjs +0 -1
- package/dist/calendar-check-icon_2.entry-087dd913.cjs +0 -1
- package/dist/calendar-icon.entry-73f9d05b.cjs +0 -1
- package/dist/checkbox-component_3.entry-bc9768dd.cjs +0 -1
- package/dist/checkbox-component_3.entry-d828eb1d.js +0 -149
- package/dist/chevron-icon_3.entry-783588a9.js +0 -147
- package/dist/chevron-icon_3.entry-e956d78c.cjs +0 -1
- package/dist/clock-icon_4.entry-60d41dfd.cjs +0 -1
- package/dist/close-icon.entry-1b5d25c5.cjs +0 -1
- package/dist/close-icon.entry-fef4f624.js +0 -15
- package/dist/constants-6da0ede7-151395ad.cjs +0 -1
- package/dist/copy-icon.entry-25699ab8.js +0 -15
- package/dist/copy-icon.entry-ab6530e0.cjs +0 -1
- package/dist/core-js-38e53e34.cjs +0 -4
- package/dist/core-js-a9d3b6e1.js +0 -3297
- package/dist/delete-icon.entry-e99e1f82.cjs +0 -1
- package/dist/document-refresh-icon.entry-065a59f5.cjs +0 -1
- package/dist/dom-68f08be9.cjs +0 -15
- package/dist/dom-86e17616.js +0 -664
- package/dist/folder-icon.entry-351e61fc.cjs +0 -1
- package/dist/forward-icon.entry-0ccfb600.js +0 -15
- package/dist/forward-icon.entry-6b7af9cd.cjs +0 -1
- package/dist/globe-icon.entry-2b75b66b.cjs +0 -1
- package/dist/globe-icon.entry-5ddcd2cb.js +0 -15
- package/dist/google-logo-icon_4.entry-04174684.js +0 -790
- package/dist/google-logo-icon_4.entry-a685ff91.cjs +0 -1
- package/dist/inbox-icon.entry-0ad18b3f.js +0 -15
- package/dist/inbox-icon.entry-425d1ded.cjs +0 -1
- package/dist/index-7e7c24f1.js +0 -16837
- package/dist/index-81719cc6.cjs +0 -81
- package/dist/info-icon_2.entry-7ec02802.cjs +0 -1
- package/dist/info-icon_2.entry-a6d0e842.js +0 -34
- package/dist/input-color-picker.entry-d98d06ca.js +0 -48
- package/dist/input-color-picker.entry-ed9a1c07.cjs +0 -1
- package/dist/input-component.entry-2e57b00e.cjs +0 -1
- package/dist/input-component.entry-f3aa3419.js +0 -70
- package/dist/input-dropdown_2.entry-0d9c8475.js +0 -228
- package/dist/input-dropdown_2.entry-6fc7df16.cjs +0 -1
- package/dist/italic-icon.entry-7a8712f2.cjs +0 -1
- package/dist/multi-select-dropdown.entry-b31d9f11.js +0 -116
- package/dist/multi-select-dropdown.entry-eaa268b4.cjs +0 -1
- package/dist/nylas-booked-event-card_12.entry-45514813.js +0 -1378
- package/dist/nylas-booked-event-card_12.entry-498de30a.cjs +0 -1
- package/dist/nylas-form-card.entry-67aec298.js +0 -57
- package/dist/nylas-form-card.entry-fdb3c114.cjs +0 -1
- package/dist/nylas-if-state.entry-76b38c9c.cjs +0 -1
- package/dist/nylas-login.entry-589e45d0.cjs +0 -1
- package/dist/nylas-provider.entry-cfb9627c.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-6fdfb9b5.cjs +0 -2
- package/dist/nylas-scheduling.entry-8cc5c353.cjs +0 -1
- package/dist/nylas-scheduling.entry-bc00beba.js +0 -424
- package/dist/nylas-time-window-picker.entry-a77c1d67.cjs +0 -1
- package/dist/nylas-time-window-picker.entry-c421303e.js +0 -316
- package/dist/person-icon.entry-36b21e95.cjs +0 -1
- package/dist/play-icon.entry-953b1bc8.js +0 -15
- package/dist/play-icon.entry-c35ade8a.cjs +0 -1
- package/dist/refresh-icon.entry-038501ca.cjs +0 -1
- package/dist/reply-all-icon.entry-ead9d0ba.cjs +0 -1
- package/dist/reply-icon.entry-b7f35ecd.cjs +0 -1
- package/dist/scheduler-config-store-ed4a8dfd-0d4408cf.cjs +0 -1
- package/dist/scheduler-store-dc3a7958-7c73f5e2.js +0 -487
- package/dist/scheduler-store-dc3a7958-99c6bdf6.cjs +0 -1
- package/dist/sent-icon.entry-b662ef5b.cjs +0 -1
- package/dist/sent-icon.entry-ec433cec.js +0 -15
- package/dist/spam-icon.entry-3a553ae4.js +0 -15
- package/dist/spam-icon.entry-a79819fd.cjs +0 -1
- package/dist/star-icon.entry-47ea44e7.cjs +0 -1
- package/dist/stop-icon.entry-26e2e633.cjs +0 -1
- package/dist/textarea-component.entry-6939d0fc.js +0 -38
- package/dist/textarea-component.entry-da0a861e.cjs +0 -1
- package/dist/toggle-switch.entry-5ae5ba46.js +0 -33
- package/dist/toggle-switch.entry-c5fd3e33.cjs +0 -1
- package/dist/translate-icon.entry-72e0369e.cjs +0 -1
- package/dist/trash-fill-icon.entry-815859c6.js +0 -15
- package/dist/trash-fill-icon.entry-8620c28f.cjs +0 -1
- package/dist/underline-icon.entry-ba1a9e87.cjs +0 -1
- package/dist/warning-icon.entry-7cbede6b.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-81719cc6.cjs");require("react");require("react-dom");const a=".sc-info-icon-h{display:flex}",i=a,o=class{constructor(e){t.registerInstance(this,e),this.width="14",this.height="14"}render(){return t.h("svg",{key:"53da1e7144b384f7c1b7aed55e2a31f8cdca2ff4",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"2183e258f3d47e706ddc63dc0f7352d2dfef00d2",fill:"currentColor",d:"M6.5 5.5C6.77614 5.5 7 5.72386 7 6V9C7 9.27614 6.77614 9.5 6.5 9.5C6.22386 9.5 6 9.27614 6 9V6C6 5.72386 6.22386 5.5 6.5 5.5ZM6.50001 4.74907C6.91369 4.74907 7.24905 4.41371 7.24905 4.00003C7.24905 3.58635 6.91369 3.251 6.50001 3.251C6.08633 3.251 5.75098 3.58635 5.75098 4.00003C5.75098 4.41371 6.08633 4.74907 6.50001 4.74907ZM0.5 6.5C0.5 3.18629 3.18629 0.5 6.5 0.5C9.81371 0.5 12.5 3.18629 12.5 6.5C12.5 9.81371 9.81371 12.5 6.5 12.5C3.18629 12.5 0.5 9.81371 0.5 6.5ZM6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5Z"}))}};o.style=i;const s='.tooltip-container{position:relative;display:flex;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.tooltip-content{visibility:hidden;background-color:var(--nylas-base-800);color:var(--nylas-base-0);text-align:left;border-radius:6px;padding:5px 0;position:absolute;z-index:1;opacity:0;transition:opacity 0.3s;padding:0.5rem 1rem;max-width:200px;width:max-content}.tooltip-content.top{bottom:0;left:0;margin-bottom:1.25rem;transform:translateX(-50%)}.tooltip-content.right{top:50%;left:0%;margin-left:1.25rem;transform:translateY(-50%)}.tooltip-content.bottom{top:0;left:0;margin-top:1.25rem;transform:translateX(-50%)}.tooltip-content.left{top:50%;right:0%;margin-right:1.25rem;transform:translateY(-50%)}.tooltip-container:hover .tooltip-content,.tooltip-container:focus-within .tooltip-content{visibility:visible;opacity:1}.tooltip-content::after{content:"";position:absolute;top:-0.75rem;left:50%;transform:rotate(180deg);border-width:6px;border-style:solid;border-color:var(--nylas-base-900) transparent transparent transparent}.tooltip-content.top::after{top:100%;left:50%;transform:rotate(0deg)}.tooltip-content.bottom::after{top:-0.75rem;left:50%;transform:rotate(180deg)}.tooltip-content.left::after{top:47.5%;left:100%;transform:rotate(270deg)}.tooltip-content.right::after{top:47.5%;left:-0.75rem;transform:rotate(90deg)}',r=s,n=class{constructor(e){t.registerInstance(this,e),this.position="bottom"}showTooltip(e){e.target.nextElementSibling.style.visibility="visible",e.target.nextElementSibling.style.opacity="1"}hideTooltip(e){e.target.nextElementSibling.style.visibility="hidden",e.target.nextElementSibling.style.opacity="0"}render(){return t.h("div",{key:"acfdd24e431b6e6d02cb00f3abf0fda0da99e222",class:"tooltip-container",part:"tc__container"},t.h("span",{key:"800c56869b4ededb27a3d431bc08a2952fdc8c1c",class:"info-icon",tabindex:"0",onFocus:this.showTooltip.bind(this),onBlur:this.hideTooltip.bind(this)},t.h("slot",{key:"6c3bcba70194a5ea2daaf64ea67efd8328ebed15",name:"tooltip-icon"},"i")),t.h("span",{key:"535b629363cebfb00bbb9e1082c364f04dedba41",class:`tooltip-content ${this.position}`,part:"tc__content"},t.h("slot",{key:"2f0ec8a2290117d57aa5e795d20932af74e47278",name:"tooltip-content"},"This is a help text.")))}get el(){return t.getElement(this)}};n.style=r;exports.info_icon=o;exports.tooltip_component=n;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { r as o, h as e, g as n } from "./index-7e7c24f1.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const a = ".sc-info-icon-h{display:flex}", i = a, s = class {
|
|
5
|
-
constructor(t) {
|
|
6
|
-
o(this, t), this.width = "14", this.height = "14";
|
|
7
|
-
}
|
|
8
|
-
render() {
|
|
9
|
-
return e("svg", { key: "53da1e7144b384f7c1b7aed55e2a31f8cdca2ff4", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("path", { key: "2183e258f3d47e706ddc63dc0f7352d2dfef00d2", fill: "currentColor", d: "M6.5 5.5C6.77614 5.5 7 5.72386 7 6V9C7 9.27614 6.77614 9.5 6.5 9.5C6.22386 9.5 6 9.27614 6 9V6C6 5.72386 6.22386 5.5 6.5 5.5ZM6.50001 4.74907C6.91369 4.74907 7.24905 4.41371 7.24905 4.00003C7.24905 3.58635 6.91369 3.251 6.50001 3.251C6.08633 3.251 5.75098 3.58635 5.75098 4.00003C5.75098 4.41371 6.08633 4.74907 6.50001 4.74907ZM0.5 6.5C0.5 3.18629 3.18629 0.5 6.5 0.5C9.81371 0.5 12.5 3.18629 12.5 6.5C12.5 9.81371 9.81371 12.5 6.5 12.5C3.18629 12.5 0.5 9.81371 0.5 6.5ZM6.5 1.5C3.73858 1.5 1.5 3.73858 1.5 6.5C1.5 9.26142 3.73858 11.5 6.5 11.5C9.26142 11.5 11.5 9.26142 11.5 6.5C11.5 3.73858 9.26142 1.5 6.5 1.5Z" }));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
s.style = i;
|
|
13
|
-
const r = '.tooltip-container{position:relative;display:flex;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.tooltip-content{visibility:hidden;background-color:var(--nylas-base-800);color:var(--nylas-base-0);text-align:left;border-radius:6px;padding:5px 0;position:absolute;z-index:1;opacity:0;transition:opacity 0.3s;padding:0.5rem 1rem;max-width:200px;width:max-content}.tooltip-content.top{bottom:0;left:0;margin-bottom:1.25rem;transform:translateX(-50%)}.tooltip-content.right{top:50%;left:0%;margin-left:1.25rem;transform:translateY(-50%)}.tooltip-content.bottom{top:0;left:0;margin-top:1.25rem;transform:translateX(-50%)}.tooltip-content.left{top:50%;right:0%;margin-right:1.25rem;transform:translateY(-50%)}.tooltip-container:hover .tooltip-content,.tooltip-container:focus-within .tooltip-content{visibility:visible;opacity:1}.tooltip-content::after{content:"";position:absolute;top:-0.75rem;left:50%;transform:rotate(180deg);border-width:6px;border-style:solid;border-color:var(--nylas-base-900) transparent transparent transparent}.tooltip-content.top::after{top:100%;left:50%;transform:rotate(0deg)}.tooltip-content.bottom::after{top:-0.75rem;left:50%;transform:rotate(180deg)}.tooltip-content.left::after{top:47.5%;left:100%;transform:rotate(270deg)}.tooltip-content.right::after{top:47.5%;left:-0.75rem;transform:rotate(90deg)}', l = r, c = class {
|
|
14
|
-
constructor(t) {
|
|
15
|
-
o(this, t), this.position = "bottom";
|
|
16
|
-
}
|
|
17
|
-
showTooltip(t) {
|
|
18
|
-
t.target.nextElementSibling.style.visibility = "visible", t.target.nextElementSibling.style.opacity = "1";
|
|
19
|
-
}
|
|
20
|
-
hideTooltip(t) {
|
|
21
|
-
t.target.nextElementSibling.style.visibility = "hidden", t.target.nextElementSibling.style.opacity = "0";
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
return e("div", { key: "acfdd24e431b6e6d02cb00f3abf0fda0da99e222", class: "tooltip-container", part: "tc__container" }, e("span", { key: "800c56869b4ededb27a3d431bc08a2952fdc8c1c", class: "info-icon", tabindex: "0", onFocus: this.showTooltip.bind(this), onBlur: this.hideTooltip.bind(this) }, e("slot", { key: "6c3bcba70194a5ea2daaf64ea67efd8328ebed15", name: "tooltip-icon" }, "i")), e("span", { key: "535b629363cebfb00bbb9e1082c364f04dedba41", class: `tooltip-content ${this.position}`, part: "tc__content" }, e("slot", { key: "2f0ec8a2290117d57aa5e795d20932af74e47278", name: "tooltip-content" }, "This is a help text.")));
|
|
25
|
-
}
|
|
26
|
-
get el() {
|
|
27
|
-
return n(this);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
c.style = l;
|
|
31
|
-
export {
|
|
32
|
-
s as info_icon,
|
|
33
|
-
c as tooltip_component
|
|
34
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { r as n, c as o, h as r, g as s } from "./index-7e7c24f1.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const l = ':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}@media screen and (max-width: 768px){:host{position:unset}}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.color-picker-container{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:-moz-available;width:-webkit-fill-available;padding-left:0;gap:0;overflow:hidden}.color-picker-container:focus{outline-color:var(--nylas-primary)}.color-picker-container.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}.color-picker-container.error::placeholder{font-weight:400}.color-picker-container::placeholder{color:var(--nylas-base-300)}.color-picker-container input{display:flex;align-items:center;height:100%;appearance:none;border:none;border-right:1px solid var(--nylas-base-200);background:transparent}.color-picker-container input::-webkit-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container input::-moz-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container.error{border:1px solid var(--nylas-error)}.color-picker-container:hover,.color-picker-container:active{outline:1px solid var(--nylas-primary)}.color-picker-container:active{outline:2px solid var(--nylas-primary)}.color-picker-container label{width:100%}.labelBtn{color:var(--nylas-base-800);padding:14px;font-size:16px;font-family:var(--nylas-font-family);cursor:pointer;display:flex;flex-direction:row;justify-content:space-between;width:100%;gap:0.5rem;background:transparent;border:none}.labelBtn.error{border:1px solid var(--nylas-error)}.labelBtn.focus{background:transparent}.labelBtn:hover,.labelBtn:active{outline:1px solid var(--nylas-primary)}.labelBtn span.chevron{display:flex;align-self:center}.labelBtn span.open{transform:rotate(90deg)}.labelBtn span.closed{transform:rotate(270deg)}.labelBtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px}@media screen and (max-width: 768px){.labelBtn span.selected-option{max-width:124px;font-size:16px}}', t = l, i = class {
|
|
5
|
-
constructor(e) {
|
|
6
|
-
n(this, e), this.nylasFormDropdownChanged = o(this, "nylasFormDropdownChanged", 7), this.componentType = "color-picker", this.name = void 0, this.defaultSelectedColor = void 0, this.selectedColor = this.defaultSelectedColor, this.isOpen = !1, this.ariaActivedescendant = "", this.errorMessage = "";
|
|
7
|
-
}
|
|
8
|
-
componentWillLoad() {
|
|
9
|
-
this.selectedColor = this.defaultSelectedColor, this.el.setAttribute("component-type", this.componentType);
|
|
10
|
-
}
|
|
11
|
-
handleFocus() {
|
|
12
|
-
this.isOpen = !0;
|
|
13
|
-
}
|
|
14
|
-
handleBlur() {
|
|
15
|
-
this.isOpen = !1;
|
|
16
|
-
}
|
|
17
|
-
handleInput(e) {
|
|
18
|
-
this.selectedColor = e.target.value;
|
|
19
|
-
}
|
|
20
|
-
handleChange(e) {
|
|
21
|
-
this.selectedColor = e.target.value, this.nylasFormDropdownChanged.emit({
|
|
22
|
-
value: this.selectedColor,
|
|
23
|
-
name: this.name,
|
|
24
|
-
error: this.errorMessage
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
handleKeyDown(e) {
|
|
28
|
-
var a;
|
|
29
|
-
(e.code === "Enter" || e.code === "Space") && (e.preventDefault(), (a = this.inputRef) == null || a.click());
|
|
30
|
-
}
|
|
31
|
-
handleOutsideClick(e) {
|
|
32
|
-
!e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
return r("div", { key: "145dabea01809c210829fc3cdc4882793b38a154", class: "color-picker-container", part: "icp_color-picker", tabindex: "0", onKeyDown: (e) => this.handleKeyDown(e) }, r("input", { key: "4ee61547ce9d051d2066fdcbcb1ebd048a8444cf", type: "color", ref: (e) => this.inputRef = e, id: this.name, name: this.name, value: this.selectedColor, tabindex: "-1", onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur(), onInput: (e) => this.handleInput(e), onChange: (e) => this.handleChange(e), onKeyDown: (e) => this.handleKeyDown(e) }), r("label", { key: "9473f60a27db4bb073c740df461ea2f276890ddb", part: "icp_color-picker-button", htmlFor: this.name, class: { labelBtn: !0, open: this.isOpen, error: !!this.errorMessage }, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? "true" : "false", "aria-label": this.name }, r("span", { key: "3e10c11d8dae028ca965da307f06a51c6c71cf40", class: "selected-option", part: "icp_color-picker-button-selected-label" }, this.selectedColor || "Select a color"), r("span", { key: "bfbe7728225a7e6203189ae4da06fc4abf4f4ec4", class: {
|
|
36
|
-
open: this.isOpen,
|
|
37
|
-
closed: !this.isOpen,
|
|
38
|
-
chevron: !0
|
|
39
|
-
}, "aria-hidden": "true" }, r("chevron-icon", { key: "99d0dc5de95436ef6ca79421026debda57c32390", width: "16", height: "16" })), this.errorMessage && r("span", { class: "error help-text" }, this.errorMessage)));
|
|
40
|
-
}
|
|
41
|
-
get el() {
|
|
42
|
-
return s(this);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
i.style = t;
|
|
46
|
-
export {
|
|
47
|
-
i as input_color_picker
|
|
48
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-81719cc6.cjs");require("react");require("react-dom");const o=':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}@media screen and (max-width: 768px){:host{position:unset}}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.color-picker-container{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:-moz-available;width:-webkit-fill-available;padding-left:0;gap:0;overflow:hidden}.color-picker-container:focus{outline-color:var(--nylas-primary)}.color-picker-container.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}.color-picker-container.error::placeholder{font-weight:400}.color-picker-container::placeholder{color:var(--nylas-base-300)}.color-picker-container input{display:flex;align-items:center;height:100%;appearance:none;border:none;border-right:1px solid var(--nylas-base-200);background:transparent}.color-picker-container input::-webkit-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container input::-moz-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container.error{border:1px solid var(--nylas-error)}.color-picker-container:hover,.color-picker-container:active{outline:1px solid var(--nylas-primary)}.color-picker-container:active{outline:2px solid var(--nylas-primary)}.color-picker-container label{width:100%}.labelBtn{color:var(--nylas-base-800);padding:14px;font-size:16px;font-family:var(--nylas-font-family);cursor:pointer;display:flex;flex-direction:row;justify-content:space-between;width:100%;gap:0.5rem;background:transparent;border:none}.labelBtn.error{border:1px solid var(--nylas-error)}.labelBtn.focus{background:transparent}.labelBtn:hover,.labelBtn:active{outline:1px solid var(--nylas-primary)}.labelBtn span.chevron{display:flex;align-self:center}.labelBtn span.open{transform:rotate(90deg)}.labelBtn span.closed{transform:rotate(270deg)}.labelBtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px}@media screen and (max-width: 768px){.labelBtn span.selected-option{max-width:124px;font-size:16px}}',l=o,n=class{constructor(e){r.registerInstance(this,e),this.nylasFormDropdownChanged=r.createEvent(this,"nylasFormDropdownChanged",7),this.componentType="color-picker",this.name=void 0,this.defaultSelectedColor=void 0,this.selectedColor=this.defaultSelectedColor,this.isOpen=!1,this.ariaActivedescendant="",this.errorMessage=""}componentWillLoad(){this.selectedColor=this.defaultSelectedColor,this.el.setAttribute("component-type",this.componentType)}handleFocus(){this.isOpen=!0}handleBlur(){this.isOpen=!1}handleInput(e){this.selectedColor=e.target.value}handleChange(e){this.selectedColor=e.target.value,this.nylasFormDropdownChanged.emit({value:this.selectedColor,name:this.name,error:this.errorMessage})}handleKeyDown(e){var a;(e.code==="Enter"||e.code==="Space")&&(e.preventDefault(),(a=this.inputRef)==null||a.click())}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.isOpen&&(this.isOpen=!1)}render(){return r.h("div",{key:"145dabea01809c210829fc3cdc4882793b38a154",class:"color-picker-container",part:"icp_color-picker",tabindex:"0",onKeyDown:e=>this.handleKeyDown(e)},r.h("input",{key:"4ee61547ce9d051d2066fdcbcb1ebd048a8444cf",type:"color",ref:e=>this.inputRef=e,id:this.name,name:this.name,value:this.selectedColor,tabindex:"-1",onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur(),onInput:e=>this.handleInput(e),onChange:e=>this.handleChange(e),onKeyDown:e=>this.handleKeyDown(e)}),r.h("label",{key:"9473f60a27db4bb073c740df461ea2f276890ddb",part:"icp_color-picker-button",htmlFor:this.name,class:{labelBtn:!0,open:this.isOpen,error:!!this.errorMessage},"aria-haspopup":"listbox","aria-expanded":this.isOpen?"true":"false","aria-label":this.name},r.h("span",{key:"3e10c11d8dae028ca965da307f06a51c6c71cf40",class:"selected-option",part:"icp_color-picker-button-selected-label"},this.selectedColor||"Select a color"),r.h("span",{key:"bfbe7728225a7e6203189ae4da06fc4abf4f4ec4",class:{open:this.isOpen,closed:!this.isOpen,chevron:!0},"aria-hidden":"true"},r.h("chevron-icon",{key:"99d0dc5de95436ef6ca79421026debda57c32390",width:"16",height:"16"})),this.errorMessage&&r.h("span",{class:"error help-text"},this.errorMessage)))}get el(){return r.getElement(this)}};n.style=l;exports.input_color_picker=n;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-81719cc6.cjs");require("react");require("react-dom");const s=':host{display:block;height:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.input_wrapper{display:flex;align-items:center;gap:1rem}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:-moz-available;width:-webkit-fill-available}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}input:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}',l=s,i={email:/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,phone_number:/^\+?\d{1,15}$/},n={email:"name@example.com",phone_number:"1234567890"},r=class{constructor(t){e.registerInstance(this,t),this.nylasFormInputChanged=e.createEvent(this,"nylasFormInputChanged",7),this.nylasFormInputFocused=e.createEvent(this,"nylasFormInputFocused",7),this.nylasFormInputBlurred=e.createEvent(this,"nylasFormInputBlurred",7),this.name="input",this.defaultValue=void 0,this.label="",this.type="text",this.placeholder=n[this.type],this.required=!1,this.readOnly=!1,this.autoFocus=!1,this.pattern=void 0,this.maxLength=255,this.patternError="",this.requiredError="",this.value=void 0,this.error=""}handleDefaultValueChange(t){this.value=e.sanitize(t),this.value&&this.validatePattern(this.value)}componentDidLoad(){this.value=e.sanitize(this.defaultValue||""),this.type!=="text"&&!this.pattern&&(this.pattern=i[this.type]),this.value&&this.validatePattern(this.value)}handleBookingFormSubmitted(t){this.validatePattern(this.value),this.error&&t.preventDefault()}async handleFormSubmitted(t){var a;(a=this.el)!=null&&a.getAttribute("data-page-styling")&&(this.validatePattern(this.value),this.error&&t.preventDefault())}handleInput(t){this.error="",this.value=e.sanitize(t.target.value),this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:this.type})}handleBlur(){this.nylasFormInputBlurred.emit({value:this.value,name:this.name})}handleFocus(){this.nylasFormInputFocused.emit({value:this.value,name:this.name})}validatePattern(t){if(this.error="",this.required&&!t){this.error=this.requiredError||"This field is required.";return}!this.pattern||!t&&!this.required||(this.pattern.test(t)?this.error="":this.error=this.patternError||"Invalid format.")}render(){return e.h("label",{key:"207cb06847b7a045c4917180affc535169b55596",part:"ic__label",class:{error:!!this.error}},this.label&&e.h("p",null,e.h("span",{class:"label"},this.label),this.required&&e.h("span",{class:"required"},"*")),e.h("div",{key:"8da4d52acd543376116d9851df43eb54b3e3fec1",part:"ic__input_wrapper",class:"input_wrapper"},e.h("input",{key:"5b70b302aae8638e389cc68075abd8ea15475942",type:"text",name:this.name,part:"ic__input",title:this.readOnly?"read-only field":void 0,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,maxLength:this.maxLength,placeholder:this.placeholder,class:{error:!!this.error},onInput:t=>this.handleInput(t),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),e.h("slot",{key:"1d6c53c9e3527909078cbca14e23b748f1ca3fb7",name:"additional-input"})),this.error&&e.h("span",{class:"error help-text"},this.error))}get el(){return e.getElement(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};r.style=l;exports.input_component=r;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { r as l, c as t, t as r, h as a, g as i } from "./index-7e7c24f1.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const n = ':host{display:block;height:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.input_wrapper{display:flex;align-items:center;gap:1rem}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:-moz-available;width:-webkit-fill-available}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}input:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}', o = n, h = {
|
|
5
|
-
email: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,
|
|
6
|
-
phone_number: /^\+?\d{1,15}$/
|
|
7
|
-
}, u = {
|
|
8
|
-
email: "name@example.com",
|
|
9
|
-
phone_number: "1234567890"
|
|
10
|
-
}, d = class {
|
|
11
|
-
constructor(e) {
|
|
12
|
-
l(this, e), this.nylasFormInputChanged = t(this, "nylasFormInputChanged", 7), this.nylasFormInputFocused = t(this, "nylasFormInputFocused", 7), this.nylasFormInputBlurred = t(this, "nylasFormInputBlurred", 7), this.name = "input", this.defaultValue = void 0, this.label = "", this.type = "text", this.placeholder = u[this.type], this.required = !1, this.readOnly = !1, this.autoFocus = !1, this.pattern = void 0, this.maxLength = 255, this.patternError = "", this.requiredError = "", this.value = void 0, this.error = "";
|
|
13
|
-
}
|
|
14
|
-
handleDefaultValueChange(e) {
|
|
15
|
-
this.value = r(e), this.value && this.validatePattern(this.value);
|
|
16
|
-
}
|
|
17
|
-
componentDidLoad() {
|
|
18
|
-
this.value = r(this.defaultValue || ""), this.type !== "text" && !this.pattern && (this.pattern = h[this.type]), this.value && this.validatePattern(this.value);
|
|
19
|
-
}
|
|
20
|
-
handleBookingFormSubmitted(e) {
|
|
21
|
-
this.validatePattern(this.value), this.error && e.preventDefault();
|
|
22
|
-
}
|
|
23
|
-
async handleFormSubmitted(e) {
|
|
24
|
-
var s;
|
|
25
|
-
(s = this.el) != null && s.getAttribute("data-page-styling") && (this.validatePattern(this.value), this.error && e.preventDefault());
|
|
26
|
-
}
|
|
27
|
-
handleInput(e) {
|
|
28
|
-
this.error = "", this.value = r(e.target.value), this.nylasFormInputChanged.emit({
|
|
29
|
-
value: this.value,
|
|
30
|
-
name: this.name,
|
|
31
|
-
label: this.label,
|
|
32
|
-
error: this.error,
|
|
33
|
-
type: this.type
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
handleBlur() {
|
|
37
|
-
this.nylasFormInputBlurred.emit({
|
|
38
|
-
value: this.value,
|
|
39
|
-
name: this.name
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
handleFocus() {
|
|
43
|
-
this.nylasFormInputFocused.emit({
|
|
44
|
-
value: this.value,
|
|
45
|
-
name: this.name
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
validatePattern(e) {
|
|
49
|
-
if (this.error = "", this.required && !e) {
|
|
50
|
-
this.error = this.requiredError || "This field is required.";
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
!this.pattern || !e && !this.required || (this.pattern.test(e) ? this.error = "" : this.error = this.patternError || "Invalid format.");
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
return a("label", { key: "207cb06847b7a045c4917180affc535169b55596", part: "ic__label", class: { error: !!this.error } }, this.label && a("p", null, a("span", { class: "label" }, this.label), this.required && a("span", { class: "required" }, "*")), a("div", { key: "8da4d52acd543376116d9851df43eb54b3e3fec1", part: "ic__input_wrapper", class: "input_wrapper" }, a("input", { key: "5b70b302aae8638e389cc68075abd8ea15475942", type: "text", name: this.name, part: "ic__input", title: this.readOnly ? "read-only field" : void 0, readOnly: this.readOnly, autoFocus: this.autoFocus, value: this.value, maxLength: this.maxLength, placeholder: this.placeholder, class: { error: !!this.error }, onInput: (e) => this.handleInput(e), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }), a("slot", { key: "1d6c53c9e3527909078cbca14e23b748f1ca3fb7", name: "additional-input" })), this.error && a("span", { class: "error help-text" }, this.error));
|
|
57
|
-
}
|
|
58
|
-
get el() {
|
|
59
|
-
return i(this);
|
|
60
|
-
}
|
|
61
|
-
static get watchers() {
|
|
62
|
-
return {
|
|
63
|
-
defaultValue: ["handleDefaultValueChange"]
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
d.style = o;
|
|
68
|
-
export {
|
|
69
|
-
d as input_component
|
|
70
|
-
};
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { r as l, c as p, h as n, g as c, d as a } from "./index-7e7c24f1.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const h = ':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{position:unset}}.dropdown{display:inline-block}.dropbtn{color:var(--nylas-base-800);padding:10px;font-size:16px;font-family:var(--nylas-font-family);cursor:pointer;display:flex;gap:0.5rem;background:transparent;border:none;border-radius:var(--nylas-border-radius-2x);width:50px;padding:14px 16px;border-radius:var(--nylas-border-radius-2x)}.dropbtn.focus{background:transparent}.dropbtn:hover,.dropbtn:active{outline:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn span.chevron{display:flex;align-self:center}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropbtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px}@media screen and (max-width: 768px){.dropbtn span.selected-option{max-width:124px;font-size:16px}}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);max-width:306px;width:max-content;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1)}@media screen and (max-width: 768px){.dropdown-content{right:0;width:325px;max-width:unset}}.search-box{border-bottom:1px solid var(--nylas-base-200);padding:10px;position:sticky;top:0;background:var(--nylas-base-0)}.search-box .icon{position:absolute;top:1.25rem;left:1.25rem;color:var(--nylas-base-300)}.dropdown-content ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.dropdown-content ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.dropdown-content ul li:hover,.dropdown-content ul li:focus{background-color:var(--nylas-base-100)}.dropdown-content .selected{background-color:#e7e7e7}input[type=text]{width:-webkit-fill-available;padding:inherit;border:1px solid #ccc;border-radius:4px;position:sticky;background:no-repeat scroll 7px 7px;padding-left:30px;background-size:16px 16px}', u = h, m = class {
|
|
5
|
-
constructor(e) {
|
|
6
|
-
l(this, e), this.inputOptionChanged = p(this, "inputOptionChanged", 7), this.name = void 0, this.options = [], this.defaultInputOption = void 0, this.inputValue = void 0, this.pluralizedLabel = "", this.filterable = !1, this.selectedOption = this.defaultInputOption || null, this.isOpen = !1, this.typedValue = "", this.filteredOptions = [...this.options], this.ariaActivedescendant = "", this.shouldAutoScroll = !1;
|
|
7
|
-
}
|
|
8
|
-
optionsChangedHandler(e, t) {
|
|
9
|
-
e !== t && (this.filteredOptions = this.getFilteredOptions(e));
|
|
10
|
-
}
|
|
11
|
-
defaultSelectedOptionChangedHandler(e, t) {
|
|
12
|
-
(e == null ? void 0 : e.label) !== (t == null ? void 0 : t.label) && (this.selectedOption = e);
|
|
13
|
-
}
|
|
14
|
-
inputValueChangedHandler(e, t) {
|
|
15
|
-
e !== t && (this.filteredOptions = this.getFilteredOptions(this.options));
|
|
16
|
-
}
|
|
17
|
-
componentWillLoad() {
|
|
18
|
-
this.filteredOptions = this.getFilteredOptions(this.options), !this.selectedOption && this.defaultInputOption && (this.selectedOption = this.defaultInputOption), !this.selectedOption && this.options.length > 0 && (this.selectedOption = this.options[0]);
|
|
19
|
-
}
|
|
20
|
-
getFilteredOptions(e) {
|
|
21
|
-
return this.filterable ? e.filter((t) => {
|
|
22
|
-
var i, s, r, o;
|
|
23
|
-
return ((s = t == null ? void 0 : t.value) == null ? void 0 : s.toString().toLowerCase().includes((i = this.typedValue) == null ? void 0 : i.toLowerCase())) || ((o = t == null ? void 0 : t.label) == null ? void 0 : o.toLowerCase().includes((r = this.typedValue) == null ? void 0 : r.toLowerCase()));
|
|
24
|
-
}) : e;
|
|
25
|
-
}
|
|
26
|
-
toggleDropdown() {
|
|
27
|
-
this.isOpen = !this.isOpen;
|
|
28
|
-
}
|
|
29
|
-
selectOption(e) {
|
|
30
|
-
this.selectedOption = e, this.toggleDropdown(), this.inputOptionChanged.emit({
|
|
31
|
-
value: e.value,
|
|
32
|
-
name: this.name
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
handleOnInput(e) {
|
|
36
|
-
const t = e.target.value;
|
|
37
|
-
this.typedValue = t;
|
|
38
|
-
const i = this.options.findIndex((s) => s.label.toLowerCase().includes(t.toLowerCase()));
|
|
39
|
-
i > -1 && this.scrollToViewWithinParent(i), this.inputOptionChanged.emit({
|
|
40
|
-
value: t,
|
|
41
|
-
name: this.name
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
scrollToViewWithinParent(e) {
|
|
45
|
-
var d;
|
|
46
|
-
const t = this.options[e], i = (d = this.el.shadowRoot) == null ? void 0 : d.getElementById(t.value.toString()), s = this.optionsRef;
|
|
47
|
-
if (this.ariaActivedescendant = t.value.toString(), !i || !s)
|
|
48
|
-
return;
|
|
49
|
-
const r = i.getBoundingClientRect(), o = s.getBoundingClientRect();
|
|
50
|
-
r.top < o.top ? s.scrollTop -= o.top - r.top : r.bottom > o.bottom && (s.scrollTop += r.bottom - o.bottom);
|
|
51
|
-
}
|
|
52
|
-
handleSelectButtonKeyDown(e) {
|
|
53
|
-
var t;
|
|
54
|
-
switch (e.key) {
|
|
55
|
-
case "ArrowDown":
|
|
56
|
-
case "Enter":
|
|
57
|
-
e.preventDefault(), this.isOpen || this.toggleDropdown(), (t = this.inputRef) == null || t.focus();
|
|
58
|
-
break;
|
|
59
|
-
case "Escape":
|
|
60
|
-
this.isOpen = !1;
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
handleClick(e) {
|
|
65
|
-
if (this.isOpen) {
|
|
66
|
-
const t = e.target.value, i = this.options.findIndex((s) => s.label.toLowerCase().includes(t.toLowerCase()));
|
|
67
|
-
i > -1 && setTimeout(() => {
|
|
68
|
-
this.scrollToViewWithinParent(i);
|
|
69
|
-
}, 10);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
handleListboxKeydown(e) {
|
|
73
|
-
var s, r;
|
|
74
|
-
const t = this.filteredOptions, i = t.findIndex((o) => o.value === this.ariaActivedescendant);
|
|
75
|
-
if (e.key === "ArrowDown" || e.key === "Tab" && !e.shiftKey) {
|
|
76
|
-
if (e.preventDefault(), i === t.length - 1) {
|
|
77
|
-
this.ariaActivedescendant = "", (s = this.inputRef) == null || s.focus();
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const o = i + 1 < t.length ? i + 1 : 0;
|
|
81
|
-
this.ariaActivedescendant = t[o].value, this.focusOption(o);
|
|
82
|
-
} else if (e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey) {
|
|
83
|
-
if (e.preventDefault(), i === 0) {
|
|
84
|
-
this.ariaActivedescendant = "", (r = this.inputRef) == null || r.focus();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const o = i - 1 >= 0 ? i - 1 : t.length - 1;
|
|
88
|
-
this.ariaActivedescendant = t[o].value, this.focusOption(o);
|
|
89
|
-
} else
|
|
90
|
-
e.key === "Enter" ? (e.preventDefault(), this.ariaActivedescendant && this.selectOption(t[i])) : e.key === "Escape" && (this.isOpen = !1);
|
|
91
|
-
}
|
|
92
|
-
focusOption(e) {
|
|
93
|
-
var r;
|
|
94
|
-
const t = this.filteredOptions[e];
|
|
95
|
-
if (!t)
|
|
96
|
-
return;
|
|
97
|
-
const i = t.value, s = (r = this.el.shadowRoot) == null ? void 0 : r.getElementById(i);
|
|
98
|
-
s && (s.focus(), s.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
99
|
-
}
|
|
100
|
-
handleComboboxKeyDown(e) {
|
|
101
|
-
if (e.key === "ArrowDown" || e.key == "Tab" && !e.shiftKey) {
|
|
102
|
-
if (e.preventDefault(), !this.isOpen) {
|
|
103
|
-
this.isOpen = !0, this.shouldAutoScroll = !0;
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
this.ariaActivedescendant = this.filteredOptions[0].value, this.focusOption(0);
|
|
107
|
-
} else
|
|
108
|
-
e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey ? (e.preventDefault(), this.ariaActivedescendant = this.filteredOptions[this.filteredOptions.length - 1].value, this.focusOption(this.filteredOptions.length - 1)) : e.key === "Escape" && (this.isOpen = !1);
|
|
109
|
-
}
|
|
110
|
-
handleOutsideClick(e) {
|
|
111
|
-
!e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
|
|
112
|
-
}
|
|
113
|
-
render() {
|
|
114
|
-
return n("div", { key: "fa0347bf09ec791976c3628837a400ffce06f785", class: "dropdown", part: "id_dropdown" }, n("input", { key: "d18704609aa859f705397ca57a0d491a8f09ed99", type: "text", name: this.name, id: this.name, part: "id_dropdown-input", class: { dropbtn: !0, open: this.isOpen }, value: this.inputValue, onClick: (e) => {
|
|
115
|
-
this.toggleDropdown(), this.shouldAutoScroll = !0, this.handleClick(e);
|
|
116
|
-
}, "aria-haspopup": "listbox", "aria-label": this.name, "aria-expanded": this.isOpen ? "true" : "false", onKeyDown: (e) => this.handleComboboxKeyDown(e), onInput: (e) => this.handleOnInput(e) }), this.isOpen ? n("div", { class: "dropdown-content", part: "id_dropdown-content", ref: (e) => this.optionsRef = e }, n("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (e) => this.handleListboxKeydown(e) }, this.filteredOptions.map((e) => n("li", { tabindex: "0", key: e.value, id: e.value, onClick: () => this.selectOption(e), role: "option", class: {
|
|
117
|
-
focused: this.ariaActivedescendant === e.value.toString()
|
|
118
|
-
} }, e.labelHTML ? e.labelHTML : e.label)))) : null);
|
|
119
|
-
}
|
|
120
|
-
get el() {
|
|
121
|
-
return c(this);
|
|
122
|
-
}
|
|
123
|
-
static get watchers() {
|
|
124
|
-
return {
|
|
125
|
-
options: ["optionsChangedHandler"],
|
|
126
|
-
defaultInputOption: ["defaultSelectedOptionChangedHandler"],
|
|
127
|
-
inputValue: ["inputValueChangedHandler"]
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
m.style = u;
|
|
132
|
-
const b = ".time-period-selector.sc-time-period-selector{display:grid;gap:0.5rem;grid-template-columns:auto 1fr}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector,.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector{width:116px}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector{width:84px;display:flex;align-items:center}.time-period-selector.sc-time-period-selector select-dropdown#time-period.sc-time-period-selector::part(sd_dropdown-button){width:100%}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown){width:inherit;height:100%}.time-period-selector.sc-time-period-selector input-dropdown#time-number.sc-time-period-selector::part(id_dropdown-input){border:none;border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector input-dropdown#time-number.error.sc-time-period-selector::part(id_dropdown-input){border:1px solid var(--nylas-error)}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown-input){padding:17px;gap:1rem}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown-content){width:100%;max-height:200px}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown){width:inherit;height:100%}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown_label){height:100%}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-button){padding:1rem;gap:1rem;justify-content:space-between;border:none;align-items:center;height:100%}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-content){width:100%;max-height:200px}", f = b, g = {
|
|
133
|
-
hours: "hour",
|
|
134
|
-
days: "day",
|
|
135
|
-
weeks: "week",
|
|
136
|
-
months: "month"
|
|
137
|
-
}, w = class {
|
|
138
|
-
constructor(e) {
|
|
139
|
-
l(this, e), this.timePeriodChanged = p(this, "timePeriodChanged", 7), this.timePeriods = ["hour", "day", "week", "month"], this.defaultSelectedPeriod = void 0, this.defaultSelectedNumber = void 0, this.hasError = !1, this.selectedPeriod = this.defaultSelectedPeriod, this.selectedNumber = this.defaultSelectedNumber, this.numberOptions = this.calculateOptions(this.defaultSelectedPeriod || "hour").map((t) => ({
|
|
140
|
-
label: t.toString(),
|
|
141
|
-
value: t.toString()
|
|
142
|
-
})), this.timePeriodOptions = this.timePeriods.map((t) => ({
|
|
143
|
-
label: t,
|
|
144
|
-
value: t
|
|
145
|
-
}));
|
|
146
|
-
}
|
|
147
|
-
defaultSelectedPeriodChanged(e) {
|
|
148
|
-
this.selectedPeriod = e, this.updateNumberOptionsAndSelectedNumber(e);
|
|
149
|
-
}
|
|
150
|
-
defaultSelectedNumberChanged(e) {
|
|
151
|
-
this.selectedNumber = e;
|
|
152
|
-
}
|
|
153
|
-
timePeriodsChanged(e) {
|
|
154
|
-
this.timePeriodOptions = e.map((t) => ({
|
|
155
|
-
label: t,
|
|
156
|
-
value: t
|
|
157
|
-
}));
|
|
158
|
-
}
|
|
159
|
-
componentDidLoad() {
|
|
160
|
-
this.selectedNumber = this.defaultSelectedNumber, this.selectedPeriod = this.defaultSelectedPeriod;
|
|
161
|
-
const e = g[this.selectedPeriod] ?? this.selectedPeriod, t = this.calculateOptions(e);
|
|
162
|
-
this.numberOptions = t.map((i) => ({
|
|
163
|
-
label: i.toString(),
|
|
164
|
-
value: i.toString()
|
|
165
|
-
}));
|
|
166
|
-
}
|
|
167
|
-
calculateOptions(e) {
|
|
168
|
-
switch (e) {
|
|
169
|
-
case "hour":
|
|
170
|
-
return Array.from({ length: 23 }, (t, i) => i + 1);
|
|
171
|
-
case "minute":
|
|
172
|
-
return Array.from({ length: 13 }, (t, i) => i * 5);
|
|
173
|
-
case "day":
|
|
174
|
-
return Array.from({ length: 30 }, (t, i) => i + 1);
|
|
175
|
-
case "week":
|
|
176
|
-
return Array.from({ length: 4 }, (t, i) => i + 1);
|
|
177
|
-
case "month":
|
|
178
|
-
return Array.from({ length: 12 }, (t, i) => i + 1);
|
|
179
|
-
default:
|
|
180
|
-
return [];
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
inputOptionChangedHandler(e) {
|
|
184
|
-
a("time-period-selector", "inputOptionChangedHandler", e.detail);
|
|
185
|
-
const { value: t, name: i } = e.detail;
|
|
186
|
-
i === "time-number" && (this.selectedNumber = t ? parseInt(t) : this.defaultSelectedNumber);
|
|
187
|
-
const s = {
|
|
188
|
-
number: this.selectedNumber,
|
|
189
|
-
period: this.selectedPeriod
|
|
190
|
-
};
|
|
191
|
-
this.timePeriodChanged.emit(s);
|
|
192
|
-
}
|
|
193
|
-
nylasFormDropdownChangedHandler(e) {
|
|
194
|
-
a("time-period-selector", "nylasFormDropdownChangedHandler", e.detail);
|
|
195
|
-
const { value: t, name: i } = e.detail;
|
|
196
|
-
i === "time-period" ? (this.selectedPeriod = t, this.updateNumberOptionsAndSelectedNumber(t)) : i === "time-number" && (this.selectedNumber = parseInt(t));
|
|
197
|
-
const s = {
|
|
198
|
-
number: this.selectedNumber,
|
|
199
|
-
period: this.selectedPeriod
|
|
200
|
-
};
|
|
201
|
-
this.timePeriodChanged.emit(s);
|
|
202
|
-
}
|
|
203
|
-
updateNumberOptionsAndSelectedNumber(e) {
|
|
204
|
-
const t = this.calculateOptions(e);
|
|
205
|
-
this.numberOptions = t.map((i) => ({
|
|
206
|
-
label: i.toString(),
|
|
207
|
-
value: i.toString()
|
|
208
|
-
}));
|
|
209
|
-
}
|
|
210
|
-
render() {
|
|
211
|
-
return n("div", { key: "a00bd6849a2c62843e298d153e20230f4a0d2c62", class: "time-period-selector" }, typeof this.selectedNumber == "number" && n("input-dropdown", { id: "time-number", name: "time-number", class: { error: this.hasError }, inputValue: this.selectedNumber.toString(), exportparts: "id_dropdown: tps__number-dropdown, id_dropdown-input: tps__number-dropdown-button, id_dropdown-content: tps__number-dropdown-content", options: this.numberOptions, defaultInputOption: this.numberOptions.find((e) => e.value == this.selectedNumber.toString()) }), typeof this.selectedPeriod == "string" && n("select-dropdown", { id: "time-period", name: "time-period", options: this.timePeriodOptions, exportparts: "sd_dropdown: tps__period-dropdown, sd_dropdown-button: tps__period-dropdown-button, sd_dropdown-content: tps__period-dropdown-content", pluralizedLabel: this.selectedNumber > 1 ? "s" : "", defaultSelectedOption: this.timePeriodOptions.find((e) => e.value == this.selectedPeriod), withSearch: !1 }));
|
|
212
|
-
}
|
|
213
|
-
get host() {
|
|
214
|
-
return c(this);
|
|
215
|
-
}
|
|
216
|
-
static get watchers() {
|
|
217
|
-
return {
|
|
218
|
-
defaultSelectedPeriod: ["defaultSelectedPeriodChanged"],
|
|
219
|
-
defaultSelectedNumber: ["defaultSelectedNumberChanged"],
|
|
220
|
-
timePeriods: ["timePeriodsChanged"]
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
w.style = f;
|
|
225
|
-
export {
|
|
226
|
-
m as input_dropdown,
|
|
227
|
-
w as time_period_selector
|
|
228
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-81719cc6.cjs");require("react");require("react-dom");const p=':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{position:unset}}.dropdown{display:inline-block}.dropbtn{color:var(--nylas-base-800);padding:10px;font-size:16px;font-family:var(--nylas-font-family);cursor:pointer;display:flex;gap:0.5rem;background:transparent;border:none;border-radius:var(--nylas-border-radius-2x);width:50px;padding:14px 16px;border-radius:var(--nylas-border-radius-2x)}.dropbtn.focus{background:transparent}.dropbtn:hover,.dropbtn:active{outline:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn span.chevron{display:flex;align-self:center}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropbtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px}@media screen and (max-width: 768px){.dropbtn span.selected-option{max-width:124px;font-size:16px}}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);max-width:306px;width:max-content;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1)}@media screen and (max-width: 768px){.dropdown-content{right:0;width:325px;max-width:unset}}.search-box{border-bottom:1px solid var(--nylas-base-200);padding:10px;position:sticky;top:0;background:var(--nylas-base-0)}.search-box .icon{position:absolute;top:1.25rem;left:1.25rem;color:var(--nylas-base-300)}.dropdown-content ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.dropdown-content ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.dropdown-content ul li:hover,.dropdown-content ul li:focus{background-color:var(--nylas-base-100)}.dropdown-content .selected{background-color:#e7e7e7}input[type=text]{width:-webkit-fill-available;padding:inherit;border:1px solid #ccc;border-radius:4px;position:sticky;background:no-repeat scroll 7px 7px;padding-left:30px;background-size:16px 16px}',c=p,a=class{constructor(e){s.registerInstance(this,e),this.inputOptionChanged=s.createEvent(this,"inputOptionChanged",7),this.name=void 0,this.options=[],this.defaultInputOption=void 0,this.inputValue=void 0,this.pluralizedLabel="",this.filterable=!1,this.selectedOption=this.defaultInputOption||null,this.isOpen=!1,this.typedValue="",this.filteredOptions=[...this.options],this.ariaActivedescendant="",this.shouldAutoScroll=!1}optionsChangedHandler(e,t){e!==t&&(this.filteredOptions=this.getFilteredOptions(e))}defaultSelectedOptionChangedHandler(e,t){(e==null?void 0:e.label)!==(t==null?void 0:t.label)&&(this.selectedOption=e)}inputValueChangedHandler(e,t){e!==t&&(this.filteredOptions=this.getFilteredOptions(this.options))}componentWillLoad(){this.filteredOptions=this.getFilteredOptions(this.options),!this.selectedOption&&this.defaultInputOption&&(this.selectedOption=this.defaultInputOption),!this.selectedOption&&this.options.length>0&&(this.selectedOption=this.options[0])}getFilteredOptions(e){return this.filterable?e.filter(t=>{var i,o,n,r;return((o=t==null?void 0:t.value)==null?void 0:o.toString().toLowerCase().includes((i=this.typedValue)==null?void 0:i.toLowerCase()))||((r=t==null?void 0:t.label)==null?void 0:r.toLowerCase().includes((n=this.typedValue)==null?void 0:n.toLowerCase()))}):e}toggleDropdown(){this.isOpen=!this.isOpen}selectOption(e){this.selectedOption=e,this.toggleDropdown(),this.inputOptionChanged.emit({value:e.value,name:this.name})}handleOnInput(e){const t=e.target.value;this.typedValue=t;const i=this.options.findIndex(o=>o.label.toLowerCase().includes(t.toLowerCase()));i>-1&&this.scrollToViewWithinParent(i),this.inputOptionChanged.emit({value:t,name:this.name})}scrollToViewWithinParent(e){var d;const t=this.options[e],i=(d=this.el.shadowRoot)==null?void 0:d.getElementById(t.value.toString()),o=this.optionsRef;if(this.ariaActivedescendant=t.value.toString(),!i||!o)return;const n=i.getBoundingClientRect(),r=o.getBoundingClientRect();n.top<r.top?o.scrollTop-=r.top-n.top:n.bottom>r.bottom&&(o.scrollTop+=n.bottom-r.bottom)}handleSelectButtonKeyDown(e){var t;switch(e.key){case"ArrowDown":case"Enter":e.preventDefault(),this.isOpen||this.toggleDropdown(),(t=this.inputRef)==null||t.focus();break;case"Escape":this.isOpen=!1;break}}handleClick(e){if(this.isOpen){const t=e.target.value,i=this.options.findIndex(o=>o.label.toLowerCase().includes(t.toLowerCase()));i>-1&&setTimeout(()=>{this.scrollToViewWithinParent(i)},10)}}handleListboxKeydown(e){var o,n;const t=this.filteredOptions,i=t.findIndex(r=>r.value===this.ariaActivedescendant);if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){if(e.preventDefault(),i===t.length-1){this.ariaActivedescendant="",(o=this.inputRef)==null||o.focus();return}const r=i+1<t.length?i+1:0;this.ariaActivedescendant=t[r].value,this.focusOption(r)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){if(e.preventDefault(),i===0){this.ariaActivedescendant="",(n=this.inputRef)==null||n.focus();return}const r=i-1>=0?i-1:t.length-1;this.ariaActivedescendant=t[r].value,this.focusOption(r)}else e.key==="Enter"?(e.preventDefault(),this.ariaActivedescendant&&this.selectOption(t[i])):e.key==="Escape"&&(this.isOpen=!1)}focusOption(e){var n;const t=this.filteredOptions[e];if(!t)return;const i=t.value,o=(n=this.el.shadowRoot)==null?void 0:n.getElementById(i);o&&(o.focus(),o.scrollIntoView({behavior:"smooth",block:"nearest"}))}handleComboboxKeyDown(e){if(e.key==="ArrowDown"||e.key=="Tab"&&!e.shiftKey){if(e.preventDefault(),!this.isOpen){this.isOpen=!0,this.shouldAutoScroll=!0;return}this.ariaActivedescendant=this.filteredOptions[0].value,this.focusOption(0)}else e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey?(e.preventDefault(),this.ariaActivedescendant=this.filteredOptions[this.filteredOptions.length-1].value,this.focusOption(this.filteredOptions.length-1)):e.key==="Escape"&&(this.isOpen=!1)}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.isOpen&&(this.isOpen=!1)}render(){return s.h("div",{key:"fa0347bf09ec791976c3628837a400ffce06f785",class:"dropdown",part:"id_dropdown"},s.h("input",{key:"d18704609aa859f705397ca57a0d491a8f09ed99",type:"text",name:this.name,id:this.name,part:"id_dropdown-input",class:{dropbtn:!0,open:this.isOpen},value:this.inputValue,onClick:e=>{this.toggleDropdown(),this.shouldAutoScroll=!0,this.handleClick(e)},"aria-haspopup":"listbox","aria-label":this.name,"aria-expanded":this.isOpen?"true":"false",onKeyDown:e=>this.handleComboboxKeyDown(e),onInput:e=>this.handleOnInput(e)}),this.isOpen?s.h("div",{class:"dropdown-content",part:"id_dropdown-content",ref:e=>this.optionsRef=e},s.h("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.filteredOptions.map(e=>s.h("li",{tabindex:"0",key:e.value,id:e.value,onClick:()=>this.selectOption(e),role:"option",class:{focused:this.ariaActivedescendant===e.value.toString()}},e.labelHTML?e.labelHTML:e.label)))):null)}get el(){return s.getElement(this)}static get watchers(){return{options:["optionsChangedHandler"],defaultInputOption:["defaultSelectedOptionChangedHandler"],inputValue:["inputValueChangedHandler"]}}};a.style=c;const h=".time-period-selector.sc-time-period-selector{display:grid;gap:0.5rem;grid-template-columns:auto 1fr}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector,.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector{width:116px}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector{width:84px;display:flex;align-items:center}.time-period-selector.sc-time-period-selector select-dropdown#time-period.sc-time-period-selector::part(sd_dropdown-button){width:100%}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown){width:inherit;height:100%}.time-period-selector.sc-time-period-selector input-dropdown#time-number.sc-time-period-selector::part(id_dropdown-input){border:none;border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector input-dropdown#time-number.error.sc-time-period-selector::part(id_dropdown-input){border:1px solid var(--nylas-error)}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown-input){padding:17px;gap:1rem}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown-content){width:100%;max-height:200px}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown){width:inherit;height:100%}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown_label){height:100%}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-button){padding:1rem;gap:1rem;justify-content:space-between;border:none;align-items:center;height:100%}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-content){width:100%;max-height:200px}",u=h,m={hours:"hour",days:"day",weeks:"week",months:"month"},l=class{constructor(e){s.registerInstance(this,e),this.timePeriodChanged=s.createEvent(this,"timePeriodChanged",7),this.timePeriods=["hour","day","week","month"],this.defaultSelectedPeriod=void 0,this.defaultSelectedNumber=void 0,this.hasError=!1,this.selectedPeriod=this.defaultSelectedPeriod,this.selectedNumber=this.defaultSelectedNumber,this.numberOptions=this.calculateOptions(this.defaultSelectedPeriod||"hour").map(t=>({label:t.toString(),value:t.toString()})),this.timePeriodOptions=this.timePeriods.map(t=>({label:t,value:t}))}defaultSelectedPeriodChanged(e){this.selectedPeriod=e,this.updateNumberOptionsAndSelectedNumber(e)}defaultSelectedNumberChanged(e){this.selectedNumber=e}timePeriodsChanged(e){this.timePeriodOptions=e.map(t=>({label:t,value:t}))}componentDidLoad(){this.selectedNumber=this.defaultSelectedNumber,this.selectedPeriod=this.defaultSelectedPeriod;const e=m[this.selectedPeriod]??this.selectedPeriod,t=this.calculateOptions(e);this.numberOptions=t.map(i=>({label:i.toString(),value:i.toString()}))}calculateOptions(e){switch(e){case"hour":return Array.from({length:23},(t,i)=>i+1);case"minute":return Array.from({length:13},(t,i)=>i*5);case"day":return Array.from({length:30},(t,i)=>i+1);case"week":return Array.from({length:4},(t,i)=>i+1);case"month":return Array.from({length:12},(t,i)=>i+1);default:return[]}}inputOptionChangedHandler(e){s.debug("time-period-selector","inputOptionChangedHandler",e.detail);const{value:t,name:i}=e.detail;i==="time-number"&&(this.selectedNumber=t?parseInt(t):this.defaultSelectedNumber);const o={number:this.selectedNumber,period:this.selectedPeriod};this.timePeriodChanged.emit(o)}nylasFormDropdownChangedHandler(e){s.debug("time-period-selector","nylasFormDropdownChangedHandler",e.detail);const{value:t,name:i}=e.detail;i==="time-period"?(this.selectedPeriod=t,this.updateNumberOptionsAndSelectedNumber(t)):i==="time-number"&&(this.selectedNumber=parseInt(t));const o={number:this.selectedNumber,period:this.selectedPeriod};this.timePeriodChanged.emit(o)}updateNumberOptionsAndSelectedNumber(e){const t=this.calculateOptions(e);this.numberOptions=t.map(i=>({label:i.toString(),value:i.toString()}))}render(){return s.h("div",{key:"a00bd6849a2c62843e298d153e20230f4a0d2c62",class:"time-period-selector"},typeof this.selectedNumber=="number"&&s.h("input-dropdown",{id:"time-number",name:"time-number",class:{error:this.hasError},inputValue:this.selectedNumber.toString(),exportparts:"id_dropdown: tps__number-dropdown, id_dropdown-input: tps__number-dropdown-button, id_dropdown-content: tps__number-dropdown-content",options:this.numberOptions,defaultInputOption:this.numberOptions.find(e=>e.value==this.selectedNumber.toString())}),typeof this.selectedPeriod=="string"&&s.h("select-dropdown",{id:"time-period",name:"time-period",options:this.timePeriodOptions,exportparts:"sd_dropdown: tps__period-dropdown, sd_dropdown-button: tps__period-dropdown-button, sd_dropdown-content: tps__period-dropdown-content",pluralizedLabel:this.selectedNumber>1?"s":"",defaultSelectedOption:this.timePeriodOptions.find(e=>e.value==this.selectedPeriod),withSearch:!1}))}get host(){return s.getElement(this)}static get watchers(){return{defaultSelectedPeriod:["defaultSelectedPeriodChanged"],defaultSelectedNumber:["defaultSelectedNumberChanged"],timePeriods:["timePeriodsChanged"]}}};l.style=u;exports.input_dropdown=a;exports.time_period_selector=l;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-81719cc6.cjs");require("react");require("react-dom");const r=".sc-italic-icon-h{display:flex}",s=r,t=class{constructor(i){e.registerInstance(this,i),this.width="15",this.height="15"}render(){return e.h("svg",{key:"42e08d459b503b00404ed6d853200439939d31c3",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"bf3ebd40f6ba15c02f132fcd0757b09d82ef031d",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m10 20 4-16m2 0h-4m0 16H8"}))}};t.style=s;exports.italic_icon=t;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { r as d, c as p, d as r, h as s, H as c, g as b } from "./index-7e7c24f1.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const h = ':host{display:block;width:inherit;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.dropdown{display:inline-block;width:100%;position:relative}.dropdown .dropdown-label{display:flex;align-items:center;gap:0.25rem;color:var(--nylas-base-800)}.dropdown .dropdown-label p{margin:0}.dropdown .dropdown-label span.required{color:var(--nylas-error);padding:0 0.25rem}.dropdown span.error{color:var(--nylas-error);font-size:14px}.dropbtn{width:inherit;height:48px;color:var(--nylas-base-900);padding:0.5rem;font-size:16px;cursor:pointer;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.dropbtn.focus{background:transparent}.dropbtn.error{border:1px solid var(--nylas-error)}.dropbtn:hover,.dropbtn:active{border:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn:disabled{cursor:not-allowed;background:var(--nylas-base-100)}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;top:72px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.dropdown-content ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.dropdown-content ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.dropdown-content ul li:hover,.dropdown-content ul li:focus{background-color:var(--nylas-base-100)}.dropdown-content ul li label{display:flex;align-items:center;gap:0.5rem}.dropdown-content ul li label input{margin:0}.selected-options{display:flex;flex-wrap:wrap;gap:0.5rem;padding:0.5rem 0;margin-top:0.25rem;background:var(--nylas-base-0)}.selected-options .selected-option{display:flex;align-items:center;gap:0.5rem;padding:4px 8px;border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-100);color:var(--nylas-base-800);font-size:16px;font-weight:500;line-height:1.5rem;letter-spacing:0.5px}.selected-options .selected-option button{background:transparent;border:none;cursor:pointer;padding:0}.selected-options .selected-option button:hover{color:var(--nylas-primary)}.selected-options .selected-option button:disabled{cursor:not-allowed;background:var(--nylas-base-100)}', u = h, f = class {
|
|
5
|
-
constructor(e) {
|
|
6
|
-
d(this, e), this.selectedOptionsChanged = p(this, "selectedOptionsChanged", 7), this.name = void 0, this.label = void 0, this.options = [], this.error = "", this.required = !1, this.readOnly = !1, this.availableOptions = this.options, this.isOpen = !1, this.ariaActivedescendant = "", this.shouldFocusFirstOption = !1;
|
|
7
|
-
}
|
|
8
|
-
areOptionsEqual(e, a) {
|
|
9
|
-
if (e.length !== a.length)
|
|
10
|
-
return !1;
|
|
11
|
-
const t = [...e].sort((n, o) => n.label.localeCompare(o.label) || n.value.localeCompare(o.value)), i = [...a].sort((n, o) => n.label.localeCompare(o.label) || n.value.localeCompare(o.value));
|
|
12
|
-
return t.every((n, o) => {
|
|
13
|
-
const l = i[o];
|
|
14
|
-
return n.label === l.label && n.value === l.value;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
optionsChangedHandler(e) {
|
|
18
|
-
this.areOptionsEqual(e, this.availableOptions) || (this.availableOptions = e);
|
|
19
|
-
}
|
|
20
|
-
componentDidLoad() {
|
|
21
|
-
r("multi-select-dropdown", "componentDidLoad"), this.options && (this.availableOptions = this.options);
|
|
22
|
-
}
|
|
23
|
-
componentDidRender() {
|
|
24
|
-
var e;
|
|
25
|
-
r("multi-select-dropdown", "componentDidRender"), this.isOpen && this.shouldFocusFirstOption && (this.ariaActivedescendant = (e = this.availableOptions[0]) == null ? void 0 : e.value, this.focusOption(0), this.shouldFocusFirstOption = !1);
|
|
26
|
-
}
|
|
27
|
-
handleOutsideClick(e) {
|
|
28
|
-
!e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
|
|
29
|
-
}
|
|
30
|
-
handleBookingFormSubmitted(e) {
|
|
31
|
-
const a = this.availableOptions.filter((t) => t.selected).map((t) => t.value);
|
|
32
|
-
this.required && (!a || a.length <= 0) && (this.error = "Please select at least one option"), this.error && e.preventDefault();
|
|
33
|
-
}
|
|
34
|
-
selectOption(e) {
|
|
35
|
-
this.availableOptions = this.availableOptions.map((t) => (t.value === e.value && (t.selected = !e.selected, t.selected && (this.error = "")), t));
|
|
36
|
-
const a = this.availableOptions.filter((t) => t.selected).map((t) => t.value);
|
|
37
|
-
this.selectedOptionsChanged.emit({
|
|
38
|
-
value: a,
|
|
39
|
-
name: this.name
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
toggleDropdown() {
|
|
43
|
-
this.isOpen = !this.isOpen, this.isOpen ? this.shouldFocusFirstOption = !0 : this.ariaActivedescendant = "";
|
|
44
|
-
}
|
|
45
|
-
handleSelectButtonKeyDown(e) {
|
|
46
|
-
switch (e.key) {
|
|
47
|
-
case "ArrowDown":
|
|
48
|
-
case "Enter":
|
|
49
|
-
e.preventDefault(), this.isOpen || this.toggleDropdown();
|
|
50
|
-
break;
|
|
51
|
-
case "Escape":
|
|
52
|
-
this.isOpen = !1;
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
handleListboxKeydown(e) {
|
|
57
|
-
const a = this.availableOptions, t = a.findIndex((i) => i.value === this.ariaActivedescendant);
|
|
58
|
-
switch (e.key) {
|
|
59
|
-
case "ArrowDown":
|
|
60
|
-
case "Tab":
|
|
61
|
-
if (e.shiftKey) {
|
|
62
|
-
e.preventDefault();
|
|
63
|
-
const n = t - 1 >= 0 ? t - 1 : a.length - 1;
|
|
64
|
-
this.ariaActivedescendant = a[n].value, this.focusOption(n);
|
|
65
|
-
} else {
|
|
66
|
-
e.preventDefault();
|
|
67
|
-
const n = t + 1 < a.length ? t + 1 : 0;
|
|
68
|
-
this.ariaActivedescendant = a[n].value, this.focusOption(n);
|
|
69
|
-
}
|
|
70
|
-
break;
|
|
71
|
-
case "ArrowUp":
|
|
72
|
-
e.preventDefault();
|
|
73
|
-
const i = t - 1 >= 0 ? t - 1 : a.length - 1;
|
|
74
|
-
this.ariaActivedescendant = a[i].value, this.focusOption(i);
|
|
75
|
-
break;
|
|
76
|
-
case "Enter":
|
|
77
|
-
e.preventDefault(), this.ariaActivedescendant && this.selectOption(a[t]);
|
|
78
|
-
break;
|
|
79
|
-
case "Escape":
|
|
80
|
-
this.isOpen = !1;
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
focusOption(e) {
|
|
85
|
-
var n;
|
|
86
|
-
const a = this.availableOptions[e];
|
|
87
|
-
if (!a)
|
|
88
|
-
return;
|
|
89
|
-
const t = a.value, i = (n = this.el.shadowRoot) == null ? void 0 : n.getElementById(t);
|
|
90
|
-
i && (i.focus(), i.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
91
|
-
}
|
|
92
|
-
getSelectedOptions() {
|
|
93
|
-
return this.availableOptions.filter((e) => e.selected);
|
|
94
|
-
}
|
|
95
|
-
renderOption(e) {
|
|
96
|
-
return s("li", { key: e.value, id: e.value, role: "option", tabindex: "0", "aria-selected": e.selected ? "true" : "false", onClick: (a) => {
|
|
97
|
-
a.stopImmediatePropagation(), this.selectOption(e);
|
|
98
|
-
}, class: { selected: !!e.selected } }, s("label", { htmlFor: e.value }, s("input", { "aria-hidden": "true", id: e.value, type: "checkbox", checked: e.selected }), s("span", null, e.label)));
|
|
99
|
-
}
|
|
100
|
-
render() {
|
|
101
|
-
var e, a;
|
|
102
|
-
return s(c, { key: "37a31937cf135ac95283a6bda665376e898528a1" }, s("div", { key: "9a563036244cd370513cd9b74deafea852c6e9bf", class: "dropdown", part: "msd_dropdown" }, s("label", { key: "66e18a246555de11c9643937948ccab15a31f15d", class: "dropdown-label", part: "msd_dropdown-label" }, s("p", { key: "41e3d3fde96d84a171e57731071649c102043fc1" }, s("span", { key: "d5002292b0cf924c5394f1ecd1a8f8752e928b13", class: "label" }, this.label), this.required && s("span", { class: "required" }, "*")), s("slot", { key: "a169bb5c2460002c307ea427c41597c0beb4ef21", name: "label-icon", "aria-hidden": "true" })), s("button", { key: "06e0529ba120efb2af170aeda87f560f824b7deb", name: this.name, part: `msd_dropdown-button ${this.error ? "msd_dropdown-button--error" : ""}`, class: { dropbtn: !0, open: this.isOpen, error: !!this.error }, onClick: () => this.toggleDropdown(), disabled: this.readOnly, title: this.readOnly ? "read-only field" : void 0, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? "true" : "false", "aria-label": this.name, onKeyDown: (t) => this.handleSelectButtonKeyDown(t) }, s("slot", { key: "643778fc42ed44e62cff22958fe6aed421db4da2", name: "select-icon", "aria-hidden": "true" }), s("span", { key: "a471f42326edcf0bfa49432504c1eaaa56e38f80", class: "selected-option", part: "msd_dropdown-button-selected-label" }, this.getSelectedOptions().length > 1 ? "Multiple options selected" : ((e = this.availableOptions.filter((t) => t.selected)[0]) == null ? void 0 : e.label) ?? ((a = this.availableOptions[0]) == null ? void 0 : a.label)), s("span", { key: "a68f0eb8608f1fff68cf682ae5721e7966fffefd", class: this.isOpen ? "open" : "closed", "aria-hidden": "true" }, s("chevron-icon", { key: "915161be22a422ffdb8126d4a0c7530633d443d9", width: "16", height: "16" }))), this.error ? s("span", { class: "error", part: "msd_dropdown_error" }, this.error) : null, this.isOpen ? null : s("div", { class: "selected-options" }, this.getSelectedOptions().map((t) => s("span", { class: "selected-option" }, t.label, s("button", { disabled: this.readOnly, key: t.label, onClick: () => this.selectOption(t) }, s("close-icon", null))))), this.isOpen ? s("div", { class: "dropdown-content", part: "msd_dropdown-content" }, s("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-multiselectable": !0, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (t) => this.handleListboxKeydown(t) }, this.availableOptions.map((t) => this.renderOption(t)))) : null));
|
|
103
|
-
}
|
|
104
|
-
get el() {
|
|
105
|
-
return b(this);
|
|
106
|
-
}
|
|
107
|
-
static get watchers() {
|
|
108
|
-
return {
|
|
109
|
-
options: ["optionsChangedHandler"]
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
f.style = u;
|
|
114
|
-
export {
|
|
115
|
-
f as multi_select_dropdown
|
|
116
|
-
};
|