@crowdstrike/glide-core 0.20.4 → 0.22.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 (43) hide show
  1. package/dist/checkbox-group.js +5 -4
  2. package/dist/checkbox.js +6 -4
  3. package/dist/checkbox.styles.js +4 -0
  4. package/dist/dropdown.js +11 -10
  5. package/dist/dropdown.option.d.ts +1 -0
  6. package/dist/dropdown.option.js +1 -1
  7. package/dist/dropdown.styles.js +15 -1
  8. package/dist/icons/x.js +1 -1
  9. package/dist/input.d.ts +2 -2
  10. package/dist/input.js +10 -10
  11. package/dist/library/localize.d.ts +6 -1
  12. package/dist/menu.link.js +1 -1
  13. package/dist/modal.d.ts +3 -0
  14. package/dist/modal.js +1 -1
  15. package/dist/radio-group.js +15 -14
  16. package/dist/tag.js +1 -1
  17. package/dist/tag.styles.js +24 -21
  18. package/dist/textarea.d.ts +0 -2
  19. package/dist/textarea.js +1 -2
  20. package/dist/toasts.toast.js +1 -1
  21. package/dist/toasts.toast.styles.js +3 -1
  22. package/dist/translations/en.js +1 -1
  23. package/dist/translations/fr.d.ts +1 -1
  24. package/dist/translations/fr.js +1 -1
  25. package/dist/translations/ja.d.ts +1 -1
  26. package/dist/translations/ja.js +1 -1
  27. package/package.json +11 -12
  28. package/dist/tree.d.ts +0 -29
  29. package/dist/tree.item.d.ts +0 -55
  30. package/dist/tree.item.icon-button.d.ts +0 -22
  31. package/dist/tree.item.icon-button.js +0 -1
  32. package/dist/tree.item.icon-button.styles.d.ts +0 -2
  33. package/dist/tree.item.icon-button.styles.js +0 -9
  34. package/dist/tree.item.js +0 -1
  35. package/dist/tree.item.menu.d.ts +0 -29
  36. package/dist/tree.item.menu.js +0 -1
  37. package/dist/tree.item.menu.styles.d.ts +0 -2
  38. package/dist/tree.item.menu.styles.js +0 -17
  39. package/dist/tree.item.styles.d.ts +0 -2
  40. package/dist/tree.item.styles.js +0 -151
  41. package/dist/tree.js +0 -1
  42. package/dist/tree.styles.d.ts +0 -2
  43. package/dist/tree.styles.js +0 -7
@@ -1,9 +1,9 @@
1
- var __decorate=this&&this.__decorate||function(e,t,i,o){var a,s=arguments.length,r=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var d=e.length-1;d>=0;d--)(a=e[d])&&(r=(s<3?a(r):s>3?a(t,i,r):a(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.#o}set value(e){this.#o=e,this.updateComplete.then((()=>{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.#a.checkValidity();return this.isCheckingValidity=!1,e}disconnectedCallback(){super.disconnectedCallback(),this.form?.removeEventListener("formdata",this.#s)}firstUpdated(){if(this.disabled)for(const e of this.#t)e.disabled=!0;if(this.required)for(const e of this.#t)e.privateRequired=!0;const e=this.value?this.#t.find((({value:e})=>e===this.value)):this.#t.find((({checked:e,disabled:t})=>e&&!t));if(!this.value&&e?.value&&this.setAttribute("value",e.value),e){this.#o=e.value;for(const t of this.#t)t.tabIndex=t!==e||t.disabled?-1:0;return}const t=this.#t.find((({disabled:e})=>!e));for(const e of this.#t)e.tabIndex=e===t?0:-1}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.#a.form}get validity(){const e=this.#t.some((({checked:e})=>e));return!this.required||e||this.disabled?this.required&&this.#a.validity.valueMissing&&e?(this.#a.setValidity({}),this.#a.validity):this.required&&this.disabled&&!e?(this.#a.setValidity({valueMissing:!0}," ",this.#r.value),this.#a.validity):(this.required||!this.#a.validity.valueMissing||e||this.#a.setValidity({}),this.#a.validity):(this.#a.setValidity({customError:Boolean(this.validityMessage),valueMissing:!0}," ",this.#r.value),this.#a.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 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){this.#i=!0,t.disabled=e,this.#i=!1;const i=this.#t.find((e=>e.checked)),a=this.#t.find((e=>!e.disabled));e?t.tabIndex=-1:t===i?t.tabIndex=0:i||t!==a||(t.tabIndex=0)}}get required(){return this.#a}set required(e){this.#a=e;for(const t of this.#t)t.privateRequired=e}get value(){return this.#o}set value(e){this.#o=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.#s.checkValidity();return this.isCheckingValidity=!1,e}disconnectedCallback(){super.disconnectedCallback(),this.form?.removeEventListener("formdata",this.#r)}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.#o=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.#s.form}get validity(){const e=this.#t.some((({checked:e})=>e));return!this.required||e||this.disabled?this.required&&this.#s.validity.valueMissing&&e?(this.#s.setValidity({}),this.#s.validity):this.required&&this.disabled&&!e?(this.#s.setValidity({valueMissing:!0}," ",this.#d.value),this.#s.validity):(this.required||!this.#s.validity.valueMissing||e||this.#s.setValidity({}),this.#s.validity):(this.#s.setValidity({customError:Boolean(this.validityMessage),valueMissing:!0}," ",this.#d.value),this.#s.validity)}formAssociatedCallback(){this.form?.addEventListener("formdata",this.#r)}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.#l}
5
+ @keydown=${this.#n}
6
+ ${ref(this.#d)}
7
7
  >
8
8
  <glide-core-private-label
9
9
  label=${ifDefined(this.label)}
@@ -11,25 +11,26 @@ var __decorate=this&&this.__decorate||function(e,t,i,o){var a,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.#h}
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.#h})}
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}
27
+ @focusout=${this.#c}
28
+ @private-checked-change=${this.#u}
29
+ @private-disabled-change=${this.#p}
30
+ @private-value-change=${this.#f}
31
+ @slotchange=${this.#m}
31
32
  ${assertSlot([GlideCoreRadioGroupRadio])}
32
- ${ref(this.#f)}
33
+ ${ref(this.#b)}
33
34
  >
34
35
  <!-- @type {GlideCoreRadio} -->
35
36
  </slot>
@@ -37,7 +38,7 @@ var __decorate=this&&this.__decorate||function(e,t,i,o){var a,s=arguments.length
37
38
 
38
39
  <div id="description" slot="description">
39
40
  <slot
40
- class=${classMap({"description-slot":!0,hidden:Boolean(this.#n&&this.validityMessage)})}
41
+ class=${classMap({"description-slot":!0,hidden:Boolean(this.#h&&this.validityMessage)})}
41
42
  name="description"
42
43
  >
43
44
  <!--
@@ -46,10 +47,10 @@ var __decorate=this&&this.__decorate||function(e,t,i,o){var a,s=arguments.length
46
47
  -->
47
48
  </slot>
48
49
 
49
- ${when(this.#n&&this.validityMessage,(()=>html`<div data-test="validity-message">
50
+ ${when(this.#h&&this.validityMessage,(()=>html`<div data-test="validity-message">
50
51
  ${unsafeHTML(this.validityMessage)}
51
52
  </div>`))}
52
53
  </div>
53
54
  </glide-core-private-label>
54
55
  </div>
55
- `}reportValidity(){this.isReportValidityOrSubmit=!0;const e=this.#a.reportValidity();return this.requestUpdate(),e}resetValidityFeedback(){this.isReportValidityOrSubmit=!1}setCustomValidity(e){this.validityMessage=e,""===e?this.#a.setValidity({customError:!1},"",this.#r.value):this.#a.setValidity({customError:!0,valueMissing:this.#a.validity.valueMissing}," ",this.#r.value)}setValidity(e,t){this.validityMessage=t,this.#a.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.#f=createRef(),this.#e=!1,this.#i=!1,this.#o="",this.#s=({formData:e})=>{this.name&&this.value.length>0&&!this.disabled&&e.append(this.name,this.value)},this.#a=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;#f;#a;#e;#i;#o;#s;get#n(){const e=!this.disabled&&!this.validity.valid&&this.isReportValidityOrSubmit;for(const t of this.#t)t.privateInvalid=e;return e}#m(e){this.#t.find((({tabIndex:e})=>0===e))?.setAttribute("tabindex","-1"),this.#o=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.#m(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.#v(e.target),this.#m(t)):i&&i!==e.target&&(this.#v(e.target),this.#m(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.#v(e.target),this.#m(t)):i&&i!==e.target&&(this.#v(e.target),this.#m(i));break}case" ":if(e.preventDefault(),!e.target.disabled&&!e.target.checked){this.#m(e.target);for(const t of this.#t)t!==e.target&&this.#v(t)}}}#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.#f.value?this.#f.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.#v(t),this.#o=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&&(e.target.tabIndex=0)}#p(e){e.target instanceof GlideCoreRadioGroupRadio&&e.target.checked&&e.detail.new?this.#o=e.target.value:e.target instanceof GlideCoreRadioGroupRadio&&e.target.checked&&(this.#o="")}#v(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.#s.reportValidity();return this.requestUpdate(),e}resetValidityFeedback(){this.isReportValidityOrSubmit=!1}setCustomValidity(e){this.validityMessage=e,""===e?this.#s.setValidity({customError:!1},"",this.#d.value):this.#s.setValidity({customError:!0,valueMissing:this.#s.validity.valueMissing}," ",this.#d.value)}setValidity(e,t){this.validityMessage=t,this.#s.setValidity(e," ",this.#d.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.#d=createRef(),this.#b=createRef(),this.#e=!1,this.#i=!1,this.#a=!1,this.#o="",this.#r=({formData:e})=>{this.name&&this.value.length>0&&!this.disabled&&e.append(this.name,this.value)},this.#s=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()}}))}#d;#b;#s;#e;#i;#a;#o;#r;get#h(){const e=!this.disabled&&!this.validity.valid&&this.isReportValidityOrSubmit;for(const t of this.#t)t.privateInvalid=e;return e}#g(e){this.#t.find((({tabIndex:e})=>0===e))?.setAttribute("tabindex","-1"),this.#o=e.value,e.checked=!0,e.tabIndex=0,e.focus()}#l(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.#g(e.target)}}#n(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.#v(e.target),this.#g(t)):i&&i!==e.target&&(this.#v(e.target),this.#g(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.#v(e.target),this.#g(t)):i&&i!==e.target&&(this.#v(e.target),this.#g(i));break}case" ":if(e.preventDefault(),!e.target.disabled&&!e.target.checked){this.#g(e.target);for(const t of this.#t)t!==e.target&&this.#v(t)}}}#m(){const e=this.#t.findLast((({checked:e,disabled:t})=>e&&!t));e&&(this.#o=e.value)}#c(e){(null===e.relatedTarget||e.relatedTarget instanceof Node&&!this.contains(e.relatedTarget))&&(this.isBlurring=!0,this.reportValidity(),this.isBlurring=!1)}get#t(){return this.#b.value?this.#b.value.assignedElements().filter((e=>e instanceof GlideCoreRadioGroupRadio)):[]}#u(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.#v(t),this.#o=e.target.value,e.target.tabIndex=e.target.disabled?-1:0}}#p(e){if(this.#i)return;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)}#f(e){e.target instanceof GlideCoreRadioGroupRadio&&e.target.checked&&e.detail.new?this.#o=e.target.value:e.target instanceof GlideCoreRadioGroupRadio&&e.target.checked&&(this.#o="")}#v(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;
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
- var __decorate=this&&this.__decorate||function(e,t,o,i){var r,s=arguments.length,l=s<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 n=e.length-1;n>=0;n--)(r=e[n])&&(l=(s<3?r(l):s>3?r(t,o,l):r(t,o))||l);return s>3&&l&&Object.defineProperty(t,o,l),l};import"./icon-button.js";import{html,LitElement}from"lit";import{choose}from"lit/directives/choose.js";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property}from"lit/decorators.js";import{styleMap}from"lit/directives/style-map.js";import{LocalizeController}from"./library/localize.js";import styles from"./toasts.toast.styles.js";import xIcon from"./icons/x.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";let GlideCoreToast=class GlideCoreToast extends LitElement{constructor(){super(...arguments),this.duration=5e3,this.#e=createRef(),this.#t=new LocalizeController(this)}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode}}static{this.styles=styles}close(){this.#e.value?.addEventListener("transitionend",(()=>{this.#e.value?.classList.remove("open","closing"),this.#e.value?.classList.add("closed"),this.dispatchEvent(new Event("close",{bubbles:!0}))}),{once:!0}),this.#e.value?.classList.add("closing")}firstUpdated(){requestAnimationFrame((()=>{this.open()}))}open(){const e=Math.max(this.duration??0,5e3);e<Number.POSITIVE_INFINITY&&setTimeout((()=>{this.close()}),e),this.#e?.value?.classList?.add("open")}render(){return html`<div aria-labelledby="label description" class="${classMap({component:!0,error:"error"===this.variant,informational:"informational"===this.variant,success:"success"===this.variant})}" data-test="component" role="alert" ${ref(this.#e)}>${choose(this.variant,[["success",()=>icons.success],["error",()=>icons.error]],(()=>icons.warningInformational))}<div class="label" id="label">${this.label}</div><glide-core-icon-button class="close-button" data-test="close-button" label="${this.#t.term("close")}" variant="tertiary" @click="${this.#o}">${xIcon}</glide-core-icon-button><div class="description" id="description">${this.description}</div></div>`}#e;#t;#o(){this.close()}};__decorate([property({reflect:!0})],GlideCoreToast.prototype,"label",void 0),__decorate([property({reflect:!0})],GlideCoreToast.prototype,"description",void 0),__decorate([property({type:Number})],GlideCoreToast.prototype,"duration",void 0),__decorate([property()],GlideCoreToast.prototype,"variant",void 0),GlideCoreToast=__decorate([customElement("glide-core-toast"),final],GlideCoreToast);export default GlideCoreToast;const icons={error:html`<svg aria-hidden="true" class="icon error" fill="none" viewBox="0 0 20 20" style="${styleMap({height:"1.25rem",width:"1.25rem"})}"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99998 0.833328C4.93737 0.833328 0.833313 4.93738 0.833313 9.99999C0.833313 15.0626 4.93737 19.1667 9.99998 19.1667C15.0626 19.1667 19.1666 15.0626 19.1666 9.99999C19.1666 4.93738 15.0626 0.833328 9.99998 0.833328ZM13.0892 6.91074C13.4147 7.23618 13.4147 7.76381 13.0892 8.08925L11.1785 9.99999L13.0892 11.9107C13.4147 12.2362 13.4147 12.7638 13.0892 13.0892C12.7638 13.4147 12.2362 13.4147 11.9107 13.0892L9.99998 11.1785L8.08923 13.0892C7.7638 13.4147 7.23616 13.4147 6.91072 13.0892C6.58529 12.7638 6.58529 12.2362 6.91072 11.9107L8.82147 9.99999L6.91072 8.08925C6.58529 7.76381 6.58529 7.23618 6.91072 6.91074C7.23616 6.5853 7.7638 6.5853 8.08923 6.91074L9.99998 8.82148L11.9107 6.91074C12.2362 6.5853 12.7638 6.5853 13.0892 6.91074Z" fill="currentColor"/></svg>`,success:html`<svg aria-hidden="true" class="icon success" fill="none" viewBox="0 0 20 20" style="${styleMap({height:"1.25rem",width:"1.25rem"})}"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99999 0.833336C4.93738 0.833336 0.833328 4.93739 0.833328 10C0.833328 15.0626 4.93738 19.1667 9.99999 19.1667C15.0626 19.1667 19.1667 15.0626 19.1667 10C19.1667 4.93739 15.0626 0.833336 9.99999 0.833336ZM14.3392 8.08926C14.6647 7.76382 14.6647 7.23618 14.3392 6.91075C14.0138 6.58531 13.4862 6.58531 13.1607 6.91075L8.74999 11.3215L6.83925 9.41075C6.51381 9.08531 5.98618 9.08531 5.66074 9.41075C5.3353 9.73618 5.3353 10.2638 5.66074 10.5893L8.16074 13.0893C8.48618 13.4147 9.01381 13.4147 9.33925 13.0893L14.3392 8.08926Z" fill="currentColor"/></svg>`,warningInformational:html`<svg aria-hidden="true" class="icon warning-informational" fill="none" viewBox="0 0 20 20" style="${styleMap({height:"1.25rem",width:"1.25rem"})}"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99999 0.833328C4.93738 0.833328 0.833328 4.93738 0.833328 9.99999C0.833328 15.0626 4.93738 19.1667 9.99999 19.1667C15.0626 19.1667 19.1667 15.0626 19.1667 9.99999C19.1667 4.93738 15.0626 0.833328 9.99999 0.833328ZM10.8333 6.66666C10.8333 6.20642 10.4602 5.83333 9.99999 5.83333C9.53976 5.83333 9.16666 6.20642 9.16666 6.66666V9.99999C9.16666 10.4602 9.53976 10.8333 9.99999 10.8333C10.4602 10.8333 10.8333 10.4602 10.8333 9.99999V6.66666ZM9.99999 12.5C9.53976 12.5 9.16666 12.8731 9.16666 13.3333C9.16666 13.7936 9.53976 14.1667 9.99999 14.1667H10.0083C10.4686 14.1667 10.8417 13.7936 10.8417 13.3333C10.8417 12.8731 10.4686 12.5 10.0083 12.5H9.99999Z" fill="currentColor"/></svg>`};
1
+ var __decorate=this&&this.__decorate||function(e,t,o,i){var r,s=arguments.length,l=s<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 n=e.length-1;n>=0;n--)(r=e[n])&&(l=(s<3?r(l):s>3?r(t,o,l):r(t,o))||l);return s>3&&l&&Object.defineProperty(t,o,l),l};import"./icon-button.js";import{html,LitElement}from"lit";import{choose}from"lit/directives/choose.js";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property}from"lit/decorators.js";import{styleMap}from"lit/directives/style-map.js";import{LocalizeController}from"./library/localize.js";import styles from"./toasts.toast.styles.js";import xIcon from"./icons/x.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";let GlideCoreToast=class GlideCoreToast extends LitElement{constructor(){super(...arguments),this.duration=5e3,this.#e=createRef(),this.#t=new LocalizeController(this)}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode}}static{this.styles=styles}close(){this.#e.value?.addEventListener("transitionend",(()=>{this.#e.value?.classList.remove("open","closing"),this.#e.value?.classList.add("closed"),this.dispatchEvent(new Event("close",{bubbles:!0}))}),{once:!0}),this.#e.value?.classList.add("closing")}firstUpdated(){requestAnimationFrame((()=>{this.open()}))}open(){const e=Math.max(this.duration??0,5e3);e<Number.POSITIVE_INFINITY&&setTimeout((()=>{this.close()}),e),this.#e?.value?.classList?.add("open")}render(){return html`<div aria-labelledby="prefix label description" class="${classMap({component:!0,error:"error"===this.variant,informational:"informational"===this.variant,success:"success"===this.variant})}" data-test="component" role="alert" ${ref(this.#e)}><span class="prefix" id="prefix">${this.#t.term(this.variant)} </span>${choose(this.variant,[["success",()=>icons.success],["error",()=>icons.error]],(()=>icons.warningInformational))}<div class="label" id="label">${this.label}</div><glide-core-icon-button class="close-button" data-test="close-button" label="${this.#t.term("close")}" variant="tertiary" @click="${this.#o}">${xIcon}</glide-core-icon-button><div class="description" id="description">${this.description}</div></div>`}#e;#t;#o(){this.close()}};__decorate([property({reflect:!0})],GlideCoreToast.prototype,"label",void 0),__decorate([property({reflect:!0})],GlideCoreToast.prototype,"description",void 0),__decorate([property({type:Number})],GlideCoreToast.prototype,"duration",void 0),__decorate([property()],GlideCoreToast.prototype,"variant",void 0),GlideCoreToast=__decorate([customElement("glide-core-toast"),final],GlideCoreToast);export default GlideCoreToast;const icons={error:html`<svg aria-hidden="true" class="icon error" fill="none" viewBox="0 0 20 20" style="${styleMap({height:"1.25rem",width:"1.25rem"})}"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99998 0.833328C4.93737 0.833328 0.833313 4.93738 0.833313 9.99999C0.833313 15.0626 4.93737 19.1667 9.99998 19.1667C15.0626 19.1667 19.1666 15.0626 19.1666 9.99999C19.1666 4.93738 15.0626 0.833328 9.99998 0.833328ZM13.0892 6.91074C13.4147 7.23618 13.4147 7.76381 13.0892 8.08925L11.1785 9.99999L13.0892 11.9107C13.4147 12.2362 13.4147 12.7638 13.0892 13.0892C12.7638 13.4147 12.2362 13.4147 11.9107 13.0892L9.99998 11.1785L8.08923 13.0892C7.7638 13.4147 7.23616 13.4147 6.91072 13.0892C6.58529 12.7638 6.58529 12.2362 6.91072 11.9107L8.82147 9.99999L6.91072 8.08925C6.58529 7.76381 6.58529 7.23618 6.91072 6.91074C7.23616 6.5853 7.7638 6.5853 8.08923 6.91074L9.99998 8.82148L11.9107 6.91074C12.2362 6.5853 12.7638 6.5853 13.0892 6.91074Z" fill="currentColor"/></svg>`,success:html`<svg aria-hidden="true" class="icon success" fill="none" viewBox="0 0 20 20" style="${styleMap({height:"1.25rem",width:"1.25rem"})}"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99999 0.833336C4.93738 0.833336 0.833328 4.93739 0.833328 10C0.833328 15.0626 4.93738 19.1667 9.99999 19.1667C15.0626 19.1667 19.1667 15.0626 19.1667 10C19.1667 4.93739 15.0626 0.833336 9.99999 0.833336ZM14.3392 8.08926C14.6647 7.76382 14.6647 7.23618 14.3392 6.91075C14.0138 6.58531 13.4862 6.58531 13.1607 6.91075L8.74999 11.3215L6.83925 9.41075C6.51381 9.08531 5.98618 9.08531 5.66074 9.41075C5.3353 9.73618 5.3353 10.2638 5.66074 10.5893L8.16074 13.0893C8.48618 13.4147 9.01381 13.4147 9.33925 13.0893L14.3392 8.08926Z" fill="currentColor"/></svg>`,warningInformational:html`<svg aria-hidden="true" class="icon warning-informational" fill="none" viewBox="0 0 20 20" style="${styleMap({height:"1.25rem",width:"1.25rem"})}"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99999 0.833328C4.93738 0.833328 0.833328 4.93738 0.833328 9.99999C0.833328 15.0626 4.93738 19.1667 9.99999 19.1667C15.0626 19.1667 19.1667 15.0626 19.1667 9.99999C19.1667 4.93738 15.0626 0.833328 9.99999 0.833328ZM10.8333 6.66666C10.8333 6.20642 10.4602 5.83333 9.99999 5.83333C9.53976 5.83333 9.16666 6.20642 9.16666 6.66666V9.99999C9.16666 10.4602 9.53976 10.8333 9.99999 10.8333C10.4602 10.8333 10.8333 10.4602 10.8333 9.99999V6.66666ZM9.99999 12.5C9.53976 12.5 9.16666 12.8731 9.16666 13.3333C9.16666 13.7936 9.53976 14.1667 9.99999 14.1667H10.0083C10.4686 14.1667 10.8417 13.7936 10.8417 13.3333C10.8417 12.8731 10.4686 12.5 10.0083 12.5H9.99999Z" fill="currentColor"/></svg>`};
@@ -1,4 +1,6 @@
1
- import{css}from"lit";export default[css`
1
+ import{css}from"lit";import visuallyHidden from"./styles/visually-hidden.js";export default[css`
2
+ ${visuallyHidden(".prefix")}
3
+ `,css`
2
4
  .component {
3
5
  align-items: center;
4
6
  border-radius: var(--glide-core-spacing-sm);
@@ -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:",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,5 +1,5 @@
1
1
  import type { Translation } from '../library/localize.js';
2
- export declare const PENDING_STRINGS: readonly [];
2
+ export declare const PENDING_STRINGS: readonly ["severityInformational", "severityCritical", "severityMedium", "success", "error", "informational"];
3
3
  type PendingTranslation = (typeof PENDING_STRINGS)[number];
4
4
  declare const translation: Omit<Translation, PendingTranslation>;
5
5
  export default translation;
@@ -1 +1 @@
1
- export const PENDING_STRINGS=[];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,5 +1,5 @@
1
1
  import type { Translation } from '../library/localize.js';
2
- export declare const PENDING_STRINGS: readonly [];
2
+ export declare const PENDING_STRINGS: readonly ["severityInformational", "severityCritical", "severityMedium", "success", "error", "informational"];
3
3
  type PendingTranslation = (typeof PENDING_STRINGS)[number];
4
4
  declare const translation: Omit<Translation, PendingTranslation>;
5
5
  export default translation;
@@ -1 +1 @@
1
- export const PENDING_STRINGS=[];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.20.4",
3
+ "version": "0.22.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; }",
@@ -174,7 +173,7 @@
174
173
  "test": "per-env",
175
174
  "test:development": "npm-run-all --parallel test:development:web-test-runner test:development:web-test-runner:serve-coverage",
176
175
  "test:development:playwright": "playwright test --quiet --ui-port 6007 --update-snapshots",
177
- "test:development:playwright:update": "rimraf ./src/aria-snapshots && playwright test --quiet --project aria --update-snapshots",
176
+ "test:development:playwright:update": "rimraf ./src/aria-snapshots && playwright test --quiet --project aria --update-snapshots --workers 100%",
178
177
  "test:development:vitest": "vitest --config ./vitest.config.js & chokidar './src/eslint/**' './src/stylelint/**' --ignore './src/eslint/rules/*.test.ts' './src/stylelint/*.test.ts' --initial --silent --command 'tsc --noCheck --outDir ./dist'",
179
178
  "test:development:vitest:comment": "Excluded from `test:development` because Vitest muddies the console when running alongside Web Test Runner.",
180
179
  "test:development:web-test-runner": "web-test-runner --watch",
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;
@@ -1,2 +0,0 @@
1
- declare const _default: import("lit").CSSResult[];
2
- export default _default;
@@ -1,9 +0,0 @@
1
- import{css}from"lit";export default[css`
2
- .component {
3
- display: flex;
4
-
5
- --private-icon-color: var(--private-icon-button-color);
6
- --private-hovered-icon-color: var(--private-hovered-icon-button-color);
7
- --private-size: 1rem;
8
- }
9
- `];
package/dist/tree.item.js DELETED
@@ -1 +0,0 @@
1
- var _a,GlideCoreTreeItem_1,__decorate=this&&this.__decorate||function(e,t,o,i){var r,s=arguments.length,l=s<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 n=e.length-1;n>=0;n--)(r=e[n])&&(l=(s<3?r(l):s>3?r(t,o,l):r(t,o))||l);return s>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,state}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import{styleMap}from"lit/directives/style-map.js";import{when}from"lit/directives/when.js";import packageJson from"../package.json"with{type:"json"};import{LocalizeController}from"./library/localize.js";import GlideCoreTreeItemMenu from"./tree.item.menu.js";import GlideCoreIconButton from"./icon-button.js";import chevronIcon from"./icons/chevron.js";import styles from"./tree.item.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 GlideCoreTreeItem=class GlideCoreTreeItem extends LitElement{constructor(){super(...arguments),this.expanded=!1,this.level=1,this.removeIndentation=!1,this.nonCollapsible=!1,this.version=packageJson.version,this.childTreeItems=[],this.hasPrefixIcon=!1,this.#e=createRef(),this.#t=!1,this.#o=createRef(),this.#i=new LocalizeController(this),this.#r=createRef(),this.#s=createRef()}static{GlideCoreTreeItem_1=this}static{this.shadowRootOptions={...LitElement.shadowRootOptions,delegatesFocus:!0,mode:shadowRootMode}}static{this.styles=styles}get selected(){return this.#t}set selected(e){const t=e!==this.#t;this.#t=e,e&&t&&this.dispatchEvent(new Event("selected",{bubbles:!0,composed:!0}))}focus(e){this.#o.value?.focus(e),this.#l(0)}get privateHasChildTreeItems(){return this.childTreeItems.length>0}get hasExpandIcon(){return this.privateHasChildTreeItems&&!this.nonCollapsible}privateToggleExpand(){this.expanded=!this.expanded}render(){return html`<div aria-label="${ifDefined(this.label)}" aria-selected="${ifDefined(this.#n)}" aria-expanded="${ifDefined(this.#a)}" class="${classMap({component:!0,expanded:this.expanded,selected:this.selected})}" data-test="component" role="treeitem"><div class="${classMap({"label-container":!0,"prefix-icon":this.hasPrefixIcon,selected:this.selected})}" tabindex="-1" @focusout="${this.#d}" @focusin="${this.#c}" ${ref(this.#o)}><div style="${styleMap({flexShrink:0,width:this.#m})}"></div>${when(!this.removeIndentation||this.hasExpandIcon,(()=>html`<div class="${classMap({"expand-icon-container":!0,expanded:this.expanded})}" data-test="expand-icon-container">${when(this.hasExpandIcon,(()=>chevronIcon))}</div>`))}<slot name="prefix" class="prefix-slot" ${ref(this.#s)} @slotchange="${this.#h}"></slot><div class="${classMap({label:!0,"prefix-icon":this.hasPrefixIcon})}">${this.label}</div><div class="icon-container"><slot name="menu" ${ref(this.#r)} @slotchange="${this.#p}" ${assertSlot([GlideCoreTreeItemMenu],!0)}></slot><slot name="suffix"></slot></div></div><div class="${classMap({"default-slot-container":!0,expanded:this.expanded})}" role="group"><slot @slotchange="${this.#f}" ${ref(this.#e)}></slot></div></div>`}selectItem(e){let t;if(this.#u)for(const o of this.#u)if(e===o)o.setAttribute("selected","true"),t=o;else{o.removeAttribute("selected");const i=o.selectItem(e);i&&(t=i)}return t}#e;#t;#o;#i;#r;#s;get#u(){return this.#e.value?.assignedElements().filter((e=>e instanceof GlideCoreTreeItem_1))}get#a(){return this.privateHasChildTreeItems?this.expanded?"true":"false":void 0}get#n(){return this.privateHasChildTreeItems?void 0:this.selected?"true":"false"}get#m(){return 20*(this.level-1)+"px"}#v(e){return e&&e instanceof HTMLElement&&!(e instanceof GlideCoreTreeItem_1)&&this.contains(e)}#f(){this.#I()}#c(e){this.#v(e.target)&&e.stopPropagation()}#d(e){this.#v(e.relatedTarget)?e.stopPropagation():this.#l(-1)}#p(){if(this.#r.value)for(const e of this.#r.value.assignedElements())e instanceof GlideCoreTreeItemMenu&&this.label&&(e.label=this.#i.term("actionsFor",this.label))}#h(){const e=this.#s.value?.assignedNodes();this.hasPrefixIcon=Boolean(e&&e.length>0)}#l(e){this.#o.value&&(this.#o.value.tabIndex=e);for(const t of this.querySelectorAll("& > glide-core-tree-item-icon-button"))t.tabIndex=e}#I(){const e=[];if(this.#u){for(const t of this.#u)t.level=this.level+1,e.push(t);this.childTreeItems=e}}};__decorate([property({reflect:!0,type:Boolean})],GlideCoreTreeItem.prototype,"expanded",void 0),__decorate([property({reflect:!0}),required],GlideCoreTreeItem.prototype,"label",void 0),__decorate([property({reflect:!0,type:Number})],GlideCoreTreeItem.prototype,"level",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreTreeItem.prototype,"selected",null),__decorate([property({reflect:!0,type:Boolean,attribute:"remove-indentation"})],GlideCoreTreeItem.prototype,"removeIndentation",void 0),__decorate([property({reflect:!0,type:Boolean,attribute:"non-collapsible"})],GlideCoreTreeItem.prototype,"nonCollapsible",void 0),__decorate([property({reflect:!0})],GlideCoreTreeItem.prototype,"version",void 0),__decorate([state()],GlideCoreTreeItem.prototype,"childTreeItems",void 0),__decorate([state()],GlideCoreTreeItem.prototype,"hasPrefixIcon",void 0),GlideCoreTreeItem=GlideCoreTreeItem_1=__decorate([customElement("glide-core-tree-item"),final],GlideCoreTreeItem);export default GlideCoreTreeItem;
@@ -1,29 +0,0 @@
1
- import './menu.js';
2
- import './menu.options.js';
3
- import { LitElement } from 'lit';
4
- declare global {
5
- interface HTMLElementTagNameMap {
6
- 'glide-core-tree-item-menu': GlideCoreTreeItemMenu;
7
- }
8
- }
9
- /**
10
- * @attr {string} [label]
11
- * @attr {'bottom-start'|'top-start'} [placement='bottom-start']
12
- *
13
- * @readonly
14
- * @attr {string} [version]
15
- *
16
- * @slot {GlideCoreMenuButton | GlideCoreMenuLink}
17
- * @slot {Element} [icon]
18
- */
19
- export default class GlideCoreTreeItemMenu extends LitElement {
20
- #private;
21
- static shadowRootOptions: ShadowRootInit;
22
- static styles: import("lit").CSSResult[];
23
- placement: 'bottom-start' | 'top-start';
24
- label?: string;
25
- readonly version: string;
26
- click(): void;
27
- render(): import("lit").TemplateResult<1>;
28
- private hasCustomIcon;
29
- }
@@ -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"./menu.js";import"./menu.options.js";import{html,LitElement}from"lit";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property,state}from"lit/decorators.js";import{styleMap}from"lit/directives/style-map.js";import{when}from"lit/directives/when.js";import{ifDefined}from"lit/directives/if-defined.js";import packageJson from"../package.json"with{type:"json"};import styles from"./tree.item.menu.styles.js";import GlideCoreIconButton from"./icon-button.js";import GlideCoreMenuLink from"./menu.link.js";import GlideCoreMenuButton from"./menu.button.js";import assertSlot from"./library/assert-slot.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";let GlideCoreTreeItemMenu=class GlideCoreTreeItemMenu extends LitElement{constructor(){super(...arguments),this.placement="bottom-start",this.version=packageJson.version,this.hasCustomIcon=!1,this.#e=createRef(),this.#t=createRef(),this.#o=createRef()}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode}}static{this.styles=styles}click(){this.#e.value?.click()}render(){return html`<glide-core-menu class="component" placement="${this.placement}" ${ref(this.#o)}><glide-core-menu-options><slot ${assertSlot([GlideCoreMenuButton,GlideCoreMenuLink])}></slot></glide-core-menu-options><glide-core-icon-button data-test="icon-button" slot="target" variant="tertiary" label="${ifDefined(this.label)}" ${ref(this.#e)}><slot name="icon" @slotchange="${this.#r}" ${ref(this.#t)}></slot>${when(!this.hasCustomIcon,(()=>icons.dots))}</glide-core-icon-button></glide-core-menu>`}#e;#t;#o;#r(){const e=this.#t.value?.assignedNodes();this.hasCustomIcon=Boolean(e&&e.length>0)}};__decorate([property({reflect:!0})],GlideCoreTreeItemMenu.prototype,"placement",void 0),__decorate([property()],GlideCoreTreeItemMenu.prototype,"label",void 0),__decorate([property({reflect:!0})],GlideCoreTreeItemMenu.prototype,"version",void 0),__decorate([state()],GlideCoreTreeItemMenu.prototype,"hasCustomIcon",void 0),GlideCoreTreeItemMenu=__decorate([customElement("glide-core-tree-item-menu"),final],GlideCoreTreeItemMenu);export default GlideCoreTreeItemMenu;const icons={dots:html`<svg aria-hidden="true" style="${styleMap({height:"0.875rem",width:"0.25rem"})}" viewBox="0 0 4 18" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 15C2.55228 15 3 15.4477 3 16C3 16.5523 2.55228 17 2 17C1.44772 17 1 16.5523 1 16C1 15.4477 1.44772 15 2 15Z"/><path d="M2 8C2.55228 8 3 8.44772 3 9C3 9.55228 2.55228 10 2 10C1.44772 10 1 9.55228 1 9C1 8.44772 1.44772 8 2 8Z"/><path d="M2 1C2.55228 1 3 1.44772 3 2C3 2.55228 2.55228 3 2 3C1.44772 3 1 2.55228 1 2C1 1.44772 1.44772 1 2 1Z"/></svg>`};
@@ -1,2 +0,0 @@
1
- declare const _default: import("lit").CSSResult[];
2
- export default _default;
@@ -1,17 +0,0 @@
1
- import{css}from"lit";export default[css`
2
- :host {
3
- display: contents;
4
- }
5
-
6
- .component {
7
- display: flex;
8
- }
9
-
10
- glide-core-icon-button {
11
- display: flex;
12
-
13
- --private-icon-color: var(--private-icon-button-color);
14
- --private-hovered-icon-color: var(--private-hovered-icon-button-color);
15
- --private-size: 1rem;
16
- }
17
- `];
@@ -1,2 +0,0 @@
1
- declare const _default: import("lit").CSSResult[];
2
- export default _default;