@crowdstrike/glide-core 0.21.0 → 0.23.0

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 (40) hide show
  1. package/dist/checkbox-group.js +7 -5
  2. package/dist/checkbox.d.ts +10 -2
  3. package/dist/checkbox.js +22 -20
  4. package/dist/checkbox.styles.js +4 -0
  5. package/dist/dropdown.d.ts +1 -1
  6. package/dist/dropdown.js +25 -22
  7. package/dist/dropdown.option.d.ts +1 -0
  8. package/dist/dropdown.option.js +1 -1
  9. package/dist/dropdown.styles.js +15 -1
  10. package/dist/input.d.ts +2 -2
  11. package/dist/input.js +10 -10
  12. package/dist/library/localize.d.ts +0 -1
  13. package/dist/radio-group.js +15 -15
  14. package/dist/radio-group.radio.d.ts +2 -1
  15. package/dist/radio-group.radio.js +1 -1
  16. package/dist/tab.styles.js +1 -0
  17. package/dist/tag.js +1 -1
  18. package/dist/tag.styles.js +24 -21
  19. package/dist/textarea.d.ts +0 -2
  20. package/dist/textarea.js +1 -2
  21. package/dist/translations/en.js +1 -1
  22. package/dist/translations/fr.js +1 -1
  23. package/dist/translations/ja.js +1 -1
  24. package/package.json +10 -11
  25. package/dist/tree.d.ts +0 -29
  26. package/dist/tree.item.d.ts +0 -55
  27. package/dist/tree.item.icon-button.d.ts +0 -22
  28. package/dist/tree.item.icon-button.js +0 -1
  29. package/dist/tree.item.icon-button.styles.d.ts +0 -2
  30. package/dist/tree.item.icon-button.styles.js +0 -9
  31. package/dist/tree.item.js +0 -1
  32. package/dist/tree.item.menu.d.ts +0 -29
  33. package/dist/tree.item.menu.js +0 -1
  34. package/dist/tree.item.menu.styles.d.ts +0 -2
  35. package/dist/tree.item.menu.styles.js +0 -17
  36. package/dist/tree.item.styles.d.ts +0 -2
  37. package/dist/tree.item.styles.js +0 -151
  38. package/dist/tree.js +0 -1
  39. package/dist/tree.styles.d.ts +0 -2
  40. package/dist/tree.styles.js +0 -7
package/dist/input.js CHANGED
@@ -1,4 +1,4 @@
1
- var __decorate=this&&this.__decorate||function(t,e,i,s){var o,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(r=(a<3?o(r):a>3?o(e,i,r):o(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,r),r};import"./icon-button.js";import"./label.js";import{html,LitElement,nothing}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property,state}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import{styleMap}from"lit/directives/style-map.js";import{unsafeHTML}from"lit/directives/unsafe-html.js";import{when}from"lit/directives/when.js";import packageJson from"../package.json"with{type:"json"};import{LocalizeController}from"./library/localize.js";import magnifyingGlassIcon from"./icons/magnifying-glass.js";import styles from"./input.styles.js";import xIcon from"./icons/x.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";import required from"./library/required.js";let GlideCoreInput=class GlideCoreInput extends LitElement{static{this.formAssociated=!0}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode,delegatesFocus:!0}}static{this.styles=styles}get form(){return this.#t.form}get validity(){return this.pattern?(this.#t.setValidity({customError:Boolean(this.validityMessage),patternMismatch:!new RegExp(this.pattern).test(this.value),valueMissing:Boolean(this.required&&!this.value)}," ",this.#e.value),this.#t.validity):!this.pattern&&this.#t.validity.patternMismatch?(this.#t.setValidity({}),this.#t.validity):!this.required||this.value||this.disabled?this.required&&this.#t.validity.valueMissing&&this.value?(this.#t.setValidity({}),this.#t.validity):(this.required||!this.#t.validity.valueMissing||this.value||this.#t.setValidity({}),this.#t.validity):(this.#t.setValidity({customError:Boolean(this.validityMessage),valueMissing:!0}," ",this.#e.value),this.#t.validity)}checkValidity(){this.isCheckingValidity=!0;const t=this.#t.checkValidity();return this.isCheckingValidity=!1,t}disconnectedCallback(){super.disconnectedCallback(),this.form?.removeEventListener("formdata",this.#i)}formAssociatedCallback(){this.form?.addEventListener("formdata",this.#i)}formResetCallback(){this.value=this.getAttribute("value")??""}render(){return html`
1
+ var __decorate=this&&this.__decorate||function(t,e,i,s){var a,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(r=(o<3?a(r):o>3?a(e,i,r):a(e,i))||r);return o>3&&r&&Object.defineProperty(e,i,r),r};import"./icon-button.js";import"./label.js";import{html,LitElement,nothing}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property,state}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import{styleMap}from"lit/directives/style-map.js";import{unsafeHTML}from"lit/directives/unsafe-html.js";import{when}from"lit/directives/when.js";import packageJson from"../package.json"with{type:"json"};import{LocalizeController}from"./library/localize.js";import magnifyingGlassIcon from"./icons/magnifying-glass.js";import styles from"./input.styles.js";import xIcon from"./icons/x.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";import required from"./library/required.js";let GlideCoreInput=class GlideCoreInput extends LitElement{static{this.formAssociated=!0}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode,delegatesFocus:!0}}static{this.styles=styles}get form(){return this.#t.form}get validity(){return this.pattern&&this.pattern.length>0?(this.#t.setValidity({customError:Boolean(this.validityMessage),patternMismatch:Boolean(this.value&&!new RegExp(`^(?:${this.pattern})$`,"v").test(this.value)),valueMissing:Boolean(this.required&&!this.value)}," ",this.#e.value),this.#t.validity):!this.pattern&&this.#t.validity.patternMismatch?(this.#t.setValidity({}),this.#t.validity):!this.required||this.value||this.disabled?this.required&&this.#t.validity.valueMissing&&this.value?(this.#t.setValidity({}),this.#t.validity):(this.required||!this.#t.validity.valueMissing||this.value||this.#t.setValidity({}),this.#t.validity):(this.#t.setValidity({customError:Boolean(this.validityMessage),valueMissing:!0}," ",this.#e.value),this.#t.validity)}checkValidity(){this.isCheckingValidity=!0;const t=this.#t.checkValidity();return this.isCheckingValidity=!1,t}disconnectedCallback(){super.disconnectedCallback(),this.form?.removeEventListener("formdata",this.#i)}formAssociatedCallback(){this.form?.addEventListener("formdata",this.#i)}formResetCallback(){this.value=this.getAttribute("value")??""}render(){return html`
2
2
  <glide-core-private-label
3
3
  class=${classMap({left:"left"===this.privateSplit,middle:"middle"===this.privateSplit})}
4
4
  label=${ifDefined(this.label)}
@@ -6,18 +6,18 @@ var __decorate=this&&this.__decorate||function(t,e,i,s){var o,a=arguments.length
6
6
  split=${ifDefined(this.privateSplit??void 0)}
7
7
  tooltip=${ifDefined(this.tooltip)}
8
8
  ?disabled=${this.disabled}
9
- ?error=${this.#s||this.#o}
9
+ ?error=${this.#s||this.#a}
10
10
  ?hide=${this.hideLabel}
11
11
  ?required=${this.required}
12
12
  >
13
13
  <label for="input"> ${this.label} </label>
14
14
 
15
15
  <div
16
- class=${classMap({"input-container":!0,focused:this.hasFocus,empty:""===this.value,disabled:this.disabled,readonly:this.readonly&&!this.disabled,error:this.#s||this.#o})}
16
+ class=${classMap({"input-container":!0,focused:this.hasFocus,empty:""===this.value,disabled:this.disabled,readonly:this.readonly&&!this.disabled,error:this.#s||this.#a})}
17
17
  slot="control"
18
18
  >
19
19
  <slot name="prefix-icon">
20
- <!--
20
+ <!--
21
21
  An icon before the input field
22
22
  @type {Element}
23
23
  -->
@@ -25,7 +25,7 @@ var __decorate=this&&this.__decorate||function(t,e,i,s){var o,a=arguments.length
25
25
 
26
26
  <input
27
27
  aria-describedby="meta"
28
- aria-invalid=${this.#s||this.#o}
28
+ aria-invalid=${this.#s||this.#a}
29
29
  class="input"
30
30
  data-test="input"
31
31
  id="input"
@@ -38,7 +38,7 @@ var __decorate=this&&this.__decorate||function(t,e,i,s){var o,a=arguments.length
38
38
  ?required=${this.required}
39
39
  ?readonly=${this.readonly}
40
40
  ?disabled=${this.disabled}
41
- @focus=${this.#a}
41
+ @focus=${this.#o}
42
42
  @blur=${this.#r}
43
43
  @change=${this.#l}
44
44
  @input=${this.#n}
@@ -88,8 +88,8 @@ var __decorate=this&&this.__decorate||function(t,e,i,s){var o,a=arguments.length
88
88
  class=${classMap({description:!0,hidden:Boolean(this.#s&&this.validityMessage)})}
89
89
  name="description"
90
90
  >
91
- <!--
92
- Additional information or context
91
+ <!--
92
+ Additional information or context
93
93
  @type {Element | string}
94
94
  -->
95
95
  </slot>
@@ -99,7 +99,7 @@ var __decorate=this&&this.__decorate||function(t,e,i,s){var o,a=arguments.length
99
99
  >`))}
100
100
  ${this.maxlength?html`
101
101
  <div
102
- class=${classMap({"character-count":!0,error:this.#o})}
102
+ class=${classMap({"character-count":!0,error:this.#a})}
103
103
  data-test="character-count-container"
104
104
  >
105
105
  <!--
@@ -118,7 +118,7 @@ var __decorate=this&&this.__decorate||function(t,e,i,s){var o,a=arguments.length
118
118
  `:nothing}
119
119
  </div>
120
120
  </glide-core-private-label>
121
- `}reportValidity(){this.isReportValidityOrSubmit=!0;const t=this.#t.reportValidity();return this.requestUpdate(),t}resetValidityFeedback(){this.isReportValidityOrSubmit=!1}setCustomValidity(t){this.validityMessage=t,""===t?this.#t.setValidity({customError:!1},"",this.#e.value):this.#t.setValidity({customError:!0,patternMismatch:this.#t.validity.patternMismatch,valueMissing:this.#t.validity.valueMissing}," ",this.#e.value)}setValidity(t,e){this.validityMessage=e,this.#t.setValidity(t," ",this.#e.value)}constructor(){super(),this.type="text",this.name="",this.value="",this.hideLabel=!1,this.orientation="horizontal",this.clearable=!1,this.spellcheck=!1,this.autocapitalize="on",this.autocomplete="on",this.passwordToggle=!1,this.required=!1,this.readonly=!1,this.disabled=!1,this.version=packageJson.version,this.hasFocus=!1,this.isBlurring=!1,this.isCheckingValidity=!1,this.isReportValidityOrSubmit=!1,this.passwordVisible=!1,this.#e=createRef(),this.#c=new LocalizeController(this),this.#i=({formData:t})=>{this.name&&this.value&&!this.disabled&&t.append(this.name,this.value)},this.#t=this.attachInternals(),this.addEventListener("invalid",(t=>{if(t?.preventDefault(),this.isCheckingValidity||this.isBlurring)return;this.isReportValidityOrSubmit=!0;this.form?.querySelector(":invalid")===this&&this.focus()}))}#e;#t;#c;get#p(){return this.clearable&&!this.disabled&&!this.readonly}get#h(){return this.#p&&this.value.length>0}get#m(){return this.value.length}#i;get#o(){return Boolean(!this.disabled&&!this.readonly&&this.maxlength&&this.#m>this.maxlength)}get#s(){return!this.disabled&&!this.validity?.valid&&this.isReportValidityOrSubmit}#u(t){this.value="",this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.#e.value?.focus(),t.stopPropagation()}#r(){this.isBlurring=!0,this.reportValidity(),this.isBlurring=!1,this.hasFocus=!1}#l(){this.#e.value?.value&&(this.value=this.#e.value?.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}#a(){this.hasFocus=!0}#n(){this.#e.value&&(this.value=this.#e.value.value)}#d(t){"Enter"===t.key&&this.form?.requestSubmit()}#y(){this.passwordVisible=!this.passwordVisible}};__decorate([property({reflect:!0})],GlideCoreInput.prototype,"type",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"name",void 0),__decorate([property()],GlideCoreInput.prototype,"value",void 0),__decorate([property({reflect:!0}),required],GlideCoreInput.prototype,"label",void 0),__decorate([property({attribute:"hide-label",type:Boolean})],GlideCoreInput.prototype,"hideLabel",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"orientation",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"pattern",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"placeholder",void 0),__decorate([property({type:Boolean})],GlideCoreInput.prototype,"clearable",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreInput.prototype,"spellcheck",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"autocapitalize",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"autocomplete",void 0),__decorate([property({attribute:"password-toggle",type:Boolean})],GlideCoreInput.prototype,"passwordToggle",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreInput.prototype,"required",void 0),__decorate([property({type:Boolean})],GlideCoreInput.prototype,"readonly",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreInput.prototype,"disabled",void 0),__decorate([property()],GlideCoreInput.prototype,"privateSplit",void 0),__decorate([property({type:Number,converter:t=>t&&Number.parseInt(t,10),reflect:!0})],GlideCoreInput.prototype,"maxlength",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"version",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"tooltip",void 0),__decorate([state()],GlideCoreInput.prototype,"hasFocus",void 0),__decorate([state()],GlideCoreInput.prototype,"isBlurring",void 0),__decorate([state()],GlideCoreInput.prototype,"isCheckingValidity",void 0),__decorate([state()],GlideCoreInput.prototype,"isReportValidityOrSubmit",void 0),__decorate([state()],GlideCoreInput.prototype,"passwordVisible",void 0),__decorate([state()],GlideCoreInput.prototype,"validityMessage",void 0),GlideCoreInput=__decorate([customElement("glide-core-input"),final],GlideCoreInput);export default GlideCoreInput;const icons={eye:html`<svg
121
+ `}reportValidity(){this.isReportValidityOrSubmit=!0;const t=this.#t.reportValidity();return this.requestUpdate(),t}resetValidityFeedback(){this.isReportValidityOrSubmit=!1}setCustomValidity(t){this.validityMessage=t,""===t?this.#t.setValidity({customError:!1},"",this.#e.value):this.#t.setValidity({customError:!0,patternMismatch:this.#t.validity.patternMismatch,valueMissing:this.#t.validity.valueMissing}," ",this.#e.value)}setValidity(t,e){this.validityMessage=e,this.#t.setValidity(t," ",this.#e.value)}constructor(){super(),this.type="text",this.name="",this.value="",this.hideLabel=!1,this.orientation="horizontal",this.pattern="",this.clearable=!1,this.spellcheck=!1,this.autocapitalize="on",this.autocomplete="on",this.passwordToggle=!1,this.required=!1,this.readonly=!1,this.disabled=!1,this.version=packageJson.version,this.hasFocus=!1,this.isBlurring=!1,this.isCheckingValidity=!1,this.isReportValidityOrSubmit=!1,this.passwordVisible=!1,this.#e=createRef(),this.#c=new LocalizeController(this),this.#i=({formData:t})=>{this.name&&this.value&&!this.disabled&&t.append(this.name,this.value)},this.#t=this.attachInternals(),this.addEventListener("invalid",(t=>{if(t?.preventDefault(),this.isCheckingValidity||this.isBlurring)return;this.isReportValidityOrSubmit=!0;this.form?.querySelector(":invalid")===this&&this.focus()}))}#e;#t;#c;get#p(){return this.clearable&&!this.disabled&&!this.readonly}get#h(){return this.#p&&this.value.length>0}get#m(){return this.value.length}#i;get#a(){return Boolean(!this.disabled&&!this.readonly&&this.maxlength&&this.#m>this.maxlength)}get#s(){return!this.disabled&&!this.validity?.valid&&this.isReportValidityOrSubmit}#u(t){this.value="",this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.#e.value?.focus(),t.stopPropagation()}#r(){this.isBlurring=!0,this.reportValidity(),this.isBlurring=!1,this.hasFocus=!1}#l(){this.#e.value?.value&&(this.value=this.#e.value?.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}#o(){this.hasFocus=!0}#n(){this.#e.value&&(this.value=this.#e.value.value)}#d(t){"Enter"===t.key&&this.form?.requestSubmit()}#y(){this.passwordVisible=!this.passwordVisible}};__decorate([property({reflect:!0})],GlideCoreInput.prototype,"type",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"name",void 0),__decorate([property()],GlideCoreInput.prototype,"value",void 0),__decorate([property({reflect:!0}),required],GlideCoreInput.prototype,"label",void 0),__decorate([property({attribute:"hide-label",type:Boolean})],GlideCoreInput.prototype,"hideLabel",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"orientation",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"pattern",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"placeholder",void 0),__decorate([property({type:Boolean})],GlideCoreInput.prototype,"clearable",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreInput.prototype,"spellcheck",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"autocapitalize",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"autocomplete",void 0),__decorate([property({attribute:"password-toggle",type:Boolean})],GlideCoreInput.prototype,"passwordToggle",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreInput.prototype,"required",void 0),__decorate([property({type:Boolean})],GlideCoreInput.prototype,"readonly",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreInput.prototype,"disabled",void 0),__decorate([property()],GlideCoreInput.prototype,"privateSplit",void 0),__decorate([property({type:Number,converter:t=>t&&Number.parseInt(t,10),reflect:!0})],GlideCoreInput.prototype,"maxlength",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"version",void 0),__decorate([property({reflect:!0})],GlideCoreInput.prototype,"tooltip",void 0),__decorate([state()],GlideCoreInput.prototype,"hasFocus",void 0),__decorate([state()],GlideCoreInput.prototype,"isBlurring",void 0),__decorate([state()],GlideCoreInput.prototype,"isCheckingValidity",void 0),__decorate([state()],GlideCoreInput.prototype,"isReportValidityOrSubmit",void 0),__decorate([state()],GlideCoreInput.prototype,"passwordVisible",void 0),__decorate([state()],GlideCoreInput.prototype,"validityMessage",void 0),GlideCoreInput=__decorate([customElement("glide-core-input"),final],GlideCoreInput);export default GlideCoreInput;const icons={eye:html`<svg
122
122
  aria-hidden="true"
123
123
  style=${styleMap({height:"1rem",width:"1rem"})}
124
124
  fill="none"
@@ -26,7 +26,6 @@ export interface Translation extends DefaultTranslation {
26
26
  editOption: (name: string) => string;
27
27
  editTag: (name: string) => string;
28
28
  removeTag: (name: string) => string;
29
- actionsFor: (label: string) => string;
30
29
  itemCount: (count: string) => string;
31
30
  closeInlineAlert: (variant: string) => string;
32
31
  }
@@ -1,9 +1,9 @@
1
- var __decorate=this&&this.__decorate||function(e,t,i,a){var o,s=arguments.length,r=s<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,a);else for(var d=e.length-1;d>=0;d--)(o=e[d])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};import"./label.js";import"./tooltip.js";import{html,LitElement}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property,state}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import{unsafeHTML}from"lit/directives/unsafe-html.js";import{when}from"lit/directives/when.js";import packageJson from"../package.json"with{type:"json"};import GlideCoreRadioGroupRadio from"./radio-group.radio.js";import styles from"./radio-group.styles.js";import assertSlot from"./library/assert-slot.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";import required from"./library/required.js";let GlideCoreRadioGroup=class GlideCoreRadioGroup extends LitElement{static{this.formAssociated=!0}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode}}static{this.styles=styles}get disabled(){return this.#e}set disabled(e){this.#e=e;for(const t of this.#t)t.disabled=e,t.tabIndex=e?-1:0}get required(){return this.#i}set required(e){this.#i=e;for(const t of this.#t)t.privateRequired=e}get value(){return this.#a}set value(e){this.#a=e;for(const t of this.#t){const i=Boolean(""!==e&&t.value===e);t.checked=!!i,t.tabIndex=i?0:-1,t.checked&&t.disabled&&(t.disabled=!1)}}checkValidity(){this.isCheckingValidity=!0;const e=this.#o.checkValidity();return this.isCheckingValidity=!1,e}disconnectedCallback(){super.disconnectedCallback(),this.form?.removeEventListener("formdata",this.#s)}firstUpdated(){for(const e of this.#t)e.privateRequired=this.required,e.tabIndex=-1,this.disabled&&(e.disabled=this.disabled);const e=this.#t.findLast((({checked:e,disabled:t})=>e&&!t));if(e)return this.#a=e.value,this.disabled||(e.tabIndex=0),void(""!==e.value&&this.setAttribute("value",e.value));if(!e&&""!==this.value){const e=this.#t.findLast((({value:e})=>e===this.value));return!this.disabled&&e?.disabled&&(e.disabled=!1),void(e&&(e.checked=!0,e.tabIndex=0))}const t=this.#t.find((({disabled:e})=>!e));t&&(t.tabIndex=0)}focus(e){const t=this.#t.find((({checked:e,disabled:t})=>e&&!t))??this.#t.find((({tabIndex:e})=>0===e));t?.focus(e)}get form(){return this.#o.form}get validity(){const e=this.#t.some((({checked:e})=>e));return!this.required||e||this.disabled?this.required&&this.#o.validity.valueMissing&&e?(this.#o.setValidity({}),this.#o.validity):this.required&&this.disabled&&!e?(this.#o.setValidity({valueMissing:!0}," ",this.#r.value),this.#o.validity):(this.required||!this.#o.validity.valueMissing||e||this.#o.setValidity({}),this.#o.validity):(this.#o.setValidity({customError:Boolean(this.validityMessage),valueMissing:!0}," ",this.#r.value),this.#o.validity)}formAssociatedCallback(){this.form?.addEventListener("formdata",this.#s)}formResetCallback(){this.value=this.getAttribute("value")??""}render(){return html`
1
+ var __decorate=this&&this.__decorate||function(e,t,i,a){var s,o=arguments.length,r=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,a);else for(var d=e.length-1;d>=0;d--)(s=e[d])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};import"./label.js";import"./tooltip.js";import{html,LitElement}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property,state}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import{unsafeHTML}from"lit/directives/unsafe-html.js";import{when}from"lit/directives/when.js";import packageJson from"../package.json"with{type:"json"};import GlideCoreRadioGroupRadio from"./radio-group.radio.js";import styles from"./radio-group.styles.js";import assertSlot from"./library/assert-slot.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";import required from"./library/required.js";let GlideCoreRadioGroup=class GlideCoreRadioGroup extends LitElement{static{this.formAssociated=!0}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode}}static{this.styles=styles}get disabled(){return this.#e}set disabled(e){this.#e=e;const t=this.#t.findLast((e=>e.checked));for(const i of this.#t){this.#i=!0,i.disabled=e,this.#i=!1;const a=this.#t.find((e=>!e.disabled));e?i.tabIndex=-1:i===t?i.tabIndex=0:t||i!==a||(i.tabIndex=0)}e?this.#a="":t&&(this.#a=t.value)}get required(){return this.#s}set required(e){this.#s=e;for(const t of this.#t)t.privateRequired=e}get value(){return this.#a}set value(e){if(this.#a=e,!this.#o)for(const t of this.#t){const i=Boolean(""!==e&&t.value===e);t.checked=!!i,t.tabIndex=i?0:-1,t.checked&&t.disabled&&(t.disabled=!1)}}checkValidity(){this.isCheckingValidity=!0;const e=this.#r.checkValidity();return this.isCheckingValidity=!1,e}disconnectedCallback(){super.disconnectedCallback(),this.form?.removeEventListener("formdata",this.#d)}firstUpdated(){for(const e of this.#t)e.privateRequired=this.required,e.tabIndex=-1,this.disabled&&(e.disabled=this.disabled);const e=this.#t.findLast((({checked:e,disabled:t})=>e&&!t));if(e)return this.#a=e.value,this.disabled||(e.tabIndex=0),this.#o=!0,this.setAttribute("value",e.value),void(this.#o=!1);if(!e&&""!==this.value){const e=this.#t.findLast((({value:e})=>e===this.value));return!this.disabled&&e?.disabled&&(e.disabled=!1),void(e&&(e.checked=!0,e.tabIndex=0))}const t=this.#t.find((({disabled:e})=>!e));t&&(t.tabIndex=0)}focus(e){const t=this.#t.find((({checked:e,disabled:t})=>e&&!t))??this.#t.find((({tabIndex:e})=>0===e));t?.focus(e)}get form(){return this.#r.form}get validity(){const e=this.#t.some((({checked:e})=>e));return!this.required||e||this.disabled?this.required&&this.#r.validity.valueMissing&&e?(this.#r.setValidity({}),this.#r.validity):this.required&&this.disabled&&!e?(this.#r.setValidity({valueMissing:!0}," ",this.#l.value),this.#r.validity):(this.required||!this.#r.validity.valueMissing||e||this.#r.setValidity({}),this.#r.validity):(this.#r.setValidity({customError:Boolean(this.validityMessage),valueMissing:!0}," ",this.#l.value),this.#r.validity)}formAssociatedCallback(){this.form?.addEventListener("formdata",this.#d)}formResetCallback(){this.value=this.getAttribute("value")??""}render(){return html`
2
2
  <div
3
3
  class="component"
4
- @click=${this.#d}
5
- @keydown=${this.#l}
6
- ${ref(this.#r)}
4
+ @click=${this.#n}
5
+ @keydown=${this.#h}
6
+ ${ref(this.#l)}
7
7
  >
8
8
  <glide-core-private-label
9
9
  label=${ifDefined(this.label)}
@@ -11,26 +11,26 @@ var __decorate=this&&this.__decorate||function(e,t,i,a){var o,s=arguments.length
11
11
  split=${ifDefined(this.privateSplit??void 0)}
12
12
  tooltip=${ifDefined(this.tooltip)}
13
13
  ?disabled=${this.disabled}
14
- ?error=${this.#n}
14
+ ?error=${this.#c}
15
15
  ?hide=${this.hideLabel}
16
16
  ?required=${this.required}
17
17
  >
18
18
  <label id="label" data-test="label"> ${this.label} </label>
19
19
 
20
20
  <div
21
- class=${classMap({"radio-container":!0,invalid:this.#n})}
21
+ class=${classMap({"radio-container":!0,invalid:this.#c})}
22
22
  role="radiogroup"
23
23
  slot="control"
24
24
  aria-labelledby="label description"
25
25
  >
26
26
  <slot
27
- @focusout=${this.#h}
28
- @private-checked-change=${this.#c}
29
- @private-disabled-change=${this.#u}
30
- @private-value-change=${this.#p}
31
- @slotchange=${this.#f}
27
+ @focusout=${this.#u}
28
+ @private-checked-change=${this.#p}
29
+ @private-disabled-change=${this.#f}
30
+ @private-value-change=${this.#m}
31
+ @slotchange=${this.#b}
32
32
  ${assertSlot([GlideCoreRadioGroupRadio])}
33
- ${ref(this.#m)}
33
+ ${ref(this.#g)}
34
34
  >
35
35
  <!-- @type {GlideCoreRadio} -->
36
36
  </slot>
@@ -38,7 +38,7 @@ var __decorate=this&&this.__decorate||function(e,t,i,a){var o,s=arguments.length
38
38
 
39
39
  <div id="description" slot="description">
40
40
  <slot
41
- class=${classMap({"description-slot":!0,hidden:Boolean(this.#n&&this.validityMessage)})}
41
+ class=${classMap({"description-slot":!0,hidden:Boolean(this.#c&&this.validityMessage)})}
42
42
  name="description"
43
43
  >
44
44
  <!--
@@ -47,10 +47,10 @@ var __decorate=this&&this.__decorate||function(e,t,i,a){var o,s=arguments.length
47
47
  -->
48
48
  </slot>
49
49
 
50
- ${when(this.#n&&this.validityMessage,(()=>html`<div data-test="validity-message">
50
+ ${when(this.#c&&this.validityMessage,(()=>html`<div data-test="validity-message">
51
51
  ${unsafeHTML(this.validityMessage)}
52
52
  </div>`))}
53
53
  </div>
54
54
  </glide-core-private-label>
55
55
  </div>
56
- `}reportValidity(){this.isReportValidityOrSubmit=!0;const e=this.#o.reportValidity();return this.requestUpdate(),e}resetValidityFeedback(){this.isReportValidityOrSubmit=!1}setCustomValidity(e){this.validityMessage=e,""===e?this.#o.setValidity({customError:!1},"",this.#r.value):this.#o.setValidity({customError:!0,valueMissing:this.#o.validity.valueMissing}," ",this.#r.value)}setValidity(e,t){this.validityMessage=t,this.#o.setValidity(e," ",this.#r.value)}constructor(){super(),this.hideLabel=!1,this.name="",this.orientation="horizontal",this.version=packageJson.version,this.isBlurring=!1,this.isCheckingValidity=!1,this.isReportValidityOrSubmit=!1,this.#r=createRef(),this.#m=createRef(),this.#e=!1,this.#i=!1,this.#a="",this.#s=({formData:e})=>{this.name&&this.value.length>0&&!this.disabled&&e.append(this.name,this.value)},this.#o=this.attachInternals(),this.addEventListener("invalid",(e=>{if(e.preventDefault(),!this.isCheckingValidity){if(e?.preventDefault(),this.isCheckingValidity||this.isBlurring)return;this.isReportValidityOrSubmit=!0;this.form?.querySelector(":invalid")===this&&this.focus()}}))}#r;#m;#o;#e;#i;#a;#s;get#n(){const e=!this.disabled&&!this.validity.valid&&this.isReportValidityOrSubmit;for(const t of this.#t)t.privateInvalid=e;return e}#v(e){this.#t.find((({tabIndex:e})=>0===e))?.setAttribute("tabindex","-1"),this.#a=e.value,e.checked=!0,e.tabIndex=0,e.focus()}#d(e){if(!this.disabled)if(e.target instanceof GlideCoreRadioGroupRadio&&e.target.disabled){const e=this.#t.find((({checked:e})=>e));e?.focus()}else if(e.target instanceof GlideCoreRadioGroupRadio&&!e.target.disabled){const t=this.#t.filter((t=>t!==e.target));for(const e of t)e.checked=!1,e.tabIndex=-1;this.#v(e.target)}}#l(e){if(!(this.disabled||e.target instanceof GlideCoreRadioGroupRadio&&e.target?.disabled)&&e.target instanceof GlideCoreRadioGroupRadio)switch(e.key){case"Enter":this.form?.requestSubmit();break;case"ArrowUp":case"ArrowLeft":{e.preventDefault();const t=this.#t.slice(0,this.#t.indexOf(e.target)).findLast((e=>!e.disabled)),i=this.#t.findLast((e=>!e.disabled));t&&t!==e.target?(this.#b(e.target),this.#v(t)):i&&i!==e.target&&(this.#b(e.target),this.#v(i));break}case"ArrowDown":case"ArrowRight":{e.preventDefault();const t=this.#t.find(((t,i)=>!t.disabled&&e.target instanceof GlideCoreRadioGroupRadio&&i>this.#t.indexOf(e.target))),i=this.#t.find((e=>!e.disabled));t&&t!==e.target?(this.#b(e.target),this.#v(t)):i&&i!==e.target&&(this.#b(e.target),this.#v(i));break}case" ":if(e.preventDefault(),!e.target.disabled&&!e.target.checked){this.#v(e.target);for(const t of this.#t)t!==e.target&&this.#b(t)}}}#f(){const e=this.#t.findLast((({checked:e,disabled:t})=>e&&!t));e&&(this.#a=e.value)}#h(e){(null===e.relatedTarget||e.relatedTarget instanceof Node&&!this.contains(e.relatedTarget))&&(this.isBlurring=!0,this.reportValidity(),this.isBlurring=!1)}get#t(){return this.#m.value?this.#m.value.assignedElements().filter((e=>e instanceof GlideCoreRadioGroupRadio)):[]}#c(e){if(e.target instanceof GlideCoreRadioGroupRadio&&e.target.checked&&!e.detail.old&&e.detail.new){const t=this.#t.find((({tabIndex:e})=>0===e));t&&t!==e.target&&this.#b(t),this.#a=e.target.value,e.target.tabIndex=e.target.disabled?-1:0}}#u(e){if(e.target instanceof GlideCoreRadioGroupRadio&&e.target.disabled){const t=this.#t.find(((t,i)=>!t.disabled&&e.target instanceof GlideCoreRadioGroupRadio&&i>this.#t.indexOf(e.target)));if(t&&0===e.target.tabIndex)return t.tabIndex=0,void(e.target.tabIndex=-1);const i=this.#t.find((e=>!e.disabled));if(i&&0===e.target.tabIndex)return i.tabIndex=0,void(e.target.tabIndex=-1)}const t=this.#t.some((({tabIndex:e})=>0===e));e.target instanceof GlideCoreRadioGroupRadio&&!t&&!this.disabled&&(e.target.tabIndex=0)}#p(e){e.target instanceof GlideCoreRadioGroupRadio&&e.target.checked&&e.detail.new?this.#a=e.target.value:e.target instanceof GlideCoreRadioGroupRadio&&e.target.checked&&(this.#a="")}#b(e){e.checked=!1,e.tabIndex=-1}};__decorate([property({reflect:!0,type:Boolean})],GlideCoreRadioGroup.prototype,"disabled",null),__decorate([property({attribute:"hide-label",type:Boolean})],GlideCoreRadioGroup.prototype,"hideLabel",void 0),__decorate([property({reflect:!0}),required],GlideCoreRadioGroup.prototype,"label",void 0),__decorate([property({reflect:!0})],GlideCoreRadioGroup.prototype,"name",void 0),__decorate([property({reflect:!0})],GlideCoreRadioGroup.prototype,"orientation",void 0),__decorate([property()],GlideCoreRadioGroup.prototype,"privateSplit",void 0),__decorate([property({reflect:!0})],GlideCoreRadioGroup.prototype,"tooltip",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreRadioGroup.prototype,"required",null),__decorate([property()],GlideCoreRadioGroup.prototype,"value",null),__decorate([property({reflect:!0})],GlideCoreRadioGroup.prototype,"version",void 0),__decorate([state()],GlideCoreRadioGroup.prototype,"isBlurring",void 0),__decorate([state()],GlideCoreRadioGroup.prototype,"isCheckingValidity",void 0),__decorate([state()],GlideCoreRadioGroup.prototype,"isReportValidityOrSubmit",void 0),__decorate([state()],GlideCoreRadioGroup.prototype,"validityMessage",void 0),GlideCoreRadioGroup=__decorate([customElement("glide-core-radio-group"),final],GlideCoreRadioGroup);export default GlideCoreRadioGroup;
56
+ `}reportValidity(){this.isReportValidityOrSubmit=!0;const e=this.#r.reportValidity();return this.requestUpdate(),e}resetValidityFeedback(){this.isReportValidityOrSubmit=!1}setCustomValidity(e){this.validityMessage=e,""===e?this.#r.setValidity({customError:!1},"",this.#l.value):this.#r.setValidity({customError:!0,valueMissing:this.#r.validity.valueMissing}," ",this.#l.value)}setValidity(e,t){this.validityMessage=t,this.#r.setValidity(e," ",this.#l.value)}constructor(){super(),this.hideLabel=!1,this.name="",this.orientation="horizontal",this.version=packageJson.version,this.isBlurring=!1,this.isCheckingValidity=!1,this.isReportValidityOrSubmit=!1,this.#l=createRef(),this.#g=createRef(),this.#e=!1,this.#i=!1,this.#s=!1,this.#o=!1,this.#a="",this.#d=({formData:e})=>{this.name&&this.value.length>0&&!this.disabled&&e.append(this.name,this.value)},this.#r=this.attachInternals(),this.addEventListener("invalid",(e=>{if(e.preventDefault(),!this.isCheckingValidity){if(e?.preventDefault(),this.isCheckingValidity||this.isBlurring)return;this.isReportValidityOrSubmit=!0;this.form?.querySelector(":invalid")===this&&this.focus()}}))}#l;#g;#r;#e;#i;#s;#o;#a;#d;get#c(){const e=!this.disabled&&!this.validity.valid&&this.isReportValidityOrSubmit;for(const t of this.#t)t.privateInvalid=e;return e}#v(e){this.#t.find((({tabIndex:e})=>0===e))?.setAttribute("tabindex","-1"),this.#a=e.value,e.checked=!0,e.tabIndex=0,e.focus()}#n(e){if(!this.disabled)if(e.target instanceof GlideCoreRadioGroupRadio&&e.target.disabled){const e=this.#t.find((({checked:e})=>e));e?.focus()}else if(e.target instanceof GlideCoreRadioGroupRadio&&!e.target.disabled){const t=this.#t.filter((t=>t!==e.target));for(const e of t)e.checked=!1,e.tabIndex=-1;this.#v(e.target)}}#h(e){if(!(this.disabled||e.target instanceof GlideCoreRadioGroupRadio&&e.target?.disabled)&&e.target instanceof GlideCoreRadioGroupRadio)switch(e.key){case"Enter":this.form?.requestSubmit();break;case"ArrowUp":case"ArrowLeft":{e.preventDefault();const t=this.#t.slice(0,this.#t.indexOf(e.target)).findLast((e=>!e.disabled)),i=this.#t.findLast((e=>!e.disabled));t&&t!==e.target?(this.#R(e.target),this.#v(t)):i&&i!==e.target&&(this.#R(e.target),this.#v(i));break}case"ArrowDown":case"ArrowRight":{e.preventDefault();const t=this.#t.find(((t,i)=>!t.disabled&&e.target instanceof GlideCoreRadioGroupRadio&&i>this.#t.indexOf(e.target))),i=this.#t.find((e=>!e.disabled));t&&t!==e.target?(this.#R(e.target),this.#v(t)):i&&i!==e.target&&(this.#R(e.target),this.#v(i));break}case" ":if(e.preventDefault(),!e.target.disabled&&!e.target.checked){this.#v(e.target);for(const t of this.#t)t!==e.target&&this.#R(t)}}}#b(){const e=this.#t.findLast((({checked:e,disabled:t})=>e&&!t));e&&(this.#a=e.value)}#u(e){(null===e.relatedTarget||e.relatedTarget instanceof Node&&!this.contains(e.relatedTarget))&&(this.isBlurring=!0,this.reportValidity(),this.isBlurring=!1)}get#t(){return this.#g.value?this.#g.value.assignedElements().filter((e=>e instanceof GlideCoreRadioGroupRadio)):[]}#p(e){if(e.target instanceof GlideCoreRadioGroupRadio&&e.target.checked&&!e.detail.old&&e.detail.new){const t=this.#t.find((({tabIndex:e})=>0===e));t&&t!==e.target&&this.#R(t),this.#a=e.target.value,e.target.tabIndex=e.target.disabled?-1:0}}#f(e){if(!this.#i){if(e.target instanceof GlideCoreRadioGroupRadio&&e.target.disabled){const t=this.#t.findLast((e=>e.checked&&!e.disabled));e.target.checked&&!t?this.#a="":t&&(this.#a=t.value);const i=this.#t.find(((t,i)=>!t.disabled&&e.target instanceof GlideCoreRadioGroupRadio&&i>this.#t.indexOf(e.target)));if(i&&0===e.target.tabIndex)return i.tabIndex=0,void(e.target.tabIndex=-1);const a=this.#t.find((e=>!e.disabled));if(a&&0===e.target.tabIndex)return a.tabIndex=0,void(e.target.tabIndex=-1)}if(e.target instanceof GlideCoreRadioGroupRadio&&!this.disabled){this.#t.some((({tabIndex:e})=>0===e))||(e.target.tabIndex=0);const t=this.#t.findLast((e=>e.checked&&!e.disabled));e.target===t&&(this.#a=e.target.value)}else;}}#m(e){const t=this.#t.findLast((e=>e.checked&&!this.disabled));e.target instanceof GlideCoreRadioGroupRadio&&e.target.checked&&e.detail.new&&e.target===t?this.#a=e.target.value:e.target instanceof GlideCoreRadioGroupRadio&&e.target.checked&&e.target===t&&(this.#a="")}#R(e){e.checked=!1,e.tabIndex=-1}};__decorate([property({reflect:!0,type:Boolean})],GlideCoreRadioGroup.prototype,"disabled",null),__decorate([property({attribute:"hide-label",type:Boolean})],GlideCoreRadioGroup.prototype,"hideLabel",void 0),__decorate([property({reflect:!0}),required],GlideCoreRadioGroup.prototype,"label",void 0),__decorate([property({reflect:!0})],GlideCoreRadioGroup.prototype,"name",void 0),__decorate([property({reflect:!0})],GlideCoreRadioGroup.prototype,"orientation",void 0),__decorate([property()],GlideCoreRadioGroup.prototype,"privateSplit",void 0),__decorate([property({reflect:!0})],GlideCoreRadioGroup.prototype,"tooltip",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreRadioGroup.prototype,"required",null),__decorate([property()],GlideCoreRadioGroup.prototype,"value",null),__decorate([property({reflect:!0})],GlideCoreRadioGroup.prototype,"version",void 0),__decorate([state()],GlideCoreRadioGroup.prototype,"isBlurring",void 0),__decorate([state()],GlideCoreRadioGroup.prototype,"isCheckingValidity",void 0),__decorate([state()],GlideCoreRadioGroup.prototype,"isReportValidityOrSubmit",void 0),__decorate([state()],GlideCoreRadioGroup.prototype,"validityMessage",void 0),GlideCoreRadioGroup=__decorate([customElement("glide-core-radio-group"),final],GlideCoreRadioGroup);export default GlideCoreRadioGroup;
@@ -29,7 +29,7 @@ export default class GlideCoreRadioGroupRadio extends LitElement {
29
29
  * @default false
30
30
  */
31
31
  get disabled(): boolean;
32
- set disabled(disabled: boolean);
32
+ set disabled(isDisabled: boolean);
33
33
  get privateInvalid(): boolean;
34
34
  set privateInvalid(invalid: boolean);
35
35
  /**
@@ -46,5 +46,6 @@ export default class GlideCoreRadioGroupRadio extends LitElement {
46
46
  set value(value: string);
47
47
  readonly version: string;
48
48
  firstUpdated(): void;
49
+ private get lastCheckedRadio();
49
50
  render(): import("lit").TemplateResult<1>;
50
51
  }
@@ -1 +1 @@
1
- var __decorate=this&&this.__decorate||function(e,t,i,r){var o,a=arguments.length,d=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(d=(a<3?o(d):a>3?o(t,i,d):o(t,i))||d);return a>3&&d&&Object.defineProperty(t,i,d),d};import{html,LitElement}from"lit";import{classMap}from"lit/directives/class-map.js";import{customElement,property}from"lit/decorators.js";import packageJson from"../package.json"with{type:"json"};import styles from"./radio-group.radio.styles.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";import required from"./library/required.js";let GlideCoreRadioGroupRadio=class GlideCoreRadioGroupRadio extends LitElement{constructor(){super(...arguments),this.version=packageJson.version,this.#e=!1,this.#t=!1,this.#i=!1,this.#r=!1,this.#o=""}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode}}static{this.styles=styles}get checked(){return this.#e}set checked(e){const t=this.#e;this.#e=e,this.ariaChecked=e.toString(),e&&t!==e&&(this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.dispatchEvent(new CustomEvent("private-checked-change",{bubbles:!0,detail:{old:t,new:e}}))}get disabled(){return this.#t}set disabled(e){this.#t=e,this.ariaDisabled=e.toString(),this.dispatchEvent(new CustomEvent("private-disabled-change",{bubbles:!0}))}get privateInvalid(){return this.#i}set privateInvalid(e){this.#i=e,this.ariaInvalid=e.toString()}get label(){return this.#a}set label(e){this.#a=e,this.ariaLabel=e.toString()}get privateRequired(){return this.#r}set privateRequired(e){this.#r=e,this.ariaRequired=e.toString()}get value(){return this.#o}set value(e){const t=this.#o;this.#o=e,this.dispatchEvent(new CustomEvent("private-value-change",{bubbles:!0,detail:{old:t,new:e}}))}firstUpdated(){this.ariaChecked=this.checked.toString(),this.ariaDisabled=this.disabled.toString(),this.ariaInvalid=this.privateInvalid.toString(),this.ariaRequired=this.privateRequired.toString(),this.role="radio",this.label&&(this.ariaLabel=this.label)}render(){return html`<div class="component" data-test="component"><div class="${classMap({circle:!0,checked:this.checked,disabled:this.disabled,animate:this.hasUpdated})}" data-test="radio"></div>${this.#a}</div>`}#e;#t;#a;#i;#r;#o};__decorate([property({type:Boolean,reflect:!0})],GlideCoreRadioGroupRadio.prototype,"checked",null),__decorate([property({type:Boolean,reflect:!0})],GlideCoreRadioGroupRadio.prototype,"disabled",null),__decorate([property({type:Boolean})],GlideCoreRadioGroupRadio.prototype,"privateInvalid",null),__decorate([property({reflect:!0}),required],GlideCoreRadioGroupRadio.prototype,"label",null),__decorate([property({type:Boolean,reflect:!0})],GlideCoreRadioGroupRadio.prototype,"privateRequired",null),__decorate([property()],GlideCoreRadioGroupRadio.prototype,"value",null),__decorate([property({reflect:!0})],GlideCoreRadioGroupRadio.prototype,"version",void 0),GlideCoreRadioGroupRadio=__decorate([customElement("glide-core-radio-group-radio"),final],GlideCoreRadioGroupRadio);export default GlideCoreRadioGroupRadio;
1
+ var __decorate=this&&this.__decorate||function(e,t,i,a){var r,o=arguments.length,d=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(d=(o<3?r(d):o>3?r(t,i,d):r(t,i))||d);return o>3&&d&&Object.defineProperty(t,i,d),d};import{html,LitElement}from"lit";import{classMap}from"lit/directives/class-map.js";import{customElement,property,state}from"lit/decorators.js";import packageJson from"../package.json"with{type:"json"};import styles from"./radio-group.radio.styles.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";import required from"./library/required.js";let GlideCoreRadioGroupRadio=class GlideCoreRadioGroupRadio extends LitElement{constructor(){super(...arguments),this.version=packageJson.version,this.#e=!1,this.#t=!1,this.#i=!1,this.#a=!1,this.#r=""}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode}}static{this.styles=styles}get checked(){return this.#e}set checked(e){const t=this.#e;this.#e=e,this.ariaChecked=e&&!this.disabled?"true":"false",e&&t!==e&&(this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.dispatchEvent(new CustomEvent("private-checked-change",{bubbles:!0,detail:{old:t,new:e}}))}get disabled(){return this.#t}set disabled(e){this.#t=e,this.ariaDisabled=e.toString(),this.ariaChecked=this.checked&&!e?"true":"false",this.dispatchEvent(new CustomEvent("private-disabled-change",{bubbles:!0}))}get privateInvalid(){return this.#i}set privateInvalid(e){this.#i=e,this.ariaInvalid=e.toString()}get label(){return this.#o}set label(e){this.#o=e,this.ariaLabel=e.toString()}get privateRequired(){return this.#a}set privateRequired(e){this.#a=e,this.ariaRequired=e.toString()}get value(){return this.#r}set value(e){const t=this.#r;this.#r=e,this.dispatchEvent(new CustomEvent("private-value-change",{bubbles:!0,detail:{old:t,new:e}}))}firstUpdated(){this.ariaChecked=this.checked&&!this.disabled&&this===this.lastCheckedRadio?"true":"false",this.ariaDisabled=this.disabled.toString(),this.ariaInvalid=this.privateInvalid.toString(),this.ariaRequired=this.privateRequired.toString(),this.role="radio",this.label&&(this.ariaLabel=this.label)}get lastCheckedRadio(){const e=this.parentElement?.querySelectorAll("glide-core-radio-group-radio");if(e&&e.length>0)return[...e].findLast((e=>e.checked))}render(){return html`<div class="component" data-test="component"><div class="${classMap({circle:!0,checked:this.checked&&this===this.lastCheckedRadio&&!this.disabled,disabled:this.disabled,animate:this.hasUpdated})}" data-test="radio"></div>${this.#o}</div>`}#e;#t;#o;#i;#a;#r};__decorate([property({type:Boolean,reflect:!0})],GlideCoreRadioGroupRadio.prototype,"checked",null),__decorate([property({type:Boolean,reflect:!0})],GlideCoreRadioGroupRadio.prototype,"disabled",null),__decorate([property({type:Boolean})],GlideCoreRadioGroupRadio.prototype,"privateInvalid",null),__decorate([property({reflect:!0}),required],GlideCoreRadioGroupRadio.prototype,"label",null),__decorate([property({type:Boolean,reflect:!0})],GlideCoreRadioGroupRadio.prototype,"privateRequired",null),__decorate([property()],GlideCoreRadioGroupRadio.prototype,"value",null),__decorate([property({reflect:!0})],GlideCoreRadioGroupRadio.prototype,"version",void 0),__decorate([state()],GlideCoreRadioGroupRadio.prototype,"lastCheckedRadio",null),GlideCoreRadioGroupRadio=__decorate([customElement("glide-core-radio-group-radio"),final],GlideCoreRadioGroupRadio);export default GlideCoreRadioGroupRadio;
@@ -17,6 +17,7 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
17
17
  gap: 0.4375rem;
18
18
  justify-content: center;
19
19
  padding-block: 0.4375rem;
20
+ user-select: none;
20
21
 
21
22
  &:hover {
22
23
  color: var(--glide-core-text-primary);
package/dist/tag.js CHANGED
@@ -1 +1 @@
1
- var __decorate=this&&this.__decorate||function(e,t,o,i){var s,a=arguments.length,l=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(l=(a<3?s(l):a>3?s(t,o,l):s(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};import{html,LitElement}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property}from"lit/decorators.js";import{when}from"lit/directives/when.js";import packageJson from"../package.json"with{type:"json"};import{LocalizeController}from"./library/localize.js";import pencilIcon from"./icons/pencil.js";import styles from"./tag.styles.js";import xIcon from"./icons/x.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";import required from"./library/required.js";let GlideCoreTag=class GlideCoreTag extends LitElement{constructor(){super(...arguments),this.disabled=!1,this.privateEditable=!1,this.removable=!1,this.size="medium",this.version=packageJson.version,this.#e=100,this.#t=createRef(),this.#o=!1,this.#i=new LocalizeController(this),this.#s=createRef()}static{this.shadowRootOptions={...LitElement.shadowRootOptions,delegatesFocus:!0,mode:shadowRootMode}}static{this.styles=styles}click(){this.#s.value?.click()}firstUpdated(){this.#t.value?.addEventListener("animationend",(()=>{this.#t.value?.classList.remove("added")}),{once:!0})}focus(){this.#s.value?.focus()}render(){return html`<div class="${classMap({component:!0,added:!0,disabled:this.disabled,[this.size]:!0})}" data-test="component" data-animation-duration="${this.#e}" style="--private-animation-duration: ${this.#e}ms" ${ref(this.#t)}><slot class="${classMap({"icon-slot":!0,[this.size]:!0})}" name="icon"></slot>${this.label} ${when(this.privateEditable,(()=>html`<button aria-label="${this.#i.term("editTag",this.label)}" class="${classMap({"edit-button":!0,[this.size]:!0,disabled:this.disabled})}" data-test="edit-button" type="button" ?disabled="${this.disabled}" @click="${this.#a}" @keydown="${this.#l}">${pencilIcon}</button>`))} ${when(this.removable,(()=>html`<button aria-label="${this.#i.term("removeTag",this.label)}" class="${classMap({"removal-button":!0,[this.size]:!0,disabled:this.disabled})}" data-test="removal-button" type="button" ?disabled="${this.disabled}" @click="${this.#r}" @keydown="${this.#n}" ${ref(this.#s)}>${xIcon}</button>`))}</div>`}#e;#t;#o;#i;#s;#a(){this.#o?this.#o=!1:this.dispatchEvent(new Event("edit",{bubbles:!0,composed:!0}))}#l(e){["Enter"," "].includes(e.key)&&(this.#o=!0,this.dispatchEvent(new Event("edit",{bubbles:!0,composed:!0})))}#r(){this.#o?this.#o=!1:(setTimeout((()=>{this.remove()}),this.#e),this.#t.value?.classList.add("removed"),this.dispatchEvent(new Event("remove",{bubbles:!0,composed:!0})))}#n(e){["Enter"," "].includes(e.key)&&(this.#o=!0,setTimeout((()=>{this.remove()}),this.#e),this.#t.value?.classList.add("removed"),this.dispatchEvent(new Event("remove",{bubbles:!0,composed:!0})))}};__decorate([property({reflect:!0,type:Boolean})],GlideCoreTag.prototype,"disabled",void 0),__decorate([property({reflect:!0}),required],GlideCoreTag.prototype,"label",void 0),__decorate([property({attribute:"private-editable",reflect:!0,type:Boolean})],GlideCoreTag.prototype,"privateEditable",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreTag.prototype,"removable",void 0),__decorate([property({reflect:!0})],GlideCoreTag.prototype,"size",void 0),__decorate([property({reflect:!0})],GlideCoreTag.prototype,"version",void 0),GlideCoreTag=__decorate([customElement("glide-core-tag"),final],GlideCoreTag);export default GlideCoreTag;
1
+ var __decorate=this&&this.__decorate||function(e,t,o,i){var s,a=arguments.length,l=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,i);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(l=(a<3?s(l):a>3?s(t,o,l):s(t,o))||l);return a>3&&l&&Object.defineProperty(t,o,l),l};import{html,LitElement}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property}from"lit/decorators.js";import{when}from"lit/directives/when.js";import packageJson from"../package.json"with{type:"json"};import{LocalizeController}from"./library/localize.js";import pencilIcon from"./icons/pencil.js";import styles from"./tag.styles.js";import xIcon from"./icons/x.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";import required from"./library/required.js";let GlideCoreTag=class GlideCoreTag extends LitElement{constructor(){super(...arguments),this.disabled=!1,this.privateEditable=!1,this.removable=!1,this.size="medium",this.version=packageJson.version,this.#e=100,this.#t=createRef(),this.#o=!1,this.#i=new LocalizeController(this),this.#s=createRef()}static{this.shadowRootOptions={...LitElement.shadowRootOptions,delegatesFocus:!0,mode:shadowRootMode}}static{this.styles=styles}click(){this.#s.value?.click()}firstUpdated(){this.#t.value?.addEventListener("animationend",(()=>{this.#t.value?.classList.remove("added")}),{once:!0})}focus(){this.#s.value?.focus()}render(){return html`<div class="${classMap({component:!0,added:!0,disabled:this.disabled,[this.size]:!0})}" data-test="component" data-animation-duration="${this.#e}" style="--private-animation-duration: ${this.#e}ms" ${ref(this.#t)}><slot class="${classMap({"icon-slot":!0,[this.size]:!0})}" name="icon"></slot><div class="label">${this.label}</div>${when(this.privateEditable,(()=>html`<button aria-label="${this.#i.term("editTag",this.label)}" class="${classMap({"edit-button":!0,[this.size]:!0,disabled:this.disabled})}" data-test="edit-button" type="button" ?disabled="${this.disabled}" @click="${this.#a}" @keydown="${this.#l}">${pencilIcon}</button>`))} ${when(this.removable,(()=>html`<button aria-label="${this.#i.term("removeTag",this.label)}" class="${classMap({"removal-button":!0,[this.size]:!0,disabled:this.disabled})}" data-test="removal-button" type="button" ?disabled="${this.disabled}" @click="${this.#r}" @keydown="${this.#n}" ${ref(this.#s)}>${xIcon}</button>`))}</div>`}#e;#t;#o;#i;#s;#a(){this.#o?this.#o=!1:this.dispatchEvent(new Event("edit",{bubbles:!0,composed:!0}))}#l(e){["Enter"," "].includes(e.key)&&(this.#o=!0,this.dispatchEvent(new Event("edit",{bubbles:!0,composed:!0})))}#r(){this.#o?this.#o=!1:(setTimeout((()=>{this.remove()}),this.#e),this.#t.value?.classList.add("removed"),this.dispatchEvent(new Event("remove",{bubbles:!0,composed:!0})))}#n(e){["Enter"," "].includes(e.key)&&(this.#o=!0,setTimeout((()=>{this.remove()}),this.#e),this.#t.value?.classList.add("removed"),this.dispatchEvent(new Event("remove",{bubbles:!0,composed:!0})))}};__decorate([property({reflect:!0,type:Boolean})],GlideCoreTag.prototype,"disabled",void 0),__decorate([property({reflect:!0}),required],GlideCoreTag.prototype,"label",void 0),__decorate([property({attribute:"private-editable",reflect:!0,type:Boolean})],GlideCoreTag.prototype,"privateEditable",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreTag.prototype,"removable",void 0),__decorate([property({reflect:!0})],GlideCoreTag.prototype,"size",void 0),__decorate([property({reflect:!0})],GlideCoreTag.prototype,"version",void 0),GlideCoreTag=__decorate([customElement("glide-core-tag"),final],GlideCoreTag);export default GlideCoreTag;
@@ -2,6 +2,26 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
2
2
  ${focusOutline(".edit-button:focus-visible")}
3
3
  ${focusOutline(".removal-button:focus-visible")}
4
4
  `,css`
5
+ @keyframes fade-in {
6
+ 0% {
7
+ opacity: 0;
8
+ }
9
+
10
+ 100% {
11
+ opacity: 1;
12
+ }
13
+ }
14
+
15
+ @keyframes fade-out {
16
+ 0% {
17
+ opacity: 1;
18
+ }
19
+
20
+ 100% {
21
+ opacity: 0;
22
+ }
23
+ }
24
+
5
25
  .component {
6
26
  align-items: center;
7
27
  background: var(--glide-core-surface-base-gray-lighter);
@@ -14,13 +34,10 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
14
34
  font-weight: var(--glide-core-body-xs-font-weight);
15
35
  justify-content: center;
16
36
  line-height: 1;
17
- margin: 0;
18
37
  max-inline-size: max-content;
19
38
  min-block-size: var(--glide-core-spacing-md);
20
39
  opacity: 1;
21
- overflow: hidden;
22
40
  padding: var(--glide-core-spacing-xxxs) var(--glide-core-spacing-xs);
23
- white-space: nowrap;
24
41
 
25
42
  &.large {
26
43
  min-block-size: 0.875rem;
@@ -53,24 +70,10 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
53
70
  }
54
71
  }
55
72
 
56
- @keyframes fade-in {
57
- 0% {
58
- opacity: 0;
59
- }
60
-
61
- 100% {
62
- opacity: 1;
63
- }
64
- }
65
-
66
- @keyframes fade-out {
67
- 0% {
68
- opacity: 1;
69
- }
70
-
71
- 100% {
72
- opacity: 0;
73
- }
73
+ .label {
74
+ overflow: hidden;
75
+ text-overflow: ellipsis;
76
+ white-space: nowrap;
74
77
  }
75
78
 
76
79
  .removal-button {
@@ -18,7 +18,6 @@ declare global {
18
18
  * @attr {string} [placeholder='']
19
19
  * @attr {boolean} [readonly=false]
20
20
  * @attr {boolean} [required=false]
21
- * @attr {number} [rows=2]
22
21
  * @attr {boolean} [spellcheck=false]
23
22
  * @attr {string} [tooltip]
24
23
  * @attr {string} [value='']
@@ -65,7 +64,6 @@ export default class GlideCoreTextarea extends LitElement implements FormControl
65
64
  hideLabel: boolean;
66
65
  orientation: 'horizontal' | 'vertical';
67
66
  placeholder?: string;
68
- rows: number;
69
67
  required: boolean;
70
68
  readonly: boolean;
71
69
  disabled: boolean;
package/dist/textarea.js CHANGED
@@ -19,7 +19,6 @@ var __decorate=this&&this.__decorate||function(e,t,i,a){var r,o=arguments.length
19
19
  id="textarea"
20
20
  name=${ifDefined(this.name)}
21
21
  placeholder=${ifDefined(this.placeholder)}
22
- rows=${this.rows}
23
22
  autocapitalize=${this.autocapitalize}
24
23
  autocomplete=${this.autocomplete}
25
24
  spellcheck=${this.spellcheck}
@@ -63,4 +62,4 @@ var __decorate=this&&this.__decorate||function(e,t,i,a){var r,o=arguments.length
63
62
  >
64
63
  </div>`:nothing}
65
64
  </div></glide-core-private-label
66
- >`}reportValidity(){this.isReportValidityOrSubmit=!0;const e=this.#e.reportValidity();return this.requestUpdate(),e}resetValidityFeedback(){this.isReportValidityOrSubmit=!1}setCustomValidity(e){this.validityMessage=e,""===e?this.#e.setValidity({customError:!1},"",this.#i.value):this.#e.setValidity({customError:!0,valueMissing:this.#e.validity.valueMissing}," ",this.#i.value)}setValidity(e,t){this.validityMessage=t,this.#e.setValidity(e," ",this.#i.value)}constructor(){super(),this.value="",this.hideLabel=!1,this.orientation="horizontal",this.placeholder="",this.rows=2,this.required=!1,this.readonly=!1,this.disabled=!1,this.name="",this.spellcheck=!1,this.autocapitalize="on",this.autocomplete="on",this.version=packageJson.version,this.isBlurring=!1,this.isCheckingValidity=!1,this.isReportValidityOrSubmit=!1,this.#n=new LocalizeController(this),this.#i=createRef(),this.#t=({formData:e})=>{this.name&&this.value&&!this.disabled&&e.append(this.name,this.value)},this.#e=this.attachInternals(),this.addEventListener("invalid",(e=>{if(e?.preventDefault(),this.isCheckingValidity||this.isBlurring)return;this.isReportValidityOrSubmit=!0;this.form?.querySelector(":invalid")===this&&this.focus()}))}#e;#n;#i;#t;get#a(){return!this.disabled&&!this.readonly&&!this.validity.valid&&this.isReportValidityOrSubmit}get#h(){return this.value.length}get#r(){return Boolean(!this.disabled&&!this.readonly&&this.maxlength&&this.#h>this.maxlength)}#o(){this.isBlurring=!0,this.reportValidity(),this.isBlurring=!1}#s(){this.#i.value&&(this.value=this.#i.value.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}#l(){this.#i.value&&(this.value=this.#i.value.value)}#d(e){"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&this.form?.requestSubmit()}};__decorate([property()],GlideCoreTextarea.prototype,"value",void 0),__decorate([property({reflect:!0}),required],GlideCoreTextarea.prototype,"label",void 0),__decorate([property({attribute:"hide-label",reflect:!0,type:Boolean})],GlideCoreTextarea.prototype,"hideLabel",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"orientation",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"placeholder",void 0),__decorate([property({reflect:!0,type:Number})],GlideCoreTextarea.prototype,"rows",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreTextarea.prototype,"required",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreTextarea.prototype,"readonly",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreTextarea.prototype,"disabled",void 0),__decorate([property({type:Number,converter:e=>e&&Number.parseInt(e,10),reflect:!0})],GlideCoreTextarea.prototype,"maxlength",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"name",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreTextarea.prototype,"spellcheck",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"autocapitalize",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"autocomplete",void 0),__decorate([property()],GlideCoreTextarea.prototype,"privateSplit",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"tooltip",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"version",void 0),__decorate([state()],GlideCoreTextarea.prototype,"isBlurring",void 0),__decorate([state()],GlideCoreTextarea.prototype,"isCheckingValidity",void 0),__decorate([state()],GlideCoreTextarea.prototype,"isReportValidityOrSubmit",void 0),__decorate([state()],GlideCoreTextarea.prototype,"validityMessage",void 0),GlideCoreTextarea=__decorate([customElement("glide-core-textarea"),final],GlideCoreTextarea);export default GlideCoreTextarea;
65
+ >`}reportValidity(){this.isReportValidityOrSubmit=!0;const e=this.#e.reportValidity();return this.requestUpdate(),e}resetValidityFeedback(){this.isReportValidityOrSubmit=!1}setCustomValidity(e){this.validityMessage=e,""===e?this.#e.setValidity({customError:!1},"",this.#i.value):this.#e.setValidity({customError:!0,valueMissing:this.#e.validity.valueMissing}," ",this.#i.value)}setValidity(e,t){this.validityMessage=t,this.#e.setValidity(e," ",this.#i.value)}constructor(){super(),this.value="",this.hideLabel=!1,this.orientation="horizontal",this.placeholder="",this.required=!1,this.readonly=!1,this.disabled=!1,this.name="",this.spellcheck=!1,this.autocapitalize="on",this.autocomplete="on",this.version=packageJson.version,this.isBlurring=!1,this.isCheckingValidity=!1,this.isReportValidityOrSubmit=!1,this.#n=new LocalizeController(this),this.#i=createRef(),this.#t=({formData:e})=>{this.name&&this.value&&!this.disabled&&e.append(this.name,this.value)},this.#e=this.attachInternals(),this.addEventListener("invalid",(e=>{if(e?.preventDefault(),this.isCheckingValidity||this.isBlurring)return;this.isReportValidityOrSubmit=!0;this.form?.querySelector(":invalid")===this&&this.focus()}))}#e;#n;#i;#t;get#a(){return!this.disabled&&!this.readonly&&!this.validity.valid&&this.isReportValidityOrSubmit}get#h(){return this.value.length}get#r(){return Boolean(!this.disabled&&!this.readonly&&this.maxlength&&this.#h>this.maxlength)}#o(){this.isBlurring=!0,this.reportValidity(),this.isBlurring=!1}#s(){this.#i.value&&(this.value=this.#i.value.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}#l(){this.#i.value&&(this.value=this.#i.value.value)}#d(e){"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&this.form?.requestSubmit()}};__decorate([property()],GlideCoreTextarea.prototype,"value",void 0),__decorate([property({reflect:!0}),required],GlideCoreTextarea.prototype,"label",void 0),__decorate([property({attribute:"hide-label",reflect:!0,type:Boolean})],GlideCoreTextarea.prototype,"hideLabel",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"orientation",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"placeholder",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreTextarea.prototype,"required",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreTextarea.prototype,"readonly",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreTextarea.prototype,"disabled",void 0),__decorate([property({type:Number,converter:e=>e&&Number.parseInt(e,10),reflect:!0})],GlideCoreTextarea.prototype,"maxlength",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"name",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreTextarea.prototype,"spellcheck",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"autocapitalize",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"autocomplete",void 0),__decorate([property()],GlideCoreTextarea.prototype,"privateSplit",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"tooltip",void 0),__decorate([property({reflect:!0})],GlideCoreTextarea.prototype,"version",void 0),__decorate([state()],GlideCoreTextarea.prototype,"isBlurring",void 0),__decorate([state()],GlideCoreTextarea.prototype,"isCheckingValidity",void 0),__decorate([state()],GlideCoreTextarea.prototype,"isReportValidityOrSubmit",void 0),__decorate([state()],GlideCoreTextarea.prototype,"validityMessage",void 0),GlideCoreTextarea=__decorate([customElement("glide-core-textarea"),final],GlideCoreTextarea);export default GlideCoreTextarea;
@@ -1 +1 @@
1
- const translation={$code:"en",$name:"English",$dir:"ltr",close:"Close",dismiss:"Dismiss",selectAll:"Select all",notifications:"Notifications",nextTab:"Next tab",previousTab:"Previous tab",noResults:"No results found",tooltip:"Tooltip:",severityInformational:"Severity: Informational",severityCritical:"Severity: Critical",severityMedium:"Severity: Medium",success:"Success:",error:"Error:",informational:"Informational:",announcedCharacterCount:(t,e)=>`Character count ${t} of ${e}`,displayedCharacterCount:(t,e)=>`${t}/${e}`,clearEntry:t=>`Clear ${t} entry`,editOption:t=>`Edit option: ${t}`,editTag:t=>`Edit tag: ${t}`,removeTag:t=>`Remove tag: ${t}`,actionsFor:t=>`Actions for ${t}`,itemCount:t=>`${t} items`,closeInlineAlert:t=>`Close ${t} alert`};export default translation;
1
+ const translation={$code:"en",$name:"English",$dir:"ltr",close:"Close",dismiss:"Dismiss",selectAll:"Select all",notifications:"Notifications",nextTab:"Next tab",previousTab:"Previous tab",noResults:"No results found",tooltip:"Tooltip:",severityInformational:"Severity: Informational",severityCritical:"Severity: Critical",severityMedium:"Severity: Medium",success:"Success:",error:"Error:",informational:"Informational:",announcedCharacterCount:(t,e)=>`Character count ${t} of ${e}`,displayedCharacterCount:(t,e)=>`${t}/${e}`,clearEntry:t=>`Clear ${t} entry`,editOption:t=>`Edit option: ${t}`,editTag:t=>`Edit tag: ${t}`,removeTag:t=>`Remove tag: ${t}`,itemCount:t=>`${t} items`,closeInlineAlert:t=>`Close ${t} alert`};export default translation;
@@ -1 +1 @@
1
- export const PENDING_STRINGS=["severityInformational","severityCritical","severityMedium","success","error","informational"];const translation={$code:"fr",$name:"French",$dir:"ltr",close:"FERMER",dismiss:"Ignorer",selectAll:"Tout sélectionner",notifications:"Notifications",nextTab:"Onglet suivant",previousTab:"Onglet précédent",noResults:"Aucun résultat trouvé",tooltip:"Info-bulle :",announcedCharacterCount:(e,t)=>`Nombre de caractères ${e} sur ${t}`,displayedCharacterCount:(e,t)=>`${e}/${t}`,clearEntry:e=>`Effacer l'entrée ${e}`,editOption:e=>`Modifier l'option : ${e}`,editTag:e=>`Modifier la balise : ${e}`,removeTag:e=>`Enlever la balise : ${e}`,actionsFor:e=>`Action pour ${e}`,itemCount:e=>`${e} éléments`,closeInlineAlert:e=>`Fermer l'alerte ${e}`};export default translation;
1
+ export const PENDING_STRINGS=["severityInformational","severityCritical","severityMedium","success","error","informational"];const translation={$code:"fr",$name:"French",$dir:"ltr",close:"FERMER",dismiss:"Ignorer",selectAll:"Tout sélectionner",notifications:"Notifications",nextTab:"Onglet suivant",previousTab:"Onglet précédent",noResults:"Aucun résultat trouvé",tooltip:"Info-bulle :",announcedCharacterCount:(e,t)=>`Nombre de caractères ${e} sur ${t}`,displayedCharacterCount:(e,t)=>`${e}/${t}`,clearEntry:e=>`Effacer l'entrée ${e}`,editOption:e=>`Modifier l'option : ${e}`,editTag:e=>`Modifier la balise : ${e}`,removeTag:e=>`Enlever la balise : ${e}`,itemCount:e=>`${e} éléments`,closeInlineAlert:e=>`Fermer l'alerte ${e}`};export default translation;
@@ -1 +1 @@
1
- export const PENDING_STRINGS=["severityInformational","severityCritical","severityMedium","success","error","informational"];const translation={$code:"ja",$name:"Japanese",$dir:"ltr",close:"閉じる",dismiss:"閉じる",selectAll:"すべて選択",notifications:"通知",nextTab:"Onglet suivant",previousTab:"Onglet précédent",noResults:"結果が見つかりません",tooltip:"ツールチップ:",announcedCharacterCount:(t,e)=>`文字数 ${t}/${e}`,displayedCharacterCount:(t,e)=>`${t}/${e}`,clearEntry:t=>`${t}入力をクリア`,editOption:t=>`編集オプション:${t}`,editTag:t=>`タグの編集:${t}`,removeTag:t=>`タグの削除:${t}`,actionsFor:t=>`${t}のアクション`,itemCount:t=>`${t}件`,closeInlineAlert:t=>`${t}アラートを閉じる`};export default translation;
1
+ export const PENDING_STRINGS=["severityInformational","severityCritical","severityMedium","success","error","informational"];const translation={$code:"ja",$name:"Japanese",$dir:"ltr",close:"閉じる",dismiss:"閉じる",selectAll:"すべて選択",notifications:"通知",nextTab:"Onglet suivant",previousTab:"Onglet précédent",noResults:"結果が見つかりません",tooltip:"ツールチップ:",announcedCharacterCount:(e,t)=>`文字数 ${e}/${t}`,displayedCharacterCount:(e,t)=>`${e}/${t}`,clearEntry:e=>`${e}入力をクリア`,editOption:e=>`編集オプション:${e}`,editTag:e=>`タグの編集:${e}`,removeTag:e=>`タグの削除:${e}`,itemCount:e=>`${e}件`,closeInlineAlert:e=>`${e}アラートを閉じる`};export default translation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdstrike/glide-core",
3
- "version": "0.21.0",
3
+ "version": "0.23.0",
4
4
  "description": "A Web Component design system",
5
5
  "author": "CrowdStrike UX Team",
6
6
  "license": "Apache-2.0",
@@ -62,8 +62,8 @@
62
62
  "@changesets/cli": "^2.27.10",
63
63
  "@crowdstrike/design-tokens": "^2.0.1",
64
64
  "@custom-elements-manifest/analyzer": "^0.10.4",
65
- "@eslint/eslintrc": "^3.2.0",
66
- "@eslint/js": "^9.17.0",
65
+ "@eslint/eslintrc": "^3.3.0",
66
+ "@eslint/js": "^9.22.0",
67
67
  "@figma/rest-api-spec": "^0.24.0",
68
68
  "@open-wc/testing": "^4.0.0",
69
69
  "@playwright/test": "^1.50.1",
@@ -78,13 +78,13 @@
78
78
  "@storybook/theming": "^8.6.3",
79
79
  "@storybook/web-components": "^8.6.3",
80
80
  "@storybook/web-components-vite": "^8.6.3",
81
- "@stylistic/eslint-plugin": "^2.12.1",
81
+ "@stylistic/eslint-plugin": "^2.13.0",
82
82
  "@types/eslint": "^8.56.12",
83
83
  "@types/mocha": "^10.0.10",
84
84
  "@types/sinon": "^17.0.3",
85
- "@typescript-eslint/rule-tester": "^8.26.0",
86
- "@typescript-eslint/types": "^8.26.0",
87
- "@typescript-eslint/utils": "^8.26.0",
85
+ "@typescript-eslint/rule-tester": "^8.26.1",
86
+ "@typescript-eslint/types": "^8.26.1",
87
+ "@typescript-eslint/utils": "^8.26.1",
88
88
  "@web/dev-server-esbuild": "^1.0.4",
89
89
  "@web/dev-server-rollup": "^0.6.4",
90
90
  "@web/test-runner": "^0.19.0",
@@ -95,8 +95,8 @@
95
95
  "comment-parser": "^1.4.1",
96
96
  "custom-elements-manifest": "^2.1.0",
97
97
  "esbuild": "^0.25.0",
98
- "eslint": "^9.17.0",
99
- "eslint-config-prettier": "^10.0.1",
98
+ "eslint": "^9.22.0",
99
+ "eslint-config-prettier": "^10.1.1",
100
100
  "eslint-plugin-import": "^2.31.0",
101
101
  "eslint-plugin-lit": "^1.15.0",
102
102
  "eslint-plugin-lit-a11y": "^4.1.4",
@@ -134,7 +134,7 @@
134
134
  "ts-morph": "^25.0.1",
135
135
  "tsx": "^4.19.2",
136
136
  "typescript": "^5.8.2",
137
- "typescript-eslint": "^8.26.0",
137
+ "typescript-eslint": "^8.26.1",
138
138
  "vite": "^6.2.1",
139
139
  "vitest": "^3.0.8",
140
140
  "yocto-spinner": "^0.2.0"
@@ -151,7 +151,6 @@
151
151
  "start:development:storybook": "storybook dev --config-dir .storybook --no-open --no-version-updates --port 6006",
152
152
  "start:development:ts-morph": "chokidar ./custom-elements.json './src/ts-morph/**' --initial --silent --command 'tsx ./src/ts-morph/run.ts'",
153
153
  "start:development:ts-morph:comment:tsx": "Remove `tsx` once Node.js type stripping is available.",
154
- "start:development:ts-morph:comment:watching": "It would be helpful to also watch './custom-elements.json`. But doing so would create a loop between this script and `start:development:cem-analyze`.",
155
154
  "start:production": "rimraf ./dist && npm-run-all --aggregate-output --print-label --parallel start:production:typescript start:production:storybook start:production:esbuild",
156
155
  "start:production:esbuild": "node ./esbuild.js",
157
156
  "start:production:cem-analyze": "tsc --noCheck --outDir ./dist && NODE_OPTIONS=--no-warnings=ExperimentalWarning cem analyze --config ./custom-elements.config.js --quiet && git diff --quiet -- || { echo ERROR: Uncommitted elements manifest changes. Run this command locally and commit the changes.; exit 1; }",
package/dist/tree.d.ts DELETED
@@ -1,29 +0,0 @@
1
- import { LitElement } from 'lit';
2
- import GlideCoreTreeItem from './tree.item.js';
3
- declare global {
4
- interface HTMLElementTagNameMap {
5
- 'glide-core-tree': GlideCoreTree;
6
- }
7
- }
8
- /**
9
- * @readonly
10
- * @attr {string} [version]
11
- *
12
- * @slot {GlideCoreTreeItem}
13
- *
14
- * @method selectItem
15
- * @param {GlideCoreTreeItem} item
16
- */
17
- export default class GlideCoreTree extends LitElement {
18
- #private;
19
- static shadowRootOptions: ShadowRootInit;
20
- static styles: import("lit").CSSResult[];
21
- readonly version: string;
22
- disconnectedCallback(): void;
23
- render(): import("lit").TemplateResult<1>;
24
- selectItem(item: GlideCoreTreeItem): void;
25
- constructor();
26
- private focusedItem?;
27
- private privateTabIndex;
28
- private selectedItem?;
29
- }
@@ -1,55 +0,0 @@
1
- import { LitElement } from 'lit';
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- 'glide-core-tree-item': GlideCoreTreeItem;
5
- }
6
- }
7
- /**
8
- * @attr {string} label
9
- * @attr {boolean} [expanded=false]
10
- * @attr {number} [level=1]
11
- * @attr {boolean} [non-collapsible=false]
12
- * @attr {boolean} [remove-indentation=false]
13
- * @attr {boolean} [selected=false]
14
- *
15
- * @readonly
16
- * @attr {string} [version]
17
- *
18
- * @slot {GlideCoreTreeItem}
19
- * @slot {GlideCoreTreeItemMenu} [menu] - Visible on hover and focus
20
- * @slot {Element} [prefix] - An icon before the label
21
- * @slot {Element} [suffix] - An icon after the label
22
- *
23
- * @fires {Event} selected
24
- *
25
- * @method selectItem - Traverses down the tree, selects the item, then deselects all other items.
26
- * @param {GlideCoreTreeItem} item
27
- * @returns GlideCoreTreeItem | undefined
28
- */
29
- export default class GlideCoreTreeItem extends LitElement {
30
- #private;
31
- static shadowRootOptions: ShadowRootInit;
32
- static styles: import("lit").CSSResult[];
33
- expanded: boolean;
34
- label?: string;
35
- level: number;
36
- /**
37
- * @default false
38
- */
39
- get selected(): boolean;
40
- set selected(isSelected: boolean);
41
- removeIndentation: boolean;
42
- nonCollapsible: boolean;
43
- readonly version: string;
44
- focus(options?: FocusOptions): void;
45
- get privateHasChildTreeItems(): boolean;
46
- private get hasExpandIcon();
47
- privateToggleExpand(): void;
48
- render(): import("lit").TemplateResult<1>;
49
- /**
50
- * Traverses down the tree, selects the item, then deselects all other items.
51
- */
52
- selectItem(item: GlideCoreTreeItem): GlideCoreTreeItem | undefined;
53
- private childTreeItems;
54
- private hasPrefixIcon;
55
- }
@@ -1,22 +0,0 @@
1
- import './icon-button.js';
2
- import { LitElement } from 'lit';
3
- declare global {
4
- interface HTMLElementTagNameMap {
5
- 'glide-core-tree-item-icon-button': GlideCoreTreeItemIconButton;
6
- }
7
- }
8
- /**
9
- * @attr {string} label
10
- *
11
- * @readonly
12
- * @attr {string} [version]
13
- *
14
- * @slot {Element} - An icon
15
- */
16
- export default class GlideCoreTreeItemIconButton extends LitElement {
17
- static shadowRootOptions: ShadowRootInit;
18
- static styles: import("lit").CSSResult[];
19
- label?: string;
20
- readonly version: string;
21
- render(): import("lit").TemplateResult<1>;
22
- }
@@ -1 +0,0 @@
1
- var __decorate=this&&this.__decorate||function(e,t,o,r){var i,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(n<3?i(s):n>3?i(t,o,s):i(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};import"./icon-button.js";import{html,LitElement}from"lit";import{customElement,property}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import packageJson from"../package.json"with{type:"json"};import styles from"./tree.item.icon-button.styles.js";import assertSlot from"./library/assert-slot.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";import required from"./library/required.js";let GlideCoreTreeItemIconButton=class GlideCoreTreeItemIconButton extends LitElement{constructor(){super(...arguments),this.version=packageJson.version}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode}}static{this.styles=styles}render(){return html`<glide-core-icon-button class="component" variant="tertiary" tabindex="-1" label="${ifDefined(this.label)}"><slot ${assertSlot()}></slot></glide-core-icon-button>`}};__decorate([property(),required],GlideCoreTreeItemIconButton.prototype,"label",void 0),__decorate([property({reflect:!0})],GlideCoreTreeItemIconButton.prototype,"version",void 0),GlideCoreTreeItemIconButton=__decorate([customElement("glide-core-tree-item-icon-button"),final],GlideCoreTreeItemIconButton);export default GlideCoreTreeItemIconButton;