@nylas/react 0.0.0-canary-20240925163706
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/LICENSE.md +22 -0
- package/README.md +111 -0
- package/dist/add-circle-icon_2.entry-19a0fe6b.js +25 -0
- package/dist/add-circle-icon_2.entry-6f0ef50b.cjs +1 -0
- package/dist/archive-icon.entry-7caa062b.js +15 -0
- package/dist/archive-icon.entry-d9a39415.cjs +1 -0
- package/dist/arrow-icon.entry-29ce2105.cjs +1 -0
- package/dist/arrow-icon.entry-ab601786.js +15 -0
- package/dist/bold-icon.entry-6ff126e7.cjs +1 -0
- package/dist/bold-icon.entry-e389dd6a.js +15 -0
- package/dist/button-component_2.entry-06af034d.js +26 -0
- package/dist/button-component_2.entry-837792bd.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_51.entry-6c5c6fd4.js +5336 -0
- package/dist/calendar-agenda-fill-icon_51.entry-aaa927bb.cjs +7 -0
- package/dist/calendar-cancel-icon.entry-bf97fa74.js +15 -0
- package/dist/calendar-cancel-icon.entry-da33711a.cjs +1 -0
- package/dist/calendar-check-icon_2.entry-0fcc2bd1.cjs +1 -0
- package/dist/calendar-check-icon_2.entry-e9709591.js +25 -0
- package/dist/calendar-icon.entry-056c8caf.cjs +1 -0
- package/dist/calendar-icon.entry-70cca97a.js +15 -0
- package/dist/checkbox-component_2.entry-88af9f01.js +79 -0
- package/dist/checkbox-component_2.entry-cf19cd62.cjs +1 -0
- package/dist/chevron-icon_3.entry-1c22f6d3.js +143 -0
- package/dist/chevron-icon_3.entry-85d098ed.cjs +1 -0
- package/dist/clock-icon_4.entry-5edf8fcd.js +45 -0
- package/dist/clock-icon_4.entry-7b892d79.cjs +1 -0
- package/dist/constants-c31dccfe-54f255f4.cjs +15 -0
- package/dist/constants-c31dccfe-93b0694c.js +3883 -0
- package/dist/copy-icon.entry-b3b8e543.js +15 -0
- package/dist/copy-icon.entry-fcd2c006.cjs +1 -0
- package/dist/core-js-38e53e34.cjs +4 -0
- package/dist/core-js-a9d3b6e1.js +3297 -0
- package/dist/delete-icon.entry-9745ae8b.cjs +1 -0
- package/dist/delete-icon.entry-f982c1a7.js +15 -0
- package/dist/document-refresh-icon.entry-5a30a275.cjs +1 -0
- package/dist/document-refresh-icon.entry-defaaba2.js +15 -0
- package/dist/dom-68f08be9.cjs +15 -0
- package/dist/dom-86e17616.js +664 -0
- package/dist/elements/index.d.ts +128 -0
- package/dist/elements/react-component-lib/createComponent.d.ts +10 -0
- package/dist/elements/react-component-lib/createOverlayComponent.d.ts +21 -0
- package/dist/elements/react-component-lib/index.d.ts +2 -0
- package/dist/elements/react-component-lib/interfaces.d.ts +29 -0
- package/dist/elements/react-component-lib/utils/attachProps.d.ts +9 -0
- package/dist/elements/react-component-lib/utils/case.d.ts +2 -0
- package/dist/elements/react-component-lib/utils/dev.d.ts +2 -0
- package/dist/elements/react-component-lib/utils/index.d.ts +10 -0
- package/dist/feedbackSync-ab657d65-b98458dc.cjs +448 -0
- package/dist/feedbackSync-ab657d65-d6521095.js +6035 -0
- package/dist/folder-icon.entry-08cf370b.js +15 -0
- package/dist/folder-icon.entry-425f61ef.cjs +1 -0
- package/dist/forward-icon.entry-4acbada4.js +15 -0
- package/dist/forward-icon.entry-7062edbf.cjs +1 -0
- package/dist/globe-icon.entry-51e847a3.js +15 -0
- package/dist/globe-icon.entry-b779a059.cjs +1 -0
- package/dist/google-logo-icon_4.entry-96a8caee.cjs +1 -0
- package/dist/google-logo-icon_4.entry-c44f16cc.js +715 -0
- package/dist/inbox-icon.entry-04d81697.cjs +1 -0
- package/dist/inbox-icon.entry-6e3a9428.js +15 -0
- package/dist/index-87381561.cjs +81 -0
- package/dist/index-995dd3b3.js +12865 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.es-b475d61f-f250d992.cjs +7 -0
- package/dist/index.es-b475d61f-f52875ad.js +3129 -0
- package/dist/info-icon_2.entry-c3f4b245.js +34 -0
- package/dist/info-icon_2.entry-d733f421.cjs +1 -0
- package/dist/input-color-picker.entry-02e48131.js +48 -0
- package/dist/input-color-picker.entry-516445b9.cjs +1 -0
- package/dist/input-component.entry-5bb8197a.cjs +1 -0
- package/dist/input-component.entry-dbff4e12.js +70 -0
- package/dist/input-dropdown.entry-7b40f8a7.cjs +1 -0
- package/dist/input-dropdown.entry-cc4182c4.js +134 -0
- package/dist/italic-icon.entry-494a04f1.js +15 -0
- package/dist/italic-icon.entry-bd268b46.cjs +1 -0
- package/dist/multi-select-dropdown.entry-55f7dd99.cjs +1 -0
- package/dist/multi-select-dropdown.entry-b9ac9a80.js +95 -0
- package/dist/nylas-booked-event-card_12.entry-a1048d4e.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-ac8f1a11.js +1139 -0
- package/dist/nylas-form-card.entry-9957f25c.cjs +1 -0
- package/dist/nylas-form-card.entry-9ec44108.js +57 -0
- package/dist/nylas-if-state.entry-934980c1.js +94 -0
- package/dist/nylas-if-state.entry-f7087bb0.cjs +1 -0
- package/dist/nylas-login.entry-074778e6.cjs +1 -0
- package/dist/nylas-login.entry-17a6788a.js +73 -0
- package/dist/nylas-provider.entry-0edfffb0.cjs +1 -0
- package/dist/nylas-provider.entry-58e44ef6.js +264 -0
- package/dist/nylas-reminder-emails.entry-0129ea1f.cjs +4 -0
- package/dist/nylas-reminder-emails.entry-dec904fb.js +168 -0
- package/dist/nylas-reminder-time_2.entry-48b85638.js +108 -0
- package/dist/nylas-reminder-time_2.entry-6d8982d9.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-a913f2b3.js +1447 -0
- package/dist/nylas-scheduler-editor.entry-b293366d.cjs +2 -0
- package/dist/nylas-scheduling.entry-29b473ef.js +400 -0
- package/dist/nylas-scheduling.entry-5d751778.cjs +1 -0
- package/dist/nylas-time-window-picker.entry-aa613b4d.cjs +1 -0
- package/dist/nylas-time-window-picker.entry-d2e2210e.js +316 -0
- package/dist/person-icon.entry-11852b43.cjs +1 -0
- package/dist/person-icon.entry-767695db.js +15 -0
- package/dist/play-icon.entry-125d062f.cjs +1 -0
- package/dist/play-icon.entry-9e385af9.js +15 -0
- package/dist/react.cjs +1 -0
- package/dist/react.js +136 -0
- package/dist/refresh-icon.entry-13e06ddd.cjs +1 -0
- package/dist/refresh-icon.entry-339c1223.js +15 -0
- package/dist/register-component-679c1308-0b6682e1.cjs +1 -0
- package/dist/register-component-679c1308-3b561946.js +109 -0
- package/dist/reply-all-icon.entry-e56e8608.cjs +1 -0
- package/dist/reply-all-icon.entry-f82e7b24.js +15 -0
- package/dist/reply-icon.entry-319e75df.js +15 -0
- package/dist/reply-icon.entry-ebb08667.cjs +1 -0
- package/dist/scheduler-config-store-2a3b403d-aed2458a.cjs +1 -0
- package/dist/scheduler-config-store-2a3b403d-f5b7b06f.js +27 -0
- package/dist/scheduler-store-908886c8-75b1f2d8.js +474 -0
- package/dist/scheduler-store-908886c8-9c388312.cjs +1 -0
- package/dist/sent-icon.entry-2f7a8e18.js +15 -0
- package/dist/sent-icon.entry-393a90a3.cjs +1 -0
- package/dist/spam-icon.entry-d7853085.cjs +1 -0
- package/dist/spam-icon.entry-de7c7233.js +15 -0
- package/dist/star-icon.entry-c8fa29e1.cjs +1 -0
- package/dist/star-icon.entry-cfb5c8e5.js +15 -0
- package/dist/stop-icon.entry-c6e9fd7f.js +15 -0
- package/dist/stop-icon.entry-e5415d24.cjs +1 -0
- package/dist/textarea-component.entry-6f80f914.js +37 -0
- package/dist/textarea-component.entry-d46ad4ac.cjs +1 -0
- package/dist/time-period-selector.entry-2eaf3ddb.cjs +1 -0
- package/dist/time-period-selector.entry-f8be5854.js +80 -0
- package/dist/translate-icon.entry-dc151da3.cjs +1 -0
- package/dist/translate-icon.entry-ffb6d5bf.js +15 -0
- package/dist/trash-fill-icon.entry-063b2e26.cjs +1 -0
- package/dist/trash-fill-icon.entry-a9966957.js +15 -0
- package/dist/underline-icon.entry-b992a0fc.js +15 -0
- package/dist/underline-icon.entry-c77e97df.cjs +1 -0
- package/dist/warning-icon.entry-0cae2440.cjs +1 -0
- package/dist/warning-icon.entry-28c1b03b.js +15 -0
- package/package.json +50 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { r as o, h as e, g as n } from "./index-995dd3b3.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: "149fd3ce434b49a4f6537d02e61826b37902eaf7", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("path", { key: "0f3bee3c4081b4d171771096bfe4f325a64dbe1c", 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:black 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: "f7ed680c86f53928c284ced8d5a6c30cd6a8a158", class: "tooltip-container", part: "tc__container" }, e("span", { key: "07d396ac91688a025497e4ff9ea5ea4c9263e787", class: "info-icon", tabindex: "0", onFocus: this.showTooltip.bind(this), onBlur: this.hideTooltip.bind(this) }, e("slot", { key: "f8ed2155292bdd8f6e7adc72e0e89ed16a6fa823", name: "tooltip-icon" }, "i")), e("span", { key: "69f9669f987897f46ede1c67f6001824e7d27553", class: `tooltip-content ${this.position}`, part: "tc__content" }, e("slot", { key: "f7e46722aca747f4ec8022df2080d08e5200e256", 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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-87381561.cjs");require("react");require("react-dom");const i=".sc-info-icon-h{display:flex}",a=i,o=class{constructor(e){t.registerInstance(this,e),this.width="14",this.height="14"}render(){return t.h("svg",{key:"149fd3ce434b49a4f6537d02e61826b37902eaf7",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"0f3bee3c4081b4d171771096bfe4f325a64dbe1c",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=a;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:black 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:"f7ed680c86f53928c284ced8d5a6c30cd6a8a158",class:"tooltip-container",part:"tc__container"},t.h("span",{key:"07d396ac91688a025497e4ff9ea5ea4c9263e787",class:"info-icon",tabindex:"0",onFocus:this.showTooltip.bind(this),onBlur:this.hideTooltip.bind(this)},t.h("slot",{key:"f8ed2155292bdd8f6e7adc72e0e89ed16a6fa823",name:"tooltip-icon"},"i")),t.h("span",{key:"69f9669f987897f46ede1c67f6001824e7d27553",class:`tooltip-content ${this.position}`,part:"tc__content"},t.h("slot",{key:"f7e46722aca747f4ec8022df2080d08e5200e256",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;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { r as n, c as o, h as r, g as s } from "./index-995dd3b3.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:1rem;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: "2d47b38b71500b918e8a7fd260ab0106c99d3d45", class: "color-picker-container", part: "icp_color-picker", tabindex: "0", onKeyDown: (e) => this.handleKeyDown(e) }, r("input", { key: "cd794ea00dc31711c2d56fd24eebb79c0a930677", 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: "d0d7e26fba92cc5e47a3bfa1a0fb8ff312444407", 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: "279f408b56ba6391aa8b9a5d741194f09340426f", class: "selected-option", part: "icp_color-picker-button-selected-label" }, this.selectedColor || "Select a color"), r("span", { key: "ca0626f40e35e027dbe64a520333bc37b6151992", class: {
|
|
36
|
+
open: this.isOpen,
|
|
37
|
+
closed: !this.isOpen,
|
|
38
|
+
chevron: !0
|
|
39
|
+
}, "aria-hidden": "true" }, r("chevron-icon", { key: "c707ace8496da13f9587cc93053592c3bf4130f8", 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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-87381561.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:1rem;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:"2d47b38b71500b918e8a7fd260ab0106c99d3d45",class:"color-picker-container",part:"icp_color-picker",tabindex:"0",onKeyDown:e=>this.handleKeyDown(e)},r.h("input",{key:"cd794ea00dc31711c2d56fd24eebb79c0a930677",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:"d0d7e26fba92cc5e47a3bfa1a0fb8ff312444407",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:"279f408b56ba6391aa8b9a5d741194f09340426f",class:"selected-option",part:"icp_color-picker-button-selected-label"},this.selectedColor||"Select a color"),r.h("span",{key:"ca0626f40e35e027dbe64a520333bc37b6151992",class:{open:this.isOpen,closed:!this.isOpen,chevron:!0},"aria-hidden":"true"},r.h("chevron-icon",{key:"c707ace8496da13f9587cc93053592c3bf4130f8",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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-87381561.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)}',i=s,l={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=l[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:"e34259d7c68764f76d23e5e29a2e146abc37d8e8",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:"bbf9cc51221105ef91447dec3e6a8f37112652fb",part:"ic__input_wrapper",class:"input_wrapper"},e.h("input",{key:"a4772fec8494e8ae308960568baf58dddebbb741",type:"text",name:this.name,part:"ic__input",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:"4baaf6f7b6929da24393e3f81df17fb8ce263d4a",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=i;exports.input_component=r;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { r as l, c as a, q as r, h as t, g as i } from "./index-995dd3b3.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)}', 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
|
+
}, p = class {
|
|
11
|
+
constructor(e) {
|
|
12
|
+
l(this, e), this.nylasFormInputChanged = a(this, "nylasFormInputChanged", 7), this.nylasFormInputFocused = a(this, "nylasFormInputFocused", 7), this.nylasFormInputBlurred = a(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 t("label", { key: "e34259d7c68764f76d23e5e29a2e146abc37d8e8", part: "ic__label", class: { error: !!this.error } }, this.label && t("p", null, t("span", { class: "label" }, this.label), this.required && t("span", { class: "required" }, "*")), t("div", { key: "bbf9cc51221105ef91447dec3e6a8f37112652fb", part: "ic__input_wrapper", class: "input_wrapper" }, t("input", { key: "a4772fec8494e8ae308960568baf58dddebbb741", type: "text", name: this.name, part: "ic__input", 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() }), t("slot", { key: "4baaf6f7b6929da24393e3f81df17fb8ce263d4a", name: "additional-input" })), this.error && t("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
|
+
p.style = o;
|
|
68
|
+
export {
|
|
69
|
+
p as input_component
|
|
70
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-87381561.cjs");require("react");require("react-dom");const d=':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:1rem;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:black;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}',p=d,l=class{constructor(e){a.registerInstance(this,e),this.inputOptionChanged=a.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,n,o,s;return((n=t==null?void 0:t.value)==null?void 0:n.toString().toLowerCase().includes((i=this.typedValue)==null?void 0:i.toLowerCase()))||((s=t==null?void 0:t.label)==null?void 0:s.toLowerCase().includes((o=this.typedValue)==null?void 0:o.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(n=>n.label.toLowerCase().includes(t.toLowerCase()));i>-1&&this.scrollToViewWithinParent(i),this.inputOptionChanged.emit({value:t,name:this.name})}scrollToViewWithinParent(e){var r;const t=this.options[e],i=(r=this.el.shadowRoot)==null?void 0:r.getElementById(t.value.toString()),n=this.optionsRef;if(this.ariaActivedescendant=t.value.toString(),!i||!n)return;const o=i.getBoundingClientRect(),s=n.getBoundingClientRect();o.top<s.top?n.scrollTop-=s.top-o.top:o.bottom>s.bottom&&(n.scrollTop+=o.bottom-s.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(n=>n.label.toLowerCase().includes(t.toLowerCase()));i>-1&&setTimeout(()=>{this.scrollToViewWithinParent(i)},10)}}handleListboxKeydown(e){var n,o;const t=this.filteredOptions,i=t.findIndex(s=>s.value===this.ariaActivedescendant);if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){if(e.preventDefault(),i===t.length-1){this.ariaActivedescendant="",(n=this.inputRef)==null||n.focus();return}const s=i+1<t.length?i+1:0;this.ariaActivedescendant=t[s].value,this.focusOption(s)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){if(e.preventDefault(),i===0){this.ariaActivedescendant="",(o=this.inputRef)==null||o.focus();return}const s=i-1>=0?i-1:t.length-1;this.ariaActivedescendant=t[s].value,this.focusOption(s)}else e.key==="Enter"?(e.preventDefault(),this.ariaActivedescendant&&this.selectOption(t[i])):e.key==="Escape"&&(this.isOpen=!1)}focusOption(e){var o;const t=this.filteredOptions[e];if(!t)return;const i=t.value,n=(o=this.el.shadowRoot)==null?void 0:o.getElementById(i);n&&(n.focus(),n.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 a.h("div",{key:"c49065e27f831f8f403cf053507bdfd9127262e9",class:"dropdown",part:"id_dropdown"},a.h("input",{key:"861269b3c4821877ed03990d10f519958e372e5e",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?a.h("div",{class:"dropdown-content",part:"id_dropdown-content",ref:e=>this.optionsRef=e},a.h("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.filteredOptions.map(e=>a.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 a.getElement(this)}static get watchers(){return{options:["optionsChangedHandler"],defaultInputOption:["defaultSelectedOptionChangedHandler"],inputValue:["inputValueChangedHandler"]}}};l.style=p;exports.input_dropdown=l;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { r as l, c as d, h as a, g as p } from "./index-995dd3b3.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:1rem;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:black;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 = h, u = class {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
l(this, e), this.inputOptionChanged = d(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, n, o, s;
|
|
23
|
+
return ((n = t == null ? void 0 : t.value) == null ? void 0 : n.toString().toLowerCase().includes((i = this.typedValue) == null ? void 0 : i.toLowerCase())) || ((s = t == null ? void 0 : t.label) == null ? void 0 : s.toLowerCase().includes((o = this.typedValue) == null ? void 0 : o.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((n) => n.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 r;
|
|
46
|
+
const t = this.options[e], i = (r = this.el.shadowRoot) == null ? void 0 : r.getElementById(t.value.toString()), n = this.optionsRef;
|
|
47
|
+
if (this.ariaActivedescendant = t.value.toString(), !i || !n)
|
|
48
|
+
return;
|
|
49
|
+
const o = i.getBoundingClientRect(), s = n.getBoundingClientRect();
|
|
50
|
+
o.top < s.top ? n.scrollTop -= s.top - o.top : o.bottom > s.bottom && (n.scrollTop += o.bottom - s.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((n) => n.label.toLowerCase().includes(t.toLowerCase()));
|
|
67
|
+
i > -1 && setTimeout(() => {
|
|
68
|
+
this.scrollToViewWithinParent(i);
|
|
69
|
+
}, 10);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
handleListboxKeydown(e) {
|
|
73
|
+
var n, o;
|
|
74
|
+
const t = this.filteredOptions, i = t.findIndex((s) => s.value === this.ariaActivedescendant);
|
|
75
|
+
if (e.key === "ArrowDown" || e.key === "Tab" && !e.shiftKey) {
|
|
76
|
+
if (e.preventDefault(), i === t.length - 1) {
|
|
77
|
+
this.ariaActivedescendant = "", (n = this.inputRef) == null || n.focus();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const s = i + 1 < t.length ? i + 1 : 0;
|
|
81
|
+
this.ariaActivedescendant = t[s].value, this.focusOption(s);
|
|
82
|
+
} else if (e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey) {
|
|
83
|
+
if (e.preventDefault(), i === 0) {
|
|
84
|
+
this.ariaActivedescendant = "", (o = this.inputRef) == null || o.focus();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const s = i - 1 >= 0 ? i - 1 : t.length - 1;
|
|
88
|
+
this.ariaActivedescendant = t[s].value, this.focusOption(s);
|
|
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 o;
|
|
94
|
+
const t = this.filteredOptions[e];
|
|
95
|
+
if (!t)
|
|
96
|
+
return;
|
|
97
|
+
const i = t.value, n = (o = this.el.shadowRoot) == null ? void 0 : o.getElementById(i);
|
|
98
|
+
n && (n.focus(), n.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 a("div", { key: "c49065e27f831f8f403cf053507bdfd9127262e9", class: "dropdown", part: "id_dropdown" }, a("input", { key: "861269b3c4821877ed03990d10f519958e372e5e", 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 ? a("div", { class: "dropdown-content", part: "id_dropdown-content", ref: (e) => this.optionsRef = e }, a("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (e) => this.handleListboxKeydown(e) }, this.filteredOptions.map((e) => a("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 p(this);
|
|
122
|
+
}
|
|
123
|
+
static get watchers() {
|
|
124
|
+
return {
|
|
125
|
+
options: ["optionsChangedHandler"],
|
|
126
|
+
defaultInputOption: ["defaultSelectedOptionChangedHandler"],
|
|
127
|
+
inputValue: ["inputValueChangedHandler"]
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
u.style = c;
|
|
132
|
+
export {
|
|
133
|
+
u as input_dropdown
|
|
134
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { r as e, h as t } from "./index-995dd3b3.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const o = ".sc-italic-icon-h{display:flex}", s = o, c = class {
|
|
5
|
+
constructor(i) {
|
|
6
|
+
e(this, i), this.width = "15", this.height = "15";
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
return t("svg", { key: "aba9c34da25f66751084badeb369dde078799956", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "8d551fcc11ab07f3018383151798c1d8ec5dc67f", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "m10 20 4-16m2 0h-4m0 16H8" }));
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
c.style = s;
|
|
13
|
+
export {
|
|
14
|
+
c as italic_icon
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-87381561.cjs");require("react");require("react-dom");const c=".sc-italic-icon-h{display:flex}",r=c,e=class{constructor(i){t.registerInstance(this,i),this.width="15",this.height="15"}render(){return t.h("svg",{key:"aba9c34da25f66751084badeb369dde078799956",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"8d551fcc11ab07f3018383151798c1d8ec5dc67f",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m10 20 4-16m2 0h-4m0 16H8"}))}};e.style=r;exports.italic_icon=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-87381561.cjs");require("react");require("react-dom");const r=':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 span.error{color:var(--nylas-error);font-size:14px}.dropbtn{width:inherit;height:48px;color:black;padding:0.5rem;font-size:1rem;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 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:black;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)}',l=r,o=class{constructor(e){s.registerInstance(this,e),this.selectedOptionsChanged=s.createEvent(this,"selectedOptionsChanged",7),this.name=void 0,this.label=void 0,this.options=[],this.error="",this.availableOptions=this.options,this.isOpen=!1,this.ariaActivedescendant="",this.shouldFocusFirstOption=!1}componentDidLoad(){s.debug("multi-select-dropdown","componentDidLoad"),this.options&&(this.availableOptions=this.options)}componentDidRender(){var e;s.debug("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)}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.isOpen&&(this.isOpen=!1)}selectOption(e){this.availableOptions=this.availableOptions.map(t=>(t.value===e.value&&(t.selected=!e.selected),t));const a=this.availableOptions.filter(t=>t.selected).map(t=>t.value);this.selectedOptionsChanged.emit({value:a,name:this.name})}toggleDropdown(){this.isOpen=!this.isOpen,this.isOpen?this.shouldFocusFirstOption=!0:this.ariaActivedescendant=""}handleSelectButtonKeyDown(e){switch(e.key){case"ArrowDown":case"Enter":e.preventDefault(),this.isOpen||this.toggleDropdown();break;case"Escape":this.isOpen=!1;break}}handleListboxKeydown(e){const a=this.availableOptions,t=a.findIndex(n=>n.value===this.ariaActivedescendant);switch(e.key){case"ArrowDown":case"Tab":if(e.shiftKey){e.preventDefault();const i=t-1>=0?t-1:a.length-1;this.ariaActivedescendant=a[i].value,this.focusOption(i)}else{e.preventDefault();const i=t+1<a.length?t+1:0;this.ariaActivedescendant=a[i].value,this.focusOption(i)}break;case"ArrowUp":e.preventDefault();const n=t-1>=0?t-1:a.length-1;this.ariaActivedescendant=a[n].value,this.focusOption(n);break;case"Enter":e.preventDefault(),this.ariaActivedescendant&&this.selectOption(a[t]);break;case"Escape":this.isOpen=!1;break}}focusOption(e){var i;const a=this.availableOptions[e];if(!a)return;const t=a.value,n=(i=this.el.shadowRoot)==null?void 0:i.getElementById(t);n&&(n.focus(),n.scrollIntoView({behavior:"smooth",block:"nearest"}))}getSelectedOptions(){return this.availableOptions.filter(e=>e.selected)}renderOption(e){return s.h("li",{key:e.value,id:e.value,role:"option",tabindex:"0","aria-selected":e.selected?"true":"false",onClick:a=>{a.stopImmediatePropagation(),this.selectOption(e)},class:{selected:!!e.selected}},s.h("label",{htmlFor:e.value},s.h("input",{"aria-hidden":"true",id:e.value,type:"checkbox",checked:e.selected}),s.h("span",null,e.label)))}render(){var e,a;return s.h(s.Host,{key:"9417bddaf55644bed09f9307e395493edff182f7"},s.h("div",{key:"2c117b95885d3b5050fa430bdab613fefbe80c8e",class:"dropdown",part:"msd_dropdown"},s.h("label",{key:"0068b39a03678248b2225d4c355403df20e4e157",class:"dropdown-label"},this.label,s.h("slot",{key:"25f55fdf4da7980ba1c4af4ce0751c7e9b8c9ddd",name:"label-icon","aria-hidden":"true"})),s.h("button",{key:"a637c27dc2aa8b270115b42f70cb5b87a89f32dd",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(),"aria-haspopup":"listbox","aria-expanded":this.isOpen?"true":"false","aria-label":this.name,onKeyDown:t=>this.handleSelectButtonKeyDown(t)},s.h("slot",{key:"7fb4005ea067df4eec7dd9b167b440c685475f19",name:"select-icon","aria-hidden":"true"}),s.h("span",{key:"d21978886c1eb01961e01f12c837a638bd3d740b",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.h("span",{key:"99b5343dc6f1bcd0488d8d7eebf3256780a89dd4",class:this.isOpen?"open":"closed","aria-hidden":"true"},s.h("chevron-icon",{key:"3fc6cbe2b3e4dc995989affc69f50339a07e2338",width:"16",height:"16"}))),this.error?s.h("span",{class:"error"},this.error):null,this.isOpen?null:s.h("div",{class:"selected-options"},this.getSelectedOptions().map(t=>s.h("span",{class:"selected-option"},t.label,s.h("button",{key:t.label,onClick:()=>this.selectOption(t)},s.h("close-icon",null))))),this.isOpen?s.h("div",{class:"dropdown-content",part:"msd_dropdown-content"},s.h("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))}get el(){return s.getElement(this)}};o.style=l;exports.multi_select_dropdown=o;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { r as l, c as r, d as o, h as s, H as d, g as c } from "./index-995dd3b3.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const p = ':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 span.error{color:var(--nylas-error);font-size:14px}.dropbtn{width:inherit;height:48px;color:black;padding:0.5rem;font-size:1rem;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 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:black;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)}', b = p, h = class {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
l(this, e), this.selectedOptionsChanged = r(this, "selectedOptionsChanged", 7), this.name = void 0, this.label = void 0, this.options = [], this.error = "", this.availableOptions = this.options, this.isOpen = !1, this.ariaActivedescendant = "", this.shouldFocusFirstOption = !1;
|
|
7
|
+
}
|
|
8
|
+
componentDidLoad() {
|
|
9
|
+
o("multi-select-dropdown", "componentDidLoad"), this.options && (this.availableOptions = this.options);
|
|
10
|
+
}
|
|
11
|
+
componentDidRender() {
|
|
12
|
+
var e;
|
|
13
|
+
o("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);
|
|
14
|
+
}
|
|
15
|
+
handleOutsideClick(e) {
|
|
16
|
+
!e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
|
|
17
|
+
}
|
|
18
|
+
selectOption(e) {
|
|
19
|
+
this.availableOptions = this.availableOptions.map((t) => (t.value === e.value && (t.selected = !e.selected), t));
|
|
20
|
+
const a = this.availableOptions.filter((t) => t.selected).map((t) => t.value);
|
|
21
|
+
this.selectedOptionsChanged.emit({
|
|
22
|
+
value: a,
|
|
23
|
+
name: this.name
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
toggleDropdown() {
|
|
27
|
+
this.isOpen = !this.isOpen, this.isOpen ? this.shouldFocusFirstOption = !0 : this.ariaActivedescendant = "";
|
|
28
|
+
}
|
|
29
|
+
handleSelectButtonKeyDown(e) {
|
|
30
|
+
switch (e.key) {
|
|
31
|
+
case "ArrowDown":
|
|
32
|
+
case "Enter":
|
|
33
|
+
e.preventDefault(), this.isOpen || this.toggleDropdown();
|
|
34
|
+
break;
|
|
35
|
+
case "Escape":
|
|
36
|
+
this.isOpen = !1;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
handleListboxKeydown(e) {
|
|
41
|
+
const a = this.availableOptions, t = a.findIndex((n) => n.value === this.ariaActivedescendant);
|
|
42
|
+
switch (e.key) {
|
|
43
|
+
case "ArrowDown":
|
|
44
|
+
case "Tab":
|
|
45
|
+
if (e.shiftKey) {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
const i = t - 1 >= 0 ? t - 1 : a.length - 1;
|
|
48
|
+
this.ariaActivedescendant = a[i].value, this.focusOption(i);
|
|
49
|
+
} else {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
const i = t + 1 < a.length ? t + 1 : 0;
|
|
52
|
+
this.ariaActivedescendant = a[i].value, this.focusOption(i);
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
case "ArrowUp":
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
const n = t - 1 >= 0 ? t - 1 : a.length - 1;
|
|
58
|
+
this.ariaActivedescendant = a[n].value, this.focusOption(n);
|
|
59
|
+
break;
|
|
60
|
+
case "Enter":
|
|
61
|
+
e.preventDefault(), this.ariaActivedescendant && this.selectOption(a[t]);
|
|
62
|
+
break;
|
|
63
|
+
case "Escape":
|
|
64
|
+
this.isOpen = !1;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
focusOption(e) {
|
|
69
|
+
var i;
|
|
70
|
+
const a = this.availableOptions[e];
|
|
71
|
+
if (!a)
|
|
72
|
+
return;
|
|
73
|
+
const t = a.value, n = (i = this.el.shadowRoot) == null ? void 0 : i.getElementById(t);
|
|
74
|
+
n && (n.focus(), n.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
75
|
+
}
|
|
76
|
+
getSelectedOptions() {
|
|
77
|
+
return this.availableOptions.filter((e) => e.selected);
|
|
78
|
+
}
|
|
79
|
+
renderOption(e) {
|
|
80
|
+
return s("li", { key: e.value, id: e.value, role: "option", tabindex: "0", "aria-selected": e.selected ? "true" : "false", onClick: (a) => {
|
|
81
|
+
a.stopImmediatePropagation(), this.selectOption(e);
|
|
82
|
+
}, 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)));
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
var e, a;
|
|
86
|
+
return s(d, { key: "9417bddaf55644bed09f9307e395493edff182f7" }, s("div", { key: "2c117b95885d3b5050fa430bdab613fefbe80c8e", class: "dropdown", part: "msd_dropdown" }, s("label", { key: "0068b39a03678248b2225d4c355403df20e4e157", class: "dropdown-label" }, this.label, s("slot", { key: "25f55fdf4da7980ba1c4af4ce0751c7e9b8c9ddd", name: "label-icon", "aria-hidden": "true" })), s("button", { key: "a637c27dc2aa8b270115b42f70cb5b87a89f32dd", 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(), "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? "true" : "false", "aria-label": this.name, onKeyDown: (t) => this.handleSelectButtonKeyDown(t) }, s("slot", { key: "7fb4005ea067df4eec7dd9b167b440c685475f19", name: "select-icon", "aria-hidden": "true" }), s("span", { key: "d21978886c1eb01961e01f12c837a638bd3d740b", 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: "99b5343dc6f1bcd0488d8d7eebf3256780a89dd4", class: this.isOpen ? "open" : "closed", "aria-hidden": "true" }, s("chevron-icon", { key: "3fc6cbe2b3e4dc995989affc69f50339a07e2338", width: "16", height: "16" }))), this.error ? s("span", { class: "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", { 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));
|
|
87
|
+
}
|
|
88
|
+
get el() {
|
|
89
|
+
return c(this);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
h.style = b;
|
|
93
|
+
export {
|
|
94
|
+
h as multi_select_dropdown
|
|
95
|
+
};
|