@sigx/lynx-daisyui 0.4.0 → 0.4.1
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/buttons/Button.js +53 -0
- package/dist/data/Avatar.js +46 -0
- package/dist/feedback/Alert.js +13 -0
- package/dist/feedback/Badge.js +17 -0
- package/dist/feedback/Loading.js +16 -0
- package/dist/feedback/Modal.js +23 -0
- package/dist/feedback/Progress.js +17 -0
- package/dist/feedback/Skeleton.js +18 -0
- package/dist/feedback/Steps.js +16 -0
- package/dist/forms/Checkbox.js +32 -0
- package/dist/forms/FormField.js +5 -0
- package/dist/forms/Input.js +25 -0
- package/dist/forms/Radio.js +28 -0
- package/dist/forms/Select.js +33 -0
- package/dist/forms/Textarea.js +31 -0
- package/dist/forms/Toggle.js +32 -0
- package/dist/index.d.ts +60 -58
- package/dist/index.js +38 -678
- package/dist/layout/Card.js +39 -0
- package/dist/layout/Center.d.ts +2 -1
- package/dist/layout/Center.js +24 -0
- package/dist/layout/Col.d.ts +2 -2
- package/dist/layout/Col.js +33 -0
- package/dist/layout/Divider.js +27 -0
- package/dist/layout/Row.d.ts +2 -2
- package/dist/layout/Row.js +33 -0
- package/dist/layout/ScrollView.js +18 -0
- package/dist/layout/Spacer.js +11 -0
- package/dist/navigation/NavHeader.js +62 -0
- package/dist/navigation/NavTabBar.js +58 -0
- package/dist/navigation/Tabs.js +18 -0
- package/dist/preset/index.js +66 -40
- package/dist/shared/press.d.ts +2 -0
- package/dist/shared/press.js +6 -0
- package/dist/shared/styles.d.ts +29 -1
- package/dist/shared/styles.js +90 -0
- package/dist/theme/ThemeProvider.js +83 -0
- package/dist/typography/Heading.js +19 -0
- package/dist/typography/Text.d.ts +11 -1
- package/dist/typography/Text.js +25 -0
- package/package.json +8 -9
- package/dist/index.js.map +0 -1
- package/dist/preset/index.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,678 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
bindtap: () => {
|
|
40
|
-
!e.disabled && !e.loading && n("press");
|
|
41
|
-
},
|
|
42
|
-
children: e.loading ? /* @__PURE__ */ a(l, {
|
|
43
|
-
type: "spinner",
|
|
44
|
-
size: "sm"
|
|
45
|
-
}) : t.default?.()
|
|
46
|
-
});
|
|
47
|
-
}), p = t(e(({ props: e, slots: t }) => {
|
|
48
|
-
let n = () => {
|
|
49
|
-
let t = ["card"];
|
|
50
|
-
return e.bordered && t.push("card-bordered"), e.compact && t.push("card-compact"), e.shadow === !0 ? t.push("shadow-md") : e.shadow === "sm" ? t.push("shadow-sm") : e.shadow === "md" ? t.push("shadow-md") : e.shadow === "lg" ? t.push("shadow-lg") : e.shadow === void 0 && t.push("shadow-md"), e.class && t.push(e.class), t.join(" ");
|
|
51
|
-
};
|
|
52
|
-
return () => /* @__PURE__ */ a("view", {
|
|
53
|
-
class: n(),
|
|
54
|
-
children: t.default?.()
|
|
55
|
-
});
|
|
56
|
-
}), {
|
|
57
|
-
Body: e(({ props: e, slots: t }) => () => /* @__PURE__ */ a("view", {
|
|
58
|
-
class: `card-body${e.class ? " " + e.class : ""}`,
|
|
59
|
-
children: t.default?.()
|
|
60
|
-
})),
|
|
61
|
-
Title: e(({ props: e, slots: t }) => () => /* @__PURE__ */ a("text", {
|
|
62
|
-
class: `card-title${e.class ? " " + e.class : ""}`,
|
|
63
|
-
children: t.default?.()
|
|
64
|
-
})),
|
|
65
|
-
Actions: e(({ props: e, slots: t }) => () => /* @__PURE__ */ a("view", {
|
|
66
|
-
class: `card-actions${e.class ? " " + e.class : ""}`,
|
|
67
|
-
children: t.default?.()
|
|
68
|
-
}))
|
|
69
|
-
});
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/shared/styles.ts
|
|
72
|
-
function m(e, t) {
|
|
73
|
-
if (e === void 0) return {};
|
|
74
|
-
if (typeof e == "number") return {
|
|
75
|
-
[`${t}Top`]: e,
|
|
76
|
-
[`${t}Right`]: e,
|
|
77
|
-
[`${t}Bottom`]: e,
|
|
78
|
-
[`${t}Left`]: e
|
|
79
|
-
};
|
|
80
|
-
let n = {};
|
|
81
|
-
return e.top === void 0 ? e.y !== void 0 && (n[`${t}Top`] = e.y) : n[`${t}Top`] = e.top, e.bottom === void 0 ? e.y !== void 0 && (n[`${t}Bottom`] = e.y) : n[`${t}Bottom`] = e.bottom, e.right === void 0 ? e.x !== void 0 && (n[`${t}Right`] = e.x) : n[`${t}Right`] = e.right, e.left === void 0 ? e.x !== void 0 && (n[`${t}Left`] = e.x) : n[`${t}Left`] = e.left, n;
|
|
82
|
-
}
|
|
83
|
-
function h(e) {
|
|
84
|
-
let t = {};
|
|
85
|
-
return e.width !== void 0 && (t.width = e.width), e.height !== void 0 && (t.height = e.height), e.flex !== void 0 && (t.flexGrow = e.flex, t.flexShrink = 1, t.flexBasis = 0, t.minHeight = 0), e.background !== void 0 && (t.backgroundColor = e.background), e.borderRadius !== void 0 && (t.borderRadius = e.borderRadius), Object.assign(t, m(e.padding, "padding")), Object.assign(t, m(e.margin, "margin")), t;
|
|
86
|
-
}
|
|
87
|
-
//#endregion
|
|
88
|
-
//#region src/layout/Row.tsx
|
|
89
|
-
var g = e(({ props: e, slots: t }) => {
|
|
90
|
-
let n = () => {
|
|
91
|
-
let t = {
|
|
92
|
-
display: "flex",
|
|
93
|
-
flexDirection: "row"
|
|
94
|
-
};
|
|
95
|
-
e.gap !== void 0 && (t.gap = e.gap), e.align && (t.alignItems = e.align), e.justify && (t.justifyContent = e.justify), e.wrap && (t.flexWrap = "wrap");
|
|
96
|
-
let n = h({
|
|
97
|
-
width: e.width,
|
|
98
|
-
height: e.height,
|
|
99
|
-
flex: e.flex,
|
|
100
|
-
background: e.background,
|
|
101
|
-
borderRadius: e.borderRadius,
|
|
102
|
-
padding: e.padding,
|
|
103
|
-
margin: e.margin
|
|
104
|
-
});
|
|
105
|
-
for (let e in n) t[e] = n[e];
|
|
106
|
-
return t;
|
|
107
|
-
};
|
|
108
|
-
return () => /* @__PURE__ */ a("view", {
|
|
109
|
-
class: e.class,
|
|
110
|
-
style: n(),
|
|
111
|
-
children: t.default?.()
|
|
112
|
-
});
|
|
113
|
-
}), _ = e(({ props: e, slots: t }) => {
|
|
114
|
-
let n = () => {
|
|
115
|
-
let t = {
|
|
116
|
-
display: "flex",
|
|
117
|
-
flexDirection: "column"
|
|
118
|
-
};
|
|
119
|
-
e.gap !== void 0 && (t.gap = e.gap), e.align && (t.alignItems = e.align), e.justify && (t.justifyContent = e.justify), e.wrap && (t.flexWrap = "wrap");
|
|
120
|
-
let n = h({
|
|
121
|
-
width: e.width,
|
|
122
|
-
height: e.height,
|
|
123
|
-
flex: e.flex,
|
|
124
|
-
background: e.background,
|
|
125
|
-
borderRadius: e.borderRadius,
|
|
126
|
-
padding: e.padding,
|
|
127
|
-
margin: e.margin
|
|
128
|
-
});
|
|
129
|
-
for (let e in n) t[e] = n[e];
|
|
130
|
-
return t;
|
|
131
|
-
};
|
|
132
|
-
return () => /* @__PURE__ */ a("view", {
|
|
133
|
-
class: e.class,
|
|
134
|
-
style: n(),
|
|
135
|
-
children: t.default?.()
|
|
136
|
-
});
|
|
137
|
-
}), v = e(({ props: e, slots: t }) => {
|
|
138
|
-
let n = () => {
|
|
139
|
-
let t = {
|
|
140
|
-
display: "flex",
|
|
141
|
-
justifyContent: "center",
|
|
142
|
-
alignItems: "center"
|
|
143
|
-
}, n = h({
|
|
144
|
-
width: e.width,
|
|
145
|
-
height: e.height,
|
|
146
|
-
flex: e.flex,
|
|
147
|
-
background: e.background,
|
|
148
|
-
borderRadius: e.borderRadius
|
|
149
|
-
});
|
|
150
|
-
for (let e in n) t[e] = n[e];
|
|
151
|
-
return t;
|
|
152
|
-
};
|
|
153
|
-
return () => /* @__PURE__ */ a("view", {
|
|
154
|
-
class: e.class,
|
|
155
|
-
style: n(),
|
|
156
|
-
children: t.default?.()
|
|
157
|
-
});
|
|
158
|
-
}), y = e(({ props: e }) => {
|
|
159
|
-
let t = () => e.size === void 0 ? { flex: 1 } : {
|
|
160
|
-
width: e.size,
|
|
161
|
-
height: e.size
|
|
162
|
-
};
|
|
163
|
-
return () => /* @__PURE__ */ a("view", {
|
|
164
|
-
class: e.class,
|
|
165
|
-
style: t()
|
|
166
|
-
});
|
|
167
|
-
}), b = e(({ props: e, slots: t }) => {
|
|
168
|
-
let n = () => {
|
|
169
|
-
let t = {};
|
|
170
|
-
return e.height !== void 0 && (t.height = e.height), e.width !== void 0 && (t.width = e.width), e.flex !== void 0 && (t.flex = e.flex), t;
|
|
171
|
-
};
|
|
172
|
-
return () => {
|
|
173
|
-
let r = e.direction ?? "vertical";
|
|
174
|
-
return /* @__PURE__ */ a("scroll-view", {
|
|
175
|
-
class: e.class,
|
|
176
|
-
style: n(),
|
|
177
|
-
"scroll-orientation": r,
|
|
178
|
-
"scroll-y": r === "vertical" ? !0 : void 0,
|
|
179
|
-
"scroll-x": r === "horizontal" ? !0 : void 0,
|
|
180
|
-
"show-scrollbar": e.showScrollbar,
|
|
181
|
-
bounces: e.bounces,
|
|
182
|
-
children: t.default?.()
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
}), x = e(({ props: e }) => {
|
|
186
|
-
let t = () => {
|
|
187
|
-
let t = [e.vertical ? "divider-vertical" : "divider"];
|
|
188
|
-
return e.class && t.push(e.class), t.join(" ");
|
|
189
|
-
}, n = () => {
|
|
190
|
-
let t = {};
|
|
191
|
-
return e.color && (t.backgroundColor = e.color), e.margin !== void 0 && (e.vertical ? (t.marginLeft = e.margin, t.marginRight = e.margin) : (t.marginTop = e.margin, t.marginBottom = e.margin)), t;
|
|
192
|
-
};
|
|
193
|
-
return () => /* @__PURE__ */ a("view", {
|
|
194
|
-
class: t(),
|
|
195
|
-
style: n()
|
|
196
|
-
});
|
|
197
|
-
}), S = {
|
|
198
|
-
xs: "input-xs",
|
|
199
|
-
sm: "input-sm",
|
|
200
|
-
md: "",
|
|
201
|
-
lg: "input-lg"
|
|
202
|
-
}, C = e(({ props: e }) => {
|
|
203
|
-
let t = () => {
|
|
204
|
-
let t = ["input"];
|
|
205
|
-
if (e.variant === "bordered" && t.push("input-bordered"), e.variant === "ghost" && t.push("input-ghost"), e.color && t.push(`input-${e.color}`), e.size) {
|
|
206
|
-
let n = S[e.size];
|
|
207
|
-
n && t.push(n);
|
|
208
|
-
}
|
|
209
|
-
return e.class && t.push(e.class), t.join(" ");
|
|
210
|
-
};
|
|
211
|
-
return () => /* @__PURE__ */ a("input", {
|
|
212
|
-
class: t(),
|
|
213
|
-
placeholder: e.placeholder,
|
|
214
|
-
type: e.type ?? "text",
|
|
215
|
-
disabled: e.disabled,
|
|
216
|
-
model: e.model
|
|
217
|
-
});
|
|
218
|
-
}), w = {
|
|
219
|
-
xs: 10,
|
|
220
|
-
sm: 16,
|
|
221
|
-
md: 20,
|
|
222
|
-
lg: 24
|
|
223
|
-
}, T = e(({ props: e, emit: t }) => {
|
|
224
|
-
let n = () => {
|
|
225
|
-
let t = ["toggle"], n = e.size ?? "md";
|
|
226
|
-
return t.push(`toggle-${n}`), e.color && t.push(`toggle-${e.color}`), e.checked && t.push("toggle-checked"), e.disabled && t.push("toggle-disabled"), e.class && t.push(e.class), t.join(" ");
|
|
227
|
-
};
|
|
228
|
-
return () => {
|
|
229
|
-
let r = !!e.checked, i = e.size ?? "md", o = r ? w[i] : 0;
|
|
230
|
-
return /* @__PURE__ */ a("view", {
|
|
231
|
-
class: n(),
|
|
232
|
-
bindtap: () => {
|
|
233
|
-
e.disabled || t("change", !r);
|
|
234
|
-
},
|
|
235
|
-
children: /* @__PURE__ */ a("view", {
|
|
236
|
-
class: "toggle-thumb",
|
|
237
|
-
style: { transform: `translateX(${o}px)` }
|
|
238
|
-
})
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
}), E = {
|
|
242
|
-
xs: 10,
|
|
243
|
-
sm: 12,
|
|
244
|
-
md: 14,
|
|
245
|
-
lg: 19
|
|
246
|
-
}, D = e(({ props: e, emit: t }) => {
|
|
247
|
-
let n = () => {
|
|
248
|
-
let t = ["checkbox"], n = e.size ?? "md";
|
|
249
|
-
return n !== "md" && t.push(`checkbox-${n}`), e.color && t.push(`checkbox-${e.color}`), e.checked && t.push("checkbox-checked"), e.disabled && t.push("checkbox-disabled"), e.class && t.push(e.class), t.join(" ");
|
|
250
|
-
};
|
|
251
|
-
return () => {
|
|
252
|
-
let r = !!e.checked, i = e.size ?? "md";
|
|
253
|
-
return /* @__PURE__ */ a("view", {
|
|
254
|
-
class: n(),
|
|
255
|
-
bindtap: () => {
|
|
256
|
-
e.disabled || t("change", !r);
|
|
257
|
-
},
|
|
258
|
-
children: r ? /* @__PURE__ */ a("text", {
|
|
259
|
-
class: "checkbox-mark",
|
|
260
|
-
style: { fontSize: E[i] },
|
|
261
|
-
children: "✓"
|
|
262
|
-
}) : null
|
|
263
|
-
});
|
|
264
|
-
};
|
|
265
|
-
}), O = e(({ props: e, emit: t }) => {
|
|
266
|
-
let n = i({ open: !1 }), r = () => {
|
|
267
|
-
let t = ["select"];
|
|
268
|
-
return e.variant === "bordered" && t.push("select-bordered"), e.variant === "ghost" && t.push("select-ghost"), e.color && t.push(`select-${e.color}`), e.size && t.push(`select-${e.size}`), e.class && t.push(e.class), t.join(" ");
|
|
269
|
-
}, s = () => {
|
|
270
|
-
let t = (e.options ?? []).find((t) => t.value === e.value);
|
|
271
|
-
return t ? t.label : e.placeholder ?? "Select...";
|
|
272
|
-
};
|
|
273
|
-
return () => /* @__PURE__ */ o("view", {
|
|
274
|
-
style: {
|
|
275
|
-
position: "relative",
|
|
276
|
-
opacity: e.disabled ? .5 : 1
|
|
277
|
-
},
|
|
278
|
-
children: [/* @__PURE__ */ o("view", {
|
|
279
|
-
class: r(),
|
|
280
|
-
bindtap: () => {
|
|
281
|
-
e.disabled || (n.open = !n.open);
|
|
282
|
-
},
|
|
283
|
-
children: [/* @__PURE__ */ a("text", { children: s() }), /* @__PURE__ */ a("view", {
|
|
284
|
-
style: { marginLeft: "auto" },
|
|
285
|
-
children: /* @__PURE__ */ a("text", { children: n.open ? "▲" : "▼" })
|
|
286
|
-
})]
|
|
287
|
-
}), n.open && !e.disabled && /* @__PURE__ */ a("view", {
|
|
288
|
-
class: "select-dropdown",
|
|
289
|
-
style: {
|
|
290
|
-
position: "absolute",
|
|
291
|
-
top: "100%",
|
|
292
|
-
left: 0,
|
|
293
|
-
right: 0,
|
|
294
|
-
zIndex: 10
|
|
295
|
-
},
|
|
296
|
-
children: (e.options ?? []).map((r) => /* @__PURE__ */ a("view", {
|
|
297
|
-
class: `select-option${r.value === e.value ? " select-option-active" : ""}`,
|
|
298
|
-
bindtap: () => {
|
|
299
|
-
t("change", r.value), n.open = !1;
|
|
300
|
-
},
|
|
301
|
-
children: /* @__PURE__ */ a("text", { children: r.label })
|
|
302
|
-
}))
|
|
303
|
-
})]
|
|
304
|
-
});
|
|
305
|
-
}), k = e(({ props: e, emit: t }) => {
|
|
306
|
-
let n = () => {
|
|
307
|
-
let t = ["radio"];
|
|
308
|
-
return e.color && t.push(`radio-${e.color}`), e.size && t.push(`radio-${e.size}`), e.checked && t.push("radio-checked"), e.class && t.push(e.class), t.join(" ");
|
|
309
|
-
};
|
|
310
|
-
return () => /* @__PURE__ */ o("view", {
|
|
311
|
-
style: {
|
|
312
|
-
flexDirection: "row",
|
|
313
|
-
alignItems: "center",
|
|
314
|
-
gap: 8,
|
|
315
|
-
opacity: e.disabled ? .5 : 1
|
|
316
|
-
},
|
|
317
|
-
bindtap: () => {
|
|
318
|
-
!e.disabled && e.value != null && t("select", e.value);
|
|
319
|
-
},
|
|
320
|
-
children: [/* @__PURE__ */ a("view", {
|
|
321
|
-
class: n(),
|
|
322
|
-
children: e.checked && /* @__PURE__ */ a("view", { class: "radio-mark" })
|
|
323
|
-
}), e.label && /* @__PURE__ */ a("text", { children: e.label })]
|
|
324
|
-
});
|
|
325
|
-
}), A = t(e(({ props: e, slots: t }) => () => /* @__PURE__ */ a("view", {
|
|
326
|
-
class: e.class ?? "",
|
|
327
|
-
style: { gap: 8 },
|
|
328
|
-
children: t.default?.()
|
|
329
|
-
})), { Item: k }), j = {
|
|
330
|
-
xs: "textarea-xs",
|
|
331
|
-
sm: "textarea-sm",
|
|
332
|
-
md: "",
|
|
333
|
-
lg: "textarea-lg"
|
|
334
|
-
}, M = e(({ props: e }) => {
|
|
335
|
-
let t = () => {
|
|
336
|
-
let t = ["textarea"];
|
|
337
|
-
if (e.variant === "bordered" && t.push("textarea-bordered"), e.variant === "ghost" && t.push("textarea-ghost"), e.color && t.push(`textarea-${e.color}`), e.size) {
|
|
338
|
-
let n = j[e.size];
|
|
339
|
-
n && t.push(n);
|
|
340
|
-
}
|
|
341
|
-
return e.class && t.push(e.class), t.join(" ");
|
|
342
|
-
}, n = () => (e.rows ?? 3) * 20 + 16;
|
|
343
|
-
return () => /* @__PURE__ */ a("textarea", {
|
|
344
|
-
class: t(),
|
|
345
|
-
placeholder: e.placeholder,
|
|
346
|
-
disabled: e.disabled,
|
|
347
|
-
model: e.model,
|
|
348
|
-
style: { height: n() }
|
|
349
|
-
});
|
|
350
|
-
}), ee = e(({ props: e, slots: t }) => () => /* @__PURE__ */ o("view", {
|
|
351
|
-
class: ["form-control", e.class].filter(Boolean).join(" "),
|
|
352
|
-
style: { gap: 4 },
|
|
353
|
-
children: [
|
|
354
|
-
e.label && /* @__PURE__ */ a("view", {
|
|
355
|
-
class: "label",
|
|
356
|
-
children: /* @__PURE__ */ a("text", {
|
|
357
|
-
class: "label-text",
|
|
358
|
-
children: e.required ? `${e.label} *` : e.label
|
|
359
|
-
})
|
|
360
|
-
}),
|
|
361
|
-
t.default?.(),
|
|
362
|
-
e.error && /* @__PURE__ */ a("view", {
|
|
363
|
-
class: "label",
|
|
364
|
-
children: /* @__PURE__ */ a("text", {
|
|
365
|
-
class: "label-text-error",
|
|
366
|
-
children: e.error
|
|
367
|
-
})
|
|
368
|
-
})
|
|
369
|
-
]
|
|
370
|
-
})), N = e(({ props: e, slots: t }) => {
|
|
371
|
-
let n = () => {
|
|
372
|
-
let t = ["badge"];
|
|
373
|
-
return e.variant && t.push(`badge-${e.variant}`), e.size && t.push(`badge-${e.size}`), e.outline && t.push("badge-outline"), e.class && t.push(e.class), t.join(" ");
|
|
374
|
-
};
|
|
375
|
-
return () => /* @__PURE__ */ a("view", {
|
|
376
|
-
class: n(),
|
|
377
|
-
children: t.default?.()
|
|
378
|
-
});
|
|
379
|
-
}), P = e(({ props: e, slots: t }) => {
|
|
380
|
-
let n = () => {
|
|
381
|
-
let t = ["alert"];
|
|
382
|
-
return e.variant && t.push(`alert-${e.variant}`), e.class && t.push(e.class), t.join(" ");
|
|
383
|
-
};
|
|
384
|
-
return () => /* @__PURE__ */ a("view", {
|
|
385
|
-
class: n(),
|
|
386
|
-
children: t.default?.()
|
|
387
|
-
});
|
|
388
|
-
}), F = e(({ props: e }) => {
|
|
389
|
-
let t = () => {
|
|
390
|
-
let t = ["progress"];
|
|
391
|
-
return e.color && t.push(`progress-${e.color}`), e.class && t.push(e.class), t.join(" ");
|
|
392
|
-
};
|
|
393
|
-
return () => {
|
|
394
|
-
let n = e.max ?? 100, r = Math.min(Math.max((e.value ?? 0) / n, 0), 1) * 100;
|
|
395
|
-
return /* @__PURE__ */ a("view", {
|
|
396
|
-
class: t(),
|
|
397
|
-
children: /* @__PURE__ */ a("view", {
|
|
398
|
-
class: "progress-bar",
|
|
399
|
-
style: { width: `${r}%` }
|
|
400
|
-
})
|
|
401
|
-
});
|
|
402
|
-
};
|
|
403
|
-
}), I = t(e(({ props: e, slots: t }) => () => e.open ? /* @__PURE__ */ a("view", {
|
|
404
|
-
class: "modal-overlay",
|
|
405
|
-
bindtap: () => {
|
|
406
|
-
e.onClose?.();
|
|
407
|
-
},
|
|
408
|
-
children: /* @__PURE__ */ a("view", {
|
|
409
|
-
class: `modal-box${e.class ? " " + e.class : ""}`,
|
|
410
|
-
bindtap: (e) => {
|
|
411
|
-
e?.stopPropagation?.();
|
|
412
|
-
},
|
|
413
|
-
children: t.default?.()
|
|
414
|
-
})
|
|
415
|
-
}) : /* @__PURE__ */ a("view", { style: { display: "none" } })), {
|
|
416
|
-
Header: e(({ props: e, slots: t }) => () => /* @__PURE__ */ a("view", {
|
|
417
|
-
class: `modal-header${e.class ? " " + e.class : ""}`,
|
|
418
|
-
children: t.default?.()
|
|
419
|
-
})),
|
|
420
|
-
Body: e(({ props: e, slots: t }) => () => /* @__PURE__ */ a("view", {
|
|
421
|
-
class: `modal-body${e.class ? " " + e.class : ""}`,
|
|
422
|
-
children: t.default?.()
|
|
423
|
-
})),
|
|
424
|
-
Actions: e(({ props: e, slots: t }) => () => /* @__PURE__ */ a("view", {
|
|
425
|
-
class: `modal-action${e.class ? " " + e.class : ""}`,
|
|
426
|
-
children: t.default?.()
|
|
427
|
-
}))
|
|
428
|
-
}), L = e(({ props: e }) => () => {
|
|
429
|
-
let t = {};
|
|
430
|
-
if (e.width != null && (t.width = e.width), e.height != null && (t.height = e.height), e.circle) {
|
|
431
|
-
let n = e.width ?? e.height ?? 48;
|
|
432
|
-
t.width = n, t.height = n, t.borderRadius = typeof n == "number" ? n / 2 : "50%";
|
|
433
|
-
}
|
|
434
|
-
return /* @__PURE__ */ a("view", {
|
|
435
|
-
class: `skeleton${e.class ? " " + e.class : ""}`,
|
|
436
|
-
style: t
|
|
437
|
-
});
|
|
438
|
-
}), R = t(e(({ props: e, slots: t }) => () => /* @__PURE__ */ a("view", {
|
|
439
|
-
class: `steps${e.vertical ?? !1 ? " steps-vertical" : " steps-horizontal"}${e.class ? " " + e.class : ""}`,
|
|
440
|
-
children: t.default?.()
|
|
441
|
-
})), { Step: e(({ props: e, slots: t }) => () => {
|
|
442
|
-
let n = e.color, r = n ? ` step-${n}` : "";
|
|
443
|
-
return /* @__PURE__ */ o("view", {
|
|
444
|
-
class: `step${r}${e.class ? " " + e.class : ""}`,
|
|
445
|
-
children: [/* @__PURE__ */ a("view", {
|
|
446
|
-
class: `step-indicator${r}`,
|
|
447
|
-
children: e.content ? /* @__PURE__ */ a("text", {
|
|
448
|
-
style: { fontSize: 14 },
|
|
449
|
-
children: e.content
|
|
450
|
-
}) : null
|
|
451
|
-
}), t.default?.()]
|
|
452
|
-
});
|
|
453
|
-
}) }), z = t(e(({ props: e, slots: t }) => () => /* @__PURE__ */ a("view", {
|
|
454
|
-
class: `tabs${e.class ? " " + e.class : ""}`,
|
|
455
|
-
children: t.default?.()
|
|
456
|
-
})), { Tab: e(({ props: e, slots: t }) => () => /* @__PURE__ */ o("view", {
|
|
457
|
-
class: `tab${e.active ?? !1 ? " tab-active" : ""}${e.class ? " " + e.class : ""}`,
|
|
458
|
-
bindtap: () => {
|
|
459
|
-
e.onPress?.();
|
|
460
|
-
},
|
|
461
|
-
children: [t.default?.(), e.label ? /* @__PURE__ */ a("text", { children: e.label }) : null]
|
|
462
|
-
})) }), B = {
|
|
463
|
-
"base-100": "bg-base-100",
|
|
464
|
-
"base-200": "bg-base-200",
|
|
465
|
-
"base-300": "bg-base-300",
|
|
466
|
-
transparent: ""
|
|
467
|
-
}, V = e(({ props: e }) => {
|
|
468
|
-
let t = c();
|
|
469
|
-
return () => {
|
|
470
|
-
let n = t.tabs, r = t.active, i = e.renderTab, o = e.position ?? "bottom";
|
|
471
|
-
return /* @__PURE__ */ a("view", {
|
|
472
|
-
"accessibility-element": !1,
|
|
473
|
-
class: [
|
|
474
|
-
"flex flex-row",
|
|
475
|
-
B[e.background ?? "base-200"],
|
|
476
|
-
e.bordered ?? !0 ? o === "bottom" ? "border-t border-base-300" : "border-b border-base-300" : ""
|
|
477
|
-
].filter(Boolean).join(" "),
|
|
478
|
-
children: n.map((e) => {
|
|
479
|
-
let n = e.name === r, o = () => t.setActive(e.name);
|
|
480
|
-
return i ? i(e, {
|
|
481
|
-
active: n,
|
|
482
|
-
onPress: o
|
|
483
|
-
}) : /* @__PURE__ */ a(H, {
|
|
484
|
-
info: e,
|
|
485
|
-
active: n,
|
|
486
|
-
onPress: o
|
|
487
|
-
});
|
|
488
|
-
})
|
|
489
|
-
});
|
|
490
|
-
};
|
|
491
|
-
}), H = e(({ props: e }) => () => {
|
|
492
|
-
let t = e.info.label ?? e.info.name, n = e.info.accessibilityLabel ?? t, r = e.active ? "text-primary font-semibold" : "text-base-content opacity-60";
|
|
493
|
-
return /* @__PURE__ */ o("view", {
|
|
494
|
-
bindtap: () => e.onPress(),
|
|
495
|
-
"accessibility-element": !0,
|
|
496
|
-
"accessibility-label": n,
|
|
497
|
-
"accessibility-trait": "button",
|
|
498
|
-
"accessibility-status": e.active ? "selected" : void 0,
|
|
499
|
-
class: "flex-1 items-center justify-center py-3",
|
|
500
|
-
children: [e.info.icon ?? null, /* @__PURE__ */ a("text", {
|
|
501
|
-
class: `text-sm ${r}`,
|
|
502
|
-
children: t
|
|
503
|
-
})]
|
|
504
|
-
});
|
|
505
|
-
}), U = {
|
|
506
|
-
"base-100": "bg-base-100",
|
|
507
|
-
"base-200": "bg-base-200",
|
|
508
|
-
"base-300": "bg-base-300",
|
|
509
|
-
transparent: ""
|
|
510
|
-
}, W = e(({ props: e }) => {
|
|
511
|
-
let t = s();
|
|
512
|
-
return () => {
|
|
513
|
-
if (!t.headerShown) return null;
|
|
514
|
-
let n = t.header;
|
|
515
|
-
if (n) return n();
|
|
516
|
-
let r = [
|
|
517
|
-
"flex flex-row items-center px-3",
|
|
518
|
-
"h-12",
|
|
519
|
-
U[e.background ?? "base-200"],
|
|
520
|
-
e.bordered ?? !0 ? "border-b border-base-300" : ""
|
|
521
|
-
].filter(Boolean).join(" "), i = t.headerLeft?.() ?? (t.canGoBack ? e.renderBack ? e.renderBack({ pop: t.pop }) : /* @__PURE__ */ a(G, { onPress: t.pop }) : null), s = t.headerRight?.() ?? null;
|
|
522
|
-
return /* @__PURE__ */ o("view", {
|
|
523
|
-
class: r,
|
|
524
|
-
children: [
|
|
525
|
-
/* @__PURE__ */ a("view", {
|
|
526
|
-
class: "flex flex-row items-center",
|
|
527
|
-
style: { minWidth: 56 },
|
|
528
|
-
children: i
|
|
529
|
-
}),
|
|
530
|
-
/* @__PURE__ */ a("view", {
|
|
531
|
-
class: "flex-1 items-center justify-center",
|
|
532
|
-
children: /* @__PURE__ */ a("text", {
|
|
533
|
-
class: "text-base-content text-base font-semibold",
|
|
534
|
-
children: t.title
|
|
535
|
-
})
|
|
536
|
-
}),
|
|
537
|
-
/* @__PURE__ */ a("view", {
|
|
538
|
-
class: "flex flex-row items-center justify-end",
|
|
539
|
-
style: { minWidth: 56 },
|
|
540
|
-
children: s
|
|
541
|
-
})
|
|
542
|
-
]
|
|
543
|
-
});
|
|
544
|
-
};
|
|
545
|
-
}), G = e(({ props: e }) => () => /* @__PURE__ */ a("view", {
|
|
546
|
-
bindtap: () => e.onPress(),
|
|
547
|
-
"accessibility-element": !0,
|
|
548
|
-
"accessibility-label": "Back",
|
|
549
|
-
"accessibility-trait": "button",
|
|
550
|
-
class: "px-2 py-2",
|
|
551
|
-
children: /* @__PURE__ */ a("text", {
|
|
552
|
-
class: "text-primary text-base",
|
|
553
|
-
children: "‹ Back"
|
|
554
|
-
})
|
|
555
|
-
})), K = n(() => {
|
|
556
|
-
throw Error("[lynx-daisyui] useTheme() called outside <ThemeProvider>. Wrap your app root with `<ThemeProvider initial=\"daisy-light\">…</ThemeProvider>`.");
|
|
557
|
-
}), q = e(({ props: e, slots: t }) => {
|
|
558
|
-
let n = i({ name: e.initial ?? "daisy-light" }), o = {
|
|
559
|
-
get name() {
|
|
560
|
-
return n.name;
|
|
561
|
-
},
|
|
562
|
-
set(e) {
|
|
563
|
-
n.name = e;
|
|
564
|
-
},
|
|
565
|
-
toggle() {
|
|
566
|
-
n.name === "daisy-light" ? n.name = "daisy-dark" : n.name === "daisy-dark" ? n.name = "daisy-light" : n.name = "daisy-dark";
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
return r(K, () => o), () => {
|
|
570
|
-
let r = {
|
|
571
|
-
flexGrow: 1,
|
|
572
|
-
flexShrink: 1,
|
|
573
|
-
flexBasis: 0,
|
|
574
|
-
minHeight: 0,
|
|
575
|
-
display: "flex",
|
|
576
|
-
flexDirection: "column"
|
|
577
|
-
};
|
|
578
|
-
return /* @__PURE__ */ a("view", {
|
|
579
|
-
class: `${n.name}${e.class ? " " + e.class : ""}`,
|
|
580
|
-
style: e.style ? {
|
|
581
|
-
...r,
|
|
582
|
-
...e.style
|
|
583
|
-
} : r,
|
|
584
|
-
children: t.default?.()
|
|
585
|
-
});
|
|
586
|
-
};
|
|
587
|
-
}), J = {
|
|
588
|
-
xs: 24,
|
|
589
|
-
sm: 32,
|
|
590
|
-
md: 48,
|
|
591
|
-
lg: 64,
|
|
592
|
-
xl: 96
|
|
593
|
-
}, Y = {
|
|
594
|
-
xs: 10,
|
|
595
|
-
sm: 12,
|
|
596
|
-
md: 18,
|
|
597
|
-
lg: 24,
|
|
598
|
-
xl: 36
|
|
599
|
-
}, X = e(({ props: e }) => () => {
|
|
600
|
-
let t = e.size || "md", n = J[t], r = ["avatar"];
|
|
601
|
-
e.online && r.push("online"), e.offline && r.push("offline"), e.placeholder && !e.src && r.push("placeholder"), e.class && r.push(e.class);
|
|
602
|
-
let i = e.rounded, o = i === "full" || i === !0 ? n / 2 : 8, s = {
|
|
603
|
-
width: n,
|
|
604
|
-
height: n,
|
|
605
|
-
borderRadius: o,
|
|
606
|
-
overflow: "hidden",
|
|
607
|
-
alignItems: "center",
|
|
608
|
-
justifyContent: "center",
|
|
609
|
-
display: "flex"
|
|
610
|
-
};
|
|
611
|
-
return e.src ? /* @__PURE__ */ a("view", {
|
|
612
|
-
class: r.join(" "),
|
|
613
|
-
children: /* @__PURE__ */ a("view", {
|
|
614
|
-
style: s,
|
|
615
|
-
children: /* @__PURE__ */ a("image", {
|
|
616
|
-
src: e.src,
|
|
617
|
-
style: {
|
|
618
|
-
width: n,
|
|
619
|
-
height: n,
|
|
620
|
-
borderRadius: o
|
|
621
|
-
}
|
|
622
|
-
})
|
|
623
|
-
})
|
|
624
|
-
}) : /* @__PURE__ */ a("view", {
|
|
625
|
-
class: r.join(" "),
|
|
626
|
-
children: /* @__PURE__ */ a("view", {
|
|
627
|
-
class: "avatar-placeholder",
|
|
628
|
-
style: s,
|
|
629
|
-
children: /* @__PURE__ */ a("text", {
|
|
630
|
-
style: { fontSize: Y[t] },
|
|
631
|
-
children: e.placeholder || "?"
|
|
632
|
-
})
|
|
633
|
-
})
|
|
634
|
-
});
|
|
635
|
-
}), Z = {
|
|
636
|
-
xs: "text-xs",
|
|
637
|
-
sm: "text-sm",
|
|
638
|
-
base: "text-base",
|
|
639
|
-
lg: "text-lg",
|
|
640
|
-
xl: "text-xl",
|
|
641
|
-
"2xl": "text-2xl",
|
|
642
|
-
"3xl": "text-3xl"
|
|
643
|
-
}, Q = {
|
|
644
|
-
light: "font-light",
|
|
645
|
-
normal: "font-normal",
|
|
646
|
-
medium: "font-medium",
|
|
647
|
-
semibold: "font-semibold",
|
|
648
|
-
bold: "font-bold"
|
|
649
|
-
}, $ = e(({ props: e, slots: t }) => {
|
|
650
|
-
let n = () => {
|
|
651
|
-
let t = [];
|
|
652
|
-
return e.size && t.push(Z[e.size]), e.weight && t.push(Q[e.weight]), e.color && t.push(`text-${e.color}`), e.class && t.push(e.class), t.join(" ");
|
|
653
|
-
};
|
|
654
|
-
return () => /* @__PURE__ */ a("text", {
|
|
655
|
-
class: n(),
|
|
656
|
-
children: t.default?.()
|
|
657
|
-
});
|
|
658
|
-
}), te = {
|
|
659
|
-
1: "text-3xl font-bold",
|
|
660
|
-
2: "text-2xl font-bold",
|
|
661
|
-
3: "text-xl font-semibold",
|
|
662
|
-
4: "text-lg font-semibold",
|
|
663
|
-
5: "text-base font-semibold",
|
|
664
|
-
6: "text-sm font-semibold"
|
|
665
|
-
}, ne = e(({ props: e, slots: t }) => {
|
|
666
|
-
let n = () => {
|
|
667
|
-
let t = [te[e.level ?? 2], "text-base-content"];
|
|
668
|
-
return e.class && t.push(e.class), t.join(" ");
|
|
669
|
-
};
|
|
670
|
-
return () => /* @__PURE__ */ a("text", {
|
|
671
|
-
class: n(),
|
|
672
|
-
children: t.default?.()
|
|
673
|
-
});
|
|
674
|
-
});
|
|
675
|
-
//#endregion
|
|
676
|
-
export { P as Alert, X as Avatar, N as Badge, f as Button, p as Card, v as Center, D as Checkbox, _ as Col, x as Divider, ee as FormField, ne as Heading, C as Input, l as Loading, I as Modal, W as NavHeader, V as NavTabBar, F as Progress, A as Radio, g as Row, b as ScrollView, O as Select, L as Skeleton, y as Spacer, R as Steps, z as Tabs, $ as Text, M as Textarea, q as ThemeProvider, T as Toggle, K as useTheme };
|
|
677
|
-
|
|
678
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
// Buttons
|
|
2
|
+
export { Button } from './buttons/Button.js';
|
|
3
|
+
// Layout
|
|
4
|
+
export { Card } from './layout/Card.js';
|
|
5
|
+
export { Row } from './layout/Row.js';
|
|
6
|
+
export { Col } from './layout/Col.js';
|
|
7
|
+
export { Center } from './layout/Center.js';
|
|
8
|
+
export { Spacer } from './layout/Spacer.js';
|
|
9
|
+
export { ScrollView } from './layout/ScrollView.js';
|
|
10
|
+
export { Divider } from './layout/Divider.js';
|
|
11
|
+
export { resolveDaisyColor } from './shared/styles.js';
|
|
12
|
+
// Forms
|
|
13
|
+
export { Input } from './forms/Input.js';
|
|
14
|
+
export { Toggle } from './forms/Toggle.js';
|
|
15
|
+
export { Checkbox } from './forms/Checkbox.js';
|
|
16
|
+
export { Select } from './forms/Select.js';
|
|
17
|
+
export { Radio } from './forms/Radio.js';
|
|
18
|
+
export { Textarea } from './forms/Textarea.js';
|
|
19
|
+
export { FormField } from './forms/FormField.js';
|
|
20
|
+
// Feedback
|
|
21
|
+
export { Badge } from './feedback/Badge.js';
|
|
22
|
+
export { Alert } from './feedback/Alert.js';
|
|
23
|
+
export { Loading } from './feedback/Loading.js';
|
|
24
|
+
export { Progress } from './feedback/Progress.js';
|
|
25
|
+
export { Modal } from './feedback/Modal.js';
|
|
26
|
+
export { Skeleton } from './feedback/Skeleton.js';
|
|
27
|
+
export { Steps } from './feedback/Steps.js';
|
|
28
|
+
// Navigation
|
|
29
|
+
export { Tabs } from './navigation/Tabs.js';
|
|
30
|
+
export { NavTabBar } from './navigation/NavTabBar.js';
|
|
31
|
+
export { NavHeader } from './navigation/NavHeader.js';
|
|
32
|
+
// Theme
|
|
33
|
+
export { ThemeProvider, useTheme } from './theme/ThemeProvider.js';
|
|
34
|
+
// Data
|
|
35
|
+
export { Avatar } from './data/Avatar.js';
|
|
36
|
+
// Typography
|
|
37
|
+
export { Text } from './typography/Text.js';
|
|
38
|
+
export { Heading } from './typography/Heading.js';
|