@nylas/react 2.0.3 → 2.0.6
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/{abstract-provider-bdb7d9b4-12a95387.cjs → abstract-provider-45ada3b4-31e3ed72.cjs} +1 -1
- package/dist/{abstract-provider-bdb7d9b4-22cf4a74.js → abstract-provider-45ada3b4-abd3105d.js} +1 -1
- package/dist/{add-circle-icon_2.entry-d56f519c.cjs → add-circle-icon_2.entry-48953f9c.cjs} +1 -1
- package/dist/{add-circle-icon_2.entry-0ff79148.js → add-circle-icon_2.entry-f6f8b5e5.js} +1 -1
- package/dist/{archive-icon.entry-aaff46ec.js → archive-icon.entry-b3a76711.js} +1 -1
- package/dist/{archive-icon.entry-6ab120ff.cjs → archive-icon.entry-e2880dc7.cjs} +1 -1
- package/dist/{arrow-icon.entry-d57cf44f.cjs → arrow-icon.entry-84d1e26c.cjs} +1 -1
- package/dist/{arrow-icon.entry-d8fcbc1f.js → arrow-icon.entry-9b3441aa.js} +1 -1
- package/dist/{bold-icon.entry-e48075a4.js → bold-icon.entry-0749a116.js} +1 -1
- package/dist/{bold-icon.entry-0f23543d.cjs → bold-icon.entry-e1d8ab5e.cjs} +1 -1
- package/dist/{button-component_2.entry-3d622397.cjs → button-component_2.entry-1a817230.cjs} +1 -1
- package/dist/{button-component_2.entry-5db80bec.js → button-component_2.entry-6eb55e97.js} +1 -1
- package/dist/calendar-agenda-fill-icon_37.entry-0ca8b9f4.cjs +6 -0
- package/dist/calendar-agenda-fill-icon_37.entry-4adf73a2.js +5231 -0
- package/dist/{calendar-cancel-icon.entry-8b43441c.js → calendar-cancel-icon.entry-2a29cb3f.js} +1 -1
- package/dist/{calendar-cancel-icon.entry-9546c7c3.cjs → calendar-cancel-icon.entry-e0dee585.cjs} +1 -1
- package/dist/{calendar-check-icon.entry-a03b249a.cjs → calendar-check-icon.entry-7f96d456.cjs} +1 -1
- package/dist/{calendar-check-icon.entry-4e6abda7.js → calendar-check-icon.entry-c12b63ea.js} +1 -1
- package/dist/{calendar-icon.entry-cd4b0ec4.cjs → calendar-icon.entry-a2d19ff2.cjs} +1 -1
- package/dist/{calendar-icon.entry-5b622c12.js → calendar-icon.entry-e82a5169.js} +1 -1
- package/dist/checkbox-component.entry-59612a67.js +52 -0
- package/dist/checkbox-component.entry-ddce70bc.cjs +1 -0
- package/dist/checkbox-group_4.entry-3311da64.cjs +28 -0
- package/dist/{checkbox-group_4.entry-b2a5b2b2.js → checkbox-group_4.entry-7df47ad4.js} +287 -246
- package/dist/{checkmark-circle-icon.entry-30582af4.js → checkmark-circle-icon.entry-677b0def.js} +1 -1
- package/dist/{checkmark-circle-icon.entry-9617301c.cjs → checkmark-circle-icon.entry-67df713b.cjs} +1 -1
- package/dist/checkmark-icon_15.entry-2121e1b7.cjs +5 -0
- package/dist/checkmark-icon_15.entry-9fd0ec58.js +1412 -0
- package/dist/chevron-icon_3.entry-1a42235c.cjs +1 -0
- package/dist/{chevron-icon_3.entry-517447a6.js → chevron-icon_3.entry-f0ad71d9.js} +19 -10
- package/dist/{clock-icon_4.entry-5351318c.cjs → clock-icon_4.entry-88822a84.cjs} +1 -1
- package/dist/{clock-icon_4.entry-7ea1274d.js → clock-icon_4.entry-e7472d5f.js} +1 -1
- package/dist/{customParseFormat-f0d21eb3-904f1e57.js → customParseFormat-eeec04f5-3ad26beb.js} +1 -1
- package/dist/{customParseFormat-f0d21eb3-769d6bf2.cjs → customParseFormat-eeec04f5-d5957784.cjs} +1 -1
- package/dist/{delete-icon.entry-64b61f5c.cjs → delete-icon.entry-3cb58910.cjs} +1 -1
- package/dist/{delete-icon.entry-02e44ba1.js → delete-icon.entry-813429d7.js} +1 -1
- package/dist/{document-refresh-icon.entry-2f599a22.cjs → document-refresh-icon.entry-ae361b0b.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-fcaa84ad.js → document-refresh-icon.entry-c224c778.js} +1 -1
- package/dist/{feedbackSync-b9c9e719-b54b3268.js → feedbackSync-0ebd0eda-803c3ebe.js} +1 -1
- package/dist/{feedbackSync-b9c9e719-bee3fea1.cjs → feedbackSync-0ebd0eda-e12b00d5.cjs} +1 -1
- package/dist/{folder-icon.entry-55c123dc.cjs → folder-icon.entry-107841af.cjs} +1 -1
- package/dist/{folder-icon.entry-f4862c1b.js → folder-icon.entry-9c1f7c41.js} +1 -1
- package/dist/{forward-icon.entry-4a41e94f.js → forward-icon.entry-4ac22c16.js} +1 -1
- package/dist/{forward-icon.entry-82719382.cjs → forward-icon.entry-6cec1f94.cjs} +1 -1
- package/dist/globe-icon.entry-7798c93b.js +16 -0
- package/dist/globe-icon.entry-909c1382.cjs +1 -0
- package/dist/google-logo-icon_6.entry-1f4ad364.cjs +2 -0
- package/dist/{google-logo-icon_6.entry-b331ab60.js → google-logo-icon_6.entry-b198c90a.js} +332 -282
- package/dist/{google-meet-icon_5.entry-e3d44d56.cjs → google-meet-icon_5.entry-82d87e77.cjs} +1 -1
- package/dist/{google-meet-icon_5.entry-eb9f7d93.js → google-meet-icon_5.entry-fa6dc1dc.js} +1 -1
- package/dist/{inbox-icon.entry-a385095d.js → inbox-icon.entry-1b123e64.js} +1 -1
- package/dist/{inbox-icon.entry-fa9085cd.cjs → inbox-icon.entry-84f96d31.cjs} +1 -1
- package/dist/{index-ad781fbc.js → index-140eb219.js} +6753 -6439
- package/dist/index-d8a42c15.cjs +118 -0
- package/dist/{index.es-ccb2a286-dfa2bfbe.js → index.es-57d4a08f-184cbc01.js} +1 -1
- package/dist/{index.es-ccb2a286-9a2c0934.cjs → index.es-57d4a08f-b0a2ca19.cjs} +1 -1
- package/dist/info-icon_2.entry-f09e7dae.cjs +1 -0
- package/dist/info-icon_2.entry-f8b72d08.js +35 -0
- package/dist/input-component.entry-44607977.js +93 -0
- package/dist/input-component.entry-fd38953d.cjs +1 -0
- package/dist/input-dropdown_2.entry-4c2e5e1a.cjs +1 -0
- package/dist/{input-dropdown_2.entry-1b55ef0c.js → input-dropdown_2.entry-6898b420.js} +30 -9
- package/dist/{italic-icon.entry-4266a817.js → italic-icon.entry-16aa1ada.js} +1 -1
- package/dist/{italic-icon.entry-843feb2b.cjs → italic-icon.entry-beef2254.cjs} +1 -1
- package/dist/lib/elements/index.d.ts +1 -0
- package/dist/lib/notetaker/SendNotetaker/SendNotetaker.d.ts +3 -2
- package/dist/lib/notetaker/VideoPlayer/VideoPlayer.d.ts +2 -0
- package/dist/lib/notetaker/lib/store.d.ts +1 -2
- package/dist/multi-select-dropdown.entry-50133d29.js +130 -0
- package/dist/multi-select-dropdown.entry-c82cd6d4.cjs +1 -0
- package/dist/{nylas-booked-event-card_11.entry-ccf30d91.js → nylas-booked-event-card_11.entry-56768a09.js} +69 -69
- package/dist/nylas-booked-event-card_11.entry-eb4b3c5c.cjs +1 -0
- package/dist/nylas-date-component_2.entry-93f2f352.cjs +1 -0
- package/dist/nylas-date-component_2.entry-df957150.js +307 -0
- package/dist/nylas-form-card.entry-4d95a4ad.cjs +1 -0
- package/dist/nylas-form-card.entry-7724e61f.js +72 -0
- package/dist/nylas-notification_2.entry-448c2cb8.cjs +1 -0
- package/dist/nylas-notification_2.entry-af763b6c.js +85 -0
- package/dist/{nylas-scheduler-editor.entry-aa079dff.js → nylas-scheduler-editor.entry-0e4ba46d.js} +45 -34
- package/dist/{nylas-scheduler-editor.entry-9744694a.cjs → nylas-scheduler-editor.entry-e36cdd9d.cjs} +2 -2
- package/dist/{nylas-scheduling.entry-7441979c.js → nylas-scheduling.entry-1b207e91.js} +196 -185
- package/dist/nylas-scheduling.entry-904dd10e.cjs +1 -0
- package/dist/{person-icon.entry-acf4d22b.cjs → person-icon.entry-70d46ca6.cjs} +1 -1
- package/dist/{person-icon.entry-23a69633.js → person-icon.entry-f2979577.js} +1 -1
- package/dist/{play-icon.entry-aa088180.cjs → play-icon.entry-c2cf0b12.cjs} +1 -1
- package/dist/{play-icon.entry-4e7884d4.js → play-icon.entry-d387df5d.js} +1 -1
- package/dist/radio-button-group.entry-45dbd2df.js +56 -0
- package/dist/radio-button-group.entry-94e06176.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +41 -40
- package/dist/{refresh-icon.entry-96cb008f.cjs → refresh-icon.entry-5ab20f26.cjs} +1 -1
- package/dist/{refresh-icon.entry-d1603555.js → refresh-icon.entry-777cff27.js} +1 -1
- package/dist/{register-component-9d4ceee5-46f58baf.js → register-component-0aad9e3d-b395364a.js} +1 -1
- package/dist/{register-component-9d4ceee5-6fabc42c.cjs → register-component-0aad9e3d-d2f2e543.cjs} +1 -1
- package/dist/{reply-all-icon.entry-537f7718.cjs → reply-all-icon.entry-3c90510e.cjs} +1 -1
- package/dist/{reply-all-icon.entry-6fae7288.js → reply-all-icon.entry-e2dd6da9.js} +1 -1
- package/dist/{reply-icon.entry-ae114e35.js → reply-icon.entry-00a97d9f.js} +1 -1
- package/dist/{reply-icon.entry-72fa6e4c.cjs → reply-icon.entry-d96478be.cjs} +1 -1
- package/dist/{sent-icon.entry-30a6ac17.cjs → sent-icon.entry-2d16da4e.cjs} +1 -1
- package/dist/{sent-icon.entry-b10d5e26.js → sent-icon.entry-949cf214.js} +1 -1
- package/dist/{spam-icon.entry-bed45849.js → spam-icon.entry-3baf9e79.js} +1 -1
- package/dist/{spam-icon.entry-357aa525.cjs → spam-icon.entry-7ee61730.cjs} +1 -1
- package/dist/{star-icon.entry-010349a5.js → star-icon.entry-9fdb278b.js} +1 -1
- package/dist/{star-icon.entry-53c85ebb.cjs → star-icon.entry-dc702d73.cjs} +1 -1
- package/dist/{stop-icon.entry-20af3bf5.cjs → stop-icon.entry-b5ae7e55.cjs} +1 -1
- package/dist/{stop-icon.entry-18f650bf.js → stop-icon.entry-efa1ea66.js} +1 -1
- package/dist/textarea-component.entry-247aca42.cjs +1 -0
- package/dist/textarea-component.entry-7c6fc4d8.js +55 -0
- package/dist/toggle-switch.entry-a0295d17.js +49 -0
- package/dist/toggle-switch.entry-d52b0338.cjs +1 -0
- package/dist/{translate-icon.entry-2308a8e4.js → translate-icon.entry-219cab17.js} +1 -1
- package/dist/{translate-icon.entry-7cb7a479.cjs → translate-icon.entry-985b3b29.cjs} +1 -1
- package/dist/{trash-fill-icon.entry-7f410c82.js → trash-fill-icon.entry-03c90559.js} +1 -1
- package/dist/{trash-fill-icon.entry-c70b9326.cjs → trash-fill-icon.entry-4dfd7d24.cjs} +1 -1
- package/dist/{underline-icon.entry-58ef1a9f.js → underline-icon.entry-58fa18b5.js} +1 -1
- package/dist/{underline-icon.entry-23f478f3.cjs → underline-icon.entry-c60b77a6.cjs} +1 -1
- package/package.json +3 -3
- package/dist/calendar-agenda-fill-icon_36.entry-75d7cd5b.cjs +0 -6
- package/dist/calendar-agenda-fill-icon_36.entry-78fc2e0d.js +0 -4708
- package/dist/checkbox-component_2.entry-82f4b1f2.js +0 -115
- package/dist/checkbox-component_2.entry-c9c8a87d.cjs +0 -1
- package/dist/checkbox-group_4.entry-5a4f0ed2.cjs +0 -28
- package/dist/checkmark-icon_15.entry-01536ed2.js +0 -1339
- package/dist/checkmark-icon_15.entry-c5eaad9b.cjs +0 -5
- package/dist/chevron-icon_3.entry-26f14744.cjs +0 -1
- package/dist/globe-icon_2.entry-3f0e408e.cjs +0 -1
- package/dist/globe-icon_2.entry-8f5c79b2.js +0 -210
- package/dist/google-logo-icon_6.entry-9c91c3d4.cjs +0 -2
- package/dist/index-dc6efb5e.cjs +0 -118
- package/dist/info-icon_2.entry-9f32753b.cjs +0 -1
- package/dist/info-icon_2.entry-c18a111e.js +0 -35
- package/dist/input-component.entry-eae64f46.js +0 -84
- package/dist/input-component.entry-ff9e04c9.cjs +0 -1
- package/dist/input-dropdown_2.entry-67d6d292.cjs +0 -1
- package/dist/multi-select-dropdown.entry-854265ef.js +0 -121
- package/dist/multi-select-dropdown.entry-ca9acf75.cjs +0 -1
- package/dist/nylas-booked-event-card_11.entry-8d3e2019.cjs +0 -1
- package/dist/nylas-form-card.entry-481ede48.js +0 -58
- package/dist/nylas-form-card.entry-58162c72.cjs +0 -1
- package/dist/nylas-notification_2.entry-7d3ed3b0.js +0 -85
- package/dist/nylas-notification_2.entry-dffa3ff6.cjs +0 -1
- package/dist/nylas-scheduling.entry-b1fcb48f.cjs +0 -1
- package/dist/radio-button-group.entry-243d7988.js +0 -47
- package/dist/radio-button-group.entry-cea225c8.cjs +0 -1
- package/dist/textarea-component.entry-b19642f1.cjs +0 -1
- package/dist/textarea-component.entry-e6120440.js +0 -39
- package/dist/toggle-switch.entry-32b0e964.js +0 -34
- package/dist/toggle-switch.entry-becdda2c.cjs +0 -1
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { r as g, a as o, y as d, h as n, g as v, d as l, i as c, W as h, X as m, L as x, Y as u, Z as p, M as b, H as w } from "./index-140eb219.js";
|
|
2
|
+
import { L as f } from "./constants-f51538ef-e0a5f026.js";
|
|
3
|
+
import { c as k } from "./customParseFormat-eeec04f5-3ad26beb.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "react-dom";
|
|
7
|
+
const T = ':host{display:block;height:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;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);border-color:var(--nylas-error)}.input_wrapper{display:flex;align-items:center;gap:1rem}input[type=date]{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:100%;width:-moz-available;width:-webkit-fill-available;font-family:var(--nylas-font-family);padding:0 8px;cursor:pointer}input[type=date]:focus{outline-color:var(--nylas-primary)}input[type=date].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=date].error::placeholder{font-weight:400}input[type=date]::placeholder{color:var(--nylas-base-300)}input[type=date]::-webkit-calendar-picker-indicator{filter:invert(37%) sepia(51%) saturate(6324%) hue-rotate(215deg) brightness(94%) contrast(95%);cursor:pointer}input:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}', C = T, I = {
|
|
8
|
+
date: "YYYY-MM-DD"
|
|
9
|
+
}, F = class {
|
|
10
|
+
constructor(t) {
|
|
11
|
+
g(this, t), this.nylasFormInputChanged = o(this, "nylasFormInputChanged", 7), this.nylasFormInputFocused = o(this, "nylasFormInputFocused", 7), this.nylasFormInputBlurred = o(this, "nylasFormInputBlurred", 7), this.name = "input", this.defaultValue = void 0, this.label = "", this.placeholder = I.date, this.required = !1, this.readOnly = !1, this.autoFocus = !1, this.pattern = void 0, this.maxLength = 255, this.patternError = "", this.requiredError = "", this.errorMessage = "", this.minDate = void 0, this.hasError = !1, this.themeConfig = void 0, this.value = void 0, this.error = "", this.isDateValid = !0;
|
|
12
|
+
}
|
|
13
|
+
handleDefaultValueChange(t) {
|
|
14
|
+
this.value = d(t), this.value && this.validatePattern(this.value, !0);
|
|
15
|
+
}
|
|
16
|
+
themeConfigChangedHandler(t, e) {
|
|
17
|
+
t !== e && this.applyThemeConfig(t);
|
|
18
|
+
}
|
|
19
|
+
applyThemeConfig(t) {
|
|
20
|
+
if (t)
|
|
21
|
+
for (const [e, i] of Object.entries(t))
|
|
22
|
+
this.el.style.setProperty(`${e}`, i);
|
|
23
|
+
}
|
|
24
|
+
componentDidLoad() {
|
|
25
|
+
this.value = d(this.defaultValue || ""), this.value && this.validatePattern(this.value, !0), this.applyThemeConfig(this.themeConfig);
|
|
26
|
+
}
|
|
27
|
+
handleBookingFormSubmitted(t) {
|
|
28
|
+
this.validatePattern(this.value), this.error && t.preventDefault();
|
|
29
|
+
}
|
|
30
|
+
async handleFormSubmitted(t) {
|
|
31
|
+
this.validatePattern(this.value), this.error && t.preventDefault();
|
|
32
|
+
}
|
|
33
|
+
handleInput(t) {
|
|
34
|
+
this.error = "";
|
|
35
|
+
const e = t.target;
|
|
36
|
+
this.value = d(e.value), this.isDateValid = e.validity.valid, this.nylasFormInputChanged.emit({
|
|
37
|
+
value: this.value,
|
|
38
|
+
name: this.name,
|
|
39
|
+
label: this.label,
|
|
40
|
+
error: this.error,
|
|
41
|
+
type: "date"
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
handleBlur() {
|
|
45
|
+
this.nylasFormInputBlurred.emit({
|
|
46
|
+
value: this.value,
|
|
47
|
+
name: this.name
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
handleFocus() {
|
|
51
|
+
this.nylasFormInputFocused.emit({
|
|
52
|
+
value: this.value,
|
|
53
|
+
name: this.name
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
validatePattern(t, e = !1) {
|
|
57
|
+
if (this.error = "", !e && (this.required && !this.isDateValid || this.minDate && new Date(this.minDate) > new Date(t))) {
|
|
58
|
+
this.error = this.errorMessage || "Please enter a valid date", this.nylasFormInputChanged.emit({
|
|
59
|
+
value: this.value,
|
|
60
|
+
name: this.name,
|
|
61
|
+
label: this.label,
|
|
62
|
+
error: this.error,
|
|
63
|
+
type: "date"
|
|
64
|
+
});
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (this.required && !t) {
|
|
68
|
+
this.error = this.requiredError || "This field is required.";
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
!this.pattern || !t && !this.required || (this.pattern.test(t) ? this.error = "" : this.error = this.patternError || "Invalid format.");
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
return n("label", { key: "19e91d1f34df671a8c3fb97ca4cb9361baccaeb3", part: "ic__label", class: { error: !!this.error || this.hasError } }, this.label && n("p", null, n("span", { class: "label" }, this.label), this.required && n("span", { class: "required" }, "*")), n("div", { key: "fd3f370a7469135b82c876938a5c1df1faedfd31", part: "ic__input_wrapper", class: "input_wrapper" }, n("input", { key: "a27ac166f7512464ed9e2caf10539ae60e0df92a", type: "date", name: this.name, part: "ic__date", title: this.readOnly ? "read-only field" : void 0, readOnly: this.readOnly, autoFocus: this.autoFocus, value: this.value, min: this.minDate, maxLength: this.maxLength, placeholder: this.placeholder, class: { error: !!this.error || this.hasError }, onInput: (t) => this.handleInput(t), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }), n("slot", { key: "2d3806006d35fecaa9b48a878eb4216249cdc80f", name: "additional-input" })), this.error && n("span", { class: "error help-text" }, this.error));
|
|
75
|
+
}
|
|
76
|
+
get el() {
|
|
77
|
+
return v(this);
|
|
78
|
+
}
|
|
79
|
+
static get watchers() {
|
|
80
|
+
return {
|
|
81
|
+
defaultValue: ["handleDefaultValueChange"],
|
|
82
|
+
themeConfig: ["themeConfigChangedHandler"]
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
F.style = C;
|
|
87
|
+
const A = ':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;color:var(--nylas-base-900);cursor:pointer;background:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:var(--nylas-base-0)}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times 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:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}', D = A;
|
|
88
|
+
l.extend(k);
|
|
89
|
+
const S = class {
|
|
90
|
+
constructor(t) {
|
|
91
|
+
g(this, t), this.timeChange = o(this, "timeChange", 7), this.timeWindowFormError = o(this, "timeWindowFormError", 7), this.time = void 0, this.minimumStartTime = null, this.placeholder = "hh:mmam/pm", this.name = void 0, this.hasError = !1, this.language = f.en, this.themeConfig = void 0, this.err = "", this.showTimes = !1, this.ariaActivedescendant = "", this.times = this.generateTimes(), this.shouldAutoScroll = !1;
|
|
92
|
+
}
|
|
93
|
+
handleOutsideClick(t) {
|
|
94
|
+
!t.composedPath().includes(this.el) && this.showTimes && (this.showTimes = !1);
|
|
95
|
+
}
|
|
96
|
+
timeChangedHandler() {
|
|
97
|
+
this.validateTimeAgainstMinimum();
|
|
98
|
+
}
|
|
99
|
+
minimumStartTimeChangedHandler() {
|
|
100
|
+
this.validateTimeAgainstMinimum();
|
|
101
|
+
}
|
|
102
|
+
themeConfigChangedHandler(t, e) {
|
|
103
|
+
this.applyThemeConfig(t);
|
|
104
|
+
}
|
|
105
|
+
applyThemeConfig(t) {
|
|
106
|
+
if (t)
|
|
107
|
+
for (const [e, i] of Object.entries(t))
|
|
108
|
+
this.el.style.setProperty(`${e}`, i);
|
|
109
|
+
}
|
|
110
|
+
validateTimeAgainstMinimum() {
|
|
111
|
+
if (this.minimumStartTime) {
|
|
112
|
+
const t = l(this.minimumStartTime, "hh:mma"), e = l(this.time, "hh:mma");
|
|
113
|
+
this.times = this.generateTimes();
|
|
114
|
+
const i = c.t("nylasTimeWindowPicker.errors.invalid");
|
|
115
|
+
e.isBefore(t) ? (this.err = i, this.timeWindowFormError.emit({
|
|
116
|
+
key: this.el.id,
|
|
117
|
+
message: i
|
|
118
|
+
})) : (this.err = "", this.timeWindowFormError.emit({
|
|
119
|
+
key: this.el.id,
|
|
120
|
+
message: ""
|
|
121
|
+
}));
|
|
122
|
+
} else
|
|
123
|
+
this.err = "", this.timeWindowFormError.emit({
|
|
124
|
+
key: this.el.id,
|
|
125
|
+
message: ""
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
componentDidLoad() {
|
|
129
|
+
this.validateTimeAgainstMinimum(), this.applyThemeConfig(this.themeConfig);
|
|
130
|
+
}
|
|
131
|
+
componentDidRender() {
|
|
132
|
+
if (this.showTimes && this.shouldAutoScroll) {
|
|
133
|
+
const t = h(this.time), e = this.times.findIndex((i) => i.value === t);
|
|
134
|
+
e > -1 && (this.shouldAutoScroll = !1, this.scrollToViewWithinParent(e));
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
handleTimeChange(t, e) {
|
|
139
|
+
const i = e.split(":");
|
|
140
|
+
if (i[0] === "00" && i[1].slice(-2) == "pm") {
|
|
141
|
+
const s = c.t("nylasTimeWindowPicker.errors.invalid");
|
|
142
|
+
this.err = s, this.timeWindowFormError.emit({
|
|
143
|
+
key: this.el.id,
|
|
144
|
+
message: s
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (m(e))
|
|
148
|
+
this.err = "", this.timeWindowFormError.emit({
|
|
149
|
+
key: this.el.id,
|
|
150
|
+
message: ""
|
|
151
|
+
});
|
|
152
|
+
else {
|
|
153
|
+
const s = c.t("nylasTimeWindowPicker.errors.invalid");
|
|
154
|
+
this.err = s, this.timeWindowFormError.emit({
|
|
155
|
+
key: this.el.id,
|
|
156
|
+
message: s
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
this.err || this.timeChange.emit({
|
|
160
|
+
key: this.el.id,
|
|
161
|
+
value: e
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
handleTimeAutocomplete(t) {
|
|
165
|
+
var a;
|
|
166
|
+
const e = (a = t.target) == null ? void 0 : a.value, i = this.language !== f.en ? x(e) : e, s = c.t("nylasTimeWindowPicker.errors.invalid");
|
|
167
|
+
if (!m(i)) {
|
|
168
|
+
this.err = s, this.timeWindowFormError.emit({
|
|
169
|
+
key: this.el.id,
|
|
170
|
+
message: s
|
|
171
|
+
});
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (i === "") {
|
|
175
|
+
const r = u().format("hh:mma");
|
|
176
|
+
this.timeChange.emit({
|
|
177
|
+
key: this.el.id,
|
|
178
|
+
value: r
|
|
179
|
+
});
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (!p(i)) {
|
|
183
|
+
const r = h(i);
|
|
184
|
+
this.timeChange.emit({
|
|
185
|
+
key: this.el.id,
|
|
186
|
+
value: r
|
|
187
|
+
});
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
this.timeChange.emit({
|
|
191
|
+
key: this.el.id,
|
|
192
|
+
value: i
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
handleOnInput(t) {
|
|
196
|
+
var i;
|
|
197
|
+
const e = (i = t.target) == null ? void 0 : i.value;
|
|
198
|
+
if (m(e)) {
|
|
199
|
+
if (e === "") {
|
|
200
|
+
const s = u().format("hh:mma"), a = this.times.findIndex((r) => r.value === s);
|
|
201
|
+
a > -1 && this.scrollToViewWithinParent(a);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (!p(e)) {
|
|
205
|
+
const s = h(e), a = this.times.findIndex((r) => r.value === s);
|
|
206
|
+
a > -1 && this.scrollToViewWithinParent(a);
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
generateTimes() {
|
|
212
|
+
const t = [];
|
|
213
|
+
let e = l().set("hour", 0).set("minute", 0).set("second", 0);
|
|
214
|
+
this.minimumStartTime && (e = l(this.minimumStartTime, "hh:mma"));
|
|
215
|
+
const i = e.endOf("day").diff(e, "minutes"), s = Math.round(i / 15);
|
|
216
|
+
for (let a = 0; a < s + 1; a++) {
|
|
217
|
+
const r = e.add(a * 15, "minute");
|
|
218
|
+
if (a == s && r.format("hh:mma").includes("am"))
|
|
219
|
+
break;
|
|
220
|
+
t.push({ id: a, value: r.format("hh:mma") });
|
|
221
|
+
}
|
|
222
|
+
return t;
|
|
223
|
+
}
|
|
224
|
+
handleComboboxKeyDown(t) {
|
|
225
|
+
if (t.key === "ArrowDown") {
|
|
226
|
+
if (t.preventDefault(), !this.showTimes) {
|
|
227
|
+
this.showTimes = !0, this.shouldAutoScroll = !0;
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (this.ariaActivedescendant === "")
|
|
231
|
+
this.ariaActivedescendant = this.times[0].id.toString(), this.focusOption(0);
|
|
232
|
+
else {
|
|
233
|
+
const e = this.times.findIndex((s) => s.id.toString() === this.ariaActivedescendant), i = e + 1 < this.times.length ? e + 1 : 0;
|
|
234
|
+
this.ariaActivedescendant = this.times[i].id.toString(), this.focusOption(i);
|
|
235
|
+
}
|
|
236
|
+
} else if (t.key === "ArrowUp")
|
|
237
|
+
if (t.preventDefault(), this.ariaActivedescendant === "")
|
|
238
|
+
this.ariaActivedescendant = this.times[this.times.length - 1].id.toString(), this.focusOption(this.times.length - 1);
|
|
239
|
+
else {
|
|
240
|
+
const e = this.times.findIndex((s) => s.id.toString() === this.ariaActivedescendant), i = e - 1 >= 0 ? e - 1 : this.times.length - 1;
|
|
241
|
+
this.ariaActivedescendant = this.times[i].id.toString(), this.focusOption(i);
|
|
242
|
+
}
|
|
243
|
+
else
|
|
244
|
+
t.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
|
|
245
|
+
}
|
|
246
|
+
handleListboxKeydown(t) {
|
|
247
|
+
const e = this.times, i = e.findIndex((s) => s.id.toString() === this.ariaActivedescendant);
|
|
248
|
+
if (t.key === "ArrowDown" || t.key === "Tab" && !t.shiftKey) {
|
|
249
|
+
t.preventDefault();
|
|
250
|
+
const s = i + 1 < e.length ? i + 1 : 0;
|
|
251
|
+
this.ariaActivedescendant = e[s].id.toString(), this.focusOption(s);
|
|
252
|
+
} else if (t.key === "ArrowUp" || t.key === "Tab" && t.shiftKey) {
|
|
253
|
+
t.preventDefault();
|
|
254
|
+
const s = i - 1 >= 0 ? i - 1 : e.length - 1;
|
|
255
|
+
this.ariaActivedescendant = e[s].id.toString(), this.focusOption(s);
|
|
256
|
+
} else if (t.key === "Enter") {
|
|
257
|
+
if (t.preventDefault(), this.ariaActivedescendant) {
|
|
258
|
+
const s = e[i];
|
|
259
|
+
this.handleTimeChange(t, s.value), this.showTimes = !1, this.ariaActivedescendant = "", this.timeInput.focus();
|
|
260
|
+
}
|
|
261
|
+
} else
|
|
262
|
+
t.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
|
|
263
|
+
}
|
|
264
|
+
scrollToViewWithinParent(t) {
|
|
265
|
+
var y;
|
|
266
|
+
const e = this.times[t], i = (y = this.el.shadowRoot) == null ? void 0 : y.getElementById(e.id.toString()), s = this.timeMenu;
|
|
267
|
+
this.ariaActivedescendant = e.id.toString();
|
|
268
|
+
const a = i.getBoundingClientRect(), r = s.getBoundingClientRect();
|
|
269
|
+
a.top < r.top ? s.scrollTop -= r.top - a.top : a.bottom > r.bottom && (s.scrollTop += a.bottom - r.bottom), a.left < r.left ? s.scrollLeft -= r.left - a.left : a.right > r.right && (s.scrollLeft += a.right - r.right);
|
|
270
|
+
}
|
|
271
|
+
focusOption(t) {
|
|
272
|
+
var a;
|
|
273
|
+
const e = this.times[t];
|
|
274
|
+
if (!e)
|
|
275
|
+
return;
|
|
276
|
+
const i = e.id.toString(), s = (a = this.el.shadowRoot) == null ? void 0 : a.getElementById(i);
|
|
277
|
+
s && (s.focus(), s.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
278
|
+
}
|
|
279
|
+
render() {
|
|
280
|
+
const t = this.language !== f.en;
|
|
281
|
+
return n(w, { key: "748ab1dcf12c2e1284ca11883dcaade689d3150f" }, n("div", { key: "77369574660ea9e48f8ed77c4b4cc51cf328690a", class: "time-picker", part: "time-picker" }, n("input", { key: "09fd3119ae7763a492068860d9a20ed06e1bf0ac", type: "text", name: this.name, id: this.name, part: "time-input", class: {
|
|
282
|
+
"time-input": !0,
|
|
283
|
+
error: !!this.err || this.hasError
|
|
284
|
+
}, ref: (e) => this.timeInput = e, value: t ? b(this.time) : this.time, onClick: () => {
|
|
285
|
+
this.showTimes = !this.showTimes, this.shouldAutoScroll = !0;
|
|
286
|
+
}, "aria-haspopup": "listbox", "aria-label": this.name, "aria-expanded": this.showTimes ? "true" : "false", placeholder: this.placeholder, onKeyDown: (e) => this.handleComboboxKeyDown(e), onInput: (e) => this.handleOnInput(e), onBlur: (e) => this.handleTimeAutocomplete(e) }), this.err && n("div", { class: "invalid-time-icon" }), this.showTimes && n("div", { class: "times", part: "times", ref: (e) => this.timeMenu = e }, n("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (e) => this.handleListboxKeydown(e) }, this.times.map((e) => n("li", { tabindex: "0", key: e.id, id: e.id.toString(), class: {
|
|
287
|
+
focused: this.ariaActivedescendant === e.id.toString()
|
|
288
|
+
}, onClick: (i) => {
|
|
289
|
+
this.handleTimeChange(i, e.value), this.showTimes = !1, this.timeInput.focus();
|
|
290
|
+
}, role: "option" }, `${t ? b(e.value) : e.value}`)))), !this.showTimes && this.err && n("p", { class: "error", id: "email-error" }, this.err)));
|
|
291
|
+
}
|
|
292
|
+
get el() {
|
|
293
|
+
return v(this);
|
|
294
|
+
}
|
|
295
|
+
static get watchers() {
|
|
296
|
+
return {
|
|
297
|
+
time: ["timeChangedHandler"],
|
|
298
|
+
minimumStartTime: ["minimumStartTimeChangedHandler"],
|
|
299
|
+
themeConfig: ["themeConfigChangedHandler"]
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
S.style = D;
|
|
304
|
+
export {
|
|
305
|
+
F as nylas_date_component,
|
|
306
|
+
S as nylas_time_window_picker
|
|
307
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-d8a42c15.cjs"),d=require("./register-component-0aad9e3d-d2f2e543.cjs");require("react");require("react/jsx-runtime");require("react-dom");const b='.sc-nylas-form-card-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-form-card.sc-nylas-form-card{width:100%;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-form-card__header.sc-nylas-form-card{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}',i=b;var u=function(e,l,n,o){var s=arguments.length,r=s<3?l:o===null?o=Object.getOwnPropertyDescriptor(l,n):o,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,l,n,o);else for(var t=e.length-1;t>=0;t--)(c=e[t])&&(r=(s<3?c(r):s>3?c(l,n,r):c(l,n))||r);return s>3&&r&&Object.defineProperty(l,n,r),r},y=function(e,l){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,l)};const f=class{constructor(e){a.registerInstance(this,e),e.$hostElement$["s-ei"]?this.internals=e.$hostElement$["s-ei"]:(this.internals=e.$hostElement$.attachInternals(),e.$hostElement$["s-ei"]=this.internals),this.themeConfig=void 0}themeConfigChangedHandler(e,l){e!==l&&this.applyThemeConfig(e)}connectedCallback(){a.debug("nylas-event-card","connectedCallback")}componentWillLoad(){a.debug("nylas-event-card","componentWillLoad")}componentDidLoad(){a.debug("nylas-event-card","componentDidLoad")}disconnectedCallback(){a.debug("nylas-event-card","disconnectedCallback");const e=["header-title","header-subtitle","content"];a.checkForMissingSlots(e,this.host)}applyThemeConfig(e){if(e)for(const[l,n]of Object.entries(e))this.host.style.setProperty(`${l}`,n)}render(){return a.h(a.Host,{key:"0d0f6136744aedaf66d3bfe00f9bf66d96f5336d"},a.h("div",{key:"eb5d1170925c2dd6655e65c5d3786e58e20a1730",class:"nylas-form-card",part:"nfc"},a.h("div",{key:"61ae5c7304c8fe85e1b80857847adf264dc15f86",class:"nylas-form-card__header",part:"nfc__header"},a.h("slot",{key:"e032d408b48ba463b2418df8ea6ec74c9751e6cd",name:"header-title"}),a.h("slot",{key:"b4c80b7aeee06feeb7feb61ec34e475de0bd89c5",name:"header-subtitle"})),a.h("div",{key:"37ab63f782ee8ceea9cb6d2673facb7a479ff528",class:"nylas-form-card__content"},a.h("slot",{key:"8a9b455a4f6b12ddd2df6144186feea96a11199c",name:"content"}))))}static get formAssociated(){return!0}get host(){return a.getElement(this)}static get watchers(){return{themeConfig:["themeConfigChangedHandler"]}}};u([d.RegisterComponent({name:"nylas-form-card",stateToProps:new Map([["schedulerConfig.themeConfig","themeConfig"]]),eventToProps:{},fireRegisterEvent:!0}),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",void 0)],f.prototype,"render",null);f.style=i;exports.nylas_form_card=f;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { r as b, b as t, P as i, h as o, H as m, g as p } from "./index-140eb219.js";
|
|
2
|
+
import { R as u } from "./register-component-0aad9e3d-b395364a.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
const g = '.sc-nylas-form-card-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-form-card.sc-nylas-form-card{width:100%;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-form-card__header.sc-nylas-form-card{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}', h = g;
|
|
7
|
+
var C = function(e, a, r, s) {
|
|
8
|
+
var n = arguments.length, l = n < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, r) : s, c;
|
|
9
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
10
|
+
l = Reflect.decorate(e, a, r, s);
|
|
11
|
+
else
|
|
12
|
+
for (var f = e.length - 1; f >= 0; f--)
|
|
13
|
+
(c = e[f]) && (l = (n < 3 ? c(l) : n > 3 ? c(a, r, l) : c(a, r)) || l);
|
|
14
|
+
return n > 3 && l && Object.defineProperty(a, r, l), l;
|
|
15
|
+
}, y = function(e, a) {
|
|
16
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
17
|
+
return Reflect.metadata(e, a);
|
|
18
|
+
};
|
|
19
|
+
const d = class {
|
|
20
|
+
constructor(e) {
|
|
21
|
+
b(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.themeConfig = void 0;
|
|
22
|
+
}
|
|
23
|
+
themeConfigChangedHandler(e, a) {
|
|
24
|
+
e !== a && this.applyThemeConfig(e);
|
|
25
|
+
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
t("nylas-event-card", "connectedCallback");
|
|
28
|
+
}
|
|
29
|
+
componentWillLoad() {
|
|
30
|
+
t("nylas-event-card", "componentWillLoad");
|
|
31
|
+
}
|
|
32
|
+
componentDidLoad() {
|
|
33
|
+
t("nylas-event-card", "componentDidLoad");
|
|
34
|
+
}
|
|
35
|
+
disconnectedCallback() {
|
|
36
|
+
t("nylas-event-card", "disconnectedCallback"), i(["header-title", "header-subtitle", "content"], this.host);
|
|
37
|
+
}
|
|
38
|
+
applyThemeConfig(e) {
|
|
39
|
+
if (e)
|
|
40
|
+
for (const [a, r] of Object.entries(e))
|
|
41
|
+
this.host.style.setProperty(`${a}`, r);
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return o(m, { key: "0d0f6136744aedaf66d3bfe00f9bf66d96f5336d" }, o("div", { key: "eb5d1170925c2dd6655e65c5d3786e58e20a1730", class: "nylas-form-card", part: "nfc" }, o("div", { key: "61ae5c7304c8fe85e1b80857847adf264dc15f86", class: "nylas-form-card__header", part: "nfc__header" }, o("slot", { key: "e032d408b48ba463b2418df8ea6ec74c9751e6cd", name: "header-title" }), o("slot", { key: "b4c80b7aeee06feeb7feb61ec34e475de0bd89c5", name: "header-subtitle" })), o("div", { key: "37ab63f782ee8ceea9cb6d2673facb7a479ff528", class: "nylas-form-card__content" }, o("slot", { key: "8a9b455a4f6b12ddd2df6144186feea96a11199c", name: "content" }))));
|
|
45
|
+
}
|
|
46
|
+
static get formAssociated() {
|
|
47
|
+
return !0;
|
|
48
|
+
}
|
|
49
|
+
get host() {
|
|
50
|
+
return p(this);
|
|
51
|
+
}
|
|
52
|
+
static get watchers() {
|
|
53
|
+
return {
|
|
54
|
+
themeConfig: ["themeConfigChangedHandler"]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
C([
|
|
59
|
+
u({
|
|
60
|
+
name: "nylas-form-card",
|
|
61
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.themeConfig", "themeConfig"]]),
|
|
62
|
+
eventToProps: {},
|
|
63
|
+
fireRegisterEvent: !0
|
|
64
|
+
}),
|
|
65
|
+
y("design:type", Function),
|
|
66
|
+
y("design:paramtypes", []),
|
|
67
|
+
y("design:returntype", void 0)
|
|
68
|
+
], d.prototype, "render", null);
|
|
69
|
+
d.style = h;
|
|
70
|
+
export {
|
|
71
|
+
d as nylas_form_card
|
|
72
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-d8a42c15.cjs");require("react");require("react/jsx-runtime");require("react-dom");const l=':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block;word-break:break-word}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error);background:rgb(255, 248, 248)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}',r=l,e=class{constructor(o){n.registerInstance(this,o),this.ttl=5e3,this.allowedCategories=["component","api","validation","invalid_session"],this.notifications=[]}onError(o){n.debug(`[nylas-notification] Error: ${o.detail.notification.title}`),this.handleNotification(o)}onWarning(o){n.debug(`[nylas-notification] Warning: ${o.detail.notification.title}`),this.handleNotification(o)}onInfo(o){n.debug(`[nylas-notification] Info: ${o.detail.notification.title}`),this.handleNotification(o)}onSuccess(o){n.debug(`[nylas-notification] Success: ${o.detail.notification.title}`),this.handleNotification(o)}onDismissNotification(o){this.dismissNotification(o.detail.id)}isChildOf(o){let i=this.host.parentNode;for(;i;){if(i===o)return!0;i instanceof ShadowRoot?i=i.host:i=i.parentNode}return!1}handleNotification(o){const i=o.detail.host;if(o.defaultPrevented){n.debug("[nylas-notification] Event default prevented");return}if(i&&!this.isChildOf(i)){n.debug("[nylas-notification] Host not a parent");return}if(this.ttl===0){n.debug("[nylas-notification] TTL is 0");return}if(this.allowedCategories.length>0&&!this.allowedCategories.includes(o.detail.notification.category)){n.debug("[nylas-notification] Category not allowed");return}if(this.notifications.find(a=>a.id===o.detail.notification.id)){n.debug("[nylas-notification] Notification already exists");return}if(this.notifications=[...this.notifications,{...o.detail.notification}],o.detail.notification.ttl!=="none"){const a=o.detail.notification.ttl?o.detail.notification.ttl:this.ttl;window.setTimeout(()=>{this.notifications=this.notifications.filter(t=>t.id!==o.detail.notification.id)},a)}}dismissNotification(o){this.notifications=this.notifications.filter(i=>i.id!==o)}render(){return n.h(n.Host,{key:"f0e6fb311ba12bebf3970afb5850a7995c5bcd83"},n.h(n.Fragment,{key:"2f9bd098337a72908c4c292e03d1ddafa54f7c61"},this.notifications.map(o=>n.h("div",{class:`notif ${o.type}`,key:o.id},n.h("div",{class:"content"},n.h("span",{class:`icon ${o.type}`},(o.type==="error"||o.type==="warning")&&n.h("warning-icon",null)),n.h("span",{class:"message"},n.h("span",{class:"title"},o.title),o.description&&n.h("span",{class:"description"},o.description))),n.h("button",{class:"dismiss-btn",onClick:()=>this.dismissNotification(o.id)},n.h("close-icon",null)))),n.h("slot",{key:"575b3ecb1b22b23c84c75a6900215795a5695fff"})))}get host(){return n.getElement(this)}};e.style=r;const c=".sc-warning-icon-h{display:flex}",f=c,s=class{constructor(o){n.registerInstance(this,o),this.width="16",this.height="16"}render(){return n.h("svg",{key:"7934b2980705106a978e817555c1065704e626c7",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.h("path",{key:"3942fd2b948a46bd0fb8c7322b6b0c7db439b66e",d:"M7.68551 1.35232L1.12678 13.2773C0.576954 14.277 1.3002 15.5002 2.4411 15.5002H15.5586C16.6995 15.5002 17.4227 14.277 16.8729 13.2773L10.3142 1.35232C9.74426 0.316153 8.2554 0.316157 7.68551 1.35232ZM8.99982 5.25016C9.41403 5.25016 9.74982 5.58595 9.74982 6.00016V10.0002C9.74982 10.4144 9.41403 10.7502 8.99982 10.7502C8.5856 10.7502 8.24982 10.4144 8.24982 10.0002V6.00016C8.24982 5.58595 8.5856 5.25016 8.99982 5.25016ZM9.74982 12.2502C9.74982 12.6644 9.41403 13.0002 8.99982 13.0002C8.5856 13.0002 8.24982 12.6644 8.24982 12.2502C8.24982 11.8359 8.5856 11.5002 8.99982 11.5002C9.41403 11.5002 9.74982 11.8359 9.74982 12.2502Z",fill:"currentColor"}))}};s.style=f;exports.nylas_notification=e;exports.warning_icon=s;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { r as t, b as i, h as n, F as l, H as r, g as c } from "./index-140eb219.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
const f = ':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block;word-break:break-word}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error);background:rgb(255, 248, 248)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}', y = f, d = class {
|
|
6
|
+
constructor(o) {
|
|
7
|
+
t(this, o), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
|
|
8
|
+
}
|
|
9
|
+
onError(o) {
|
|
10
|
+
i(`[nylas-notification] Error: ${o.detail.notification.title}`), this.handleNotification(o);
|
|
11
|
+
}
|
|
12
|
+
onWarning(o) {
|
|
13
|
+
i(`[nylas-notification] Warning: ${o.detail.notification.title}`), this.handleNotification(o);
|
|
14
|
+
}
|
|
15
|
+
onInfo(o) {
|
|
16
|
+
i(`[nylas-notification] Info: ${o.detail.notification.title}`), this.handleNotification(o);
|
|
17
|
+
}
|
|
18
|
+
onSuccess(o) {
|
|
19
|
+
i(`[nylas-notification] Success: ${o.detail.notification.title}`), this.handleNotification(o);
|
|
20
|
+
}
|
|
21
|
+
onDismissNotification(o) {
|
|
22
|
+
this.dismissNotification(o.detail.id);
|
|
23
|
+
}
|
|
24
|
+
isChildOf(o) {
|
|
25
|
+
let a = this.host.parentNode;
|
|
26
|
+
for (; a; ) {
|
|
27
|
+
if (a === o)
|
|
28
|
+
return !0;
|
|
29
|
+
a instanceof ShadowRoot ? a = a.host : a = a.parentNode;
|
|
30
|
+
}
|
|
31
|
+
return !1;
|
|
32
|
+
}
|
|
33
|
+
handleNotification(o) {
|
|
34
|
+
const a = o.detail.host;
|
|
35
|
+
if (o.defaultPrevented) {
|
|
36
|
+
i("[nylas-notification] Event default prevented");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (a && !this.isChildOf(a)) {
|
|
40
|
+
i("[nylas-notification] Host not a parent");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (this.ttl === 0) {
|
|
44
|
+
i("[nylas-notification] TTL is 0");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(o.detail.notification.category)) {
|
|
48
|
+
i("[nylas-notification] Category not allowed");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (this.notifications.find((s) => s.id === o.detail.notification.id)) {
|
|
52
|
+
i("[nylas-notification] Notification already exists");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (this.notifications = [...this.notifications, { ...o.detail.notification }], o.detail.notification.ttl !== "none") {
|
|
56
|
+
const s = o.detail.notification.ttl ? o.detail.notification.ttl : this.ttl;
|
|
57
|
+
window.setTimeout(() => {
|
|
58
|
+
this.notifications = this.notifications.filter((e) => e.id !== o.detail.notification.id);
|
|
59
|
+
}, s);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
dismissNotification(o) {
|
|
63
|
+
this.notifications = this.notifications.filter((a) => a.id !== o);
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return n(r, { key: "f0e6fb311ba12bebf3970afb5850a7995c5bcd83" }, n(l, { key: "2f9bd098337a72908c4c292e03d1ddafa54f7c61" }, this.notifications.map((o) => n("div", { class: `notif ${o.type}`, key: o.id }, n("div", { class: "content" }, n("span", { class: `icon ${o.type}` }, (o.type === "error" || o.type === "warning") && n("warning-icon", null)), n("span", { class: "message" }, n("span", { class: "title" }, o.title), o.description && n("span", { class: "description" }, o.description))), n("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(o.id) }, n("close-icon", null)))), n("slot", { key: "575b3ecb1b22b23c84c75a6900215795a5695fff" })));
|
|
67
|
+
}
|
|
68
|
+
get host() {
|
|
69
|
+
return c(this);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
d.style = y;
|
|
73
|
+
const b = ".sc-warning-icon-h{display:flex}", h = b, p = class {
|
|
74
|
+
constructor(o) {
|
|
75
|
+
t(this, o), this.width = "16", this.height = "16";
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
return n("svg", { key: "7934b2980705106a978e817555c1065704e626c7", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("path", { key: "3942fd2b948a46bd0fb8c7322b6b0c7db439b66e", d: "M7.68551 1.35232L1.12678 13.2773C0.576954 14.277 1.3002 15.5002 2.4411 15.5002H15.5586C16.6995 15.5002 17.4227 14.277 16.8729 13.2773L10.3142 1.35232C9.74426 0.316153 8.2554 0.316157 7.68551 1.35232ZM8.99982 5.25016C9.41403 5.25016 9.74982 5.58595 9.74982 6.00016V10.0002C9.74982 10.4144 9.41403 10.7502 8.99982 10.7502C8.5856 10.7502 8.24982 10.4144 8.24982 10.0002V6.00016C8.24982 5.58595 8.5856 5.25016 8.99982 5.25016ZM9.74982 12.2502C9.74982 12.6644 9.41403 13.0002 8.99982 13.0002C8.5856 13.0002 8.24982 12.6644 8.24982 12.2502C8.24982 11.8359 8.5856 11.5002 8.99982 11.5002C9.41403 11.5002 9.74982 11.8359 9.74982 12.2502Z", fill: "currentColor" }));
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
p.style = h;
|
|
82
|
+
export {
|
|
83
|
+
d as nylas_notification,
|
|
84
|
+
p as warning_icon
|
|
85
|
+
};
|