@crowdstrike/glide-core 0.22.0 → 0.24.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.
- package/dist/accordion.styles.js +22 -21
- package/dist/button-group.button.styles.js +46 -22
- package/dist/button-group.styles.js +7 -7
- package/dist/button.d.ts +3 -0
- package/dist/button.js +1 -1
- package/dist/button.styles.js +62 -42
- package/dist/checkbox-group.js +6 -5
- package/dist/checkbox-group.styles.js +5 -5
- package/dist/checkbox.d.ts +10 -2
- package/dist/checkbox.js +23 -17
- package/dist/checkbox.styles.js +46 -28
- package/dist/drawer.styles.js +6 -4
- package/dist/dropdown.d.ts +1 -1
- package/dist/dropdown.js +20 -18
- package/dist/dropdown.option.js +1 -1
- package/dist/dropdown.option.styles.js +26 -28
- package/dist/dropdown.styles.js +64 -58
- package/dist/icon-button.styles.js +44 -23
- package/dist/inline-alert.js +1 -1
- package/dist/inline-alert.styles.js +24 -21
- package/dist/input.styles.js +33 -25
- package/dist/label.styles.js +22 -27
- package/dist/menu.button.styles.js +6 -4
- package/dist/menu.js +1 -1
- package/dist/menu.link.styles.js +6 -4
- package/dist/menu.options.styles.js +12 -16
- package/dist/menu.styles.js +9 -6
- package/dist/modal.styles.js +16 -13
- package/dist/popover.js +1 -1
- package/dist/popover.styles.js +14 -14
- package/dist/radio-group.js +15 -15
- package/dist/radio-group.radio.d.ts +2 -1
- package/dist/radio-group.radio.js +1 -1
- package/dist/radio-group.radio.styles.js +31 -11
- package/dist/radio-group.styles.js +8 -10
- package/dist/split-button.primary-button.styles.js +41 -26
- package/dist/split-button.secondary-button.styles.js +61 -21
- package/dist/styles/focus-outline.js +1 -1
- package/dist/styles/variables.css +1 -1
- package/dist/tab.group.styles.js +6 -5
- package/dist/tab.panel.styles.js +1 -1
- package/dist/tab.styles.js +8 -7
- package/dist/tag.styles.js +27 -26
- package/dist/textarea.styles.js +22 -18
- package/dist/toasts.styles.js +2 -2
- package/dist/toasts.toast.styles.js +20 -20
- package/dist/toggle.styles.js +15 -7
- package/dist/tooltip.container.styles.js +14 -13
- package/dist/tooltip.js +1 -1
- package/dist/tooltip.styles.js +1 -1
- package/package.json +8 -9
- package/dist/library/get-parent-class-name.d.ts +0 -3
- package/dist/library/get-parent-class-name.js +0 -1
package/dist/popover.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var __decorate=this&&this.__decorate||function(e,t,o,r){var i,l=arguments.length,a=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(l<3?i(a):l>3?i(t,o,a):i(t,o))||a);return l>3&&a&&Object.defineProperty(t,o,a),a};import{html,LitElement}from"lit";import{arrow,autoUpdate,computePosition,flip,limitShift,offset,shift}from"@floating-ui/dom";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,state}from"lit/decorators.js";import packageJson from"../package.json"with{type:"json"};import styles from"./popover.styles.js";import assertSlot from"./library/assert-slot.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";let GlideCorePopover=class GlideCorePopover extends LitElement{constructor(){super(...arguments),this.version=packageJson.version,this.effectivePlacement=this.placement??"bottom",this.#e=createRef(),this.#t=createRef(),this.#o=!1,this.#r=!1,this.#i=!1,this.#l=!1,this.#a=!1,this.#s=createRef(),this.#n=createRef(),this.#p=()=>{this.#r||this.#a||this.#o?setTimeout((()=>{this.#r=!1,this.#a=!1,this.#o=!1})):this.open=!1}}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode}}static{this.styles=styles}get disabled(){return this.#i}set disabled(e){this.#i=e,this.open&&!e?this.#f():this.#d()}get offset(){return this.#m??Number.parseFloat(window.getComputedStyle(document.body).getPropertyValue("--glide-core-spacing-xxs"))*Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize)}set offset(e){this.#m=e}get open(){return this.#l}set open(e){const t=e!==this.#l;this.#l=e,e&&t&&!this.disabled?(this.#f(),this.dispatchEvent(new Event("toggle",{bubbles:!0,composed:!0}))):t&&(this.#d(),this.dispatchEvent(new Event("toggle",{bubbles:!0,composed:!0})))}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#p,{capture:!0})}firstUpdated(){this.#s.value&&(this.#s.value.popover="manual"),this.open&&!this.disabled&&this.#f(),this.#t.value?.addEventListener("mouseup",(()=>{this.#r=!0})),this.#n.value?.addEventListener("mouseup",(()=>{this.#a=!0})),this.#e.value?.addEventListener("mouseup",(()=>{this.#o=!0})),this.#n.value?.addEventListener("keydown",(e=>{"Enter"!==e.key&&" "!==e.key||(this.#a=!0)}))}render(){return html`<div class="component"><slot class="target-slot" data-test="target-slot" name="target" @click="${this.#h}" @keydown="${this.#c}" ${assertSlot([Element])} ${ref(this.#n)}></slot><div class="${classMap({popover:!0,[this.effectivePlacement]:!0})}" id="popover" data-test="popover" ${ref(this.#s)}><div class="${classMap({arrow:!0,[this.effectivePlacement]:!0})}" data-test="arrow" ${ref(this.#e)}>${choose(this.effectivePlacement,[["top",()=>icons.topArrow],["right",()=>icons.rightArrow],["bottom",()=>icons.bottomArrow],["left",()=>icons.leftArrow]])}</div><slot class="default-slot" ${assertSlot()} ${ref(this.#t)}></slot></div></div>`}#e;#u;#t;#o;#r;#i;#l;#a;#m;#s;#n;#p;#d(){this.#s.value?.hidePopover(),this.#v&&(this.#v.ariaExpanded="false"),this.#u?.()}#h(){this.open=!this.open}#c(e){"Escape"===e.key&&(e.preventDefault(),this.open=!1)}get#v(){return this.#n.value?.assignedElements().at(0)}#f(){this.disabled||(this.#u?.(),this.#n.value&&this.#s.value&&(this.#u=autoUpdate(this.#n.value,this.#s.value,(()=>{(async()=>{if(this.#n.value&&this.#s.value&&this.#e.value){const e=Number.parseFloat(window.getComputedStyle(this.#s.value).padding),{x:t,y:o,placement:r,middlewareData:i}=await computePosition(this.#n.value,this.#s.value,{placement:this.placement,middleware:[offset(this.offset-e-2),flip({fallbackStrategy:"initialPlacement"}),shift({limiter:limitShift({offset:30})}),arrow({element:this.#e.value})]});Object.assign(this.#s.value.style,{left:`${t}px`,top:`${o}px`}),Object.assign(this.#e.value.style,{left:i.arrow?.x?i.arrow.x-e+"px":null,top:i.arrow?.y?i.arrow.y-e+"px":null}),this.effectivePlacement=r,this.#s.value.showPopover(),this.#v&&(this.#v.ariaExpanded="true")}})()}))))}};__decorate([property({reflect:!0,type:Boolean})],GlideCorePopover.prototype,"disabled",null),__decorate([property({reflect:!0,type:Number})],GlideCorePopover.prototype,"offset",null),__decorate([property({reflect:!0,type:Boolean})],GlideCorePopover.prototype,"open",null),__decorate([property()],GlideCorePopover.prototype,"placement",void 0),__decorate([property({reflect:!0})],GlideCorePopover.prototype,"version",void 0),__decorate([state()],GlideCorePopover.prototype,"effectivePlacement",void 0),GlideCorePopover=__decorate([customElement("glide-core-popover"),final],GlideCorePopover);export default GlideCorePopover;const icons={topArrow:html`<svg aria-hidden="true" viewBox="0 0 16 9" fill="none"><mask id="mask0_13064_691" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0"><path d="M16 6.99382e-07V9L0 9L3.93402e-07 0L16 6.99382e-07Z" fill="#D9D9D9"/></mask><g mask="url(#mask0_13064_691)"><g filter="url(#filter0_d_13064_691)"><path d="M8.76822 5.603C8.36842 6.13234 7.63157 6.13233 7.23178 5.60299L3 0L13 9.19407e-07L8.76822 5.603Z" fill="currentColor"/></g></g><defs><filter id="filter0_d_13064_691" x="2" y="0" width="0.75rem" height="0.625rem" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="3"/><feGaussianBlur stdDeviation="0.5"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_13064_691"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_13064_691" result="shape"/></filter></defs></svg>`,rightArrow:html`<svg aria-hidden="true" viewBox="0 0 9 16" fill="none"><mask id="mask0_13064_688" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0"><path d="M9 16H1.39876e-06L0 7.86805e-07L9 0L9 16Z" fill="#D9D9D9"/></mask><g mask="url(#mask0_13064_688)"><g filter="url(#filter0_d_13064_688)"><path d="M3.397 8.76822C2.86766 8.36843 2.86767 7.63157 3.39701 7.23178L9 3V13L3.397 8.76822Z" fill="currentColor"/></g></g><defs><filter id="filter0_d_13064_688" x="2" y="3" width="0.5rem" height="0.875rem" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="3"/><feGaussianBlur stdDeviation="0.5"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_13064_688"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_13064_688" result="shape"/></filter></defs></svg>`,bottomArrow:html`<svg aria-hidden="true" viewBox="0 0 16 9" fill="none"><mask id="mask0_13064_685" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0"><path d="M0 9L1.07324e-07 0L16 1.90798e-07V9H0Z" fill="#D9D9D9"/></mask><g mask="url(#mask0_13064_685)"><g filter="url(#filter0_dd_13064_685)"><path d="M7.23178 3.397C7.63157 2.86766 8.36843 2.86767 8.76822 3.39701L13 9L3 9L7.23178 3.397Z" fill="currentColor"/></g></g><defs><filter id="filter0_dd_13064_685" x="-5" y="-2" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="3"/><feGaussianBlur stdDeviation="4"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_13064_685"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="-1"/><feGaussianBlur stdDeviation="1"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/><feBlend mode="normal" in2="effect1_dropShadow_13064_685" result="effect2_dropShadow_13064_685"/><feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_13064_685" result="shape"/></filter></defs></svg>`,leftArrow:html`<svg aria-hidden="true" viewBox="0 0 9 16" fill="none"><mask id="mask0_12969_88361" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0"><path d="M0 0H9V16H0V0Z" fill="#D9D9D9"/></mask><g mask="url(#mask0_12969_88361)"><g filter="url(#filter0_d_12969_88361)"><path d="M5.603 7.23178C6.13234 7.63157 6.13233 8.36843 5.60299 8.76822L0 13L4.82293e-07 3L5.603 7.23178Z" fill="currentColor"/></g></g><defs><filter id="filter0_d_12969_88361" x="-1" y="3" width="0.5rem" height="0.875rem" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="3"/><feGaussianBlur stdDeviation="0.5"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_12969_88361"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_12969_88361" result="shape"/></filter></defs></svg>`};
|
1
|
+
var __decorate=this&&this.__decorate||function(e,t,o,r){var i,l=arguments.length,a=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(l<3?i(a):l>3?i(t,o,a):i(t,o))||a);return l>3&&a&&Object.defineProperty(t,o,a),a};import{html,LitElement}from"lit";import{arrow,autoUpdate,computePosition,flip,limitShift,offset,shift}from"@floating-ui/dom";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,state}from"lit/decorators.js";import packageJson from"../package.json"with{type:"json"};import styles from"./popover.styles.js";import assertSlot from"./library/assert-slot.js";import shadowRootMode from"./library/shadow-root-mode.js";import final from"./library/final.js";let GlideCorePopover=class GlideCorePopover extends LitElement{constructor(){super(...arguments),this.version=packageJson.version,this.effectivePlacement=this.placement??"bottom",this.#e=createRef(),this.#t=createRef(),this.#o=!1,this.#r=!1,this.#i=!1,this.#l=!1,this.#a=!1,this.#s=createRef(),this.#n=createRef(),this.#p=()=>{this.#r||this.#a||this.#o?setTimeout((()=>{this.#r=!1,this.#a=!1,this.#o=!1})):this.open=!1}}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:shadowRootMode}}static{this.styles=styles}get disabled(){return this.#i}set disabled(e){this.#i=e,this.open&&!e?this.#f():this.#d()}get offset(){return this.#m??Number.parseFloat(window.getComputedStyle(document.body).getPropertyValue("--glide-core-spacing-base-xxs"))*Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize)}set offset(e){this.#m=e}get open(){return this.#l}set open(e){const t=e!==this.#l;this.#l=e,e&&t&&!this.disabled?(this.#f(),this.dispatchEvent(new Event("toggle",{bubbles:!0,composed:!0}))):t&&(this.#d(),this.dispatchEvent(new Event("toggle",{bubbles:!0,composed:!0})))}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#p,{capture:!0})}firstUpdated(){this.#s.value&&(this.#s.value.popover="manual"),this.open&&!this.disabled&&this.#f(),this.#t.value?.addEventListener("mouseup",(()=>{this.#r=!0})),this.#n.value?.addEventListener("mouseup",(()=>{this.#a=!0})),this.#e.value?.addEventListener("mouseup",(()=>{this.#o=!0})),this.#n.value?.addEventListener("keydown",(e=>{"Enter"!==e.key&&" "!==e.key||(this.#a=!0)}))}render(){return html`<div class="component"><slot class="target-slot" data-test="target-slot" name="target" @click="${this.#h}" @keydown="${this.#c}" ${assertSlot([Element])} ${ref(this.#n)}></slot><div class="${classMap({popover:!0,[this.effectivePlacement]:!0})}" id="popover" data-test="popover" ${ref(this.#s)}><div class="${classMap({arrow:!0,[this.effectivePlacement]:!0})}" data-test="arrow" ${ref(this.#e)}>${choose(this.effectivePlacement,[["top",()=>icons.topArrow],["right",()=>icons.rightArrow],["bottom",()=>icons.bottomArrow],["left",()=>icons.leftArrow]])}</div><slot class="default-slot" ${assertSlot()} ${ref(this.#t)}></slot></div></div>`}#e;#u;#t;#o;#r;#i;#l;#a;#m;#s;#n;#p;#d(){this.#s.value?.hidePopover(),this.#v&&(this.#v.ariaExpanded="false"),this.#u?.()}#h(){this.open=!this.open}#c(e){"Escape"===e.key&&(e.preventDefault(),this.open=!1)}get#v(){return this.#n.value?.assignedElements().at(0)}#f(){this.disabled||(this.#u?.(),this.#n.value&&this.#s.value&&(this.#u=autoUpdate(this.#n.value,this.#s.value,(()=>{(async()=>{if(this.#n.value&&this.#s.value&&this.#e.value){const e=Number.parseFloat(window.getComputedStyle(this.#s.value).padding),{x:t,y:o,placement:r,middlewareData:i}=await computePosition(this.#n.value,this.#s.value,{placement:this.placement,middleware:[offset(this.offset-e-2),flip({fallbackStrategy:"initialPlacement"}),shift({limiter:limitShift({offset:30})}),arrow({element:this.#e.value})]});Object.assign(this.#s.value.style,{left:`${t}px`,top:`${o}px`}),Object.assign(this.#e.value.style,{left:i.arrow?.x?i.arrow.x-e+"px":null,top:i.arrow?.y?i.arrow.y-e+"px":null}),this.effectivePlacement=r,this.#s.value.showPopover(),this.#v&&(this.#v.ariaExpanded="true")}})()}))))}};__decorate([property({reflect:!0,type:Boolean})],GlideCorePopover.prototype,"disabled",null),__decorate([property({reflect:!0,type:Number})],GlideCorePopover.prototype,"offset",null),__decorate([property({reflect:!0,type:Boolean})],GlideCorePopover.prototype,"open",null),__decorate([property()],GlideCorePopover.prototype,"placement",void 0),__decorate([property({reflect:!0})],GlideCorePopover.prototype,"version",void 0),__decorate([state()],GlideCorePopover.prototype,"effectivePlacement",void 0),GlideCorePopover=__decorate([customElement("glide-core-popover"),final],GlideCorePopover);export default GlideCorePopover;const icons={topArrow:html`<svg aria-hidden="true" viewBox="0 0 16 9" fill="none"><mask id="mask0_13064_691" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0"><path d="M16 6.99382e-07V9L0 9L3.93402e-07 0L16 6.99382e-07Z" fill="#D9D9D9"/></mask><g mask="url(#mask0_13064_691)"><g filter="url(#filter0_d_13064_691)"><path d="M8.76822 5.603C8.36842 6.13234 7.63157 6.13233 7.23178 5.60299L3 0L13 9.19407e-07L8.76822 5.603Z" fill="currentColor"/></g></g><defs><filter id="filter0_d_13064_691" x="2" y="0" width="0.75rem" height="0.625rem" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="3"/><feGaussianBlur stdDeviation="0.5"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_13064_691"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_13064_691" result="shape"/></filter></defs></svg>`,rightArrow:html`<svg aria-hidden="true" viewBox="0 0 9 16" fill="none"><mask id="mask0_13064_688" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0"><path d="M9 16H1.39876e-06L0 7.86805e-07L9 0L9 16Z" fill="#D9D9D9"/></mask><g mask="url(#mask0_13064_688)"><g filter="url(#filter0_d_13064_688)"><path d="M3.397 8.76822C2.86766 8.36843 2.86767 7.63157 3.39701 7.23178L9 3V13L3.397 8.76822Z" fill="currentColor"/></g></g><defs><filter id="filter0_d_13064_688" x="2" y="3" width="0.5rem" height="0.875rem" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="3"/><feGaussianBlur stdDeviation="0.5"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_13064_688"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_13064_688" result="shape"/></filter></defs></svg>`,bottomArrow:html`<svg aria-hidden="true" viewBox="0 0 16 9" fill="none"><mask id="mask0_13064_685" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0"><path d="M0 9L1.07324e-07 0L16 1.90798e-07V9H0Z" fill="#D9D9D9"/></mask><g mask="url(#mask0_13064_685)"><g filter="url(#filter0_dd_13064_685)"><path d="M7.23178 3.397C7.63157 2.86766 8.36843 2.86767 8.76822 3.39701L13 9L3 9L7.23178 3.397Z" fill="currentColor"/></g></g><defs><filter id="filter0_dd_13064_685" x="-5" y="-2" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="3"/><feGaussianBlur stdDeviation="4"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_13064_685"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="-1"/><feGaussianBlur stdDeviation="1"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/><feBlend mode="normal" in2="effect1_dropShadow_13064_685" result="effect2_dropShadow_13064_685"/><feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_13064_685" result="shape"/></filter></defs></svg>`,leftArrow:html`<svg aria-hidden="true" viewBox="0 0 9 16" fill="none"><mask id="mask0_12969_88361" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0"><path d="M0 0H9V16H0V0Z" fill="#D9D9D9"/></mask><g mask="url(#mask0_12969_88361)"><g filter="url(#filter0_d_12969_88361)"><path d="M5.603 7.23178C6.13234 7.63157 6.13233 8.36843 5.60299 8.76822L0 13L4.82293e-07 3L5.603 7.23178Z" fill="currentColor"/></g></g><defs><filter id="filter0_d_12969_88361" x="-1" y="3" width="0.5rem" height="0.875rem" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="3"/><feGaussianBlur stdDeviation="0.5"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_12969_88361"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_12969_88361" result="shape"/></filter></defs></svg>`};
|
package/dist/popover.styles.js
CHANGED
@@ -36,7 +36,7 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";import
|
|
36
36
|
background-color: transparent;
|
37
37
|
border: none;
|
38
38
|
inset: unset;
|
39
|
-
padding: var(--glide-core-spacing-xs);
|
39
|
+
padding: var(--glide-core-spacing-base-xs);
|
40
40
|
position: absolute;
|
41
41
|
|
42
42
|
&:popover-open {
|
@@ -72,7 +72,7 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";import
|
|
72
72
|
--private-arrow-height: 0.5625rem;
|
73
73
|
--private-arrow-width: 1rem;
|
74
74
|
|
75
|
-
color: var(--glide-core-surface-
|
75
|
+
color: var(--glide-core-private-color-dialog-and-modal-surface-container);
|
76
76
|
display: flex;
|
77
77
|
position: relative;
|
78
78
|
|
@@ -91,29 +91,29 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";import
|
|
91
91
|
}
|
92
92
|
|
93
93
|
.default-slot {
|
94
|
-
background-color: var(
|
95
|
-
|
94
|
+
background-color: var(
|
95
|
+
--glide-core-private-color-dialog-and-modal-surface-container
|
96
|
+
);
|
97
|
+
border-radius: var(--glide-core-spacing-base-xs);
|
96
98
|
|
97
|
-
/*
|
98
|
-
".popover" can't overflow because the Popover API won't allow it. And
|
99
|
-
a shadow counts as overflow. So make sure to adjust the padding on
|
99
|
+
/*
|
100
|
+
".popover" can't overflow because the Popover API won't allow it. And
|
101
|
+
a shadow counts as overflow. So make sure to adjust the padding on
|
100
102
|
".popover" when changing this shadow so ".popover" has enough room for it.
|
101
103
|
*/
|
102
104
|
box-shadow:
|
103
105
|
0 3px 8px 0 rgba(0 0 0 / 15%),
|
104
106
|
0 3px 1px 0 rgba(0 0 0 / 6%);
|
105
107
|
box-sizing: border-box;
|
106
|
-
color: var(--glide-core-text-
|
108
|
+
color: var(--glide-core-color-static-text-default);
|
107
109
|
display: flex;
|
108
|
-
font-family: var(--glide-core-
|
109
|
-
font-size: var(--glide-core-
|
110
|
-
font-
|
111
|
-
font-weight: var(--glide-core-body-sm-font-weight);
|
110
|
+
font-family: var(--glide-core-typography-family-primary);
|
111
|
+
font-size: var(--glide-core-typography-size-body-default);
|
112
|
+
font-weight: var(--glide-core-typography-weight-regular);
|
112
113
|
inset-block-start: 50%;
|
113
|
-
line-height: var(--glide-core-body-sm-line-height);
|
114
114
|
max-inline-size: 23.75rem;
|
115
115
|
min-block-size: 2rem;
|
116
116
|
min-inline-size: 5rem;
|
117
|
-
padding: var(--glide-core-spacing-sm);
|
117
|
+
padding: var(--glide-core-spacing-base-sm);
|
118
118
|
}
|
119
119
|
`];
|
package/dist/radio-group.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
var __decorate=this&&this.__decorate||function(e,t,i,a){var o
|
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.#
|
5
|
-
@keydown=${this.#
|
6
|
-
${ref(this.#
|
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.#
|
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.#
|
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.#
|
28
|
-
@private-checked-change=${this.#
|
29
|
-
@private-disabled-change=${this.#
|
30
|
-
@private-value-change=${this.#
|
31
|
-
@slotchange=${this.#
|
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.#
|
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.#
|
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.#
|
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.#
|
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(
|
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,
|
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;
|
@@ -19,20 +19,32 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
|
|
19
19
|
|
20
20
|
.component {
|
21
21
|
align-items: center;
|
22
|
-
color: var(--glide-core-text-
|
22
|
+
color: var(--glide-core-color-interactive-text-default);
|
23
23
|
display: flex;
|
24
|
-
font-weight: var(--glide-core-
|
24
|
+
font-weight: var(--glide-core-typography-weight-regular);
|
25
25
|
|
26
26
|
&:hover {
|
27
|
-
.circle {
|
28
|
-
border-color: var(--glide-core-
|
29
|
-
|
27
|
+
.circle:not(.disabled) {
|
28
|
+
border-color: var(--glide-core-color-interactive-icon-active--hover);
|
29
|
+
|
30
|
+
&.checked {
|
31
|
+
border-color: var(
|
32
|
+
--glide-core-color-interactive-icon-active--hover
|
33
|
+
);
|
34
|
+
box-shadow: var(--glide-core-effect-hovered);
|
35
|
+
|
36
|
+
&::after {
|
37
|
+
background-color: var(
|
38
|
+
--glide-core-color-interactive-icon-active--hover
|
39
|
+
);
|
40
|
+
}
|
41
|
+
}
|
30
42
|
}
|
31
43
|
}
|
32
44
|
|
33
45
|
.circle {
|
34
46
|
block-size: 1rem;
|
35
|
-
border: 1px solid var(--glide-core-
|
47
|
+
border: 1px solid var(--glide-core-color-interactive-stroke-contrast);
|
36
48
|
border-radius: 50%;
|
37
49
|
box-sizing: border-box;
|
38
50
|
inline-size: 1rem;
|
@@ -44,8 +56,10 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
|
|
44
56
|
box-shadow 200ms ease-in-out;
|
45
57
|
|
46
58
|
&.checked {
|
47
|
-
background-color: var(
|
48
|
-
|
59
|
+
background-color: var(
|
60
|
+
--glide-core-private-color-checkbox-surface-background-idle
|
61
|
+
);
|
62
|
+
border-color: var(--glide-core-color-interactive-icon-active);
|
49
63
|
|
50
64
|
&.animate {
|
51
65
|
@media (prefers-reduced-motion: no-preference) {
|
@@ -56,7 +70,9 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
|
|
56
70
|
}
|
57
71
|
|
58
72
|
&::after {
|
59
|
-
background-color: var(
|
73
|
+
background-color: var(
|
74
|
+
--glide-core-color-interactive-surface-container-active
|
75
|
+
);
|
60
76
|
block-size: 0.5rem;
|
61
77
|
border-radius: 50%;
|
62
78
|
box-sizing: border-box;
|
@@ -70,12 +86,16 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
|
|
70
86
|
}
|
71
87
|
|
72
88
|
&.disabled {
|
73
|
-
border-color: var(
|
89
|
+
border-color: var(
|
90
|
+
--glide-core-private-color-radio-icon-default--disabled
|
91
|
+
);
|
74
92
|
box-shadow: none;
|
75
93
|
cursor: not-allowed;
|
76
94
|
|
77
95
|
&::after {
|
78
|
-
background-color: var(
|
96
|
+
background-color: var(
|
97
|
+
--glide-core-private-color-radio-icon-default--disabled
|
98
|
+
);
|
79
99
|
}
|
80
100
|
}
|
81
101
|
}
|
@@ -1,11 +1,9 @@
|
|
1
1
|
import{css}from"lit";export default[css`
|
2
2
|
.component {
|
3
|
-
color: var(--glide-core-text-
|
4
|
-
font-family: var(--glide-core-
|
5
|
-
font-size: var(--glide-core-
|
6
|
-
font-
|
7
|
-
font-variant: var(--glide-core-heading-xxxs-font-variant);
|
8
|
-
font-weight: var(--glide-core-heading-xxxs-font-weight);
|
3
|
+
color: var(--glide-core-color-static-text-default);
|
4
|
+
font-family: var(--glide-core-typography-family-primary);
|
5
|
+
font-size: var(--glide-core-typography-size-body-default);
|
6
|
+
font-weight: var(--glide-core-typography-weight-bold);
|
9
7
|
}
|
10
8
|
|
11
9
|
.radio-container {
|
@@ -14,12 +12,12 @@ import{css}from"lit";export default[css`
|
|
14
12
|
gap: 0.375rem;
|
15
13
|
|
16
14
|
&.invalid {
|
17
|
-
border: 1px solid var(--glide-core-
|
18
|
-
border-radius:
|
19
|
-
color: var(--glide-core-
|
15
|
+
border: 1px solid var(--glide-core-color-error-stroke-primary);
|
16
|
+
border-radius: var(--glide-core-rounding-base-radius-sm);
|
17
|
+
color: var(--glide-core-color-error-stroke-primary);
|
20
18
|
margin-block-end: -0.0625rem;
|
21
19
|
margin-inline-start: -0.0625rem;
|
22
|
-
padding: var(--glide-core-spacing-xxs) 0.375rem;
|
20
|
+
padding: var(--glide-core-spacing-base-xxs) 0.375rem;
|
23
21
|
}
|
24
22
|
}
|
25
23
|
|
@@ -3,19 +3,18 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
|
|
3
3
|
`,css`
|
4
4
|
.component {
|
5
5
|
align-items: center;
|
6
|
-
border-radius:
|
6
|
+
border-radius: var(--glide-core-rounding-base-radius-md) 0 0
|
7
|
+
var(--glide-core-rounding-base-radius-md);
|
7
8
|
border-style: solid;
|
8
9
|
border-width: 1px 0 1px 1px;
|
9
10
|
cursor: pointer;
|
10
11
|
display: inline-flex;
|
11
|
-
font-family: var(--glide-core-
|
12
|
-
font-
|
13
|
-
font-weight: var(--glide-core-heading-xxs-font-weight);
|
12
|
+
font-family: var(--glide-core-typography-family-primary);
|
13
|
+
font-weight: var(--glide-core-typography-weight-bold);
|
14
14
|
gap: 0.625rem;
|
15
15
|
justify-content: center;
|
16
|
-
padding-block: var(--glide-core-spacing-xs);
|
17
|
-
padding-inline: var(--glide-core-spacing-md);
|
18
|
-
padding-inline-end: var(--glide-core-spacing-xs);
|
16
|
+
padding-block: var(--glide-core-spacing-base-xs);
|
17
|
+
padding-inline: var(--glide-core-spacing-base-md);
|
19
18
|
position: relative;
|
20
19
|
text-decoration: none;
|
21
20
|
transition-duration: 150ms;
|
@@ -32,65 +31,81 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";export
|
|
32
31
|
|
33
32
|
&:focus-visible {
|
34
33
|
/* Covers up the secondary button's border. */
|
35
|
-
box-shadow: 0 0 0 2px
|
34
|
+
box-shadow: 0 0 0 2px
|
35
|
+
var(--glide-core-color-interactive-surface-container) !important;
|
36
36
|
}
|
37
37
|
|
38
38
|
&.primary {
|
39
|
-
background-color: var(
|
39
|
+
background-color: var(
|
40
|
+
--glide-core-color-interactive-surface-container-active
|
41
|
+
);
|
40
42
|
border-color: transparent;
|
41
|
-
color: var(--glide-core-text-
|
43
|
+
color: var(--glide-core-private-color-button-text-primary);
|
42
44
|
}
|
43
45
|
|
44
46
|
&.secondary {
|
45
|
-
background-color: var(--glide-core-surface-
|
46
|
-
border-color: var(--glide-core-
|
47
|
-
color: var(--glide-core-text-
|
47
|
+
background-color: var(--glide-core-color-interactive-surface-container);
|
48
|
+
border-color: var(--glide-core-private-color-button-stroke-default);
|
49
|
+
color: var(--glide-core-color-interactive-text-link);
|
48
50
|
|
49
51
|
&:not(.disabled) {
|
50
52
|
/* So it has a right border when the secondary button is disabled. */
|
51
|
-
box-shadow: 1px 0 0
|
53
|
+
box-shadow: 1px 0 0
|
54
|
+
var(--glide-core-private-color-button-stroke-default);
|
55
|
+
}
|
56
|
+
|
57
|
+
&.disabled {
|
58
|
+
border-color: var(
|
59
|
+
--glide-core-color-interactive-stroke-primary--disabled
|
60
|
+
);
|
52
61
|
}
|
53
62
|
}
|
54
63
|
|
55
64
|
&.small {
|
56
65
|
block-size: 1.75rem;
|
57
66
|
box-sizing: border-box;
|
58
|
-
font-size: var(--glide-core-
|
67
|
+
font-size: var(--glide-core-typography-size-body-small);
|
59
68
|
line-height: 1rem;
|
60
69
|
}
|
61
70
|
|
62
71
|
&.large {
|
63
72
|
block-size: 2.125rem;
|
64
73
|
box-sizing: border-box;
|
65
|
-
font-size: var(--glide-core-
|
74
|
+
font-size: var(--glide-core-typography-size-body-large);
|
66
75
|
line-height: 1.5rem;
|
67
76
|
}
|
68
77
|
|
69
|
-
/*
|
70
|
-
A "disabled" class is used instead of ":disabled" because these styles are
|
71
|
-
shared between Split Button Primary Button and Split Button Primary Link.
|
78
|
+
/*
|
79
|
+
A "disabled" class is used instead of ":disabled" because these styles are
|
80
|
+
shared between Split Button Primary Button and Split Button Primary Link.
|
72
81
|
*/
|
73
82
|
&.disabled {
|
74
|
-
background-color: var(
|
83
|
+
background-color: var(
|
84
|
+
--glide-core-color-interactive-surface-container--disabled
|
85
|
+
);
|
75
86
|
border-color: transparent;
|
76
|
-
color: var(--glide-core-text-
|
87
|
+
color: var(--glide-core-color-interactive-text-link--disabled);
|
77
88
|
cursor: not-allowed;
|
78
89
|
}
|
79
90
|
|
80
91
|
&:not(:active, .disabled):is(:focus, :hover) {
|
81
|
-
background-color: var(
|
92
|
+
background-color: var(
|
93
|
+
--glide-core-color-interactive-surface-container--hover
|
94
|
+
);
|
82
95
|
border-color: transparent;
|
83
|
-
color: var(--glide-core-text-
|
96
|
+
color: var(--glide-core-color-interactive-text-link);
|
84
97
|
}
|
85
98
|
|
86
99
|
&:not(:active, .disabled):is(:hover) {
|
87
|
-
box-shadow: var(--glide-core-
|
100
|
+
box-shadow: var(--glide-core-effect-hovered);
|
88
101
|
z-index: 1;
|
89
102
|
}
|
90
103
|
|
91
104
|
&:not(.disabled):active {
|
92
|
-
background-color: var(
|
93
|
-
|
105
|
+
background-color: var(
|
106
|
+
--glide-core-color-interactive-surface-container-active
|
107
|
+
);
|
108
|
+
color: var(--glide-core-private-color-button-text-primary);
|
94
109
|
}
|
95
110
|
}
|
96
111
|
`];
|