@nordhealth/components
Advanced tools
Comparing version 1.0.0-alpha.22 to 1.0.0-alpha.23
@@ -90,3 +90,3 @@ { | ||
"default": "\"submit\"", | ||
"description": "The type of button.", | ||
"description": "The type of the button.", | ||
"attribute": "type", | ||
@@ -259,3 +259,3 @@ "reflects": true | ||
"default": "\"submit\"", | ||
"description": "The type of button.", | ||
"description": "The type of the button.", | ||
"fieldName": "type" | ||
@@ -451,2 +451,3 @@ }, | ||
"default": "false", | ||
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.", | ||
"attribute": "hide-label" | ||
@@ -677,2 +678,3 @@ }, | ||
"default": "false", | ||
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.", | ||
"fieldName": "hideLabel" | ||
@@ -679,0 +681,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
import"./custom-element-a6d824b8.js";import"./property-03f59dce.js";export{B as default}from"./Button-1018fd8a.js"; | ||
import"./custom-element-a6d824b8.js";import"./property-03f59dce.js";export{B as default}from"./Button-382ffa7f.js"; | ||
//# sourceMappingURL=Button.js.map |
@@ -1,2 +0,2 @@ | ||
export{default as VisuallyHidden}from"./VisuallyHidden.js";export{B as Button}from"./Button-1018fd8a.js";export{default as Stack}from"./Stack.js";export{default as Select}from"./Select.js";import"./custom-element-a6d824b8.js";import"./property-03f59dce.js";import"./events.js"; | ||
export{default as VisuallyHidden}from"./VisuallyHidden.js";export{B as Button}from"./Button-382ffa7f.js";export{default as Stack}from"./Stack.js";export{default as Select}from"./Select.js";import"./custom-element-a6d824b8.js";import"./property-03f59dce.js";import"./events.js"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{r as e,_ as t,y as o,a as n,n as a}from"./custom-element-a6d824b8.js";import{e as l}from"./property-03f59dce.js";import{I as s,n as i,l as r,F as d}from"./Button-1018fd8a.js";import"./VisuallyHidden.js";import{NordEvent as c}from"./events.js";const h=e`:host{display:block}*,::after,::before{box-sizing:border-box}.n-select-container{position:relative;inline-size:fit-content}:host([expand]) .n-select-container{inline-size:100%}select{-webkit-appearance:none;appearance:none;position:absolute;font-size:var(--n-font-size-m);font-family:var(--n-font-family);color:var(--n-color-text);inline-size:100%;opacity:.0001;cursor:pointer;background:0 0;border:0;block-size:var(--n-space-xl);inset-block-end:0;inset-inline-start:0;z-index:2}nord-button{--n-button-text-align:start}select:not(:disabled):hover+nord-button{--n-button-background-color:var(--n-color-button-hover);--n-button-border-color:var(--n-color-border-hover)}select:not(:disabled):hover+nord-button svg{fill:var(--n-color-icon-hover)}select:focus+nord-button{outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}:host([disabled]) select{cursor:auto}label{display:block;padding-block-end:var(--n-space-s)}::slotted(:not([slot])){display:none}svg[slot=after]{fill:var(--n-color-icon);margin-inline-start:var(--n-space-m);margin-inline-end:calc(var(--n-space-s)/ -2);inline-size:calc(var(--n-space-l)/ 2)}::slotted([slot=before]){margin-inline-start:calc(var(--n-space-s) * -1);margin-inline-end:var(--n-space-s)}`;let p=class extends(function(e){class o extends e{constructor(){super(...arguments),this.label="",this.required=!1,this.handleFormData=e=>{var t;this.name&&e.formData.append(this.name,null!==(t=this.value)&&void 0!==t?t:"")}}connectedCallback(){var e;super.connectedCallback(),null===(e=this.form)||void 0===e||e.addEventListener("formdata",this.handleFormData)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.form)||void 0===e||e.removeEventListener("formdata",this.handleFormData)}handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new c("change"))}}return t([l()],o.prototype,"label",void 0),t([l({type:Boolean})],o.prototype,"required",void 0),o}(s(d(a)))){constructor(){super(...arguments),this.hideLabel=!1,this.expand=!1}render(){const e=this.options,t=this.getButtonText(e);return o`<slot @slotchange="${this.handleSlotChange}"></slot>${this.renderLabel()}<div class="n-select-container"><select ${i(this.focusableRef)} id="select" ?disabled="${this.disabled}" ?required="${this.required}" name="${r(this.name)}" @change="${this.handleChange}">${this.placeholder&&o`<option value="" disabled="disabled" ?selected="${!this.value}">${this.placeholder}</option>`} ${e.map((e=>this.renderOption(e)))}</select><nord-button tabindex="-1" ?disabled="${this.disabled}" ?expand="${this.expand}" aria-hidden="true" type="button"><slot slot="before" name="before"></slot>${t} <svg slot="after" height="12" width="10" viewBox="0 0 10 12" xmlns="http://www.w3.org/2000/svg"><path d="m4.43391.234315c.31242-.3124199.81895-.3124199 1.13137 0l3.53554 3.535535c.31242.31242.31242.81895 0 1.13137s-.81896.31242-1.13137 0l-2.96985-2.96985-2.96985 2.96985c-.31242.31242-.81895.31242-1.131373 0-.312419-.31242-.312419-.81895 0-1.13137z"/><path d="m.898377 7.09857c.312423-.31242.818953-.31242 1.131373 0l2.96985 2.96983 2.96985-2.96983c.31241-.31242.81895-.31242 1.13137 0s.31242.81895 0 1.13137l-3.53554 3.53556c-.31242.3124-.81895.3124-1.13137 0l-3.535533-3.53556c-.312419-.31242-.312419-.81895 0-1.13137z"/></svg></nord-button></div>`}handleSlotChange(){this.requestUpdate()}get options(){return Array.from(this.querySelectorAll("option"))}getButtonText(e){const t=e.find((e=>e.value===this.value));return t?t.text:this.placeholder?this.placeholder:e[0]?e[0].text:""}renderLabel(){const e=o`<label for="select"><slot name="label">${this.label}</slot></label>`;return this.hideLabel?o`<nord-visually-hidden>${e}</nord-visually-hidden>`:e}renderOption(e){return o`<option value="${r(e.value)}" ?disabled="${e.disabled}" ?selected="${e.value===this.value}">${e.text}</option>`}};p.styles=[h],t([l({type:Boolean,attribute:"hide-label"})],p.prototype,"hideLabel",void 0),t([l()],p.prototype,"placeholder",void 0),t([l({reflect:!0,type:Boolean})],p.prototype,"expand",void 0),p=t([n("nord-select")],p);var u=p;export{u as default}; | ||
import{r as e,_ as t,y as o,a as n,n as a}from"./custom-element-a6d824b8.js";import{e as l}from"./property-03f59dce.js";import{I as s,n as i,l as r,F as d}from"./Button-382ffa7f.js";import"./VisuallyHidden.js";import{NordEvent as c}from"./events.js";const h=e`:host{display:block}*,::after,::before{box-sizing:border-box}.n-select-container{position:relative;inline-size:fit-content}:host([expand]) .n-select-container{inline-size:100%}select{-webkit-appearance:none;appearance:none;position:absolute;font-size:var(--n-font-size-m);font-family:var(--n-font-family);color:var(--n-color-text);inline-size:100%;opacity:.0001;cursor:pointer;background:0 0;border:0;block-size:var(--n-space-xl);inset-block-end:0;inset-inline-start:0;z-index:2}nord-button{--n-button-text-align:start}select:not(:disabled):hover+nord-button{--n-button-background-color:var(--n-color-button-hover);--n-button-border-color:var(--n-color-border-hover)}select:not(:disabled):hover+nord-button svg{fill:var(--n-color-icon-hover)}select:focus+nord-button{outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}:host([disabled]) select{cursor:auto}label{display:block;padding-block-end:var(--n-space-s)}::slotted(:not([slot])){display:none}svg[slot=after]{fill:var(--n-color-icon);margin-inline-start:var(--n-space-m);margin-inline-end:calc(var(--n-space-s)/ -2);inline-size:calc(var(--n-space-l)/ 2)}::slotted([slot=before]){margin-inline-start:calc(var(--n-space-s) * -1);margin-inline-end:var(--n-space-s)}`;let p=class extends(function(e){class o extends e{constructor(){super(...arguments),this.label="",this.required=!1,this.handleFormData=e=>{var t;this.name&&e.formData.append(this.name,null!==(t=this.value)&&void 0!==t?t:"")}}connectedCallback(){var e;super.connectedCallback(),null===(e=this.form)||void 0===e||e.addEventListener("formdata",this.handleFormData)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.form)||void 0===e||e.removeEventListener("formdata",this.handleFormData)}handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new c("change"))}}return t([l()],o.prototype,"label",void 0),t([l({type:Boolean})],o.prototype,"required",void 0),o}(s(d(a)))){constructor(){super(...arguments),this.hideLabel=!1,this.expand=!1}render(){const e=this.options,t=this.getButtonText(e);return o`<slot @slotchange="${this.handleSlotChange}"></slot>${this.renderLabel()}<div class="n-select-container"><select ${i(this.focusableRef)} id="select" ?disabled="${this.disabled}" ?required="${this.required}" name="${r(this.name)}" @change="${this.handleChange}">${this.placeholder&&o`<option value="" disabled="disabled" ?selected="${!this.value}">${this.placeholder}</option>`} ${e.map((e=>this.renderOption(e)))}</select><nord-button tabindex="-1" ?disabled="${this.disabled}" ?expand="${this.expand}" aria-hidden="true" type="button"><slot slot="before" name="before"></slot>${t} <svg slot="after" height="12" width="10" viewBox="0 0 10 12" xmlns="http://www.w3.org/2000/svg"><path d="m4.43391.234315c.31242-.3124199.81895-.3124199 1.13137 0l3.53554 3.535535c.31242.31242.31242.81895 0 1.13137s-.81896.31242-1.13137 0l-2.96985-2.96985-2.96985 2.96985c-.31242.31242-.81895.31242-1.131373 0-.312419-.31242-.312419-.81895 0-1.13137z"/><path d="m.898377 7.09857c.312423-.31242.818953-.31242 1.131373 0l2.96985 2.96983 2.96985-2.96983c.31241-.31242.81895-.31242 1.13137 0s.31242.81895 0 1.13137l-3.53554 3.53556c-.31242.3124-.81895.3124-1.13137 0l-3.535533-3.53556c-.312419-.31242-.312419-.81895 0-1.13137z"/></svg></nord-button></div>`}handleSlotChange(){this.requestUpdate()}get options(){return Array.from(this.querySelectorAll("option"))}getButtonText(e){const t=e.find((e=>e.value===this.value));return t?t.text:this.placeholder?this.placeholder:e[0]?e[0].text:""}renderLabel(){const e=o`<label for="select"><slot name="label">${this.label}</slot></label>`;return this.hideLabel?o`<nord-visually-hidden>${e}</nord-visually-hidden>`:e}renderOption(e){return o`<option value="${r(e.value)}" ?disabled="${e.disabled}" ?selected="${e.value===this.value}">${e.text}</option>`}};p.styles=[h],t([l({type:Boolean,attribute:"hide-label"})],p.prototype,"hideLabel",void 0),t([l()],p.prototype,"placeholder",void 0),t([l({reflect:!0,type:Boolean})],p.prototype,"expand",void 0),p=t([n("nord-select")],p);var u=p;export{u as default}; | ||
//# sourceMappingURL=Select.js.map |
@@ -19,3 +19,3 @@ import { LitElement } from "lit"; | ||
/** | ||
* The type of button. | ||
* The type of the button. | ||
*/ | ||
@@ -22,0 +22,0 @@ type: "button" | "submit" | "reset"; |
@@ -14,2 +14,5 @@ import { LitElement } from "lit"; | ||
static styles: import("lit").CSSResult[]; | ||
/** | ||
* Visually hide the label, but still show it to assistive technologies like screen readers. | ||
*/ | ||
hideLabel: boolean; | ||
@@ -16,0 +19,0 @@ /** |
{ | ||
"name": "@nordhealth/components", | ||
"version": "1.0.0-alpha.22", | ||
"version": "1.0.0-alpha.23", | ||
"description": "This package includes Nord Design System web components", | ||
@@ -34,5 +34,5 @@ "author": "Nordhealth <info@nordhealth.com>", | ||
"@custom-elements-manifest/analyzer": "^0.5.5", | ||
"@nordhealth/fonts": "^1.1.5-alpha.2", | ||
"@nordhealth/themes": "^1.4.3-alpha.2", | ||
"@nordhealth/tokens": "^1.0.0-alpha.17", | ||
"@nordhealth/fonts": "^2.0.0", | ||
"@nordhealth/themes": "^2.0.0", | ||
"@nordhealth/tokens": "^1.0.0", | ||
"@open-wc/eslint-config": "^4.3.0", | ||
@@ -115,3 +115,3 @@ "@open-wc/testing": "^2.5.33", | ||
}, | ||
"gitHead": "65f8171e6c535a4a882a9fae882eaf1f820333e4" | ||
"gitHead": "a100dd07fa7d3d4e8702226af4f593c0d52e7c35" | ||
} |
Sorry, the diff of this file is not supported yet
170616
1721