@momentum-design/components 0.133.32 → 0.133.34
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/browser/index.js
CHANGED
|
@@ -3263,6 +3263,9 @@
|
|
|
3263
3263
|
display: contents;
|
|
3264
3264
|
}
|
|
3265
3265
|
|
|
3266
|
+
/* AI-Assisted: range fill is rendered via a ::before pseudo aligned to the
|
|
3267
|
+
day-circle (1.75rem) instead of filling the full grid column, so the rounded
|
|
3268
|
+
ends line up with the today/selected circle. */
|
|
3266
3269
|
.calendar-day-wrapper {
|
|
3267
3270
|
display: flex;
|
|
3268
3271
|
align-items: center;
|
|
@@ -3271,25 +3274,41 @@
|
|
|
3271
3274
|
position: relative;
|
|
3272
3275
|
}
|
|
3273
3276
|
|
|
3274
|
-
.calendar-day-wrapper.in-range {
|
|
3277
|
+
.calendar-day-wrapper.in-range::before {
|
|
3278
|
+
content: '';
|
|
3279
|
+
position: absolute;
|
|
3280
|
+
top: 0;
|
|
3281
|
+
bottom: 0;
|
|
3282
|
+
inset-inline-start: 0;
|
|
3283
|
+
inset-inline-end: 0;
|
|
3275
3284
|
background: var(--mdc-calendar-range-bg);
|
|
3276
3285
|
border-top: 1px solid var(--mdc-calendar-day-selected-bg);
|
|
3277
3286
|
border-bottom: 1px solid var(--mdc-calendar-day-selected-bg);
|
|
3287
|
+
z-index: 0;
|
|
3288
|
+
pointer-events: none;
|
|
3289
|
+
}
|
|
3290
|
+
|
|
3291
|
+
.calendar-day-wrapper.in-range > .calendar-day {
|
|
3292
|
+
position: relative;
|
|
3293
|
+
z-index: 1;
|
|
3278
3294
|
}
|
|
3279
3295
|
|
|
3280
|
-
.calendar-day-wrapper.range-start,
|
|
3281
|
-
.calendar-day-wrapper.in-range:first-child {
|
|
3282
|
-
|
|
3283
|
-
border-
|
|
3296
|
+
.calendar-day-wrapper.range-start::before,
|
|
3297
|
+
.calendar-day-wrapper.in-range:first-child::before {
|
|
3298
|
+
inset-inline-start: calc(50% - 0.875rem);
|
|
3299
|
+
border-start-start-radius: 0.875rem;
|
|
3300
|
+
border-end-start-radius: 0.875rem;
|
|
3284
3301
|
border-inline-start: 1px solid var(--mdc-calendar-day-selected-bg);
|
|
3285
3302
|
}
|
|
3286
3303
|
|
|
3287
|
-
.calendar-day-wrapper.range-end,
|
|
3288
|
-
.calendar-day-wrapper.in-range:last-child {
|
|
3289
|
-
|
|
3290
|
-
border-
|
|
3304
|
+
.calendar-day-wrapper.range-end::before,
|
|
3305
|
+
.calendar-day-wrapper.in-range:last-child::before {
|
|
3306
|
+
inset-inline-end: calc(50% - 0.875rem);
|
|
3307
|
+
border-start-end-radius: 0.875rem;
|
|
3308
|
+
border-end-end-radius: 0.875rem;
|
|
3291
3309
|
border-inline-end: 1px solid var(--mdc-calendar-day-selected-bg);
|
|
3292
3310
|
}
|
|
3311
|
+
/* End AI-Assisted */
|
|
3293
3312
|
|
|
3294
3313
|
.calendar-day {
|
|
3295
3314
|
display: flex;
|
|
@@ -5652,7 +5671,7 @@
|
|
|
5652
5671
|
outline: 0.125rem solid var(--mds-color-theme-focus-default-0);
|
|
5653
5672
|
}
|
|
5654
5673
|
}
|
|
5655
|
-
`,...Et(!0,"parent-to-child")],ay=yS;var Gn=class extends Lt(Nt(Ve(pe(Qt)))){constructor(){super();this.checked=!1;this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown)}connectedCallback(){super.connectedCallback(),this.role=et.RADIO,this.shouldRenderLabel=!1,this.helpTextType=void 0,this.toggletipPlacement=void 0,this.toggletipStrategy=void 0,this.updateAriaLabel()}firstUpdated(t){this.updateTabIndex(),this.autoFocusOnMount&&(this.elementToAutoFocus=this),super.firstUpdated(t)}getAllRadiosWithinSameGroup(){return Array.from(
|
|
5674
|
+
`,...Et(!0,"parent-to-child")],ay=yS;var Gn=class extends Lt(Nt(Ve(pe(Qt)))){constructor(){super();this.checked=!1;this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown)}connectedCallback(){super.connectedCallback(),this.role=et.RADIO,this.shouldRenderLabel=!1,this.helpTextType=void 0,this.toggletipPlacement=void 0,this.toggletipStrategy=void 0,this.updateAriaLabel()}firstUpdated(t){this.updateTabIndex(),this.autoFocusOnMount&&(this.elementToAutoFocus=this),super.firstUpdated(t)}getAllRadiosWithinSameGroup(){let t=this.getRootNode();return Array.from(t.querySelectorAll(`mdc-radio[name="${this.name}"]`))}formResetCallback(){this.getAllRadiosWithinSameGroup().forEach(e=>{e.checked=!1}),this.updateComplete.then(()=>{this.setActualFormValue()}).catch(e=>{this.onerror&&this.onerror(e)})}formStateRestoreCallback(t){this.value===t&&t!==""&&(this.checked=!0)}setComponentValidity(t){t?this.internals.setValidity({}):this.required&&!this.checked&&this.setValidity(),this.updateTabIndex()}setGroupValidity(t,e){this.updateComplete.then(()=>{t.forEach(i=>i.setComponentValidity(e))}).catch(i=>{var l;return(l=this.onerror)==null?void 0:l.call(this,i)})}setActualFormValue(){let t=this.getAllRadiosWithinSameGroup();if(this.checked)this.setGroupValidity(t,!0),this.internals.setFormValue(this.value||"on");else{let e=t.some(c=>c.required),i=t.some(c=>c.checked),l=e&&!i;this.setGroupValidity(t,!l),this.internals.setFormValue(null)}}handleChange(t=!1){if(this.checked||this.disabled||this.readonly||this.softDisabled)return;this.getAllRadiosWithinSameGroup().forEach(i=>{i.checked=!1}),this.checked=!0,t&&super.click(),this.emitCheckedChangeEvent()}click(){this.handleChange(!0)}updateRadio(t,e){let i=t[e];i.focus(),i.handleChange()}handleClick(){this.handleChange()}emitCheckedChangeEvent(){this.checked&&(this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}handleKeyDown(t){var f;if(this.disabled)return;let e=this.getActionForKeyEvent(t);(this.readonly||this.softDisabled)&&e===W.SPACE&&t.preventDefault();let l=this.getAllRadiosWithinSameGroup().filter(b=>!b.disabled),c=l.indexOf(this);if(this.getKeyboardNavMode()===ee.SPATIAL){e===W.ENTER&&(this.updateRadio(l,c),this.keyDownEventHandled()),this.updateTabIndex();return}if(e===W.DOWN||e===W.RIGHT){let b=(c+1)%l.length;this.updateRadio(l,b)}else if(e===W.UP||e===W.LEFT){let b=(c-1+l.length)%l.length;this.updateRadio(l,b)}else e===W.SPACE&&this.updateRadio(l,c);this.updateTabIndex(),e===W.ENTER&&((f=this.form)==null||f.requestSubmit())}updateTabIndex(){let t=this.getKeyboardNavMode()===ee.SPATIAL,e=this.getAllRadiosWithinSameGroup(),i=e.find(c=>c.checked),l=e.find(c=>!c.disabled);e.forEach(c=>{c.tabIndex=-1,(t||c===i||!i&&c===l)&&(c.tabIndex=0)})}update(t){super.update(t),t.has("checked")&&(this.ariaChecked=this.checked.toString(),this.setActualFormValue()),t.has("label")&&this.updateAriaLabel()}updateAriaLabel(){!this.ariaLabel&&this.ariaLabel!==this.label&&(this.ariaLabel=this.label||"")}setValidity(){this.required&&!this.checked&&this.validationMessage&&this.internals.setValidity({valueMissing:!0,customError:!0},this.validationMessage,this),this.internals.setValidity({})}handleIndicatorSlotChange(t){let i=t.target.assignedNodes({flatten:!0}).filter(l=>l.nodeType===Node.ELEMENT_NODE);this.classList.toggle("mdc-focus-ring",i.length>0)}render(){return S`
|
|
5656
5675
|
<slot name="indicator" @slotchange=${this.handleIndicatorSlotChange}>
|
|
5657
5676
|
<mdc-staticradio
|
|
5658
5677
|
part="radio-indicator"
|