@proyecto-viviana/ui 0.1.0
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/dist/alert/index.d.ts +12 -0
- package/dist/alert/index.d.ts.map +1 -0
- package/dist/avatar/index.d.ts +17 -0
- package/dist/avatar/index.d.ts.map +1 -0
- package/dist/badge/index.d.ts +12 -0
- package/dist/badge/index.d.ts.map +1 -0
- package/dist/button/Button.d.ts +19 -0
- package/dist/button/Button.d.ts.map +1 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/button/index.d.ts.map +1 -0
- package/dist/button/types.d.ts +23 -0
- package/dist/button/types.d.ts.map +1 -0
- package/dist/checkbox/index.d.ts +43 -0
- package/dist/checkbox/index.d.ts.map +1 -0
- package/dist/components.css +975 -0
- package/dist/custom/calendar-card/index.d.ts +12 -0
- package/dist/custom/calendar-card/index.d.ts.map +1 -0
- package/dist/custom/chip/index.d.ts +11 -0
- package/dist/custom/chip/index.d.ts.map +1 -0
- package/dist/custom/conversation/index.d.ts +32 -0
- package/dist/custom/conversation/index.d.ts.map +1 -0
- package/dist/custom/event-card/index.d.ts +26 -0
- package/dist/custom/event-card/index.d.ts.map +1 -0
- package/dist/custom/lateral-nav/index.d.ts +32 -0
- package/dist/custom/lateral-nav/index.d.ts.map +1 -0
- package/dist/custom/logo/index.d.ts +26 -0
- package/dist/custom/logo/index.d.ts.map +1 -0
- package/dist/custom/nav-header/index.d.ts +12 -0
- package/dist/custom/nav-header/index.d.ts.map +1 -0
- package/dist/custom/page-layout/index.d.ts +11 -0
- package/dist/custom/page-layout/index.d.ts.map +1 -0
- package/dist/custom/profile-card/index.d.ts +12 -0
- package/dist/custom/profile-card/index.d.ts.map +1 -0
- package/dist/custom/project-card/index.d.ts +24 -0
- package/dist/custom/project-card/index.d.ts.map +1 -0
- package/dist/custom/timeline-item/index.d.ts +18 -0
- package/dist/custom/timeline-item/index.d.ts.map +1 -0
- package/dist/dialog/index.d.ts +18 -0
- package/dist/dialog/index.d.ts.map +1 -0
- package/dist/icon/icons/GitHubIcon.d.ts +7 -0
- package/dist/icon/icons/GitHubIcon.d.ts.map +1 -0
- package/dist/icon/index.d.ts +28 -0
- package/dist/icon/index.d.ts.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1988 -0
- package/dist/index.js.map +1 -0
- package/dist/link/index.d.ts +39 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/progress-bar/index.d.ts +49 -0
- package/dist/progress-bar/index.d.ts.map +1 -0
- package/dist/radio/index.d.ts +43 -0
- package/dist/radio/index.d.ts.map +1 -0
- package/dist/separator/index.d.ts +42 -0
- package/dist/separator/index.d.ts.map +1 -0
- package/dist/styles.css +450 -0
- package/dist/switch/ToggleSwitch.d.ts +28 -0
- package/dist/switch/ToggleSwitch.d.ts.map +1 -0
- package/dist/switch/index.d.ts +26 -0
- package/dist/switch/index.d.ts.map +1 -0
- package/dist/test-utils/index.d.ts +44 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/textfield/index.d.ts +31 -0
- package/dist/textfield/index.d.ts.map +1 -0
- package/dist/theme.css +101 -0
- package/dist/tooltip/index.d.ts +17 -0
- package/dist/tooltip/index.d.ts.map +1 -0
- package/package.json +55 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1988 @@
|
|
|
1
|
+
import { createComponent, mergeProps as mergeProps$1, template, insert, effect, className, addEventListener, delegateEvents, setAttribute, memo, spread, setStyleProperty } from 'solid-js/web';
|
|
2
|
+
import { mergeProps, splitProps, Show, createSignal, createEffect, createContext, useContext, createMemo, For } from 'solid-js';
|
|
3
|
+
import { Button as Button$1, ToggleSwitch as ToggleSwitch$1, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, RadioGroup as RadioGroup$1, Radio as Radio$1, Link as Link$1 } from '@proyecto-viviana/solidaria-components';
|
|
4
|
+
import { createTextField, createFocusRing, createProgressBar, createSeparator } from '@proyecto-viviana/solidaria';
|
|
5
|
+
|
|
6
|
+
function Button(props) {
|
|
7
|
+
const defaultProps = {
|
|
8
|
+
variant: "primary",
|
|
9
|
+
buttonStyle: "fill",
|
|
10
|
+
size: "md"
|
|
11
|
+
};
|
|
12
|
+
const merged = mergeProps(defaultProps, props);
|
|
13
|
+
const [local, headlessProps] = splitProps(merged, ["children", "variant", "buttonStyle", "size", "fullWidth", "staticColor", "class"]);
|
|
14
|
+
const getClassName = (renderProps) => {
|
|
15
|
+
const classList = ["vui-button", `vui-button--${local.buttonStyle}`, `vui-button--${local.variant}`, `vui-button--${local.size}`];
|
|
16
|
+
if (renderProps.isPressed) {
|
|
17
|
+
classList.push("is-pressed");
|
|
18
|
+
}
|
|
19
|
+
if (local.fullWidth) {
|
|
20
|
+
classList.push("vui-button--full-width");
|
|
21
|
+
}
|
|
22
|
+
if (local.class) {
|
|
23
|
+
classList.push(local.class);
|
|
24
|
+
}
|
|
25
|
+
return classList.join(" ");
|
|
26
|
+
};
|
|
27
|
+
return createComponent(Button$1, mergeProps$1(headlessProps, {
|
|
28
|
+
"class": getClassName,
|
|
29
|
+
get ["data-variant"]() {
|
|
30
|
+
return local.variant;
|
|
31
|
+
},
|
|
32
|
+
get ["data-style"]() {
|
|
33
|
+
return local.buttonStyle;
|
|
34
|
+
},
|
|
35
|
+
get ["data-static-color"]() {
|
|
36
|
+
return local.staticColor || void 0;
|
|
37
|
+
},
|
|
38
|
+
get children() {
|
|
39
|
+
return local.children;
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
var _tmpl$$o = /* @__PURE__ */ template(`<span>`), _tmpl$2$j = /* @__PURE__ */ template(`<div>`);
|
|
45
|
+
const variantStyles$5 = {
|
|
46
|
+
primary: "bg-primary-500 text-white",
|
|
47
|
+
secondary: "bg-bg-300 text-primary-300",
|
|
48
|
+
accent: "bg-accent-300 text-black",
|
|
49
|
+
success: "bg-success-400 text-white",
|
|
50
|
+
warning: "bg-warning-400 text-black",
|
|
51
|
+
danger: "bg-danger-400 text-white"
|
|
52
|
+
};
|
|
53
|
+
const sizeStyles$6 = {
|
|
54
|
+
sm: "w-5 h-5 text-xs",
|
|
55
|
+
md: "w-7 h-7 text-xs",
|
|
56
|
+
lg: "w-9 h-9 text-sm"
|
|
57
|
+
};
|
|
58
|
+
function Badge(props) {
|
|
59
|
+
const variant = () => props.variant ?? "accent";
|
|
60
|
+
const size = () => props.size ?? "md";
|
|
61
|
+
return (() => {
|
|
62
|
+
var _el$ = _tmpl$2$j();
|
|
63
|
+
insert(_el$, createComponent(Show, {
|
|
64
|
+
get when() {
|
|
65
|
+
return props.count !== void 0;
|
|
66
|
+
},
|
|
67
|
+
get fallback() {
|
|
68
|
+
return props.children;
|
|
69
|
+
},
|
|
70
|
+
get children() {
|
|
71
|
+
var _el$2 = _tmpl$$o();
|
|
72
|
+
insert(_el$2, () => props.count);
|
|
73
|
+
return _el$2;
|
|
74
|
+
}
|
|
75
|
+
}));
|
|
76
|
+
effect(() => className(_el$, `flex items-center justify-center rounded-full border-b border-white font-semibold ${variantStyles$5[variant()]} ${sizeStyles$6[size()]} ${props.class ?? ""}`));
|
|
77
|
+
return _el$;
|
|
78
|
+
})();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
var _tmpl$$n = /* @__PURE__ */ template(`<span class="font-semibold font-jost">`), _tmpl$2$i = /* @__PURE__ */ template(`<span class=opacity-50>|`), _tmpl$3$d = /* @__PURE__ */ template(`<button class="hover:opacity-70 transition-opacity ml-2"aria-label=Dismiss>✕`), _tmpl$4$d = /* @__PURE__ */ template(`<div role=alert><div class="flex items-center gap-3 flex-1"><div class=flex-1>`);
|
|
82
|
+
const variantStyles$4 = {
|
|
83
|
+
info: "bg-primary-700 text-primary-200 border border-primary-500",
|
|
84
|
+
success: "bg-success-600 text-success-100 border border-success-400",
|
|
85
|
+
warning: "bg-warning-600 text-warning-100 border border-warning-400",
|
|
86
|
+
error: "bg-danger-600 text-danger-100 border border-danger-400"
|
|
87
|
+
};
|
|
88
|
+
function Alert(props) {
|
|
89
|
+
const variant = () => props.variant ?? "info";
|
|
90
|
+
return (() => {
|
|
91
|
+
var _el$ = _tmpl$4$d(), _el$2 = _el$.firstChild, _el$5 = _el$2.firstChild;
|
|
92
|
+
insert(_el$2, createComponent(Show, {
|
|
93
|
+
get when() {
|
|
94
|
+
return props.title;
|
|
95
|
+
},
|
|
96
|
+
get children() {
|
|
97
|
+
return [(() => {
|
|
98
|
+
var _el$3 = _tmpl$$n();
|
|
99
|
+
insert(_el$3, () => props.title);
|
|
100
|
+
return _el$3;
|
|
101
|
+
})(), _tmpl$2$i()];
|
|
102
|
+
}
|
|
103
|
+
}), _el$5);
|
|
104
|
+
insert(_el$5, () => props.children);
|
|
105
|
+
insert(_el$2, createComponent(Show, {
|
|
106
|
+
get when() {
|
|
107
|
+
return props.dismissible;
|
|
108
|
+
},
|
|
109
|
+
get children() {
|
|
110
|
+
var _el$6 = _tmpl$3$d();
|
|
111
|
+
addEventListener(_el$6, "click", props.onDismiss, true);
|
|
112
|
+
return _el$6;
|
|
113
|
+
}
|
|
114
|
+
}), null);
|
|
115
|
+
effect(() => className(_el$, `flex items-center min-h-[50px] font-normal rounded-lg px-4 py-2 ${variantStyles$4[variant()]} ${props.class ?? ""}`));
|
|
116
|
+
return _el$;
|
|
117
|
+
})();
|
|
118
|
+
}
|
|
119
|
+
delegateEvents(["click"]);
|
|
120
|
+
|
|
121
|
+
var _tmpl$$m = /* @__PURE__ */ template(`<img class="w-full h-full object-cover">`), _tmpl$2$h = /* @__PURE__ */ template(`<span>`), _tmpl$3$c = /* @__PURE__ */ template(`<div><div>`), _tmpl$4$c = /* @__PURE__ */ template(`<div class="flex -space-x-2">`);
|
|
122
|
+
const sizeStyles$5 = {
|
|
123
|
+
xs: {
|
|
124
|
+
container: "w-6 h-6",
|
|
125
|
+
text: "text-xs",
|
|
126
|
+
indicator: "w-1.5 h-1.5"
|
|
127
|
+
},
|
|
128
|
+
sm: {
|
|
129
|
+
container: "w-8 h-8",
|
|
130
|
+
text: "text-sm",
|
|
131
|
+
indicator: "w-2 h-2"
|
|
132
|
+
},
|
|
133
|
+
md: {
|
|
134
|
+
container: "w-10 h-10",
|
|
135
|
+
text: "text-base",
|
|
136
|
+
indicator: "w-2.5 h-2.5"
|
|
137
|
+
},
|
|
138
|
+
lg: {
|
|
139
|
+
container: "w-14 h-14",
|
|
140
|
+
text: "text-lg",
|
|
141
|
+
indicator: "w-3 h-3"
|
|
142
|
+
},
|
|
143
|
+
xl: {
|
|
144
|
+
container: "w-20 h-20",
|
|
145
|
+
text: "text-xl",
|
|
146
|
+
indicator: "w-4 h-4"
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
function Avatar(props) {
|
|
150
|
+
const size = () => props.size ?? "md";
|
|
151
|
+
const styles = () => sizeStyles$5[size()];
|
|
152
|
+
const initials = () => {
|
|
153
|
+
if (props.fallback) return props.fallback.slice(0, 2).toUpperCase();
|
|
154
|
+
if (props.alt) return props.alt.slice(0, 2).toUpperCase();
|
|
155
|
+
return "?";
|
|
156
|
+
};
|
|
157
|
+
return (() => {
|
|
158
|
+
var _el$ = _tmpl$3$c(), _el$2 = _el$.firstChild;
|
|
159
|
+
insert(_el$2, createComponent(Show, {
|
|
160
|
+
get when() {
|
|
161
|
+
return props.src;
|
|
162
|
+
},
|
|
163
|
+
get fallback() {
|
|
164
|
+
return (() => {
|
|
165
|
+
var _el$5 = _tmpl$2$h();
|
|
166
|
+
insert(_el$5, initials);
|
|
167
|
+
effect(() => className(_el$5, `${styles().text} font-medium text-primary-300`));
|
|
168
|
+
return _el$5;
|
|
169
|
+
})();
|
|
170
|
+
},
|
|
171
|
+
get children() {
|
|
172
|
+
var _el$3 = _tmpl$$m();
|
|
173
|
+
effect((_p$) => {
|
|
174
|
+
var _v$ = props.src, _v$2 = props.alt ?? "Avatar";
|
|
175
|
+
_v$ !== _p$.e && setAttribute(_el$3, "src", _p$.e = _v$);
|
|
176
|
+
_v$2 !== _p$.t && setAttribute(_el$3, "alt", _p$.t = _v$2);
|
|
177
|
+
return _p$;
|
|
178
|
+
}, {
|
|
179
|
+
e: void 0,
|
|
180
|
+
t: void 0
|
|
181
|
+
});
|
|
182
|
+
return _el$3;
|
|
183
|
+
}
|
|
184
|
+
}));
|
|
185
|
+
insert(_el$, createComponent(Show, {
|
|
186
|
+
get when() {
|
|
187
|
+
return props.online !== void 0;
|
|
188
|
+
},
|
|
189
|
+
get children() {
|
|
190
|
+
var _el$4 = _tmpl$2$h();
|
|
191
|
+
effect(() => className(_el$4, `absolute bottom-0 right-0 ${styles().indicator} rounded-full ring-2 ring-bg-400 ${props.online ? "bg-success-400" : "bg-bg-light"}`));
|
|
192
|
+
return _el$4;
|
|
193
|
+
}
|
|
194
|
+
}), null);
|
|
195
|
+
effect((_p$) => {
|
|
196
|
+
var _v$3 = `relative inline-block ${props.class ?? ""}`, _v$4 = `${styles().container} rounded-full overflow-hidden bg-bg-200 flex items-center justify-center ring-2 ring-accent/50`;
|
|
197
|
+
_v$3 !== _p$.e && className(_el$, _p$.e = _v$3);
|
|
198
|
+
_v$4 !== _p$.t && className(_el$2, _p$.t = _v$4);
|
|
199
|
+
return _p$;
|
|
200
|
+
}, {
|
|
201
|
+
e: void 0,
|
|
202
|
+
t: void 0
|
|
203
|
+
});
|
|
204
|
+
return _el$;
|
|
205
|
+
})();
|
|
206
|
+
}
|
|
207
|
+
function AvatarGroup(props) {
|
|
208
|
+
return (() => {
|
|
209
|
+
var _el$6 = _tmpl$4$c();
|
|
210
|
+
insert(_el$6, () => props.children);
|
|
211
|
+
return _el$6;
|
|
212
|
+
})();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
var _tmpl$$l = /* @__PURE__ */ template(`<span><span>`), _tmpl$2$g = /* @__PURE__ */ template(`<span class=text-primary-200>`);
|
|
216
|
+
const sizeStyles$4 = {
|
|
217
|
+
sm: {
|
|
218
|
+
track: "h-5 w-9",
|
|
219
|
+
thumb: "h-4 w-4",
|
|
220
|
+
translate: "translate-x-4"
|
|
221
|
+
},
|
|
222
|
+
md: {
|
|
223
|
+
track: "h-6 w-11",
|
|
224
|
+
thumb: "h-5 w-5",
|
|
225
|
+
translate: "translate-x-5"
|
|
226
|
+
},
|
|
227
|
+
lg: {
|
|
228
|
+
track: "h-7 w-14",
|
|
229
|
+
thumb: "h-6 w-6",
|
|
230
|
+
translate: "translate-x-7"
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
function ToggleSwitch(props) {
|
|
234
|
+
const defaultProps = {
|
|
235
|
+
size: "md"
|
|
236
|
+
};
|
|
237
|
+
const merged = mergeProps(defaultProps, props);
|
|
238
|
+
const [local, headlessProps] = splitProps(merged, ["size", "class", "children"]);
|
|
239
|
+
const size = () => sizeStyles$4[local.size];
|
|
240
|
+
const getClassName = (renderProps) => {
|
|
241
|
+
const base = "inline-flex items-center gap-2 cursor-pointer";
|
|
242
|
+
const disabledClass = renderProps.isDisabled ? "cursor-not-allowed opacity-50" : "";
|
|
243
|
+
const custom = local.class || "";
|
|
244
|
+
return [base, disabledClass, custom].filter(Boolean).join(" ");
|
|
245
|
+
};
|
|
246
|
+
return createComponent(ToggleSwitch$1, mergeProps$1(headlessProps, {
|
|
247
|
+
"class": getClassName,
|
|
248
|
+
children: (renderProps) => [(() => {
|
|
249
|
+
var _el$ = _tmpl$$l(), _el$2 = _el$.firstChild;
|
|
250
|
+
effect((_p$) => {
|
|
251
|
+
var _v$ = ["relative rounded-full transition-colors duration-200", "focus-within:ring-2 focus-within:ring-accent-300 focus-within:ring-offset-2 focus-within:ring-offset-bg-400", size().track, renderProps.isSelected ? "bg-accent" : "bg-bg-300", renderProps.isDisabled ? "cursor-not-allowed" : "cursor-pointer"].join(" "), _v$2 = ["absolute top-0.5 left-0.5 rounded-full bg-white shadow transition-transform duration-200", size().thumb, renderProps.isSelected ? size().translate : "translate-x-0"].join(" ");
|
|
252
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
253
|
+
_v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
|
|
254
|
+
return _p$;
|
|
255
|
+
}, {
|
|
256
|
+
e: void 0,
|
|
257
|
+
t: void 0
|
|
258
|
+
});
|
|
259
|
+
return _el$;
|
|
260
|
+
})(), memo(() => memo(() => !!local.children)() && (() => {
|
|
261
|
+
var _el$3 = _tmpl$2$g();
|
|
262
|
+
insert(_el$3, () => local.children);
|
|
263
|
+
return _el$3;
|
|
264
|
+
})())]
|
|
265
|
+
}));
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
var _tmpl$$k = /* @__PURE__ */ template(`<div><div></div><div class="flex z-10 h-8 justify-around"><button type=button><span></span></button><button type=button><span>`);
|
|
269
|
+
function TabSwitch(props) {
|
|
270
|
+
const [leftSelected, setLeftSelected] = createSignal(props.value ? props.value === props.options[0]?.value : true);
|
|
271
|
+
createEffect(() => {
|
|
272
|
+
if (props.value !== void 0) {
|
|
273
|
+
setLeftSelected(props.value === props.options[0]?.value);
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
const toggle = () => {
|
|
277
|
+
const newLeftSelected = !leftSelected();
|
|
278
|
+
setLeftSelected(newLeftSelected);
|
|
279
|
+
const newValue = newLeftSelected ? props.options[0]?.value : props.options[1]?.value;
|
|
280
|
+
if (newValue) {
|
|
281
|
+
props.onChange?.(newValue);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
const leftSelectedStyle = "left-0 w-[142px] border-l-2";
|
|
285
|
+
const rightSelectedStyle = "left-[142px] w-[108px] border-r-2";
|
|
286
|
+
const textSelected = "font-extrabold text-primary-300";
|
|
287
|
+
const textUnselected = "font-medium text-primary-600 tracking-wider";
|
|
288
|
+
return (() => {
|
|
289
|
+
var _el$ = _tmpl$$k(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$4.nextSibling, _el$7 = _el$6.firstChild;
|
|
290
|
+
_el$.$$click = toggle;
|
|
291
|
+
insert(_el$5, () => props.options[0]?.label ?? "TENDENCIAS");
|
|
292
|
+
insert(_el$7, () => props.options[1]?.label ?? "ÚLTIMOS");
|
|
293
|
+
effect((_p$) => {
|
|
294
|
+
var _v$ = `relative bg-bg-400 rounded-full w-[250px] cursor-pointer ${props.class ?? ""}`, _v$2 = `${leftSelected() ? leftSelectedStyle : rightSelectedStyle} transition-all duration-500 ease-in-out z-0 absolute bg-primary-600 rounded-full h-8 border-accent-300`, _v$3 = `${leftSelected() ? textSelected : textUnselected} transition-all ease-in-out duration-500 z-10 text-lg flex justify-center items-center pointer-events-none`, _v$4 = `${leftSelected() ? textUnselected : textSelected} transition-all ease-in-out duration-500 z-10 text-lg flex justify-center items-center pointer-events-none`;
|
|
295
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
296
|
+
_v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
|
|
297
|
+
_v$3 !== _p$.a && className(_el$4, _p$.a = _v$3);
|
|
298
|
+
_v$4 !== _p$.o && className(_el$6, _p$.o = _v$4);
|
|
299
|
+
return _p$;
|
|
300
|
+
}, {
|
|
301
|
+
e: void 0,
|
|
302
|
+
t: void 0,
|
|
303
|
+
a: void 0,
|
|
304
|
+
o: void 0
|
|
305
|
+
});
|
|
306
|
+
return _el$;
|
|
307
|
+
})();
|
|
308
|
+
}
|
|
309
|
+
delegateEvents(["click"]);
|
|
310
|
+
|
|
311
|
+
var _tmpl$$j = /* @__PURE__ */ template(`<svg viewBox="0 0 12 10"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 5L4.5 8.5L11 1"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>`), _tmpl$2$f = /* @__PURE__ */ template(`<svg viewBox="0 0 12 2"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1H11"stroke=currentColor stroke-width=2 stroke-linecap=round>`), _tmpl$3$b = /* @__PURE__ */ template(`<span>`), _tmpl$4$b = /* @__PURE__ */ template(`<span class="text-sm font-medium text-primary-200">`), _tmpl$5$6 = /* @__PURE__ */ template(`<div class="flex flex-col gap-2">`), _tmpl$6$3 = /* @__PURE__ */ template(`<span class="text-sm text-primary-400">`), _tmpl$7$2 = /* @__PURE__ */ template(`<span class="text-sm text-danger-400">`);
|
|
312
|
+
const sizeStyles$3 = {
|
|
313
|
+
sm: {
|
|
314
|
+
box: "h-4 w-4",
|
|
315
|
+
icon: "h-3 w-3",
|
|
316
|
+
label: "text-sm"
|
|
317
|
+
},
|
|
318
|
+
md: {
|
|
319
|
+
box: "h-5 w-5",
|
|
320
|
+
icon: "h-3.5 w-3.5",
|
|
321
|
+
label: "text-base"
|
|
322
|
+
},
|
|
323
|
+
lg: {
|
|
324
|
+
box: "h-6 w-6",
|
|
325
|
+
icon: "h-4 w-4",
|
|
326
|
+
label: "text-lg"
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
function CheckIcon(props) {
|
|
330
|
+
return (() => {
|
|
331
|
+
var _el$ = _tmpl$$j();
|
|
332
|
+
effect(() => setAttribute(_el$, "class", props.class));
|
|
333
|
+
return _el$;
|
|
334
|
+
})();
|
|
335
|
+
}
|
|
336
|
+
function IndeterminateIcon(props) {
|
|
337
|
+
return (() => {
|
|
338
|
+
var _el$2 = _tmpl$2$f();
|
|
339
|
+
effect(() => setAttribute(_el$2, "class", props.class));
|
|
340
|
+
return _el$2;
|
|
341
|
+
})();
|
|
342
|
+
}
|
|
343
|
+
function Checkbox(props) {
|
|
344
|
+
const defaultProps = {
|
|
345
|
+
size: "md"
|
|
346
|
+
};
|
|
347
|
+
const merged = mergeProps(defaultProps, props);
|
|
348
|
+
const [local, headlessProps] = splitProps(merged, ["size", "class", "children"]);
|
|
349
|
+
const size = () => sizeStyles$3[local.size];
|
|
350
|
+
const getClassName = (renderProps) => {
|
|
351
|
+
const base = "inline-flex items-center gap-2 cursor-pointer";
|
|
352
|
+
const disabledClass = renderProps.isDisabled ? "cursor-not-allowed opacity-50" : "";
|
|
353
|
+
const custom = local.class || "";
|
|
354
|
+
return [base, disabledClass, custom].filter(Boolean).join(" ");
|
|
355
|
+
};
|
|
356
|
+
return createComponent(Checkbox$1, mergeProps$1(headlessProps, {
|
|
357
|
+
"class": getClassName,
|
|
358
|
+
children: (renderProps) => {
|
|
359
|
+
const boxClasses = () => {
|
|
360
|
+
const base = "relative flex items-center justify-center rounded border-2 transition-all duration-200";
|
|
361
|
+
const sizeClass = size().box;
|
|
362
|
+
let colorClass;
|
|
363
|
+
if (renderProps.isDisabled) {
|
|
364
|
+
colorClass = "border-bg-300 bg-bg-200";
|
|
365
|
+
} else if (renderProps.isSelected || renderProps.isIndeterminate) {
|
|
366
|
+
colorClass = "border-accent bg-accent";
|
|
367
|
+
} else {
|
|
368
|
+
colorClass = "border-primary-600 bg-transparent hover:border-accent-300";
|
|
369
|
+
}
|
|
370
|
+
const focusClass = renderProps.isFocusVisible ? "ring-2 ring-accent-300 ring-offset-2 ring-offset-bg-400" : "";
|
|
371
|
+
const cursorClass = renderProps.isDisabled ? "cursor-not-allowed" : "cursor-pointer";
|
|
372
|
+
return [base, sizeClass, colorClass, focusClass, cursorClass].filter(Boolean).join(" ");
|
|
373
|
+
};
|
|
374
|
+
const iconClasses = () => {
|
|
375
|
+
const base = "text-white transition-opacity duration-200";
|
|
376
|
+
const sizeClass = size().icon;
|
|
377
|
+
const visibilityClass = renderProps.isSelected || renderProps.isIndeterminate ? "opacity-100" : "opacity-0";
|
|
378
|
+
return [base, sizeClass, visibilityClass].filter(Boolean).join(" ");
|
|
379
|
+
};
|
|
380
|
+
const labelClasses = () => {
|
|
381
|
+
const base = "text-primary-200";
|
|
382
|
+
const sizeClass = size().label;
|
|
383
|
+
const disabledClass = renderProps.isDisabled ? "opacity-50" : "";
|
|
384
|
+
return [base, sizeClass, disabledClass].filter(Boolean).join(" ");
|
|
385
|
+
};
|
|
386
|
+
return [(() => {
|
|
387
|
+
var _el$3 = _tmpl$3$b();
|
|
388
|
+
insert(_el$3, createComponent(Show, {
|
|
389
|
+
get when() {
|
|
390
|
+
return !renderProps.isIndeterminate;
|
|
391
|
+
},
|
|
392
|
+
get fallback() {
|
|
393
|
+
return createComponent(IndeterminateIcon, {
|
|
394
|
+
get ["class"]() {
|
|
395
|
+
return iconClasses();
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
},
|
|
399
|
+
get children() {
|
|
400
|
+
return createComponent(CheckIcon, {
|
|
401
|
+
get ["class"]() {
|
|
402
|
+
return iconClasses();
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
}));
|
|
407
|
+
effect(() => className(_el$3, boxClasses()));
|
|
408
|
+
return _el$3;
|
|
409
|
+
})(), createComponent(Show, {
|
|
410
|
+
get when() {
|
|
411
|
+
return local.children;
|
|
412
|
+
},
|
|
413
|
+
get children() {
|
|
414
|
+
var _el$4 = _tmpl$3$b();
|
|
415
|
+
insert(_el$4, () => local.children);
|
|
416
|
+
effect(() => className(_el$4, labelClasses()));
|
|
417
|
+
return _el$4;
|
|
418
|
+
}
|
|
419
|
+
})];
|
|
420
|
+
}
|
|
421
|
+
}));
|
|
422
|
+
}
|
|
423
|
+
function CheckboxGroup(props) {
|
|
424
|
+
const [local, headlessProps] = splitProps(props, ["class", "children", "label", "description", "errorMessage"]);
|
|
425
|
+
const getClassName = (renderProps) => {
|
|
426
|
+
const base = "flex flex-col gap-2";
|
|
427
|
+
const disabledClass = renderProps.isDisabled ? "opacity-50" : "";
|
|
428
|
+
const custom = local.class || "";
|
|
429
|
+
return [base, disabledClass, custom].filter(Boolean).join(" ");
|
|
430
|
+
};
|
|
431
|
+
const renderChildren = (renderProps) => [createComponent(Show, {
|
|
432
|
+
get when() {
|
|
433
|
+
return local.label;
|
|
434
|
+
},
|
|
435
|
+
get children() {
|
|
436
|
+
var _el$5 = _tmpl$4$b();
|
|
437
|
+
insert(_el$5, () => local.label);
|
|
438
|
+
return _el$5;
|
|
439
|
+
}
|
|
440
|
+
}), (() => {
|
|
441
|
+
var _el$6 = _tmpl$5$6();
|
|
442
|
+
insert(_el$6, () => local.children);
|
|
443
|
+
return _el$6;
|
|
444
|
+
})(), createComponent(Show, {
|
|
445
|
+
get when() {
|
|
446
|
+
return memo(() => !!local.description)() && !renderProps.isInvalid;
|
|
447
|
+
},
|
|
448
|
+
get children() {
|
|
449
|
+
var _el$7 = _tmpl$6$3();
|
|
450
|
+
insert(_el$7, () => local.description);
|
|
451
|
+
return _el$7;
|
|
452
|
+
}
|
|
453
|
+
}), createComponent(Show, {
|
|
454
|
+
get when() {
|
|
455
|
+
return memo(() => !!local.errorMessage)() && renderProps.isInvalid;
|
|
456
|
+
},
|
|
457
|
+
get children() {
|
|
458
|
+
var _el$8 = _tmpl$7$2();
|
|
459
|
+
insert(_el$8, () => local.errorMessage);
|
|
460
|
+
return _el$8;
|
|
461
|
+
}
|
|
462
|
+
})];
|
|
463
|
+
return createComponent(CheckboxGroup$1, mergeProps$1(headlessProps, {
|
|
464
|
+
"class": getClassName,
|
|
465
|
+
children: renderChildren
|
|
466
|
+
}));
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
var _tmpl$$i = /* @__PURE__ */ template(`<span class="text-primary-200 font-medium mb-1">`), _tmpl$2$e = /* @__PURE__ */ template(`<span class="text-primary-400 text-sm">`), _tmpl$3$a = /* @__PURE__ */ template(`<span class="text-danger-400 text-sm">`), _tmpl$4$a = /* @__PURE__ */ template(`<span><span>`), _tmpl$5$5 = /* @__PURE__ */ template(`<span>`);
|
|
470
|
+
const RadioSizeContext = createContext("md");
|
|
471
|
+
const sizeStyles$2 = {
|
|
472
|
+
sm: {
|
|
473
|
+
circle: "h-4 w-4",
|
|
474
|
+
dot: "h-2 w-2",
|
|
475
|
+
label: "text-sm"
|
|
476
|
+
},
|
|
477
|
+
md: {
|
|
478
|
+
circle: "h-5 w-5",
|
|
479
|
+
dot: "h-2.5 w-2.5",
|
|
480
|
+
label: "text-base"
|
|
481
|
+
},
|
|
482
|
+
lg: {
|
|
483
|
+
circle: "h-6 w-6",
|
|
484
|
+
dot: "h-3 w-3",
|
|
485
|
+
label: "text-lg"
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
function RadioGroup(props) {
|
|
489
|
+
const [local, headlessProps] = splitProps(props, ["size", "class", "label", "description", "errorMessage", "children"]);
|
|
490
|
+
const size = local.size ?? "md";
|
|
491
|
+
const customClass = local.class ?? "";
|
|
492
|
+
const getClassName = (renderProps) => {
|
|
493
|
+
const base = "flex gap-2";
|
|
494
|
+
const orientationClass = renderProps.orientation === "horizontal" ? "flex-row flex-wrap" : "flex-col";
|
|
495
|
+
const disabledClass = renderProps.isDisabled ? "opacity-50" : "";
|
|
496
|
+
return [base, orientationClass, disabledClass, customClass].filter(Boolean).join(" ");
|
|
497
|
+
};
|
|
498
|
+
const renderChildren = (renderProps) => [createComponent(Show, {
|
|
499
|
+
get when() {
|
|
500
|
+
return local.label;
|
|
501
|
+
},
|
|
502
|
+
get children() {
|
|
503
|
+
var _el$ = _tmpl$$i();
|
|
504
|
+
insert(_el$, () => local.label);
|
|
505
|
+
return _el$;
|
|
506
|
+
}
|
|
507
|
+
}), memo(() => memo(() => typeof local.children === "function")() ? local.children(renderProps) : local.children), createComponent(Show, {
|
|
508
|
+
get when() {
|
|
509
|
+
return memo(() => !!local.description)() && !renderProps.isInvalid;
|
|
510
|
+
},
|
|
511
|
+
get children() {
|
|
512
|
+
var _el$2 = _tmpl$2$e();
|
|
513
|
+
insert(_el$2, () => local.description);
|
|
514
|
+
return _el$2;
|
|
515
|
+
}
|
|
516
|
+
}), createComponent(Show, {
|
|
517
|
+
get when() {
|
|
518
|
+
return memo(() => !!local.errorMessage)() && renderProps.isInvalid;
|
|
519
|
+
},
|
|
520
|
+
get children() {
|
|
521
|
+
var _el$3 = _tmpl$3$a();
|
|
522
|
+
insert(_el$3, () => local.errorMessage);
|
|
523
|
+
return _el$3;
|
|
524
|
+
}
|
|
525
|
+
})];
|
|
526
|
+
return createComponent(RadioSizeContext.Provider, {
|
|
527
|
+
value: size,
|
|
528
|
+
get children() {
|
|
529
|
+
return createComponent(RadioGroup$1, mergeProps$1(headlessProps, {
|
|
530
|
+
"class": getClassName,
|
|
531
|
+
"data-size": size,
|
|
532
|
+
children: renderChildren
|
|
533
|
+
}));
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
function Radio(props) {
|
|
538
|
+
const sizeFromContext = useContext(RadioSizeContext);
|
|
539
|
+
const size = () => sizeStyles$2[sizeFromContext];
|
|
540
|
+
const customClass = props.class ?? "";
|
|
541
|
+
const getClassName = (renderProps) => {
|
|
542
|
+
const base = "inline-flex items-center gap-2 cursor-pointer";
|
|
543
|
+
const disabledClass = renderProps.isDisabled ? "cursor-not-allowed opacity-50" : "";
|
|
544
|
+
return [base, disabledClass, customClass].filter(Boolean).join(" ");
|
|
545
|
+
};
|
|
546
|
+
const {
|
|
547
|
+
class: _,
|
|
548
|
+
children,
|
|
549
|
+
...headlessProps
|
|
550
|
+
} = props;
|
|
551
|
+
return createComponent(Radio$1, mergeProps$1(headlessProps, {
|
|
552
|
+
"class": getClassName,
|
|
553
|
+
children: (renderProps) => {
|
|
554
|
+
const circleClasses = () => {
|
|
555
|
+
const base = "relative flex items-center justify-center rounded-full border-2 transition-all duration-200";
|
|
556
|
+
const sizeClass = size().circle;
|
|
557
|
+
let colorClass;
|
|
558
|
+
if (renderProps.isDisabled) {
|
|
559
|
+
colorClass = "border-bg-300 bg-bg-200";
|
|
560
|
+
} else if (renderProps.isSelected) {
|
|
561
|
+
colorClass = "border-accent bg-transparent";
|
|
562
|
+
} else {
|
|
563
|
+
colorClass = "border-primary-600 bg-transparent hover:border-accent-300";
|
|
564
|
+
}
|
|
565
|
+
const focusClass = renderProps.isFocusVisible ? "ring-2 ring-accent-300 ring-offset-2 ring-offset-bg-400" : "";
|
|
566
|
+
const cursorClass = renderProps.isDisabled ? "cursor-not-allowed" : "cursor-pointer";
|
|
567
|
+
return [base, sizeClass, colorClass, focusClass, cursorClass].filter(Boolean).join(" ");
|
|
568
|
+
};
|
|
569
|
+
const dotClasses = () => {
|
|
570
|
+
const base = "rounded-full bg-accent transition-all duration-200";
|
|
571
|
+
const sizeClass = size().dot;
|
|
572
|
+
const visibilityClass = renderProps.isSelected ? "scale-100 opacity-100" : "scale-0 opacity-0";
|
|
573
|
+
return [base, sizeClass, visibilityClass].filter(Boolean).join(" ");
|
|
574
|
+
};
|
|
575
|
+
const labelClasses = () => {
|
|
576
|
+
const base = "text-primary-200";
|
|
577
|
+
const sizeClass = size().label;
|
|
578
|
+
const disabledClass = renderProps.isDisabled ? "opacity-50" : "";
|
|
579
|
+
return [base, sizeClass, disabledClass].filter(Boolean).join(" ");
|
|
580
|
+
};
|
|
581
|
+
const resolvedChildren = typeof children === "function" ? children(renderProps) : children;
|
|
582
|
+
return [(() => {
|
|
583
|
+
var _el$4 = _tmpl$4$a(), _el$5 = _el$4.firstChild;
|
|
584
|
+
effect((_p$) => {
|
|
585
|
+
var _v$ = circleClasses(), _v$2 = dotClasses();
|
|
586
|
+
_v$ !== _p$.e && className(_el$4, _p$.e = _v$);
|
|
587
|
+
_v$2 !== _p$.t && className(_el$5, _p$.t = _v$2);
|
|
588
|
+
return _p$;
|
|
589
|
+
}, {
|
|
590
|
+
e: void 0,
|
|
591
|
+
t: void 0
|
|
592
|
+
});
|
|
593
|
+
return _el$4;
|
|
594
|
+
})(), createComponent(Show, {
|
|
595
|
+
when: resolvedChildren,
|
|
596
|
+
get children() {
|
|
597
|
+
var _el$6 = _tmpl$5$5();
|
|
598
|
+
insert(_el$6, resolvedChildren);
|
|
599
|
+
effect(() => className(_el$6, labelClasses()));
|
|
600
|
+
return _el$6;
|
|
601
|
+
}
|
|
602
|
+
})];
|
|
603
|
+
}
|
|
604
|
+
}));
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
var _tmpl$$h = /* @__PURE__ */ template(`<button><span>`), _tmpl$2$d = /* @__PURE__ */ template(`<span class=mr-1.5>`);
|
|
608
|
+
const variantStyles$3 = {
|
|
609
|
+
primary: "bg-primary-700 text-primary-200 shadow-primary-chip",
|
|
610
|
+
secondary: "bg-primary-600 text-primary-100 hover:bg-primary-500",
|
|
611
|
+
accent: "bg-accent text-white",
|
|
612
|
+
outline: "bg-transparent border border-primary-500 text-primary-300"
|
|
613
|
+
};
|
|
614
|
+
function Chip(props) {
|
|
615
|
+
const variant = () => props.variant ?? "primary";
|
|
616
|
+
return (() => {
|
|
617
|
+
var _el$ = _tmpl$$h(), _el$2 = _el$.firstChild;
|
|
618
|
+
addEventListener(_el$, "click", props.onClick, true);
|
|
619
|
+
insert(_el$, (() => {
|
|
620
|
+
var _c$ = memo(() => !!props.icon);
|
|
621
|
+
return () => _c$() && (() => {
|
|
622
|
+
var _el$3 = _tmpl$2$d();
|
|
623
|
+
insert(_el$3, () => props.icon);
|
|
624
|
+
return _el$3;
|
|
625
|
+
})();
|
|
626
|
+
})(), _el$2);
|
|
627
|
+
insert(_el$2, () => props.text);
|
|
628
|
+
effect(() => className(_el$, `flex justify-center items-center h-6 w-auto rounded-full px-4 py-1 font-medium text-sm tracking-wide transition-colors ${variantStyles$3[variant()]} ${props.class ?? ""}`));
|
|
629
|
+
return _el$;
|
|
630
|
+
})();
|
|
631
|
+
}
|
|
632
|
+
delegateEvents(["click"]);
|
|
633
|
+
|
|
634
|
+
var _tmpl$$g = /* @__PURE__ */ template(`<span class="text-base font-normal text-primary-300">`), _tmpl$2$c = /* @__PURE__ */ template(`<div class="flex flex-1 flex-row items-end justify-center gap-5 py-5">`), _tmpl$3$9 = /* @__PURE__ */ template(`<div class="relative bottom-4 right-4 w-full"><div class="flex flex-row justify-end gap-2 pr-4">`), _tmpl$4$9 = /* @__PURE__ */ template(`<div><span class="relative left-8 top-4 bg-gradient-to-b from-primary-100 to-primary-500 bg-clip-text text-4xl font-extrabold text-transparent"></span><div class="flex h-[50px] flex-col justify-end rounded-t-[26px] bg-primary-800"><div class="flex h-[40px] flex-col justify-end rounded-t-[30px] bg-primary-600"><div class="flex h-[20px] items-center justify-end rounded-t-[100px] bg-primary-700 pr-4"></div></div></div><div class="mt-1 flex min-h-[200px] flex-col rounded-b-[26px] rounded-t-lg border-b border-accent-500 bg-bg-300"><div class="flex flex-1 flex-col p-4"><div class="text-lg text-gray-100">`);
|
|
635
|
+
function Dialog(props) {
|
|
636
|
+
return (() => {
|
|
637
|
+
var _el$ = _tmpl$4$9(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$7 = _el$3.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild;
|
|
638
|
+
insert(_el$2, () => props.title);
|
|
639
|
+
insert(_el$5, createComponent(Show, {
|
|
640
|
+
get when() {
|
|
641
|
+
return props.subtitle;
|
|
642
|
+
},
|
|
643
|
+
get children() {
|
|
644
|
+
var _el$6 = _tmpl$$g();
|
|
645
|
+
insert(_el$6, () => props.subtitle);
|
|
646
|
+
return _el$6;
|
|
647
|
+
}
|
|
648
|
+
}));
|
|
649
|
+
insert(_el$9, () => props.children);
|
|
650
|
+
insert(_el$8, createComponent(Show, {
|
|
651
|
+
get when() {
|
|
652
|
+
return props.primaryAction || props.secondaryAction;
|
|
653
|
+
},
|
|
654
|
+
get children() {
|
|
655
|
+
var _el$0 = _tmpl$2$c();
|
|
656
|
+
insert(_el$0, createComponent(Show, {
|
|
657
|
+
get when() {
|
|
658
|
+
return props.secondaryAction;
|
|
659
|
+
},
|
|
660
|
+
get children() {
|
|
661
|
+
return createComponent(Button, {
|
|
662
|
+
variant: "primary",
|
|
663
|
+
buttonStyle: "outline",
|
|
664
|
+
get onPress() {
|
|
665
|
+
return props.secondaryAction.onClick;
|
|
666
|
+
},
|
|
667
|
+
get children() {
|
|
668
|
+
return props.secondaryAction.label;
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
}), null);
|
|
673
|
+
insert(_el$0, createComponent(Show, {
|
|
674
|
+
get when() {
|
|
675
|
+
return props.primaryAction;
|
|
676
|
+
},
|
|
677
|
+
get children() {
|
|
678
|
+
return createComponent(Button, {
|
|
679
|
+
variant: "primary",
|
|
680
|
+
get onPress() {
|
|
681
|
+
return props.primaryAction.onClick;
|
|
682
|
+
},
|
|
683
|
+
get children() {
|
|
684
|
+
return props.primaryAction.label;
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
}), null);
|
|
689
|
+
return _el$0;
|
|
690
|
+
}
|
|
691
|
+
}), null);
|
|
692
|
+
insert(_el$, createComponent(Show, {
|
|
693
|
+
get when() {
|
|
694
|
+
return memo(() => !!props.tags)() && props.tags.length > 0;
|
|
695
|
+
},
|
|
696
|
+
get children() {
|
|
697
|
+
var _el$1 = _tmpl$3$9(), _el$10 = _el$1.firstChild;
|
|
698
|
+
insert(_el$10, () => props.tags.map((tag) => createComponent(Chip, {
|
|
699
|
+
variant: "primary",
|
|
700
|
+
text: tag
|
|
701
|
+
})));
|
|
702
|
+
return _el$1;
|
|
703
|
+
}
|
|
704
|
+
}), null);
|
|
705
|
+
effect(() => className(_el$, `flex flex-col w-full max-w-[540px] ${props.class ?? ""}`));
|
|
706
|
+
return _el$;
|
|
707
|
+
})();
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
var _tmpl$$f = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"aria-hidden=true><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z">`);
|
|
711
|
+
function GitHubIcon(props) {
|
|
712
|
+
return (() => {
|
|
713
|
+
var _el$ = _tmpl$$f();
|
|
714
|
+
effect((_p$) => {
|
|
715
|
+
var _v$ = props.size, _v$2 = props.size, _v$3 = props.color;
|
|
716
|
+
_v$ !== _p$.e && setAttribute(_el$, "width", _p$.e = _v$);
|
|
717
|
+
_v$2 !== _p$.t && setAttribute(_el$, "height", _p$.t = _v$2);
|
|
718
|
+
_v$3 !== _p$.a && setAttribute(_el$, "fill", _p$.a = _v$3);
|
|
719
|
+
return _p$;
|
|
720
|
+
}, {
|
|
721
|
+
e: void 0,
|
|
722
|
+
t: void 0,
|
|
723
|
+
a: void 0
|
|
724
|
+
});
|
|
725
|
+
return _el$;
|
|
726
|
+
})();
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
var _tmpl$$e = /* @__PURE__ */ template(`<div><div class=vui-icon__main>`), _tmpl$2$b = /* @__PURE__ */ template(`<div class=vui-icon__shadow>`);
|
|
730
|
+
function Icon(props) {
|
|
731
|
+
const size = () => props.size ?? 24;
|
|
732
|
+
const color = () => props.color ?? "var(--color-primary-500)";
|
|
733
|
+
const IconComponent = props.icon;
|
|
734
|
+
return (() => {
|
|
735
|
+
var _el$ = _tmpl$$e(), _el$2 = _el$.firstChild;
|
|
736
|
+
addEventListener(_el$, "click", props.onClick, true);
|
|
737
|
+
insert(_el$, (() => {
|
|
738
|
+
var _c$ = memo(() => !!props.withShadow);
|
|
739
|
+
return () => _c$() && (() => {
|
|
740
|
+
var _el$3 = _tmpl$2$b();
|
|
741
|
+
insert(_el$3, createComponent(IconComponent, {
|
|
742
|
+
get size() {
|
|
743
|
+
return size();
|
|
744
|
+
},
|
|
745
|
+
color: "var(--color-accent)"
|
|
746
|
+
}));
|
|
747
|
+
return _el$3;
|
|
748
|
+
})();
|
|
749
|
+
})(), _el$2);
|
|
750
|
+
insert(_el$2, createComponent(IconComponent, {
|
|
751
|
+
get size() {
|
|
752
|
+
return size();
|
|
753
|
+
},
|
|
754
|
+
get color() {
|
|
755
|
+
return color();
|
|
756
|
+
}
|
|
757
|
+
}));
|
|
758
|
+
effect(() => className(_el$, `vui-icon ${props.withShadow ? "vui-icon--with-shadow" : ""} ${props.class ?? ""}`));
|
|
759
|
+
return _el$;
|
|
760
|
+
})();
|
|
761
|
+
}
|
|
762
|
+
delegateEvents(["click"]);
|
|
763
|
+
|
|
764
|
+
var _tmpl$$d = /* @__PURE__ */ template(`<div><div class=vui-tooltip__trigger></div><div><span>`);
|
|
765
|
+
function Tooltip(props) {
|
|
766
|
+
const position = () => props.position ?? "bottom";
|
|
767
|
+
return (() => {
|
|
768
|
+
var _el$ = _tmpl$$d(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild;
|
|
769
|
+
insert(_el$2, () => props.children);
|
|
770
|
+
insert(_el$4, () => props.label);
|
|
771
|
+
effect((_p$) => {
|
|
772
|
+
var _v$ = `vui-tooltip ${props.class ?? ""}`, _v$2 = `vui-tooltip__content vui-tooltip__content--${position()}`;
|
|
773
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
774
|
+
_v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
|
|
775
|
+
return _p$;
|
|
776
|
+
}, {
|
|
777
|
+
e: void 0,
|
|
778
|
+
t: void 0
|
|
779
|
+
});
|
|
780
|
+
return _el$;
|
|
781
|
+
})();
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
function access(value) {
|
|
785
|
+
return typeof value === "function" ? value() : value;
|
|
786
|
+
}
|
|
787
|
+
function createTextFieldState(props = {}) {
|
|
788
|
+
const getProps = () => access(props);
|
|
789
|
+
const initialProps = getProps();
|
|
790
|
+
const initialValue = initialProps.value ?? initialProps.defaultValue ?? "";
|
|
791
|
+
const [internalValue, setInternalValue] = createSignal(initialValue);
|
|
792
|
+
const isControlled = () => getProps().value !== void 0;
|
|
793
|
+
const value = () => {
|
|
794
|
+
const p = getProps();
|
|
795
|
+
return isControlled() ? p.value ?? "" : internalValue();
|
|
796
|
+
};
|
|
797
|
+
function setValue(newValue) {
|
|
798
|
+
var _a;
|
|
799
|
+
const p = getProps();
|
|
800
|
+
if (!isControlled()) {
|
|
801
|
+
setInternalValue(newValue);
|
|
802
|
+
}
|
|
803
|
+
(_a = p.onChange) == null ? void 0 : _a.call(p, newValue);
|
|
804
|
+
}
|
|
805
|
+
return {
|
|
806
|
+
value,
|
|
807
|
+
setValue
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
var _tmpl$$c = /* @__PURE__ */ template(`<span class="text-danger-400 ml-0.5">*`), _tmpl$2$a = /* @__PURE__ */ template(`<label>`), _tmpl$3$8 = /* @__PURE__ */ template(`<p>`), _tmpl$4$8 = /* @__PURE__ */ template(`<div><input>`);
|
|
812
|
+
const sizeStyles$1 = {
|
|
813
|
+
sm: {
|
|
814
|
+
input: "h-8 px-2 text-sm",
|
|
815
|
+
label: "text-sm",
|
|
816
|
+
description: "text-xs"
|
|
817
|
+
},
|
|
818
|
+
md: {
|
|
819
|
+
input: "h-10 px-3 text-base",
|
|
820
|
+
label: "text-sm",
|
|
821
|
+
description: "text-sm"
|
|
822
|
+
},
|
|
823
|
+
lg: {
|
|
824
|
+
input: "h-12 px-4 text-lg",
|
|
825
|
+
label: "text-base",
|
|
826
|
+
description: "text-sm"
|
|
827
|
+
}
|
|
828
|
+
};
|
|
829
|
+
function TextField(props) {
|
|
830
|
+
const defaultProps = {
|
|
831
|
+
size: "md",
|
|
832
|
+
variant: "outline"
|
|
833
|
+
};
|
|
834
|
+
const merged = mergeProps(defaultProps, props);
|
|
835
|
+
const [local, ariaProps] = splitProps(merged, ["size", "variant", "class", "label", "description", "errorMessage"]);
|
|
836
|
+
const size = () => sizeStyles$1[local.size];
|
|
837
|
+
const state = createTextFieldState(() => ({
|
|
838
|
+
value: ariaProps.value,
|
|
839
|
+
defaultValue: ariaProps.defaultValue,
|
|
840
|
+
onChange: ariaProps.onChange
|
|
841
|
+
}));
|
|
842
|
+
const textFieldAria = createTextField(() => ({
|
|
843
|
+
...ariaProps,
|
|
844
|
+
value: state.value(),
|
|
845
|
+
onChange: state.setValue
|
|
846
|
+
}));
|
|
847
|
+
const {
|
|
848
|
+
isFocused,
|
|
849
|
+
isFocusVisible,
|
|
850
|
+
focusProps
|
|
851
|
+
} = createFocusRing();
|
|
852
|
+
const containerClasses = () => {
|
|
853
|
+
const base = "flex flex-col";
|
|
854
|
+
const disabledClass = ariaProps.isDisabled ? "opacity-60" : "";
|
|
855
|
+
const custom = local.class || "";
|
|
856
|
+
return [base, disabledClass, custom].filter(Boolean).join(" ");
|
|
857
|
+
};
|
|
858
|
+
const inputClasses = () => {
|
|
859
|
+
const base = "w-full rounded-md transition-all duration-200 outline-none";
|
|
860
|
+
const sizeClass = size().input;
|
|
861
|
+
let variantClass;
|
|
862
|
+
if (local.variant === "filled") {
|
|
863
|
+
variantClass = "bg-bg-200 border border-transparent";
|
|
864
|
+
} else {
|
|
865
|
+
variantClass = "bg-transparent border border-bg-400";
|
|
866
|
+
}
|
|
867
|
+
let stateClass;
|
|
868
|
+
if (ariaProps.isDisabled) {
|
|
869
|
+
stateClass = "bg-bg-200 text-primary-500 cursor-not-allowed";
|
|
870
|
+
} else if (textFieldAria.isInvalid) {
|
|
871
|
+
stateClass = "border-danger-500 focus:border-danger-400 focus:ring-2 focus:ring-danger-400/20";
|
|
872
|
+
} else {
|
|
873
|
+
stateClass = "text-primary-100 placeholder:text-primary-500 focus:border-accent focus:ring-2 focus:ring-accent/20";
|
|
874
|
+
}
|
|
875
|
+
const hoverClass = ariaProps.isDisabled ? "" : "hover:border-accent-300";
|
|
876
|
+
return [base, sizeClass, variantClass, stateClass, hoverClass].filter(Boolean).join(" ");
|
|
877
|
+
};
|
|
878
|
+
const labelClasses = () => {
|
|
879
|
+
const base = "block font-medium text-primary-200 mb-1";
|
|
880
|
+
const sizeClass = size().label;
|
|
881
|
+
return [base, sizeClass].filter(Boolean).join(" ");
|
|
882
|
+
};
|
|
883
|
+
const descriptionClasses = () => {
|
|
884
|
+
const base = "mt-1 text-primary-400";
|
|
885
|
+
const sizeClass = size().description;
|
|
886
|
+
return [base, sizeClass].filter(Boolean).join(" ");
|
|
887
|
+
};
|
|
888
|
+
const errorClasses = () => {
|
|
889
|
+
const base = "mt-1 text-danger-400";
|
|
890
|
+
const sizeClass = size().description;
|
|
891
|
+
return [base, sizeClass].filter(Boolean).join(" ");
|
|
892
|
+
};
|
|
893
|
+
const cleanLabelProps = () => {
|
|
894
|
+
const {
|
|
895
|
+
ref: _ref,
|
|
896
|
+
...rest
|
|
897
|
+
} = textFieldAria.labelProps;
|
|
898
|
+
return rest;
|
|
899
|
+
};
|
|
900
|
+
const cleanInputProps = () => {
|
|
901
|
+
const {
|
|
902
|
+
ref: _ref1,
|
|
903
|
+
...rest
|
|
904
|
+
} = textFieldAria.inputProps;
|
|
905
|
+
const {
|
|
906
|
+
ref: _ref2,
|
|
907
|
+
...focusRest
|
|
908
|
+
} = focusProps;
|
|
909
|
+
return {
|
|
910
|
+
...rest,
|
|
911
|
+
...focusRest
|
|
912
|
+
};
|
|
913
|
+
};
|
|
914
|
+
const cleanDescriptionProps = () => {
|
|
915
|
+
const {
|
|
916
|
+
ref: _ref,
|
|
917
|
+
...rest
|
|
918
|
+
} = textFieldAria.descriptionProps;
|
|
919
|
+
return rest;
|
|
920
|
+
};
|
|
921
|
+
const cleanErrorMessageProps = () => {
|
|
922
|
+
const {
|
|
923
|
+
ref: _ref,
|
|
924
|
+
...rest
|
|
925
|
+
} = textFieldAria.errorMessageProps;
|
|
926
|
+
return rest;
|
|
927
|
+
};
|
|
928
|
+
return (() => {
|
|
929
|
+
var _el$ = _tmpl$4$8(), _el$4 = _el$.firstChild;
|
|
930
|
+
insert(_el$, createComponent(Show, {
|
|
931
|
+
get when() {
|
|
932
|
+
return local.label;
|
|
933
|
+
},
|
|
934
|
+
get children() {
|
|
935
|
+
var _el$2 = _tmpl$2$a();
|
|
936
|
+
spread(_el$2, mergeProps$1(cleanLabelProps, {
|
|
937
|
+
get ["class"]() {
|
|
938
|
+
return labelClasses();
|
|
939
|
+
}
|
|
940
|
+
}), false, true);
|
|
941
|
+
insert(_el$2, () => local.label, null);
|
|
942
|
+
insert(_el$2, createComponent(Show, {
|
|
943
|
+
get when() {
|
|
944
|
+
return ariaProps.isRequired;
|
|
945
|
+
},
|
|
946
|
+
get children() {
|
|
947
|
+
return _tmpl$$c();
|
|
948
|
+
}
|
|
949
|
+
}), null);
|
|
950
|
+
return _el$2;
|
|
951
|
+
}
|
|
952
|
+
}), _el$4);
|
|
953
|
+
spread(_el$4, mergeProps$1(cleanInputProps, {
|
|
954
|
+
get ["class"]() {
|
|
955
|
+
return inputClasses();
|
|
956
|
+
}
|
|
957
|
+
}), false, false);
|
|
958
|
+
insert(_el$, createComponent(Show, {
|
|
959
|
+
get when() {
|
|
960
|
+
return memo(() => !!local.description)() && !textFieldAria.isInvalid;
|
|
961
|
+
},
|
|
962
|
+
get children() {
|
|
963
|
+
var _el$5 = _tmpl$3$8();
|
|
964
|
+
spread(_el$5, mergeProps$1(cleanDescriptionProps, {
|
|
965
|
+
get ["class"]() {
|
|
966
|
+
return descriptionClasses();
|
|
967
|
+
}
|
|
968
|
+
}), false, true);
|
|
969
|
+
insert(_el$5, () => local.description);
|
|
970
|
+
return _el$5;
|
|
971
|
+
}
|
|
972
|
+
}), null);
|
|
973
|
+
insert(_el$, createComponent(Show, {
|
|
974
|
+
get when() {
|
|
975
|
+
return memo(() => !!local.errorMessage)() && textFieldAria.isInvalid;
|
|
976
|
+
},
|
|
977
|
+
get children() {
|
|
978
|
+
var _el$6 = _tmpl$3$8();
|
|
979
|
+
spread(_el$6, mergeProps$1(cleanErrorMessageProps, {
|
|
980
|
+
get ["class"]() {
|
|
981
|
+
return errorClasses();
|
|
982
|
+
}
|
|
983
|
+
}), false, true);
|
|
984
|
+
insert(_el$6, () => local.errorMessage);
|
|
985
|
+
return _el$6;
|
|
986
|
+
}
|
|
987
|
+
}), null);
|
|
988
|
+
effect((_p$) => {
|
|
989
|
+
var _v$ = containerClasses(), _v$2 = ariaProps.isDisabled || void 0, _v$3 = textFieldAria.isInvalid || void 0, _v$4 = ariaProps.isReadOnly || void 0, _v$5 = ariaProps.isRequired || void 0, _v$6 = isFocused() || void 0, _v$7 = isFocusVisible() || void 0;
|
|
990
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
991
|
+
_v$2 !== _p$.t && setAttribute(_el$, "data-disabled", _p$.t = _v$2);
|
|
992
|
+
_v$3 !== _p$.a && setAttribute(_el$, "data-invalid", _p$.a = _v$3);
|
|
993
|
+
_v$4 !== _p$.o && setAttribute(_el$, "data-readonly", _p$.o = _v$4);
|
|
994
|
+
_v$5 !== _p$.i && setAttribute(_el$, "data-required", _p$.i = _v$5);
|
|
995
|
+
_v$6 !== _p$.n && setAttribute(_el$, "data-focused", _p$.n = _v$6);
|
|
996
|
+
_v$7 !== _p$.s && setAttribute(_el$, "data-focus-visible", _p$.s = _v$7);
|
|
997
|
+
return _p$;
|
|
998
|
+
}, {
|
|
999
|
+
e: void 0,
|
|
1000
|
+
t: void 0,
|
|
1001
|
+
a: void 0,
|
|
1002
|
+
o: void 0,
|
|
1003
|
+
i: void 0,
|
|
1004
|
+
n: void 0,
|
|
1005
|
+
s: void 0
|
|
1006
|
+
});
|
|
1007
|
+
return _el$;
|
|
1008
|
+
})();
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
const variantStyles$2 = {
|
|
1012
|
+
primary: "text-accent hover:text-accent-300",
|
|
1013
|
+
secondary: "text-primary-300 hover:text-primary-200",
|
|
1014
|
+
subtle: "text-primary-400 hover:text-primary-300"
|
|
1015
|
+
};
|
|
1016
|
+
function Link(props) {
|
|
1017
|
+
const [local, headlessProps] = splitProps(props, ["variant", "isStandalone", "isQuiet", "class", "children"]);
|
|
1018
|
+
const variant = local.variant ?? "primary";
|
|
1019
|
+
const customClass = local.class ?? "";
|
|
1020
|
+
const getClassName = (renderProps) => {
|
|
1021
|
+
const base = "transition-colors duration-200 cursor-pointer rounded-sm outline-none";
|
|
1022
|
+
const variantClass = variantStyles$2[variant];
|
|
1023
|
+
let underlineClass;
|
|
1024
|
+
if (local.isStandalone && local.isQuiet) {
|
|
1025
|
+
underlineClass = renderProps.isHovered || renderProps.isFocusVisible ? "underline" : "no-underline";
|
|
1026
|
+
} else {
|
|
1027
|
+
underlineClass = "underline";
|
|
1028
|
+
}
|
|
1029
|
+
const weightClass = local.isStandalone ? "font-medium" : "";
|
|
1030
|
+
const focusClass = renderProps.isFocusVisible ? "ring-2 ring-accent-300 ring-offset-2 ring-offset-bg-400" : "";
|
|
1031
|
+
const disabledClass = renderProps.isDisabled ? "opacity-50 cursor-not-allowed" : "";
|
|
1032
|
+
const pressedClass = renderProps.isPressed ? "opacity-80" : "";
|
|
1033
|
+
return [base, variantClass, underlineClass, weightClass, focusClass, disabledClass, pressedClass, customClass].filter(Boolean).join(" ");
|
|
1034
|
+
};
|
|
1035
|
+
return createComponent(Link$1, mergeProps$1(headlessProps, {
|
|
1036
|
+
"class": getClassName,
|
|
1037
|
+
get children() {
|
|
1038
|
+
return local.children;
|
|
1039
|
+
}
|
|
1040
|
+
}));
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
var _tmpl$$b = /* @__PURE__ */ template(`<span class="text-primary-200 font-medium">`), _tmpl$2$9 = /* @__PURE__ */ template(`<span class=text-primary-300>`), _tmpl$3$7 = /* @__PURE__ */ template(`<div>`), _tmpl$4$7 = /* @__PURE__ */ template(`<div><div><div>`);
|
|
1044
|
+
const sizeStyles = {
|
|
1045
|
+
sm: {
|
|
1046
|
+
track: "h-1",
|
|
1047
|
+
text: "text-xs"
|
|
1048
|
+
},
|
|
1049
|
+
md: {
|
|
1050
|
+
track: "h-2",
|
|
1051
|
+
text: "text-sm"
|
|
1052
|
+
},
|
|
1053
|
+
lg: {
|
|
1054
|
+
track: "h-3",
|
|
1055
|
+
text: "text-base"
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
const variantStyles$1 = {
|
|
1059
|
+
primary: "bg-primary-500",
|
|
1060
|
+
accent: "bg-accent",
|
|
1061
|
+
success: "bg-green-500",
|
|
1062
|
+
warning: "bg-yellow-500",
|
|
1063
|
+
danger: "bg-red-500"
|
|
1064
|
+
};
|
|
1065
|
+
function clamp(value, min, max) {
|
|
1066
|
+
return Math.min(Math.max(value, min), max);
|
|
1067
|
+
}
|
|
1068
|
+
function ProgressBar(props) {
|
|
1069
|
+
const [local, ariaProps] = splitProps(props, ["size", "variant", "label", "showValueLabel", "class"]);
|
|
1070
|
+
const size = () => local.size ?? "md";
|
|
1071
|
+
const variant = () => local.variant ?? "primary";
|
|
1072
|
+
const isIndeterminate = () => ariaProps.isIndeterminate ?? false;
|
|
1073
|
+
const showValueLabel = () => local.showValueLabel ?? !isIndeterminate();
|
|
1074
|
+
const progressAria = createProgressBar({
|
|
1075
|
+
get value() {
|
|
1076
|
+
return ariaProps.value;
|
|
1077
|
+
},
|
|
1078
|
+
get minValue() {
|
|
1079
|
+
return ariaProps.minValue;
|
|
1080
|
+
},
|
|
1081
|
+
get maxValue() {
|
|
1082
|
+
return ariaProps.maxValue;
|
|
1083
|
+
},
|
|
1084
|
+
get valueLabel() {
|
|
1085
|
+
return ariaProps.valueLabel;
|
|
1086
|
+
},
|
|
1087
|
+
get isIndeterminate() {
|
|
1088
|
+
return ariaProps.isIndeterminate;
|
|
1089
|
+
},
|
|
1090
|
+
get label() {
|
|
1091
|
+
return local.label;
|
|
1092
|
+
},
|
|
1093
|
+
get "aria-label"() {
|
|
1094
|
+
return ariaProps["aria-label"];
|
|
1095
|
+
}
|
|
1096
|
+
});
|
|
1097
|
+
const percentage = createMemo(() => {
|
|
1098
|
+
if (isIndeterminate()) {
|
|
1099
|
+
return void 0;
|
|
1100
|
+
}
|
|
1101
|
+
const value = ariaProps.value ?? 0;
|
|
1102
|
+
const minValue = ariaProps.minValue ?? 0;
|
|
1103
|
+
const maxValue = ariaProps.maxValue ?? 100;
|
|
1104
|
+
const clampedValue = clamp(value, minValue, maxValue);
|
|
1105
|
+
return (clampedValue - minValue) / (maxValue - minValue) * 100;
|
|
1106
|
+
});
|
|
1107
|
+
const valueText = () => progressAria.progressBarProps["aria-valuetext"];
|
|
1108
|
+
const sizeConfig = () => sizeStyles[size()];
|
|
1109
|
+
return (() => {
|
|
1110
|
+
var _el$ = _tmpl$4$7(), _el$5 = _el$.firstChild, _el$6 = _el$5.firstChild;
|
|
1111
|
+
spread(_el$, mergeProps$1(() => progressAria.progressBarProps, {
|
|
1112
|
+
get ["class"]() {
|
|
1113
|
+
return `w-full ${local.class ?? ""}`;
|
|
1114
|
+
}
|
|
1115
|
+
}), false, true);
|
|
1116
|
+
insert(_el$, createComponent(Show, {
|
|
1117
|
+
get when() {
|
|
1118
|
+
return local.label || showValueLabel();
|
|
1119
|
+
},
|
|
1120
|
+
get children() {
|
|
1121
|
+
var _el$2 = _tmpl$3$7();
|
|
1122
|
+
insert(_el$2, createComponent(Show, {
|
|
1123
|
+
get when() {
|
|
1124
|
+
return local.label;
|
|
1125
|
+
},
|
|
1126
|
+
get children() {
|
|
1127
|
+
var _el$3 = _tmpl$$b();
|
|
1128
|
+
insert(_el$3, () => local.label);
|
|
1129
|
+
return _el$3;
|
|
1130
|
+
}
|
|
1131
|
+
}), null);
|
|
1132
|
+
insert(_el$2, createComponent(Show, {
|
|
1133
|
+
get when() {
|
|
1134
|
+
return memo(() => !!showValueLabel())() && !isIndeterminate();
|
|
1135
|
+
},
|
|
1136
|
+
get children() {
|
|
1137
|
+
var _el$4 = _tmpl$2$9();
|
|
1138
|
+
insert(_el$4, valueText);
|
|
1139
|
+
return _el$4;
|
|
1140
|
+
}
|
|
1141
|
+
}), null);
|
|
1142
|
+
effect(() => className(_el$2, `flex justify-between items-center mb-1 ${sizeConfig().text}`));
|
|
1143
|
+
return _el$2;
|
|
1144
|
+
}
|
|
1145
|
+
}), _el$5);
|
|
1146
|
+
effect((_p$) => {
|
|
1147
|
+
var _v$ = `w-full ${sizeConfig().track} bg-bg-300 rounded-full overflow-hidden`, _v$2 = `h-full rounded-full transition-all duration-300 ${variantStyles$1[variant()]} ${isIndeterminate() ? "animate-progress-indeterminate" : ""}`, _v$3 = isIndeterminate() ? "30%" : `${percentage()}%`;
|
|
1148
|
+
_v$ !== _p$.e && className(_el$5, _p$.e = _v$);
|
|
1149
|
+
_v$2 !== _p$.t && className(_el$6, _p$.t = _v$2);
|
|
1150
|
+
_v$3 !== _p$.a && setStyleProperty(_el$6, "width", _p$.a = _v$3);
|
|
1151
|
+
return _p$;
|
|
1152
|
+
}, {
|
|
1153
|
+
e: void 0,
|
|
1154
|
+
t: void 0,
|
|
1155
|
+
a: void 0
|
|
1156
|
+
});
|
|
1157
|
+
return _el$;
|
|
1158
|
+
})();
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
var _tmpl$$a = /* @__PURE__ */ template(`<div>`), _tmpl$2$8 = /* @__PURE__ */ template(`<hr>`);
|
|
1162
|
+
const variantStyles = {
|
|
1163
|
+
default: "bg-bg-100",
|
|
1164
|
+
subtle: "bg-bg-200",
|
|
1165
|
+
strong: "bg-primary-600"
|
|
1166
|
+
};
|
|
1167
|
+
const horizontalSizeStyles = {
|
|
1168
|
+
sm: "h-px",
|
|
1169
|
+
md: "h-0.5",
|
|
1170
|
+
lg: "h-1"
|
|
1171
|
+
};
|
|
1172
|
+
const verticalSizeStyles = {
|
|
1173
|
+
sm: "w-px",
|
|
1174
|
+
md: "w-0.5",
|
|
1175
|
+
lg: "w-1"
|
|
1176
|
+
};
|
|
1177
|
+
function Separator(props) {
|
|
1178
|
+
const [local, ariaProps] = splitProps(props, ["orientation", "variant", "size", "class"]);
|
|
1179
|
+
const orientation = () => local.orientation ?? "horizontal";
|
|
1180
|
+
const variant = () => local.variant ?? "default";
|
|
1181
|
+
const size = () => local.size ?? "md";
|
|
1182
|
+
const elementType = createMemo(() => {
|
|
1183
|
+
if (orientation() === "vertical") {
|
|
1184
|
+
return "div";
|
|
1185
|
+
}
|
|
1186
|
+
return "hr";
|
|
1187
|
+
});
|
|
1188
|
+
const separatorAria = createSeparator({
|
|
1189
|
+
get orientation() {
|
|
1190
|
+
return orientation();
|
|
1191
|
+
},
|
|
1192
|
+
get elementType() {
|
|
1193
|
+
return elementType();
|
|
1194
|
+
},
|
|
1195
|
+
get "aria-label"() {
|
|
1196
|
+
return ariaProps["aria-label"];
|
|
1197
|
+
}
|
|
1198
|
+
});
|
|
1199
|
+
const className = createMemo(() => {
|
|
1200
|
+
const isVertical = orientation() === "vertical";
|
|
1201
|
+
const sizeStyles = isVertical ? verticalSizeStyles : horizontalSizeStyles;
|
|
1202
|
+
const base = [
|
|
1203
|
+
variantStyles[variant()],
|
|
1204
|
+
sizeStyles[size()],
|
|
1205
|
+
isVertical ? "h-full self-stretch" : "w-full",
|
|
1206
|
+
"border-0",
|
|
1207
|
+
// Reset hr default border
|
|
1208
|
+
local.class ?? ""
|
|
1209
|
+
];
|
|
1210
|
+
return base.filter(Boolean).join(" ");
|
|
1211
|
+
});
|
|
1212
|
+
const getAriaProps = () => {
|
|
1213
|
+
const {
|
|
1214
|
+
ref: _,
|
|
1215
|
+
...props2
|
|
1216
|
+
} = separatorAria.separatorProps;
|
|
1217
|
+
return props2;
|
|
1218
|
+
};
|
|
1219
|
+
return createComponent(Show, {
|
|
1220
|
+
get when() {
|
|
1221
|
+
return orientation() === "vertical";
|
|
1222
|
+
},
|
|
1223
|
+
get fallback() {
|
|
1224
|
+
return (() => {
|
|
1225
|
+
var _el$2 = _tmpl$2$8();
|
|
1226
|
+
spread(_el$2, mergeProps$1(getAriaProps, {
|
|
1227
|
+
get ["class"]() {
|
|
1228
|
+
return className();
|
|
1229
|
+
}
|
|
1230
|
+
}), false, false);
|
|
1231
|
+
return _el$2;
|
|
1232
|
+
})();
|
|
1233
|
+
},
|
|
1234
|
+
get children() {
|
|
1235
|
+
var _el$ = _tmpl$$a();
|
|
1236
|
+
spread(_el$, mergeProps$1(getAriaProps, {
|
|
1237
|
+
get ["class"]() {
|
|
1238
|
+
return className();
|
|
1239
|
+
}
|
|
1240
|
+
}), false, false);
|
|
1241
|
+
return _el$;
|
|
1242
|
+
}
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
var _tmpl$$9 = /* @__PURE__ */ template(`<img class="h-[42px] w-auto">`), _tmpl$2$7 = /* @__PURE__ */ template(`<button class="md:hidden flex items-center justify-center">`), _tmpl$3$6 = /* @__PURE__ */ template(`<nav><div class="pl-1 md:pl-8 flex items-center"></div><div class="flex-1 flex justify-end items-center pr-1 md:pr-8">`), _tmpl$4$6 = /* @__PURE__ */ template(`<span class="text-[34px] font-light text-primary-700 flex items-center">`);
|
|
1247
|
+
function NavHeader(props) {
|
|
1248
|
+
return (() => {
|
|
1249
|
+
var _el$ = _tmpl$3$6(), _el$2 = _el$.firstChild, _el$4 = _el$2.nextSibling;
|
|
1250
|
+
insert(_el$2, createComponent(Show, {
|
|
1251
|
+
get when() {
|
|
1252
|
+
return props.logo;
|
|
1253
|
+
},
|
|
1254
|
+
get fallback() {
|
|
1255
|
+
return createComponent(Show, {
|
|
1256
|
+
get when() {
|
|
1257
|
+
return props.logoText;
|
|
1258
|
+
},
|
|
1259
|
+
get children() {
|
|
1260
|
+
var _el$6 = _tmpl$4$6();
|
|
1261
|
+
insert(_el$6, () => props.logoText);
|
|
1262
|
+
return _el$6;
|
|
1263
|
+
}
|
|
1264
|
+
});
|
|
1265
|
+
},
|
|
1266
|
+
get children() {
|
|
1267
|
+
var _el$3 = _tmpl$$9();
|
|
1268
|
+
effect((_p$) => {
|
|
1269
|
+
var _v$ = props.logo, _v$2 = props.logoAlt ?? "Logo";
|
|
1270
|
+
_v$ !== _p$.e && setAttribute(_el$3, "src", _p$.e = _v$);
|
|
1271
|
+
_v$2 !== _p$.t && setAttribute(_el$3, "alt", _p$.t = _v$2);
|
|
1272
|
+
return _p$;
|
|
1273
|
+
}, {
|
|
1274
|
+
e: void 0,
|
|
1275
|
+
t: void 0
|
|
1276
|
+
});
|
|
1277
|
+
return _el$3;
|
|
1278
|
+
}
|
|
1279
|
+
}));
|
|
1280
|
+
insert(_el$4, () => props.children, null);
|
|
1281
|
+
insert(_el$4, createComponent(Show, {
|
|
1282
|
+
get when() {
|
|
1283
|
+
return props.menuIcon;
|
|
1284
|
+
},
|
|
1285
|
+
get children() {
|
|
1286
|
+
var _el$5 = _tmpl$2$7();
|
|
1287
|
+
addEventListener(_el$5, "click", props.onMenuClick, true);
|
|
1288
|
+
insert(_el$5, () => props.menuIcon);
|
|
1289
|
+
return _el$5;
|
|
1290
|
+
}
|
|
1291
|
+
}), null);
|
|
1292
|
+
effect(() => className(_el$, `flex items-center bg-bg-400 h-[70px] border-b-4 border-accent-500 ${props.class ?? ""}`));
|
|
1293
|
+
return _el$;
|
|
1294
|
+
})();
|
|
1295
|
+
}
|
|
1296
|
+
delegateEvents(["click"]);
|
|
1297
|
+
|
|
1298
|
+
var _tmpl$$8 = /* @__PURE__ */ template(`<li><span class="text-lg font-bold text-primary-200">`), _tmpl$2$6 = /* @__PURE__ */ template(`<a>`), _tmpl$3$5 = /* @__PURE__ */ template(`<div><div class="flex h-full"><div class="h-5 w-1 bg-accent-300"></div><ul class="flex h-full flex-1 flex-col gap-1 pl-4">`), _tmpl$4$5 = /* @__PURE__ */ template(`<li>`), _tmpl$5$4 = /* @__PURE__ */ template(`<div>`);
|
|
1299
|
+
function NavItem(props) {
|
|
1300
|
+
return (() => {
|
|
1301
|
+
var _el$ = _tmpl$$8(), _el$2 = _el$.firstChild;
|
|
1302
|
+
insert(_el$2, () => props.title);
|
|
1303
|
+
insert(_el$, () => props.children, null);
|
|
1304
|
+
effect(() => className(_el$, `flex items-center ${props.class ?? ""}`));
|
|
1305
|
+
return _el$;
|
|
1306
|
+
})();
|
|
1307
|
+
}
|
|
1308
|
+
function NavLink(props) {
|
|
1309
|
+
const activeStyles = "font-medium text-primary-300 underline underline-offset-4";
|
|
1310
|
+
const inactiveStyles = "font-normal text-gray-200 underline-offset-4 hover:text-gray-100 hover:underline";
|
|
1311
|
+
return (() => {
|
|
1312
|
+
var _el$3 = _tmpl$2$6();
|
|
1313
|
+
insert(_el$3, () => props.children);
|
|
1314
|
+
effect((_p$) => {
|
|
1315
|
+
var _v$ = props.href, _v$2 = `${props.active ? activeStyles : inactiveStyles} ${props.class ?? ""}`;
|
|
1316
|
+
_v$ !== _p$.e && setAttribute(_el$3, "href", _p$.e = _v$);
|
|
1317
|
+
_v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
|
|
1318
|
+
return _p$;
|
|
1319
|
+
}, {
|
|
1320
|
+
e: void 0,
|
|
1321
|
+
t: void 0
|
|
1322
|
+
});
|
|
1323
|
+
return _el$3;
|
|
1324
|
+
})();
|
|
1325
|
+
}
|
|
1326
|
+
function NavSection(props) {
|
|
1327
|
+
return (() => {
|
|
1328
|
+
var _el$4 = _tmpl$3$5(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
|
|
1329
|
+
insert(_el$4, createComponent(NavItem, {
|
|
1330
|
+
get title() {
|
|
1331
|
+
return props.title;
|
|
1332
|
+
}
|
|
1333
|
+
}), _el$5);
|
|
1334
|
+
insert(_el$7, createComponent(Show, {
|
|
1335
|
+
get when() {
|
|
1336
|
+
return props.links;
|
|
1337
|
+
},
|
|
1338
|
+
get children() {
|
|
1339
|
+
return createComponent(For, {
|
|
1340
|
+
get each() {
|
|
1341
|
+
return props.links;
|
|
1342
|
+
},
|
|
1343
|
+
children: (link) => (() => {
|
|
1344
|
+
var _el$8 = _tmpl$4$5();
|
|
1345
|
+
insert(_el$8, createComponent(NavLink, {
|
|
1346
|
+
get href() {
|
|
1347
|
+
return link.href;
|
|
1348
|
+
},
|
|
1349
|
+
get active() {
|
|
1350
|
+
return link.active;
|
|
1351
|
+
},
|
|
1352
|
+
get children() {
|
|
1353
|
+
return link.label;
|
|
1354
|
+
}
|
|
1355
|
+
}));
|
|
1356
|
+
return _el$8;
|
|
1357
|
+
})()
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
}), null);
|
|
1361
|
+
insert(_el$7, () => props.children, null);
|
|
1362
|
+
effect(() => className(_el$4, props.class ?? ""));
|
|
1363
|
+
return _el$4;
|
|
1364
|
+
})();
|
|
1365
|
+
}
|
|
1366
|
+
function LateralNav(props) {
|
|
1367
|
+
const bgColor = () => props.transparent ? "" : "bg-bg-200";
|
|
1368
|
+
return (() => {
|
|
1369
|
+
var _el$9 = _tmpl$5$4();
|
|
1370
|
+
insert(_el$9, () => props.children);
|
|
1371
|
+
effect(() => className(_el$9, `hidden w-[300px] md:block ${bgColor()} m-0 border-r border-primary-600 p-3 ${props.class ?? ""}`));
|
|
1372
|
+
return _el$9;
|
|
1373
|
+
})();
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
var _tmpl$$7 = /* @__PURE__ */ template(`<span class="font-semibold text-accent-200">`), _tmpl$2$5 = /* @__PURE__ */ template(`<div><div class="flex items-center justify-around gap-3"></div><div class="flex items-center justify-center gap-3 text-center"><span class="font-light text-primary-300">`);
|
|
1377
|
+
const eventMessages = {
|
|
1378
|
+
follow: (left, right) => [(() => {
|
|
1379
|
+
var _el$ = _tmpl$$7();
|
|
1380
|
+
insert(_el$, left);
|
|
1381
|
+
return _el$;
|
|
1382
|
+
})(), " ha empezado a seguir a ", (() => {
|
|
1383
|
+
var _el$2 = _tmpl$$7();
|
|
1384
|
+
insert(_el$2, right);
|
|
1385
|
+
return _el$2;
|
|
1386
|
+
})()],
|
|
1387
|
+
like: (left, right) => [(() => {
|
|
1388
|
+
var _el$3 = _tmpl$$7();
|
|
1389
|
+
insert(_el$3, left);
|
|
1390
|
+
return _el$3;
|
|
1391
|
+
})(), " le ha dado like a ", (() => {
|
|
1392
|
+
var _el$4 = _tmpl$$7();
|
|
1393
|
+
insert(_el$4, right);
|
|
1394
|
+
return _el$4;
|
|
1395
|
+
})()],
|
|
1396
|
+
comment: (left, right) => [(() => {
|
|
1397
|
+
var _el$5 = _tmpl$$7();
|
|
1398
|
+
insert(_el$5, left);
|
|
1399
|
+
return _el$5;
|
|
1400
|
+
})(), " ha comentado en ", (() => {
|
|
1401
|
+
var _el$6 = _tmpl$$7();
|
|
1402
|
+
insert(_el$6, right);
|
|
1403
|
+
return _el$6;
|
|
1404
|
+
})()],
|
|
1405
|
+
event: (left, right) => [(() => {
|
|
1406
|
+
var _el$7 = _tmpl$$7();
|
|
1407
|
+
insert(_el$7, left);
|
|
1408
|
+
return _el$7;
|
|
1409
|
+
})(), " asistirá al evento de ", (() => {
|
|
1410
|
+
var _el$8 = _tmpl$$7();
|
|
1411
|
+
insert(_el$8, right);
|
|
1412
|
+
return _el$8;
|
|
1413
|
+
})()],
|
|
1414
|
+
custom: () => null
|
|
1415
|
+
};
|
|
1416
|
+
function TimelineItem(props) {
|
|
1417
|
+
const type = () => props.type ?? "follow";
|
|
1418
|
+
const leftName = () => props.leftUser?.name ?? "";
|
|
1419
|
+
const rightName = () => props.rightUser?.name ?? "";
|
|
1420
|
+
return (() => {
|
|
1421
|
+
var _el$9 = _tmpl$2$5(), _el$0 = _el$9.firstChild, _el$1 = _el$0.nextSibling, _el$10 = _el$1.firstChild;
|
|
1422
|
+
insert(_el$0, createComponent(Show, {
|
|
1423
|
+
get when() {
|
|
1424
|
+
return props.leftUser;
|
|
1425
|
+
},
|
|
1426
|
+
get children() {
|
|
1427
|
+
return createComponent(Avatar, {
|
|
1428
|
+
get src() {
|
|
1429
|
+
return props.leftUser.avatar;
|
|
1430
|
+
},
|
|
1431
|
+
get alt() {
|
|
1432
|
+
return props.leftUser.name;
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
}), null);
|
|
1437
|
+
insert(_el$0, createComponent(Show, {
|
|
1438
|
+
get when() {
|
|
1439
|
+
return props.icon;
|
|
1440
|
+
},
|
|
1441
|
+
get children() {
|
|
1442
|
+
return props.icon;
|
|
1443
|
+
}
|
|
1444
|
+
}), null);
|
|
1445
|
+
insert(_el$0, createComponent(Show, {
|
|
1446
|
+
get when() {
|
|
1447
|
+
return props.rightUser;
|
|
1448
|
+
},
|
|
1449
|
+
get children() {
|
|
1450
|
+
return createComponent(Avatar, {
|
|
1451
|
+
get src() {
|
|
1452
|
+
return props.rightUser.avatar;
|
|
1453
|
+
},
|
|
1454
|
+
get alt() {
|
|
1455
|
+
return props.rightUser.name;
|
|
1456
|
+
}
|
|
1457
|
+
});
|
|
1458
|
+
}
|
|
1459
|
+
}), null);
|
|
1460
|
+
insert(_el$10, createComponent(Show, {
|
|
1461
|
+
get when() {
|
|
1462
|
+
return props.message;
|
|
1463
|
+
},
|
|
1464
|
+
get fallback() {
|
|
1465
|
+
return eventMessages[type()](leftName(), rightName());
|
|
1466
|
+
},
|
|
1467
|
+
get children() {
|
|
1468
|
+
return props.message;
|
|
1469
|
+
}
|
|
1470
|
+
}));
|
|
1471
|
+
effect(() => className(_el$9, `inline-flex w-auto flex-col gap-5 rounded-2xl border border-primary-700 bg-bg-200 p-5 hover:bg-bg-300 transition-colors ${props.class ?? ""}`));
|
|
1472
|
+
return _el$9;
|
|
1473
|
+
})();
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
var _tmpl$$6 = /* @__PURE__ */ template(`<span class="text-xs text-primary-500">`), _tmpl$2$4 = /* @__PURE__ */ template(`<p class="text-sm text-primary-400 truncate">`), _tmpl$3$4 = /* @__PURE__ */ template(`<span class="flex h-5 w-5 items-center justify-center rounded-full bg-accent text-xs font-bold text-white">`), _tmpl$4$4 = /* @__PURE__ */ template(`<button><div class="flex-1 min-w-0"><div class="flex items-center justify-between"><span class="font-semibold text-primary-100 truncate">`), _tmpl$5$3 = /* @__PURE__ */ template(`<span>`), _tmpl$6$2 = /* @__PURE__ */ template(`<div><div><p>`), _tmpl$7$1 = /* @__PURE__ */ template(`<div>`);
|
|
1477
|
+
function ConversationPreview(props) {
|
|
1478
|
+
return (() => {
|
|
1479
|
+
var _el$ = _tmpl$4$4(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild;
|
|
1480
|
+
addEventListener(_el$, "click", props.onClick, true);
|
|
1481
|
+
insert(_el$, createComponent(Avatar, {
|
|
1482
|
+
get src() {
|
|
1483
|
+
return props.user.avatar;
|
|
1484
|
+
},
|
|
1485
|
+
get alt() {
|
|
1486
|
+
return props.user.name;
|
|
1487
|
+
},
|
|
1488
|
+
get online() {
|
|
1489
|
+
return props.user.online;
|
|
1490
|
+
},
|
|
1491
|
+
size: "md"
|
|
1492
|
+
}), _el$2);
|
|
1493
|
+
insert(_el$4, () => props.user.name);
|
|
1494
|
+
insert(_el$3, createComponent(Show, {
|
|
1495
|
+
get when() {
|
|
1496
|
+
return props.timestamp;
|
|
1497
|
+
},
|
|
1498
|
+
get children() {
|
|
1499
|
+
var _el$5 = _tmpl$$6();
|
|
1500
|
+
insert(_el$5, () => props.timestamp);
|
|
1501
|
+
return _el$5;
|
|
1502
|
+
}
|
|
1503
|
+
}), null);
|
|
1504
|
+
insert(_el$2, createComponent(Show, {
|
|
1505
|
+
get when() {
|
|
1506
|
+
return props.lastMessage;
|
|
1507
|
+
},
|
|
1508
|
+
get children() {
|
|
1509
|
+
var _el$6 = _tmpl$2$4();
|
|
1510
|
+
insert(_el$6, () => props.lastMessage);
|
|
1511
|
+
return _el$6;
|
|
1512
|
+
}
|
|
1513
|
+
}), null);
|
|
1514
|
+
insert(_el$, createComponent(Show, {
|
|
1515
|
+
get when() {
|
|
1516
|
+
return memo(() => !!props.unreadCount)() && props.unreadCount > 0;
|
|
1517
|
+
},
|
|
1518
|
+
get children() {
|
|
1519
|
+
var _el$7 = _tmpl$3$4();
|
|
1520
|
+
insert(_el$7, () => props.unreadCount);
|
|
1521
|
+
return _el$7;
|
|
1522
|
+
}
|
|
1523
|
+
}), null);
|
|
1524
|
+
effect(() => className(_el$, `flex w-full items-center gap-3 rounded-xl p-3 hover:bg-bg-300 transition-colors text-left ${props.class ?? ""}`));
|
|
1525
|
+
return _el$;
|
|
1526
|
+
})();
|
|
1527
|
+
}
|
|
1528
|
+
function ConversationBubble(props) {
|
|
1529
|
+
const isUser = () => props.sender === "user";
|
|
1530
|
+
return (() => {
|
|
1531
|
+
var _el$8 = _tmpl$6$2(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild;
|
|
1532
|
+
insert(_el$0, () => props.content);
|
|
1533
|
+
insert(_el$9, createComponent(Show, {
|
|
1534
|
+
get when() {
|
|
1535
|
+
return props.timestamp;
|
|
1536
|
+
},
|
|
1537
|
+
get children() {
|
|
1538
|
+
var _el$1 = _tmpl$5$3();
|
|
1539
|
+
insert(_el$1, () => props.timestamp);
|
|
1540
|
+
effect(() => className(_el$1, `text-xs ${isUser() ? "text-white/70" : "text-primary-500"}`));
|
|
1541
|
+
return _el$1;
|
|
1542
|
+
}
|
|
1543
|
+
}), null);
|
|
1544
|
+
effect((_p$) => {
|
|
1545
|
+
var _v$ = `flex ${isUser() ? "justify-end" : "justify-start"} ${props.class ?? ""}`, _v$2 = `max-w-[70%] rounded-2xl px-4 py-2 ${isUser() ? "bg-accent text-white rounded-br-sm" : "bg-bg-300 text-primary-100 rounded-bl-sm"}`;
|
|
1546
|
+
_v$ !== _p$.e && className(_el$8, _p$.e = _v$);
|
|
1547
|
+
_v$2 !== _p$.t && className(_el$9, _p$.t = _v$2);
|
|
1548
|
+
return _p$;
|
|
1549
|
+
}, {
|
|
1550
|
+
e: void 0,
|
|
1551
|
+
t: void 0
|
|
1552
|
+
});
|
|
1553
|
+
return _el$8;
|
|
1554
|
+
})();
|
|
1555
|
+
}
|
|
1556
|
+
function Conversation(props) {
|
|
1557
|
+
return (() => {
|
|
1558
|
+
var _el$10 = _tmpl$7$1();
|
|
1559
|
+
insert(_el$10, createComponent(For, {
|
|
1560
|
+
get each() {
|
|
1561
|
+
return props.messages;
|
|
1562
|
+
},
|
|
1563
|
+
children: (message) => createComponent(ConversationBubble, {
|
|
1564
|
+
get content() {
|
|
1565
|
+
return message.content;
|
|
1566
|
+
},
|
|
1567
|
+
get sender() {
|
|
1568
|
+
return message.sender;
|
|
1569
|
+
},
|
|
1570
|
+
get timestamp() {
|
|
1571
|
+
return message.timestamp;
|
|
1572
|
+
}
|
|
1573
|
+
})
|
|
1574
|
+
}));
|
|
1575
|
+
effect(() => className(_el$10, `flex flex-col gap-2 p-4 ${props.class ?? ""}`));
|
|
1576
|
+
return _el$10;
|
|
1577
|
+
})();
|
|
1578
|
+
}
|
|
1579
|
+
delegateEvents(["click"]);
|
|
1580
|
+
|
|
1581
|
+
var _tmpl$$5 = /* @__PURE__ */ template(`<p class="text-primary-300 text-sm mt-1 line-clamp-2">`), _tmpl$2$3 = /* @__PURE__ */ template(`<span class=text-primary-300><span class="font-semibold text-primary-100"></span> seguidores`), _tmpl$3$3 = /* @__PURE__ */ template(`<span class=text-primary-300><span class="font-semibold text-primary-100"></span> siguiendo`), _tmpl$4$3 = /* @__PURE__ */ template(`<div class="mt-4 flex gap-2">`), _tmpl$5$2 = /* @__PURE__ */ template(`<div><div class="flex items-start gap-4"><div class="flex-1 min-w-0"><h3 class="font-semibold text-primary-100 text-lg truncate"></h3><div class="flex gap-4 mt-2 text-sm">`);
|
|
1582
|
+
function ProfileCard(props) {
|
|
1583
|
+
const formatNumber = (num) => {
|
|
1584
|
+
if (num >= 1e6) return `${(num / 1e6).toFixed(1)}M`;
|
|
1585
|
+
if (num >= 1e3) return `${(num / 1e3).toFixed(1)}K`;
|
|
1586
|
+
return num.toString();
|
|
1587
|
+
};
|
|
1588
|
+
return (() => {
|
|
1589
|
+
var _el$ = _tmpl$5$2(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$6 = _el$4.nextSibling;
|
|
1590
|
+
insert(_el$2, createComponent(Avatar, {
|
|
1591
|
+
get src() {
|
|
1592
|
+
return props.avatar;
|
|
1593
|
+
},
|
|
1594
|
+
get alt() {
|
|
1595
|
+
return props.username;
|
|
1596
|
+
},
|
|
1597
|
+
size: "lg"
|
|
1598
|
+
}), _el$3);
|
|
1599
|
+
insert(_el$4, () => props.username);
|
|
1600
|
+
insert(_el$3, createComponent(Show, {
|
|
1601
|
+
get when() {
|
|
1602
|
+
return props.bio;
|
|
1603
|
+
},
|
|
1604
|
+
get children() {
|
|
1605
|
+
var _el$5 = _tmpl$$5();
|
|
1606
|
+
insert(_el$5, () => props.bio);
|
|
1607
|
+
return _el$5;
|
|
1608
|
+
}
|
|
1609
|
+
}), _el$6);
|
|
1610
|
+
insert(_el$6, createComponent(Show, {
|
|
1611
|
+
get when() {
|
|
1612
|
+
return props.followers !== void 0;
|
|
1613
|
+
},
|
|
1614
|
+
get children() {
|
|
1615
|
+
var _el$7 = _tmpl$2$3(), _el$8 = _el$7.firstChild;
|
|
1616
|
+
insert(_el$8, () => formatNumber(props.followers));
|
|
1617
|
+
return _el$7;
|
|
1618
|
+
}
|
|
1619
|
+
}), null);
|
|
1620
|
+
insert(_el$6, createComponent(Show, {
|
|
1621
|
+
get when() {
|
|
1622
|
+
return props.following !== void 0;
|
|
1623
|
+
},
|
|
1624
|
+
get children() {
|
|
1625
|
+
var _el$9 = _tmpl$3$3(), _el$0 = _el$9.firstChild;
|
|
1626
|
+
insert(_el$0, () => formatNumber(props.following));
|
|
1627
|
+
return _el$9;
|
|
1628
|
+
}
|
|
1629
|
+
}), null);
|
|
1630
|
+
insert(_el$, createComponent(Show, {
|
|
1631
|
+
get when() {
|
|
1632
|
+
return props.actions;
|
|
1633
|
+
},
|
|
1634
|
+
get children() {
|
|
1635
|
+
var _el$1 = _tmpl$4$3();
|
|
1636
|
+
insert(_el$1, () => props.actions);
|
|
1637
|
+
return _el$1;
|
|
1638
|
+
}
|
|
1639
|
+
}), null);
|
|
1640
|
+
effect(() => className(_el$, `bg-bg-200 rounded-xl p-4 ${props.class ?? ""}`));
|
|
1641
|
+
return _el$;
|
|
1642
|
+
})();
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
var _tmpl$$4 = /* @__PURE__ */ template(`<div class="absolute -top-2 -right-2 z-10 flex flex-col gap-1"><img alt class="w-8 h-8 object-contain"><img alt class="w-6 h-6 object-contain ml-2"><img alt class="w-5 h-5 object-contain">`), _tmpl$2$2 = /* @__PURE__ */ template(`<div class="relative h-32 w-full"><img class="w-full h-full object-cover"><div class="absolute inset-0 bg-gradient-to-t from-bg-200 via-transparent to-transparent">`), _tmpl$3$2 = /* @__PURE__ */ template(`<div class="flex items-center gap-1.5"><span class=text-accent>@</span><span>`), _tmpl$4$2 = /* @__PURE__ */ template(`<div class="flex items-center gap-1.5"><span class=text-accent>⏱</span><span>`), _tmpl$5$1 = /* @__PURE__ */ template(`<div class="flex items-center gap-4 mt-3 text-sm text-primary-300">`), _tmpl$6$1 = /* @__PURE__ */ template(`<span class="ml-2 text-sm text-primary-300">+<!> más`), _tmpl$7 = /* @__PURE__ */ template(`<div class="flex items-center mt-3"><div class="flex -space-x-2">`), _tmpl$8 = /* @__PURE__ */ template(`<div class="mt-4 flex gap-2">`), _tmpl$9 = /* @__PURE__ */ template(`<div><div class="p-4 pt-2"><h3 class="font-bold text-xl leading-tight bg-gradient-to-r from-accent to-accent-300 bg-clip-text text-transparent">`), _tmpl$0 = /* @__PURE__ */ template(`<div class="w-12 h-12 rounded-lg overflow-hidden flex-shrink-0"><img class="w-full h-full object-cover">`), _tmpl$1 = /* @__PURE__ */ template(`<p class="text-sm text-primary-300 truncate">`), _tmpl$10 = /* @__PURE__ */ template(`<button><div class="flex-1 min-w-0"><h4 class="font-medium text-primary-100 truncate">`);
|
|
1646
|
+
function EventCard(props) {
|
|
1647
|
+
const displayedAttendees = () => props.attendees?.slice(0, 3) ?? [];
|
|
1648
|
+
const remainingCount = () => {
|
|
1649
|
+
const total = props.attendeeCount ?? props.attendees?.length ?? 0;
|
|
1650
|
+
const displayed = displayedAttendees().length;
|
|
1651
|
+
return total - displayed;
|
|
1652
|
+
};
|
|
1653
|
+
return (() => {
|
|
1654
|
+
var _el$ = _tmpl$9(), _el$8 = _el$.firstChild, _el$9 = _el$8.firstChild;
|
|
1655
|
+
insert(_el$, createComponent(Show, {
|
|
1656
|
+
get when() {
|
|
1657
|
+
return props.decorationImage;
|
|
1658
|
+
},
|
|
1659
|
+
get children() {
|
|
1660
|
+
var _el$2 = _tmpl$$4(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.nextSibling;
|
|
1661
|
+
effect((_p$) => {
|
|
1662
|
+
var _v$ = props.decorationImage, _v$2 = props.decorationImage, _v$3 = props.decorationImage;
|
|
1663
|
+
_v$ !== _p$.e && setAttribute(_el$3, "src", _p$.e = _v$);
|
|
1664
|
+
_v$2 !== _p$.t && setAttribute(_el$4, "src", _p$.t = _v$2);
|
|
1665
|
+
_v$3 !== _p$.a && setAttribute(_el$5, "src", _p$.a = _v$3);
|
|
1666
|
+
return _p$;
|
|
1667
|
+
}, {
|
|
1668
|
+
e: void 0,
|
|
1669
|
+
t: void 0,
|
|
1670
|
+
a: void 0
|
|
1671
|
+
});
|
|
1672
|
+
return _el$2;
|
|
1673
|
+
}
|
|
1674
|
+
}), _el$8);
|
|
1675
|
+
insert(_el$, createComponent(Show, {
|
|
1676
|
+
get when() {
|
|
1677
|
+
return props.image;
|
|
1678
|
+
},
|
|
1679
|
+
get children() {
|
|
1680
|
+
var _el$6 = _tmpl$2$2(), _el$7 = _el$6.firstChild;
|
|
1681
|
+
effect((_p$) => {
|
|
1682
|
+
var _v$4 = props.image, _v$5 = props.title;
|
|
1683
|
+
_v$4 !== _p$.e && setAttribute(_el$7, "src", _p$.e = _v$4);
|
|
1684
|
+
_v$5 !== _p$.t && setAttribute(_el$7, "alt", _p$.t = _v$5);
|
|
1685
|
+
return _p$;
|
|
1686
|
+
}, {
|
|
1687
|
+
e: void 0,
|
|
1688
|
+
t: void 0
|
|
1689
|
+
});
|
|
1690
|
+
return _el$6;
|
|
1691
|
+
}
|
|
1692
|
+
}), _el$8);
|
|
1693
|
+
insert(_el$9, () => props.title);
|
|
1694
|
+
insert(_el$8, createComponent(Show, {
|
|
1695
|
+
get when() {
|
|
1696
|
+
return props.date || props.author;
|
|
1697
|
+
},
|
|
1698
|
+
get children() {
|
|
1699
|
+
var _el$0 = _tmpl$5$1();
|
|
1700
|
+
insert(_el$0, createComponent(Show, {
|
|
1701
|
+
get when() {
|
|
1702
|
+
return props.author;
|
|
1703
|
+
},
|
|
1704
|
+
get children() {
|
|
1705
|
+
var _el$1 = _tmpl$3$2(), _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
|
|
1706
|
+
insert(_el$11, () => props.author);
|
|
1707
|
+
return _el$1;
|
|
1708
|
+
}
|
|
1709
|
+
}), null);
|
|
1710
|
+
insert(_el$0, createComponent(Show, {
|
|
1711
|
+
get when() {
|
|
1712
|
+
return props.date;
|
|
1713
|
+
},
|
|
1714
|
+
get children() {
|
|
1715
|
+
var _el$12 = _tmpl$4$2(), _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling;
|
|
1716
|
+
insert(_el$14, () => props.date);
|
|
1717
|
+
return _el$12;
|
|
1718
|
+
}
|
|
1719
|
+
}), null);
|
|
1720
|
+
return _el$0;
|
|
1721
|
+
}
|
|
1722
|
+
}), null);
|
|
1723
|
+
insert(_el$8, createComponent(Show, {
|
|
1724
|
+
get when() {
|
|
1725
|
+
return displayedAttendees().length > 0;
|
|
1726
|
+
},
|
|
1727
|
+
get children() {
|
|
1728
|
+
var _el$15 = _tmpl$7(), _el$16 = _el$15.firstChild;
|
|
1729
|
+
insert(_el$16, createComponent(For, {
|
|
1730
|
+
get each() {
|
|
1731
|
+
return displayedAttendees();
|
|
1732
|
+
},
|
|
1733
|
+
children: (attendee) => createComponent(Avatar, {
|
|
1734
|
+
get src() {
|
|
1735
|
+
return attendee.avatar;
|
|
1736
|
+
},
|
|
1737
|
+
get alt() {
|
|
1738
|
+
return attendee.name;
|
|
1739
|
+
},
|
|
1740
|
+
size: "sm"
|
|
1741
|
+
})
|
|
1742
|
+
}));
|
|
1743
|
+
insert(_el$15, createComponent(Show, {
|
|
1744
|
+
get when() {
|
|
1745
|
+
return remainingCount() > 0;
|
|
1746
|
+
},
|
|
1747
|
+
get children() {
|
|
1748
|
+
var _el$17 = _tmpl$6$1(), _el$18 = _el$17.firstChild, _el$20 = _el$18.nextSibling; _el$20.nextSibling;
|
|
1749
|
+
insert(_el$17, remainingCount, _el$20);
|
|
1750
|
+
return _el$17;
|
|
1751
|
+
}
|
|
1752
|
+
}), null);
|
|
1753
|
+
return _el$15;
|
|
1754
|
+
}
|
|
1755
|
+
}), null);
|
|
1756
|
+
insert(_el$8, createComponent(Show, {
|
|
1757
|
+
get when() {
|
|
1758
|
+
return props.actions;
|
|
1759
|
+
},
|
|
1760
|
+
get children() {
|
|
1761
|
+
var _el$21 = _tmpl$8();
|
|
1762
|
+
insert(_el$21, () => props.actions);
|
|
1763
|
+
return _el$21;
|
|
1764
|
+
}
|
|
1765
|
+
}), null);
|
|
1766
|
+
effect(() => className(_el$, `relative bg-bg-200 rounded-3xl overflow-hidden ${props.class ?? ""}`));
|
|
1767
|
+
return _el$;
|
|
1768
|
+
})();
|
|
1769
|
+
}
|
|
1770
|
+
function EventListItem(props) {
|
|
1771
|
+
return (() => {
|
|
1772
|
+
var _el$22 = _tmpl$10(), _el$25 = _el$22.firstChild, _el$26 = _el$25.firstChild;
|
|
1773
|
+
addEventListener(_el$22, "click", props.onClick, true);
|
|
1774
|
+
insert(_el$22, createComponent(Show, {
|
|
1775
|
+
get when() {
|
|
1776
|
+
return props.image;
|
|
1777
|
+
},
|
|
1778
|
+
get children() {
|
|
1779
|
+
var _el$23 = _tmpl$0(), _el$24 = _el$23.firstChild;
|
|
1780
|
+
effect((_p$) => {
|
|
1781
|
+
var _v$6 = props.image, _v$7 = props.title;
|
|
1782
|
+
_v$6 !== _p$.e && setAttribute(_el$24, "src", _p$.e = _v$6);
|
|
1783
|
+
_v$7 !== _p$.t && setAttribute(_el$24, "alt", _p$.t = _v$7);
|
|
1784
|
+
return _p$;
|
|
1785
|
+
}, {
|
|
1786
|
+
e: void 0,
|
|
1787
|
+
t: void 0
|
|
1788
|
+
});
|
|
1789
|
+
return _el$23;
|
|
1790
|
+
}
|
|
1791
|
+
}), _el$25);
|
|
1792
|
+
insert(_el$26, () => props.title);
|
|
1793
|
+
insert(_el$25, createComponent(Show, {
|
|
1794
|
+
get when() {
|
|
1795
|
+
return props.subtitle;
|
|
1796
|
+
},
|
|
1797
|
+
get children() {
|
|
1798
|
+
var _el$27 = _tmpl$1();
|
|
1799
|
+
insert(_el$27, () => props.subtitle);
|
|
1800
|
+
return _el$27;
|
|
1801
|
+
}
|
|
1802
|
+
}), null);
|
|
1803
|
+
effect(() => className(_el$22, `flex items-center gap-3 w-full p-2 rounded-lg hover:bg-bg-300 transition-colors text-left ${props.class ?? ""}`));
|
|
1804
|
+
return _el$22;
|
|
1805
|
+
})();
|
|
1806
|
+
}
|
|
1807
|
+
delegateEvents(["click"]);
|
|
1808
|
+
|
|
1809
|
+
var _tmpl$$3 = /* @__PURE__ */ template(`<div class="relative h-[80px] w-[80px] flex-shrink-0 overflow-hidden rounded-xl border-2 border-accent-200"><img class="h-full w-full object-cover">`), _tmpl$2$1 = /* @__PURE__ */ template(`<div class="absolute bottom-[-20px] h-[30px] w-full"><div class="flex h-full w-full flex-1 justify-end gap-1">`), _tmpl$3$1 = /* @__PURE__ */ template(`<span class="font-semibold text-accent-200"> más`), _tmpl$4$1 = /* @__PURE__ */ template(`<div class="flex flex-1"><span class="text-base font-normal text-primary-500">seguida por `), _tmpl$5 = /* @__PURE__ */ template(`<div><div class="relative h-full flex-1 flex-col pl-3"><div class="flex h-full flex-col items-end justify-center pb-3 pr-5 pt-2"><div class="flex flex-1"><span class="text-lg font-semibold text-white drop-shadow-sm">`), _tmpl$6 = /* @__PURE__ */ template(`<span class="font-semibold text-accent-200">`);
|
|
1810
|
+
function CalendarCard(props) {
|
|
1811
|
+
const displayedFollowers = () => props.followers?.slice(0, 2) ?? [];
|
|
1812
|
+
const remainingCount = () => {
|
|
1813
|
+
const total = props.followerCount ?? props.followers?.length ?? 0;
|
|
1814
|
+
const displayed = displayedFollowers().length;
|
|
1815
|
+
return total - displayed;
|
|
1816
|
+
};
|
|
1817
|
+
return (() => {
|
|
1818
|
+
var _el$ = _tmpl$5(), _el$4 = _el$.firstChild, _el$7 = _el$4.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$8.firstChild;
|
|
1819
|
+
insert(_el$, createComponent(Show, {
|
|
1820
|
+
get when() {
|
|
1821
|
+
return props.image;
|
|
1822
|
+
},
|
|
1823
|
+
get children() {
|
|
1824
|
+
var _el$2 = _tmpl$$3(), _el$3 = _el$2.firstChild;
|
|
1825
|
+
effect((_p$) => {
|
|
1826
|
+
var _v$ = props.image, _v$2 = props.title;
|
|
1827
|
+
_v$ !== _p$.e && setAttribute(_el$3, "src", _p$.e = _v$);
|
|
1828
|
+
_v$2 !== _p$.t && setAttribute(_el$3, "alt", _p$.t = _v$2);
|
|
1829
|
+
return _p$;
|
|
1830
|
+
}, {
|
|
1831
|
+
e: void 0,
|
|
1832
|
+
t: void 0
|
|
1833
|
+
});
|
|
1834
|
+
return _el$2;
|
|
1835
|
+
}
|
|
1836
|
+
}), _el$4);
|
|
1837
|
+
insert(_el$4, createComponent(Show, {
|
|
1838
|
+
get when() {
|
|
1839
|
+
return memo(() => !!props.tags)() && props.tags.length > 0;
|
|
1840
|
+
},
|
|
1841
|
+
get children() {
|
|
1842
|
+
var _el$5 = _tmpl$2$1(), _el$6 = _el$5.firstChild;
|
|
1843
|
+
insert(_el$6, createComponent(For, {
|
|
1844
|
+
get each() {
|
|
1845
|
+
return props.tags;
|
|
1846
|
+
},
|
|
1847
|
+
children: (tag) => createComponent(Chip, {
|
|
1848
|
+
text: tag,
|
|
1849
|
+
variant: "primary"
|
|
1850
|
+
})
|
|
1851
|
+
}));
|
|
1852
|
+
return _el$5;
|
|
1853
|
+
}
|
|
1854
|
+
}), _el$7);
|
|
1855
|
+
insert(_el$9, () => props.title);
|
|
1856
|
+
insert(_el$7, createComponent(Show, {
|
|
1857
|
+
get when() {
|
|
1858
|
+
return displayedFollowers().length > 0;
|
|
1859
|
+
},
|
|
1860
|
+
get children() {
|
|
1861
|
+
var _el$0 = _tmpl$4$1(), _el$1 = _el$0.firstChild; _el$1.firstChild;
|
|
1862
|
+
insert(_el$1, createComponent(For, {
|
|
1863
|
+
get each() {
|
|
1864
|
+
return displayedFollowers();
|
|
1865
|
+
},
|
|
1866
|
+
children: (follower, index) => [(() => {
|
|
1867
|
+
var _el$14 = _tmpl$6();
|
|
1868
|
+
insert(_el$14, () => follower.name);
|
|
1869
|
+
return _el$14;
|
|
1870
|
+
})(), memo(() => index() < displayedFollowers().length - 1 && ", ")]
|
|
1871
|
+
}), null);
|
|
1872
|
+
insert(_el$1, createComponent(Show, {
|
|
1873
|
+
get when() {
|
|
1874
|
+
return remainingCount() > 0;
|
|
1875
|
+
},
|
|
1876
|
+
get children() {
|
|
1877
|
+
return [" ", "y ", (() => {
|
|
1878
|
+
var _el$12 = _tmpl$3$1(), _el$13 = _el$12.firstChild;
|
|
1879
|
+
insert(_el$12, remainingCount, _el$13);
|
|
1880
|
+
return _el$12;
|
|
1881
|
+
})()];
|
|
1882
|
+
}
|
|
1883
|
+
}), null);
|
|
1884
|
+
return _el$0;
|
|
1885
|
+
}
|
|
1886
|
+
}), null);
|
|
1887
|
+
effect(() => className(_el$, `flex h-[100px] w-full max-w-[500px] items-center rounded-xl border border-primary-600 border-b-accent-500 bg-bg-300 p-2 ${props.class ?? ""}`));
|
|
1888
|
+
return _el$;
|
|
1889
|
+
})();
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
var _tmpl$$2 = /* @__PURE__ */ template(`<span><span class=vui-logo__first></span><span class=vui-logo__second>`);
|
|
1893
|
+
function Logo(props) {
|
|
1894
|
+
const sizeClass = () => {
|
|
1895
|
+
switch (props.size) {
|
|
1896
|
+
case "sm":
|
|
1897
|
+
return "vui-logo--sm";
|
|
1898
|
+
case "lg":
|
|
1899
|
+
return "vui-logo--lg";
|
|
1900
|
+
case "xl":
|
|
1901
|
+
return "vui-logo--xl";
|
|
1902
|
+
case "md":
|
|
1903
|
+
default:
|
|
1904
|
+
return "vui-logo--md";
|
|
1905
|
+
}
|
|
1906
|
+
};
|
|
1907
|
+
const firstWord = () => props.firstWord ?? "Proyecto";
|
|
1908
|
+
const secondWord = () => props.secondWord ?? "Viviana";
|
|
1909
|
+
return (() => {
|
|
1910
|
+
var _el$ = _tmpl$$2(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
1911
|
+
insert(_el$2, firstWord);
|
|
1912
|
+
insert(_el$3, secondWord);
|
|
1913
|
+
effect((_p$) => {
|
|
1914
|
+
var _v$ = `vui-logo ${sizeClass()} ${props.class ?? ""}`, _v$2 = secondWord();
|
|
1915
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
1916
|
+
_v$2 !== _p$.t && setAttribute(_el$3, "data-text", _p$.t = _v$2);
|
|
1917
|
+
return _p$;
|
|
1918
|
+
}, {
|
|
1919
|
+
e: void 0,
|
|
1920
|
+
t: void 0
|
|
1921
|
+
});
|
|
1922
|
+
return _el$;
|
|
1923
|
+
})();
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
var _tmpl$$1 = /* @__PURE__ */ template(`<div class=vui-project-card__tooltip><span>`), _tmpl$2 = /* @__PURE__ */ template(`<img class=vui-project-card__image>`), _tmpl$3 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer">`), _tmpl$4 = /* @__PURE__ */ template(`<div>`);
|
|
1927
|
+
function ProjectCard(props) {
|
|
1928
|
+
const size = () => props.size ?? "sm";
|
|
1929
|
+
const inactive = () => props.inactive ?? false;
|
|
1930
|
+
const cardContent = () => [(() => {
|
|
1931
|
+
var _el$ = _tmpl$$1(), _el$2 = _el$.firstChild;
|
|
1932
|
+
insert(_el$2, () => props.name);
|
|
1933
|
+
return _el$;
|
|
1934
|
+
})(), (() => {
|
|
1935
|
+
var _el$3 = _tmpl$2();
|
|
1936
|
+
effect((_p$) => {
|
|
1937
|
+
var _v$ = props.imageSrc, _v$2 = props.imageAlt ?? props.name;
|
|
1938
|
+
_v$ !== _p$.e && setAttribute(_el$3, "src", _p$.e = _v$);
|
|
1939
|
+
_v$2 !== _p$.t && setAttribute(_el$3, "alt", _p$.t = _v$2);
|
|
1940
|
+
return _p$;
|
|
1941
|
+
}, {
|
|
1942
|
+
e: void 0,
|
|
1943
|
+
t: void 0
|
|
1944
|
+
});
|
|
1945
|
+
return _el$3;
|
|
1946
|
+
})()];
|
|
1947
|
+
const cardClasses = () => `vui-project-card vui-project-card--${size()} ${inactive() ? "vui-project-card--inactive" : ""} ${props.class ?? ""}`;
|
|
1948
|
+
if (props.href) {
|
|
1949
|
+
return (() => {
|
|
1950
|
+
var _el$4 = _tmpl$3();
|
|
1951
|
+
insert(_el$4, cardContent);
|
|
1952
|
+
effect((_p$) => {
|
|
1953
|
+
var _v$3 = props.href, _v$4 = cardClasses();
|
|
1954
|
+
_v$3 !== _p$.e && setAttribute(_el$4, "href", _p$.e = _v$3);
|
|
1955
|
+
_v$4 !== _p$.t && className(_el$4, _p$.t = _v$4);
|
|
1956
|
+
return _p$;
|
|
1957
|
+
}, {
|
|
1958
|
+
e: void 0,
|
|
1959
|
+
t: void 0
|
|
1960
|
+
});
|
|
1961
|
+
return _el$4;
|
|
1962
|
+
})();
|
|
1963
|
+
}
|
|
1964
|
+
return (() => {
|
|
1965
|
+
var _el$5 = _tmpl$4();
|
|
1966
|
+
insert(_el$5, cardContent);
|
|
1967
|
+
effect(() => className(_el$5, cardClasses()));
|
|
1968
|
+
return _el$5;
|
|
1969
|
+
})();
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
1973
|
+
function PageLayout(props) {
|
|
1974
|
+
const [local, rest] = splitProps(props, ["children", "class"]);
|
|
1975
|
+
return (() => {
|
|
1976
|
+
var _el$ = _tmpl$();
|
|
1977
|
+
spread(_el$, mergeProps$1({
|
|
1978
|
+
get ["class"]() {
|
|
1979
|
+
return `vui-page ${local.class ?? ""}`;
|
|
1980
|
+
}
|
|
1981
|
+
}, rest), false, true);
|
|
1982
|
+
insert(_el$, () => local.children);
|
|
1983
|
+
return _el$;
|
|
1984
|
+
})();
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
export { Alert, Avatar, AvatarGroup, Badge, Button, CalendarCard, Checkbox, CheckboxGroup, Chip, Conversation, ConversationBubble, ConversationPreview, Dialog, EventCard, EventListItem, GitHubIcon, Icon, LateralNav, Link, Logo, NavHeader, NavItem, NavLink, NavSection, PageLayout, ProfileCard, ProgressBar, ProjectCard, Radio, RadioGroup, Separator, TabSwitch, TextField, TimelineItem, ToggleSwitch, Tooltip };
|
|
1988
|
+
//# sourceMappingURL=index.js.map
|