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