@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,272 @@
|
|
|
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.value=`on`,this.checked=!1,this.size=`small`,this.disabled=!1,this.position=`solo`,this.hideCheck=!1}static{this.styles=[i,n`
|
|
2
|
+
.label {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
font-family: inherit;
|
|
7
|
+
font-size: inherit;
|
|
8
|
+
font-weight: inherit;
|
|
9
|
+
color: inherit;
|
|
10
|
+
text-align: center;
|
|
11
|
+
}
|
|
12
|
+
:host {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
position: relative;
|
|
16
|
+
z-index: 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Collapsing margins on host */
|
|
20
|
+
:host(:not([position='first'])) {
|
|
21
|
+
margin-inline-start: var(--moni-button-segment-gap, -0.0625rem);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([disabled]) {
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.button {
|
|
29
|
+
--_segment-height: 3.5rem;
|
|
30
|
+
--_segment-padding: 1.5rem;
|
|
31
|
+
--_segment-gap: 0.5rem;
|
|
32
|
+
--_segment-icon: 1.5rem;
|
|
33
|
+
--_segment-square-radius: 1rem;
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
height: var(--_segment-height);
|
|
39
|
+
width: 100%;
|
|
40
|
+
padding: 0 var(--_segment-padding);
|
|
41
|
+
font-size: 1rem;
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
font-family: inherit;
|
|
44
|
+
color: var(--on-surface);
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
border: 0.0625rem solid var(--outline-variant, var(--outline, #79747e));
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
user-select: none;
|
|
49
|
+
transition:
|
|
50
|
+
background-color var(--speed2),
|
|
51
|
+
color var(--speed2),
|
|
52
|
+
border-radius var(--speed2),
|
|
53
|
+
transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
54
|
+
box-shadow 250ms ease;
|
|
55
|
+
position: relative;
|
|
56
|
+
gap: var(--_segment-gap);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.button::after {
|
|
60
|
+
content: '';
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 50%;
|
|
63
|
+
left: 50%;
|
|
64
|
+
min-width: 100%;
|
|
65
|
+
min-height: 3rem; /* 48px minimum touch target */
|
|
66
|
+
transform: translate(-50%, -50%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Sizes */
|
|
70
|
+
.button.xsmall {
|
|
71
|
+
--_segment-height: 2rem;
|
|
72
|
+
--_segment-padding: 0.75rem;
|
|
73
|
+
--_segment-gap: 0.25rem;
|
|
74
|
+
--_segment-icon: 1.25rem;
|
|
75
|
+
--_segment-square-radius: 0.75rem;
|
|
76
|
+
min-width: 0;
|
|
77
|
+
font-size: 0.875rem;
|
|
78
|
+
}
|
|
79
|
+
.button.small {
|
|
80
|
+
--_segment-height: 2.5rem;
|
|
81
|
+
--_segment-padding: 1rem;
|
|
82
|
+
--_segment-gap: 0.5rem;
|
|
83
|
+
--_segment-icon: 1.25rem;
|
|
84
|
+
--_segment-square-radius: 0.75rem;
|
|
85
|
+
min-width: 0;
|
|
86
|
+
}
|
|
87
|
+
.button.large {
|
|
88
|
+
--_segment-height: 6rem;
|
|
89
|
+
--_segment-padding: 3rem;
|
|
90
|
+
--_segment-gap: 0.75rem;
|
|
91
|
+
--_segment-icon: 2rem;
|
|
92
|
+
--_segment-square-radius: 1.75rem;
|
|
93
|
+
font-size: 1.5rem;
|
|
94
|
+
}
|
|
95
|
+
.button.xlarge,
|
|
96
|
+
.button.extra {
|
|
97
|
+
--_segment-height: 8.5rem;
|
|
98
|
+
--_segment-padding: 4rem;
|
|
99
|
+
--_segment-gap: 1rem;
|
|
100
|
+
--_segment-icon: 2.5rem;
|
|
101
|
+
--_segment-square-radius: 1.75rem;
|
|
102
|
+
font-size: 2rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host([disabled]) .button {
|
|
106
|
+
opacity: 0.38;
|
|
107
|
+
cursor: not-allowed;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Border Radius positioning */
|
|
111
|
+
:host([position='first']) .button {
|
|
112
|
+
border-radius: var(--moni-button-segment-radius-left, 1.25rem 0.5rem 0.5rem 1.25rem);
|
|
113
|
+
}
|
|
114
|
+
:host([position='first']) .button.xsmall {
|
|
115
|
+
border-radius: var(--moni-button-segment-radius-left, 0.875rem 0.25rem 0.25rem 0.875rem);
|
|
116
|
+
}
|
|
117
|
+
:host([position='first']) .button.small {
|
|
118
|
+
border-radius: var(--moni-button-segment-radius-left, 1rem 0.5rem 0.5rem 1rem);
|
|
119
|
+
}
|
|
120
|
+
:host([position='first']) .button.large {
|
|
121
|
+
border-radius: var(--moni-button-segment-radius-left, 1.5rem 1rem 1rem 1.5rem);
|
|
122
|
+
}
|
|
123
|
+
:host([position='first']) .button.xlarge,
|
|
124
|
+
:host([position='first']) .button.extra {
|
|
125
|
+
border-radius: var(--moni-button-segment-radius-left, 1.75rem 1.25rem 1.25rem 1.75rem);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([position='last']) .button {
|
|
129
|
+
border-radius: var(--moni-button-segment-radius-right, 0.5rem 1.25rem 1.25rem 0.5rem);
|
|
130
|
+
}
|
|
131
|
+
:host([position='last']) .button.xsmall {
|
|
132
|
+
border-radius: var(--moni-button-segment-radius-right, 0.25rem 0.875rem 0.875rem 0.25rem);
|
|
133
|
+
}
|
|
134
|
+
:host([position='last']) .button.small {
|
|
135
|
+
border-radius: var(--moni-button-segment-radius-right, 0.5rem 1rem 1rem 0.5rem);
|
|
136
|
+
}
|
|
137
|
+
:host([position='last']) .button.large {
|
|
138
|
+
border-radius: var(--moni-button-segment-radius-right, 1rem 1.5rem 1.5rem 1rem);
|
|
139
|
+
}
|
|
140
|
+
:host([position='last']) .button.xlarge,
|
|
141
|
+
:host([position='last']) .button.extra {
|
|
142
|
+
border-radius: var(--moni-button-segment-radius-right, 1.25rem 1.75rem 1.75rem 1.25rem);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
:host([position='middle']) .button {
|
|
146
|
+
border-radius: var(--moni-button-segment-radius-middle, 0.5rem);
|
|
147
|
+
}
|
|
148
|
+
:host([position='middle']) .button.xsmall {
|
|
149
|
+
border-radius: var(--moni-button-segment-radius-middle, 0.25rem);
|
|
150
|
+
}
|
|
151
|
+
:host([position='middle']) .button.small {
|
|
152
|
+
border-radius: var(--moni-button-segment-radius-middle, 0.5rem);
|
|
153
|
+
}
|
|
154
|
+
:host([position='middle']) .button.large {
|
|
155
|
+
border-radius: var(--moni-button-segment-radius-middle, 1rem);
|
|
156
|
+
}
|
|
157
|
+
:host([position='middle']) .button.xlarge,
|
|
158
|
+
:host([position='middle']) .button.extra {
|
|
159
|
+
border-radius: var(--moni-button-segment-radius-middle, 1.25rem);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:host([position='solo']) .button {
|
|
163
|
+
border-radius: 1.25rem;
|
|
164
|
+
}
|
|
165
|
+
:host([position='solo']) .button.xsmall {
|
|
166
|
+
border-radius: 0.875rem;
|
|
167
|
+
}
|
|
168
|
+
:host([position='solo']) .button.small {
|
|
169
|
+
border-radius: 1rem;
|
|
170
|
+
}
|
|
171
|
+
:host([position='solo']) .button.large {
|
|
172
|
+
border-radius: 1.5rem;
|
|
173
|
+
}
|
|
174
|
+
:host([position='solo']) .button.xlarge,
|
|
175
|
+
:host([position='solo']) .button.extra {
|
|
176
|
+
border-radius: 1.75rem;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* Hover and Active states */
|
|
180
|
+
:host(:hover:not([disabled])) {
|
|
181
|
+
z-index: 2;
|
|
182
|
+
}
|
|
183
|
+
:host(:hover:not([disabled])) .button {
|
|
184
|
+
transform: translateY(-0.0625rem);
|
|
185
|
+
}
|
|
186
|
+
:host(:hover:not([disabled]):not([checked])) .button {
|
|
187
|
+
background-color: var(--surface-container-high, rgba(0, 0, 0, 0.04));
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
:host(:active:not([disabled])) .button {
|
|
191
|
+
transform: translateY(0.0625rem) scale(0.97);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* Checked state */
|
|
195
|
+
:host([checked]) {
|
|
196
|
+
z-index: 3;
|
|
197
|
+
}
|
|
198
|
+
:host([checked]) .button {
|
|
199
|
+
background-color: var(--secondary-container);
|
|
200
|
+
color: var(--on-secondary-container);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
:host([checked]:hover:not([disabled])) {
|
|
204
|
+
z-index: 3;
|
|
205
|
+
}
|
|
206
|
+
:host([checked]:hover:not([disabled])) .button {
|
|
207
|
+
background-color: var(--secondary-container);
|
|
208
|
+
opacity: 0.92;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* Checkmark Animation */
|
|
212
|
+
.checkmark {
|
|
213
|
+
--moni-icon-size: var(--_segment-icon);
|
|
214
|
+
display: inline-flex;
|
|
215
|
+
align-items: center;
|
|
216
|
+
justify-content: center;
|
|
217
|
+
font-size: var(--_segment-icon);
|
|
218
|
+
inline-size: 0;
|
|
219
|
+
block-size: var(--_segment-icon);
|
|
220
|
+
opacity: 0;
|
|
221
|
+
transform: scale(0);
|
|
222
|
+
margin-inline-end: calc(var(--_segment-gap) * -1); /* Cancels host gap when collapsed */
|
|
223
|
+
transition:
|
|
224
|
+
inline-size var(--speed2) var(--ease-standard),
|
|
225
|
+
margin-inline-end var(--speed2) var(--ease-standard),
|
|
226
|
+
opacity var(--speed2) var(--ease-standard),
|
|
227
|
+
transform var(--speed2) var(--ease-standard);
|
|
228
|
+
overflow: hidden;
|
|
229
|
+
color: inherit;
|
|
230
|
+
flex: none;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
:host([checked]:not([hide-check])) .checkmark {
|
|
234
|
+
inline-size: var(--_segment-icon);
|
|
235
|
+
margin-inline-end: 0;
|
|
236
|
+
opacity: 1;
|
|
237
|
+
transform: scale(1);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* Icon slot */
|
|
241
|
+
::slotted([slot='icon']) {
|
|
242
|
+
display: inline-flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
justify-content: center;
|
|
245
|
+
font-size: var(--_segment-icon);
|
|
246
|
+
inline-size: var(--_segment-icon);
|
|
247
|
+
block-size: var(--_segment-icon);
|
|
248
|
+
color: inherit;
|
|
249
|
+
flex: none;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
:host([position='first']) .button {
|
|
253
|
+
border-radius: 999px var(--_segment-square-radius) var(--_segment-square-radius) 999px;
|
|
254
|
+
}
|
|
255
|
+
:host([position='last']) .button {
|
|
256
|
+
border-radius: var(--_segment-square-radius) 999px 999px var(--_segment-square-radius);
|
|
257
|
+
}
|
|
258
|
+
:host([position='middle']) .button {
|
|
259
|
+
border-radius: var(--_segment-square-radius);
|
|
260
|
+
}
|
|
261
|
+
:host([position='solo']) .button {
|
|
262
|
+
border-radius: 999px;
|
|
263
|
+
}
|
|
264
|
+
`]}render(){return e`
|
|
265
|
+
<button class="button ${this.size}" type="button" ?disabled=${this.disabled}>
|
|
266
|
+
<span class="checkmark" part="checkmark">
|
|
267
|
+
<moni-icon name="check"></moni-icon>
|
|
268
|
+
</span>
|
|
269
|
+
<slot name="icon"></slot>
|
|
270
|
+
<span class="label" part="label"><slot></slot></span>
|
|
271
|
+
</button>
|
|
272
|
+
`}};o([r({reflect:!0})],s.prototype,`value`,void 0),o([r({type:Boolean,reflect:!0})],s.prototype,`checked`,void 0),o([r({reflect:!0})],s.prototype,`size`,void 0),o([r({type:Boolean,reflect:!0})],s.prototype,`disabled`,void 0),o([r({reflect:!0})],s.prototype,`position`,void 0),o([r({type:Boolean,reflect:!0,attribute:`hide-check`})],s.prototype,`hideCheck`,void 0),s=o([a(`moni-button-segment`)],s);
|