@nysds/components 1.1.4 → 1.1.5
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/nysds.es.js +15 -15
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +16 -16
- package/dist/nysds.js.map +1 -1
- package/package.json +2 -18
package/dist/nysds.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(_,c1){typeof exports=="object"&&typeof module<"u"?c1(exports):typeof define=="function"&&define.amd?define(["exports"],c1):(_=typeof globalThis<"u"?globalThis:_||self,c1(_.NYSDS={}))})(this,function(_){"use strict";/*!
|
|
2
|
-
* New York State Design System (v1.1.
|
|
2
|
+
* New York State Design System (v1.1.5)
|
|
3
3
|
* Description: A design system for New York State's digital products.
|
|
4
4
|
* Repository: https://github.com/its-hcd/nysds
|
|
5
5
|
* License: MIT
|
|
@@ -89,10 +89,6 @@
|
|
|
89
89
|
--_nys-alert-gap-space-50: var(--nys-space-50, 4px);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
.nys-alert__icon {
|
|
93
|
-
margin-top: 1.5px; /* this margin is to just better align the icon with the texts */
|
|
94
|
-
}
|
|
95
|
-
|
|
96
92
|
/* Main alert container */
|
|
97
93
|
.nys-alert__container {
|
|
98
94
|
display: flex;
|
|
@@ -157,6 +153,7 @@
|
|
|
157
153
|
|
|
158
154
|
.close-container {
|
|
159
155
|
margin-left: auto;
|
|
156
|
+
margin-top: -5px;
|
|
160
157
|
}
|
|
161
158
|
|
|
162
159
|
/* Centered variant: For no descriptions, we remove the <slot name="text"> via JS logic. In styling, centers the icon for a compact layout. */
|
|
@@ -1291,7 +1288,7 @@
|
|
|
1291
1288
|
<div part="nys-alert__icon" class="nys-alert__icon">
|
|
1292
1289
|
<nys-icon
|
|
1293
1290
|
name="${this._getIconName()}"
|
|
1294
|
-
size="
|
|
1291
|
+
size="3xl"
|
|
1295
1292
|
label="${this.type} icon"
|
|
1296
1293
|
></nys-icon>
|
|
1297
1294
|
</div>
|
|
@@ -1424,14 +1421,14 @@
|
|
|
1424
1421
|
<nys-icon
|
|
1425
1422
|
label="nys-avatar__icon"
|
|
1426
1423
|
name=${this.icon}
|
|
1427
|
-
size="
|
|
1424
|
+
size="xl"
|
|
1428
1425
|
></nys-icon>
|
|
1429
1426
|
</div>`:h`<div part="nys-avatar__icon">
|
|
1430
1427
|
<slot>
|
|
1431
1428
|
<nys-icon
|
|
1432
1429
|
label="nys-avatar__icon"
|
|
1433
1430
|
name="account_circle"
|
|
1434
|
-
size="
|
|
1431
|
+
size="xl"
|
|
1435
1432
|
></nys-icon>
|
|
1436
1433
|
</slot>
|
|
1437
1434
|
</div>`}
|
|
@@ -2025,7 +2022,9 @@
|
|
|
2025
2022
|
/* wraps the native checkbox and it's icon */
|
|
2026
2023
|
.nys-checkbox__checkboxwrapper {
|
|
2027
2024
|
position: relative;
|
|
2028
|
-
display:
|
|
2025
|
+
display: flex;
|
|
2026
|
+
justify-content: center;
|
|
2027
|
+
align-items: center;
|
|
2029
2028
|
max-height: var(--_nys-checkbox-size);
|
|
2030
2029
|
}
|
|
2031
2030
|
|
|
@@ -2033,7 +2032,7 @@
|
|
|
2033
2032
|
position: absolute;
|
|
2034
2033
|
top: 50%;
|
|
2035
2034
|
left: 50%;
|
|
2036
|
-
transform:
|
|
2035
|
+
transform: translate(-50%, -50%); /* Centering the icon visually */
|
|
2037
2036
|
pointer-events: none;
|
|
2038
2037
|
color: white;
|
|
2039
2038
|
}
|
|
@@ -2300,7 +2299,7 @@
|
|
|
2300
2299
|
var(--_nys-errormessage-color);
|
|
2301
2300
|
}
|
|
2302
2301
|
`;var is=Object.defineProperty,_t=(o,t,e,s)=>{for(var r=void 0,i=o.length-1,n;i>=0;i--)(n=o[i])&&(r=n(t,e,r)||r);return r&&is(t,e,r),r};const bt=class extends p{constructor(){super(),this.showError=!1,this.errorMessage="",this.showDivider=!1,this._internals=this.attachInternals()}render(){return h`${this.showError?h`<div class="nys-errormessage" ?showDivider=${this.showDivider}>
|
|
2303
|
-
<nys-icon name="error" size="
|
|
2302
|
+
<nys-icon name="error" size="2xl"></nys-icon>
|
|
2304
2303
|
${this._internals.validationMessage||this.errorMessage}
|
|
2305
2304
|
</div>`:""}`}};bt.styles=ns,bt.formAssociated=!0;let T2=bt;_t([vt({type:Boolean})],T2.prototype,"showError"),_t([vt({type:String})],T2.prototype,"errorMessage"),_t([vt({type:Boolean,reflect:!0})],T2.prototype,"showDivider"),customElements.get("nys-errormessage")||customElements.define("nys-errormessage",T2);var as=Object.defineProperty,ls=Object.getOwnPropertyDescriptor,e1=(o,t,e,s)=>{for(var r=s>1?void 0:s?ls(t,e):t,i=o.length-1,n;i>=0;i--)(n=o[i])&&(r=(s?n(t,e,r):n(r))||r);return s&&r&&as(t,e,r),r};let cs=0;const K=(o1=class extends p{constructor(){super(),this.id="",this.name="",this.required=!1,this.optional=!1,this.showError=!1,this.errorMessage="",this.label="",this.description="",this._size="md",this._internals=this.attachInternals()}get size(){return this._size}set size(t){this._size=o1.VALID_SIZES.includes(t)?t:"md"}connectedCallback(){super.connectedCallback(),this.id||(this.id=`nys-checkbox-${Date.now()}-${cs++}`),this.addEventListener("change",this._handleCheckboxChange),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",this._handleCheckboxChange),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._setGroupExist()}updated(t){t.has("required")&&this.required&&this._setupCheckboxRequired(),t.has("size")&&this.updateCheckboxSize()}_setGroupExist(){this.querySelectorAll("nys-checkbox").forEach(e=>{e.groupExist=!0})}async _handleInvalid(t){t.preventDefault(),this.showError=!0,this._manageCheckboxRequired();const e=this.querySelector("nys-checkbox"),s=e?await e.getInputElement():null;if(s){const r=this._internals.form;r?Array.from(r.elements).find(l=>{if(l.tagName.toLowerCase()==="nys-checkboxgroup"){if(Array.from(this.querySelectorAll("nys-checkbox")).filter(y=>y.checked).length===0)return l}else return typeof l.checkValidity=="function"&&!l.checkValidity()})===this&&s.focus():s.focus()}}async _setupCheckboxRequired(){const t=this.querySelector("nys-checkbox"),e=this.errorMessage||"This field is required",s=t?await t.getInputElement():null;this._internals.setValidity({valueMissing:!0},e,s||this)}_handleCheckboxChange(t){const e=t,{name:s}=e.detail,i=Array.from(this.querySelectorAll("nys-checkbox")).filter(n=>n.checked).map(n=>n.value);this.name=s,this._internals.setFormValue(i.join(", ")),this._manageCheckboxRequired()}async _manageCheckboxRequired(){if(this.required){const t=this.errorMessage||"Please select at least one option.",e=this.querySelector("nys-checkbox"),s=e?await e.getInputElement():null;let r=!1;this.querySelectorAll("nys-checkbox").forEach(n=>{n.checked&&(r=!0)}),r?(this._internals.setValidity({}),this.showError=!1):(this._internals.setValidity({valueMissing:!0},t,s||this),this.showError=!0)}}updateCheckboxSize(){this.querySelectorAll("nys-checkbox").forEach(e=>{e.setAttribute("size",this.size)})}render(){return h` <div
|
|
2306
2305
|
class="nys-checkboxgroup"
|
|
@@ -2346,7 +2345,7 @@
|
|
|
2346
2345
|
${this.checked?h`<nys-icon
|
|
2347
2346
|
for="${this.id}"
|
|
2348
2347
|
name="check"
|
|
2349
|
-
size="${this.size==="md"?"
|
|
2348
|
+
size="${this.size==="md"?"4xl":this.size==="sm"?"2xl":"xl"}"
|
|
2350
2349
|
class="nys-checkbox__icon"
|
|
2351
2350
|
></nys-icon>`:""}
|
|
2352
2351
|
</div>
|
|
@@ -2418,7 +2417,7 @@
|
|
|
2418
2417
|
var(--_nys-errormessage-color);
|
|
2419
2418
|
}
|
|
2420
2419
|
`;var us=Object.defineProperty,mt=(o,t,e,s)=>{for(var r=void 0,i=o.length-1,n;i>=0;i--)(n=o[i])&&(r=n(t,e,r)||r);return r&&us(t,e,r),r};const K2=class K2 extends p{constructor(){super(),this.showError=!1,this.errorMessage="",this.showDivider=!1,this._internals=this.attachInternals()}render(){return h`${this.showError?h`<div class="nys-errormessage" ?showDivider=${this.showDivider}>
|
|
2421
|
-
<nys-icon name="error" size="
|
|
2420
|
+
<nys-icon name="error" size="2xl"></nys-icon>
|
|
2422
2421
|
${this._internals.validationMessage||this.errorMessage}
|
|
2423
2422
|
</div>`:""}`}};K2.styles=ys,K2.formAssociated=!0;let A1=K2;mt([a({type:Boolean})],A1.prototype,"showError"),mt([a({type:String})],A1.prototype,"errorMessage"),mt([a({type:Boolean,reflect:!0})],A1.prototype,"showDivider"),customElements.get("nys-errormessage")||customElements.define("nys-errormessage",A1);const ps={account_circle:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
2424
2423
|
<mask id="mask0_12372_781" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
@@ -3485,7 +3484,7 @@
|
|
|
3485
3484
|
></slot>
|
|
3486
3485
|
<nys-icon
|
|
3487
3486
|
name="chevron_down"
|
|
3488
|
-
size="
|
|
3487
|
+
size="xl"
|
|
3489
3488
|
class="nys-select__icon"
|
|
3490
3489
|
></nys-icon>
|
|
3491
3490
|
</div>
|
|
@@ -4133,7 +4132,7 @@
|
|
|
4133
4132
|
--_nys-toggle-width: var(--nys-toggle-font-size-6xl, 36px);
|
|
4134
4133
|
--_nys-toggle-height: var(--nys-toggle-size-250, 20px);
|
|
4135
4134
|
--_nys-toggle-slider-diameter: var(--nys-toggle--font-size-md, 16px);
|
|
4136
|
-
--_nys-icon-font-size: var(--nys-toggle-font-size-sm, 14px);
|
|
4135
|
+
--_nys-toggle-icon-font-size: var(--nys-toggle-font-size-sm, 14px);
|
|
4137
4136
|
--_nys-toggle-gap: var(--nys-space-100, 8px);
|
|
4138
4137
|
}
|
|
4139
4138
|
|
|
@@ -4141,7 +4140,7 @@
|
|
|
4141
4140
|
--_nys-toggle-width: var(--nys-toggle-font-size-8xl, 44px);
|
|
4142
4141
|
--_nys-toggle-height: var(--nys-toggle-size-300, 24px);
|
|
4143
4142
|
--_nys-toggle-slider-diameter: var(--nys-toggle-font-size-xl, 20px);
|
|
4144
|
-
--_nys-icon-font-size: var(--nys-toggle-font-size-md, 16px);
|
|
4143
|
+
--_nys-toggle-icon-font-size: var(--nys-toggle-font-size-md, 16px);
|
|
4145
4144
|
}
|
|
4146
4145
|
|
|
4147
4146
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -4174,6 +4173,7 @@
|
|
|
4174
4173
|
${this.noIcon?"":h`<nys-icon
|
|
4175
4174
|
class="toggle-icon"
|
|
4176
4175
|
name="${this.checked?"check":"close"}"
|
|
4176
|
+
size="2xl"
|
|
4177
4177
|
></nys-icon>`}
|
|
4178
4178
|
</div>
|
|
4179
4179
|
</span>
|