@moni-labs/moni-ui 0.4.0 → 0.4.2
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/README.md +49 -0
- package/custom-elements.json +36 -0
- package/dist/browser/moni-ui.iife.min.js +7118 -0
- 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 -0
- package/dist/browser/moni-ui.min.css +1 -0
- package/dist/browser/moni-ui.min.css.br +0 -0
- package/dist/browser/moni-ui.min.css.gz +0 -0
- package/dist/browser/moni-ui.min.css.map +1 -0
- package/dist/browser/moni-ui.min.js +16903 -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 -0
- package/dist/browser.d.ts +7 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +6 -0
- package/dist/cdn/chunks/base-BIpe3L86.js +1 -0
- package/dist/cdn/chunks/class-map-DBljv-_e.js +1 -0
- package/dist/cdn/chunks/decorate-DxX3e27g.js +738 -0
- package/dist/cdn/chunks/directive-BSZPiF1A.js +1 -0
- package/dist/cdn/chunks/event-emitter-CGhsijUg.js +1 -0
- package/dist/cdn/chunks/gsap-DWxn8li7.js +1 -0
- package/dist/cdn/chunks/if-defined-CuEAJKpp.js +1 -0
- package/dist/cdn/chunks/live-B7Rjg1kt.js +1 -0
- package/dist/cdn/chunks/query-SWT-tzvq.js +1 -0
- package/dist/cdn/chunks/query-assigned-elements-BBHe1xEY.js +1 -0
- package/dist/cdn/components/moni-app-bar.js +118 -0
- package/dist/cdn/components/moni-badge.js +69 -0
- package/dist/cdn/components/moni-bottom-sheet.js +143 -0
- package/dist/cdn/components/moni-button-group.js +56 -0
- package/dist/cdn/components/moni-button-segment.js +272 -0
- package/dist/cdn/components/moni-button.js +602 -0
- package/dist/cdn/components/moni-card.js +143 -0
- package/dist/cdn/components/moni-carousel.js +311 -0
- package/dist/cdn/components/moni-checkbox.js +137 -0
- package/dist/cdn/components/moni-chip.js +218 -0
- package/dist/cdn/components/moni-color-field.js +54 -0
- package/dist/cdn/components/moni-context-menu.js +24 -0
- package/dist/cdn/components/moni-dialog.js +191 -0
- package/dist/cdn/components/moni-divider.js +32 -0
- package/dist/cdn/components/moni-expansion.js +50 -0
- package/dist/cdn/components/moni-fab-menu.js +57 -0
- package/dist/cdn/components/moni-fab.js +103 -0
- package/dist/cdn/components/moni-file-field.js +45 -0
- package/dist/cdn/components/moni-icon.js +55 -0
- package/dist/cdn/components/moni-list-item.js +144 -0
- package/dist/cdn/components/moni-list.js +16 -0
- package/dist/cdn/components/moni-loading-indicator.js +134 -0
- package/dist/cdn/components/moni-menu-item.js +45 -0
- package/dist/cdn/components/moni-menu.js +165 -0
- package/dist/cdn/components/moni-morph-modal.js +157 -0
- package/dist/cdn/components/moni-nav-item.js +153 -0
- package/dist/cdn/components/moni-nav.js +161 -0
- package/dist/cdn/components/moni-progress.js +420 -0
- package/dist/cdn/components/moni-radio.js +154 -0
- package/dist/cdn/components/moni-ripple.js +55 -0
- package/dist/cdn/components/moni-segmented-button.js +32 -0
- package/dist/cdn/components/moni-select-option.js +47 -0
- package/dist/cdn/components/moni-select.js +503 -0
- package/dist/cdn/components/moni-shape.js +99 -0
- package/dist/cdn/components/moni-side-sheet.js +234 -0
- package/dist/cdn/components/moni-slider.js +252 -0
- package/dist/cdn/components/moni-snackbar.js +91 -0
- package/dist/cdn/components/moni-split-button.js +110 -0
- package/dist/cdn/components/moni-step.js +111 -0
- package/dist/cdn/components/moni-stepper.js +25 -0
- package/dist/cdn/components/moni-switch.js +169 -0
- package/dist/cdn/components/moni-tab.js +93 -0
- package/dist/cdn/components/moni-tabs.js +38 -0
- package/dist/cdn/components/moni-text-field.js +83 -0
- package/dist/cdn/components/moni-textarea.js +46 -0
- package/dist/cdn/components/moni-time-picker.js +496 -0
- package/dist/cdn/components/moni-toolbar.js +71 -0
- package/dist/cdn/components/moni-tooltip.js +161 -0
- package/dist/cdn/components/moni-typography.js +117 -0
- package/dist/cdn/importmap.json +102 -0
- package/dist/cdn/moni-ui.min.css +1 -0
- package/package.json +8 -1
- package/src/browser.ts +6 -0
- package/src/types/css.d.ts +4 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import{d as e,i as t,m as n,o as r,r as i,s as a,t as o}from"../chunks/decorate-DxX3e27g.js";import"./moni-icon.js";var s=class extends t{constructor(...e){super(...e),this.title=``,this.description=``,this.active=!1,this.completed=!1,this.icon=``,this.index=0,this.orientation=`horizontal`}static{this.styles=[i,n`
|
|
2
|
+
:host {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
text-align: center;
|
|
7
|
+
gap: 0.5rem;
|
|
8
|
+
font-family: var(--font);
|
|
9
|
+
color: var(--on-surface-variant);
|
|
10
|
+
position: relative;
|
|
11
|
+
flex: 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host(:not(:last-child))::after {
|
|
15
|
+
content: '';
|
|
16
|
+
position: absolute;
|
|
17
|
+
inset-inline-start: calc(50% + 1rem);
|
|
18
|
+
inset-inline-end: calc(-50% + 1rem - var(--_stepper-gap, 0.5rem));
|
|
19
|
+
inset-block-start: 1rem;
|
|
20
|
+
block-size: 0.0625rem;
|
|
21
|
+
transform: translateY(-50%);
|
|
22
|
+
background-color: var(--outline-variant);
|
|
23
|
+
z-index: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([orientation='vertical']) {
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
align-items: flex-start;
|
|
29
|
+
text-align: start;
|
|
30
|
+
gap: 1rem;
|
|
31
|
+
min-block-size: 4rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Conector vertical. Geometría: el punto (dot) ocupa y=0 a y=2rem en
|
|
35
|
+
la parte superior del paso (el host es flex de columna con min-block-size 4rem).
|
|
36
|
+
El conector va desde la parte INFERIOR del punto actual (y=2rem) hasta
|
|
37
|
+
la parte INFERIOR del paso actual (y=100%). Esta fórmula se mantiene
|
|
38
|
+
calibrada independientemente de la altura del paso. */
|
|
39
|
+
:host([orientation='vertical']:not(:last-child))::after {
|
|
40
|
+
position: absolute;
|
|
41
|
+
inset-inline-start: calc(1rem - 0.03125rem);
|
|
42
|
+
inset-block-start: 2rem;
|
|
43
|
+
inset-inline-end: auto;
|
|
44
|
+
inline-size: 0.0625rem;
|
|
45
|
+
block-size: calc(100% - 2rem + var(--_stepper-gap, 0.5rem));
|
|
46
|
+
transform: none;
|
|
47
|
+
z-index: 0;
|
|
48
|
+
margin: 0;
|
|
49
|
+
background-color: var(--outline-variant);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.dot {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
inline-size: 2rem;
|
|
57
|
+
block-size: 2rem;
|
|
58
|
+
border-radius: 50%;
|
|
59
|
+
background-color: var(--surface-container);
|
|
60
|
+
color: var(--on-surface-variant);
|
|
61
|
+
font-size: 0.875rem;
|
|
62
|
+
font-weight: 500;
|
|
63
|
+
flex: none;
|
|
64
|
+
z-index: 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([active]) .dot {
|
|
68
|
+
background-color: var(--primary);
|
|
69
|
+
color: var(--on-primary);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host([completed]) .dot {
|
|
73
|
+
background-color: var(--primary);
|
|
74
|
+
color: var(--on-primary);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([active]) .text {
|
|
78
|
+
color: var(--on-surface);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.text {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
min-inline-size: 0;
|
|
85
|
+
z-index: 1;
|
|
86
|
+
}
|
|
87
|
+
.title {
|
|
88
|
+
font-size: 0.875rem;
|
|
89
|
+
font-weight: 500;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
text-overflow: ellipsis;
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
}
|
|
94
|
+
.description {
|
|
95
|
+
font-size: 0.75rem;
|
|
96
|
+
opacity: 0.7;
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
text-overflow: ellipsis;
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
}
|
|
101
|
+
`]}render(){let t=this.completed?e`<moni-icon name="check"></moni-icon>`:this.icon?e`<moni-icon name="${this.icon}"></moni-icon>`:e`${this.index+1}`;return e`
|
|
102
|
+
<span class="dot" part="dot">${t}</span>
|
|
103
|
+
<div class="text" part="text">
|
|
104
|
+
<span class="title" part="title"
|
|
105
|
+
><slot>${this.title}</slot></span
|
|
106
|
+
>
|
|
107
|
+
<span class="description" part="description"
|
|
108
|
+
>${this.description}</span
|
|
109
|
+
>
|
|
110
|
+
</div>
|
|
111
|
+
`}};o([r({reflect:!0})],s.prototype,`title`,void 0),o([r({reflect:!0})],s.prototype,`description`,void 0),o([r({type:Boolean,reflect:!0})],s.prototype,`active`,void 0),o([r({type:Boolean,reflect:!0})],s.prototype,`completed`,void 0),o([r({reflect:!0})],s.prototype,`icon`,void 0),o([r({type:Number,reflect:!0})],s.prototype,`index`,void 0),o([r({reflect:!0})],s.prototype,`orientation`,void 0),s=o([a(`moni-step`)],s);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{d as e,i as t,m as n,o as r,r as i,s as a,t as o}from"../chunks/decorate-DxX3e27g.js";import{t as s}from"../chunks/query-assigned-elements-BBHe1xEY.js";var c=class extends t{constructor(...e){super(...e),this.orientation=`horizontal`,this.current=0,this._onSlotChange=()=>{this._syncSteps()}}updated(e){(e.has(`current`)||e.has(`orientation`)||e.size===0)&&this._syncSteps()}_syncSteps(){Promise.resolve().then(()=>{let e=this._steps||[];e.length===0&&(e=Array.from(this.querySelectorAll(`moni-step`))),e.forEach((e,t)=>{e.index=t,e.orientation=this.orientation,e.completed=t<this.current,e.active=t===this.current})})}static{this.styles=[i,n`
|
|
2
|
+
:host {
|
|
3
|
+
--_stepper-gap: 0.5rem;
|
|
4
|
+
display: block;
|
|
5
|
+
font-family: var(--font);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.list {
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: var(--_stepper-gap);
|
|
11
|
+
padding: 0;
|
|
12
|
+
margin: 0;
|
|
13
|
+
list-style: none;
|
|
14
|
+
}
|
|
15
|
+
:host([orientation='vertical']) .list {
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
::slotted(*) {
|
|
20
|
+
flex: 1;
|
|
21
|
+
min-inline-size: 0;
|
|
22
|
+
}
|
|
23
|
+
`]}render(){return e`<ol class="list" part="stepper">
|
|
24
|
+
<slot @slotchange=${this._onSlotChange}></slot>
|
|
25
|
+
</ol>`}};o([r({reflect:!0})],c.prototype,`orientation`,void 0),o([r({type:Number,reflect:!0})],c.prototype,`current`,void 0),o([s({selector:`moni-step`})],c.prototype,`_steps`,void 0),c=o([a(`moni-stepper`)],c);
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import{d as e,i as t,m as n,o as r,r as i,s as a,t as o}from"../chunks/decorate-DxX3e27g.js";import{t as s}from"../chunks/query-SWT-tzvq.js";import"./moni-icon.js";import{t as c}from"../chunks/if-defined-CuEAJKpp.js";var l=class extends t{static{this.formAssociated=!0}constructor(){super(),this.label=``,this.checked=!1,this.disabled=!1,this.icon=!1,this.uncheckedIcon=``,this.checkedIcon=``,this.name=``,this.value=``,this._internals=this.attachInternals()}updated(e){this._input&&(e.has(`checked`)&&(this._input.checked=this.checked,this._internals?.setFormValue?.(this.checked?this.value||`on`:null)),e.has(`disabled`)&&(this._input.disabled=this.disabled))}_onChange(e){this.checked=e.target.checked,this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))}static{this.styles=[i,n`
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
font-family: var(--font);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.switch {
|
|
8
|
+
--_thumb: 1rem; /* 16dp unselected (M3) */
|
|
9
|
+
--_track-w: 3.25rem; /* 52dp */
|
|
10
|
+
--_track-h: 2rem; /* 32dp */
|
|
11
|
+
inline-size: auto;
|
|
12
|
+
block-size: auto;
|
|
13
|
+
line-height: normal;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
direction: ltr;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Input hit area: 52dp × 32dp track */
|
|
22
|
+
.switch > input {
|
|
23
|
+
inline-size: var(--_track-w);
|
|
24
|
+
block-size: var(--_track-h);
|
|
25
|
+
opacity: 0;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
flex: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Text label span */
|
|
31
|
+
.switch > span {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
color: var(--on-surface);
|
|
35
|
+
font-size: 0.875rem;
|
|
36
|
+
position: relative;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Track */
|
|
40
|
+
.switch > span::after {
|
|
41
|
+
content: "";
|
|
42
|
+
position: absolute;
|
|
43
|
+
inset: 50% auto auto 0;
|
|
44
|
+
background-color: var(--surface-container-highest);
|
|
45
|
+
border: 0.125rem solid var(--outline);
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
inline-size: var(--_track-w);
|
|
48
|
+
block-size: var(--_track-h);
|
|
49
|
+
border-radius: var(--_track-h);
|
|
50
|
+
/* Shift the track to sit behind the input (input is to the left) */
|
|
51
|
+
transform: translate(calc(-1 * var(--_track-w)), -50%);
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
transition: background-color var(--speed2), border-color var(--speed2);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Thumb (handle) */
|
|
57
|
+
.switch > span::before,
|
|
58
|
+
.switch.icon > span > i {
|
|
59
|
+
position: absolute;
|
|
60
|
+
inset: 50% auto auto 0;
|
|
61
|
+
display: inline-flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
border-radius: 50%;
|
|
65
|
+
transition: all var(--speed2);
|
|
66
|
+
font-size: calc(var(--_thumb) - 0.25rem);
|
|
67
|
+
user-select: none;
|
|
68
|
+
min-inline-size: var(--_thumb);
|
|
69
|
+
min-block-size: var(--_thumb);
|
|
70
|
+
content: "";
|
|
71
|
+
color: var(--on-surface-variant);
|
|
72
|
+
background-color: var(--outline);
|
|
73
|
+
/* Unchecked: 16dp thumb sits 2dp from track start */
|
|
74
|
+
transform: translate(calc(-1 * var(--_track-w) + 0.25rem), -50%);
|
|
75
|
+
z-index: 2;
|
|
76
|
+
pointer-events: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Icon mode uses a 24dp thumb at rest */
|
|
80
|
+
.switch.icon > span > i {
|
|
81
|
+
--_thumb: 1.5rem;
|
|
82
|
+
transform: translate(calc(-1 * var(--_track-w) + 0.25rem), -50%);
|
|
83
|
+
font-family: var(--font-icon);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* 40dp circular state layer behind the thumb on hover/focus */
|
|
87
|
+
.switch > span::before,
|
|
88
|
+
.switch.icon > span > i {
|
|
89
|
+
box-shadow: 0 0 0 0 transparent;
|
|
90
|
+
}
|
|
91
|
+
.switch > input:not(:disabled):is(:focus, :hover) + span::before,
|
|
92
|
+
.switch.icon > input:not(:disabled):is(:focus, :hover) + span > i {
|
|
93
|
+
box-shadow: 0 0 0 0.5rem color-mix(in srgb, var(--on-surface) 8%, transparent);
|
|
94
|
+
}
|
|
95
|
+
.switch > input:not(:disabled):is(:focus, :hover):checked + span::before,
|
|
96
|
+
.switch.icon > input:not(:disabled):is(:focus, :hover):checked + span > i {
|
|
97
|
+
box-shadow: 0 0 0 0.5rem color-mix(in srgb, var(--primary) 12%, transparent);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Checked: track fills with primary */
|
|
101
|
+
.switch > input:checked + span::after {
|
|
102
|
+
border: none;
|
|
103
|
+
background-color: var(--primary);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Checked: thumb grows to 24dp and slides right */
|
|
107
|
+
.switch > input:checked + span::before {
|
|
108
|
+
--_thumb: 1.5rem;
|
|
109
|
+
content: "";
|
|
110
|
+
color: var(--primary);
|
|
111
|
+
background-color: var(--on-primary);
|
|
112
|
+
transform: translate(calc(-1.75rem), -50%);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* Checked icon mode: show check icon */
|
|
116
|
+
.switch.icon > input:checked + span > i {
|
|
117
|
+
content: "check";
|
|
118
|
+
color: var(--primary);
|
|
119
|
+
background-color: var(--on-primary);
|
|
120
|
+
transform: translate(-1.75rem, -50%);
|
|
121
|
+
font-family: var(--font-icon);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Active (pressed) states: 28dp thumb */
|
|
125
|
+
.switch > input:active:not(:disabled) + span::before {
|
|
126
|
+
--_thumb: 1.75rem;
|
|
127
|
+
/* Preserve the 16dp resting thumb's center while growing to 28dp. */
|
|
128
|
+
transform: translate(calc(-1 * var(--_track-w) - 0.125rem), -50%);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.switch.icon > input:active:not(:disabled) + span > i {
|
|
132
|
+
--_thumb: 1.75rem;
|
|
133
|
+
/* Icon thumbs rest at 24dp, so 28dp adds 2dp on each side. */
|
|
134
|
+
transform: translate(calc(-1 * var(--_track-w) + 0.125rem), -50%);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.switch > input:active:checked:not(:disabled) + span::before,
|
|
138
|
+
.switch.icon > input:active:checked:not(:disabled) + span > i {
|
|
139
|
+
--_thumb: 1.75rem;
|
|
140
|
+
/* Keep the checked thumb centered at 36dp while it grows. */
|
|
141
|
+
transform: translate(-1.875rem, -50%);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Disabled */
|
|
145
|
+
.switch > input:disabled + span {
|
|
146
|
+
opacity: 0.5;
|
|
147
|
+
cursor: not-allowed;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* Focus outline on the track */
|
|
151
|
+
.switch > :focus-visible + span::after {
|
|
152
|
+
outline: 0.125rem solid var(--primary);
|
|
153
|
+
outline-offset: 0.25rem;
|
|
154
|
+
}
|
|
155
|
+
`]}render(){let t=this.icon||!!(this.uncheckedIcon||this.checkedIcon),n=this.uncheckedIcon||(this.icon?`close`:``),r=this.checkedIcon||(this.icon?`check`:``),i=this.checked?r:n;return e`<label class=${t?`switch icon`:`switch`} part="switch">
|
|
156
|
+
<input
|
|
157
|
+
type="checkbox"
|
|
158
|
+
role="switch"
|
|
159
|
+
.checked=${this.checked}
|
|
160
|
+
?disabled=${this.disabled}
|
|
161
|
+
name=${c(this.name||void 0)}
|
|
162
|
+
value=${c(this.value||void 0)}
|
|
163
|
+
@change=${this._onChange}
|
|
164
|
+
/>
|
|
165
|
+
<span>
|
|
166
|
+
${t?e`<i>${i}</i>`:``}
|
|
167
|
+
${this.label?e`<span class="label" part="label"> ${this.label}</span>`:e`<slot></slot>`}
|
|
168
|
+
</span>
|
|
169
|
+
</label>`}};o([r({reflect:!0})],l.prototype,`label`,void 0),o([r({type:Boolean,reflect:!0})],l.prototype,`checked`,void 0),o([r({type:Boolean,reflect:!0})],l.prototype,`disabled`,void 0),o([r({type:Boolean,reflect:!0})],l.prototype,`icon`,void 0),o([r({reflect:!0,attribute:`unchecked-icon`})],l.prototype,`uncheckedIcon`,void 0),o([r({reflect:!0,attribute:`checked-icon`})],l.prototype,`checkedIcon`,void 0),o([r({reflect:!0})],l.prototype,`name`,void 0),o([r({reflect:!0})],l.prototype,`value`,void 0),o([s(`input`)],l.prototype,`_input`,void 0),l=o([a(`moni-switch`)],l);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import{d as e,i as t,m as n,o as r,r as i,s as a,t as o}from"../chunks/decorate-DxX3e27g.js";import"./moni-icon.js";var s=class extends t{constructor(...e){super(...e),this.active=!1,this.icon=``,this.label=``,this.href=`#`}static{this.styles=[i,n`
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
font-family: var(--font);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host-context(moni-tabs[vertical]) {
|
|
8
|
+
display: flex;
|
|
9
|
+
inline-size: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
a {
|
|
13
|
+
position: relative;
|
|
14
|
+
display: flex;
|
|
15
|
+
font-size: 0.875rem;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
color: var(--on-surface-variant);
|
|
18
|
+
padding: 0.5rem 1rem;
|
|
19
|
+
text-align: center;
|
|
20
|
+
min-block-size: 3rem;
|
|
21
|
+
inline-size: 100%;
|
|
22
|
+
gap: 0.25rem;
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
transition: color var(--speed2);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host-context(moni-tabs[vertical]) a {
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
gap: 0.25rem;
|
|
33
|
+
min-block-size: 4.5rem;
|
|
34
|
+
border-inline-end: 0.125rem solid transparent;
|
|
35
|
+
border-block-end: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
a:hover {
|
|
39
|
+
color: var(--primary);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
a.active,
|
|
43
|
+
a.active > * {
|
|
44
|
+
color: var(--primary);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
a.active::before {
|
|
48
|
+
content: '';
|
|
49
|
+
position: absolute;
|
|
50
|
+
inset: auto 0 0 0;
|
|
51
|
+
/* M3 Expressive: indicator thickness 3dp. */
|
|
52
|
+
block-size: 0.1875rem;
|
|
53
|
+
/* M3 Expressive default: full tab width. */
|
|
54
|
+
border-radius: 0.75rem;
|
|
55
|
+
background-color: var(--primary);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host-context(moni-tabs[vertical]) a.active::before {
|
|
59
|
+
inset: 0 0 0 auto;
|
|
60
|
+
inline-size: 0.1875rem;
|
|
61
|
+
block-size: auto;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* M3 indicator-size='min': 24dp de altura (centrado en la pestaña) con
|
|
65
|
+
radio superior/inferior de 8dp — coincide con la especificación M3 § Indicator anatomy. */
|
|
66
|
+
:host-context(moni-tabs[indicator-size='min']) a.active::before {
|
|
67
|
+
margin: 0 auto;
|
|
68
|
+
max-inline-size: min(100%, 4rem);
|
|
69
|
+
block-size: 1.5rem;
|
|
70
|
+
border-radius: 0.5rem;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host-context(moni-tabs[vertical][indicator-size='min'])
|
|
74
|
+
a.active::before {
|
|
75
|
+
margin: auto 0;
|
|
76
|
+
max-block-size: 4rem;
|
|
77
|
+
max-inline-size: 0.1875rem;
|
|
78
|
+
border-radius: 0.5rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* M3 indicator-size='max': altura completa de la pestaña, sin redondeo. */
|
|
82
|
+
:host-context(moni-tabs[indicator-size='max']) a.active::before {
|
|
83
|
+
border-radius: 0;
|
|
84
|
+
}
|
|
85
|
+
`]}render(){return e`<a
|
|
86
|
+
href=${this.href||`#`}
|
|
87
|
+
class=${this.active?`active`:``}
|
|
88
|
+
part="tab"
|
|
89
|
+
aria-selected=${this.active}
|
|
90
|
+
>
|
|
91
|
+
${this.icon?e`<moni-icon name="${this.icon}" part="icon"></moni-icon>`:e`<slot name="icon"></slot>`}
|
|
92
|
+
<span part="label"><slot>${this.label}</slot></span>
|
|
93
|
+
</a>`}};o([r({type:Boolean,reflect:!0})],s.prototype,`active`,void 0),o([r({reflect:!0})],s.prototype,`icon`,void 0),o([r({reflect:!0})],s.prototype,`label`,void 0),o([r({reflect:!0})],s.prototype,`href`,void 0),s=o([a(`moni-tab`)],s);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import{d as e,i as t,m as n,o as r,r as i,s as a,t as o}from"../chunks/decorate-DxX3e27g.js";var s=class extends t{constructor(...e){super(...e),this.mode=`primary`,this.scrollable=!1,this.vertical=!1,this.align=`default`,this.indicatorSize=`default`}static{this.styles=[i,n`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
font-family: var(--font);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
nav {
|
|
8
|
+
display: flex;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
border-block-end: 0.0625rem solid var(--surface-variant);
|
|
11
|
+
border-radius: 0;
|
|
12
|
+
overflow-x: auto;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
nav.left-align {
|
|
16
|
+
justify-content: flex-start;
|
|
17
|
+
}
|
|
18
|
+
nav.center-align {
|
|
19
|
+
justify-content: center;
|
|
20
|
+
}
|
|
21
|
+
nav.right-align {
|
|
22
|
+
justify-content: flex-end;
|
|
23
|
+
}
|
|
24
|
+
:host(:not([align])) nav,
|
|
25
|
+
nav:not(.left-align):not(.center-align):not(.right-align) {
|
|
26
|
+
justify-content: space-around;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([vertical]) nav {
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
border-block-end: none;
|
|
32
|
+
border-inline-end: 0.0625rem solid var(--surface-variant);
|
|
33
|
+
overflow-x: visible;
|
|
34
|
+
overflow-y: auto;
|
|
35
|
+
}
|
|
36
|
+
`]}render(){let t=[`tabs`,this.align==="default"?``:`${this.align}-align`,this.indicatorSize==="default"?``:this.indicatorSize,this.mode,this.vertical?`vertical`:``].filter(Boolean).join(` `);return e`<nav class=${t} part="tabs">
|
|
37
|
+
<slot></slot>
|
|
38
|
+
</nav>`}};o([r({reflect:!0})],s.prototype,`mode`,void 0),o([r({type:Boolean,reflect:!0})],s.prototype,`scrollable`,void 0),o([r({type:Boolean,reflect:!0})],s.prototype,`vertical`,void 0),o([r({reflect:!0})],s.prototype,`align`,void 0),o([r({reflect:!0,attribute:`indicator-size`})],s.prototype,`indicatorSize`,void 0),s=o([a(`moni-tabs`)],s);
|