@nylas/react 2.1.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/cjs/connect.js +1 -0
  2. package/dist/cjs/elements.js +1 -0
  3. package/dist/cjs/index.js +1 -0
  4. package/dist/cjs/notetaker.js +62 -0
  5. package/dist/cjs/utils.js +11 -0
  6. package/dist/connect.d.ts +1 -0
  7. package/dist/elements.d.ts +1 -0
  8. package/dist/es/connect.js +279 -0
  9. package/dist/es/elements.js +1319 -0
  10. package/dist/es/index.js +281 -0
  11. package/dist/es/notetaker.js +5784 -0
  12. package/dist/es/utils.js +12396 -0
  13. package/dist/lib/connect/types.d.ts +1 -1
  14. package/dist/lib/connect/useNylasConnect.d.ts +2 -2
  15. package/dist/lib/connect.d.ts +1 -0
  16. package/dist/lib/elements/components.d.ts +975 -0
  17. package/dist/lib/elements.d.ts +1 -0
  18. package/dist/lib/index.d.ts +3 -6
  19. package/dist/lib/notetaker.d.ts +1 -0
  20. package/dist/lib/utils.d.ts +2 -0
  21. package/dist/notetaker.d.ts +1 -0
  22. package/dist/utils.d.ts +1 -0
  23. package/package.json +36 -16
  24. package/dist/add-circle-icon_2.entry-8c3bb0bb.cjs +0 -1
  25. package/dist/add-circle-icon_2.entry-a3daf6c4.js +0 -28
  26. package/dist/archive-icon.entry-46ad0ff3.cjs +0 -1
  27. package/dist/archive-icon.entry-d5141486.js +0 -18
  28. package/dist/arrow-icon.entry-1b89ce78.js +0 -18
  29. package/dist/arrow-icon.entry-f696de4f.cjs +0 -1
  30. package/dist/bold-icon.entry-7827cd4e.cjs +0 -1
  31. package/dist/bold-icon.entry-c117b4cf.js +0 -18
  32. package/dist/button-component_2.entry-8cd4c5f3.cjs +0 -1
  33. package/dist/button-component_2.entry-e68caa9b.js +0 -29
  34. package/dist/calendar-agenda-fill-icon_37.entry-52bdc8b3.js +0 -5234
  35. package/dist/calendar-agenda-fill-icon_37.entry-8c592cfa.cjs +0 -6
  36. package/dist/calendar-cancel-icon.entry-7facfa05.cjs +0 -1
  37. package/dist/calendar-cancel-icon.entry-f5f1d499.js +0 -18
  38. package/dist/calendar-check-icon.entry-55320137.js +0 -18
  39. package/dist/calendar-check-icon.entry-72108702.cjs +0 -1
  40. package/dist/calendar-icon.entry-afea361e.js +0 -18
  41. package/dist/calendar-icon.entry-f5c6730f.cjs +0 -1
  42. package/dist/checkbox-component.entry-5722d263.cjs +0 -1
  43. package/dist/checkbox-component.entry-89fa6edd.js +0 -54
  44. package/dist/checkbox-group_4.entry-30e8af17.cjs +0 -28
  45. package/dist/checkbox-group_4.entry-51f03009.js +0 -10014
  46. package/dist/checkmark-circle-icon.entry-ae11049d.cjs +0 -1
  47. package/dist/checkmark-circle-icon.entry-dfe67e22.js +0 -18
  48. package/dist/checkmark-icon_15.entry-4c3979db.js +0 -1415
  49. package/dist/checkmark-icon_15.entry-e59c0f53.cjs +0 -5
  50. package/dist/chevron-icon_3.entry-1f3c3ca6.js +0 -159
  51. package/dist/chevron-icon_3.entry-ea791750.cjs +0 -1
  52. package/dist/clock-icon_4.entry-172fed74.cjs +0 -1
  53. package/dist/clock-icon_4.entry-78878cb8.js +0 -48
  54. package/dist/constants-f51538ef-cd2a67c4.cjs +0 -1
  55. package/dist/constants-f51538ef-e0a5f026.js +0 -876
  56. package/dist/customParseFormat-b5d95b34-a6b6fcba.cjs +0 -1
  57. package/dist/customParseFormat-b5d95b34-ce80820c.js +0 -135
  58. package/dist/delete-icon.entry-a8c0bf03.cjs +0 -1
  59. package/dist/delete-icon.entry-cebdc90f.js +0 -18
  60. package/dist/document-refresh-icon.entry-2d9a529d.cjs +0 -1
  61. package/dist/document-refresh-icon.entry-8780a2b8.js +0 -18
  62. package/dist/feedbackSync-92220b42-fbebe1f9.cjs +0 -448
  63. package/dist/feedbackSync-92220b42-fd5f5610.js +0 -6048
  64. package/dist/folder-icon.entry-3e61ccca.cjs +0 -1
  65. package/dist/folder-icon.entry-6ffd5191.js +0 -18
  66. package/dist/forward-icon.entry-c7d88db8.cjs +0 -1
  67. package/dist/forward-icon.entry-c9c4bf5b.js +0 -18
  68. package/dist/globe-icon.entry-0b93cab8.cjs +0 -1
  69. package/dist/globe-icon.entry-7c0dca7b.js +0 -18
  70. package/dist/google-logo-icon_6.entry-deef91ee.js +0 -1765
  71. package/dist/google-logo-icon_6.entry-e25ce3e7.cjs +0 -2
  72. package/dist/google-meet-icon_5.entry-214347f0.cjs +0 -1
  73. package/dist/google-meet-icon_5.entry-f8b5a92a.js +0 -58
  74. package/dist/inbox-icon.entry-873062c3.js +0 -18
  75. package/dist/inbox-icon.entry-f08f2fd5.cjs +0 -1
  76. package/dist/index-025be398.js +0 -7187
  77. package/dist/index-c510313d-1318f67a.js +0 -289
  78. package/dist/index-c510313d-b0508eee.cjs +0 -1
  79. package/dist/index-f42fe591.cjs +0 -65
  80. package/dist/index.es-488bc919-d02dd50a.cjs +0 -7
  81. package/dist/index.es-488bc919-ea63a7e9.js +0 -2724
  82. package/dist/info-icon_2.entry-442b9097.cjs +0 -1
  83. package/dist/info-icon_2.entry-60fb8648.js +0 -37
  84. package/dist/input-component.entry-5898a52e.js +0 -96
  85. package/dist/input-component.entry-7274fd28.cjs +0 -1
  86. package/dist/input-dropdown_2.entry-4534436c.js +0 -255
  87. package/dist/input-dropdown_2.entry-9b72f637.cjs +0 -1
  88. package/dist/italic-icon.entry-62052cd8.js +0 -18
  89. package/dist/italic-icon.entry-9bdbbd37.cjs +0 -1
  90. package/dist/lib/elements/index.d.ts +0 -133
  91. package/dist/lib/elements/react-component-lib/createComponent.d.ts +0 -10
  92. package/dist/lib/elements/react-component-lib/createOverlayComponent.d.ts +0 -21
  93. package/dist/lib/elements/react-component-lib/index.d.ts +0 -2
  94. package/dist/lib/elements/react-component-lib/interfaces.d.ts +0 -29
  95. package/dist/lib/elements/react-component-lib/utils/attachProps.d.ts +0 -9
  96. package/dist/lib/elements/react-component-lib/utils/case.d.ts +0 -2
  97. package/dist/lib/elements/react-component-lib/utils/dev.d.ts +0 -2
  98. package/dist/lib/elements/react-component-lib/utils/index.d.ts +0 -10
  99. package/dist/multi-select-dropdown.entry-77752d46.cjs +0 -1
  100. package/dist/multi-select-dropdown.entry-9c9d05c1.js +0 -133
  101. package/dist/nylas-booked-event-card_11.entry-32b2e9f1.js +0 -1410
  102. package/dist/nylas-booked-event-card_11.entry-4aba5146.cjs +0 -1
  103. package/dist/nylas-date-component_2.entry-6b058796.cjs +0 -1
  104. package/dist/nylas-date-component_2.entry-a869519f.js +0 -310
  105. package/dist/nylas-form-card.entry-5390459f.js +0 -75
  106. package/dist/nylas-form-card.entry-c2f34d73.cjs +0 -1
  107. package/dist/nylas-notification_2.entry-054392cf.cjs +0 -1
  108. package/dist/nylas-notification_2.entry-f46e88e5.js +0 -88
  109. package/dist/nylas-scheduler-editor.entry-40a48f47.js +0 -1854
  110. package/dist/nylas-scheduler-editor.entry-e29fdf07.cjs +0 -2
  111. package/dist/nylas-scheduling.entry-115b1752.js +0 -1002
  112. package/dist/nylas-scheduling.entry-79cb1d9c.cjs +0 -1
  113. package/dist/person-icon.entry-2cae306c.cjs +0 -1
  114. package/dist/person-icon.entry-fd668b89.js +0 -18
  115. package/dist/play-icon.entry-7fc3c0fd.js +0 -18
  116. package/dist/play-icon.entry-9989a520.cjs +0 -1
  117. package/dist/radio-button-group.entry-03385b5f.cjs +0 -1
  118. package/dist/radio-button-group.entry-9df82cd0.js +0 -58
  119. package/dist/react.cjs +0 -1
  120. package/dist/react.js +0 -164
  121. package/dist/refresh-icon.entry-310954ba.cjs +0 -1
  122. package/dist/refresh-icon.entry-c56e5623.js +0 -18
  123. package/dist/register-component-3acd57e7-5a79a90a.cjs +0 -1
  124. package/dist/register-component-3acd57e7-cb09c05e.js +0 -110
  125. package/dist/reply-all-icon.entry-32e0e000.js +0 -18
  126. package/dist/reply-all-icon.entry-68388f97.cjs +0 -1
  127. package/dist/reply-icon.entry-3ac2e736.js +0 -18
  128. package/dist/reply-icon.entry-e616a9a4.cjs +0 -1
  129. package/dist/sent-icon.entry-0622ed04.js +0 -18
  130. package/dist/sent-icon.entry-543eb3c4.cjs +0 -1
  131. package/dist/spam-icon.entry-74bcfd4f.js +0 -18
  132. package/dist/spam-icon.entry-e341ee3e.cjs +0 -1
  133. package/dist/star-icon.entry-864d2bf9.js +0 -18
  134. package/dist/star-icon.entry-c90d40f6.cjs +0 -1
  135. package/dist/stop-icon.entry-835908c5.js +0 -18
  136. package/dist/stop-icon.entry-ffc46b42.cjs +0 -1
  137. package/dist/textarea-component.entry-6adcf6a6.js +0 -58
  138. package/dist/textarea-component.entry-dae8eb5c.cjs +0 -1
  139. package/dist/toggle-switch.entry-5ee29867.cjs +0 -1
  140. package/dist/toggle-switch.entry-ff2ccb75.js +0 -51
  141. package/dist/translate-icon.entry-372dd808.js +0 -18
  142. package/dist/translate-icon.entry-5606067d.cjs +0 -1
  143. package/dist/trash-fill-icon.entry-01b4379e.js +0 -18
  144. package/dist/trash-fill-icon.entry-daed6c0a.cjs +0 -1
  145. package/dist/underline-icon.entry-2020ee64.cjs +0 -1
  146. package/dist/underline-icon.entry-464b900d.js +0 -18
  147. package/dist/utils-31933f5d-15041585.js +0 -17878
  148. package/dist/utils-31933f5d-1d4c81ab.cjs +0 -54
@@ -1,310 +0,0 @@
1
- import { r as g, c as o, h as n, g as v, H as x } from "./index-025be398.js";
2
- import { q as d, a as l, i as c, O as h, P as m, E as w, Q as u, R as p, F as b } from "./utils-31933f5d-15041585.js";
3
- import { L as f } from "./constants-f51538ef-e0a5f026.js";
4
- import { c as k } from "./customParseFormat-b5d95b34-ce80820c.js";
5
- import "@nylas/web-elements";
6
- import "react";
7
- import "@nylas/connect";
8
- import "react/jsx-runtime";
9
- import "react-dom";
10
- 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 = {
11
- date: "YYYY-MM-DD"
12
- }, F = class {
13
- constructor(t) {
14
- 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;
15
- }
16
- handleDefaultValueChange(t) {
17
- this.value = d(t), this.value && this.validatePattern(this.value, !0);
18
- }
19
- themeConfigChangedHandler(t, e) {
20
- t !== e && this.applyThemeConfig(t);
21
- }
22
- applyThemeConfig(t) {
23
- if (t)
24
- for (const [e, i] of Object.entries(t))
25
- this.el.style.setProperty(`${e}`, i);
26
- }
27
- componentDidLoad() {
28
- this.value = d(this.defaultValue || ""), this.value && this.validatePattern(this.value, !0), this.applyThemeConfig(this.themeConfig);
29
- }
30
- handleBookingFormSubmitted(t) {
31
- this.validatePattern(this.value), this.error && t.preventDefault();
32
- }
33
- async handleFormSubmitted(t) {
34
- this.validatePattern(this.value), this.error && t.preventDefault();
35
- }
36
- handleInput(t) {
37
- this.error = "";
38
- const e = t.target;
39
- this.value = d(e.value), this.isDateValid = e.validity.valid, this.nylasFormInputChanged.emit({
40
- value: this.value,
41
- name: this.name,
42
- label: this.label,
43
- error: this.error,
44
- type: "date"
45
- });
46
- }
47
- handleBlur() {
48
- this.nylasFormInputBlurred.emit({
49
- value: this.value,
50
- name: this.name
51
- });
52
- }
53
- handleFocus() {
54
- this.nylasFormInputFocused.emit({
55
- value: this.value,
56
- name: this.name
57
- });
58
- }
59
- validatePattern(t, e = !1) {
60
- if (this.error = "", !e && (this.required && !this.isDateValid || this.minDate && new Date(this.minDate) > new Date(t))) {
61
- this.error = this.errorMessage || "Please enter a valid date", this.nylasFormInputChanged.emit({
62
- value: this.value,
63
- name: this.name,
64
- label: this.label,
65
- error: this.error,
66
- type: "date"
67
- });
68
- return;
69
- }
70
- if (this.required && !t) {
71
- this.error = this.requiredError || "This field is required.";
72
- return;
73
- }
74
- !this.pattern || !t && !this.required || (this.pattern.test(t) ? this.error = "" : this.error = this.patternError || "Invalid format.");
75
- }
76
- render() {
77
- 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));
78
- }
79
- get el() {
80
- return v(this);
81
- }
82
- static get watchers() {
83
- return {
84
- defaultValue: ["handleDefaultValueChange"],
85
- themeConfig: ["themeConfigChangedHandler"]
86
- };
87
- }
88
- };
89
- F.style = C;
90
- 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;
91
- l.extend(k);
92
- const E = class {
93
- constructor(t) {
94
- 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;
95
- }
96
- handleOutsideClick(t) {
97
- !t.composedPath().includes(this.el) && this.showTimes && (this.showTimes = !1);
98
- }
99
- timeChangedHandler() {
100
- this.validateTimeAgainstMinimum();
101
- }
102
- minimumStartTimeChangedHandler() {
103
- this.validateTimeAgainstMinimum();
104
- }
105
- themeConfigChangedHandler(t, e) {
106
- this.applyThemeConfig(t);
107
- }
108
- applyThemeConfig(t) {
109
- if (t)
110
- for (const [e, i] of Object.entries(t))
111
- this.el.style.setProperty(`${e}`, i);
112
- }
113
- validateTimeAgainstMinimum() {
114
- if (this.minimumStartTime) {
115
- const t = l(this.minimumStartTime, "hh:mma"), e = l(this.time, "hh:mma");
116
- this.times = this.generateTimes();
117
- const i = c.t("nylasTimeWindowPicker.errors.invalid");
118
- e.isBefore(t) ? (this.err = i, this.timeWindowFormError.emit({
119
- key: this.el.id,
120
- message: i
121
- })) : (this.err = "", this.timeWindowFormError.emit({
122
- key: this.el.id,
123
- message: ""
124
- }));
125
- } else
126
- this.err = "", this.timeWindowFormError.emit({
127
- key: this.el.id,
128
- message: ""
129
- });
130
- }
131
- componentDidLoad() {
132
- this.validateTimeAgainstMinimum(), this.applyThemeConfig(this.themeConfig);
133
- }
134
- componentDidRender() {
135
- if (this.showTimes && this.shouldAutoScroll) {
136
- const t = h(this.time), e = this.times.findIndex((i) => i.value === t);
137
- e > -1 && (this.shouldAutoScroll = !1, this.scrollToViewWithinParent(e));
138
- return;
139
- }
140
- }
141
- handleTimeChange(t, e) {
142
- const i = e.split(":");
143
- if (i[0] === "00" && i[1].slice(-2) == "pm") {
144
- const s = c.t("nylasTimeWindowPicker.errors.invalid");
145
- this.err = s, this.timeWindowFormError.emit({
146
- key: this.el.id,
147
- message: s
148
- });
149
- }
150
- if (m(e))
151
- this.err = "", this.timeWindowFormError.emit({
152
- key: this.el.id,
153
- message: ""
154
- });
155
- else {
156
- const s = c.t("nylasTimeWindowPicker.errors.invalid");
157
- this.err = s, this.timeWindowFormError.emit({
158
- key: this.el.id,
159
- message: s
160
- });
161
- }
162
- this.err || this.timeChange.emit({
163
- key: this.el.id,
164
- value: e
165
- });
166
- }
167
- handleTimeAutocomplete(t) {
168
- var a;
169
- const e = (a = t.target) == null ? void 0 : a.value, i = this.language !== f.en ? w(e) : e, s = c.t("nylasTimeWindowPicker.errors.invalid");
170
- if (!m(i)) {
171
- this.err = s, this.timeWindowFormError.emit({
172
- key: this.el.id,
173
- message: s
174
- });
175
- return;
176
- }
177
- if (i === "") {
178
- const r = u().format("hh:mma");
179
- this.timeChange.emit({
180
- key: this.el.id,
181
- value: r
182
- });
183
- return;
184
- }
185
- if (!p(i)) {
186
- const r = h(i);
187
- this.timeChange.emit({
188
- key: this.el.id,
189
- value: r
190
- });
191
- return;
192
- }
193
- this.timeChange.emit({
194
- key: this.el.id,
195
- value: i
196
- });
197
- }
198
- handleOnInput(t) {
199
- var i;
200
- const e = (i = t.target) == null ? void 0 : i.value;
201
- if (m(e)) {
202
- if (e === "") {
203
- const s = u().format("hh:mma"), a = this.times.findIndex((r) => r.value === s);
204
- a > -1 && this.scrollToViewWithinParent(a);
205
- return;
206
- }
207
- if (!p(e)) {
208
- const s = h(e), a = this.times.findIndex((r) => r.value === s);
209
- a > -1 && this.scrollToViewWithinParent(a);
210
- return;
211
- }
212
- }
213
- }
214
- generateTimes() {
215
- const t = [];
216
- let e = l().set("hour", 0).set("minute", 0).set("second", 0);
217
- this.minimumStartTime && (e = l(this.minimumStartTime, "hh:mma"));
218
- const i = e.endOf("day").diff(e, "minutes"), s = Math.round(i / 15);
219
- for (let a = 0; a < s + 1; a++) {
220
- const r = e.add(a * 15, "minute");
221
- if (a == s && r.format("hh:mma").includes("am"))
222
- break;
223
- t.push({ id: a, value: r.format("hh:mma") });
224
- }
225
- return t;
226
- }
227
- handleComboboxKeyDown(t) {
228
- if (t.key === "ArrowDown") {
229
- if (t.preventDefault(), !this.showTimes) {
230
- this.showTimes = !0, this.shouldAutoScroll = !0;
231
- return;
232
- }
233
- if (this.ariaActivedescendant === "")
234
- this.ariaActivedescendant = this.times[0].id.toString(), this.focusOption(0);
235
- else {
236
- const e = this.times.findIndex((s) => s.id.toString() === this.ariaActivedescendant), i = e + 1 < this.times.length ? e + 1 : 0;
237
- this.ariaActivedescendant = this.times[i].id.toString(), this.focusOption(i);
238
- }
239
- } else if (t.key === "ArrowUp")
240
- if (t.preventDefault(), this.ariaActivedescendant === "")
241
- this.ariaActivedescendant = this.times[this.times.length - 1].id.toString(), this.focusOption(this.times.length - 1);
242
- else {
243
- const e = this.times.findIndex((s) => s.id.toString() === this.ariaActivedescendant), i = e - 1 >= 0 ? e - 1 : this.times.length - 1;
244
- this.ariaActivedescendant = this.times[i].id.toString(), this.focusOption(i);
245
- }
246
- else
247
- t.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
248
- }
249
- handleListboxKeydown(t) {
250
- const e = this.times, i = e.findIndex((s) => s.id.toString() === this.ariaActivedescendant);
251
- if (t.key === "ArrowDown" || t.key === "Tab" && !t.shiftKey) {
252
- t.preventDefault();
253
- const s = i + 1 < e.length ? i + 1 : 0;
254
- this.ariaActivedescendant = e[s].id.toString(), this.focusOption(s);
255
- } else if (t.key === "ArrowUp" || t.key === "Tab" && t.shiftKey) {
256
- t.preventDefault();
257
- const s = i - 1 >= 0 ? i - 1 : e.length - 1;
258
- this.ariaActivedescendant = e[s].id.toString(), this.focusOption(s);
259
- } else if (t.key === "Enter") {
260
- if (t.preventDefault(), this.ariaActivedescendant) {
261
- const s = e[i];
262
- this.handleTimeChange(t, s.value), this.showTimes = !1, this.ariaActivedescendant = "", this.timeInput.focus();
263
- }
264
- } else
265
- t.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
266
- }
267
- scrollToViewWithinParent(t) {
268
- var y;
269
- const e = this.times[t], i = (y = this.el.shadowRoot) == null ? void 0 : y.getElementById(e.id.toString()), s = this.timeMenu;
270
- this.ariaActivedescendant = e.id.toString();
271
- const a = i.getBoundingClientRect(), r = s.getBoundingClientRect();
272
- 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);
273
- }
274
- focusOption(t) {
275
- var a;
276
- const e = this.times[t];
277
- if (!e)
278
- return;
279
- const i = e.id.toString(), s = (a = this.el.shadowRoot) == null ? void 0 : a.getElementById(i);
280
- s && (s.focus(), s.scrollIntoView({ behavior: "smooth", block: "nearest" }));
281
- }
282
- render() {
283
- const t = this.language !== f.en;
284
- return n(x, { 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: {
285
- "time-input": !0,
286
- error: !!this.err || this.hasError
287
- }, ref: (e) => this.timeInput = e, value: t ? b(this.time) : this.time, onClick: () => {
288
- this.showTimes = !this.showTimes, this.shouldAutoScroll = !0;
289
- }, "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: {
290
- focused: this.ariaActivedescendant === e.id.toString()
291
- }, onClick: (i) => {
292
- this.handleTimeChange(i, e.value), this.showTimes = !1, this.timeInput.focus();
293
- }, role: "option" }, `${t ? b(e.value) : e.value}`)))), !this.showTimes && this.err && n("p", { class: "error", id: "email-error" }, this.err)));
294
- }
295
- get el() {
296
- return v(this);
297
- }
298
- static get watchers() {
299
- return {
300
- time: ["timeChangedHandler"],
301
- minimumStartTime: ["minimumStartTimeChangedHandler"],
302
- themeConfig: ["themeConfigChangedHandler"]
303
- };
304
- }
305
- };
306
- E.style = D;
307
- export {
308
- F as nylas_date_component,
309
- E as nylas_time_window_picker
310
- };
@@ -1,75 +0,0 @@
1
- import { r as b, h as o, H as i, g as m } from "./index-025be398.js";
2
- import { R as p } from "./register-component-3acd57e7-cb09c05e.js";
3
- import { b as t, H as u } from "./utils-31933f5d-15041585.js";
4
- import "@nylas/web-elements";
5
- import "react";
6
- import "@nylas/connect";
7
- import "react/jsx-runtime";
8
- import "react-dom";
9
- 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;
10
- var C = function(e, a, r, s) {
11
- var n = arguments.length, l = n < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, r) : s, c;
12
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
13
- l = Reflect.decorate(e, a, r, s);
14
- else
15
- for (var f = e.length - 1; f >= 0; f--)
16
- (c = e[f]) && (l = (n < 3 ? c(l) : n > 3 ? c(a, r, l) : c(a, r)) || l);
17
- return n > 3 && l && Object.defineProperty(a, r, l), l;
18
- }, y = function(e, a) {
19
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
20
- return Reflect.metadata(e, a);
21
- };
22
- const d = class {
23
- constructor(e) {
24
- 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;
25
- }
26
- themeConfigChangedHandler(e, a) {
27
- e !== a && this.applyThemeConfig(e);
28
- }
29
- connectedCallback() {
30
- t("nylas-event-card", "connectedCallback");
31
- }
32
- componentWillLoad() {
33
- t("nylas-event-card", "componentWillLoad");
34
- }
35
- componentDidLoad() {
36
- t("nylas-event-card", "componentDidLoad");
37
- }
38
- disconnectedCallback() {
39
- t("nylas-event-card", "disconnectedCallback"), u(["header-title", "header-subtitle", "content"], this.host);
40
- }
41
- applyThemeConfig(e) {
42
- if (e)
43
- for (const [a, r] of Object.entries(e))
44
- this.host.style.setProperty(`${a}`, r);
45
- }
46
- render() {
47
- return o(i, { 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" }))));
48
- }
49
- static get formAssociated() {
50
- return !0;
51
- }
52
- get host() {
53
- return m(this);
54
- }
55
- static get watchers() {
56
- return {
57
- themeConfig: ["themeConfigChangedHandler"]
58
- };
59
- }
60
- };
61
- C([
62
- p({
63
- name: "nylas-form-card",
64
- stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.themeConfig", "themeConfig"]]),
65
- eventToProps: {},
66
- fireRegisterEvent: !0
67
- }),
68
- y("design:type", Function),
69
- y("design:paramtypes", []),
70
- y("design:returntype", void 0)
71
- ], d.prototype, "render", null);
72
- d.style = h;
73
- export {
74
- d as nylas_form_card
75
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-f42fe591.cjs"),b=require("./register-component-3acd57e7-5a79a90a.cjs"),o=require("./utils-31933f5d-1d4c81ab.cjs");require("@nylas/web-elements");require("react");require("@nylas/connect");require("react/jsx-runtime");require("react-dom");const i='.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)}',u=i;var m=function(e,a,n,s){var c=arguments.length,l=c<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,n):s,t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,a,n,s);else for(var y=e.length-1;y>=0;y--)(t=e[y])&&(l=(c<3?t(l):c>3?t(a,n,l):t(a,n))||l);return c>3&&l&&Object.defineProperty(a,n,l),l},f=function(e,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,a)};const d=class{constructor(e){r.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,a){e!==a&&this.applyThemeConfig(e)}connectedCallback(){o.debug("nylas-event-card","connectedCallback")}componentWillLoad(){o.debug("nylas-event-card","componentWillLoad")}componentDidLoad(){o.debug("nylas-event-card","componentDidLoad")}disconnectedCallback(){o.debug("nylas-event-card","disconnectedCallback");const e=["header-title","header-subtitle","content"];o.checkForMissingSlots(e,this.host)}applyThemeConfig(e){if(e)for(const[a,n]of Object.entries(e))this.host.style.setProperty(`${a}`,n)}render(){return r.h(r.Host,{key:"0d0f6136744aedaf66d3bfe00f9bf66d96f5336d"},r.h("div",{key:"eb5d1170925c2dd6655e65c5d3786e58e20a1730",class:"nylas-form-card",part:"nfc"},r.h("div",{key:"61ae5c7304c8fe85e1b80857847adf264dc15f86",class:"nylas-form-card__header",part:"nfc__header"},r.h("slot",{key:"e032d408b48ba463b2418df8ea6ec74c9751e6cd",name:"header-title"}),r.h("slot",{key:"b4c80b7aeee06feeb7feb61ec34e475de0bd89c5",name:"header-subtitle"})),r.h("div",{key:"37ab63f782ee8ceea9cb6d2673facb7a479ff528",class:"nylas-form-card__content"},r.h("slot",{key:"8a9b455a4f6b12ddd2df6144186feea96a11199c",name:"content"}))))}static get formAssociated(){return!0}get host(){return r.getElement(this)}static get watchers(){return{themeConfig:["themeConfigChangedHandler"]}}};m([b.RegisterComponent({name:"nylas-form-card",stateToProps:new Map([["schedulerConfig.themeConfig","themeConfig"]]),eventToProps:{},fireRegisterEvent:!0}),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",void 0)],d.prototype,"render",null);d.style=u;exports.nylas_form_card=d;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-f42fe591.cjs"),e=require("./utils-31933f5d-1d4c81ab.cjs");require("@nylas/web-elements");require("react");require("@nylas/connect");require("react/jsx-runtime");require("react-dom");const r=':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}',c=r,s=class{constructor(o){n.registerInstance(this,o),this.ttl=5e3,this.allowedCategories=["component","api","validation","invalid_session"],this.notifications=[]}onError(o){e.debug(`[nylas-notification] Error: ${o.detail.notification.title}`),this.handleNotification(o)}onWarning(o){e.debug(`[nylas-notification] Warning: ${o.detail.notification.title}`),this.handleNotification(o)}onInfo(o){e.debug(`[nylas-notification] Info: ${o.detail.notification.title}`),this.handleNotification(o)}onSuccess(o){e.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){e.debug("[nylas-notification] Event default prevented");return}if(i&&!this.isChildOf(i)){e.debug("[nylas-notification] Host not a parent");return}if(this.ttl===0){e.debug("[nylas-notification] TTL is 0");return}if(this.allowedCategories.length>0&&!this.allowedCategories.includes(o.detail.notification.category)){e.debug("[nylas-notification] Category not allowed");return}if(this.notifications.find(a=>a.id===o.detail.notification.id)){e.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(l=>l.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)}};s.style=c;const f=".sc-warning-icon-h{display:flex}",y=f,t=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"}))}};t.style=y;exports.nylas_notification=s;exports.warning_icon=t;
@@ -1,88 +0,0 @@
1
- import { r as t, h as n, F as l, H as r, g as c } from "./index-025be398.js";
2
- import { b as i } from "./utils-31933f5d-15041585.js";
3
- import "@nylas/web-elements";
4
- import "react";
5
- import "@nylas/connect";
6
- import "react/jsx-runtime";
7
- import "react-dom";
8
- 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 {
9
- constructor(o) {
10
- t(this, o), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
11
- }
12
- onError(o) {
13
- i(`[nylas-notification] Error: ${o.detail.notification.title}`), this.handleNotification(o);
14
- }
15
- onWarning(o) {
16
- i(`[nylas-notification] Warning: ${o.detail.notification.title}`), this.handleNotification(o);
17
- }
18
- onInfo(o) {
19
- i(`[nylas-notification] Info: ${o.detail.notification.title}`), this.handleNotification(o);
20
- }
21
- onSuccess(o) {
22
- i(`[nylas-notification] Success: ${o.detail.notification.title}`), this.handleNotification(o);
23
- }
24
- onDismissNotification(o) {
25
- this.dismissNotification(o.detail.id);
26
- }
27
- isChildOf(o) {
28
- let a = this.host.parentNode;
29
- for (; a; ) {
30
- if (a === o)
31
- return !0;
32
- a instanceof ShadowRoot ? a = a.host : a = a.parentNode;
33
- }
34
- return !1;
35
- }
36
- handleNotification(o) {
37
- const a = o.detail.host;
38
- if (o.defaultPrevented) {
39
- i("[nylas-notification] Event default prevented");
40
- return;
41
- }
42
- if (a && !this.isChildOf(a)) {
43
- i("[nylas-notification] Host not a parent");
44
- return;
45
- }
46
- if (this.ttl === 0) {
47
- i("[nylas-notification] TTL is 0");
48
- return;
49
- }
50
- if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(o.detail.notification.category)) {
51
- i("[nylas-notification] Category not allowed");
52
- return;
53
- }
54
- if (this.notifications.find((s) => s.id === o.detail.notification.id)) {
55
- i("[nylas-notification] Notification already exists");
56
- return;
57
- }
58
- if (this.notifications = [...this.notifications, { ...o.detail.notification }], o.detail.notification.ttl !== "none") {
59
- const s = o.detail.notification.ttl ? o.detail.notification.ttl : this.ttl;
60
- window.setTimeout(() => {
61
- this.notifications = this.notifications.filter((e) => e.id !== o.detail.notification.id);
62
- }, s);
63
- }
64
- }
65
- dismissNotification(o) {
66
- this.notifications = this.notifications.filter((a) => a.id !== o);
67
- }
68
- render() {
69
- 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" })));
70
- }
71
- get host() {
72
- return c(this);
73
- }
74
- };
75
- d.style = y;
76
- const b = ".sc-warning-icon-h{display:flex}", h = b, p = class {
77
- constructor(o) {
78
- t(this, o), this.width = "16", this.height = "16";
79
- }
80
- render() {
81
- 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" }));
82
- }
83
- };
84
- p.style = h;
85
- export {
86
- d as nylas_notification,
87
- p as warning_icon
88
- };