@ncino/web-components 4.0.0-preview.8 → 4.0.0-preview.9
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/components/chip/chip.js +1 -1
- package/dist/components/chip/gator/chip.gator.js +12 -4
- package/dist/packages/web-components/src/components/chip/gator/chip.gator.scss.js +1 -1
- package/dist/types/components/chip/chip.d.ts +5 -0
- package/dist/types/components/chip/gator/chip.gator.d.ts +1 -0
- package/package.json +1 -1
- package/web-types.json +6 -1
- package/dist/packages/web-components/src/components/chip/chip.tokens.scss.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{property as t}from"../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/property.js";import{TestableLitElement as
|
|
1
|
+
import{property as t}from"../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/property.js";import{TestableLitElement as d}from"../../utils/components/testable-lit-element/testable-lit-element.js";var n=Object.defineProperty,r=(p,i,l,y)=>{for(var e=void 0,s=p.length-1,a;s>=0;s--)(a=p[s])&&(e=a(i,l,e)||e);return e&&n(i,l,e),e};class o extends d{constructor(){super(...arguments),this.disabled=!1,this.readonly=!1,this.type=null,this.size=null,this.hideBorder=!1}}r([t({type:Boolean})],o.prototype,"disabled");r([t({type:Boolean})],o.prototype,"readonly");r([t()],o.prototype,"type");r([t()],o.prototype,"size");r([t({type:Boolean,attribute:"hide-border"})],o.prototype,"hideBorder");export{o as NjcChip};
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/reactive-element.js";import{html as p}from"../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/lit-html.js";import"../../../node_modules/.pnpm/lit-element@4.2.0/node_modules/lit-element/lit-element.js";import{customElement as
|
|
2
|
-
<button
|
|
1
|
+
import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/reactive-element.js";import{html as p}from"../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/lit-html.js";import"../../../node_modules/.pnpm/lit-element@4.2.0/node_modules/lit-element/lit-element.js";import{customElement as n}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/custom-element.js";import m from"../../../packages/web-components/src/tokens/primitive.tokens.scss.js";import u from"../../../packages/web-components/src/tokens/semantic.tokens.scss.js";import g from"../../../packages/web-components/src/components/chip/gator/chip.gator.scss.js";import{NjcChip as c}from"../chip.js";import{classMap as h}from"../../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/class-map.js";import{unsafeCSS as r}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/css-tag.js";var b=Object.getOwnPropertyDescriptor,f=(t,o,d,a)=>{for(var s=a>1?void 0:a?b(o,d):o,i=t.length-1,l;i>=0;i--)(l=t[i])&&(s=l(s)||s);return s};let e=class extends c{render(){return this.readonly?this.readonlyChipMarkup:this.chipMarkup}get chipMarkup(){return p`
|
|
2
|
+
<button
|
|
3
|
+
class=${h(this.classes)}
|
|
4
|
+
?disabled="${this.disabled}"
|
|
5
|
+
@click=${this.handleClick}
|
|
6
|
+
>
|
|
3
7
|
<slot></slot>
|
|
4
8
|
</button>
|
|
5
9
|
`}get readonlyChipMarkup(){return p`
|
|
6
|
-
<div
|
|
10
|
+
<div
|
|
11
|
+
class="gator-chip__read-only ${h(this.classes)}"
|
|
12
|
+
aria-disabled="${this.disabled}"
|
|
13
|
+
@click=${this.handleClick}
|
|
14
|
+
>
|
|
7
15
|
<slot></slot>
|
|
8
16
|
</div>
|
|
9
|
-
`}handleClick(t){t.stopPropagation(),t.preventDefault(),!(this.disabled||this.readonly)&&this.dispatchEvent(new Event("click",{bubbles:!0}))}get classes(){return{"gator-chip":!0,"gator-chip_small":this.size==="small","gator-chip_disabled":this.disabled,[`gator-chip_${this.type}`]:this.type!==null}}};
|
|
17
|
+
`}handleClick(t){t.stopPropagation(),t.preventDefault(),!(this.disabled||this.readonly)&&this.dispatchEvent(new Event("click",{bubbles:!0}))}get classes(){return{"gator-chip":!0,"gator-chip_small":this.size==="small","gator-chip_disabled":this.disabled,"hide-border":this.hideBorder,[`gator-chip_${this.type}`]:this.type!==null}}};e.shadowRootOptions={...c.shadowRootOptions,delegatesFocus:!0};e.styles=[r(g),r(m),r(u)];e=f([n("ngc-chip")],e);export{e as NgcChip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const r='.gator-chip{background-color:var(--ngc-chip-background-color);border-radius:var(--ngc-chip-border-radius);display:inline-block;padding:var(--ngc-chip-padding);font-family:var(--text-family-body, "Open Sans"),sans-serif;font-size:var(--ngc-chip-font-size);line-height:var(--ngc-chip-line-height);border:var(--ngc-chip-border);color:var(--color-neutral-70);cursor:var(--ngc-chip-cursor, default)
|
|
1
|
+
const r='.gator-chip{background-color:var(--ngc-chip-background-color, var(--color-background-primary));border-radius:var(--ngc-chip-border-radius, 3rem);display:inline-block;padding:var(--ngc-chip-padding, .25rem .75rem);font-family:var(--text-family-body, "Open Sans"),sans-serif;font-size:var(--ngc-chip-font-size, .9375rem);line-height:var(--ngc-chip-line-height);border:var(--ngc-chip-border, 1px solid var(--color-stroke-tertiary, #E5E5E5));color:var(--color-neutral-70);cursor:var(--ngc-chip-cursor, default)}button:hover{background-color:var(--ngc-chip-hover-background-color, var(--color-neutral-20));cursor:var(--ngc-chip-cursor, pointer)}button:focus-visible{outline:none;box-shadow:var(--ngc-chip-focus-box-shadow, var(--shadow-x-offset-0, 0px) var(--shadow-y-offset-0, 0px) var(--shadow-blur-0, 0px) var(--shadow-spread-2, 2px) var(--color-focus-gap, #FFF), var(--shadow-x-offset-0, 0px) var(--shadow-y-offset-0, 0px) var(--shadow-blur-0, 0px) var(--shadow-spread-4, 4px) var(--color-focus-border, #11395B))}button:active{background-color:var(--ngc-chip-active-background-color)}.gator-chip_disabled{cursor:not-allowed!important;color:var(--button-color-default-text-disabled, #6D6D6D);outline:1px solid transparent!important;background:var(--color-surface-disabled, #E5E5E5);border:1px solid transparent!important}.gator-chip_disabled:hover{background:var(--color-surface-disabled, #E5E5E5)!important}.gator-chip__read-only{cursor:var(--ngc-chip-cursor, default !important)}.gator-chip__read-only:active{background-color:var(--ngc-chip-background-color, var(--color-background-primary))}.gator-chip_error{background:var(--color-surface-error, #FAEBE7);border:1px solid var(--color-stroke-error-weak, #E99F88)}.gator-chip_error:hover:not(.gator-chip__read-only){background:var(--color-stroke-error-weak, #E99F88)}.gator-chip_warning{background:var(--color-surface-error, #FAEBE7);border:1px solid var(--color-stroke-warning, #F5B77F)}.gator-chip_warning:hover:not(.gator-chip__read-only){background:var(--color-stroke-warning, #F5B77F)}.gator-chip_success{background:var(--color-surface-success, #E9F7F0);border:1px solid var(--color-stroke-success, #90D4B4)}.gator-chip_success:hover:not(.gator-chip__read-only){background:var(--color-stroke-success, #90D4B4)}.gator-chip_info{border:1px solid var(--color-surface-brand-secondary, #C3CDD6);background:var(--color-surface-brand-hover, #E4ECF2)}.gator-chip_info:hover:not(.gator-chip__read-only){background:var(--color-surface-brand-secondary, #C3CDD6)}.gator-chip_small{font-size:var(--text-size-caption);line-height:var(--text-line-height-caption)}.hide-border{border:none}';export{r as default};
|
package/package.json
CHANGED
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": "4.0.0-preview.
|
|
4
|
+
"version": "4.0.0-preview.8",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -124,6 +124,10 @@
|
|
|
124
124
|
"name": "size",
|
|
125
125
|
"value": { "type": " | 'small'", "default": "null" }
|
|
126
126
|
},
|
|
127
|
+
{
|
|
128
|
+
"name": "hide-border",
|
|
129
|
+
"value": { "type": "boolean", "default": "false" }
|
|
130
|
+
},
|
|
127
131
|
{
|
|
128
132
|
"name": "data-testid",
|
|
129
133
|
"value": { "type": "string | undefined", "default": "undefined" }
|
|
@@ -145,6 +149,7 @@
|
|
|
145
149
|
"type": " | 'success' | 'warning' | 'error' | 'info'"
|
|
146
150
|
},
|
|
147
151
|
{ "name": "size", "type": " | 'small'" },
|
|
152
|
+
{ "name": "hideBorder", "type": "boolean" },
|
|
148
153
|
{ "name": "dataTestid", "type": "string | undefined" },
|
|
149
154
|
{ "name": "labelDataTestid" },
|
|
150
155
|
{ "name": "helpTextDataTestid" },
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const o=":host{--ngc-chip-disabled-color: var(--color-neutral-50);--ngc-chip-color: var(--color-neutral-70);--ngc-chip-background-color: var(--color-background-primary);--ngc-chip-hover-background-color: var(--color-neutral-20);--ngc-chip-border-radius: 3rem;--ngc-chip-focus-box-shadow: var(--shadow-x-offset-0, 0px) var(--shadow-y-offset-0, 0px) var(--shadow-blur-0, 0px) var(--shadow-spread-2, 2px) var(--color-focus-gap, #FFF), var(--shadow-x-offset-0, 0px) var(--shadow-y-offset-0, 0px) var(--shadow-blur-0, 0px) var(--shadow-spread-4, 4px) var(--color-focus-border, #11395B);--ngc-chip-padding: .25rem .75rem;--ngc-chip-font-size: .9375rem;--ngc-chip-border: none}";export{o as default};
|