@moni-labs/moni-ui 0.4.1 → 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 +28 -3
- package/custom-elements.json +6 -6
- 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 +3 -1
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
import{a as e,d as t,i as n,m as r,o as i,r as a,s as o,t as s}from"../chunks/decorate-DxX3e27g.js";import"./moni-icon.js";import{t as c}from"../chunks/if-defined-CuEAJKpp.js";import"./moni-progress.js";var l,u=class extends n{static{l=this}constructor(...e){super(...e),this._hasLabel=!1,this.variant=`filled`,this.size=`small`,this.shape=`round`,this.disabled=!1,this.loading=!1,this.active=!1,this.icon=``,this.iconTrailing=``,this.type=`button`,this.href=``,this.target=``}static{this._deprecationWarned=!1}connectedCallback(){super.connectedCallback(),this._hasLabel=this._hasDefaultSlotContent(this.childNodes),!l._deprecationWarned&&this.size===`extra`&&(l._deprecationWarned=!0,console.warn(`[moni-ui] <moni-button size="extra"> is deprecated since v0.3.1. Material Design 3 Expressive uses "xlarge". See m3-docs/components/buttons/overview.md § Sizes.`))}_hasDefaultSlotContent(e){return Array.from(e).some(e=>e.nodeType===Node.TEXT_NODE?!!e.textContent?.trim():e instanceof Element&&!e.hasAttribute(`slot`))}_handleLabelSlotChange(e){let t=e.currentTarget;this._hasLabel=this._hasDefaultSlotContent(t.assignedNodes({flatten:!0}))}static{this.styles=[a,r`
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
vertical-align: middle;
|
|
5
|
+
font-family: var(--font);
|
|
6
|
+
position: relative;
|
|
7
|
+
user-select: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.button {
|
|
11
|
+
box-sizing: var(--moni-button-box-sizing, border-box);
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
--_button-visual-height: 3.5rem;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
--_button-icon-size: var(--moni-button-icon-size, 1.5rem);
|
|
17
|
+
block-size: var(--moni-button-height, 3.5rem);
|
|
18
|
+
font-size: var(--moni-button-font-size, 1rem);
|
|
19
|
+
font-weight: 500;
|
|
20
|
+
color: var(--on-primary);
|
|
21
|
+
padding: var(--moni-button-padding, 0 1.5rem);
|
|
22
|
+
background-color: var(--primary);
|
|
23
|
+
border: 0.0625rem solid transparent;
|
|
24
|
+
border-radius: 999px;
|
|
25
|
+
transition:
|
|
26
|
+
transform 250ms cubic-bezier(0.2, 0, 0, 1),
|
|
27
|
+
border-radius 200ms cubic-bezier(0.2, 0, 0, 1),
|
|
28
|
+
padding 250ms cubic-bezier(0.2, 0, 0, 1),
|
|
29
|
+
background-color 200ms cubic-bezier(0.2, 0, 0, 1),
|
|
30
|
+
box-shadow 200ms cubic-bezier(0.2, 0, 0, 1);
|
|
31
|
+
user-select: none;
|
|
32
|
+
gap: var(--moni-button-gap, 0.5rem);
|
|
33
|
+
line-height: normal;
|
|
34
|
+
font-family: inherit;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
text-decoration: none;
|
|
37
|
+
box-shadow: none;
|
|
38
|
+
position: relative;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.button::after {
|
|
42
|
+
content: '';
|
|
43
|
+
position: absolute;
|
|
44
|
+
top: 50%;
|
|
45
|
+
left: 50%;
|
|
46
|
+
min-width: 3rem; /* 48px minimum touch target */
|
|
47
|
+
min-height: 3rem; /* 48px minimum touch target */
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: 100%;
|
|
50
|
+
transform: translate(-50%, -50%);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Sizes */
|
|
54
|
+
.button.xsmall {
|
|
55
|
+
--_button-visual-height: 2rem;
|
|
56
|
+
--_button-icon-size: var(--moni-button-icon-size, 1.25rem);
|
|
57
|
+
block-size: var(--moni-button-height, 2rem);
|
|
58
|
+
min-inline-size: var(--moni-button-min-inline-size, 0);
|
|
59
|
+
font-size: var(--moni-button-font-size, 0.875rem);
|
|
60
|
+
padding: var(--moni-button-padding, 0 0.75rem); /* 12dp; keeps 48dp touch target */
|
|
61
|
+
gap: var(--moni-button-gap, 0.25rem);
|
|
62
|
+
}
|
|
63
|
+
.button.small {
|
|
64
|
+
--_button-visual-height: 2.5rem;
|
|
65
|
+
--_button-icon-size: var(--moni-button-icon-size, 1.25rem);
|
|
66
|
+
block-size: var(--moni-button-height, 2.5rem);
|
|
67
|
+
min-inline-size: var(--moni-button-min-inline-size, 0);
|
|
68
|
+
padding: var(--moni-button-padding, 0 1rem);
|
|
69
|
+
gap: var(--moni-button-gap, 0.5rem);
|
|
70
|
+
}
|
|
71
|
+
.button.large {
|
|
72
|
+
--_button-visual-height: 6rem;
|
|
73
|
+
--_button-icon-size: var(--moni-button-icon-size, 2rem);
|
|
74
|
+
block-size: var(--moni-button-height, 6rem);
|
|
75
|
+
font-size: var(--moni-button-font-size, 1.5rem);
|
|
76
|
+
padding: var(--moni-button-padding, 0 3rem);
|
|
77
|
+
gap: var(--moni-button-gap, 0.75rem);
|
|
78
|
+
}
|
|
79
|
+
.button.xlarge,
|
|
80
|
+
.button.extra {
|
|
81
|
+
--_button-visual-height: 8.5rem;
|
|
82
|
+
--_button-icon-size: var(--moni-button-icon-size, 2.5rem);
|
|
83
|
+
block-size: var(--moni-button-height, 8.5rem);
|
|
84
|
+
font-size: var(--moni-button-font-size, 2rem);
|
|
85
|
+
padding: var(--moni-button-padding, 0 4rem);
|
|
86
|
+
gap: var(--moni-button-gap, 1rem);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Shapes */
|
|
90
|
+
/* Square keeps horizontal padding (like a normal button) but
|
|
91
|
+
drops border-radius. Only the circle removes all padding. */
|
|
92
|
+
.button.circle {
|
|
93
|
+
padding: 0 !important;
|
|
94
|
+
border-radius: 50%;
|
|
95
|
+
inline-size: var(--moni-button-height, 3.5rem);
|
|
96
|
+
min-inline-size: var(--moni-button-height, 3.5rem);
|
|
97
|
+
aspect-ratio: 1;
|
|
98
|
+
}
|
|
99
|
+
.button.round.icon-only {
|
|
100
|
+
inline-size: var(--moni-button-height, var(--_button-visual-height));
|
|
101
|
+
min-inline-size: var(--moni-button-height, var(--_button-visual-height));
|
|
102
|
+
padding-inline: 0;
|
|
103
|
+
}
|
|
104
|
+
.button.no-round {
|
|
105
|
+
border-radius: 0;
|
|
106
|
+
}
|
|
107
|
+
.button.square {
|
|
108
|
+
border-radius: 1rem;
|
|
109
|
+
}
|
|
110
|
+
.button.square.xsmall,
|
|
111
|
+
.button.square.small {
|
|
112
|
+
border-radius: 0.75rem;
|
|
113
|
+
}
|
|
114
|
+
.button.square.large,
|
|
115
|
+
.button.square.xlarge,
|
|
116
|
+
.button.square.extra {
|
|
117
|
+
border-radius: 1.75rem;
|
|
118
|
+
}
|
|
119
|
+
.button.left-round {
|
|
120
|
+
border-radius: 1.25rem 0.5rem 0.5rem 1.25rem;
|
|
121
|
+
}
|
|
122
|
+
.button.left-round.xsmall {
|
|
123
|
+
border-radius: 0.875rem 0.25rem 0.25rem 0.875rem;
|
|
124
|
+
}
|
|
125
|
+
.button.left-round.small {
|
|
126
|
+
border-radius: 1rem 0.5rem 0.5rem 1rem;
|
|
127
|
+
}
|
|
128
|
+
.button.left-round.large {
|
|
129
|
+
border-radius: 1.5rem 1rem 1rem 1.5rem;
|
|
130
|
+
}
|
|
131
|
+
.button.left-round.xlarge,
|
|
132
|
+
.button.left-round.extra {
|
|
133
|
+
border-radius: 1.75rem 1.25rem 1.25rem 1.75rem;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.button.right-round {
|
|
137
|
+
border-radius: 0.5rem 1.25rem 1.25rem 0.5rem;
|
|
138
|
+
}
|
|
139
|
+
.button.right-round.xsmall {
|
|
140
|
+
border-radius: 0.25rem 0.875rem 0.875rem 0.25rem;
|
|
141
|
+
}
|
|
142
|
+
.button.right-round.small {
|
|
143
|
+
border-radius: 0.5rem 1rem 1rem 0.5rem;
|
|
144
|
+
}
|
|
145
|
+
.button.right-round.large {
|
|
146
|
+
border-radius: 1rem 1.5rem 1.5rem 1rem;
|
|
147
|
+
}
|
|
148
|
+
.button.right-round.xlarge,
|
|
149
|
+
.button.right-round.extra {
|
|
150
|
+
border-radius: 1.25rem 1.75rem 1.75rem 1.25rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.button.top-round {
|
|
154
|
+
border-radius: 1.25rem 1.25rem 0.5rem 0.5rem;
|
|
155
|
+
}
|
|
156
|
+
.button.top-round.xsmall {
|
|
157
|
+
border-radius: 0.875rem 0.875rem 0.25rem 0.25rem;
|
|
158
|
+
}
|
|
159
|
+
.button.top-round.small {
|
|
160
|
+
border-radius: 1rem 1rem 0.5rem 0.5rem;
|
|
161
|
+
}
|
|
162
|
+
.button.top-round.large {
|
|
163
|
+
border-radius: 1.5rem 1.5rem 1rem 1rem;
|
|
164
|
+
}
|
|
165
|
+
.button.top-round.xlarge,
|
|
166
|
+
.button.top-round.extra {
|
|
167
|
+
border-radius: 1.75rem 1.75rem 1.25rem 1.25rem;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.button.bottom-round {
|
|
171
|
+
border-radius: 0.5rem 0.5rem 1.25rem 1.25rem;
|
|
172
|
+
}
|
|
173
|
+
.button.bottom-round.xsmall {
|
|
174
|
+
border-radius: 0.25rem 0.25rem 0.875rem 0.875rem;
|
|
175
|
+
}
|
|
176
|
+
.button.bottom-round.small {
|
|
177
|
+
border-radius: 0.5rem 0.5rem 1rem 1rem;
|
|
178
|
+
}
|
|
179
|
+
.button.bottom-round.large {
|
|
180
|
+
border-radius: 1rem 1rem 1.5rem 1.5rem;
|
|
181
|
+
}
|
|
182
|
+
.button.bottom-round.xlarge,
|
|
183
|
+
.button.bottom-round.extra {
|
|
184
|
+
border-radius: 1.25rem 1.25rem 1.75rem 1.75rem;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* Morph active states (square-ish equivalents) */
|
|
188
|
+
.button.left-square {
|
|
189
|
+
border-radius: 0.75rem 0.5rem 0.5rem 0.75rem;
|
|
190
|
+
}
|
|
191
|
+
.button.left-square.xsmall {
|
|
192
|
+
border-radius: 0.5rem 0.25rem 0.25rem 0.5rem;
|
|
193
|
+
}
|
|
194
|
+
.button.left-square.small {
|
|
195
|
+
border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
|
|
196
|
+
}
|
|
197
|
+
.button.left-square.large {
|
|
198
|
+
border-radius: 1rem 1rem 1rem 1rem;
|
|
199
|
+
}
|
|
200
|
+
.button.left-square.xlarge,
|
|
201
|
+
.button.left-square.extra {
|
|
202
|
+
border-radius: 1rem 1.25rem 1.25rem 1rem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.button.right-square {
|
|
206
|
+
border-radius: 0.5rem 0.75rem 0.75rem 0.5rem;
|
|
207
|
+
}
|
|
208
|
+
.button.right-square.xsmall {
|
|
209
|
+
border-radius: 0.25rem 0.5rem 0.5rem 0.25rem;
|
|
210
|
+
}
|
|
211
|
+
.button.right-square.small {
|
|
212
|
+
border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
|
|
213
|
+
}
|
|
214
|
+
.button.right-square.large {
|
|
215
|
+
border-radius: 1rem 1rem 1rem 1rem;
|
|
216
|
+
}
|
|
217
|
+
.button.right-square.xlarge,
|
|
218
|
+
.button.right-square.extra {
|
|
219
|
+
border-radius: 1.25rem 1rem 1rem 1.25rem;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.button.top-square {
|
|
223
|
+
border-radius: 0.75rem 0.75rem 0.5rem 0.5rem;
|
|
224
|
+
}
|
|
225
|
+
.button.top-square.xsmall {
|
|
226
|
+
border-radius: 0.5rem 0.5rem 0.25rem 0.25rem;
|
|
227
|
+
}
|
|
228
|
+
.button.top-square.small {
|
|
229
|
+
border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
|
|
230
|
+
}
|
|
231
|
+
.button.top-square.large {
|
|
232
|
+
border-radius: 1rem 1rem 1rem 1rem;
|
|
233
|
+
}
|
|
234
|
+
.button.top-square.xlarge,
|
|
235
|
+
.button.top-square.extra {
|
|
236
|
+
border-radius: 1rem 1rem 1.25rem 1.25rem;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.button.bottom-square {
|
|
240
|
+
border-radius: 0.5rem 0.5rem 0.75rem 0.75rem;
|
|
241
|
+
}
|
|
242
|
+
.button.bottom-square.xsmall {
|
|
243
|
+
border-radius: 0.25rem 0.25rem 0.5rem 0.5rem;
|
|
244
|
+
}
|
|
245
|
+
.button.bottom-square.small {
|
|
246
|
+
border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
|
|
247
|
+
}
|
|
248
|
+
.button.bottom-square.large {
|
|
249
|
+
border-radius: 1rem 1rem 1rem 1rem;
|
|
250
|
+
}
|
|
251
|
+
.button.bottom-square.xlarge,
|
|
252
|
+
.button.bottom-square.extra {
|
|
253
|
+
border-radius: 1.25rem 1.25rem 1rem 1rem;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.button.inner-round {
|
|
257
|
+
border-radius: 0.5rem;
|
|
258
|
+
}
|
|
259
|
+
.button.inner-round.xsmall {
|
|
260
|
+
border-radius: 0.25rem;
|
|
261
|
+
}
|
|
262
|
+
.button.inner-round.small {
|
|
263
|
+
border-radius: 0.5rem;
|
|
264
|
+
}
|
|
265
|
+
.button.inner-round.large {
|
|
266
|
+
border-radius: 1rem;
|
|
267
|
+
}
|
|
268
|
+
.button.inner-round.xlarge,
|
|
269
|
+
.button.inner-round.extra {
|
|
270
|
+
border-radius: 1.25rem;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/* Flat variants (completely 0px on flat sides) */
|
|
274
|
+
.button.left-round-flat {
|
|
275
|
+
border-radius: 1.25rem 0 0 1.25rem;
|
|
276
|
+
}
|
|
277
|
+
.button.left-round-flat.xsmall {
|
|
278
|
+
border-radius: 0.875rem 0 0 0.875rem;
|
|
279
|
+
}
|
|
280
|
+
.button.left-round-flat.small {
|
|
281
|
+
border-radius: 1rem 0 0 1rem;
|
|
282
|
+
}
|
|
283
|
+
.button.left-round-flat.large {
|
|
284
|
+
border-radius: 1.5rem 0 0 1.5rem;
|
|
285
|
+
}
|
|
286
|
+
.button.left-round-flat.xlarge,
|
|
287
|
+
.button.left-round-flat.extra {
|
|
288
|
+
border-radius: 1.75rem 0 0 1.75rem;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.button.right-round-flat {
|
|
292
|
+
border-radius: 0 1.25rem 1.25rem 0;
|
|
293
|
+
}
|
|
294
|
+
.button.right-round-flat.xsmall {
|
|
295
|
+
border-radius: 0 0.875rem 0.875rem 0;
|
|
296
|
+
}
|
|
297
|
+
.button.right-round-flat.small {
|
|
298
|
+
border-radius: 0 1rem 1rem 0;
|
|
299
|
+
}
|
|
300
|
+
.button.right-round-flat.large {
|
|
301
|
+
border-radius: 0 1.5rem 1.5rem 0;
|
|
302
|
+
}
|
|
303
|
+
.button.right-round-flat.xlarge,
|
|
304
|
+
.button.right-round-flat.extra {
|
|
305
|
+
border-radius: 0 1.75rem 1.75rem 0;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.button.top-round-flat {
|
|
309
|
+
border-radius: 1.25rem 1.25rem 0 0;
|
|
310
|
+
}
|
|
311
|
+
.button.top-round-flat.xsmall {
|
|
312
|
+
border-radius: 0.875rem 0.875rem 0 0;
|
|
313
|
+
}
|
|
314
|
+
.button.top-round-flat.small {
|
|
315
|
+
border-radius: 1rem 1rem 0 0;
|
|
316
|
+
}
|
|
317
|
+
.button.top-round-flat.large {
|
|
318
|
+
border-radius: 1.5rem 1.5rem 0 0;
|
|
319
|
+
}
|
|
320
|
+
.button.top-round-flat.xlarge,
|
|
321
|
+
.button.top-round-flat.extra {
|
|
322
|
+
border-radius: 1.75rem 1.75rem 0 0;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.button.bottom-round-flat {
|
|
326
|
+
border-radius: 0 0 1.25rem 1.25rem;
|
|
327
|
+
}
|
|
328
|
+
.button.bottom-round-flat.xsmall {
|
|
329
|
+
border-radius: 0 0 0.875rem 0.875rem;
|
|
330
|
+
}
|
|
331
|
+
.button.bottom-round-flat.small {
|
|
332
|
+
border-radius: 0 0 1rem 1rem;
|
|
333
|
+
}
|
|
334
|
+
.button.bottom-round-flat.large {
|
|
335
|
+
border-radius: 0 0 1.5rem 1.5rem;
|
|
336
|
+
}
|
|
337
|
+
.button.bottom-round-flat.xlarge,
|
|
338
|
+
.button.bottom-round-flat.extra {
|
|
339
|
+
border-radius: 0 0 1.75rem 1.75rem;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* Morph active states for flat variants */
|
|
343
|
+
.button.left-square-flat {
|
|
344
|
+
border-radius: 0.75rem 0 0 0.75rem;
|
|
345
|
+
}
|
|
346
|
+
.button.left-square-flat.xsmall,
|
|
347
|
+
.button.left-square-flat.small {
|
|
348
|
+
border-radius: 0.5rem 0 0 0.5rem;
|
|
349
|
+
}
|
|
350
|
+
.button.left-square-flat.large,
|
|
351
|
+
.button.left-square-flat.xlarge,
|
|
352
|
+
.button.left-square-flat.extra {
|
|
353
|
+
border-radius: 1rem 0 0 1rem;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.button.right-square-flat {
|
|
357
|
+
border-radius: 0 0.75rem 0.75rem 0;
|
|
358
|
+
}
|
|
359
|
+
.button.right-square-flat.xsmall,
|
|
360
|
+
.button.right-square-flat.small {
|
|
361
|
+
border-radius: 0 0.5rem 0.5rem 0;
|
|
362
|
+
}
|
|
363
|
+
.button.right-square-flat.large,
|
|
364
|
+
.button.right-square-flat.xlarge,
|
|
365
|
+
.button.right-square-flat.extra {
|
|
366
|
+
border-radius: 0 1rem 1rem 0;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.button.top-square-flat {
|
|
370
|
+
border-radius: 0.75rem 0.75rem 0 0;
|
|
371
|
+
}
|
|
372
|
+
.button.top-square-flat.xsmall,
|
|
373
|
+
.button.top-square-flat.small {
|
|
374
|
+
border-radius: 0.5rem 0.5rem 0 0;
|
|
375
|
+
}
|
|
376
|
+
.button.top-square-flat.large,
|
|
377
|
+
.button.top-square-flat.xlarge,
|
|
378
|
+
.button.top-square-flat.extra {
|
|
379
|
+
border-radius: 1rem 1rem 0 0;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.button.bottom-square-flat {
|
|
383
|
+
border-radius: 0 0 0.75rem 0.75rem;
|
|
384
|
+
}
|
|
385
|
+
.button.bottom-square-flat.xsmall,
|
|
386
|
+
.button.bottom-square-flat.small {
|
|
387
|
+
border-radius: 0 0 0.5rem 0.5rem;
|
|
388
|
+
}
|
|
389
|
+
.button.bottom-square-flat.large,
|
|
390
|
+
.button.bottom-square-flat.xlarge,
|
|
391
|
+
.button.bottom-square-flat.extra {
|
|
392
|
+
border-radius: 0 0 1rem 1rem;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/* Circle hides the label visually (slot still present for a11y
|
|
396
|
+
and SSR fallback). */
|
|
397
|
+
:host([shape='circle']) [part='label'] {
|
|
398
|
+
display: none;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/* Variants */
|
|
402
|
+
.button.border {
|
|
403
|
+
border: 0.0625rem solid var(--outline-variant);
|
|
404
|
+
color: var(--primary);
|
|
405
|
+
background-color: transparent;
|
|
406
|
+
}
|
|
407
|
+
.button.fill {
|
|
408
|
+
background-color: var(--secondary-container);
|
|
409
|
+
color: var(--on-secondary-container);
|
|
410
|
+
}
|
|
411
|
+
.button.transparent {
|
|
412
|
+
color: var(--primary);
|
|
413
|
+
background-color: transparent;
|
|
414
|
+
}
|
|
415
|
+
.button.elevated {
|
|
416
|
+
background-color: var(--surface-container-low, var(--surface));
|
|
417
|
+
color: var(--primary);
|
|
418
|
+
box-shadow: var(--elevate1);
|
|
419
|
+
}
|
|
420
|
+
.button.error {
|
|
421
|
+
background-color: var(--error);
|
|
422
|
+
color: var(--on-error);
|
|
423
|
+
}
|
|
424
|
+
.button.error:hover:not(:disabled) {
|
|
425
|
+
background-image: linear-gradient(color-mix(in srgb, currentColor 8%, transparent), color-mix(in srgb, currentColor 8%, transparent));
|
|
426
|
+
}
|
|
427
|
+
.button.error:focus-visible {
|
|
428
|
+
outline-color: var(--error);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/* Disabled / active */
|
|
432
|
+
.button:disabled,
|
|
433
|
+
.button[aria-disabled='true'] {
|
|
434
|
+
opacity: 0.5;
|
|
435
|
+
cursor: not-allowed;
|
|
436
|
+
pointer-events: none;
|
|
437
|
+
}
|
|
438
|
+
.button:hover:not(:disabled) {
|
|
439
|
+
transform: translateY(-0.0625rem);
|
|
440
|
+
background-image: linear-gradient(color-mix(in srgb, currentColor 8%, transparent), color-mix(in srgb, currentColor 8%, transparent));
|
|
441
|
+
}
|
|
442
|
+
.button.elevated:hover:not(:disabled) {
|
|
443
|
+
box-shadow: var(--elevate2);
|
|
444
|
+
}
|
|
445
|
+
.button:active:not(:disabled) {
|
|
446
|
+
border-radius: 0.75rem;
|
|
447
|
+
transform: translateY(0.0625rem) scale(0.97);
|
|
448
|
+
background-image: linear-gradient(color-mix(in srgb, currentColor 12%, transparent), color-mix(in srgb, currentColor 12%, transparent));
|
|
449
|
+
}
|
|
450
|
+
.button.elevated:active:not(:disabled) {
|
|
451
|
+
box-shadow: none;
|
|
452
|
+
}
|
|
453
|
+
.button.xsmall:active:not(:disabled) {
|
|
454
|
+
border-radius: 0.5rem;
|
|
455
|
+
}
|
|
456
|
+
.button.small:active:not(:disabled) {
|
|
457
|
+
border-radius: 0.5rem;
|
|
458
|
+
}
|
|
459
|
+
.button.large:active:not(:disabled) {
|
|
460
|
+
border-radius: 1rem;
|
|
461
|
+
}
|
|
462
|
+
.button.xlarge:active:not(:disabled),
|
|
463
|
+
.button.extra:active:not(:disabled) {
|
|
464
|
+
border-radius: 1rem;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.button.active:not(:disabled) {
|
|
468
|
+
background-color: var(--primary-container);
|
|
469
|
+
color: var(--on-primary-container);
|
|
470
|
+
}
|
|
471
|
+
.button.fill.active:not(:disabled) {
|
|
472
|
+
background-color: var(--secondary);
|
|
473
|
+
color: var(--on-secondary);
|
|
474
|
+
}
|
|
475
|
+
.button.border.active:not(:disabled) {
|
|
476
|
+
background-color: var(--inverse-surface);
|
|
477
|
+
color: var(--inverse-on-surface);
|
|
478
|
+
border-color: var(--inverse-surface);
|
|
479
|
+
}
|
|
480
|
+
.button.elevated.active:not(:disabled) {
|
|
481
|
+
background-color: var(--primary-container);
|
|
482
|
+
color: var(--on-primary-container);
|
|
483
|
+
box-shadow: var(--elevate2);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.button:focus-visible {
|
|
487
|
+
outline: 0.125rem solid var(--primary);
|
|
488
|
+
outline-offset: 0.125rem;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/* Icon helper */
|
|
492
|
+
.icon,
|
|
493
|
+
::slotted([slot='icon']),
|
|
494
|
+
::slotted([slot='icon-trailing']) {
|
|
495
|
+
display: inline-flex;
|
|
496
|
+
align-items: center;
|
|
497
|
+
justify-content: center;
|
|
498
|
+
font-size: var(--_button-icon-size);
|
|
499
|
+
inline-size: var(--_button-icon-size);
|
|
500
|
+
block-size: var(--_button-icon-size);
|
|
501
|
+
flex: none;
|
|
502
|
+
color: inherit;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.icon {
|
|
506
|
+
--moni-icon-size: var(--_button-icon-size);
|
|
507
|
+
font-size: var(--_button-icon-size);
|
|
508
|
+
inline-size: var(--_button-icon-size);
|
|
509
|
+
block-size: var(--_button-icon-size);
|
|
510
|
+
transform: translateX(var(--moni-button-icon-offset, 0));
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.button.left-round {
|
|
514
|
+
border-radius: 999px var(--_button-square-radius, 1rem) var(--_button-square-radius, 1rem) 999px;
|
|
515
|
+
}
|
|
516
|
+
.button.right-round {
|
|
517
|
+
border-radius: var(--_button-square-radius, 1rem) 999px 999px var(--_button-square-radius, 1rem);
|
|
518
|
+
}
|
|
519
|
+
.button.top-round {
|
|
520
|
+
border-radius: 999px 999px var(--_button-square-radius, 1rem) var(--_button-square-radius, 1rem);
|
|
521
|
+
}
|
|
522
|
+
.button.bottom-round {
|
|
523
|
+
border-radius: var(--_button-square-radius, 1rem) var(--_button-square-radius, 1rem) 999px 999px;
|
|
524
|
+
}
|
|
525
|
+
.button.left-round-flat {
|
|
526
|
+
border-radius: 999px 0 0 999px;
|
|
527
|
+
}
|
|
528
|
+
.button.right-round-flat {
|
|
529
|
+
border-radius: 0 999px 999px 0;
|
|
530
|
+
}
|
|
531
|
+
.button.top-round-flat {
|
|
532
|
+
border-radius: 999px 999px 0 0;
|
|
533
|
+
}
|
|
534
|
+
.button.bottom-round-flat {
|
|
535
|
+
border-radius: 0 0 999px 999px;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.button.xsmall,
|
|
539
|
+
.button.small {
|
|
540
|
+
--_button-square-radius: 0.75rem;
|
|
541
|
+
}
|
|
542
|
+
.button.large,
|
|
543
|
+
.button.xlarge,
|
|
544
|
+
.button.extra {
|
|
545
|
+
--_button-square-radius: 1.75rem;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
:host([split-position]) .button {
|
|
549
|
+
inline-size: var(--moni-button-inline-size);
|
|
550
|
+
min-inline-size: var(--moni-button-min-inline-size);
|
|
551
|
+
border-radius: var(--moni-button-border-radius);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
slot {
|
|
555
|
+
display: contents;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
[part='label'][hidden] {
|
|
559
|
+
display: none;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/* Loading spinner */
|
|
563
|
+
.loading-spinner {
|
|
564
|
+
inline-size: 1.125rem;
|
|
565
|
+
block-size: 1.125rem;
|
|
566
|
+
color: currentColor;
|
|
567
|
+
}
|
|
568
|
+
.loading-spinner::part(progress) {
|
|
569
|
+
border-width: 0.1875rem;
|
|
570
|
+
}
|
|
571
|
+
`]}handleLinkClick(e){this.disabled&&(e.preventDefault(),e.stopPropagation())}render(){let e=``;this.variant===`outlined`?e=`border`:this.variant===`tonal`||this.variant===`fill`?e=`fill`:this.variant===`text`?e=`transparent`:this.variant===`elevated`?e=`elevated`:this.variant===`error`&&(e=`error`);let n=this.shape;this.active&&(this.shape===`round`?n=`square`:this.shape===`square`?n=`round`:this.shape===`left-round`?n=`left-square`:this.shape===`right-round`?n=`right-square`:this.shape===`top-round`?n=`top-square`:this.shape===`bottom-round`?n=`bottom-square`:this.shape===`left-round-flat`?n=`left-square-flat`:this.shape===`right-round-flat`?n=`right-square-flat`:this.shape===`top-round-flat`?n=`top-square-flat`:this.shape===`bottom-round-flat`?n=`bottom-square-flat`:this.shape===`inner-round`&&(n=`inner-round`));let r=[`button`,e,this.size,n,this.active?`active`:``,!this._hasLabel&&(this.icon||this.iconTrailing||this.loading)?`icon-only`:``].filter(Boolean).join(` `),i=this.loading?t`<moni-progress
|
|
572
|
+
class="loading-spinner"
|
|
573
|
+
part="loading"
|
|
574
|
+
variant="circular"
|
|
575
|
+
indeterminate
|
|
576
|
+
size="small"
|
|
577
|
+
></moni-progress>`:this.icon?t`<span class="icon" part="icon"
|
|
578
|
+
><moni-icon name="${this.icon}"></moni-icon
|
|
579
|
+
></span>`:t`<slot name="icon" part="icon"></slot>`,a=this.iconTrailing?t`<span class="icon" part="icon-trailing"
|
|
580
|
+
><moni-icon name="${this.iconTrailing}"></moni-icon
|
|
581
|
+
></span>`:t`<slot name="icon-trailing" part="icon-trailing"></slot>`,o=t`${i}
|
|
582
|
+
<span part="label" ?hidden=${!this._hasLabel} style=${this.loading?`opacity: 0.5;`:``}><slot @slotchange=${this._handleLabelSlotChange}></slot></span>
|
|
583
|
+
${a}`;return this.href?t`<a
|
|
584
|
+
class=${r}
|
|
585
|
+
part="button"
|
|
586
|
+
href=${this.disabled?void 0:this.href}
|
|
587
|
+
target=${c(this.target||void 0)}
|
|
588
|
+
aria-disabled=${this.disabled?`true`:`false`}
|
|
589
|
+
aria-busy=${this.loading?`true`:`false`}
|
|
590
|
+
@click=${this.handleLinkClick}
|
|
591
|
+
>
|
|
592
|
+
${o}
|
|
593
|
+
</a>`:t`<button
|
|
594
|
+
class=${r}
|
|
595
|
+
part="button"
|
|
596
|
+
type=${this.type}
|
|
597
|
+
?disabled=${this.disabled}
|
|
598
|
+
aria-disabled=${this.disabled}
|
|
599
|
+
aria-busy=${this.loading?`true`:`false`}
|
|
600
|
+
>
|
|
601
|
+
${o}
|
|
602
|
+
</button>`}};s([e()],u.prototype,`_hasLabel`,void 0),s([i({reflect:!0})],u.prototype,`variant`,void 0),s([i({reflect:!0})],u.prototype,`size`,void 0),s([i({reflect:!0})],u.prototype,`shape`,void 0),s([i({type:Boolean,reflect:!0})],u.prototype,`disabled`,void 0),s([i({type:Boolean,reflect:!0})],u.prototype,`loading`,void 0),s([i({type:Boolean,reflect:!0})],u.prototype,`active`,void 0),s([i({reflect:!0})],u.prototype,`icon`,void 0),s([i({reflect:!0,attribute:`icon-trailing`})],u.prototype,`iconTrailing`,void 0),s([i({reflect:!0})],u.prototype,`type`,void 0),s([i({reflect:!0})],u.prototype,`href`,void 0),s([i({reflect:!0})],u.prototype,`target`,void 0),u=l=s([o(`moni-button`)],u);
|