@ncino/web-components 13.8.0 → 13.8.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.
@@ -1 +1 @@
1
- const A=2,T=300,_=350;export{A as MAX_TOAST_ACTIONS,T as TOAST_ANIMATION_DURATION_MS,_ as TOAST_CLOSE_DIALOG_DELAY_MS};
1
+ const A=2,T=300,O=350;export{A as MAX_TOAST_ACTIONS,T as TOAST_ANIMATION_DURATION_MS,O as TOAST_CLOSE_POPOVER_DELAY_MS};
@@ -1,14 +1,10 @@
1
- import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as h}from"../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import{LitElement as _}from"../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{property as p}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as d}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as g}from"../../../utils/decorators/custom-element-decorator.js";import f from"../../../packages/web-components/src/components/toaster/gator/toaster.gator.scss.js";import T from"../../../packages/styles/dist/tokens/primitive.tokens.css.js";import D from"../../../packages/styles/dist/tokens/semantic.tokens.css.js";import"../../toast-container/gator/toast-container.gator.js";import{createRef as O,ref as v}from"../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/ref.js";import{MAX_TOAST_ACTIONS as c,TOAST_CLOSE_DIALOG_DELAY_MS as m}from"../../toast/gator/toast-constants.js";import{unsafeCSS as u}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var y=Object.defineProperty,S=Object.getOwnPropertyDescriptor,r=(o,t,e,a)=>{for(var i=a>1?void 0:a?S(t,e):t,l=o.length-1,n;l>=0;l--)(n=o[l])&&(i=(a?n(t,e,i):n(i))||i);return a&&i&&y(t,e,i),i};let s=class extends _{constructor(){super(...arguments),this.position="top-right",this.defaultToastOptions={},this._toasts=[],this._dialogOpen=!1,this._dialogRef=O(),this._closeDialogTimeout=null}addToast(o){const t=crypto.randomUUID(),e=o.duration??this.defaultToastOptions?.duration??s.defaultDuration,a=!e||e===0;let i=o.actions;i&&i.length>c&&(console.warn(`[ngc-toaster] Toast actions are limited to ${c}. Extra actions were ignored.`),i=i.slice(0,c));const l={...this.defaultToastOptions,...o,id:t,sticky:a,actions:i};return this._toasts=[...this._toasts,l],this._closeDialogTimeout!==null&&(clearTimeout(this._closeDialogTimeout),this._closeDialogTimeout=null),this._dialogOpen=!0,a||setTimeout(()=>{this.removeToast(t)},e),t}removeToast(o){this._toasts=this._toasts.filter(t=>t.id!==o),this._toasts.length===0&&(this._closeDialogTimeout!==null&&clearTimeout(this._closeDialogTimeout),this._closeDialogTimeout=window.setTimeout(()=>{this._dialogOpen=!1,this._closeDialogTimeout=null},m))}clearAll(){this._toasts=[],this._closeDialogTimeout!==null&&clearTimeout(this._closeDialogTimeout),this._closeDialogTimeout=window.setTimeout(()=>{this._dialogOpen=!1,this._closeDialogTimeout=null},m)}handleToastDismiss(o){const t=o.detail.id;t&&this.removeToast(t)}updated(o){if(super.updated(o),o.has("_dialogOpen")){const t=this._dialogRef.value;if(!t)return;this._dialogOpen&&!t.open?t.show():!this._dialogOpen&&t.open&&t.close()}}disconnectedCallback(){super.disconnectedCallback(),this._closeDialogTimeout!==null&&(clearTimeout(this._closeDialogTimeout),this._closeDialogTimeout=null)}render(){return h`
2
- <dialog
3
- ${v(this._dialogRef)}
4
- class="gator-toaster-dialog"
5
- @click=${this.preventDialogClose}
6
- >
1
+ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as h}from"../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import{LitElement as f}from"../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{property as u}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as m}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as _}from"../../../utils/decorators/custom-element-decorator.js";import v from"../../../packages/web-components/src/components/toaster/gator/toaster.gator.scss.js";import d from"../../../packages/styles/dist/tokens/primitive.tokens.css.js";import T from"../../../packages/styles/dist/tokens/semantic.tokens.css.js";import"../../toast-container/gator/toast-container.gator.js";import{createRef as O,ref as P}from"../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/ref.js";import{MAX_TOAST_ACTIONS as n,TOAST_CLOSE_POPOVER_DELAY_MS as g}from"../../toast/gator/toast-constants.js";import{unsafeCSS as c}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var y=Object.defineProperty,S=Object.getOwnPropertyDescriptor,p=(o,t,s,r)=>{for(var e=r>1?void 0:r?S(t,s):t,a=o.length-1,l;a>=0;a--)(l=o[a])&&(e=(r?l(t,s,e):l(e))||e);return r&&e&&y(t,s,e),e};let i=class extends f{constructor(){super(...arguments),this.position="top-right",this.defaultToastOptions={},this._toasts=[],this._popoverOpen=!1,this._popoverRef=O(),this._closePopoverTimeout=null}addToast(o){const t=crypto.randomUUID(),s=o.duration??this.defaultToastOptions?.duration??i.defaultDuration,r=!s||s===0;let e=o.actions;e&&e.length>n&&(console.warn(`[ngc-toaster] Toast actions are limited to ${n}. Extra actions were ignored.`),e=e.slice(0,n));const a={...this.defaultToastOptions,...o,id:t,sticky:r,actions:e};return this._toasts=[...this._toasts,a],this._closePopoverTimeout!==null&&(clearTimeout(this._closePopoverTimeout),this._closePopoverTimeout=null),this._popoverOpen=!0,r||setTimeout(()=>{this.removeToast(t)},s),t}removeToast(o){this._toasts=this._toasts.filter(t=>t.id!==o),this._toasts.length===0&&this.scheduleClose()}clearAll(){this._toasts=[],this.scheduleClose()}scheduleClose(){this._closePopoverTimeout!==null&&clearTimeout(this._closePopoverTimeout),this._closePopoverTimeout=window.setTimeout(()=>{this._popoverOpen=!1,this._closePopoverTimeout=null},g)}handleToastDismiss(o){const t=o.detail.id;t&&this.removeToast(t)}updated(o){if(super.updated(o),o.has("_popoverOpen")){const t=this._popoverRef.value;if(!t)return;const s=t.matches(":popover-open");try{this._popoverOpen&&!s?t.showPopover():!this._popoverOpen&&s&&t.hidePopover()}catch{}}}disconnectedCallback(){super.disconnectedCallback(),this._closePopoverTimeout!==null&&(clearTimeout(this._closePopoverTimeout),this._closePopoverTimeout=null)}render(){return h`
2
+ <div ${P(this._popoverRef)} popover="manual" class="gator-toaster-popover">
7
3
  <div class="gator-toaster ${this.position}">
8
4
  <ngc-toast-container
9
5
  .toasts=${this._toasts}
10
6
  @dismiss=${this.handleToastDismiss}
11
7
  ></ngc-toast-container>
12
8
  </div>
13
- </dialog>
14
- `}preventDialogClose(o){o.stopPropagation()}};s.styles=[u(f),u(T),u(D)];s.defaultDuration=5e3;r([p({type:String})],s.prototype,"position",2);r([p({type:Object,attribute:"default-toast-options"})],s.prototype,"defaultToastOptions",2);r([d()],s.prototype,"_toasts",2);r([d()],s.prototype,"_dialogOpen",2);s=r([g("ngc-toaster")],s);export{s as NgcToaster};
9
+ </div>
10
+ `}};i.styles=[c(v),c(d),c(T)];i.defaultDuration=5e3;p([u({type:String})],i.prototype,"position",2);p([u({type:Object,attribute:"default-toast-options"})],i.prototype,"defaultToastOptions",2);p([m()],i.prototype,"_toasts",2);p([m()],i.prototype,"_popoverOpen",2);i=p([_("ngc-toaster")],i);export{i as NgcToaster};
@@ -1 +1 @@
1
- const t=".gator-toaster-dialog{border:none;padding:0;background:transparent;max-width:none;max-height:none;overflow:visible;margin:0}.gator-toaster-dialog::backdrop{display:none}.gator-toaster{position:fixed;display:flex;flex-direction:column}.gator-toaster.top-left{inset-block-start:var(--spacing-8, 1rem);inset-inline-start:var(--spacing-8, 1rem)}.gator-toaster.top-center{inset-block-start:var(--spacing-8, 1rem);inset-inline-start:50%;transform:translate(-50%)}.gator-toaster.top-right{inset-block-start:var(--spacing-8, 1rem);inset-inline-end:var(--spacing-8, 1rem)}.gator-toaster.bottom-left{inset-block-end:var(--spacing-8, 1rem);inset-inline-start:var(--spacing-8, 1rem)}.gator-toaster.bottom-center{inset-block-end:var(--spacing-8, 1rem);inset-inline-start:50%;transform:translate(-50%)}.gator-toaster.bottom-right{inset-block-end:var(--spacing-8, 1rem);inset-inline-end:var(--spacing-8, 1rem)}";export{t as default};
1
+ const t=".gator-toaster-popover{position:fixed;inset:auto;width:auto;height:auto;max-width:none;max-height:none;margin:0;padding:0;border:none;background:transparent;overflow:visible;pointer-events:none}.gator-toaster-popover::backdrop{display:none}.gator-toaster{position:fixed;display:flex;flex-direction:column;pointer-events:auto}.gator-toaster.top-left{inset-block-start:var(--spacing-8, 1rem);inset-inline-start:var(--spacing-8, 1rem)}.gator-toaster.top-center{inset-block-start:var(--spacing-8, 1rem);inset-inline-start:50%;transform:translate(-50%)}.gator-toaster.top-right{inset-block-start:var(--spacing-8, 1rem);inset-inline-end:var(--spacing-8, 1rem)}.gator-toaster.bottom-left{inset-block-end:var(--spacing-8, 1rem);inset-inline-start:var(--spacing-8, 1rem)}.gator-toaster.bottom-center{inset-block-end:var(--spacing-8, 1rem);inset-inline-start:50%;transform:translate(-50%)}.gator-toaster.bottom-right{inset-block-end:var(--spacing-8, 1rem);inset-inline-end:var(--spacing-8, 1rem)}";export{t as default};
@@ -7,6 +7,6 @@ export declare const MAX_TOAST_ACTIONS = 2;
7
7
  */
8
8
  export declare const TOAST_ANIMATION_DURATION_MS = 300;
9
9
  /**
10
- * Amount of time to wait before officially closing the toast dialog to account for animation timing
10
+ * Amount of time to wait before hiding the toast popover (leaving the top layer) to account for animation timing
11
11
  */
12
- export declare const TOAST_CLOSE_DIALOG_DELAY_MS: number;
12
+ export declare const TOAST_CLOSE_POPOVER_DELAY_MS: number;
@@ -18,20 +18,20 @@ export declare class NgcToaster extends LitElement {
18
18
  **/
19
19
  defaultToastOptions: DefaultToastOptions;
20
20
  private _toasts;
21
- private _dialogOpen;
22
- private _dialogRef;
23
- private _closeDialogTimeout;
21
+ private _popoverOpen;
22
+ private _popoverRef;
23
+ private _closePopoverTimeout;
24
24
  addToast(options: Partial<DefaultToastOptions> & {
25
25
  title?: string;
26
26
  subtitle?: string;
27
27
  }): `${string}-${string}-${string}-${string}-${string}`;
28
28
  removeToast(id: string): void;
29
29
  clearAll(): void;
30
+ private scheduleClose;
30
31
  private handleToastDismiss;
31
32
  updated(changedProperties: Map<string | number | symbol, unknown>): void;
32
33
  disconnectedCallback(): void;
33
34
  render(): import('lit').TemplateResult<1>;
34
- private preventDialogClose;
35
35
  }
36
36
  declare global {
37
37
  interface HTMLElementTagNameMap {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ncino/web-components",
3
3
  "author": "nCino",
4
- "version": "13.8.0",
4
+ "version": "13.8.1",
5
5
  "license": "(c) Copyright 2023 nCino, Inc., all rights reserved",
6
6
  "publishConfig": {
7
7
  "registry": "https://registry.npmjs.org/"
@@ -100,10 +100,10 @@
100
100
  "vite-plugin-static-copy": "^3.3.0",
101
101
  "vitest": "^4.1.0",
102
102
  "yaml-eslint-parser": "^2.0.0",
103
- "@ncino/styles": "13.8.0"
103
+ "@ncino/styles": "13.8.1"
104
104
  },
105
105
  "peerDependencies": {
106
- "@ncino/styles": "13.8.0"
106
+ "@ncino/styles": "13.8.1"
107
107
  },
108
108
  "bugs": {
109
109
  "url": "https://github.com/ncino/force-sdk-web-components/issues"
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@ncino/web-components",
4
- "version": "13.7.2",
4
+ "version": "13.8.0",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {