@ncino/web-components 8.0.0-preview.27 → 8.0.0-preview.29

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,4 +1,4 @@
1
- import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as i,nothing as h}from"../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";import"../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";import{customElement as g}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/custom-element.js";import"../../button/slds/button.slds.js";import"../../button/gator/button.gator.js";import"../../icon/slds/icon.slds.js";import"../../icon/gator/icon.gator.js";import"../../skeleton-loader/gator/skeleton-loader.gator.js";import"../../loading-spinner/gator/loading-spinner.gator.js";import m from"../../../packages/web-components/src/components/icon-button/gator/icon-button.gator.scss.js";import p from"../../../packages/web-components/src/tokens/primitive.tokens.scss.js";import b from"../../../packages/web-components/src/tokens/semantic.tokens.scss.js";import{NjcIconButton as c}from"../icon-button.js";import{ifDefined as u}from"../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.js";import{unsafeCSS as r}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var k=Object.getOwnPropertyDescriptor,f=(t,o,d,n)=>{for(var e=n>1?void 0:n?k(o,d):o,s=t.length-1,l;s>=0;s--)(l=t[s])&&(e=l(e)||e);return e};let a=class extends c{render(){return this.skeleton?this.skeletonMarkup:i`
1
+ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as i,nothing as h}from"../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";import"../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";import{customElement as g}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/custom-element.js";import"../../button/slds/button.slds.js";import"../../button/gator/button.gator.js";import"../../icon/slds/icon.slds.js";import"../../icon/gator/icon.gator.js";import"../../skeleton-loader/gator/skeleton-loader.gator.js";import"../../loading-spinner/gator/loading-spinner.gator.js";import m from"../../../packages/web-components/src/components/icon-button/gator/icon-button.gator.scss.js";import p from"../../../packages/web-components/src/tokens/primitive-new.tokens.scss.js";import b from"../../../packages/web-components/src/tokens/semantic-new.tokens.scss.js";import{NjcIconButton as c}from"../icon-button.js";import{ifDefined as u}from"../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.js";import{unsafeCSS as r}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var k=Object.getOwnPropertyDescriptor,f=(t,o,d,n)=>{for(var e=n>1?void 0:n?k(o,d):o,s=t.length-1,l;s>=0;s--)(l=t[s])&&(e=l(e)||e);return e};let a=class extends c{render(){return this.skeleton?this.skeletonMarkup:i`
2
2
  <button
3
3
  aria-label=${this.buttonAriaLabel}
4
4
  data-testid=${u(this.dataTestid?`${this.dataTestid}-icon-button`:void 0)}
@@ -1,4 +1,4 @@
1
- import{customElement as m}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/custom-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{NgcInputText as h}from"../input-text/input-text.gator.js";import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as d}from"../../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";import p from"../../../../packages/web-components/src/components/input/gator/input-currency/input-currency.gator.scss.js";import{str as y}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/str-tag.js";import{msg as c}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import{localized as f}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js";import"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import{unsafeCSS as v}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var g=Object.defineProperty,_=Object.getOwnPropertyDescriptor,b=Object.getPrototypeOf,C=Reflect.get,o=(e,r,t,i)=>{for(var a=i>1?void 0:i?_(r,t):r,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=(i?l(r,t,a):l(a))||a);return i&&a&&g(r,t,a),a},D=(e,r,t)=>C(b(e),t,r);let s=class extends h{constructor(){super(...arguments),this.value="",this._value="",this.type="text",this.currencyIsoCode="USD"}render(){return d`
1
+ import{customElement as d}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/custom-element.js";import{property as h}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{NgcInputText as p}from"../input-text/input-text.gator.js";import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as y}from"../../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";import f from"../../../../packages/web-components/src/components/input/gator/input-currency/input-currency.gator.scss.js";import{str as c}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/str-tag.js";import{msg as s}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import{localized as v}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js";import"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import{unsafeCSS as g}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var _=Object.defineProperty,b=Object.getOwnPropertyDescriptor,C=Object.getPrototypeOf,x=Reflect.get,u=(e,r,t,i)=>{for(var a=i>1?void 0:i?b(r,t):r,l=e.length-1,o;l>=0;l--)(o=e[l])&&(a=(i?o(r,t,a):o(a))||a);return i&&a&&_(r,t,a),a},D=(e,r,t)=>x(C(e),t,r);let n=class extends p{constructor(){super(...arguments),this.value="",this._value="",this.type="text",this.currencyIsoCode="USD"}render(){return y`
2
2
  ${super.render()}
3
3
  <div id="ngc-input-currency-descriptor">${this.currencyIsoCode}</div>
4
- `}connectedCallback(){super.connectedCallback(),this.startIcon="",this._startIconAsText=this.currencySymbol,this._value=this.format(this.value),this._inputMode="numeric",this._placeholder=this.placeholder||this.format("0"),this._ariaDescribedBy="ngc-input-currency-descriptor"}updated(e){if(super.updated(e),e.has("value")&&e.get("value")&&(this._value=this.value),e.has("currencyIsoCode")&&(this._startIconAsText=this.currencySymbol,this._placeholder=this.placeholder||this.format("0")),e.has("locale")){const r=this.isPeriodAsDecimalCurrency?".":",",t=this.isPeriodAsDecimalCurrency?",":".";this._value&&(this._value=this.format(this._value.replaceAll(t,r)));const i=new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:this._value}});this.dispatchEvent(i),this._placeholder=this.placeholder||this.format("0")}this.validateInput(this._value)}validateInput(e){if(/.*[^,\d.].*/.test(e))return this._internalValidationError=c("Invalid input. Only numbers, commas or periods are allowed."),!1;const t=this.isPeriodAsDecimalCurrency?".":",",i=(this._value.match(new RegExp("\\"+t,"g"))??[]).length;if(!(this.numDecimalPlaces>0)&&i>0)return this._internalValidationError=c("Invalid input. No decimals are allowed for this currency."),!1;if(i>1)return this._internalValidationError=c("Invalid input. Only one decimal character is allowed."),!1;const n=new RegExp("^[\\d,]+\\.\\d{"+(this.numDecimalPlaces+1)+",}$"),l=new RegExp("^[\\d.]+,\\d{"+(this.numDecimalPlaces+1)+",}$");return(this.isPeriodAsDecimalCurrency?n:l).test(e)?(this._internalValidationError=c(y`Invalid input. Only ${this.numDecimalPlaces} decimal places are allowed.`),!1):this._value===t?(this._internalValidationError=c("Invalid input. Please enter a valid number value."),!1):(this._internalValidationError="",!0)}handleChange(){if(this.displayedErrorText)return;let r=this.inputRef.value?.value.replaceAll(this.currencyThousandsSeparator,"");this.isPeriodAsDecimalCurrency||(r=r?.replaceAll(",","."));const t=this.format(r??"0.00"),i=new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:t}});this.dispatchEvent(i)}currencyNumberFormater(e={}){return new Intl.NumberFormat(this.locale||navigator.language,{style:"currency",currency:this.currencyIsoCode||"USD",currencyDisplay:"narrowSymbol",...e})}format(e){return e?this.currencyNumberFormater({useGrouping:!1}).format(parseFloat(e)).replaceAll(this.currencySymbol,"").trim():""}get currencySymbol(){return this.currencyNumberFormater({currencyDisplay:"narrowSymbol"}).formatToParts(1).find(e=>e.type==="currency")?.value??"$"}get currencyThousandsSeparator(){return this.currencyNumberFormater().formatToParts(1e3).find(e=>e.type==="group")?.value??","}get numDecimalPlaces(){return(this.currencyNumberFormater().format(1).match(/0/g)||[]).length}get isPeriodAsDecimalCurrency(){return this.currencyThousandsSeparator===","}};s.styles=[...D(s,s,"styles"),v(p)];o([u({attribute:"currency-iso-code"})],s.prototype,"currencyIsoCode",2);o([u()],s.prototype,"locale",2);s=o([f(),m("ngc-input-currency")],s);export{s as NgcInputCurrency};
4
+ `}connectedCallback(){super.connectedCallback(),this.startIcon="",this._startIconAsText=this.currencySymbol,this._value=this.format(this.value),this._inputMode="numeric",this._placeholder=this.placeholder||this.format("0"),this._ariaDescribedBy="ngc-input-currency-descriptor"}updated(e){if(super.updated(e),e.has("value")&&e.get("value")&&(this._value=this.value),e.has("currencyIsoCode")&&(this._startIconAsText=this.currencySymbol,this._placeholder=this.placeholder||this.format("0")),e.has("locale")){const r=this.isPeriodAsDecimalCurrency?".":",",t=this.isPeriodAsDecimalCurrency?",":".";this._value&&(this._value=this.format(this._value.replaceAll(t,r)));const i=new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:this._value}});this.dispatchEvent(i),this._placeholder=this.placeholder||this.format("0")}this.validateInput(this._value)}validateInput(e){if(/.*[^,\d.].*/.test(e))return this._internalValidationError=s("Invalid input. Only numbers, commas or periods are allowed."),!1;const t=this.isPeriodAsDecimalCurrency?".":",",i=(this._value.match(new RegExp("\\"+t,"g"))??[]).length;if(!(this.numDecimalPlaces>0)&&i>0)return this._internalValidationError=s("Invalid input. No decimals are allowed for this currency."),!1;if(i>1)return this._internalValidationError=s("Invalid input. Only one decimal character is allowed."),!1;const l=new RegExp("^[\\d,]+\\.\\d{"+(this.numDecimalPlaces+1)+",}$"),o=new RegExp("^[\\d.]+,\\d{"+(this.numDecimalPlaces+1)+",}$");if((this.isPeriodAsDecimalCurrency?l:o).test(e))return this._internalValidationError=s(c`Invalid input. Only ${this.numDecimalPlaces} decimal places are allowed.`),!1;if(this._value===t)return this._internalValidationError=s("Invalid input. Please enter a valid number value."),!1;const m=parseFloat(e.replaceAll(this.currencyThousandsSeparator,"").replaceAll(",","."));return this.min!==void 0&&!isNaN(Number(this.min))&&m<Number(this.min)?(this._internalValidationError=s(c`Invalid input. Value must be greater than or equal to ${this.format(this.min.toString())}.`),!1):this.max!==void 0&&!isNaN(Number(this.max))&&m>Number(this.max)?(this._internalValidationError=s(c`Invalid input. Value must be less than or equal to ${this.format(this.max.toString())}.`),!1):(this._internalValidationError="",!0)}handleChange(){if(this.displayedErrorText)return;let r=this.inputRef.value?.value.replaceAll(this.currencyThousandsSeparator,"");this.isPeriodAsDecimalCurrency||(r=r?.replaceAll(",","."));const t=this.format(r??"0.00"),i=new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:t}});this.dispatchEvent(i)}currencyNumberFormater(e={}){return new Intl.NumberFormat(this.locale||navigator.language,{style:"currency",currency:this.currencyIsoCode||"USD",currencyDisplay:"narrowSymbol",...e})}format(e){return e?this.currencyNumberFormater({useGrouping:!1}).format(parseFloat(e)).replaceAll(this.currencySymbol,"").trim():""}get currencySymbol(){return this.currencyNumberFormater({currencyDisplay:"narrowSymbol"}).formatToParts(1).find(e=>e.type==="currency")?.value??"$"}get currencyThousandsSeparator(){return this.currencyNumberFormater().formatToParts(1e3).find(e=>e.type==="group")?.value??","}get numDecimalPlaces(){return(this.currencyNumberFormater().format(1).match(/0/g)||[]).length}get isPeriodAsDecimalCurrency(){return this.currencyThousandsSeparator===","}};n.styles=[...D(n,n,"styles"),g(f)];u([h({attribute:"currency-iso-code"})],n.prototype,"currencyIsoCode",2);u([h()],n.prototype,"locale",2);n=u([v(),d("ngc-input-currency")],n);export{n as NgcInputCurrency};
@@ -1 +1 @@
1
- const o=".gator-icon-button{display:inline-flex;align-items:center;justify-content:center;border-style:none;cursor:pointer;margin:var(--ngc-icon-button-margin, auto);background-color:var(--ngc-icon-button-background-color, transparent);padding:var(--ngc-icon-button-padding, 0);border-radius:50%}.gator-icon-button ngc-icon{--ngc-icon-color: var(--ngc-icon-button-icon-color, var(--color-primary-03-base))}.gator-icon-button_xsmall{height:var(--ngc-icon-button-height, 1.5rem);width:var(--ngc-icon-button-width, 1.5rem)}.gator-icon-button_xsmall ngc-icon{--ngc-icon-height: 1rem;--ngc-icon-width: 1rem}.gator-icon-button_xsmall .gator-icon-button_loader{display:inline-flex;align-items:center;justify-content:center;height:1.5rem;width:1.5rem}.gator-icon-button_small{height:var(--ngc-icon-button-height, 1.5rem);width:var(--ngc-icon-button-width, 1.5rem)}.gator-icon-button_small ngc-icon{--ngc-icon-height: 1.125rem;--ngc-icon-width: 1.125rem}.gator-icon-button_medium{height:var(--ngc-icon-button-height, 2rem);width:var(--ngc-icon-button-width, 2rem)}.gator-icon-button_medium ngc-icon{--ngc-icon-height: 1.5rem;--ngc-icon-width: 1.5rem}.gator-icon-button_large{height:var(--ngc-icon-button-height, 3rem);width:var(--ngc-icon-button-width, 3rem)}.gator-icon-button_large ngc-icon{--ngc-icon-height: 2.25rem;--ngc-icon-width: 2.25rem}.gator-icon-button_xlarge{height:var(--ngc-icon-button-height, 3rem);width:var(--ngc-icon-button-width, 3rem)}.gator-icon-button_xlarge ngc-icon{--ngc-icon-height: 2.5rem;--ngc-icon-width: 2.5rem}.gator-icon-button-loader{display:flex;align-items:center;justify-content:center;background-color:var(--ngc-icon-button-loading-background-color, var(--color-surface-loading));border-radius:50%}.gator-icon-button-loader_xsmall{width:16px;height:16px}.gator-icon-button-loader_small{width:20px;height:20px}.gator-icon-button-loader_medium{width:24px;height:24px}.gator-icon-button-loader_large{width:36px;height:36px}.gator-icon-button-loader_xlarge{width:40px;height:40px}.gator-icon-button[disabled]{cursor:not-allowed}.gator-icon-button[disabled] ngc-icon{--ngc-icon-color: var(--ngc-icon-button-disabled-color, var(--color-text-disabled))}.gator-icon-button:not([disabled]):not(.gator-icon-button_loading):hover{box-shadow:var(--ngc-icon-button-hover-box-shadow, 0px 3px 6px 0px rgba(31, 31, 31, .2))}.gator-icon-button:not([disabled]):focus-visible{outline:var(--ngc-icon-button-focus-outline, 2px solid var(--color-focus-border));outline-offset:2px}.gator-icon-button:focus-visible.no-focus-visible{outline:none}.gator-icon-button:not([disabled]):not(.gator-icon-button_loading):active{background-color:var(--ngc-icon-button-pressed-background-color, var(--color-surface-brand-secondary));box-shadow:none}.gator-icon-button.gator-icon-button_loading{cursor:not-allowed}";export{o as default};
1
+ const o=".gator-icon-button{display:inline-flex;align-items:center;justify-content:center;border-style:none;cursor:pointer;margin:var(--ngc-icon-button-margin, auto);background-color:var(--ngc-icon-button-background-color, transparent);padding:var(--ngc-icon-button-padding, 0);border-radius:var(--border-radius-circle, 9999px)}.gator-icon-button ngc-icon{--ngc-icon-color: var(--ngc-icon-button-icon-color, var(--color-icon-primary, #1F1F1F))}.gator-icon-button_xsmall{height:var(--ngc-icon-button-height, 1.5rem);width:var(--ngc-icon-button-width, 1.5rem)}.gator-icon-button_xsmall ngc-icon{--ngc-icon-height: 1rem;--ngc-icon-width: 1rem}.gator-icon-button_xsmall .gator-icon-button_loader{display:inline-flex;align-items:center;justify-content:center;height:1.5rem;width:1.5rem}.gator-icon-button_small{height:var(--ngc-icon-button-height, 1.5rem);width:var(--ngc-icon-button-width, 1.5rem)}.gator-icon-button_small ngc-icon{--ngc-icon-height: 1.125rem;--ngc-icon-width: 1.125rem}.gator-icon-button_medium{height:var(--ngc-icon-button-height, 2rem);width:var(--ngc-icon-button-width, 2rem)}.gator-icon-button_medium ngc-icon{--ngc-icon-height: 1.5rem;--ngc-icon-width: 1.5rem}.gator-icon-button_large{height:var(--ngc-icon-button-height, 3rem);width:var(--ngc-icon-button-width, 3rem)}.gator-icon-button_large ngc-icon{--ngc-icon-height: 2.25rem;--ngc-icon-width: 2.25rem}.gator-icon-button_xlarge{height:var(--ngc-icon-button-height, 3rem);width:var(--ngc-icon-button-width, 3rem)}.gator-icon-button_xlarge ngc-icon{--ngc-icon-height: 2.5rem;--ngc-icon-width: 2.5rem}.gator-icon-button-loader{display:flex;align-items:center;justify-content:center;background-color:var(--ngc-icon-button-loading-background-color, var(--color-surface-loading, #DBDBDB));border-radius:var(--border-radius-circle, 9999px)}.gator-icon-button-loader_xsmall{width:16px;height:16px}.gator-icon-button-loader_small{width:20px;height:20px}.gator-icon-button-loader_medium{width:24px;height:24px}.gator-icon-button-loader_large{width:36px;height:36px}.gator-icon-button-loader_xlarge{width:40px;height:40px}.gator-icon-button[disabled]{cursor:not-allowed}.gator-icon-button[disabled] ngc-icon{--ngc-icon-color: var(--ngc-icon-button-disabled-color, var(--color-icon-disabled, #BFBFBF))}.gator-icon-button:not([disabled]):not(.gator-icon-button_loading):hover{box-shadow:var(--ngc-icon-button-hover-box-shadow, var(--shadow-2-card-raised))}.gator-icon-button:not([disabled]):focus-visible{outline:var(--ngc-icon-button-focus-outline, 2px solid var(--color-border-neutral, #1F1F1F));outline-offset:2px}.gator-icon-button:focus-visible.no-focus-visible{outline:none}.gator-icon-button:not([disabled]):not(.gator-icon-button_loading):active{background-color:var(--ngc-icon-button-pressed-background-color, var(--color-surface-brand-tertiary, #BDCDDC));box-shadow:none}.gator-icon-button.gator-icon-button_loading{cursor:not-allowed}";export{o as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ncino/web-components",
3
3
  "author": "nCino",
4
- "version": "8.0.0-preview.27",
4
+ "version": "8.0.0-preview.29",
5
5
  "license": "(c) Copyright 2023 nCino, Inc., all rights reserved",
6
6
  "publishConfig": {
7
7
  "registry": "https://registry.npmjs.org/"
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": "8.0.0-preview.26",
4
+ "version": "8.0.0-preview.28",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {