@govtechsg/sgds-web-component 3.30.1-rc.6 → 3.30.1-rc.7

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 (41) hide show
  1. package/components/Checkbox/index.umd.min.js +2 -2
  2. package/components/Checkbox/index.umd.min.js.map +1 -1
  3. package/components/Checkbox/sgds-checkbox.d.ts +7 -1
  4. package/components/Checkbox/sgds-checkbox.js +14 -0
  5. package/components/Checkbox/sgds-checkbox.js.map +1 -1
  6. package/components/ComboBox/index.umd.min.js +266 -266
  7. package/components/ComboBox/index.umd.min.js.map +1 -1
  8. package/components/DataTable/index.umd.min.js +301 -301
  9. package/components/DataTable/index.umd.min.js.map +1 -1
  10. package/components/Datepicker/index.umd.min.js +1 -1
  11. package/components/Datepicker/index.umd.min.js.map +1 -1
  12. package/components/FileUpload/index.umd.min.js +1 -1
  13. package/components/FileUpload/index.umd.min.js.map +1 -1
  14. package/components/Input/index.umd.min.js +1 -1
  15. package/components/Input/index.umd.min.js.map +1 -1
  16. package/components/QuantityToggle/index.umd.min.js +1 -1
  17. package/components/QuantityToggle/index.umd.min.js.map +1 -1
  18. package/components/Radio/index.umd.min.js +1 -1
  19. package/components/Radio/index.umd.min.js.map +1 -1
  20. package/components/Select/index.umd.min.js +1 -1
  21. package/components/Select/index.umd.min.js.map +1 -1
  22. package/components/Textarea/index.umd.min.js +1 -1
  23. package/components/Textarea/index.umd.min.js.map +1 -1
  24. package/components/index.umd.min.js +2 -2
  25. package/components/index.umd.min.js.map +1 -1
  26. package/custom-elements.json +10 -3
  27. package/index.umd.min.js +722 -722
  28. package/index.umd.min.js.map +1 -1
  29. package/package.json +1 -1
  30. package/react/components/Checkbox/sgds-checkbox.cjs.js +14 -0
  31. package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
  32. package/react/components/Checkbox/sgds-checkbox.js +14 -0
  33. package/react/components/Checkbox/sgds-checkbox.js.map +1 -1
  34. package/react/utils/validatorMixin.cjs.js +2 -3
  35. package/react/utils/validatorMixin.cjs.js.map +1 -1
  36. package/react/utils/validatorMixin.js +2 -3
  37. package/react/utils/validatorMixin.js.map +1 -1
  38. package/types/react.d.ts +1 -1
  39. package/utils/validatorMixin.d.ts +1 -1
  40. package/utils/validatorMixin.js +2 -3
  41. package/utils/validatorMixin.js.map +1 -1
@@ -2741,7 +2741,7 @@ let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Ig(e,t);return
2741
2741
  * @license
2742
2742
  * Copyright 2020 Google LLC
2743
2743
  * SPDX-License-Identifier: BSD-3-Clause
2744
- */let w_=pt(class extends mt{constructor(e){if(super(e),e.type!==ft.PROPERTY&&e.type!==ft.ATTRIBUTE&&e.type!==ft.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Og(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===Ie||t===y)return t;let n=e.element,r=e.name;if(e.type===ft.PROPERTY){if(t===n[r])return Ie}else if(e.type===ft.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(r))return Ie}else if(e.type===ft.ATTRIBUTE&&n.getAttribute(r)===t+``)return Ie;return Ng(e),t}});b();var T_=u`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`;b();var E_=u`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`;b();var D_=u`.form-label{color:var(--sgds-form-color-default);font-weight:var(--sgds-font-weight-semibold);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-40)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`;b();var O_=u`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-label);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`,V=class extends E{constructor(...e){super(...e),this.label=``,this.hintText=``,this.disabled=!1,this.invalid=!1,this._controlId=mm(`input`),this._labelId=mm(`label`)}static{this.styles=[...E.styles,T_,E_,D_,O_]}setInvalid(e){this.invalid=e,e?this.emit(`sgds-invalid`):this.emit(`sgds-valid`)}};T([x({reflect:!0})],V.prototype,`label`,void 0),T([x({reflect:!0})],V.prototype,`hintText`,void 0),T([x({reflect:!0})],V.prototype,`name`,void 0),T([x({type:Boolean,reflect:!0})],V.prototype,`disabled`,void 0),T([x({type:Boolean,reflect:!0})],V.prototype,`invalid`,void 0),b();let k_=(e=`value`)=>(t,n)=>{let r=t.constructor,i=r.prototype.attributeChangedCallback;r.prototype.attributeChangedCallback=function(t,a,o){let s=r.getPropertyOptions(e);if(t===(typeof s.attribute==`string`?s.attribute:e).toLowerCase()){let t=s.converter||_,r=(typeof t==`function`?t:t?.fromAttribute??_.fromAttribute)(o,s.type);this[e]!==r&&(this[n]=r)}i.call(this,t,a,o)}};var A_=class{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options={setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input,...t}}hostConnected(){this.host.addEventListener(`invalid`,e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener(`invalid`,e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){let t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){let t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,n){return this._internals.setValidity(e,t,n)}setFormValue(){let e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});let t=e.validity;if(t.valid)this._internals.setValidity({});else for(let n in t)t[n]&&(this.validationError=n.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}};let j_=e=>{class t extends e{static{this.formAssociated=!0}constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),this.inputValidationController??=new A_(this)}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector(`input`)||await this.sgdsInput||this.shadowRoot.querySelector(`textarea`)||await this.sgdsDatepickerInput,this._mixinSetFormValue(),!this._mixinShouldSkipSgdsValidation()&&this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),!this._mixinShouldSkipSgdsValidation()&&this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),!this._mixinShouldSkipSgdsValidation()&&this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&=!1,!this._mixinShouldSkipSgdsValidation()&&this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){let e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return this._mixinShouldSkipSgdsValidation()?!0:this.inputValidationController.checkValidity()}_mixinReportValidity(){return this._mixinShouldSkipSgdsValidation()?!0:this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,n){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,n)}_mixinShouldSkipSgdsValidation(){return this.closest(`form`)?.noValidate||this.noValidate}}return T([ot(`sgds-input`)],t.prototype,`sgdsInput`,void 0),T([ot(`sgds-datepicker-input`)],t.prototype,`sgdsDatepickerInput`,void 0),t};b();var M_=u`.form-check-input[type=checkbox]{border-radius:var(--sgds-form-border-radius-subtle)}.form-check-input[checked]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none" viewBox="0 0 17 16"><path fill="%23fff" d="M14.347 3.979a.52.52 0 0 1 0 .739L7.043 12.02a.52.52 0 0 1-.738 0L2.653 8.369a.522.522 0 1 1 .739-.738l3.282 3.283 6.934-6.935a.52.52 0 0 1 .739 0"/></svg>')}.form-check-input:indeterminate,.form-check-input[indeterminate]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none" viewBox="0 0 17 16"><path fill="%23fff" fill-rule="evenodd" d="M2.5 8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" clip-rule="evenodd"/></svg>');background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:indeterminate:focus,.form-check-input:indeterminate:hover,.form-check-input[indeterminate]:focus-visible,.form-check-input[indeterminate]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}.form-check-input:indeterminate.is-invalid,.form-check-input[checked].is-invalid,.form-check-input[indeterminate].is-invalid{background-color:var(--sgds-form-danger-surface-default)}.form-check-label{flex:1;font-size:var(--sgds-font-size-label-md)}.form-check{margin:var(--sgds-padding-2-xs) 0;padding:0}`;b();var N_=u`input{margin:0}.form-check{display:flex;gap:var(--sgds-form-gap-md);padding:var(--sgds-padding-2-xs) 0}.form-check-input{appearance:none;background-color:var(--sgds-form-surface-default);background-image:var(--sgds-radio-bg-image);background-position:50%;background-repeat:no-repeat;background-size:auto;border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);flex-shrink:0;height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.form-check-input[checked]{background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid):not([aria-checked=true]):not(:focus-visible):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid)[checked]:focus-visible,.form-check-input:not([disabled]):not(.is-invalid)[checked]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}:host([disabled]) .form-check{cursor:not-allowed;opacity:var(--sgds-opacity-40)}.form-check-input:not([disabled]).is-invalid{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-check-input:not([disabled]).is-invalid:focus-visible{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-outline-offset-focus)}`;b();var H=class extends j_(V){constructor(...e){super(...e),this.hasSlotController=new Sm(this,`[default]`),this.checked=!1,this.defaultChecked=!1,this.indeterminate=!1,this.required=!1,this.noValidate=!1,this.ariaLabel=``,this.invalidFeedback=``,this._isTouched=!1,this._handleHostClick=e=>{e.composedPath()[0]===this&&(e.stopPropagation(),this.input.click())}}static{this.styles=[...V.styles,N_,M_]}static{this.dependencies={"sgds-icon":I}}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}_handleChange(e){this.indeterminate&&=!this.indeterminate,this.checked=!this.checked,super._mixinHandleChange(e),this.emit(`sgds-change`,{detail:{checked:this.checked,value:this.value}}),this.checked?this.emit(`sgds-check`,{detail:{value:this.value}}):this.emit(`sgds-uncheck`,{detail:{value:this.value}})}_handleKeyDown(e){let t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key===`Enter`&&!t&&this.click()}_handleBlur(){this._isTouched=!0,this.emit(`sgds-blur`)}_handleFocus(){this.emit(`sgds-focus`)}_handleInvalid(e){e.preventDefault(),this.invalid=!0}_handleDisabledChange(){this.setInvalid(!1)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&(this.invalid=!this.input.checkValidity())}_mixinResetFormControl(){this._isTouched=!1,this.checked=this.input.checked=this.defaultChecked,this.input.dispatchEvent(new InputEvent(`reset`)),this._mixinResetValidity(this.input)}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}firstUpdated(e){super.firstUpdated(e),this.checked&&this.emit(`sgds-check`,{detail:{value:this.value}})}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this._handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`click`,this._handleHostClick)}render(){let e=this.hasFeedback===`both`||this.hasFeedback===`style`,t=this.hasFeedback===`both`||this.hasFeedback===`text`,n=this.hasSlotController.test(`[default]`);return v`
2744
+ */let w_=pt(class extends mt{constructor(e){if(super(e),e.type!==ft.PROPERTY&&e.type!==ft.ATTRIBUTE&&e.type!==ft.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Og(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===Ie||t===y)return t;let n=e.element,r=e.name;if(e.type===ft.PROPERTY){if(t===n[r])return Ie}else if(e.type===ft.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(r))return Ie}else if(e.type===ft.ATTRIBUTE&&n.getAttribute(r)===t+``)return Ie;return Ng(e),t}});b();var T_=u`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`;b();var E_=u`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`;b();var D_=u`.form-label{color:var(--sgds-form-color-default);font-weight:var(--sgds-font-weight-semibold);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-40)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`;b();var O_=u`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-label);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`,V=class extends E{constructor(...e){super(...e),this.label=``,this.hintText=``,this.disabled=!1,this.invalid=!1,this._controlId=mm(`input`),this._labelId=mm(`label`)}static{this.styles=[...E.styles,T_,E_,D_,O_]}setInvalid(e){this.invalid=e,e?this.emit(`sgds-invalid`):this.emit(`sgds-valid`)}};T([x({reflect:!0})],V.prototype,`label`,void 0),T([x({reflect:!0})],V.prototype,`hintText`,void 0),T([x({reflect:!0})],V.prototype,`name`,void 0),T([x({type:Boolean,reflect:!0})],V.prototype,`disabled`,void 0),T([x({type:Boolean,reflect:!0})],V.prototype,`invalid`,void 0),b();let k_=(e=`value`)=>(t,n)=>{let r=t.constructor,i=r.prototype.attributeChangedCallback;r.prototype.attributeChangedCallback=function(t,a,o){let s=r.getPropertyOptions(e);if(t===(typeof s.attribute==`string`?s.attribute:e).toLowerCase()){let t=s.converter||_,r=(typeof t==`function`?t:t?.fromAttribute??_.fromAttribute)(o,s.type);this[e]!==r&&(this[n]=r)}i.call(this,t,a,o)}};var A_=class{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options={setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input,...t}}hostConnected(){this.host.addEventListener(`invalid`,e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener(`invalid`,e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){let t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){let t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,n){return this._internals.setValidity(e,t,n)}setFormValue(){let e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});let t=e.validity;if(t.valid)this._internals.setValidity({});else for(let n in t)t[n]&&(this.validationError=n.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}};let j_=e=>{class t extends e{static{this.formAssociated=!0}constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),this.inputValidationController??=new A_(this)}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector(`input`)||await this.sgdsInput||this.shadowRoot.querySelector(`textarea`)||await this.sgdsDatepickerInput,this._mixinSetFormValue(),!this._mixinShouldSkipSgdsValidation()&&this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),!this._mixinShouldSkipSgdsValidation()&&this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),!this._mixinShouldSkipSgdsValidation()&&this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&=!1,!this._mixinShouldSkipSgdsValidation()&&this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(e){this._internals.setFormValue(e===void 0?this.value:e)}_mixinCheckValidity(){return this._mixinShouldSkipSgdsValidation()?!0:this.inputValidationController.checkValidity()}_mixinReportValidity(){return this._mixinShouldSkipSgdsValidation()?!0:this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,n){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,n)}_mixinShouldSkipSgdsValidation(){return this.closest(`form`)?.noValidate||this.noValidate}}return T([ot(`sgds-input`)],t.prototype,`sgdsInput`,void 0),T([ot(`sgds-datepicker-input`)],t.prototype,`sgdsDatepickerInput`,void 0),t};b();var M_=u`.form-check-input[type=checkbox]{border-radius:var(--sgds-form-border-radius-subtle)}.form-check-input[checked]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none" viewBox="0 0 17 16"><path fill="%23fff" d="M14.347 3.979a.52.52 0 0 1 0 .739L7.043 12.02a.52.52 0 0 1-.738 0L2.653 8.369a.522.522 0 1 1 .739-.738l3.282 3.283 6.934-6.935a.52.52 0 0 1 .739 0"/></svg>')}.form-check-input:indeterminate,.form-check-input[indeterminate]{--sgds-radio-bg-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" fill="none" viewBox="0 0 17 16"><path fill="%23fff" fill-rule="evenodd" d="M2.5 8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5" clip-rule="evenodd"/></svg>');background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:indeterminate:focus,.form-check-input:indeterminate:hover,.form-check-input[indeterminate]:focus-visible,.form-check-input[indeterminate]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}.form-check-input:indeterminate.is-invalid,.form-check-input[checked].is-invalid,.form-check-input[indeterminate].is-invalid{background-color:var(--sgds-form-danger-surface-default)}.form-check-label{flex:1;font-size:var(--sgds-font-size-label-md)}.form-check{margin:var(--sgds-padding-2-xs) 0;padding:0}`;b();var N_=u`input{margin:0}.form-check{display:flex;gap:var(--sgds-form-gap-md);padding:var(--sgds-padding-2-xs) 0}.form-check-input{appearance:none;background-color:var(--sgds-form-surface-default);background-image:var(--sgds-radio-bg-image);background-position:50%;background-repeat:no-repeat;background-size:auto;border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);flex-shrink:0;height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.form-check-input[checked]{background-color:var(--sgds-form-primary-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-transparent)}.form-check-input:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid):not([aria-checked=true]):not(:focus-visible):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-outline-offset-focus)}.form-check-input:not([disabled]):not(.is-invalid)[checked]:focus-visible,.form-check-input:not([disabled]):not(.is-invalid)[checked]:hover{background-color:var(--sgds-form-primary-surface-emphasis)}:host([disabled]) .form-check{cursor:not-allowed;opacity:var(--sgds-opacity-40)}.form-check-input:not([disabled]).is-invalid{border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-check-input:not([disabled]).is-invalid:focus-visible{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-outline-offset-focus)}`;b();var H=class extends j_(V){constructor(...e){super(...e),this.hasSlotController=new Sm(this,`[default]`),this.checked=!1,this.defaultChecked=!1,this.indeterminate=!1,this.required=!1,this.noValidate=!1,this.ariaLabel=``,this.invalidFeedback=``,this._isTouched=!1,this._handleHostClick=e=>{e.composedPath()[0]===this&&(e.stopPropagation(),this.input.click())}}static{this.styles=[...V.styles,N_,M_]}static{this.dependencies={"sgds-icon":I}}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}_handleChange(e){this.indeterminate&&=!this.indeterminate,this.checked=!this.checked,super._mixinHandleChange(e),this.emit(`sgds-change`,{detail:{checked:this.checked,value:this.value}}),this.checked?this.emit(`sgds-check`,{detail:{value:this.value}}):this.emit(`sgds-uncheck`,{detail:{value:this.value}})}_handleKeyDown(e){let t=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key===`Enter`&&!t&&this.click()}_handleBlur(){this._isTouched=!0,this.emit(`sgds-blur`)}_handleFocus(){this.emit(`sgds-focus`)}_handleInvalid(e){e.preventDefault(),this.invalid=!0}_mixinSetFormValue(){super._mixinSetFormValue(this.checked?this.value??`on`:null)}_handleCheckedChange(){this._mixinSetFormValue()}_handleValueChange(){this._mixinSetFormValue()}_handleDisabledChange(){this.setInvalid(!1)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&(this.invalid=!this.input.checkValidity())}_mixinResetFormControl(){this._isTouched=!1,this.checked=this.input.checked=this.defaultChecked,this.input.dispatchEvent(new InputEvent(`reset`)),this._mixinResetValidity(this.input)}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}firstUpdated(e){super.firstUpdated(e),this.checked&&this.emit(`sgds-check`,{detail:{value:this.value}})}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this._handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`click`,this._handleHostClick)}render(){let e=this.hasFeedback===`both`||this.hasFeedback===`style`,t=this.hasFeedback===`both`||this.hasFeedback===`text`,n=this.hasSlotController.test(`[default]`);return v`
2745
2745
  <div class="form-check">
2746
2746
  <input
2747
2747
  class=${D({"form-check-input":!0,"is-invalid":e&&this.invalid})}
@@ -2775,7 +2775,7 @@ let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Ig(e,t);return
2775
2775
  </div>
2776
2776
  </div>
2777
2777
  `:y}
2778
- `}};T([x({type:String,reflect:!0})],H.prototype,`value`,void 0),T([x({type:Boolean,reflect:!0})],H.prototype,`checked`,void 0),T([x({type:String,reflect:!0})],H.prototype,`hasFeedback`,void 0),T([k_(`checked`)],H.prototype,`defaultChecked`,void 0),T([x({type:Boolean,reflect:!0})],H.prototype,`indeterminate`,void 0),T([x({type:Boolean,reflect:!0})],H.prototype,`required`,void 0),T([x({type:Boolean,reflect:!0})],H.prototype,`noValidate`,void 0),T([x({type:String})],H.prototype,`ariaLabel`,void 0),T([x({type:String,reflect:!0})],H.prototype,`invalidFeedback`,void 0),T([S()],H.prototype,`_isTouched`,void 0),T([P(`disabled`,{waitUntilFirstUpdate:!0})],H.prototype,`_handleDisabledChange`,null),T([P(`_isTouched`,{waitUntilFirstUpdate:!0})],H.prototype,`_handleIsTouched`,null),b();var P_=u`:host{--sgds-checkbox-group-gap:var(--sgds-spacer-2)}fieldset{border:0;gap:var(--sgds-form-gap-md);margin:0;min-width:0;padding:0}.label-hint-container,fieldset{display:flex;flex-direction:column}.label-hint-container{gap:var(--sgds-form-gap-sm)}.label-hint-container .form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-semibold)}.checkbox-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md);padding:var(--sgds-padding-2-xs) 0}.checkbox-group-validation-input{display:none}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-40)}`;b();var U=class extends j_(V){constructor(...e){super(...e),this.label=``,this.invalidFeedback=`Please tick at least one box if you want to proceed`,this.hasFeedback=!1,this.hintText=``,this.required=!1,this.noValidate=!1,this.value=``,this._isTouched=!1,this.defaultValue=``,this._blurredCheckboxes=/* @__PURE__ */ new Set}static{this.styles=[...V.styles,P_]}static{this.dependencies={"sgds-icon":I}}connectedCallback(){super.connectedCallback(),this.addEventListener(`sgds-check`,e=>{let{value:t}=e.detail;!this.value.includes(t)&&this._addValue(t)}),this.addEventListener(`sgds-uncheck`,e=>{let{value:t}=e.detail;this._removeValue(t)}),this.addEventListener(`sgds-blur`,e=>{let t=e.target;this._blurredCheckboxes.add(t),Array.from(this._blurredCheckboxes).length===this._checkboxes.length&&(this._isTouched=!0,this._blurredCheckboxes.clear())})}firstUpdated(e){super.firstUpdated(e),this.value&&this._updateInputValue(),this.invalid&&this._updateInvalid()}_renderHintText(){let e=v` <div class="form-text" id="${this._controlId}Help">${this.hintText}</div> `;return this.hintText&&e}_addValue(e){let t=this.value?this.value.split(`;`):[];t.push(e),this.value=t.join(`;`),this._updateInputValue(),this.emit(`sgds-change`,{detail:{value:this.value}})}_removeValue(e){let t=(this.value?this.value.split(`;`):[]).filter(t=>t!==e);this.value=t.join(`;`),this._updateInputValue(),this.emit(`sgds-change`,{detail:{value:this.value}})}_sanitizeSlot(){this._checkboxes.forEach(e=>{e.checked=e.defaultChecked=this.value.includes(e.value),e.hasFeedback=this.hasFeedback?`style`:null,e.required&&(console.error(`Checkboxes in a group cannot have required or hasFeedback prop set to true`),e.remove())}),this._disabledChildCheckboxes()}_disabledChildCheckboxes(){this.disabled&&this._checkboxes.forEach(e=>e.disabled=this.disabled)}_handleValueChange(){this._checkboxes.forEach(e=>{e.checked=this.value.includes(e.value)}),this._updateInputValue(),this._updateInvalid()}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&(this.invalid=!this.input.checkValidity(),this._updateInvalid())}_updateInvalid(){this._checkboxes.forEach(e=>e.invalid=this.invalid)}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_mixinResetFormControl(){this.value=this.input.value=this.defaultValue,this._updateInputValue(`reset`),this._mixinResetValidity(this.input)}async _updateInputValue(e=`change`){this.input.value=this.value,this.input.dispatchEvent(new InputEvent(e))}render(){return v`
2778
+ `}};T([x({type:String,reflect:!0})],H.prototype,`value`,void 0),T([x({type:Boolean,reflect:!0})],H.prototype,`checked`,void 0),T([x({type:String,reflect:!0})],H.prototype,`hasFeedback`,void 0),T([k_(`checked`)],H.prototype,`defaultChecked`,void 0),T([x({type:Boolean,reflect:!0})],H.prototype,`indeterminate`,void 0),T([x({type:Boolean,reflect:!0})],H.prototype,`required`,void 0),T([x({type:Boolean,reflect:!0})],H.prototype,`noValidate`,void 0),T([x({type:String})],H.prototype,`ariaLabel`,void 0),T([x({type:String,reflect:!0})],H.prototype,`invalidFeedback`,void 0),T([S()],H.prototype,`_isTouched`,void 0),T([P(`checked`,{waitUntilFirstUpdate:!0})],H.prototype,`_handleCheckedChange`,null),T([P(`value`,{waitUntilFirstUpdate:!0})],H.prototype,`_handleValueChange`,null),T([P(`disabled`,{waitUntilFirstUpdate:!0})],H.prototype,`_handleDisabledChange`,null),T([P(`_isTouched`,{waitUntilFirstUpdate:!0})],H.prototype,`_handleIsTouched`,null),b();var P_=u`:host{--sgds-checkbox-group-gap:var(--sgds-spacer-2)}fieldset{border:0;gap:var(--sgds-form-gap-md);margin:0;min-width:0;padding:0}.label-hint-container,fieldset{display:flex;flex-direction:column}.label-hint-container{gap:var(--sgds-form-gap-sm)}.label-hint-container .form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-semibold)}.checkbox-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md);padding:var(--sgds-padding-2-xs) 0}.checkbox-group-validation-input{display:none}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-40)}`;b();var U=class extends j_(V){constructor(...e){super(...e),this.label=``,this.invalidFeedback=`Please tick at least one box if you want to proceed`,this.hasFeedback=!1,this.hintText=``,this.required=!1,this.noValidate=!1,this.value=``,this._isTouched=!1,this.defaultValue=``,this._blurredCheckboxes=/* @__PURE__ */ new Set}static{this.styles=[...V.styles,P_]}static{this.dependencies={"sgds-icon":I}}connectedCallback(){super.connectedCallback(),this.addEventListener(`sgds-check`,e=>{let{value:t}=e.detail;!this.value.includes(t)&&this._addValue(t)}),this.addEventListener(`sgds-uncheck`,e=>{let{value:t}=e.detail;this._removeValue(t)}),this.addEventListener(`sgds-blur`,e=>{let t=e.target;this._blurredCheckboxes.add(t),Array.from(this._blurredCheckboxes).length===this._checkboxes.length&&(this._isTouched=!0,this._blurredCheckboxes.clear())})}firstUpdated(e){super.firstUpdated(e),this.value&&this._updateInputValue(),this.invalid&&this._updateInvalid()}_renderHintText(){let e=v` <div class="form-text" id="${this._controlId}Help">${this.hintText}</div> `;return this.hintText&&e}_addValue(e){let t=this.value?this.value.split(`;`):[];t.push(e),this.value=t.join(`;`),this._updateInputValue(),this.emit(`sgds-change`,{detail:{value:this.value}})}_removeValue(e){let t=(this.value?this.value.split(`;`):[]).filter(t=>t!==e);this.value=t.join(`;`),this._updateInputValue(),this.emit(`sgds-change`,{detail:{value:this.value}})}_sanitizeSlot(){this._checkboxes.forEach(e=>{e.checked=e.defaultChecked=this.value.includes(e.value),e.hasFeedback=this.hasFeedback?`style`:null,e.required&&(console.error(`Checkboxes in a group cannot have required or hasFeedback prop set to true`),e.remove())}),this._disabledChildCheckboxes()}_disabledChildCheckboxes(){this.disabled&&this._checkboxes.forEach(e=>e.disabled=this.disabled)}_handleValueChange(){this._checkboxes.forEach(e=>{e.checked=this.value.includes(e.value)}),this._updateInputValue(),this._updateInvalid()}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&(this.invalid=!this.input.checkValidity(),this._updateInvalid())}_updateInvalid(){this._checkboxes.forEach(e=>e.invalid=this.invalid)}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_mixinResetFormControl(){this.value=this.input.value=this.defaultValue,this._updateInputValue(`reset`),this._mixinResetValidity(this.input)}async _updateInputValue(e=`change`){this.input.value=this.value,this.input.dispatchEvent(new InputEvent(e))}render(){return v`
2779
2779
  <fieldset>
2780
2780
  <div class="label-hint-container">
2781
2781
  <label class="form-label">${this.label}</label>