@moni-labs/moni-ui 0.4.8 → 0.4.10
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/custom-elements.json +3 -3
- package/dist/browser/moni-ui.iife.min.js +25 -3
- package/dist/browser/moni-ui.iife.min.js.br +0 -0
- package/dist/browser/moni-ui.iife.min.js.gz +0 -0
- package/dist/browser/moni-ui.iife.min.js.map +1 -1
- package/dist/browser/moni-ui.min.js +25 -0
- package/dist/browser/moni-ui.min.js.br +0 -0
- package/dist/browser/moni-ui.min.js.gz +0 -0
- package/dist/browser/moni-ui.min.js.map +1 -1
- package/dist/cdn/chunks/{class-map-EVPcxmRq.js → class-map-DVIPqVv8.js} +1 -1
- package/dist/cdn/chunks/{decorate-D4jKxi6H.js → decorate-B_60A6SM.js} +22 -0
- package/dist/cdn/chunks/if-defined-35Uf60Gp.js +1 -0
- package/dist/cdn/chunks/{live-DdUrWiUp.js → live-0xU7YMoc.js} +1 -1
- package/dist/cdn/components/moni-app-bar.js +1 -1
- package/dist/cdn/components/moni-badge.js +1 -1
- package/dist/cdn/components/moni-bottom-sheet.js +1 -1
- package/dist/cdn/components/moni-button-group.js +1 -1
- package/dist/cdn/components/moni-button-segment.js +1 -1
- package/dist/cdn/components/moni-button.js +1 -1
- package/dist/cdn/components/moni-card.js +1 -1
- package/dist/cdn/components/moni-carousel.js +1 -1
- package/dist/cdn/components/moni-checkbox.js +1 -1
- package/dist/cdn/components/moni-chip.js +1 -1
- package/dist/cdn/components/moni-color-field.js +1 -1
- package/dist/cdn/components/moni-context-menu.js +1 -1
- package/dist/cdn/components/moni-dialog.js +1 -1
- package/dist/cdn/components/moni-divider.js +1 -1
- package/dist/cdn/components/moni-expansion.js +1 -1
- package/dist/cdn/components/moni-fab-menu.js +1 -1
- package/dist/cdn/components/moni-fab.js +1 -1
- package/dist/cdn/components/moni-file-field.js +1 -1
- package/dist/cdn/components/moni-icon.js +1 -1
- package/dist/cdn/components/moni-list-item.js +1 -1
- package/dist/cdn/components/moni-list.js +1 -1
- package/dist/cdn/components/moni-loading-indicator.js +1 -1
- package/dist/cdn/components/moni-menu-item.js +1 -1
- package/dist/cdn/components/moni-menu.js +1 -1
- package/dist/cdn/components/moni-morph-modal.js +1 -1
- package/dist/cdn/components/moni-nav-item.js +1 -1
- package/dist/cdn/components/moni-nav.js +1 -1
- package/dist/cdn/components/moni-progress.js +1 -1
- package/dist/cdn/components/moni-radio.js +1 -1
- package/dist/cdn/components/moni-ripple.js +1 -1
- package/dist/cdn/components/moni-segmented-button.js +1 -1
- package/dist/cdn/components/moni-select-option.js +1 -1
- package/dist/cdn/components/moni-select.js +2 -2
- package/dist/cdn/components/moni-shape.js +1 -1
- package/dist/cdn/components/moni-side-sheet.js +1 -1
- package/dist/cdn/components/moni-slider.js +1 -1
- package/dist/cdn/components/moni-snackbar.js +1 -1
- package/dist/cdn/components/moni-split-button.js +1 -1
- package/dist/cdn/components/moni-step.js +1 -1
- package/dist/cdn/components/moni-stepper.js +1 -1
- package/dist/cdn/components/moni-switch.js +1 -1
- package/dist/cdn/components/moni-tab.js +1 -1
- package/dist/cdn/components/moni-tabs.js +1 -1
- package/dist/cdn/components/moni-text-field.js +2 -2
- package/dist/cdn/components/moni-textarea.js +2 -2
- package/dist/cdn/components/moni-time-picker.js +1 -1
- package/dist/cdn/components/moni-toolbar.js +1 -1
- package/dist/cdn/components/moni-tooltip.js +1 -1
- package/dist/cdn/components/moni-typography.js +1 -1
- package/dist/cdn/importmap.json +98 -98
- package/dist/components/_base/field-styles.d.ts.map +1 -1
- package/dist/components/_base/field-styles.js +22 -0
- package/dist/components/moni-select.d.ts +2 -2
- package/dist/components/moni-select.d.ts.map +1 -1
- package/dist/components/moni-select.js +2 -1
- package/dist/components/moni-text-field.d.ts +2 -2
- package/dist/components/moni-text-field.d.ts.map +1 -1
- package/dist/components/moni-text-field.js +2 -1
- package/dist/components/moni-textarea.d.ts +2 -2
- package/dist/components/moni-textarea.d.ts.map +1 -1
- package/dist/components/moni-textarea.js +2 -1
- package/docs/api.json +7 -4
- package/docs/assets/moni-select/shape--small-round.png +0 -0
- package/docs/assets/moni-text-field/shape--small-round.png +0 -0
- package/docs/assets/moni-textarea/shape--small-round.png +0 -0
- package/docs/components/select.md +3 -1
- package/docs/components/text-field.md +3 -1
- package/docs/components/textarea.md +3 -1
- package/package.json +1 -1
- package/src/components/_base/field-styles.ts +22 -0
- package/src/components/moni-select.test.ts +8 -0
- package/src/components/moni-select.ts +3 -2
- package/src/components/moni-text-field.test.ts +8 -0
- package/src/components/moni-text-field.ts +3 -2
- package/src/components/moni-textarea.test.ts +8 -0
- package/src/components/moni-textarea.ts +3 -2
- package/dist/cdn/chunks/if-defined-DlAUOFi9.js +0 -1
package/custom-elements.json
CHANGED
|
@@ -4780,7 +4780,7 @@
|
|
|
4780
4780
|
"name": "shape",
|
|
4781
4781
|
"attribute": "shape",
|
|
4782
4782
|
"type": {
|
|
4783
|
-
"text": "'round' | 'square' | 'no-round'"
|
|
4783
|
+
"text": "'round' | 'small-round' | 'square' | 'no-round'"
|
|
4784
4784
|
},
|
|
4785
4785
|
"default": "'no-round'",
|
|
4786
4786
|
"description": "Forma (radio de borde) del campo."
|
|
@@ -6633,7 +6633,7 @@
|
|
|
6633
6633
|
"name": "shape",
|
|
6634
6634
|
"attribute": "shape",
|
|
6635
6635
|
"type": {
|
|
6636
|
-
"text": "'round' | 'no-round'"
|
|
6636
|
+
"text": "'round' | 'small-round' | 'no-round'"
|
|
6637
6637
|
},
|
|
6638
6638
|
"default": "'no-round'",
|
|
6639
6639
|
"description": "Forma del radio del borde (border-radius) del campo."
|
|
@@ -7109,7 +7109,7 @@
|
|
|
7109
7109
|
"name": "shape",
|
|
7110
7110
|
"attribute": "shape",
|
|
7111
7111
|
"type": {
|
|
7112
|
-
"text": "'round' | 'square' | 'no-round'"
|
|
7112
|
+
"text": "'round' | 'small-round' | 'square' | 'no-round'"
|
|
7113
7113
|
},
|
|
7114
7114
|
"default": "'no-round'",
|
|
7115
7115
|
"description": "Forma del radio del borde (border-radius) del campo."
|
|
@@ -333,6 +333,13 @@ var MoniUI=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Modul
|
|
|
333
333
|
.field[class*='round'].extra {
|
|
334
334
|
border-radius: 2rem;
|
|
335
335
|
}
|
|
336
|
+
/* Compact rounding for dense forms without falling back to square corners. */
|
|
337
|
+
.field.small-round,
|
|
338
|
+
.field.small-round.small,
|
|
339
|
+
.field.small-round.large,
|
|
340
|
+
.field.small-round.extra {
|
|
341
|
+
border-radius: 0.5rem;
|
|
342
|
+
}
|
|
336
343
|
|
|
337
344
|
/* ─── Icon positioning ───────────────────────────────────────────────────── */
|
|
338
345
|
/* Generic rule: absolutely positions any icon/image/svg inside the field. */
|
|
@@ -593,6 +600,11 @@ var MoniUI=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Modul
|
|
|
593
600
|
.field.label[class*='round'] > label {
|
|
594
601
|
inset: -0.5rem 1.9375rem 0 var(--_start);
|
|
595
602
|
}
|
|
603
|
+
/* Compact rounding keeps the label closer to the edge than pill fields. */
|
|
604
|
+
.field.label.small-round > label {
|
|
605
|
+
--_start: 1rem;
|
|
606
|
+
inset: -0.5rem 0.9375rem 0 var(--_start);
|
|
607
|
+
}
|
|
596
608
|
|
|
597
609
|
/* ─── Label lift selector group ──────────────────────────────────────────── */
|
|
598
610
|
/* The label lifts (scales down + moves up) in four conditions:
|
|
@@ -716,6 +728,16 @@ var MoniUI=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Modul
|
|
|
716
728
|
clip-path: polygon(-2% -2%,1.25rem -2%,1.25rem .5rem,calc(100% - 2rem) .5rem,calc(100% - 2rem) -2%,102% -2%,102% 102%,-2% 102%);
|
|
717
729
|
}
|
|
718
730
|
|
|
731
|
+
/* The compact shape needs a narrower leading segment so it never crosses
|
|
732
|
+
the first glyph of the floating label. */
|
|
733
|
+
.field.label.border.small-round:not(.fill)
|
|
734
|
+
> :is(input, textarea):is(:focus, [placeholder]:not(:placeholder-shown), .active),
|
|
735
|
+
.field.label.border.small-round:not(.fill) > select,
|
|
736
|
+
.field.label.border.small-round:not(.fill) > input.active,
|
|
737
|
+
.field.label.border.small-round:not(.fill) > select.active {
|
|
738
|
+
clip-path: polygon(-2% -2%,.75rem -2%,.75rem .5rem,calc(100% - 1rem) .5rem,calc(100% - 1rem) -2%,102% -2%,102% 102%,-2% 102%);
|
|
739
|
+
}
|
|
740
|
+
|
|
719
741
|
/* ─── Label color changes ─────────────────────────────────────────────────── */
|
|
720
742
|
/* On focus: label turns primary-colored to draw attention. */
|
|
721
743
|
.field.label > :focus + label {
|
|
@@ -4606,7 +4628,7 @@ var MoniUI=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Modul
|
|
|
4606
4628
|
</ul>
|
|
4607
4629
|
</div>
|
|
4608
4630
|
</div>
|
|
4609
|
-
`}let t={value:0};return this._parsedOptions.map(e=>this._renderDesktopNode(e,t))}render(){let e=!!this.icon,t=this._getFilteredOptions(),n=this._findOptionByValue(this.value),r=this._open&&this.searchable&&!this.sheet?this._searchQuery:n?n.label:``,i=!!(r||this.placeholder),a={field:!0,label:!!this.label,fill:this.variant===`filled`,border:this.variant===`outlined`,small:this.size===`small`,large:this.size===`large`,extra:this.size===`extra`,prefix:e,suffix:!0,invalid:this.error,round:this.shape===`round`,square:this.shape===`no-round`},o=this.icon?L`<i class="leading-icon" part="leading-icon"
|
|
4631
|
+
`}let t={value:0};return this._parsedOptions.map(e=>this._renderDesktopNode(e,t))}render(){let e=!!this.icon,t=this._getFilteredOptions(),n=this._findOptionByValue(this.value),r=this._open&&this.searchable&&!this.sheet?this._searchQuery:n?n.label:``,i=!!(r||this.placeholder),a={field:!0,label:!!this.label,fill:this.variant===`filled`,border:this.variant===`outlined`,small:this.size===`small`,large:this.size===`large`,extra:this.size===`extra`,prefix:e,suffix:!0,invalid:this.error,round:this.shape===`round`,"small-round":this.shape===`small-round`,square:this.shape===`no-round`},o=this.icon?L`<i class="leading-icon" part="leading-icon"
|
|
4610
4632
|
><moni-icon name="${this.icon}"></moni-icon
|
|
4611
4633
|
></i>`:R,s=this.loading?L`<i class="trailing-icon" part="trailing-icon"
|
|
4612
4634
|
><moni-progress
|
|
@@ -5465,7 +5487,7 @@ var MoniUI=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Modul
|
|
|
5465
5487
|
<slot></slot>
|
|
5466
5488
|
</nav>`}};G([B({reflect:!0})],Lt.prototype,`mode`,void 0),G([B({type:Boolean,reflect:!0})],Lt.prototype,`scrollable`,void 0),G([B({type:Boolean,reflect:!0})],Lt.prototype,`vertical`,void 0),G([B({reflect:!0})],Lt.prototype,`align`,void 0),G([B({reflect:!0,attribute:`indicator-size`})],Lt.prototype,`indicatorSize`,void 0),Lt=G([z(`moni-tabs`)],Lt);var J=class extends U{static{this.formAssociated=!0}constructor(){super(),this.name=``,this.label=``,this.variant=`filled`,this.size=`medium`,this.shape=`no-round`,this.icon=``,this.trailingIcon=``,this.prefix=``,this.suffix=``,this.rows=3,this.autosize=!1,this.maxRows=0,this.maxlength=null,this.required=!1,this.readonly=!1,this.minlength=null,this.autocomplete=``,this.noCounter=!1,this.loading=!1,this.disabled=!1,this.helper=``,this.errorText=``,this.error=!1,this.value=``,this.placeholder=``,this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),this._resizeObserver=new ResizeObserver(()=>this._resizeTextarea())}disconnectedCallback(){this._resizeObserver?.disconnect(),this._resizeObserver=void 0,super.disconnectedCallback()}firstUpdated(){this._resizeObserver?.observe(this._input),this._resizeTextarea()}_handleInput(e){let t=e.currentTarget;this.value=t.value,this._internals?.setFormValue?.(this.value),this._resizeTextarea()}_resizeTextarea(){let e=this._input;if(!e)return;if(!this.autosize){e.style.removeProperty(`block-size`),e.style.removeProperty(`overflow-y`);return}let t=getComputedStyle(e),n=Number.parseFloat(t.lineHeight)||24,r=Number.parseFloat(t.paddingTop)+Number.parseFloat(t.paddingBottom),i=Number.parseFloat(t.borderTopWidth)+Number.parseFloat(t.borderBottomWidth),a=n*Math.max(1,this.rows)+r+i,o=this.maxRows>0?n*Math.max(this.rows,this.maxRows)+r+i:1/0;e.style.blockSize=`auto`;let s=Math.min(o,Math.max(a,e.scrollHeight+i));e.style.blockSize=`${s}px`,e.style.overflowY=e.scrollHeight+i>o?`auto`:`hidden`}updated(e){this._input&&(e.has(`value`)&&(this._input.value=this.value,this._internals?.setFormValue?.(this.value)),e.has(`disabled`)&&(this._input.disabled=this.disabled),e.has(`maxlength`)&&this.maxlength!=null&&(this._input.maxLength=this.maxlength),(e.has(`value`)||e.has(`autosize`)||e.has(`rows`)||e.has(`maxRows`))&&this._resizeTextarea()),this._syncValidity()}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}_syncValidity(){!this._input||!this._internals?.setValidity||this._internals.setValidity(this._input.validity,this._input.validationMessage,this._input)}static{this.styles=[W,Ke,g`
|
|
5467
5489
|
:host([autosize]) textarea { resize: none; }
|
|
5468
|
-
`]}render(){let e=!!this.icon||!!this.prefix,t=!!this.trailingIcon||!!this.suffix||this.loading,n=!!this.value||!!this.placeholder,r=!this.noCounter&&this.maxlength!=null&&this.maxlength>0,i={field:!0,label:!!this.label,fill:this.variant===`filled`,border:this.variant===`outlined`,small:this.size===`small`,large:this.size===`large`,extra:this.size===`extra`,prefix:e,suffix:t,invalid:this.error,round:this.shape===`round`,square:this.shape===`no-round`},a=this.placeholder||(this.label?` `:``),o=this.icon?L`<i class="leading-icon" part="leading-icon"
|
|
5490
|
+
`]}render(){let e=!!this.icon||!!this.prefix,t=!!this.trailingIcon||!!this.suffix||this.loading,n=!!this.value||!!this.placeholder,r=!this.noCounter&&this.maxlength!=null&&this.maxlength>0,i={field:!0,label:!!this.label,fill:this.variant===`filled`,border:this.variant===`outlined`,small:this.size===`small`,large:this.size===`large`,extra:this.size===`extra`,prefix:e,suffix:t,invalid:this.error,round:this.shape===`round`,"small-round":this.shape===`small-round`,square:this.shape===`no-round`},a=this.placeholder||(this.label?` `:``),o=this.icon?L`<i class="leading-icon" part="leading-icon"
|
|
5469
5491
|
><moni-icon name="${this.icon}"></moni-icon
|
|
5470
5492
|
></i>`:this.prefix?L`<span class="leading-icon" part="prefix"
|
|
5471
5493
|
>${this.prefix}</span
|
|
@@ -5547,7 +5569,7 @@ var MoniUI=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Modul
|
|
|
5547
5569
|
::slotted([slot='suffix']) { pointer-events: auto; }
|
|
5548
5570
|
.field.suffix-action-field > input { padding-inline-end: 3.5rem; }
|
|
5549
5571
|
.field.suffix-action-field > input:focus { padding-inline-end: 3.4375rem; }
|
|
5550
|
-
`]}render(){let e=!!this.icon||!!this.prefix,t=!!this.trailingIcon||!!this.suffix||!!this.suffixButtonIcon||this._hasSuffixSlot,n=!!this.value||!!this.placeholder,r={field:!0,label:!!this.label,fill:this.variant===`filled`,border:this.variant===`outlined`,small:this.size===`small`,large:this.size===`large`,extra:this.size===`extra`,prefix:e,suffix:t,"suffix-action-field":!!this.suffixButtonIcon||this._hasSuffixSlot,invalid:this.error,round:this.shape===`round`&&this.variant!==`underlined`,square:this.shape===`no-round`},i=this.placeholder||(this.label?` `:``),a=this.icon?L`<i class="leading-icon" part="leading-icon"
|
|
5572
|
+
`]}render(){let e=!!this.icon||!!this.prefix,t=!!this.trailingIcon||!!this.suffix||!!this.suffixButtonIcon||this._hasSuffixSlot,n=!!this.value||!!this.placeholder,r={field:!0,label:!!this.label,fill:this.variant===`filled`,border:this.variant===`outlined`,small:this.size===`small`,large:this.size===`large`,extra:this.size===`extra`,prefix:e,suffix:t,"suffix-action-field":!!this.suffixButtonIcon||this._hasSuffixSlot,invalid:this.error,round:this.shape===`round`&&this.variant!==`underlined`,"small-round":this.shape===`small-round`&&this.variant!==`underlined`,square:this.shape===`no-round`},i=this.placeholder||(this.label?` `:``),a=this.icon?L`<i class="leading-icon" part="leading-icon"
|
|
5551
5573
|
><moni-icon name="${this.icon}"></moni-icon
|
|
5552
5574
|
></i>`:this.prefix?L`<span class="leading-icon" part="prefix"
|
|
5553
5575
|
>${this.prefix}</span
|
|
Binary file
|
|
Binary file
|