@moni-labs/moni-ui 0.4.8 → 0.4.9
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 +10 -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 +10 -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-C4FUGLfQ.js} +1 -1
- package/dist/cdn/chunks/{decorate-D4jKxi6H.js → decorate-C9xO7mby.js} +7 -0
- package/dist/cdn/chunks/if-defined-6foei_QT.js +1 -0
- package/dist/cdn/chunks/{live-DdUrWiUp.js → live-DcFRrlh7.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 +7 -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 +7 -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
|
@@ -143,6 +143,13 @@ export const fieldStyles = css`
|
|
|
143
143
|
.field[class*='round'].extra {
|
|
144
144
|
border-radius: 2rem;
|
|
145
145
|
}
|
|
146
|
+
/* Compact rounding for dense forms without falling back to square corners. */
|
|
147
|
+
.field.small-round,
|
|
148
|
+
.field.small-round.small,
|
|
149
|
+
.field.small-round.large,
|
|
150
|
+
.field.small-round.extra {
|
|
151
|
+
border-radius: 0.5rem;
|
|
152
|
+
}
|
|
146
153
|
|
|
147
154
|
/* ─── Icon positioning ───────────────────────────────────────────────────── */
|
|
148
155
|
/* Generic rule: absolutely positions any icon/image/svg inside the field. */
|
|
@@ -23,6 +23,14 @@ describe('moni-select', () => {
|
|
|
23
23
|
expect(input?.getAttribute('readonly')).toBe('');
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
+
it('aplica la clase small-round para un redondeado compacto', async () => {
|
|
27
|
+
el.shape = 'small-round';
|
|
28
|
+
await el.updateComplete;
|
|
29
|
+
const field = el.shadowRoot?.querySelector('.field');
|
|
30
|
+
expect(field?.classList.contains('small-round')).toBe(true);
|
|
31
|
+
expect(field?.classList.contains('square')).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
|
|
26
34
|
it('analiza las opciones insertadas en slots (slotted)', async () => {
|
|
27
35
|
const opt1 = document.createElement('moni-select-option');
|
|
28
36
|
opt1.setAttribute('value', 'v1');
|
|
@@ -146,11 +146,11 @@ export class MoniSelect extends MoniElement {
|
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* Forma (radio de borde) del campo.
|
|
149
|
-
* @type {'round' | 'square' | 'no-round'}
|
|
149
|
+
* @type {'round' | 'small-round' | 'square' | 'no-round'}
|
|
150
150
|
* @default 'no-round'
|
|
151
151
|
*/
|
|
152
152
|
@property({ reflect: true })
|
|
153
|
-
shape: 'round' | 'square' | 'no-round' = 'no-round';
|
|
153
|
+
shape: 'round' | 'small-round' | 'square' | 'no-round' = 'no-round';
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* Deshabilita el campo select.
|
|
@@ -1694,6 +1694,7 @@ export class MoniSelect extends MoniElement {
|
|
|
1694
1694
|
suffix: true,
|
|
1695
1695
|
invalid: this.error,
|
|
1696
1696
|
round: this.shape === 'round',
|
|
1697
|
+
'small-round': this.shape === 'small-round',
|
|
1697
1698
|
square: this.shape === 'no-round'
|
|
1698
1699
|
};
|
|
1699
1700
|
|
|
@@ -86,6 +86,14 @@ describe('moni-text-field', () => {
|
|
|
86
86
|
expect(field?.classList.contains('round')).toBe(true);
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
+
it('aplica la clase small-round para un redondeado compacto', async () => {
|
|
90
|
+
el.shape = 'small-round';
|
|
91
|
+
await el.updateComplete;
|
|
92
|
+
const field = el.shadowRoot?.querySelector('.field');
|
|
93
|
+
expect(field?.classList.contains('small-round')).toBe(true);
|
|
94
|
+
expect(field?.classList.contains('square')).toBe(false);
|
|
95
|
+
});
|
|
96
|
+
|
|
89
97
|
it('renderiza underlined sin fondo, contorno completo ni forma redondeada', async () => {
|
|
90
98
|
el.variant = 'underlined';
|
|
91
99
|
el.shape = 'round';
|
|
@@ -106,11 +106,11 @@ export class MoniTextField extends MoniElement {
|
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
108
|
* Forma del radio del borde (border-radius) del campo.
|
|
109
|
-
* @type {'round' | 'no-round'}
|
|
109
|
+
* @type {'round' | 'small-round' | 'no-round'}
|
|
110
110
|
* @default 'no-round'
|
|
111
111
|
*/
|
|
112
112
|
@property({ reflect: true })
|
|
113
|
-
shape: 'round' | 'no-round' = 'no-round';
|
|
113
|
+
shape: 'round' | 'small-round' | 'no-round' = 'no-round';
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* El tipo de input HTML nativo.
|
|
@@ -544,6 +544,7 @@ export class MoniTextField extends MoniElement {
|
|
|
544
544
|
'suffix-action-field': Boolean(this.suffixButtonIcon) || this._hasSuffixSlot,
|
|
545
545
|
invalid: this.error,
|
|
546
546
|
round: this.shape === 'round' && this.variant !== 'underlined',
|
|
547
|
+
'small-round': this.shape === 'small-round' && this.variant !== 'underlined',
|
|
547
548
|
square: this.shape === 'no-round'
|
|
548
549
|
};
|
|
549
550
|
const placeholder = this.placeholder || (this.label ? ' ' : '');
|
|
@@ -97,6 +97,14 @@ describe('moni-textarea', () => {
|
|
|
97
97
|
expect(field?.classList.contains('round')).toBe(true);
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
+
it('aplica la clase small-round para un redondeado compacto', async () => {
|
|
101
|
+
el.shape = 'small-round';
|
|
102
|
+
await el.updateComplete;
|
|
103
|
+
const field = el.shadowRoot?.querySelector('.field');
|
|
104
|
+
expect(field?.classList.contains('small-round')).toBe(true);
|
|
105
|
+
expect(field?.classList.contains('square')).toBe(false);
|
|
106
|
+
});
|
|
107
|
+
|
|
100
108
|
it('no aplica la clase de forma (shape) en el contenedor de campo para shape=square', async () => {
|
|
101
109
|
el.shape = 'square';
|
|
102
110
|
await el.updateComplete;
|
|
@@ -98,11 +98,11 @@ export class MoniTextarea extends MoniElement {
|
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* Forma del radio del borde (border-radius) del campo.
|
|
101
|
-
* @type {'round' | 'square' | 'no-round'}
|
|
101
|
+
* @type {'round' | 'small-round' | 'square' | 'no-round'}
|
|
102
102
|
* @default 'no-round'
|
|
103
103
|
*/
|
|
104
104
|
@property({ reflect: true })
|
|
105
|
-
shape: 'round' | 'square' | 'no-round' = 'no-round';
|
|
105
|
+
shape: 'round' | 'small-round' | 'square' | 'no-round' = 'no-round';
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
108
|
* Nombre del icono inicial (leading) (Material Symbols).
|
|
@@ -364,6 +364,7 @@ export class MoniTextarea extends MoniElement {
|
|
|
364
364
|
suffix: hasTrailing,
|
|
365
365
|
invalid: this.error,
|
|
366
366
|
round: this.shape === 'round',
|
|
367
|
+
'small-round': this.shape === 'small-round',
|
|
367
368
|
square: this.shape === 'no-round'
|
|
368
369
|
};
|
|
369
370
|
const placeholder = this.placeholder || (this.label ? ' ' : '');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./decorate-D4jKxi6H.js";var t=t=>t??e;export{t};
|