@stacksjs/stx 0.2.413 → 0.2.415
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/appearance-bootstrap.js +1 -1
- package/dist/binding-manifest.d.ts +1 -1
- package/dist/builtins/image-delivery.js +19 -11
- package/dist/bundle-analyzer.js +20 -20
- package/dist/chunk-020xyn9q.js +3 -0
- package/dist/chunk-04jhmfbz.js +2 -0
- package/dist/chunk-0pnj3zt2.js +2 -0
- package/dist/{chunk-bwjxk1dw.js → chunk-0zaess6f.js} +29 -29
- package/dist/chunk-1098mas0.js +2 -0
- package/dist/chunk-169n1vpx.js +12 -0
- package/dist/chunk-18vmfkcc.js +2 -0
- package/dist/chunk-1b6t12hd.js +2 -0
- package/dist/chunk-1xdzcy9d.js +14 -0
- package/dist/chunk-1zs30k3y.js +2 -0
- package/dist/chunk-2ce7f416.js +2 -0
- package/dist/chunk-340a824p.js +2 -0
- package/dist/chunk-393341w7.js +2 -0
- package/dist/chunk-39g1134q.js +2 -0
- package/dist/chunk-3efw27as.js +2785 -0
- package/dist/chunk-3kthfs03.js +3 -0
- package/dist/chunk-3qn1wcdg.js +2 -0
- package/dist/chunk-3s2vnqcf.js +2 -0
- package/dist/chunk-42wbs8vq.js +17 -0
- package/dist/chunk-4bjravgk.js +2 -0
- package/dist/chunk-5gsxpaqk.js +2 -0
- package/dist/{chunk-bwsxym3d.js → chunk-5qns2sdz.js} +17 -17
- package/dist/chunk-6cfa3g0r.js +2 -0
- package/dist/{chunk-bjar18jd.js → chunk-6h38kkjf.js} +46 -52
- package/dist/chunk-6hc5vz20.js +3 -0
- package/dist/chunk-6q6g76vg.js +499 -0
- package/dist/chunk-74j18qk0.js +930 -0
- package/dist/chunk-752hw7cd.js +4 -0
- package/dist/{chunk-kgd8kchy.js → chunk-765e1s44.js} +11 -76
- package/dist/chunk-7gkv67ky.js +4 -0
- package/dist/chunk-7z2ra0yf.js +2 -0
- package/dist/chunk-8eqrwj1k.js +20 -0
- package/dist/chunk-8nhshfz6.js +5 -0
- package/dist/chunk-92ps1xpk.js +2 -0
- package/dist/chunk-96k8s808.js +3 -0
- package/dist/chunk-9amp82bx.js +7 -0
- package/dist/chunk-9g27ybyr.js +3 -0
- package/dist/chunk-9p9qkbtg.js +3 -0
- package/dist/{chunk-xq1acw1r.js → chunk-9pt8fd2n.js} +13 -13
- package/dist/{chunk-24zher49.js → chunk-9vrja6vp.js} +4 -4
- package/dist/chunk-9xrbve19.js +2 -0
- package/dist/chunk-a688m6js.js +3 -0
- package/dist/chunk-ak1cgcah.js +5 -0
- package/dist/{chunk-4m7ajama.js → chunk-amd6ey3t.js} +14 -14
- package/dist/chunk-amtr3rmf.js +11 -0
- package/dist/chunk-atws6p5s.js +2 -0
- package/dist/chunk-b84h16er.js +61 -0
- package/dist/chunk-b98be3yp.js +32 -0
- package/dist/{chunk-hx998w7n.js → chunk-bay9s6rs.js} +13 -13
- package/dist/chunk-ce1sejr3.js +3 -0
- package/dist/chunk-cg8hg6cs.js +3 -0
- package/dist/{chunk-4f9zyfdw.js → chunk-czxt605c.js} +4 -5
- package/dist/chunk-dd8cja4h.js +2 -0
- package/dist/chunk-dgdm3hy3.js +2 -0
- package/dist/chunk-e9hs7kk6.js +12 -0
- package/dist/chunk-eed4fwps.js +3 -0
- package/dist/chunk-ej9j6k1q.js +3 -0
- package/dist/chunk-et0rr8c7.js +3 -0
- package/dist/chunk-f1sxycmv.js +2 -0
- package/dist/chunk-f46qsp4m.js +4 -0
- package/dist/chunk-fbcv4fes.js +2 -0
- package/dist/{chunk-bjcsc6wx.js → chunk-fh1qrp68.js} +21 -21
- package/dist/chunk-fjs0a8h7.js +2 -0
- package/dist/chunk-fpfzm238.js +2 -0
- package/dist/chunk-fr2txj8q.js +829 -0
- package/dist/{chunk-xssw417m.js → chunk-ft4p6d28.js} +14 -14
- package/dist/chunk-fyzajkrx.js +2 -0
- package/dist/chunk-fzapbw9p.js +3 -0
- package/dist/chunk-g03s93qr.js +3 -0
- package/dist/chunk-g186znp9.js +33 -0
- package/dist/chunk-gawrg4gb.js +216 -0
- package/dist/chunk-gc1drn2p.js +2 -0
- package/dist/chunk-gea5hf0v.js +2 -0
- package/dist/chunk-gqv3ta5d.js +2 -0
- package/dist/chunk-h6kp2m9r.js +2 -0
- package/dist/chunk-h6zsqb9r.js +3 -0
- package/dist/{chunk-2snqdnk9.js → chunk-h85hrwkq.js} +13 -13
- package/dist/chunk-hbxz85wy.js +2 -0
- package/dist/chunk-hepd9qgx.js +6 -0
- package/dist/chunk-hhnw2sn3.js +2 -0
- package/dist/chunk-hjg3ndgh.js +2 -0
- package/dist/chunk-hk1mj4tz.js +2 -0
- package/dist/{chunk-smcj3442.js → chunk-hkrmcbwy.js} +79 -79
- package/dist/chunk-hn9pkyv8.js +2 -0
- package/dist/chunk-hpgr4qgp.js +2 -0
- package/dist/chunk-hrbbbtbn.js +2 -0
- package/dist/chunk-j03revz2.js +8 -0
- package/dist/chunk-j9qcrwbg.js +2 -0
- package/dist/chunk-jk4njz0w.js +2 -0
- package/dist/chunk-jmabeqfq.js +2 -0
- package/dist/chunk-jnkrn913.js +4 -0
- package/dist/chunk-jp10q90g.js +2 -0
- package/dist/chunk-jt0n43mk.js +2 -0
- package/dist/chunk-kjbv8a3m.js +2 -0
- package/dist/chunk-m1vdghnx.js +2 -0
- package/dist/chunk-m4sk62wb.js +5 -0
- package/dist/chunk-md8rqn48.js +30 -0
- package/dist/chunk-mp6hy8g4.js +2 -0
- package/dist/chunk-nc8my58s.js +2 -0
- package/dist/chunk-ngc2wke4.js +3 -0
- package/dist/chunk-nn2vstke.js +2 -0
- package/dist/chunk-nppdrf0x.js +2 -0
- package/dist/chunk-p2v2a68k.js +2 -0
- package/dist/chunk-pazfr1a1.js +2 -0
- package/dist/{chunk-qn5srnj3.js → chunk-pbh4smw3.js} +16 -16
- package/dist/chunk-pdb5fw3r.js +2 -0
- package/dist/chunk-pdt69hpb.js +2 -0
- package/dist/chunk-pgzvyrv6.js +29 -0
- package/dist/chunk-px7fvbj6.js +3 -0
- package/dist/chunk-q6vrb2pe.js +2 -0
- package/dist/chunk-q7qchkvk.js +2 -0
- package/dist/chunk-q9bdh4s5.js +8 -0
- package/dist/chunk-qghxz7jm.js +194 -0
- package/dist/chunk-r3f9jcf7.js +5 -0
- package/dist/chunk-re8b5r9x.js +3 -0
- package/dist/chunk-s5xezjps.js +3 -0
- package/dist/chunk-sd321bn3.js +2 -0
- package/dist/chunk-shr559s7.js +3 -0
- package/dist/chunk-t4hzprsm.js +3 -0
- package/dist/chunk-t5pvq5mx.js +2 -0
- package/dist/{chunk-pv3d7sfn.js → chunk-t61vdbje.js} +89 -89
- package/dist/chunk-tafqyf2g.js +2033 -0
- package/dist/chunk-tfexmdkt.js +3 -0
- package/dist/chunk-thyt8ed8.js +6 -0
- package/dist/chunk-v91p6ekp.js +24 -0
- package/dist/chunk-vgvtnwxa.js +4 -0
- package/dist/chunk-w72qx0eb.js +2 -0
- package/dist/chunk-wfy1zq53.js +30 -0
- package/dist/chunk-wzx0164n.js +18 -0
- package/dist/chunk-x0q32ees.js +3 -0
- package/dist/chunk-xfp7k0v8.js +64 -0
- package/dist/chunk-xtvf6n6f.js +4 -0
- package/dist/chunk-xwzvfqcb.js +2 -0
- package/dist/chunk-y1cmjvk3.js +43 -0
- package/dist/chunk-y5310237.js +311 -0
- package/dist/chunk-ya0qecph.js +27 -0
- package/dist/chunk-yazk54jr.js +8 -0
- package/dist/chunk-ydjfar14.js +2 -0
- package/dist/chunk-ym95v4nc.js +3 -0
- package/dist/chunk-z0g9jvv0.js +40 -0
- package/dist/chunk-z23kaxq6.js +2 -0
- package/dist/chunk-z8xn5ta3.js +2 -0
- package/dist/{chunk-8sdhs0zk.js → chunk-zhxdpzga.js} +4 -4
- package/dist/cli.js +110 -110
- package/dist/craft-entry.js +7 -7
- package/dist/craft.js +7 -7
- package/dist/database.js +2 -2
- package/dist/image-optimization/component.js +4 -4
- package/dist/media/image/component.js +5 -5
- package/dist/media/protected/component.js +2 -2
- package/dist/media/video/index.js +4 -4
- package/dist/native/bridge/protocol.d.ts +325 -0
- package/dist/native/bridge/protocol.js +219 -0
- package/dist/native/cli.d.ts +24 -0
- package/dist/native/cli.js +52 -0
- package/dist/native/compiler/bundle.d.ts +41 -0
- package/dist/native/compiler/bundle.js +90 -0
- package/dist/native/compiler/client-script.d.ts +8 -0
- package/dist/native/compiler/client-script.js +31 -0
- package/dist/native/compiler/codegen.d.ts +10 -0
- package/dist/native/compiler/codegen.js +145 -0
- package/dist/native/compiler/headwind-to-style.d.ts +395 -0
- package/dist/native/compiler/headwind-to-style.js +1163 -0
- package/dist/native/compiler/html-to-ir.d.ts +41 -0
- package/dist/native/compiler/html-to-ir.js +411 -0
- package/dist/native/compiler/icons.d.ts +220 -0
- package/dist/native/compiler/icons.js +208 -0
- package/dist/native/compiler/ir.d.ts +234 -0
- package/dist/native/compiler/ir.js +15 -0
- package/dist/native/compiler/parser.d.ts +88 -0
- package/dist/native/compiler/parser.js +753 -0
- package/dist/native/compiler/render-screen.d.ts +26 -0
- package/dist/native/compiler/render-screen.js +31 -0
- package/dist/native/components/primitives.d.ts +291 -0
- package/dist/native/components/primitives.js +22 -0
- package/dist/native/hot-reload/client.d.ts +62 -0
- package/dist/native/hot-reload/client.js +324 -0
- package/dist/native/index.d.ts +90 -0
- package/dist/native/index.js +34 -0
- package/dist/native/primitives/ActivityIndicator.stx +5 -0
- package/dist/native/primitives/Button.stx +5 -0
- package/dist/native/primitives/DatePicker.stx +5 -0
- package/dist/native/primitives/FlatList.stx +5 -0
- package/dist/native/primitives/Image.stx +5 -0
- package/dist/native/primitives/ImageBackground.stx +5 -0
- package/dist/native/primitives/KeyboardAvoidingView.stx +5 -0
- package/dist/native/primitives/Modal.stx +5 -0
- package/dist/native/primitives/Picker.stx +5 -0
- package/dist/native/primitives/Pressable.stx +5 -0
- package/dist/native/primitives/RefreshControl.stx +5 -0
- package/dist/native/primitives/SafeAreaView.stx +5 -0
- package/dist/native/primitives/ScrollView.stx +5 -0
- package/dist/native/primitives/SectionList.stx +5 -0
- package/dist/native/primitives/Slider.stx +5 -0
- package/dist/native/primitives/StatusBar.stx +5 -0
- package/dist/native/primitives/Switch.stx +5 -0
- package/dist/native/primitives/Text.stx +5 -0
- package/dist/native/primitives/TextInput.stx +5 -0
- package/dist/native/primitives/TouchableHighlight.stx +5 -0
- package/dist/native/primitives/TouchableOpacity.stx +5 -0
- package/dist/native/primitives/View.stx +5 -0
- package/dist/native/runtime/craft.d.ts +75 -0
- package/dist/native/runtime/craft.js +0 -0
- package/dist/native/runtime/entry.d.ts +1 -0
- package/dist/native/runtime/entry.js +3 -0
- package/dist/native/runtime/index.d.ts +45 -0
- package/dist/native/runtime/index.js +165 -0
- package/dist/native/runtime/native-host.d.ts +33 -0
- package/dist/native/runtime/native-host.js +184 -0
- package/dist/native/runtime/screen.d.ts +43 -0
- package/dist/native/runtime/screen.js +808 -0
- package/dist/pwa/service-worker.js +1 -1
- package/dist/pwa/workbox.js +1 -1
- package/dist/pwa.js +8 -8
- package/dist/site-url.d.ts +1 -1
- package/dist/ssg.js +53 -53
- package/dist/visual-testing.js +42 -42
- package/dist/web-components/reactive-generator.js +2 -2
- package/package.json +9 -5
- package/dist/chunk-0btmm4m2.js +0 -147
- package/dist/chunk-0c2h69k2.js +0 -4
- package/dist/chunk-0d0qeqvv.js +0 -2
- package/dist/chunk-0psndabd.js +0 -2
- package/dist/chunk-0qv8yf53.js +0 -2
- package/dist/chunk-0vkxyvsd.js +0 -2
- package/dist/chunk-0we9nw1d.js +0 -3
- package/dist/chunk-0xqdmemy.js +0 -3
- package/dist/chunk-0y46fbkx.js +0 -3
- package/dist/chunk-158wqccn.js +0 -4422
- package/dist/chunk-1cyxbb8y.js +0 -16
- package/dist/chunk-1enwnh2a.js +0 -2
- package/dist/chunk-213pzm0d.js +0 -3
- package/dist/chunk-21hzqyja.js +0 -12
- package/dist/chunk-266t58b8.js +0 -5
- package/dist/chunk-27fgag95.js +0 -4
- package/dist/chunk-2a9n102n.js +0 -2
- package/dist/chunk-2eqzrczk.js +0 -2
- package/dist/chunk-2ke37m54.js +0 -14
- package/dist/chunk-35ds08e7.js +0 -3
- package/dist/chunk-3mtwkjcg.js +0 -2
- package/dist/chunk-4xr8zwkp.js +0 -2
- package/dist/chunk-58v77x2c.js +0 -2
- package/dist/chunk-5mhq8605.js +0 -2
- package/dist/chunk-5se8xt9e.js +0 -64
- package/dist/chunk-5zh0h080.js +0 -2
- package/dist/chunk-62435225.js +0 -2
- package/dist/chunk-6kdrncsx.js +0 -30
- package/dist/chunk-6n2rr3x7.js +0 -2
- package/dist/chunk-6xk87qf2.js +0 -30
- package/dist/chunk-72rwcbp6.js +0 -3
- package/dist/chunk-76w34xne.js +0 -3
- package/dist/chunk-7ekd7zj9.js +0 -2
- package/dist/chunk-7pr3wdd5.js +0 -3
- package/dist/chunk-7rxvafwc.js +0 -24
- package/dist/chunk-7tnwfa7w.js +0 -8
- package/dist/chunk-8c5je0wf.js +0 -2
- package/dist/chunk-8dz6nyvx.js +0 -2
- package/dist/chunk-98zj3fv2.js +0 -7
- package/dist/chunk-9e8t0twa.js +0 -3
- package/dist/chunk-9fqp72ze.js +0 -5
- package/dist/chunk-anydpa34.js +0 -3
- package/dist/chunk-ay6zjq8v.js +0 -3
- package/dist/chunk-az4v4ard.js +0 -3
- package/dist/chunk-ba5erggg.js +0 -2
- package/dist/chunk-bnagrdz6.js +0 -2
- package/dist/chunk-by8wghtf.js +0 -2
- package/dist/chunk-cd7h4q51.js +0 -2
- package/dist/chunk-cjmv8hgp.js +0 -33
- package/dist/chunk-cthf912y.js +0 -2
- package/dist/chunk-cxbpmwq5.js +0 -4
- package/dist/chunk-d3sy16qn.js +0 -2
- package/dist/chunk-dh6s7mrj.js +0 -1199
- package/dist/chunk-dm2nzg7a.js +0 -2
- package/dist/chunk-e2sgcnxc.js +0 -2
- package/dist/chunk-e3b7jj74.js +0 -2
- package/dist/chunk-ec4wq2sv.js +0 -6
- package/dist/chunk-ekzg97dn.js +0 -29
- package/dist/chunk-epjt342x.js +0 -2
- package/dist/chunk-eqe26g14.js +0 -18
- package/dist/chunk-ev0v1yma.js +0 -2
- package/dist/chunk-f53psr2y.js +0 -5
- package/dist/chunk-f8p69dsg.js +0 -3
- package/dist/chunk-f95drhdb.js +0 -194
- package/dist/chunk-ff5a6hvb.js +0 -17
- package/dist/chunk-fs5fy4h8.js +0 -2
- package/dist/chunk-fzsygce3.js +0 -2
- package/dist/chunk-g465x63k.js +0 -2
- package/dist/chunk-g708ekh1.js +0 -2
- package/dist/chunk-gcr9e83g.js +0 -11
- package/dist/chunk-gdmyrsr8.js +0 -4
- package/dist/chunk-gkms2ngq.js +0 -2
- package/dist/chunk-gnfywmgs.js +0 -7
- package/dist/chunk-hpf8kq7e.js +0 -2
- package/dist/chunk-j4x3faf8.js +0 -2
- package/dist/chunk-jkavtw9f.js +0 -2
- package/dist/chunk-kg1rdena.js +0 -3
- package/dist/chunk-km91wx0v.js +0 -2
- package/dist/chunk-kmsyvaex.js +0 -8
- package/dist/chunk-mrahwn5v.js +0 -8
- package/dist/chunk-nk3czvnk.js +0 -2
- package/dist/chunk-nmw4eewb.js +0 -2
- package/dist/chunk-nq5zxrk0.js +0 -4
- package/dist/chunk-ny67c03k.js +0 -3
- package/dist/chunk-p4wdxp2c.js +0 -2
- package/dist/chunk-pcxp4r9n.js +0 -3
- package/dist/chunk-pdyeaxc1.js +0 -2
- package/dist/chunk-pf06ded4.js +0 -2
- package/dist/chunk-pfs0gpzm.js +0 -2
- package/dist/chunk-pshdwq44.js +0 -2
- package/dist/chunk-pwgv84pn.js +0 -32
- package/dist/chunk-pwsnafp3.js +0 -4367
- package/dist/chunk-q9n5swx7.js +0 -3
- package/dist/chunk-qr346wnp.js +0 -2
- package/dist/chunk-r02hke04.js +0 -2
- package/dist/chunk-ranshpyc.js +0 -3
- package/dist/chunk-rn194bhp.js +0 -20
- package/dist/chunk-rn1hgyc8.js +0 -930
- package/dist/chunk-s7z5dp70.js +0 -43
- package/dist/chunk-s8jd13nb.js +0 -3
- package/dist/chunk-sn7exv0n.js +0 -2
- package/dist/chunk-t1tdjjht.js +0 -216
- package/dist/chunk-t6qx04s8.js +0 -499
- package/dist/chunk-t6y6gyps.js +0 -2
- package/dist/chunk-tjfs7cc3.js +0 -2
- package/dist/chunk-tkyrk66a.js +0 -3
- package/dist/chunk-tntv9hvq.js +0 -2
- package/dist/chunk-v3nwkveg.js +0 -12
- package/dist/chunk-vd4cb5xr.js +0 -2
- package/dist/chunk-vkhdce50.js +0 -2
- package/dist/chunk-w183av08.js +0 -2
- package/dist/chunk-w2m02njv.js +0 -2
- package/dist/chunk-wpjrcrs5.js +0 -2
- package/dist/chunk-wqmppf6b.js +0 -3
- package/dist/chunk-wtb9fxdy.js +0 -2
- package/dist/chunk-xmzygmcz.js +0 -3
- package/dist/chunk-xsng1mtq.js +0 -3
- package/dist/chunk-xxzefj4j.js +0 -2
- package/dist/chunk-yq8x8bxq.js +0 -47
- package/dist/chunk-ytma76qe.js +0 -3
- package/dist/chunk-yw1m115e.js +0 -2
- package/dist/chunk-z64a924m.js +0 -2
- package/dist/chunk-zcz9rs6p.js +0 -3
|
@@ -0,0 +1,1163 @@
|
|
|
1
|
+
const colors = {
|
|
2
|
+
transparent: "transparent",
|
|
3
|
+
current: "currentColor",
|
|
4
|
+
black: "#000000",
|
|
5
|
+
white: "#ffffff",
|
|
6
|
+
slate: {
|
|
7
|
+
50: "#f8fafc",
|
|
8
|
+
100: "#f1f5f9",
|
|
9
|
+
200: "#e2e8f0",
|
|
10
|
+
300: "#cbd5e1",
|
|
11
|
+
400: "#94a3b8",
|
|
12
|
+
500: "#64748b",
|
|
13
|
+
600: "#475569",
|
|
14
|
+
700: "#334155",
|
|
15
|
+
800: "#1e293b",
|
|
16
|
+
900: "#0f172a",
|
|
17
|
+
950: "#020617"
|
|
18
|
+
},
|
|
19
|
+
gray: {
|
|
20
|
+
50: "#f9fafb",
|
|
21
|
+
100: "#f3f4f6",
|
|
22
|
+
200: "#e5e7eb",
|
|
23
|
+
300: "#d1d5db",
|
|
24
|
+
400: "#9ca3af",
|
|
25
|
+
500: "#6b7280",
|
|
26
|
+
600: "#4b5563",
|
|
27
|
+
700: "#374151",
|
|
28
|
+
800: "#1f2937",
|
|
29
|
+
900: "#111827",
|
|
30
|
+
950: "#030712"
|
|
31
|
+
},
|
|
32
|
+
zinc: {
|
|
33
|
+
50: "#fafafa",
|
|
34
|
+
100: "#f4f4f5",
|
|
35
|
+
200: "#e4e4e7",
|
|
36
|
+
300: "#d4d4d8",
|
|
37
|
+
400: "#a1a1aa",
|
|
38
|
+
500: "#71717a",
|
|
39
|
+
600: "#52525b",
|
|
40
|
+
700: "#3f3f46",
|
|
41
|
+
800: "#27272a",
|
|
42
|
+
900: "#18181b",
|
|
43
|
+
950: "#09090b"
|
|
44
|
+
},
|
|
45
|
+
red: {
|
|
46
|
+
50: "#fef2f2",
|
|
47
|
+
100: "#fee2e2",
|
|
48
|
+
200: "#fecaca",
|
|
49
|
+
300: "#fca5a5",
|
|
50
|
+
400: "#f87171",
|
|
51
|
+
500: "#ef4444",
|
|
52
|
+
600: "#dc2626",
|
|
53
|
+
700: "#b91c1c",
|
|
54
|
+
800: "#991b1b",
|
|
55
|
+
900: "#7f1d1d",
|
|
56
|
+
950: "#450a0a"
|
|
57
|
+
},
|
|
58
|
+
orange: {
|
|
59
|
+
50: "#fff7ed",
|
|
60
|
+
100: "#ffedd5",
|
|
61
|
+
200: "#fed7aa",
|
|
62
|
+
300: "#fdba74",
|
|
63
|
+
400: "#fb923c",
|
|
64
|
+
500: "#f97316",
|
|
65
|
+
600: "#ea580c",
|
|
66
|
+
700: "#c2410c",
|
|
67
|
+
800: "#9a3412",
|
|
68
|
+
900: "#7c2d12",
|
|
69
|
+
950: "#431407"
|
|
70
|
+
},
|
|
71
|
+
amber: {
|
|
72
|
+
50: "#fffbeb",
|
|
73
|
+
100: "#fef3c7",
|
|
74
|
+
200: "#fde68a",
|
|
75
|
+
300: "#fcd34d",
|
|
76
|
+
400: "#fbbf24",
|
|
77
|
+
500: "#f59e0b",
|
|
78
|
+
600: "#d97706",
|
|
79
|
+
700: "#b45309",
|
|
80
|
+
800: "#92400e",
|
|
81
|
+
900: "#78350f",
|
|
82
|
+
950: "#451a03"
|
|
83
|
+
},
|
|
84
|
+
yellow: {
|
|
85
|
+
50: "#fefce8",
|
|
86
|
+
100: "#fef9c3",
|
|
87
|
+
200: "#fef08a",
|
|
88
|
+
300: "#fde047",
|
|
89
|
+
400: "#facc15",
|
|
90
|
+
500: "#eab308",
|
|
91
|
+
600: "#ca8a04",
|
|
92
|
+
700: "#a16207",
|
|
93
|
+
800: "#854d0e",
|
|
94
|
+
900: "#713f12",
|
|
95
|
+
950: "#422006"
|
|
96
|
+
},
|
|
97
|
+
green: {
|
|
98
|
+
50: "#f0fdf4",
|
|
99
|
+
100: "#dcfce7",
|
|
100
|
+
200: "#bbf7d0",
|
|
101
|
+
300: "#86efac",
|
|
102
|
+
400: "#4ade80",
|
|
103
|
+
500: "#22c55e",
|
|
104
|
+
600: "#16a34a",
|
|
105
|
+
700: "#15803d",
|
|
106
|
+
800: "#166534",
|
|
107
|
+
900: "#14532d",
|
|
108
|
+
950: "#052e16"
|
|
109
|
+
},
|
|
110
|
+
emerald: {
|
|
111
|
+
50: "#ecfdf5",
|
|
112
|
+
100: "#d1fae5",
|
|
113
|
+
200: "#a7f3d0",
|
|
114
|
+
300: "#6ee7b7",
|
|
115
|
+
400: "#34d399",
|
|
116
|
+
500: "#10b981",
|
|
117
|
+
600: "#059669",
|
|
118
|
+
700: "#047857",
|
|
119
|
+
800: "#065f46",
|
|
120
|
+
900: "#064e3b",
|
|
121
|
+
950: "#022c22"
|
|
122
|
+
},
|
|
123
|
+
teal: {
|
|
124
|
+
50: "#f0fdfa",
|
|
125
|
+
100: "#ccfbf1",
|
|
126
|
+
200: "#99f6e4",
|
|
127
|
+
300: "#5eead4",
|
|
128
|
+
400: "#2dd4bf",
|
|
129
|
+
500: "#14b8a6",
|
|
130
|
+
600: "#0d9488",
|
|
131
|
+
700: "#0f766e",
|
|
132
|
+
800: "#115e59",
|
|
133
|
+
900: "#134e4a",
|
|
134
|
+
950: "#042f2e"
|
|
135
|
+
},
|
|
136
|
+
cyan: {
|
|
137
|
+
50: "#ecfeff",
|
|
138
|
+
100: "#cffafe",
|
|
139
|
+
200: "#a5f3fc",
|
|
140
|
+
300: "#67e8f9",
|
|
141
|
+
400: "#22d3ee",
|
|
142
|
+
500: "#06b6d4",
|
|
143
|
+
600: "#0891b2",
|
|
144
|
+
700: "#0e7490",
|
|
145
|
+
800: "#155e75",
|
|
146
|
+
900: "#164e63",
|
|
147
|
+
950: "#083344"
|
|
148
|
+
},
|
|
149
|
+
sky: {
|
|
150
|
+
50: "#f0f9ff",
|
|
151
|
+
100: "#e0f2fe",
|
|
152
|
+
200: "#bae6fd",
|
|
153
|
+
300: "#7dd3fc",
|
|
154
|
+
400: "#38bdf8",
|
|
155
|
+
500: "#0ea5e9",
|
|
156
|
+
600: "#0284c7",
|
|
157
|
+
700: "#0369a1",
|
|
158
|
+
800: "#075985",
|
|
159
|
+
900: "#0c4a6e",
|
|
160
|
+
950: "#082f49"
|
|
161
|
+
},
|
|
162
|
+
lime: {
|
|
163
|
+
50: "#f7fee7",
|
|
164
|
+
100: "#ecfccb",
|
|
165
|
+
200: "#d9f99d",
|
|
166
|
+
300: "#bef264",
|
|
167
|
+
400: "#a3e635",
|
|
168
|
+
500: "#84cc16",
|
|
169
|
+
600: "#65a30d",
|
|
170
|
+
700: "#4d7c0f",
|
|
171
|
+
800: "#3f6212",
|
|
172
|
+
900: "#365314",
|
|
173
|
+
950: "#1a2e05"
|
|
174
|
+
},
|
|
175
|
+
fuchsia: {
|
|
176
|
+
50: "#fdf4ff",
|
|
177
|
+
100: "#fae8ff",
|
|
178
|
+
200: "#f5d0fe",
|
|
179
|
+
300: "#f0abfc",
|
|
180
|
+
400: "#e879f9",
|
|
181
|
+
500: "#d946ef",
|
|
182
|
+
600: "#c026d3",
|
|
183
|
+
700: "#a21caf",
|
|
184
|
+
800: "#86198f",
|
|
185
|
+
900: "#701a75",
|
|
186
|
+
950: "#4a044e"
|
|
187
|
+
},
|
|
188
|
+
neutral: {
|
|
189
|
+
50: "#fafafa",
|
|
190
|
+
100: "#f5f5f5",
|
|
191
|
+
200: "#e5e5e5",
|
|
192
|
+
300: "#d4d4d4",
|
|
193
|
+
400: "#a3a3a3",
|
|
194
|
+
500: "#737373",
|
|
195
|
+
600: "#525252",
|
|
196
|
+
700: "#404040",
|
|
197
|
+
800: "#262626",
|
|
198
|
+
900: "#171717",
|
|
199
|
+
950: "#0a0a0a"
|
|
200
|
+
},
|
|
201
|
+
stone: {
|
|
202
|
+
50: "#fafaf9",
|
|
203
|
+
100: "#f5f5f4",
|
|
204
|
+
200: "#e7e5e4",
|
|
205
|
+
300: "#d6d3d1",
|
|
206
|
+
400: "#a8a29e",
|
|
207
|
+
500: "#78716c",
|
|
208
|
+
600: "#57534e",
|
|
209
|
+
700: "#44403c",
|
|
210
|
+
800: "#292524",
|
|
211
|
+
900: "#1c1917",
|
|
212
|
+
950: "#0c0a09"
|
|
213
|
+
},
|
|
214
|
+
blue: {
|
|
215
|
+
50: "#eff6ff",
|
|
216
|
+
100: "#dbeafe",
|
|
217
|
+
200: "#bfdbfe",
|
|
218
|
+
300: "#93c5fd",
|
|
219
|
+
400: "#60a5fa",
|
|
220
|
+
500: "#3b82f6",
|
|
221
|
+
600: "#2563eb",
|
|
222
|
+
700: "#1d4ed8",
|
|
223
|
+
800: "#1e40af",
|
|
224
|
+
900: "#1e3a8a",
|
|
225
|
+
950: "#172554"
|
|
226
|
+
},
|
|
227
|
+
indigo: {
|
|
228
|
+
50: "#eef2ff",
|
|
229
|
+
100: "#e0e7ff",
|
|
230
|
+
200: "#c7d2fe",
|
|
231
|
+
300: "#a5b4fc",
|
|
232
|
+
400: "#818cf8",
|
|
233
|
+
500: "#6366f1",
|
|
234
|
+
600: "#4f46e5",
|
|
235
|
+
700: "#4338ca",
|
|
236
|
+
800: "#3730a3",
|
|
237
|
+
900: "#312e81",
|
|
238
|
+
950: "#1e1b4b"
|
|
239
|
+
},
|
|
240
|
+
violet: {
|
|
241
|
+
50: "#f5f3ff",
|
|
242
|
+
100: "#ede9fe",
|
|
243
|
+
200: "#ddd6fe",
|
|
244
|
+
300: "#c4b5fd",
|
|
245
|
+
400: "#a78bfa",
|
|
246
|
+
500: "#8b5cf6",
|
|
247
|
+
600: "#7c3aed",
|
|
248
|
+
700: "#6d28d9",
|
|
249
|
+
800: "#5b21b6",
|
|
250
|
+
900: "#4c1d95",
|
|
251
|
+
950: "#2e1065"
|
|
252
|
+
},
|
|
253
|
+
purple: {
|
|
254
|
+
50: "#faf5ff",
|
|
255
|
+
100: "#f3e8ff",
|
|
256
|
+
200: "#e9d5ff",
|
|
257
|
+
300: "#d8b4fe",
|
|
258
|
+
400: "#c084fc",
|
|
259
|
+
500: "#a855f7",
|
|
260
|
+
600: "#9333ea",
|
|
261
|
+
700: "#7e22ce",
|
|
262
|
+
800: "#6b21a8",
|
|
263
|
+
900: "#581c87",
|
|
264
|
+
950: "#3b0764"
|
|
265
|
+
},
|
|
266
|
+
pink: {
|
|
267
|
+
50: "#fdf2f8",
|
|
268
|
+
100: "#fce7f3",
|
|
269
|
+
200: "#fbcfe8",
|
|
270
|
+
300: "#f9a8d4",
|
|
271
|
+
400: "#f472b6",
|
|
272
|
+
500: "#ec4899",
|
|
273
|
+
600: "#db2777",
|
|
274
|
+
700: "#be185d",
|
|
275
|
+
800: "#9d174d",
|
|
276
|
+
900: "#831843",
|
|
277
|
+
950: "#500724"
|
|
278
|
+
},
|
|
279
|
+
rose: {
|
|
280
|
+
50: "#fff1f2",
|
|
281
|
+
100: "#ffe4e6",
|
|
282
|
+
200: "#fecdd3",
|
|
283
|
+
300: "#fda4af",
|
|
284
|
+
400: "#fb7185",
|
|
285
|
+
500: "#f43f5e",
|
|
286
|
+
600: "#e11d48",
|
|
287
|
+
700: "#be123c",
|
|
288
|
+
800: "#9f1239",
|
|
289
|
+
900: "#881337",
|
|
290
|
+
950: "#4c0519"
|
|
291
|
+
}
|
|
292
|
+
}, spacing = {
|
|
293
|
+
px: 1,
|
|
294
|
+
0: 0,
|
|
295
|
+
0.5: 2,
|
|
296
|
+
1: 4,
|
|
297
|
+
1.5: 6,
|
|
298
|
+
2: 8,
|
|
299
|
+
2.5: 10,
|
|
300
|
+
3: 12,
|
|
301
|
+
3.5: 14,
|
|
302
|
+
4: 16,
|
|
303
|
+
5: 20,
|
|
304
|
+
6: 24,
|
|
305
|
+
7: 28,
|
|
306
|
+
8: 32,
|
|
307
|
+
9: 36,
|
|
308
|
+
10: 40,
|
|
309
|
+
11: 44,
|
|
310
|
+
12: 48,
|
|
311
|
+
14: 56,
|
|
312
|
+
16: 64,
|
|
313
|
+
20: 80,
|
|
314
|
+
24: 96,
|
|
315
|
+
28: 112,
|
|
316
|
+
32: 128,
|
|
317
|
+
36: 144,
|
|
318
|
+
40: 160,
|
|
319
|
+
44: 176,
|
|
320
|
+
48: 192,
|
|
321
|
+
52: 208,
|
|
322
|
+
56: 224,
|
|
323
|
+
60: 240,
|
|
324
|
+
64: 256,
|
|
325
|
+
72: 288,
|
|
326
|
+
80: 320,
|
|
327
|
+
96: 384
|
|
328
|
+
}, fontSizes = {
|
|
329
|
+
xs: 12,
|
|
330
|
+
sm: 14,
|
|
331
|
+
base: 16,
|
|
332
|
+
lg: 18,
|
|
333
|
+
xl: 20,
|
|
334
|
+
"2xl": 24,
|
|
335
|
+
"3xl": 30,
|
|
336
|
+
"4xl": 36,
|
|
337
|
+
"5xl": 48,
|
|
338
|
+
"6xl": 60,
|
|
339
|
+
"7xl": 72,
|
|
340
|
+
"8xl": 96,
|
|
341
|
+
"9xl": 128
|
|
342
|
+
}, borderRadius = {
|
|
343
|
+
none: 0,
|
|
344
|
+
sm: 2,
|
|
345
|
+
DEFAULT: 4,
|
|
346
|
+
md: 6,
|
|
347
|
+
lg: 8,
|
|
348
|
+
xl: 12,
|
|
349
|
+
"2xl": 16,
|
|
350
|
+
"3xl": 24,
|
|
351
|
+
full: 9999
|
|
352
|
+
};
|
|
353
|
+
function resolveColor(colorClass) {
|
|
354
|
+
const slash = colorClass.lastIndexOf("/");
|
|
355
|
+
if (slash > 0 && !colorClass.endsWith("]")) {
|
|
356
|
+
const base = resolveColor(colorClass.slice(0, slash)), amount = colorClass.slice(slash + 1), alpha = /^\[(.+)\]$/.test(amount) ? Number.parseFloat(amount.slice(1, -1)) * (amount.includes("%") ? 1 : 100) : Number.parseFloat(amount);
|
|
357
|
+
if (!base || !Number.isFinite(alpha))
|
|
358
|
+
return;
|
|
359
|
+
return withAlpha(base, alpha / 100);
|
|
360
|
+
}
|
|
361
|
+
if (colorClass === "transparent")
|
|
362
|
+
return "transparent";
|
|
363
|
+
if (colorClass === "current")
|
|
364
|
+
return "currentColor";
|
|
365
|
+
if (colorClass === "black")
|
|
366
|
+
return "#000000";
|
|
367
|
+
if (colorClass === "white")
|
|
368
|
+
return "#ffffff";
|
|
369
|
+
const parts = colorClass.split("-");
|
|
370
|
+
if (parts.length === 2) {
|
|
371
|
+
const [colorName, shade] = parts, palette = colors[colorName];
|
|
372
|
+
if (palette && typeof palette === "object")
|
|
373
|
+
return palette[shade];
|
|
374
|
+
}
|
|
375
|
+
if (colorClass.startsWith("[") && colorClass.endsWith("]")) {
|
|
376
|
+
const inner = colorClass.slice(1, -1);
|
|
377
|
+
return /^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(inner) ? inner : void 0;
|
|
378
|
+
}
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
function withAlpha(color, alpha) {
|
|
382
|
+
if (color === "transparent")
|
|
383
|
+
return color;
|
|
384
|
+
let hex = color.startsWith("#") ? color.slice(1) : "";
|
|
385
|
+
if (hex.length === 3)
|
|
386
|
+
hex = hex.split("").map((digit) => digit + digit).join("");
|
|
387
|
+
if (hex.length === 8)
|
|
388
|
+
hex = hex.slice(0, 6);
|
|
389
|
+
if (hex.length !== 6)
|
|
390
|
+
return;
|
|
391
|
+
const byte = Math.round(Math.min(1, Math.max(0, alpha)) * 255);
|
|
392
|
+
return `#${hex}${byte.toString(16).padStart(2, "0")}`;
|
|
393
|
+
}
|
|
394
|
+
function arbitraryLength(value, emBase = 16) {
|
|
395
|
+
if (!value.startsWith("[") || !value.endsWith("]"))
|
|
396
|
+
return;
|
|
397
|
+
const inner = value.slice(1, -1), number = Number.parseFloat(inner);
|
|
398
|
+
if (!Number.isFinite(number))
|
|
399
|
+
return;
|
|
400
|
+
if (inner.endsWith("rem"))
|
|
401
|
+
return number * 16;
|
|
402
|
+
if (inner.endsWith("em"))
|
|
403
|
+
return number * emBase;
|
|
404
|
+
return number;
|
|
405
|
+
}
|
|
406
|
+
function resolveSpacing(value) {
|
|
407
|
+
if (value.startsWith("[") && value.endsWith("]")) {
|
|
408
|
+
const inner = value.slice(1, -1), length = inner.endsWith("rem") ? Number.parseFloat(inner) * 16 : Number.parseFloat(inner);
|
|
409
|
+
return Number.isFinite(length) ? length : void 0;
|
|
410
|
+
}
|
|
411
|
+
return spacing[value];
|
|
412
|
+
}
|
|
413
|
+
const classParsers = {
|
|
414
|
+
flex: (_, style) => {
|
|
415
|
+
style.display = "flex";
|
|
416
|
+
return !0;
|
|
417
|
+
},
|
|
418
|
+
hidden: (_, style) => {
|
|
419
|
+
style.display = "none";
|
|
420
|
+
return !0;
|
|
421
|
+
},
|
|
422
|
+
grid: (_, style) => {
|
|
423
|
+
style.display = "grid";
|
|
424
|
+
return !0;
|
|
425
|
+
},
|
|
426
|
+
"flex-row": (_, style) => {
|
|
427
|
+
style.flexDirection = "row";
|
|
428
|
+
return !0;
|
|
429
|
+
},
|
|
430
|
+
"flex-col": (_, style) => {
|
|
431
|
+
style.flexDirection = "column";
|
|
432
|
+
return !0;
|
|
433
|
+
},
|
|
434
|
+
"flex-row-reverse": (_, style) => {
|
|
435
|
+
style.flexDirection = "row-reverse";
|
|
436
|
+
return !0;
|
|
437
|
+
},
|
|
438
|
+
"flex-col-reverse": (_, style) => {
|
|
439
|
+
style.flexDirection = "column-reverse";
|
|
440
|
+
return !0;
|
|
441
|
+
},
|
|
442
|
+
"flex-wrap": (_, style) => {
|
|
443
|
+
style.flexWrap = "wrap";
|
|
444
|
+
return !0;
|
|
445
|
+
},
|
|
446
|
+
"flex-nowrap": (_, style) => {
|
|
447
|
+
style.flexWrap = "nowrap";
|
|
448
|
+
return !0;
|
|
449
|
+
},
|
|
450
|
+
"flex-wrap-reverse": (_, style) => {
|
|
451
|
+
style.flexWrap = "wrap-reverse";
|
|
452
|
+
return !0;
|
|
453
|
+
},
|
|
454
|
+
"flex-1": (_, style) => {
|
|
455
|
+
style.flex = 1;
|
|
456
|
+
style.flexGrow = 1;
|
|
457
|
+
style.flexShrink = 1;
|
|
458
|
+
style.flexBasis = 0;
|
|
459
|
+
return !0;
|
|
460
|
+
},
|
|
461
|
+
"flex-auto": (_, style) => {
|
|
462
|
+
style.flexGrow = 1;
|
|
463
|
+
style.flexShrink = 1;
|
|
464
|
+
return !0;
|
|
465
|
+
},
|
|
466
|
+
"flex-initial": (_, style) => {
|
|
467
|
+
style.flexGrow = 0;
|
|
468
|
+
style.flexShrink = 1;
|
|
469
|
+
return !0;
|
|
470
|
+
},
|
|
471
|
+
"flex-none": (_, style) => {
|
|
472
|
+
style.flexGrow = 0;
|
|
473
|
+
style.flexShrink = 0;
|
|
474
|
+
return !0;
|
|
475
|
+
},
|
|
476
|
+
grow: (_, style) => {
|
|
477
|
+
style.flexGrow = 1;
|
|
478
|
+
return !0;
|
|
479
|
+
},
|
|
480
|
+
"grow-0": (_, style) => {
|
|
481
|
+
style.flexGrow = 0;
|
|
482
|
+
return !0;
|
|
483
|
+
},
|
|
484
|
+
shrink: (_, style) => {
|
|
485
|
+
style.flexShrink = 1;
|
|
486
|
+
return !0;
|
|
487
|
+
},
|
|
488
|
+
"shrink-0": (_, style) => {
|
|
489
|
+
style.flexShrink = 0;
|
|
490
|
+
return !0;
|
|
491
|
+
},
|
|
492
|
+
"justify-start": (_, style) => {
|
|
493
|
+
style.justifyContent = "flex-start";
|
|
494
|
+
return !0;
|
|
495
|
+
},
|
|
496
|
+
"justify-center": (_, style) => {
|
|
497
|
+
style.justifyContent = "center";
|
|
498
|
+
return !0;
|
|
499
|
+
},
|
|
500
|
+
"justify-end": (_, style) => {
|
|
501
|
+
style.justifyContent = "flex-end";
|
|
502
|
+
return !0;
|
|
503
|
+
},
|
|
504
|
+
"justify-between": (_, style) => {
|
|
505
|
+
style.justifyContent = "space-between";
|
|
506
|
+
return !0;
|
|
507
|
+
},
|
|
508
|
+
"justify-around": (_, style) => {
|
|
509
|
+
style.justifyContent = "space-around";
|
|
510
|
+
return !0;
|
|
511
|
+
},
|
|
512
|
+
"justify-evenly": (_, style) => {
|
|
513
|
+
style.justifyContent = "space-evenly";
|
|
514
|
+
return !0;
|
|
515
|
+
},
|
|
516
|
+
"items-start": (_, style) => {
|
|
517
|
+
style.alignItems = "flex-start";
|
|
518
|
+
return !0;
|
|
519
|
+
},
|
|
520
|
+
"items-center": (_, style) => {
|
|
521
|
+
style.alignItems = "center";
|
|
522
|
+
return !0;
|
|
523
|
+
},
|
|
524
|
+
"items-end": (_, style) => {
|
|
525
|
+
style.alignItems = "flex-end";
|
|
526
|
+
return !0;
|
|
527
|
+
},
|
|
528
|
+
"items-stretch": (_, style) => {
|
|
529
|
+
style.alignItems = "stretch";
|
|
530
|
+
return !0;
|
|
531
|
+
},
|
|
532
|
+
"items-baseline": (_, style) => {
|
|
533
|
+
style.alignItems = "baseline";
|
|
534
|
+
return !0;
|
|
535
|
+
},
|
|
536
|
+
"self-auto": (_, style) => {
|
|
537
|
+
style.alignSelf = "auto";
|
|
538
|
+
return !0;
|
|
539
|
+
},
|
|
540
|
+
"self-start": (_, style) => {
|
|
541
|
+
style.alignSelf = "flex-start";
|
|
542
|
+
return !0;
|
|
543
|
+
},
|
|
544
|
+
"self-center": (_, style) => {
|
|
545
|
+
style.alignSelf = "center";
|
|
546
|
+
return !0;
|
|
547
|
+
},
|
|
548
|
+
"self-end": (_, style) => {
|
|
549
|
+
style.alignSelf = "flex-end";
|
|
550
|
+
return !0;
|
|
551
|
+
},
|
|
552
|
+
"self-stretch": (_, style) => {
|
|
553
|
+
style.alignSelf = "stretch";
|
|
554
|
+
return !0;
|
|
555
|
+
},
|
|
556
|
+
"self-baseline": (_, style) => {
|
|
557
|
+
style.alignSelf = "baseline";
|
|
558
|
+
return !0;
|
|
559
|
+
},
|
|
560
|
+
"min-w-0": (_, style) => {
|
|
561
|
+
style.minWidth = 0;
|
|
562
|
+
return !0;
|
|
563
|
+
},
|
|
564
|
+
"aspect-square": (_, style) => {
|
|
565
|
+
style.aspectRatio = 1;
|
|
566
|
+
return !0;
|
|
567
|
+
},
|
|
568
|
+
"inset-0": (_, style) => {
|
|
569
|
+
style.top = 0;
|
|
570
|
+
style.right = 0;
|
|
571
|
+
style.bottom = 0;
|
|
572
|
+
style.left = 0;
|
|
573
|
+
return !0;
|
|
574
|
+
},
|
|
575
|
+
"tracking-tighter": (_, style) => {
|
|
576
|
+
style.letterSpacing = -0.8;
|
|
577
|
+
return !0;
|
|
578
|
+
},
|
|
579
|
+
"tracking-tight": (_, style) => {
|
|
580
|
+
style.letterSpacing = -0.4;
|
|
581
|
+
return !0;
|
|
582
|
+
},
|
|
583
|
+
"tracking-normal": (_, style) => {
|
|
584
|
+
style.letterSpacing = 0;
|
|
585
|
+
return !0;
|
|
586
|
+
},
|
|
587
|
+
"tracking-wide": (_, style) => {
|
|
588
|
+
style.letterSpacing = 0.4;
|
|
589
|
+
return !0;
|
|
590
|
+
},
|
|
591
|
+
"tracking-wider": (_, style) => {
|
|
592
|
+
style.letterSpacing = 0.8;
|
|
593
|
+
return !0;
|
|
594
|
+
},
|
|
595
|
+
"tracking-widest": (_, style) => {
|
|
596
|
+
style.letterSpacing = 1.6;
|
|
597
|
+
return !0;
|
|
598
|
+
},
|
|
599
|
+
"tabular-nums": () => !0,
|
|
600
|
+
block: () => !0,
|
|
601
|
+
"inline-flex": (_, style) => {
|
|
602
|
+
style.display = "flex";
|
|
603
|
+
return !0;
|
|
604
|
+
},
|
|
605
|
+
truncate: () => !0,
|
|
606
|
+
relative: (_, style) => {
|
|
607
|
+
style.position = "relative";
|
|
608
|
+
return !0;
|
|
609
|
+
},
|
|
610
|
+
absolute: (_, style) => {
|
|
611
|
+
style.position = "absolute";
|
|
612
|
+
return !0;
|
|
613
|
+
},
|
|
614
|
+
"overflow-visible": (_, style) => {
|
|
615
|
+
style.overflow = "visible";
|
|
616
|
+
return !0;
|
|
617
|
+
},
|
|
618
|
+
"overflow-hidden": (_, style) => {
|
|
619
|
+
style.overflow = "hidden";
|
|
620
|
+
return !0;
|
|
621
|
+
},
|
|
622
|
+
"overflow-scroll": (_, style) => {
|
|
623
|
+
style.overflow = "scroll";
|
|
624
|
+
return !0;
|
|
625
|
+
},
|
|
626
|
+
"font-thin": (_, style) => {
|
|
627
|
+
style.fontWeight = "100";
|
|
628
|
+
return !0;
|
|
629
|
+
},
|
|
630
|
+
"font-extralight": (_, style) => {
|
|
631
|
+
style.fontWeight = "200";
|
|
632
|
+
return !0;
|
|
633
|
+
},
|
|
634
|
+
"font-light": (_, style) => {
|
|
635
|
+
style.fontWeight = "300";
|
|
636
|
+
return !0;
|
|
637
|
+
},
|
|
638
|
+
"font-normal": (_, style) => {
|
|
639
|
+
style.fontWeight = "400";
|
|
640
|
+
return !0;
|
|
641
|
+
},
|
|
642
|
+
"font-medium": (_, style) => {
|
|
643
|
+
style.fontWeight = "500";
|
|
644
|
+
return !0;
|
|
645
|
+
},
|
|
646
|
+
"font-semibold": (_, style) => {
|
|
647
|
+
style.fontWeight = "600";
|
|
648
|
+
return !0;
|
|
649
|
+
},
|
|
650
|
+
"font-bold": (_, style) => {
|
|
651
|
+
style.fontWeight = "bold";
|
|
652
|
+
return !0;
|
|
653
|
+
},
|
|
654
|
+
"font-extrabold": (_, style) => {
|
|
655
|
+
style.fontWeight = "800";
|
|
656
|
+
return !0;
|
|
657
|
+
},
|
|
658
|
+
"font-black": (_, style) => {
|
|
659
|
+
style.fontWeight = "900";
|
|
660
|
+
return !0;
|
|
661
|
+
},
|
|
662
|
+
italic: (_, style) => {
|
|
663
|
+
style.fontStyle = "italic";
|
|
664
|
+
return !0;
|
|
665
|
+
},
|
|
666
|
+
"not-italic": (_, style) => {
|
|
667
|
+
style.fontStyle = "normal";
|
|
668
|
+
return !0;
|
|
669
|
+
},
|
|
670
|
+
"text-left": (_, style) => {
|
|
671
|
+
style.textAlign = "left";
|
|
672
|
+
return !0;
|
|
673
|
+
},
|
|
674
|
+
"text-center": (_, style) => {
|
|
675
|
+
style.textAlign = "center";
|
|
676
|
+
return !0;
|
|
677
|
+
},
|
|
678
|
+
"text-right": (_, style) => {
|
|
679
|
+
style.textAlign = "right";
|
|
680
|
+
return !0;
|
|
681
|
+
},
|
|
682
|
+
"text-justify": (_, style) => {
|
|
683
|
+
style.textAlign = "justify";
|
|
684
|
+
return !0;
|
|
685
|
+
},
|
|
686
|
+
uppercase: (_, style) => {
|
|
687
|
+
style.textTransform = "uppercase";
|
|
688
|
+
return !0;
|
|
689
|
+
},
|
|
690
|
+
lowercase: (_, style) => {
|
|
691
|
+
style.textTransform = "lowercase";
|
|
692
|
+
return !0;
|
|
693
|
+
},
|
|
694
|
+
capitalize: (_, style) => {
|
|
695
|
+
style.textTransform = "capitalize";
|
|
696
|
+
return !0;
|
|
697
|
+
},
|
|
698
|
+
"normal-case": (_, style) => {
|
|
699
|
+
style.textTransform = "none";
|
|
700
|
+
return !0;
|
|
701
|
+
},
|
|
702
|
+
underline: (_, style) => {
|
|
703
|
+
style.textDecorationLine = "underline";
|
|
704
|
+
return !0;
|
|
705
|
+
},
|
|
706
|
+
"line-through": (_, style) => {
|
|
707
|
+
style.textDecorationLine = "line-through";
|
|
708
|
+
return !0;
|
|
709
|
+
},
|
|
710
|
+
"no-underline": (_, style) => {
|
|
711
|
+
style.textDecorationLine = "none";
|
|
712
|
+
return !0;
|
|
713
|
+
}
|
|
714
|
+
};
|
|
715
|
+
function parseBackgroundColor(className, style) {
|
|
716
|
+
if (!className.startsWith("bg-"))
|
|
717
|
+
return !1;
|
|
718
|
+
const colorClass = className.slice(3), color = resolveColor(colorClass);
|
|
719
|
+
if (color) {
|
|
720
|
+
style.backgroundColor = color;
|
|
721
|
+
return !0;
|
|
722
|
+
}
|
|
723
|
+
return !1;
|
|
724
|
+
}
|
|
725
|
+
function parseTextColor(className, style) {
|
|
726
|
+
if (!className.startsWith("text-"))
|
|
727
|
+
return !1;
|
|
728
|
+
const value = className.slice(5);
|
|
729
|
+
if (fontSizes[value]) {
|
|
730
|
+
style.fontSize = fontSizes[value];
|
|
731
|
+
return !0;
|
|
732
|
+
}
|
|
733
|
+
if (value.startsWith("[") && value.endsWith("]")) {
|
|
734
|
+
const inner = value.slice(1, -1);
|
|
735
|
+
if (/^-?[\d.]+(?:px|r?em)?$/.test(inner)) {
|
|
736
|
+
const size = inner.endsWith("rem") || inner.endsWith("em") ? Number.parseFloat(inner) * 16 : Number.parseFloat(inner);
|
|
737
|
+
if (Number.isFinite(size)) {
|
|
738
|
+
style.fontSize = size;
|
|
739
|
+
return !0;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
const color = resolveColor(value);
|
|
744
|
+
if (color) {
|
|
745
|
+
style.color = color;
|
|
746
|
+
return !0;
|
|
747
|
+
}
|
|
748
|
+
return !1;
|
|
749
|
+
}
|
|
750
|
+
function parsePadding(className, style) {
|
|
751
|
+
if (className.startsWith("p-")) {
|
|
752
|
+
const size = resolveSpacing(className.slice(2));
|
|
753
|
+
if (size !== void 0) {
|
|
754
|
+
style.padding = size;
|
|
755
|
+
return !0;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
if (className.startsWith("px-")) {
|
|
759
|
+
const size = resolveSpacing(className.slice(3));
|
|
760
|
+
if (size !== void 0) {
|
|
761
|
+
style.paddingHorizontal = size;
|
|
762
|
+
return !0;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
if (className.startsWith("py-")) {
|
|
766
|
+
const size = resolveSpacing(className.slice(3));
|
|
767
|
+
if (size !== void 0) {
|
|
768
|
+
style.paddingVertical = size;
|
|
769
|
+
return !0;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
if (className.startsWith("pt-")) {
|
|
773
|
+
const size = resolveSpacing(className.slice(3));
|
|
774
|
+
if (size !== void 0) {
|
|
775
|
+
style.paddingTop = size;
|
|
776
|
+
return !0;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
if (className.startsWith("pr-")) {
|
|
780
|
+
const size = resolveSpacing(className.slice(3));
|
|
781
|
+
if (size !== void 0) {
|
|
782
|
+
style.paddingRight = size;
|
|
783
|
+
return !0;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
if (className.startsWith("pb-")) {
|
|
787
|
+
const size = resolveSpacing(className.slice(3));
|
|
788
|
+
if (size !== void 0) {
|
|
789
|
+
style.paddingBottom = size;
|
|
790
|
+
return !0;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
if (className.startsWith("pl-")) {
|
|
794
|
+
const size = resolveSpacing(className.slice(3));
|
|
795
|
+
if (size !== void 0) {
|
|
796
|
+
style.paddingLeft = size;
|
|
797
|
+
return !0;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
return !1;
|
|
801
|
+
}
|
|
802
|
+
function parseMargin(className, style) {
|
|
803
|
+
if (className.startsWith("m-")) {
|
|
804
|
+
const size = resolveSpacing(className.slice(2));
|
|
805
|
+
if (size !== void 0) {
|
|
806
|
+
style.margin = size;
|
|
807
|
+
return !0;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
if (className.startsWith("mx-")) {
|
|
811
|
+
const size = resolveSpacing(className.slice(3));
|
|
812
|
+
if (size !== void 0) {
|
|
813
|
+
style.marginHorizontal = size;
|
|
814
|
+
return !0;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
if (className.startsWith("my-")) {
|
|
818
|
+
const size = resolveSpacing(className.slice(3));
|
|
819
|
+
if (size !== void 0) {
|
|
820
|
+
style.marginVertical = size;
|
|
821
|
+
return !0;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
if (className.startsWith("mt-")) {
|
|
825
|
+
const size = resolveSpacing(className.slice(3));
|
|
826
|
+
if (size !== void 0) {
|
|
827
|
+
style.marginTop = size;
|
|
828
|
+
return !0;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
if (className.startsWith("mr-")) {
|
|
832
|
+
const size = resolveSpacing(className.slice(3));
|
|
833
|
+
if (size !== void 0) {
|
|
834
|
+
style.marginRight = size;
|
|
835
|
+
return !0;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
if (className.startsWith("mb-")) {
|
|
839
|
+
const size = resolveSpacing(className.slice(3));
|
|
840
|
+
if (size !== void 0) {
|
|
841
|
+
style.marginBottom = size;
|
|
842
|
+
return !0;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
if (className.startsWith("ml-")) {
|
|
846
|
+
const size = resolveSpacing(className.slice(3));
|
|
847
|
+
if (size !== void 0) {
|
|
848
|
+
style.marginLeft = size;
|
|
849
|
+
return !0;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
return !1;
|
|
853
|
+
}
|
|
854
|
+
function parseWidth(className, style) {
|
|
855
|
+
if (!className.startsWith("w-"))
|
|
856
|
+
return !1;
|
|
857
|
+
const value = className.slice(2);
|
|
858
|
+
if (value === "full") {
|
|
859
|
+
style.width = "100%";
|
|
860
|
+
return !0;
|
|
861
|
+
}
|
|
862
|
+
if (value === "screen") {
|
|
863
|
+
style.width = "100%";
|
|
864
|
+
return !0;
|
|
865
|
+
}
|
|
866
|
+
if (value === "auto") {
|
|
867
|
+
style.width = "auto";
|
|
868
|
+
return !0;
|
|
869
|
+
}
|
|
870
|
+
if (value.includes("/")) {
|
|
871
|
+
const [num, denom] = value.split("/"), percent = Number.parseInt(num) / Number.parseInt(denom) * 100;
|
|
872
|
+
style.width = `${percent}%`;
|
|
873
|
+
return !0;
|
|
874
|
+
}
|
|
875
|
+
const size = resolveSpacing(value);
|
|
876
|
+
if (size !== void 0) {
|
|
877
|
+
style.width = size;
|
|
878
|
+
return !0;
|
|
879
|
+
}
|
|
880
|
+
return !1;
|
|
881
|
+
}
|
|
882
|
+
function parseHeight(className, style) {
|
|
883
|
+
if (!className.startsWith("h-"))
|
|
884
|
+
return !1;
|
|
885
|
+
const value = className.slice(2);
|
|
886
|
+
if (value === "full") {
|
|
887
|
+
style.height = "100%";
|
|
888
|
+
return !0;
|
|
889
|
+
}
|
|
890
|
+
if (value === "screen") {
|
|
891
|
+
style.height = "100%";
|
|
892
|
+
return !0;
|
|
893
|
+
}
|
|
894
|
+
if (value === "auto") {
|
|
895
|
+
style.height = "auto";
|
|
896
|
+
return !0;
|
|
897
|
+
}
|
|
898
|
+
const size = resolveSpacing(value);
|
|
899
|
+
if (size !== void 0) {
|
|
900
|
+
style.height = size;
|
|
901
|
+
return !0;
|
|
902
|
+
}
|
|
903
|
+
return !1;
|
|
904
|
+
}
|
|
905
|
+
function parseBorderRadius(className, style) {
|
|
906
|
+
if (!className.startsWith("rounded"))
|
|
907
|
+
return !1;
|
|
908
|
+
if (className === "rounded") {
|
|
909
|
+
style.borderRadius = borderRadius.DEFAULT;
|
|
910
|
+
return !0;
|
|
911
|
+
}
|
|
912
|
+
const value = className.slice(8);
|
|
913
|
+
if (value === "")
|
|
914
|
+
return !1;
|
|
915
|
+
const corner = /^(?:(t|b|l|r)-)?(\[[^\]]+\])$/.exec(value);
|
|
916
|
+
if (corner) {
|
|
917
|
+
const r = arbitraryLength(corner[2]);
|
|
918
|
+
if (r === void 0)
|
|
919
|
+
return !1;
|
|
920
|
+
const corners = {
|
|
921
|
+
t: ["borderTopLeftRadius", "borderTopRightRadius"],
|
|
922
|
+
b: ["borderBottomLeftRadius", "borderBottomRightRadius"],
|
|
923
|
+
l: ["borderTopLeftRadius", "borderBottomLeftRadius"],
|
|
924
|
+
r: ["borderTopRightRadius", "borderBottomRightRadius"]
|
|
925
|
+
};
|
|
926
|
+
for (const key of corner[1] ? corners[corner[1]] : ["borderRadius"])
|
|
927
|
+
style[key] = r;
|
|
928
|
+
return !0;
|
|
929
|
+
}
|
|
930
|
+
if (value.startsWith("t-")) {
|
|
931
|
+
const r = borderRadius[value.slice(2)] ?? borderRadius.DEFAULT;
|
|
932
|
+
style.borderTopLeftRadius = r;
|
|
933
|
+
style.borderTopRightRadius = r;
|
|
934
|
+
return !0;
|
|
935
|
+
}
|
|
936
|
+
if (value.startsWith("b-")) {
|
|
937
|
+
const r = borderRadius[value.slice(2)] ?? borderRadius.DEFAULT;
|
|
938
|
+
style.borderBottomLeftRadius = r;
|
|
939
|
+
style.borderBottomRightRadius = r;
|
|
940
|
+
return !0;
|
|
941
|
+
}
|
|
942
|
+
if (value.startsWith("l-")) {
|
|
943
|
+
const r = borderRadius[value.slice(2)] ?? borderRadius.DEFAULT;
|
|
944
|
+
style.borderTopLeftRadius = r;
|
|
945
|
+
style.borderBottomLeftRadius = r;
|
|
946
|
+
return !0;
|
|
947
|
+
}
|
|
948
|
+
if (value.startsWith("r-")) {
|
|
949
|
+
const r = borderRadius[value.slice(2)] ?? borderRadius.DEFAULT;
|
|
950
|
+
style.borderTopRightRadius = r;
|
|
951
|
+
style.borderBottomRightRadius = r;
|
|
952
|
+
return !0;
|
|
953
|
+
}
|
|
954
|
+
const radius = borderRadius[value];
|
|
955
|
+
if (radius !== void 0) {
|
|
956
|
+
style.borderRadius = radius;
|
|
957
|
+
return !0;
|
|
958
|
+
}
|
|
959
|
+
return !1;
|
|
960
|
+
}
|
|
961
|
+
function parseBorderWidth(className, style) {
|
|
962
|
+
if (!className.startsWith("border"))
|
|
963
|
+
return !1;
|
|
964
|
+
if (className === "border") {
|
|
965
|
+
style.borderWidth = 1;
|
|
966
|
+
return !0;
|
|
967
|
+
}
|
|
968
|
+
const match = className.match(/^border-(\d+)$/);
|
|
969
|
+
if (match) {
|
|
970
|
+
style.borderWidth = Number.parseInt(match[1]);
|
|
971
|
+
return !0;
|
|
972
|
+
}
|
|
973
|
+
const sideMatch = className.match(/^border-(t|r|b|l)-?(\d*)$/);
|
|
974
|
+
if (sideMatch) {
|
|
975
|
+
const [, side, width] = sideMatch, w = width ? Number.parseInt(width) : 1;
|
|
976
|
+
switch (side) {
|
|
977
|
+
case "t":
|
|
978
|
+
style.borderTopWidth = w;
|
|
979
|
+
break;
|
|
980
|
+
case "r":
|
|
981
|
+
style.borderRightWidth = w;
|
|
982
|
+
break;
|
|
983
|
+
case "b":
|
|
984
|
+
style.borderBottomWidth = w;
|
|
985
|
+
break;
|
|
986
|
+
case "l":
|
|
987
|
+
style.borderLeftWidth = w;
|
|
988
|
+
break;
|
|
989
|
+
}
|
|
990
|
+
return !0;
|
|
991
|
+
}
|
|
992
|
+
return !1;
|
|
993
|
+
}
|
|
994
|
+
function parseBorderColor(className, style) {
|
|
995
|
+
if (!className.startsWith("border-"))
|
|
996
|
+
return !1;
|
|
997
|
+
const colorClass = className.slice(7), color = resolveColor(colorClass);
|
|
998
|
+
if (color) {
|
|
999
|
+
style.borderColor = color;
|
|
1000
|
+
return !0;
|
|
1001
|
+
}
|
|
1002
|
+
return !1;
|
|
1003
|
+
}
|
|
1004
|
+
function parseOpacity(className, style) {
|
|
1005
|
+
if (!className.startsWith("opacity-"))
|
|
1006
|
+
return !1;
|
|
1007
|
+
const value = Number.parseInt(className.slice(8));
|
|
1008
|
+
if (!Number.isNaN(value)) {
|
|
1009
|
+
style.opacity = value / 100;
|
|
1010
|
+
return !0;
|
|
1011
|
+
}
|
|
1012
|
+
return !1;
|
|
1013
|
+
}
|
|
1014
|
+
function parseTypography(className, style) {
|
|
1015
|
+
if (className.startsWith("tracking-[")) {
|
|
1016
|
+
const value = arbitraryLength(className.slice(9), typeof style.fontSize === "number" ? style.fontSize : 16);
|
|
1017
|
+
if (value === void 0)
|
|
1018
|
+
return !1;
|
|
1019
|
+
style.letterSpacing = value;
|
|
1020
|
+
return !0;
|
|
1021
|
+
}
|
|
1022
|
+
if (className.startsWith("leading-")) {
|
|
1023
|
+
const value = className.slice(8), size = typeof style.fontSize === "number" ? style.fontSize : 16, ratios = { none: 1, tight: 1.25, snug: 1.375, normal: 1.5, relaxed: 1.625, loose: 2 }, length = value.startsWith("[") ? /^\[[\d.]+\]$/.test(value) ? Number.parseFloat(value.slice(1, -1)) * size : arbitraryLength(value, size) : ratios[value] !== void 0 ? ratios[value] * size : spacing[value];
|
|
1024
|
+
if (length === void 0 || !Number.isFinite(length))
|
|
1025
|
+
return !1;
|
|
1026
|
+
style.lineHeight = length;
|
|
1027
|
+
return !0;
|
|
1028
|
+
}
|
|
1029
|
+
return !1;
|
|
1030
|
+
}
|
|
1031
|
+
function parseGridColumns(className, style) {
|
|
1032
|
+
const match = /^grid-cols-(\d+)$/.exec(className);
|
|
1033
|
+
if (!match)
|
|
1034
|
+
return !1;
|
|
1035
|
+
style.gridColumns = Number(match[1]);
|
|
1036
|
+
return !0;
|
|
1037
|
+
}
|
|
1038
|
+
function parseSize(className, style) {
|
|
1039
|
+
if (!className.startsWith("size-"))
|
|
1040
|
+
return !1;
|
|
1041
|
+
const value = className.slice(5), size = value === "full" ? "100%" : resolveSpacing(value);
|
|
1042
|
+
if (size === void 0)
|
|
1043
|
+
return !1;
|
|
1044
|
+
style.width = size;
|
|
1045
|
+
style.height = size;
|
|
1046
|
+
return !0;
|
|
1047
|
+
}
|
|
1048
|
+
function parsePosition(className, style) {
|
|
1049
|
+
const match = /^(-?)(top|right|bottom|left)-(.+)$/.exec(className);
|
|
1050
|
+
if (!match)
|
|
1051
|
+
return !1;
|
|
1052
|
+
const size = match[3] === "full" ? "100%" : resolveSpacing(match[3]);
|
|
1053
|
+
if (size === void 0)
|
|
1054
|
+
return !1;
|
|
1055
|
+
style[match[2]] = typeof size === "number" && match[1] ? -size : size;
|
|
1056
|
+
return !0;
|
|
1057
|
+
}
|
|
1058
|
+
function parseSpace(className, style) {
|
|
1059
|
+
const match = /^space-(x|y)-(.+)$/.exec(className);
|
|
1060
|
+
if (!match)
|
|
1061
|
+
return !1;
|
|
1062
|
+
const size = resolveSpacing(match[2]);
|
|
1063
|
+
if (size === void 0)
|
|
1064
|
+
return !1;
|
|
1065
|
+
style.gap = size;
|
|
1066
|
+
return !0;
|
|
1067
|
+
}
|
|
1068
|
+
function parseGap(className, style) {
|
|
1069
|
+
if (className.startsWith("gap-")) {
|
|
1070
|
+
const size = resolveSpacing(className.slice(4));
|
|
1071
|
+
if (size !== void 0) {
|
|
1072
|
+
style.gap = size;
|
|
1073
|
+
return !0;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
if (className.startsWith("gap-x-")) {
|
|
1077
|
+
const size = resolveSpacing(className.slice(6));
|
|
1078
|
+
if (size !== void 0) {
|
|
1079
|
+
style.columnGap = size;
|
|
1080
|
+
return !0;
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
if (className.startsWith("gap-y-")) {
|
|
1084
|
+
const size = resolveSpacing(className.slice(6));
|
|
1085
|
+
if (size !== void 0) {
|
|
1086
|
+
style.rowGap = size;
|
|
1087
|
+
return !0;
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
return !1;
|
|
1091
|
+
}
|
|
1092
|
+
export function compileClassStyles(classes) {
|
|
1093
|
+
const plain = [], dark = [];
|
|
1094
|
+
for (const name of classes.split(/\s+/).filter(Boolean))
|
|
1095
|
+
if (name.startsWith("dark:"))
|
|
1096
|
+
dark.push(name.slice(5));
|
|
1097
|
+
else if (!name.includes(":") || name.startsWith("["))
|
|
1098
|
+
plain.push(name);
|
|
1099
|
+
const unknown = [], result = { style: compileHeadwindToStyle(plain.join(" "), unknown), unknown };
|
|
1100
|
+
if (dark.length)
|
|
1101
|
+
result.dark = compileHeadwindToStyle(dark.join(" "), unknown);
|
|
1102
|
+
for (const name of plain) {
|
|
1103
|
+
if (name === "truncate")
|
|
1104
|
+
result.numberOfLines = 1;
|
|
1105
|
+
const clamp = /^line-clamp-(\d+)$/.exec(name);
|
|
1106
|
+
if (clamp)
|
|
1107
|
+
result.numberOfLines = Number(clamp[1]);
|
|
1108
|
+
if (!result.icon && /^i-[a-z0-9]+-[a-z0-9-]+$/.test(name))
|
|
1109
|
+
result.icon = name;
|
|
1110
|
+
}
|
|
1111
|
+
result.unknown = unknown.filter((name) => !/^line-clamp-\d+$/.test(name));
|
|
1112
|
+
return result;
|
|
1113
|
+
}
|
|
1114
|
+
export function compileHeadwindToStyle(classes, unknown) {
|
|
1115
|
+
const style = {}, classNames = classes.split(/\s+/).filter(Boolean);
|
|
1116
|
+
for (const className of classNames) {
|
|
1117
|
+
if (/^i-[a-z0-9]+-/.test(className))
|
|
1118
|
+
continue;
|
|
1119
|
+
const exactParser = classParsers[className];
|
|
1120
|
+
if (exactParser) {
|
|
1121
|
+
exactParser("", style);
|
|
1122
|
+
continue;
|
|
1123
|
+
}
|
|
1124
|
+
if (parseBackgroundColor(className, style))
|
|
1125
|
+
continue;
|
|
1126
|
+
if (parseTextColor(className, style))
|
|
1127
|
+
continue;
|
|
1128
|
+
if (parsePadding(className, style))
|
|
1129
|
+
continue;
|
|
1130
|
+
if (parseMargin(className, style))
|
|
1131
|
+
continue;
|
|
1132
|
+
if (parseWidth(className, style))
|
|
1133
|
+
continue;
|
|
1134
|
+
if (parseHeight(className, style))
|
|
1135
|
+
continue;
|
|
1136
|
+
if (parseBorderRadius(className, style))
|
|
1137
|
+
continue;
|
|
1138
|
+
if (parseBorderWidth(className, style))
|
|
1139
|
+
continue;
|
|
1140
|
+
if (parseBorderColor(className, style))
|
|
1141
|
+
continue;
|
|
1142
|
+
if (parseOpacity(className, style))
|
|
1143
|
+
continue;
|
|
1144
|
+
if (parseGap(className, style))
|
|
1145
|
+
continue;
|
|
1146
|
+
if (parseTypography(className, style))
|
|
1147
|
+
continue;
|
|
1148
|
+
if (parseSize(className, style))
|
|
1149
|
+
continue;
|
|
1150
|
+
if (parseGridColumns(className, style))
|
|
1151
|
+
continue;
|
|
1152
|
+
if (parsePosition(className, style))
|
|
1153
|
+
continue;
|
|
1154
|
+
if (parseSpace(className, style))
|
|
1155
|
+
continue;
|
|
1156
|
+
unknown?.push(className);
|
|
1157
|
+
if (typeof process < "u" && process.env?.NODE_ENV === "development")
|
|
1158
|
+
console.warn(`[STX Native] Unknown Headwind class: ${className}`);
|
|
1159
|
+
}
|
|
1160
|
+
return style;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
export { colors, spacing, fontSizes, borderRadius };
|