@govtechsg/sgds-web-component 3.21.0 → 3.21.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.
Files changed (54) hide show
  1. package/Masthead/index.js +1 -1
  2. package/components/Badge/badge.js +1 -1
  3. package/components/Badge/index.umd.min.js +4 -4
  4. package/components/Badge/index.umd.min.js.map +1 -1
  5. package/components/Badge/sgds-badge.js +6 -9
  6. package/components/Badge/sgds-badge.js.map +1 -1
  7. package/components/ComboBox/combo-box.js +1 -1
  8. package/components/ComboBox/index.umd.min.js +6 -5
  9. package/components/ComboBox/index.umd.min.js.map +1 -1
  10. package/components/ComboBox/sgds-combo-box.js +1 -0
  11. package/components/ComboBox/sgds-combo-box.js.map +1 -1
  12. package/components/Datepicker/index.umd.min.js +12 -13
  13. package/components/Datepicker/index.umd.min.js.map +1 -1
  14. package/components/Input/index.umd.min.js +2 -3
  15. package/components/Input/index.umd.min.js.map +1 -1
  16. package/components/Input/sgds-input.js +8 -4
  17. package/components/Input/sgds-input.js.map +1 -1
  18. package/components/Masthead/index.umd.min.js +1 -1
  19. package/components/Masthead/index.umd.min.js.map +1 -1
  20. package/components/Masthead/masthead.js +1 -1
  21. package/components/QuantityToggle/index.umd.min.js +3 -4
  22. package/components/QuantityToggle/index.umd.min.js.map +1 -1
  23. package/components/QuantityToggle/sgds-quantity-toggle.js +1 -1
  24. package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
  25. package/components/index.umd.min.js +10 -10
  26. package/components/index.umd.min.js.map +1 -1
  27. package/custom-elements.json +1 -1
  28. package/index.umd.min.js +10 -10
  29. package/index.umd.min.js.map +1 -1
  30. package/package.json +1 -1
  31. package/react/components/Badge/badge.cjs.js +1 -1
  32. package/react/components/Badge/badge.js +1 -1
  33. package/react/components/Badge/sgds-badge.cjs.js +6 -9
  34. package/react/components/Badge/sgds-badge.cjs.js.map +1 -1
  35. package/react/components/Badge/sgds-badge.js +6 -9
  36. package/react/components/Badge/sgds-badge.js.map +1 -1
  37. package/react/components/ComboBox/combo-box.cjs.js +1 -1
  38. package/react/components/ComboBox/combo-box.js +1 -1
  39. package/react/components/ComboBox/sgds-combo-box.cjs.js +1 -0
  40. package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
  41. package/react/components/ComboBox/sgds-combo-box.js +1 -0
  42. package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
  43. package/react/components/Input/sgds-input.cjs.js +8 -4
  44. package/react/components/Input/sgds-input.cjs.js.map +1 -1
  45. package/react/components/Input/sgds-input.js +8 -4
  46. package/react/components/Input/sgds-input.js.map +1 -1
  47. package/react/components/Masthead/masthead.cjs.js +1 -1
  48. package/react/components/Masthead/masthead.js +1 -1
  49. package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js +1 -1
  50. package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
  51. package/react/components/QuantityToggle/sgds-quantity-toggle.js +1 -1
  52. package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
  53. package/themes/day.css +1 -0
  54. package/themes/night.css +1 -0
@@ -2300,7 +2300,7 @@ class extends Le{constructor(e){if(super(e),e.type!==Se&&e.type!==Be&&e.type!==k
2300
2300
  clip-rule="evenodd"
2301
2301
  />
2302
2302
  </svg>
2303
- `};var Ct,Mt,yt=r`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;class bt extends Ge{constructor(){super(...arguments),this.size="lg"}_getIconByName(e){if(!e)return;const t=xt[e];if(t)return t;console.warn(`Icon not found: ${e}`)}updated(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("svg");t&&(this.ariaLabel?(t.removeAttribute("aria-hidden"),t.setAttribute("aria-label",this.ariaLabel)):(t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")))}render(){const e=this._getIconByName(this.name);return e||le}}bt.styles=[...Ge.styles,yt],e([Ve({type:String,reflect:!0})],bt.prototype,"name",void 0),e([Ve({type:String,reflect:!0})],bt.prototype,"size",void 0),e([Ve({type:String})],bt.prototype,"ariaLabel",void 0);class _t extends(Qe(Ye)){constructor(){super(...arguments),this.type="text",this.placeholder="placeholder",this.autofocus=!1,this.readonly=!1,this.defaultValue="",this.valid=!1,this.loading=!1,this.required=!1,this.noValidate=!1,this.value="",this._isTouched=!1,this._showPassword=!1}focus(e){this.input.focus(e)}blur(){this.input.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setValidity(e,t,l){return this._mixinSetValidity(e,t,l)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const e=this.emit("sgds-blur",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleClick(){this.focus()}_handleChange(e){this.value=this.input.value;this.emit("sgds-change",{cancelable:!0}).defaultPrevented||super._mixinHandleChange(e)}_handleInputChange(e){this.value=this.input.value;this.emit("sgds-input",{cancelable:!0}).defaultPrevented||super._mixinHandleInputChange(e)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_renderInput(){const e="both"===this.hasFeedback||"style"===this.hasFeedback;return Oe`
2303
+ `};var Ct,Mt,yt=r`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;class bt extends Ge{constructor(){super(...arguments),this.size="lg"}_getIconByName(e){if(!e)return;const t=xt[e];if(t)return t;console.warn(`Icon not found: ${e}`)}updated(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("svg");t&&(this.ariaLabel?(t.removeAttribute("aria-hidden"),t.setAttribute("aria-label",this.ariaLabel)):(t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")))}render(){const e=this._getIconByName(this.name);return e||le}}bt.styles=[...Ge.styles,yt],e([Ve({type:String,reflect:!0})],bt.prototype,"name",void 0),e([Ve({type:String,reflect:!0})],bt.prototype,"size",void 0),e([Ve({type:String})],bt.prototype,"ariaLabel",void 0);class _t extends(Qe(Ye)){constructor(){super(...arguments),this.type="text",this.placeholder="placeholder",this.autofocus=!1,this.readonly=!1,this.defaultValue="",this.valid=!1,this.loading=!1,this.required=!1,this.noValidate=!1,this.value="",this._isTouched=!1,this._showPassword=!1}focus(e){this.input.focus(e)}blur(){this.input.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setValidity(e,t,l){return this._mixinSetValidity(e,t,l)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const e=this.emit("sgds-blur",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleClick(){this.focus()}_handleChange(e){this.value=this.input.value;this.emit("sgds-change",{cancelable:!0}).defaultPrevented||super._mixinHandleChange(e)}_handleInputChange(e){this.value=this.input.value;this.emit("sgds-input",{cancelable:!0}).defaultPrevented||super._mixinHandleInputChange(e)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_renderInput(){const e="both"===this.hasFeedback||"style"===this.hasFeedback,t="both"===this.hasFeedback||"text"===this.hasFeedback,l=[this.hintText?`${this._controlId}Help`:"",this.invalid&&t?`${this._controlId}-invalid`:""].filter(Boolean).join(" ")||void 0;return Oe`
2304
2304
  <div
2305
2305
  class="form-control-group ${Pe({disabled:this.disabled,readonly:this.readonly,"is-invalid":this.invalid&&e})}"
2306
2306
  @click=${this._handleClick}
@@ -2330,8 +2330,7 @@ class extends Le{constructor(e){if(super(e),e.type!==Se&&e.type!==Be&&e.type!==k
2330
2330
  @invalid=${()=>this.setInvalid(!0)}
2331
2331
  @focus=${this._handleFocus}
2332
2332
  @blur=${this._handleBlur}
2333
- aria-describedby=${Te(this.invalid&&this.hasFeedback?`${this._controlId}-invalid`:void 0)}
2334
- aria-labelledby="${this._labelId} ${this._controlId}Help ${this.invalid&&this.hasFeedback?`${this._controlId}-invalid`:""}"
2333
+ aria-describedby=${Te(l)}
2335
2334
  />
2336
2335
  ${"password"===this.type?this._renderPasswordToggle():le}
2337
2336
  ${this.suffix?Oe`<span class="form-control-suffix">${this.suffix}</span>`:le}