@crowdstrike/glide-core 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/drawer.styles.js
CHANGED
@@ -23,11 +23,11 @@ export default class GlideCoreDropdownOption extends LitElement {
|
|
23
23
|
privateIsFocusable: boolean;
|
24
24
|
private get isMultiple();
|
25
25
|
click(): void;
|
26
|
+
connectedCallback(): void;
|
26
27
|
firstUpdated(): void;
|
27
28
|
get value(): string;
|
28
29
|
set value(value: string);
|
29
30
|
focus(): void;
|
30
31
|
privateUpdateCheckbox(): Promise<void>;
|
31
32
|
render(): import("lit").TemplateResult<1>;
|
32
|
-
constructor();
|
33
33
|
}
|
package/dist/dropdown.option.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var L=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var c=(i,t,e,a)=>{for(var o=a>1?void 0:a?T(t,e):t,$=i.length-1,x;$>=0;$--)(x=i[$])&&(o=(a?x(t,e,o):x(o))||o);return a&&o&&L(t,e,o),o};var E=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var s=(i,t,e)=>(E(i,t,"read from private field"),e?e.call(i):t.get(i)),h=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},M=(i,t,e,a)=>(E(i,t,"write to private field"),a?a.call(i,e):t.set(i,e),e);var y=(i,t,e)=>(E(i,t,"access private method"),e);var r,n,f,v,u,b,A,g,U,k,F;import{LitElement as R,html as I}from"lit";import{classMap as m}from"lit/directives/class-map.js";import{createRef as z,ref as S}from"lit/directives/ref.js";import{customElement as B,property as d,state as p}from"lit/decorators.js";import{when as H}from"lit/directives/when.js";import"./checkbox.js";import q from"./icons/checked.js";import w from"./dropdown.option.styles.js";let l=class extends R{constructor(){super(...arguments);h(this,b);h(this,g);h(this,k);this.privateMultiple=!1;this.privateSize="large";this.privateActive=!1;this.privateIndeterminate=!1;this.privateIsFocusable=!0;h(this,r,z());h(this,n,z());h(this,f,window.crypto.randomUUID());h(this,v,!1);h(this,u,"")}get selected(){return s(this,v)}set selected(e){if(M(this,v,e),this.isMultiple)s(this,r).value&&(s(this,r).value.checked=e);else for(const a of s(this,b,A))a!==this&&this.selected&&a.selected&&(a.selected=!1);this.dispatchEvent(new Event("private-selected-change",{bubbles:!0}))}get isMultiple(){return this.privateMultiple||this.closest("glide-core-dropdown")?.multiple}click(){this.isMultiple?this.selected=!this.selected:this.selected||(this.selected=!0)}connectedCallback(){super.connectedCallback(),this.id=s(this,f)}firstUpdated(){s(this,r).value&&(s(this,r).value.checked=this.selected)}get value(){return s(this,u)}set value(e){const a=s(this,u);M(this,u,e),this.dispatchEvent(new CustomEvent("private-value-change",{bubbles:!0,detail:a}))}focus(){s(this,n).value?.focus()}async privateUpdateCheckbox(){await this.updateComplete,s(this,r).value&&(s(this,r).value.checked=this.selected)}render(){return I`<div aria-selected="${this.selected?"true":"false"}" class="${m({component:!0,active:this.privateActive,[this.privateSize]:!0})}" data-test="component" tabindex="${this.privateActive&&this.privateIsFocusable?"0":"-1"}" role="option" @click="${y(this,k,F)}" ${S(s(this,n))}>${H(this.isMultiple,()=>I`<glide-core-checkbox class="${m({checkbox:!0,[this.privateSize]:!0})}" data-test="checkbox" label="${this.label??""}" tabindex="-1" private-variant="minimal" value="${this.value}" ?indeterminate="${this.privateIndeterminate}" ?internally-inert="${!this.privateIsFocusable}" @change="${y(this,g,U)}" ${S(s(this,r))}></glide-core-checkbox>`,()=>I`<div class="${m({option:!0,[this.privateSize]:!0})}"><div class="${m({"checked-icon":!0,visible:this.selected})}">${q}</div><slot name="icon"></slot>${this.label}</div>`)}</div>`}};r=new WeakMap,n=new WeakMap,f=new WeakMap,v=new WeakMap,u=new WeakMap,b=new WeakSet,A=function(){return[...this.closest("glide-core-dropdown")?.querySelectorAll("glide-core-dropdown-option")??[]]},g=new WeakSet,U=function(){this.selected=!this.selected},k=new WeakSet,F=function(e){e.target!==s(this,r).value&&!this.isMultiple&&!this.selected&&(this.selected=!0)},l.shadowRootOptions={...R.shadowRootOptions,mode:"closed"},l.styles=w,c([d({reflect:!0})],l.prototype,"label",2),c([d({attribute:"private-multiple",type:Boolean})],l.prototype,"privateMultiple",2),c([d({type:Boolean})],l.prototype,"selected",1),c([d({attribute:"private-size",reflect:!0})],l.prototype,"privateSize",2),c([p()],l.prototype,"privateActive",2),c([p()],l.prototype,"privateIndeterminate",2),c([p()],l.prototype,"privateIsFocusable",2),c([p()],l.prototype,"isMultiple",1),c([d()],l.prototype,"value",1),l=c([B("glide-core-dropdown-option")],l);export{l as default};
|
package/dist/dropdown.styles.js
CHANGED
@@ -83,9 +83,9 @@
|
|
83
83
|
visibility: hidden;
|
84
84
|
|
85
85
|
/*
|
86
|
-
".
|
87
|
-
This ensures
|
88
|
-
|
86
|
+
".dropdown-and-options" is relative and many Dropdowns may be stacked in a column.
|
87
|
+
This ensures the ".options" of Dropdowns earlier in the column aren't obscured by
|
88
|
+
the ".dropdown-and-options" that come later.
|
89
89
|
*/
|
90
90
|
z-index: 1;
|
91
91
|
|
package/dist/menu.styles.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";import{css as
|
1
|
+
"use strict";import{css as e}from"lit";export default[e`
|
2
2
|
:host {
|
3
3
|
/* Contains elements with "padding", "margin", and "width". Inline by default. */
|
4
4
|
display: inline-block;
|
@@ -15,8 +15,8 @@
|
|
15
15
|
}
|
16
16
|
|
17
17
|
.options {
|
18
|
-
background-color: var(--glide-core-surface-
|
19
|
-
border: 1px solid var(--glide-core-
|
18
|
+
background-color: var(--glide-core-surface-modal);
|
19
|
+
border: 1px solid var(--glide-core-surface-modal);
|
20
20
|
border-radius: var(--glide-core-spacing-xs);
|
21
21
|
box-shadow: var(--glide-core-shadow-lg);
|
22
22
|
box-sizing: border-box;
|
@@ -29,6 +29,13 @@
|
|
29
29
|
position: absolute;
|
30
30
|
visibility: hidden;
|
31
31
|
|
32
|
+
/*
|
33
|
+
".target-container" is relative and many Menus may be stacked in a column.
|
34
|
+
This ensures the ".options" of Menus earlier in the column aren't obscured
|
35
|
+
by the ".target-container" that come later.
|
36
|
+
*/
|
37
|
+
z-index: 1;
|
38
|
+
|
32
39
|
&.visible {
|
33
40
|
visibility: visible;
|
34
41
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@crowdstrike/glide-core",
|
3
|
-
"version": "0.5.
|
3
|
+
"version": "0.5.1",
|
4
4
|
"description": "CrowdStrike's Glide Design System components package for providing web components",
|
5
5
|
"author": "CrowdStrike UX Team",
|
6
6
|
"license": "Apache-2.0",
|
@@ -29,8 +29,8 @@
|
|
29
29
|
"./styles/*": null,
|
30
30
|
"./label.js": null,
|
31
31
|
"./toasts.toast.js": null,
|
32
|
-
"./styles/fonts.
|
33
|
-
"./styles/variables.
|
32
|
+
"./styles/fonts.css": "./dist/styles/fonts.css",
|
33
|
+
"./styles/variables.css": "./dist/styles/variables.css"
|
34
34
|
},
|
35
35
|
"engines": {
|
36
36
|
"node": ">= 20",
|