@sigx/lynx-daisyui 0.1.3 → 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.
Files changed (48) hide show
  1. package/README.md +109 -0
  2. package/dist/buttons/Button.js +53 -0
  3. package/dist/data/Avatar.js +46 -0
  4. package/dist/feedback/Alert.js +13 -0
  5. package/dist/feedback/Badge.js +17 -0
  6. package/dist/feedback/Loading.js +16 -0
  7. package/dist/feedback/Modal.js +23 -0
  8. package/dist/feedback/Progress.js +17 -0
  9. package/dist/feedback/Skeleton.js +18 -0
  10. package/dist/feedback/Steps.js +16 -0
  11. package/dist/forms/Checkbox.js +32 -0
  12. package/dist/forms/FormField.js +5 -0
  13. package/dist/forms/Input.js +25 -0
  14. package/dist/forms/Radio.js +28 -0
  15. package/dist/forms/Select.js +33 -0
  16. package/dist/forms/Textarea.js +31 -0
  17. package/dist/forms/Toggle.js +32 -0
  18. package/dist/index.d.ts +8 -0
  19. package/dist/index.js +38 -552
  20. package/dist/layout/Card.js +39 -0
  21. package/dist/layout/Center.d.ts +2 -1
  22. package/dist/layout/Center.js +24 -0
  23. package/dist/layout/Col.d.ts +2 -2
  24. package/dist/layout/Col.js +33 -0
  25. package/dist/layout/Divider.js +27 -0
  26. package/dist/layout/Row.d.ts +2 -2
  27. package/dist/layout/Row.js +33 -0
  28. package/dist/layout/ScrollView.js +18 -0
  29. package/dist/layout/Spacer.js +11 -0
  30. package/dist/navigation/NavHeader.d.ts +32 -0
  31. package/dist/navigation/NavHeader.js +62 -0
  32. package/dist/navigation/NavTabBar.d.ts +36 -0
  33. package/dist/navigation/NavTabBar.js +58 -0
  34. package/dist/navigation/Tabs.js +18 -0
  35. package/dist/preset/index.js +66 -26
  36. package/dist/shared/press.d.ts +2 -0
  37. package/dist/shared/press.js +6 -0
  38. package/dist/shared/styles.d.ts +29 -1
  39. package/dist/shared/styles.js +90 -0
  40. package/dist/styles/index.css.d.ts +7 -0
  41. package/dist/theme/ThemeProvider.d.ts +82 -0
  42. package/dist/theme/ThemeProvider.js +83 -0
  43. package/dist/typography/Heading.js +19 -0
  44. package/dist/typography/Text.d.ts +11 -1
  45. package/dist/typography/Text.js +25 -0
  46. package/package.json +18 -9
  47. package/dist/index.js.map +0 -1
  48. package/dist/preset/index.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,552 +1,38 @@
1
- import { component as e, compound as t, signal as n } from "@sigx/lynx";
2
- import { jsx as r, jsxs as i } from "@sigx/lynx/jsx-runtime";
3
- //#region src/feedback/Loading.tsx
4
- var a = e(({ props: e }) => {
5
- let t = () => {
6
- let t = ["loading"];
7
- 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
- return () => /* @__PURE__ */ r("view", { class: t() });
10
- }), o = {
11
- primary: "btn-primary",
12
- secondary: "btn-secondary",
13
- accent: "btn-accent",
14
- info: "btn-info",
15
- success: "btn-success",
16
- warning: "btn-warning",
17
- error: "btn-error",
18
- ghost: "btn-ghost",
19
- link: "btn-link",
20
- neutral: "btn-neutral"
21
- }, s = {
22
- xs: "btn-xs",
23
- sm: "btn-sm",
24
- md: "",
25
- lg: "btn-lg",
26
- xl: "btn-xl"
27
- }, c = e(({ props: e, slots: t, emit: n }) => {
28
- let i = () => {
29
- let t = ["btn"];
30
- if (e.variant && t.push(o[e.variant]), e.size) {
31
- let n = s[e.size];
32
- n && t.push(n);
33
- }
34
- 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
- return () => /* @__PURE__ */ r("view", {
37
- class: i(),
38
- bindtap: () => {
39
- !e.disabled && !e.loading && n("press");
40
- },
41
- children: e.loading ? /* @__PURE__ */ r(a, {
42
- type: "spinner",
43
- size: "sm"
44
- }) : t.default?.()
45
- });
46
- }), l = t(e(({ props: e, slots: t }) => {
47
- let n = () => {
48
- let t = ["card"];
49
- 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
- return () => /* @__PURE__ */ r("view", {
52
- class: n(),
53
- children: t.default?.()
54
- });
55
- }), {
56
- Body: e(({ props: e, slots: t }) => () => /* @__PURE__ */ r("view", {
57
- class: `card-body${e.class ? " " + e.class : ""}`,
58
- children: t.default?.()
59
- })),
60
- Title: e(({ props: e, slots: t }) => () => /* @__PURE__ */ r("text", {
61
- class: `card-title${e.class ? " " + e.class : ""}`,
62
- children: t.default?.()
63
- })),
64
- Actions: e(({ props: e, slots: t }) => () => /* @__PURE__ */ r("view", {
65
- class: `card-actions${e.class ? " " + e.class : ""}`,
66
- children: t.default?.()
67
- }))
68
- });
69
- //#endregion
70
- //#region src/shared/styles.ts
71
- function u(e, t) {
72
- if (e === void 0) return {};
73
- if (typeof e == "number") return {
74
- [`${t}Top`]: e,
75
- [`${t}Right`]: e,
76
- [`${t}Bottom`]: e,
77
- [`${t}Left`]: e
78
- };
79
- let n = {};
80
- 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
- function d(e) {
83
- 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.flex = e.flex), e.background !== void 0 && (t.backgroundColor = e.background), e.borderRadius !== void 0 && (t.borderRadius = e.borderRadius), Object.assign(t, u(e.padding, "padding")), Object.assign(t, u(e.margin, "margin")), t;
85
- }
86
- //#endregion
87
- //#region src/layout/Row.tsx
88
- var f = e(({ props: e, slots: t }) => {
89
- let n = () => {
90
- let t = {
91
- display: "flex",
92
- flexDirection: "row"
93
- };
94
- 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 = d({
96
- width: e.width,
97
- height: e.height,
98
- flex: e.flex,
99
- background: e.background,
100
- borderRadius: e.borderRadius,
101
- padding: e.padding,
102
- margin: e.margin
103
- });
104
- for (let e in n) t[e] = n[e];
105
- return t;
106
- };
107
- return () => /* @__PURE__ */ r("view", {
108
- class: e.class,
109
- style: n(),
110
- children: t.default?.()
111
- });
112
- }), p = e(({ props: e, slots: t }) => {
113
- let n = () => {
114
- let t = {
115
- display: "flex",
116
- flexDirection: "column"
117
- };
118
- 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 = d({
120
- width: e.width,
121
- height: e.height,
122
- flex: e.flex,
123
- background: e.background,
124
- borderRadius: e.borderRadius,
125
- padding: e.padding,
126
- margin: e.margin
127
- });
128
- for (let e in n) t[e] = n[e];
129
- return t;
130
- };
131
- return () => /* @__PURE__ */ r("view", {
132
- class: e.class,
133
- style: n(),
134
- children: t.default?.()
135
- });
136
- }), m = e(({ props: e, slots: t }) => {
137
- let n = () => {
138
- let t = {
139
- display: "flex",
140
- justifyContent: "center",
141
- alignItems: "center"
142
- }, n = d({
143
- width: e.width,
144
- height: e.height,
145
- flex: e.flex,
146
- background: e.background,
147
- borderRadius: e.borderRadius
148
- });
149
- for (let e in n) t[e] = n[e];
150
- return t;
151
- };
152
- return () => /* @__PURE__ */ r("view", {
153
- class: e.class,
154
- style: n(),
155
- children: t.default?.()
156
- });
157
- }), h = e(({ props: e }) => {
158
- let t = () => e.size === void 0 ? { flex: 1 } : {
159
- width: e.size,
160
- height: e.size
161
- };
162
- return () => /* @__PURE__ */ r("view", {
163
- class: e.class,
164
- style: t()
165
- });
166
- }), g = e(({ props: e, slots: t }) => {
167
- let n = () => {
168
- let t = {};
169
- 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
- return () => {
172
- let i = e.direction ?? "vertical";
173
- return /* @__PURE__ */ r("scroll-view", {
174
- class: e.class,
175
- style: n(),
176
- "scroll-orientation": i,
177
- "scroll-y": i === "vertical" ? !0 : void 0,
178
- "scroll-x": i === "horizontal" ? !0 : void 0,
179
- "show-scrollbar": e.showScrollbar,
180
- bounces: e.bounces,
181
- children: t.default?.()
182
- });
183
- };
184
- }), _ = e(({ props: e }) => {
185
- let t = () => {
186
- let t = [e.vertical ? "divider-vertical" : "divider"];
187
- return e.class && t.push(e.class), t.join(" ");
188
- }, n = () => {
189
- let t = {};
190
- 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
- return () => /* @__PURE__ */ r("view", {
193
- class: t(),
194
- style: n()
195
- });
196
- }), v = {
197
- xs: "input-xs",
198
- sm: "input-sm",
199
- md: "",
200
- lg: "input-lg"
201
- }, y = e(({ props: e }) => {
202
- let t = () => {
203
- let t = ["input"];
204
- 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 = v[e.size];
206
- n && t.push(n);
207
- }
208
- return e.class && t.push(e.class), t.join(" ");
209
- };
210
- return () => /* @__PURE__ */ r("input", {
211
- class: t(),
212
- placeholder: e.placeholder,
213
- type: e.type ?? "text",
214
- disabled: e.disabled,
215
- model: e.model
216
- });
217
- }), b = {
218
- xs: 10,
219
- sm: 16,
220
- md: 20,
221
- lg: 24
222
- }, x = e(({ props: e, emit: t }) => {
223
- let n = () => {
224
- let t = ["toggle"], n = e.size ?? "md";
225
- 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
- return () => {
228
- let i = !!e.checked, a = e.size ?? "md", o = i ? b[a] : 0;
229
- return /* @__PURE__ */ r("view", {
230
- class: n(),
231
- bindtap: () => {
232
- e.disabled || t("change", !i);
233
- },
234
- children: /* @__PURE__ */ r("view", {
235
- class: "toggle-thumb",
236
- style: { transform: `translateX(${o}px)` }
237
- })
238
- });
239
- };
240
- }), S = {
241
- xs: 10,
242
- sm: 12,
243
- md: 14,
244
- lg: 19
245
- }, C = e(({ props: e, emit: t }) => {
246
- let n = () => {
247
- let t = ["checkbox"], n = e.size ?? "md";
248
- 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
- return () => {
251
- let i = !!e.checked, a = e.size ?? "md";
252
- return /* @__PURE__ */ r("view", {
253
- class: n(),
254
- bindtap: () => {
255
- e.disabled || t("change", !i);
256
- },
257
- children: i ? /* @__PURE__ */ r("text", {
258
- class: "checkbox-mark",
259
- style: { fontSize: S[a] },
260
- children: "✓"
261
- }) : null
262
- });
263
- };
264
- }), w = e(({ props: e, emit: t }) => {
265
- let a = n({ open: !1 }), o = () => {
266
- let t = ["select"];
267
- 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
- }, s = () => {
269
- let t = (e.options ?? []).find((t) => t.value === e.value);
270
- return t ? t.label : e.placeholder ?? "Select...";
271
- };
272
- return () => /* @__PURE__ */ i("view", {
273
- style: {
274
- position: "relative",
275
- opacity: e.disabled ? .5 : 1
276
- },
277
- children: [/* @__PURE__ */ i("view", {
278
- class: o(),
279
- bindtap: () => {
280
- e.disabled || (a.open = !a.open);
281
- },
282
- children: [/* @__PURE__ */ r("text", { children: s() }), /* @__PURE__ */ r("view", {
283
- style: { marginLeft: "auto" },
284
- children: /* @__PURE__ */ r("text", { children: a.open ? "▲" : "▼" })
285
- })]
286
- }), a.open && !e.disabled && /* @__PURE__ */ r("view", {
287
- class: "select-dropdown",
288
- style: {
289
- position: "absolute",
290
- top: "100%",
291
- left: 0,
292
- right: 0,
293
- zIndex: 10
294
- },
295
- children: (e.options ?? []).map((n) => /* @__PURE__ */ r("view", {
296
- class: `select-option${n.value === e.value ? " select-option-active" : ""}`,
297
- bindtap: () => {
298
- t("change", n.value), a.open = !1;
299
- },
300
- children: /* @__PURE__ */ r("text", { children: n.label })
301
- }))
302
- })]
303
- });
304
- }), T = e(({ props: e, emit: t }) => {
305
- let n = () => {
306
- let t = ["radio"];
307
- 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
- return () => /* @__PURE__ */ i("view", {
310
- style: {
311
- flexDirection: "row",
312
- alignItems: "center",
313
- gap: 8,
314
- opacity: e.disabled ? .5 : 1
315
- },
316
- bindtap: () => {
317
- !e.disabled && e.value != null && t("select", e.value);
318
- },
319
- children: [/* @__PURE__ */ r("view", {
320
- class: n(),
321
- children: e.checked && /* @__PURE__ */ r("view", { class: "radio-mark" })
322
- }), e.label && /* @__PURE__ */ r("text", { children: e.label })]
323
- });
324
- }), E = t(e(({ props: e, slots: t }) => () => /* @__PURE__ */ r("view", {
325
- class: e.class ?? "",
326
- style: { gap: 8 },
327
- children: t.default?.()
328
- })), { Item: T }), D = {
329
- xs: "textarea-xs",
330
- sm: "textarea-sm",
331
- md: "",
332
- lg: "textarea-lg"
333
- }, O = e(({ props: e }) => {
334
- let t = () => {
335
- let t = ["textarea"];
336
- 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 = D[e.size];
338
- n && t.push(n);
339
- }
340
- return e.class && t.push(e.class), t.join(" ");
341
- }, n = () => (e.rows ?? 3) * 20 + 16;
342
- return () => /* @__PURE__ */ r("textarea", {
343
- class: t(),
344
- placeholder: e.placeholder,
345
- disabled: e.disabled,
346
- model: e.model,
347
- style: { height: n() }
348
- });
349
- }), k = e(({ props: e, slots: t }) => () => /* @__PURE__ */ i("view", {
350
- class: ["form-control", e.class].filter(Boolean).join(" "),
351
- style: { gap: 4 },
352
- children: [
353
- e.label && /* @__PURE__ */ r("view", {
354
- class: "label",
355
- children: /* @__PURE__ */ r("text", {
356
- class: "label-text",
357
- children: e.required ? `${e.label} *` : e.label
358
- })
359
- }),
360
- t.default?.(),
361
- e.error && /* @__PURE__ */ r("view", {
362
- class: "label",
363
- children: /* @__PURE__ */ r("text", {
364
- class: "label-text-error",
365
- children: e.error
366
- })
367
- })
368
- ]
369
- })), A = e(({ props: e, slots: t }) => {
370
- let n = () => {
371
- let t = ["badge"];
372
- 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
- return () => /* @__PURE__ */ r("view", {
375
- class: n(),
376
- children: t.default?.()
377
- });
378
- }), j = e(({ props: e, slots: t }) => {
379
- let n = () => {
380
- let t = ["alert"];
381
- return e.variant && t.push(`alert-${e.variant}`), e.class && t.push(e.class), t.join(" ");
382
- };
383
- return () => /* @__PURE__ */ r("view", {
384
- class: n(),
385
- children: t.default?.()
386
- });
387
- }), M = e(({ props: e }) => {
388
- let t = () => {
389
- let t = ["progress"];
390
- return e.color && t.push(`progress-${e.color}`), e.class && t.push(e.class), t.join(" ");
391
- };
392
- return () => {
393
- let n = e.max ?? 100, i = Math.min(Math.max((e.value ?? 0) / n, 0), 1) * 100;
394
- return /* @__PURE__ */ r("view", {
395
- class: t(),
396
- children: /* @__PURE__ */ r("view", {
397
- class: "progress-bar",
398
- style: { width: `${i}%` }
399
- })
400
- });
401
- };
402
- }), N = t(e(({ props: e, slots: t }) => () => e.open ? /* @__PURE__ */ r("view", {
403
- class: "modal-overlay",
404
- bindtap: () => {
405
- e.onClose?.();
406
- },
407
- children: /* @__PURE__ */ r("view", {
408
- class: `modal-box${e.class ? " " + e.class : ""}`,
409
- bindtap: (e) => {
410
- e?.stopPropagation?.();
411
- },
412
- children: t.default?.()
413
- })
414
- }) : /* @__PURE__ */ r("view", { style: { display: "none" } })), {
415
- Header: e(({ props: e, slots: t }) => () => /* @__PURE__ */ r("view", {
416
- class: `modal-header${e.class ? " " + e.class : ""}`,
417
- children: t.default?.()
418
- })),
419
- Body: e(({ props: e, slots: t }) => () => /* @__PURE__ */ r("view", {
420
- class: `modal-body${e.class ? " " + e.class : ""}`,
421
- children: t.default?.()
422
- })),
423
- Actions: e(({ props: e, slots: t }) => () => /* @__PURE__ */ r("view", {
424
- class: `modal-action${e.class ? " " + e.class : ""}`,
425
- children: t.default?.()
426
- }))
427
- }), P = e(({ props: e }) => () => {
428
- let t = {};
429
- if (e.width != null && (t.width = e.width), e.height != null && (t.height = e.height), e.circle) {
430
- let n = e.width ?? e.height ?? 48;
431
- t.width = n, t.height = n, t.borderRadius = typeof n == "number" ? n / 2 : "50%";
432
- }
433
- return /* @__PURE__ */ r("view", {
434
- class: `skeleton${e.class ? " " + e.class : ""}`,
435
- style: t
436
- });
437
- }), F = t(e(({ props: e, slots: t }) => () => /* @__PURE__ */ r("view", {
438
- class: `steps${e.vertical ?? !1 ? " steps-vertical" : " steps-horizontal"}${e.class ? " " + e.class : ""}`,
439
- children: t.default?.()
440
- })), { Step: e(({ props: e, slots: t }) => () => {
441
- let n = e.color, a = n ? ` step-${n}` : "";
442
- return /* @__PURE__ */ i("view", {
443
- class: `step${a}${e.class ? " " + e.class : ""}`,
444
- children: [/* @__PURE__ */ r("view", {
445
- class: `step-indicator${a}`,
446
- children: e.content ? /* @__PURE__ */ r("text", {
447
- style: { fontSize: 14 },
448
- children: e.content
449
- }) : null
450
- }), t.default?.()]
451
- });
452
- }) }), I = t(e(({ props: e, slots: t }) => () => /* @__PURE__ */ r("view", {
453
- class: `tabs${e.class ? " " + e.class : ""}`,
454
- children: t.default?.()
455
- })), { Tab: e(({ props: e, slots: t }) => () => /* @__PURE__ */ i("view", {
456
- class: `tab${e.active ?? !1 ? " tab-active" : ""}${e.class ? " " + e.class : ""}`,
457
- bindtap: () => {
458
- e.onPress?.();
459
- },
460
- children: [t.default?.(), e.label ? /* @__PURE__ */ r("text", { children: e.label }) : null]
461
- })) }), L = {
462
- xs: 24,
463
- sm: 32,
464
- md: 48,
465
- lg: 64,
466
- xl: 96
467
- }, R = {
468
- xs: 10,
469
- sm: 12,
470
- md: 18,
471
- lg: 24,
472
- xl: 36
473
- }, z = e(({ props: e }) => () => {
474
- let t = e.size || "md", n = L[t], i = ["avatar"];
475
- e.online && i.push("online"), e.offline && i.push("offline"), e.placeholder && !e.src && i.push("placeholder"), e.class && i.push(e.class);
476
- let a = e.rounded, o = a === "full" || a === !0 ? n / 2 : 8, s = {
477
- width: n,
478
- height: n,
479
- borderRadius: o,
480
- overflow: "hidden",
481
- alignItems: "center",
482
- justifyContent: "center",
483
- display: "flex"
484
- };
485
- return e.src ? /* @__PURE__ */ r("view", {
486
- class: i.join(" "),
487
- children: /* @__PURE__ */ r("view", {
488
- style: s,
489
- children: /* @__PURE__ */ r("image", {
490
- src: e.src,
491
- style: {
492
- width: n,
493
- height: n,
494
- borderRadius: o
495
- }
496
- })
497
- })
498
- }) : /* @__PURE__ */ r("view", {
499
- class: i.join(" "),
500
- children: /* @__PURE__ */ r("view", {
501
- class: "avatar-placeholder",
502
- style: s,
503
- children: /* @__PURE__ */ r("text", {
504
- style: { fontSize: R[t] },
505
- children: e.placeholder || "?"
506
- })
507
- })
508
- });
509
- }), B = {
510
- xs: "text-xs",
511
- sm: "text-sm",
512
- base: "text-base",
513
- lg: "text-lg",
514
- xl: "text-xl",
515
- "2xl": "text-2xl",
516
- "3xl": "text-3xl"
517
- }, V = {
518
- light: "font-light",
519
- normal: "font-normal",
520
- medium: "font-medium",
521
- semibold: "font-semibold",
522
- bold: "font-bold"
523
- }, H = e(({ props: e, slots: t }) => {
524
- let n = () => {
525
- let t = [];
526
- return e.size && t.push(B[e.size]), e.weight && t.push(V[e.weight]), e.color && t.push(`text-${e.color}`), e.class && t.push(e.class), t.join(" ");
527
- };
528
- return () => /* @__PURE__ */ r("text", {
529
- class: n(),
530
- children: t.default?.()
531
- });
532
- }), U = {
533
- 1: "text-3xl font-bold",
534
- 2: "text-2xl font-bold",
535
- 3: "text-xl font-semibold",
536
- 4: "text-lg font-semibold",
537
- 5: "text-base font-semibold",
538
- 6: "text-sm font-semibold"
539
- }, W = e(({ props: e, slots: t }) => {
540
- let n = () => {
541
- let t = [U[e.level ?? 2], "text-base-content"];
542
- return e.class && t.push(e.class), t.join(" ");
543
- };
544
- return () => /* @__PURE__ */ r("text", {
545
- class: n(),
546
- children: t.default?.()
547
- });
548
- });
549
- //#endregion
550
- export { j as Alert, z as Avatar, A as Badge, c as Button, l as Card, m as Center, C as Checkbox, p as Col, _ as Divider, k as FormField, W as Heading, y as Input, a as Loading, N as Modal, M as Progress, E as Radio, f as Row, g as ScrollView, w as Select, P as Skeleton, h as Spacer, F as Steps, I as Tabs, H as Text, O as Textarea, x as Toggle };
551
-
552
- //# 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';
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx } from "@sigx/lynx/jsx-runtime";
2
+ import { component, compound } from '@sigx/lynx';
3
+ const _Card = component(({ props, slots }) => {
4
+ const getClasses = () => {
5
+ const c = ['card'];
6
+ if (props.bordered)
7
+ c.push('card-bordered');
8
+ if (props.compact)
9
+ c.push('card-compact');
10
+ if (props.shadow === true)
11
+ c.push('shadow-md');
12
+ else if (props.shadow === 'sm')
13
+ c.push('shadow-sm');
14
+ else if (props.shadow === 'md')
15
+ c.push('shadow-md');
16
+ else if (props.shadow === 'lg')
17
+ c.push('shadow-lg');
18
+ else if (props.shadow === undefined)
19
+ c.push('shadow-md');
20
+ if (props.class)
21
+ c.push(props.class);
22
+ return c.join(' ');
23
+ };
24
+ return () => _jsx("view", { class: getClasses(), children: slots.default?.() });
25
+ });
26
+ const CardBody = component(({ props, slots }) => {
27
+ return () => (_jsx("view", { class: `card-body${props.class ? ' ' + props.class : ''}`, children: slots.default?.() }));
28
+ });
29
+ const CardTitle = component(({ props, slots }) => {
30
+ return () => (_jsx("text", { class: `card-title${props.class ? ' ' + props.class : ''}`, children: slots.default?.() }));
31
+ });
32
+ const CardActions = component(({ props, slots }) => {
33
+ return () => (_jsx("view", { class: `card-actions${props.class ? ' ' + props.class : ''}`, children: slots.default?.() }));
34
+ });
35
+ export const Card = compound(_Card, {
36
+ Body: CardBody,
37
+ Title: CardTitle,
38
+ Actions: CardActions,
39
+ });
@@ -1,5 +1,6 @@
1
1
  import { type Define } from '@sigx/lynx';
2
- export type CenterProps = Define.Prop<'width', number | string, false> & Define.Prop<'height', number | string, false> & Define.Prop<'flex', number, false> & Define.Prop<'background', string, false> & Define.Prop<'borderRadius', number, false> & Define.Prop<'class', string, false> & Define.Slot<'default'>;
2
+ import { type BackgroundValue } from '../shared/styles.js';
3
+ export type CenterProps = Define.Prop<'width', number | string, false> & Define.Prop<'height', number | string, false> & Define.Prop<'flex', number, false> & Define.Prop<'background', BackgroundValue, false> & Define.Prop<'borderRadius', number, false> & Define.Prop<'class', string, false> & Define.Slot<'default'>;
3
4
  export declare const Center: import("@sigx/runtime-core").ComponentFactory<CenterProps, void, {
4
5
  default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
5
6
  }>;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "@sigx/lynx/jsx-runtime";
2
+ import { component } from '@sigx/lynx';
3
+ import { resolveBoxStyle } from '../shared/styles.js';
4
+ export const Center = component(({ props, slots }) => {
5
+ const getStyle = () => {
6
+ const style = {
7
+ display: 'flex',
8
+ justifyContent: 'center',
9
+ alignItems: 'center',
10
+ };
11
+ const box = resolveBoxStyle({
12
+ width: props.width,
13
+ height: props.height,
14
+ flex: props.flex,
15
+ background: props.background,
16
+ borderRadius: props.borderRadius,
17
+ });
18
+ for (const key in box) {
19
+ style[key] = box[key];
20
+ }
21
+ return style;
22
+ };
23
+ return () => (_jsx("view", { class: props.class, style: getStyle(), children: slots.default?.() }));
24
+ });
@@ -1,6 +1,6 @@
1
1
  import { type Define } from '@sigx/lynx';
2
- import { type SpacingValue } from '../shared/styles.js';
3
- export type ColProps = Define.Prop<'gap', number, false> & Define.Prop<'align', 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline', false> & Define.Prop<'justify', 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly', false> & Define.Prop<'wrap', boolean, false> & Define.Prop<'padding', SpacingValue, false> & Define.Prop<'margin', SpacingValue, false> & Define.Prop<'width', number | string, false> & Define.Prop<'height', number | string, false> & Define.Prop<'flex', number, false> & Define.Prop<'background', string, false> & Define.Prop<'borderRadius', number, false> & Define.Prop<'class', string, false> & Define.Slot<'default'>;
2
+ import { type SpacingValue, type BackgroundValue } from '../shared/styles.js';
3
+ export type ColProps = Define.Prop<'gap', number, false> & Define.Prop<'align', 'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline', false> & Define.Prop<'justify', 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly', false> & Define.Prop<'wrap', boolean, false> & Define.Prop<'padding', SpacingValue, false> & Define.Prop<'margin', SpacingValue, false> & Define.Prop<'width', number | string, false> & Define.Prop<'height', number | string, false> & Define.Prop<'flex', number, false> & Define.Prop<'background', BackgroundValue, false> & Define.Prop<'borderRadius', number, false> & Define.Prop<'class', string, false> & Define.Slot<'default'>;
4
4
  export declare const Col: import("@sigx/runtime-core").ComponentFactory<ColProps, void, {
5
5
  default: () => import("@sigx/runtime-core").JSXElement | import("@sigx/runtime-core").JSXElement[] | null;
6
6
  }>;