@farm.js/core 0.1.51-beta.2 → 0.1.51-beta.3
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/{agent-mcp-handler-WWCC4GLG.mjs → agent-mcp-handler-7JSKGSOW.mjs} +4 -4
- package/dist/{agent-mcp-handler-RT3COCEL.cjs → agent-mcp-handler-YE4AGWHN.cjs} +5 -5
- package/dist/{agent-mcp.d-CR5Ov83o.d.ts → agent-mcp.d-BAR9njbJ.d.ts} +1 -1
- package/dist/{agent-mcp.d-Z5DuwrqW.d.mts → agent-mcp.d-BJKChOrO.d.mts} +1 -1
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/{analyzer-Z6TNEAET.mjs → analyzer-OTPEWH5W.mjs} +14 -3
- package/dist/{analyzer-T76CN3S7.cjs → analyzer-TSQXZCZN.cjs} +14 -3
- package/dist/api/route-manager.d.mts +4 -4
- package/dist/api/route-manager.d.ts +4 -4
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/{app-manifest.d-DiWr_Jfx.d.ts → app-manifest.d-BLFbaqx8.d.ts} +1 -1
- package/dist/{app-manifest.d-CAHkOBFa.d.mts → app-manifest.d-DEQNnNhV.d.mts} +1 -1
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +3 -3
- package/dist/{app.d-DmapqkbV.d.ts → app.d-CNPaUYaa.d.ts} +4 -4
- package/dist/{app.d-BfgJCsTQ.d.mts → app.d-CT7xDkj2.d.mts} +4 -4
- package/dist/{chunk-YVJV7Q2X.mjs → chunk-3BLEXUGE.mjs} +1 -1
- package/dist/chunk-3HLQTOVU.cjs +6 -0
- package/dist/{chunk-E6LTONL4.mjs → chunk-3SMXQNFD.mjs} +2 -2
- package/dist/{chunk-PMKUU273.mjs → chunk-3TLKUBXG.mjs} +411 -166
- package/dist/{chunk-74Z5KX4A.mjs → chunk-3WSIYBMG.mjs} +41 -19
- package/dist/{chunk-GNJIYJMS.cjs → chunk-3XQ57EFI.cjs} +16 -16
- package/dist/{chunk-GW4YUIHW.mjs → chunk-3Z63X45F.mjs} +1 -1
- package/dist/{chunk-IBSAYAWB.mjs → chunk-4353ZRE5.mjs} +1 -1
- package/dist/{chunk-SBABQKPT.cjs → chunk-46KXZBOG.cjs} +5 -5
- package/dist/{chunk-YU42A5MA.cjs → chunk-4CGOMZP3.cjs} +221 -199
- package/dist/{chunk-J3LBO2O4.cjs → chunk-4SEHMBL4.cjs} +10 -10
- package/dist/{chunk-E73PGHSR.mjs → chunk-4TKAIO2F.mjs} +3 -3
- package/dist/{chunk-NJLTQR5P.cjs → chunk-53SACYBY.cjs} +7 -7
- package/dist/{chunk-FM2UEKS2.mjs → chunk-5FXPJIOT.mjs} +2 -2
- package/dist/{chunk-QXPSWMUD.cjs → chunk-7MD37P5V.cjs} +5 -5
- package/dist/{chunk-JATTVAHA.cjs → chunk-B3GM5I6N.cjs} +4 -4
- package/dist/{chunk-WJFFPXCV.cjs → chunk-D7UQC4O6.cjs} +10 -8
- package/dist/{chunk-KRRZJ77U.mjs → chunk-E5DXF5GE.mjs} +2 -2
- package/dist/chunk-EFZGB7JC.cjs +114 -0
- package/dist/{chunk-NYQSC4DX.cjs → chunk-FFE2EMF7.cjs} +5 -5
- package/dist/{chunk-CTM4SPB3.mjs → chunk-GAO7MS5O.mjs} +4 -3
- package/dist/{chunk-HIFIG6HL.cjs → chunk-H33PJEXN.cjs} +5 -5
- package/dist/{chunk-NXBHYO7S.cjs → chunk-HLWOWZFX.cjs} +2 -2
- package/dist/chunk-JXEPLIXD.cjs +389 -0
- package/dist/{chunk-NPQLMP7M.cjs → chunk-KLNFJDFM.cjs} +10 -9
- package/dist/{chunk-KBRZAYI7.mjs → chunk-LDNSSHEG.mjs} +2 -2
- package/dist/chunk-LLZSYFOM.mjs +6 -0
- package/dist/{chunk-N77JBPLC.mjs → chunk-LPDKG6RA.mjs} +9 -7
- package/dist/chunk-MIGFX2FN.mjs +758 -0
- package/dist/{chunk-72D2NX77.mjs → chunk-MRNDAJEV.mjs} +1 -1
- package/dist/{chunk-4SSRBCBR.mjs → chunk-NOTSHVRN.mjs} +355 -218
- package/dist/{chunk-GUJTVM36.cjs → chunk-OAMUSC7H.cjs} +1 -1
- package/dist/chunk-P6MHI5O2.cjs +758 -0
- package/dist/{chunk-6CYQQQGR.mjs → chunk-R4PHCZ3G.mjs} +1 -1
- package/dist/{chunk-WZW6LEHM.cjs → chunk-TQMI6BYO.cjs} +675 -430
- package/dist/{chunk-76GHW3WI.cjs → chunk-TSFMFPRU.cjs} +4 -4
- package/dist/{chunk-5N7QAGEA.cjs → chunk-TWHXBMLJ.cjs} +37 -7
- package/dist/{chunk-BOVGCUDZ.cjs → chunk-UJL4JOXV.cjs} +2 -2
- package/dist/chunk-UQF3OJVE.mjs +389 -0
- package/dist/{chunk-DTU4PX7V.cjs → chunk-WGUHDWT5.cjs} +557 -420
- package/dist/{chunk-LAZK6UV7.mjs → chunk-YAJTD3ZG.mjs} +1 -1
- package/dist/{chunk-7UPCJDB5.mjs → chunk-YUEYBL35.mjs} +2 -2
- package/dist/{chunk-EIMK7D2D.mjs → chunk-ZD2VKAUI.mjs} +34 -4
- package/dist/chunk-ZNXTU4YH.mjs +114 -0
- package/dist/{client-plugins.d-Bx3FXpqm.d.mts → client-plugins.d-DllmH8eM.d.mts} +17 -4
- package/dist/{client-plugins.d-TiLbS5j4.d.ts → client-plugins.d-n3iWY1EJ.d.ts} +17 -4
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/{config.d-iRPI16ku.d.ts → config.d-DqKaCr1r.d.mts} +8 -1
- package/dist/{config.d-iRPI16ku.d.mts → config.d-DqKaCr1r.d.ts} +8 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/desktop.d.mts +3 -3
- package/dist/desktop.d.ts +3 -3
- package/dist/{devtools-6XWCZIGO.cjs → devtools-TO6TAO32.cjs} +5 -5
- package/dist/{devtools-UQLDAOEI.mjs → devtools-UESYARTF.mjs} +4 -4
- package/dist/docs.cjs +7 -7
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +6 -6
- package/dist/index.cjs +22 -18
- package/dist/{index.d-YxJ2AiDF.d.mts → index.d-BL7KKiwa.d.mts} +1 -1
- package/dist/{index.d-yueUNipJ.d.ts → index.d-BXsAXm1U.d.ts} +1 -1
- package/dist/index.d.mts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.mjs +22 -18
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +20 -18
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +19 -17
- package/dist/internal/cli-runtime.cjs +7 -7
- package/dist/internal/cli-runtime.mjs +6 -6
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +2 -2
- package/dist/internal/compression-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.cjs +6 -6
- package/dist/internal/config-runtime.d.mts +31 -7
- package/dist/internal/config-runtime.d.ts +31 -7
- package/dist/internal/config-runtime.mjs +5 -5
- package/dist/internal/infra-analytics-runtime.cjs +8 -8
- package/dist/internal/infra-analytics-runtime.mjs +6 -6
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +87 -9
- package/dist/internal/production-runtime.d.mts +44 -12
- package/dist/internal/production-runtime.d.ts +44 -12
- package/dist/internal/production-runtime.mjs +86 -8
- package/dist/markdown.cjs +4 -2
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.mjs +3 -1
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/mobile.d.mts +21 -5
- package/dist/mobile.d.ts +21 -5
- package/dist/native-tree-EBPDFTRW.mjs +25 -0
- package/dist/native-tree-MMZS7S6W.cjs +25 -0
- package/dist/{navigation-delegate.d-HnDXhlyP.d.mts → navigation-delegate.d-C76gXTmO.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BY1e_Xrh.d.ts → navigation-delegate.d-DIyDslxt.d.ts} +1 -1
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/plugin.cjs +14 -13
- package/dist/plugin.d.mts +5 -4
- package/dist/plugin.d.ts +5 -4
- package/dist/plugin.mjs +13 -12
- package/dist/{production-runtime.d-BpJUDzP8.d.mts → production-runtime.d-CDHztggO.d.mts} +1 -1
- package/dist/{production-runtime.d-lMjvE9cf.d.ts → production-runtime.d-tyaGdbk6.d.ts} +1 -1
- package/dist/{programmatic-routes-client.d-BlFp5hv4.d.ts → programmatic-routes-client.d-XfmIrCK1.d.ts} +2 -2
- package/dist/{programmatic-routes-client.d-6CGQ3TCk.d.mts → programmatic-routes-client.d-aAWiDd64.d.mts} +2 -2
- package/dist/{render-plan.d-BH9edqKs.d.mts → render-plan.d-Diwybxo8.d.mts} +1 -1
- package/dist/{render-plan.d-DhP0mTHF.d.ts → render-plan.d-Dr5WRjoV.d.ts} +1 -1
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/{request.d-BVZrsR1v.d.ts → request.d-D01fRn--.d.ts} +1 -1
- package/dist/{request.d-DJFRdKi8.d.mts → request.d-Dd3AFR79.d.mts} +1 -1
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/{route-rendering.d-Bpmw7PED.d.mts → route-rendering.d-BQ53lJ_D.d.mts} +1 -1
- package/dist/{route-rendering.d-B00JtK_-.d.ts → route-rendering.d-Bhx4QoJt.d.ts} +1 -1
- package/dist/{router.d-e0jQ3jQ-.d.mts → router.d-Bi23a6Xc.d.mts} +1 -1
- package/dist/{router.d-Bd1x9XxQ.d.ts → router.d-DQ3k7EYn.d.ts} +1 -1
- package/dist/{routes.d-Cmv8TgVq.d.mts → routes.d-BgTd7vI4.d.mts} +3 -3
- package/dist/{routes.d-D96Dq9lz.d.ts → routes.d-C7jMJFvP.d.ts} +3 -3
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/{rsc-pipeline-ZQ4CTVEG.mjs → rsc-pipeline-K3ER3Q4N.mjs} +5 -5
- package/dist/{rsc-pipeline-DX4OC5FN.cjs → rsc-pipeline-OCZIT5OF.cjs} +6 -6
- package/dist/{runtime-NQ3EDSA7.cjs → runtime-DKNSIH7V.cjs} +30 -23
- package/dist/{runtime-NPDRDV6R.mjs → runtime-MKYDEUZT.mjs} +20 -13
- package/dist/{runtime.d-CgB3IJDq.d.mts → runtime.d-B2Js6qZ2.d.mts} +1 -1
- package/dist/{runtime.d-D-td-RR3.d.ts → runtime.d-BL-CGwoi.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +31 -30
- package/dist/server.d.mts +11 -10
- package/dist/server.d.ts +11 -10
- package/dist/server.mjs +16 -15
- package/dist/{spa-router.d-BWDhS0FK.d.mts → spa-router.d-B2rIFGs0.d.mts} +2 -2
- package/dist/{spa-router.d-CO01mVOM.d.ts → spa-router.d-DqZ6Lfs0.d.ts} +2 -2
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/{utils.d-B77__yh8.d.ts → utils.d-Bv2MPeLR.d.ts} +1 -1
- package/dist/{utils.d-DRDazhCA.d.mts → utils.d-fqXe8lNc.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +14 -13
- package/dist/vite.d.mts +12 -6
- package/dist/vite.d.ts +12 -6
- package/dist/vite.mjs +13 -12
- package/package.json +1 -1
|
@@ -0,0 +1,758 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/mobile/native-theme.ts
|
|
2
|
+
var FARM_NATIVE_THEME = {
|
|
3
|
+
spacing: 4,
|
|
4
|
+
colors: {
|
|
5
|
+
"red-50": "#fef2f2",
|
|
6
|
+
"red-100": "#ffe2e2",
|
|
7
|
+
"red-200": "#ffc9c9",
|
|
8
|
+
"red-300": "#ffa2a2",
|
|
9
|
+
"red-400": "#ff6467",
|
|
10
|
+
"red-500": "#fb2c36",
|
|
11
|
+
"red-600": "#e7000b",
|
|
12
|
+
"red-700": "#c10007",
|
|
13
|
+
"red-800": "#9f0712",
|
|
14
|
+
"red-900": "#82181a",
|
|
15
|
+
"red-950": "#460809",
|
|
16
|
+
"orange-50": "#fff7ed",
|
|
17
|
+
"orange-100": "#ffedd4",
|
|
18
|
+
"orange-200": "#ffd6a7",
|
|
19
|
+
"orange-300": "#ffb86a",
|
|
20
|
+
"orange-400": "#ff8904",
|
|
21
|
+
"orange-500": "#ff6900",
|
|
22
|
+
"orange-600": "#f54900",
|
|
23
|
+
"orange-700": "#ca3500",
|
|
24
|
+
"orange-800": "#9f2d00",
|
|
25
|
+
"orange-900": "#7e2a0c",
|
|
26
|
+
"orange-950": "#441306",
|
|
27
|
+
"amber-50": "#fffbeb",
|
|
28
|
+
"amber-100": "#fef3c6",
|
|
29
|
+
"amber-200": "#fee685",
|
|
30
|
+
"amber-300": "#ffd230",
|
|
31
|
+
"amber-400": "#ffb900",
|
|
32
|
+
"amber-500": "#fe9a00",
|
|
33
|
+
"amber-600": "#e17100",
|
|
34
|
+
"amber-700": "#bb4d00",
|
|
35
|
+
"amber-800": "#973c00",
|
|
36
|
+
"amber-900": "#7b3306",
|
|
37
|
+
"amber-950": "#461901",
|
|
38
|
+
"yellow-50": "#fefce8",
|
|
39
|
+
"yellow-100": "#fef9c2",
|
|
40
|
+
"yellow-200": "#fff085",
|
|
41
|
+
"yellow-300": "#ffdf20",
|
|
42
|
+
"yellow-400": "#fdc700",
|
|
43
|
+
"yellow-500": "#f0b100",
|
|
44
|
+
"yellow-600": "#d08700",
|
|
45
|
+
"yellow-700": "#a65f00",
|
|
46
|
+
"yellow-800": "#894b00",
|
|
47
|
+
"yellow-900": "#733e0a",
|
|
48
|
+
"yellow-950": "#432004",
|
|
49
|
+
"lime-50": "#f7fee7",
|
|
50
|
+
"lime-100": "#ecfcca",
|
|
51
|
+
"lime-200": "#d8f999",
|
|
52
|
+
"lime-300": "#bbf451",
|
|
53
|
+
"lime-400": "#9ae600",
|
|
54
|
+
"lime-500": "#7ccf00",
|
|
55
|
+
"lime-600": "#5ea500",
|
|
56
|
+
"lime-700": "#497d00",
|
|
57
|
+
"lime-800": "#3c6300",
|
|
58
|
+
"lime-900": "#35530e",
|
|
59
|
+
"lime-950": "#192e03",
|
|
60
|
+
"green-50": "#f0fdf4",
|
|
61
|
+
"green-100": "#dcfce7",
|
|
62
|
+
"green-200": "#b9f8cf",
|
|
63
|
+
"green-300": "#7bf1a8",
|
|
64
|
+
"green-400": "#05df72",
|
|
65
|
+
"green-500": "#00c950",
|
|
66
|
+
"green-600": "#00a63e",
|
|
67
|
+
"green-700": "#008236",
|
|
68
|
+
"green-800": "#016630",
|
|
69
|
+
"green-900": "#0d542b",
|
|
70
|
+
"green-950": "#032e15",
|
|
71
|
+
"emerald-50": "#ecfdf5",
|
|
72
|
+
"emerald-100": "#d0fae5",
|
|
73
|
+
"emerald-200": "#a4f4cf",
|
|
74
|
+
"emerald-300": "#5ee9b5",
|
|
75
|
+
"emerald-400": "#00d492",
|
|
76
|
+
"emerald-500": "#00bc7d",
|
|
77
|
+
"emerald-600": "#009966",
|
|
78
|
+
"emerald-700": "#007a55",
|
|
79
|
+
"emerald-800": "#006045",
|
|
80
|
+
"emerald-900": "#004f3b",
|
|
81
|
+
"emerald-950": "#002c22",
|
|
82
|
+
"teal-50": "#f0fdfa",
|
|
83
|
+
"teal-100": "#cbfbf1",
|
|
84
|
+
"teal-200": "#96f7e4",
|
|
85
|
+
"teal-300": "#46ecd5",
|
|
86
|
+
"teal-400": "#00d5be",
|
|
87
|
+
"teal-500": "#00bba7",
|
|
88
|
+
"teal-600": "#009689",
|
|
89
|
+
"teal-700": "#00786f",
|
|
90
|
+
"teal-800": "#005f5a",
|
|
91
|
+
"teal-900": "#0b4f4a",
|
|
92
|
+
"teal-950": "#022f2e",
|
|
93
|
+
"cyan-50": "#ecfeff",
|
|
94
|
+
"cyan-100": "#cefafe",
|
|
95
|
+
"cyan-200": "#a2f4fd",
|
|
96
|
+
"cyan-300": "#53eafd",
|
|
97
|
+
"cyan-400": "#00d3f2",
|
|
98
|
+
"cyan-500": "#00b8db",
|
|
99
|
+
"cyan-600": "#0092b8",
|
|
100
|
+
"cyan-700": "#007595",
|
|
101
|
+
"cyan-800": "#005f78",
|
|
102
|
+
"cyan-900": "#104e64",
|
|
103
|
+
"cyan-950": "#053345",
|
|
104
|
+
"sky-50": "#f0f9ff",
|
|
105
|
+
"sky-100": "#dff2fe",
|
|
106
|
+
"sky-200": "#b8e6fe",
|
|
107
|
+
"sky-300": "#74d4ff",
|
|
108
|
+
"sky-400": "#00bcff",
|
|
109
|
+
"sky-500": "#00a6f4",
|
|
110
|
+
"sky-600": "#0084d1",
|
|
111
|
+
"sky-700": "#0069a8",
|
|
112
|
+
"sky-800": "#00598a",
|
|
113
|
+
"sky-900": "#024a70",
|
|
114
|
+
"sky-950": "#052f4a",
|
|
115
|
+
"blue-50": "#eff6ff",
|
|
116
|
+
"blue-100": "#dbeafe",
|
|
117
|
+
"blue-200": "#bedbff",
|
|
118
|
+
"blue-300": "#8ec5ff",
|
|
119
|
+
"blue-400": "#51a2ff",
|
|
120
|
+
"blue-500": "#2b7fff",
|
|
121
|
+
"blue-600": "#155dfc",
|
|
122
|
+
"blue-700": "#1447e6",
|
|
123
|
+
"blue-800": "#193cb8",
|
|
124
|
+
"blue-900": "#1c398e",
|
|
125
|
+
"blue-950": "#162456",
|
|
126
|
+
"indigo-50": "#eef2ff",
|
|
127
|
+
"indigo-100": "#e0e7ff",
|
|
128
|
+
"indigo-200": "#c6d2ff",
|
|
129
|
+
"indigo-300": "#a3b3ff",
|
|
130
|
+
"indigo-400": "#7c86ff",
|
|
131
|
+
"indigo-500": "#615fff",
|
|
132
|
+
"indigo-600": "#4f39f6",
|
|
133
|
+
"indigo-700": "#432dd7",
|
|
134
|
+
"indigo-800": "#372aac",
|
|
135
|
+
"indigo-900": "#312c85",
|
|
136
|
+
"indigo-950": "#1e1a4d",
|
|
137
|
+
"violet-50": "#f5f3ff",
|
|
138
|
+
"violet-100": "#ede9fe",
|
|
139
|
+
"violet-200": "#ddd6ff",
|
|
140
|
+
"violet-300": "#c4b4ff",
|
|
141
|
+
"violet-400": "#a684ff",
|
|
142
|
+
"violet-500": "#8e51ff",
|
|
143
|
+
"violet-600": "#7f22fe",
|
|
144
|
+
"violet-700": "#7008e7",
|
|
145
|
+
"violet-800": "#5d0ec0",
|
|
146
|
+
"violet-900": "#4d179a",
|
|
147
|
+
"violet-950": "#2f0d68",
|
|
148
|
+
"purple-50": "#faf5ff",
|
|
149
|
+
"purple-100": "#f3e8ff",
|
|
150
|
+
"purple-200": "#e9d4ff",
|
|
151
|
+
"purple-300": "#dab2ff",
|
|
152
|
+
"purple-400": "#c27aff",
|
|
153
|
+
"purple-500": "#ad46ff",
|
|
154
|
+
"purple-600": "#9810fa",
|
|
155
|
+
"purple-700": "#8200db",
|
|
156
|
+
"purple-800": "#6e11b0",
|
|
157
|
+
"purple-900": "#59168b",
|
|
158
|
+
"purple-950": "#3c0366",
|
|
159
|
+
"fuchsia-50": "#fdf4ff",
|
|
160
|
+
"fuchsia-100": "#fae8ff",
|
|
161
|
+
"fuchsia-200": "#f6cfff",
|
|
162
|
+
"fuchsia-300": "#f4a8ff",
|
|
163
|
+
"fuchsia-400": "#ed6aff",
|
|
164
|
+
"fuchsia-500": "#e12afb",
|
|
165
|
+
"fuchsia-600": "#c800de",
|
|
166
|
+
"fuchsia-700": "#a800b7",
|
|
167
|
+
"fuchsia-800": "#8a0194",
|
|
168
|
+
"fuchsia-900": "#721378",
|
|
169
|
+
"fuchsia-950": "#4b004f",
|
|
170
|
+
"pink-50": "#fdf2f8",
|
|
171
|
+
"pink-100": "#fce7f3",
|
|
172
|
+
"pink-200": "#fccee8",
|
|
173
|
+
"pink-300": "#fda5d5",
|
|
174
|
+
"pink-400": "#fb64b6",
|
|
175
|
+
"pink-500": "#f6339a",
|
|
176
|
+
"pink-600": "#e60076",
|
|
177
|
+
"pink-700": "#c6005c",
|
|
178
|
+
"pink-800": "#a3004c",
|
|
179
|
+
"pink-900": "#861043",
|
|
180
|
+
"pink-950": "#510424",
|
|
181
|
+
"rose-50": "#fff1f2",
|
|
182
|
+
"rose-100": "#ffe4e6",
|
|
183
|
+
"rose-200": "#ffccd3",
|
|
184
|
+
"rose-300": "#ffa1ad",
|
|
185
|
+
"rose-400": "#ff637e",
|
|
186
|
+
"rose-500": "#ff2056",
|
|
187
|
+
"rose-600": "#ec003f",
|
|
188
|
+
"rose-700": "#c70036",
|
|
189
|
+
"rose-800": "#a50036",
|
|
190
|
+
"rose-900": "#8b0836",
|
|
191
|
+
"rose-950": "#4d0218",
|
|
192
|
+
"slate-50": "#f8fafc",
|
|
193
|
+
"slate-100": "#f1f5f9",
|
|
194
|
+
"slate-200": "#e2e8f0",
|
|
195
|
+
"slate-300": "#cad5e2",
|
|
196
|
+
"slate-400": "#90a1b9",
|
|
197
|
+
"slate-500": "#62748e",
|
|
198
|
+
"slate-600": "#45556c",
|
|
199
|
+
"slate-700": "#314158",
|
|
200
|
+
"slate-800": "#1d293d",
|
|
201
|
+
"slate-900": "#0f172b",
|
|
202
|
+
"slate-950": "#020618",
|
|
203
|
+
"gray-50": "#f9fafb",
|
|
204
|
+
"gray-100": "#f3f4f6",
|
|
205
|
+
"gray-200": "#e5e7eb",
|
|
206
|
+
"gray-300": "#d1d5dc",
|
|
207
|
+
"gray-400": "#99a1af",
|
|
208
|
+
"gray-500": "#6a7282",
|
|
209
|
+
"gray-600": "#4a5565",
|
|
210
|
+
"gray-700": "#364153",
|
|
211
|
+
"gray-800": "#1e2939",
|
|
212
|
+
"gray-900": "#101828",
|
|
213
|
+
"gray-950": "#030712",
|
|
214
|
+
"zinc-50": "#fafafa",
|
|
215
|
+
"zinc-100": "#f4f4f5",
|
|
216
|
+
"zinc-200": "#e4e4e7",
|
|
217
|
+
"zinc-300": "#d4d4d8",
|
|
218
|
+
"zinc-400": "#9f9fa9",
|
|
219
|
+
"zinc-500": "#71717b",
|
|
220
|
+
"zinc-600": "#52525c",
|
|
221
|
+
"zinc-700": "#3f3f46",
|
|
222
|
+
"zinc-800": "#27272a",
|
|
223
|
+
"zinc-900": "#18181b",
|
|
224
|
+
"zinc-950": "#09090b",
|
|
225
|
+
"neutral-50": "#fafafa",
|
|
226
|
+
"neutral-100": "#f5f5f5",
|
|
227
|
+
"neutral-200": "#e5e5e5",
|
|
228
|
+
"neutral-300": "#d4d4d4",
|
|
229
|
+
"neutral-400": "#a1a1a1",
|
|
230
|
+
"neutral-500": "#737373",
|
|
231
|
+
"neutral-600": "#525252",
|
|
232
|
+
"neutral-700": "#404040",
|
|
233
|
+
"neutral-800": "#262626",
|
|
234
|
+
"neutral-900": "#171717",
|
|
235
|
+
"neutral-950": "#0a0a0a",
|
|
236
|
+
"stone-50": "#fafaf9",
|
|
237
|
+
"stone-100": "#f5f5f4",
|
|
238
|
+
"stone-200": "#e7e5e4",
|
|
239
|
+
"stone-300": "#d6d3d1",
|
|
240
|
+
"stone-400": "#a6a09b",
|
|
241
|
+
"stone-500": "#79716b",
|
|
242
|
+
"stone-600": "#57534d",
|
|
243
|
+
"stone-700": "#44403b",
|
|
244
|
+
"stone-800": "#292524",
|
|
245
|
+
"stone-900": "#1c1917",
|
|
246
|
+
"stone-950": "#0c0a09",
|
|
247
|
+
"mauve-50": "#fafafa",
|
|
248
|
+
"mauve-100": "#f3f1f3",
|
|
249
|
+
"mauve-200": "#e7e4e7",
|
|
250
|
+
"mauve-300": "#d7d0d7",
|
|
251
|
+
"mauve-400": "#a89ea9",
|
|
252
|
+
"mauve-500": "#79697b",
|
|
253
|
+
"mauve-600": "#594c5b",
|
|
254
|
+
"mauve-700": "#463947",
|
|
255
|
+
"mauve-800": "#2a212c",
|
|
256
|
+
"mauve-900": "#1d161e",
|
|
257
|
+
"mauve-950": "#0c090c",
|
|
258
|
+
"olive-50": "#fbfbf9",
|
|
259
|
+
"olive-100": "#f4f4f0",
|
|
260
|
+
"olive-200": "#e8e8e3",
|
|
261
|
+
"olive-300": "#d8d8d0",
|
|
262
|
+
"olive-400": "#abab9c",
|
|
263
|
+
"olive-500": "#7c7c67",
|
|
264
|
+
"olive-600": "#5b5b4b",
|
|
265
|
+
"olive-700": "#474739",
|
|
266
|
+
"olive-800": "#2b2b22",
|
|
267
|
+
"olive-900": "#1d1d16",
|
|
268
|
+
"olive-950": "#0c0c09",
|
|
269
|
+
"mist-50": "#f9fbfb",
|
|
270
|
+
"mist-100": "#f1f3f3",
|
|
271
|
+
"mist-200": "#e3e7e8",
|
|
272
|
+
"mist-300": "#d0d6d8",
|
|
273
|
+
"mist-400": "#9ca8ab",
|
|
274
|
+
"mist-500": "#67787c",
|
|
275
|
+
"mist-600": "#4b585b",
|
|
276
|
+
"mist-700": "#394447",
|
|
277
|
+
"mist-800": "#22292b",
|
|
278
|
+
"mist-900": "#161b1d",
|
|
279
|
+
"mist-950": "#090b0c",
|
|
280
|
+
"taupe-50": "#fbfaf9",
|
|
281
|
+
"taupe-100": "#f3f1f1",
|
|
282
|
+
"taupe-200": "#e8e4e3",
|
|
283
|
+
"taupe-300": "#d8d2d0",
|
|
284
|
+
"taupe-400": "#aba09c",
|
|
285
|
+
"taupe-500": "#7c6d67",
|
|
286
|
+
"taupe-600": "#5b4f4b",
|
|
287
|
+
"taupe-700": "#473c39",
|
|
288
|
+
"taupe-800": "#2b2422",
|
|
289
|
+
"taupe-900": "#1d1816",
|
|
290
|
+
"taupe-950": "#0c0a09",
|
|
291
|
+
black: "#000000",
|
|
292
|
+
white: "#ffffff"
|
|
293
|
+
},
|
|
294
|
+
text: {
|
|
295
|
+
xs: [12, 16],
|
|
296
|
+
sm: [14, 20],
|
|
297
|
+
base: [16, 24],
|
|
298
|
+
lg: [18, 28],
|
|
299
|
+
xl: [20, 28],
|
|
300
|
+
"2xl": [24, 32],
|
|
301
|
+
"3xl": [30, 36],
|
|
302
|
+
"4xl": [36, 40],
|
|
303
|
+
"5xl": [48, 48],
|
|
304
|
+
"6xl": [60, 60],
|
|
305
|
+
"7xl": [72, 72],
|
|
306
|
+
"8xl": [96, 96],
|
|
307
|
+
"9xl": [128, 128]
|
|
308
|
+
},
|
|
309
|
+
fontWeight: {
|
|
310
|
+
thin: 100,
|
|
311
|
+
extralight: 200,
|
|
312
|
+
light: 300,
|
|
313
|
+
normal: 400,
|
|
314
|
+
medium: 500,
|
|
315
|
+
semibold: 600,
|
|
316
|
+
bold: 700,
|
|
317
|
+
extrabold: 800,
|
|
318
|
+
black: 900
|
|
319
|
+
},
|
|
320
|
+
tracking: { tighter: -0.05, tight: -0.025, normal: 0, wide: 0.025, wider: 0.05, widest: 0.1 },
|
|
321
|
+
leading: { tight: 1.25, snug: 1.375, normal: 1.5, relaxed: 1.625, loose: 2 },
|
|
322
|
+
radius: { xs: 2, sm: 4, md: 6, lg: 8, xl: 12, "2xl": 16, "3xl": 24, "4xl": 32 },
|
|
323
|
+
container: {
|
|
324
|
+
"3xs": 256,
|
|
325
|
+
"2xs": 288,
|
|
326
|
+
xs: 320,
|
|
327
|
+
sm: 384,
|
|
328
|
+
md: 448,
|
|
329
|
+
lg: 512,
|
|
330
|
+
xl: 576,
|
|
331
|
+
"2xl": 672,
|
|
332
|
+
"3xl": 768,
|
|
333
|
+
"4xl": 896,
|
|
334
|
+
"5xl": 1024,
|
|
335
|
+
"6xl": 1152,
|
|
336
|
+
"7xl": 1280
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
// src/mobile/native-style.ts
|
|
341
|
+
var FARM_NATIVE_TEXT_KEYS = /* @__PURE__ */ new Set([
|
|
342
|
+
"color",
|
|
343
|
+
"fontSize",
|
|
344
|
+
"lineHeight",
|
|
345
|
+
"fontWeight",
|
|
346
|
+
"fontStyle",
|
|
347
|
+
"fontFamily",
|
|
348
|
+
"textAlign",
|
|
349
|
+
"letterSpacing",
|
|
350
|
+
"textTransform",
|
|
351
|
+
"textDecorationLine",
|
|
352
|
+
// `leading-*`: a multiple of the font size, or a fixed height. Either wins over the line
|
|
353
|
+
// height a `text-*` size sets, as in Tailwind.
|
|
354
|
+
"lineHeightScale",
|
|
355
|
+
"lineHeightPx"
|
|
356
|
+
]);
|
|
357
|
+
var ALL_SIDES = ["Top", "Right", "Bottom", "Left"];
|
|
358
|
+
var ALL_CORNERS = ["TopLeft", "TopRight", "BottomRight", "BottomLeft"];
|
|
359
|
+
var each = (keys, value) => Object.fromEntries(keys.map((key) => [key, value]));
|
|
360
|
+
var SIDES = {
|
|
361
|
+
t: ["Top"],
|
|
362
|
+
r: ["Right"],
|
|
363
|
+
b: ["Bottom"],
|
|
364
|
+
l: ["Left"],
|
|
365
|
+
x: ["Left", "Right"],
|
|
366
|
+
y: ["Top", "Bottom"],
|
|
367
|
+
s: ["Left"],
|
|
368
|
+
e: ["Right"]
|
|
369
|
+
};
|
|
370
|
+
var CORNERS = {
|
|
371
|
+
t: ["TopLeft", "TopRight"],
|
|
372
|
+
r: ["TopRight", "BottomRight"],
|
|
373
|
+
b: ["BottomLeft", "BottomRight"],
|
|
374
|
+
l: ["TopLeft", "BottomLeft"],
|
|
375
|
+
tl: ["TopLeft"],
|
|
376
|
+
tr: ["TopRight"],
|
|
377
|
+
br: ["BottomRight"],
|
|
378
|
+
bl: ["BottomLeft"]
|
|
379
|
+
};
|
|
380
|
+
var ALIGN = {
|
|
381
|
+
start: "flex-start",
|
|
382
|
+
end: "flex-end",
|
|
383
|
+
center: "center",
|
|
384
|
+
between: "space-between",
|
|
385
|
+
around: "space-around",
|
|
386
|
+
evenly: "space-evenly",
|
|
387
|
+
stretch: "stretch",
|
|
388
|
+
baseline: "baseline",
|
|
389
|
+
auto: "auto"
|
|
390
|
+
};
|
|
391
|
+
var DROPPED = /^(?:relative|cursor-.+|select-.+|outline-.+|pointer-events-.+)$/;
|
|
392
|
+
function spacing(value) {
|
|
393
|
+
if (value === "px") return 1;
|
|
394
|
+
if (value === "auto") return "auto";
|
|
395
|
+
if (!/^\d+(?:\.5)?$/.test(value)) return void 0;
|
|
396
|
+
return Number(value) * FARM_NATIVE_THEME.spacing;
|
|
397
|
+
}
|
|
398
|
+
function size(value) {
|
|
399
|
+
if (value === "full") return "100%";
|
|
400
|
+
const fraction = /^(\d+)\/(\d+)$/.exec(value);
|
|
401
|
+
if (fraction) return `${Math.round(Number(fraction[1]) / Number(fraction[2]) * 1e4) / 100}%`;
|
|
402
|
+
return spacing(value);
|
|
403
|
+
}
|
|
404
|
+
function color(value) {
|
|
405
|
+
const [name, alpha] = value.split("/");
|
|
406
|
+
if (name === "transparent") return "transparent";
|
|
407
|
+
if (name === "current" || name === "inherit") return "currentColor";
|
|
408
|
+
const hex = FARM_NATIVE_THEME.colors[name];
|
|
409
|
+
if (!hex) return void 0;
|
|
410
|
+
if (alpha === void 0) return hex;
|
|
411
|
+
if (!/^\d{1,3}$/.test(alpha) || Number(alpha) > 100) return void 0;
|
|
412
|
+
return `${hex}${Math.round(Number(alpha) / 100 * 255).toString(16).padStart(2, "0")}`;
|
|
413
|
+
}
|
|
414
|
+
function utility(token) {
|
|
415
|
+
if (DROPPED.test(token)) return {};
|
|
416
|
+
switch (token) {
|
|
417
|
+
case "flex":
|
|
418
|
+
return { display: "flex", flexDirection: "row" };
|
|
419
|
+
case "flex-row":
|
|
420
|
+
return { flexDirection: "row" };
|
|
421
|
+
case "flex-col":
|
|
422
|
+
return { flexDirection: "column" };
|
|
423
|
+
case "flex-1":
|
|
424
|
+
return { flexGrow: 1, flexShrink: 1, flexBasis: 0 };
|
|
425
|
+
case "flex-auto":
|
|
426
|
+
return { flexGrow: 1, flexShrink: 1 };
|
|
427
|
+
case "flex-initial":
|
|
428
|
+
return { flexGrow: 0, flexShrink: 1 };
|
|
429
|
+
case "flex-none":
|
|
430
|
+
return { flexGrow: 0, flexShrink: 0 };
|
|
431
|
+
case "grow":
|
|
432
|
+
return { flexGrow: 1 };
|
|
433
|
+
case "grow-0":
|
|
434
|
+
return { flexGrow: 0 };
|
|
435
|
+
case "shrink":
|
|
436
|
+
return { flexShrink: 1 };
|
|
437
|
+
case "shrink-0":
|
|
438
|
+
return { flexShrink: 0 };
|
|
439
|
+
case "flex-nowrap":
|
|
440
|
+
return {};
|
|
441
|
+
case "hidden":
|
|
442
|
+
return { display: "none" };
|
|
443
|
+
case "overflow-hidden":
|
|
444
|
+
return { overflow: "hidden" };
|
|
445
|
+
case "overflow-visible":
|
|
446
|
+
return { overflow: "visible" };
|
|
447
|
+
case "italic":
|
|
448
|
+
return { fontStyle: "italic" };
|
|
449
|
+
case "not-italic":
|
|
450
|
+
return { fontStyle: "normal" };
|
|
451
|
+
case "underline":
|
|
452
|
+
return { textDecorationLine: "underline" };
|
|
453
|
+
case "line-through":
|
|
454
|
+
return { textDecorationLine: "line-through" };
|
|
455
|
+
case "no-underline":
|
|
456
|
+
return { textDecorationLine: "none" };
|
|
457
|
+
case "uppercase":
|
|
458
|
+
case "lowercase":
|
|
459
|
+
case "capitalize":
|
|
460
|
+
return { textTransform: token };
|
|
461
|
+
case "normal-case":
|
|
462
|
+
return { textTransform: "none" };
|
|
463
|
+
case "text-left":
|
|
464
|
+
case "text-center":
|
|
465
|
+
case "text-right":
|
|
466
|
+
case "text-justify":
|
|
467
|
+
return { textAlign: token.slice(5) };
|
|
468
|
+
case "rounded":
|
|
469
|
+
return each(
|
|
470
|
+
ALL_CORNERS.map((corner) => `border${corner}Radius`),
|
|
471
|
+
FARM_NATIVE_THEME.radius.sm
|
|
472
|
+
);
|
|
473
|
+
case "border":
|
|
474
|
+
return {
|
|
475
|
+
...each(
|
|
476
|
+
ALL_SIDES.map((side) => `border${side}Width`),
|
|
477
|
+
1
|
|
478
|
+
),
|
|
479
|
+
...each(
|
|
480
|
+
ALL_SIDES.map((side) => `border${side}Color`),
|
|
481
|
+
"currentColor"
|
|
482
|
+
)
|
|
483
|
+
};
|
|
484
|
+
case "border-solid":
|
|
485
|
+
case "border-dashed":
|
|
486
|
+
case "border-dotted":
|
|
487
|
+
return { borderStyle: token.slice(7) };
|
|
488
|
+
case "border-none":
|
|
489
|
+
return { borderStyle: "none" };
|
|
490
|
+
}
|
|
491
|
+
let match = /^(items|justify|self)-([a-z]+)$/.exec(token);
|
|
492
|
+
if (match) {
|
|
493
|
+
const value = ALIGN[match[2]];
|
|
494
|
+
if (!value) return void 0;
|
|
495
|
+
const key = { items: "alignItems", justify: "justifyContent", self: "alignSelf" }[match[1]];
|
|
496
|
+
return { [key]: value };
|
|
497
|
+
}
|
|
498
|
+
match = /^(-?)(p|m)([trblxyse]?)-(.+)$/.exec(token);
|
|
499
|
+
if (match) {
|
|
500
|
+
const value = spacing(match[4]);
|
|
501
|
+
if (value === void 0 || match[2] === "p" && (value === "auto" || match[1]))
|
|
502
|
+
return void 0;
|
|
503
|
+
const signed = match[1] && typeof value === "number" ? -value : value;
|
|
504
|
+
const property = match[2] === "p" ? "padding" : "margin";
|
|
505
|
+
const sides = match[3] ? SIDES[match[3]] : ALL_SIDES;
|
|
506
|
+
return each(
|
|
507
|
+
sides.map((side) => `${property}${side}`),
|
|
508
|
+
signed
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
match = /^gap(-[xy])?-(.+)$/.exec(token);
|
|
512
|
+
if (match) {
|
|
513
|
+
const value = spacing(match[2]);
|
|
514
|
+
if (typeof value !== "number") return void 0;
|
|
515
|
+
if (match[1] === "-x") return { columnGap: value };
|
|
516
|
+
if (match[1] === "-y") return { rowGap: value };
|
|
517
|
+
return { rowGap: value, columnGap: value };
|
|
518
|
+
}
|
|
519
|
+
match = /^(w|h|size|min-w|min-h|max-h)-(.+)$/.exec(token);
|
|
520
|
+
if (match) {
|
|
521
|
+
const value = size(match[2]);
|
|
522
|
+
if (value === void 0 || value === "auto" && match[1].includes("-")) return void 0;
|
|
523
|
+
if (match[1] === "size") return { width: value, height: value };
|
|
524
|
+
const key = {
|
|
525
|
+
w: "width",
|
|
526
|
+
h: "height",
|
|
527
|
+
"min-w": "minWidth",
|
|
528
|
+
"min-h": "minHeight",
|
|
529
|
+
"max-h": "maxHeight"
|
|
530
|
+
}[match[1]];
|
|
531
|
+
return value === "auto" ? {} : { [key]: value };
|
|
532
|
+
}
|
|
533
|
+
match = /^max-w-(.+)$/.exec(token);
|
|
534
|
+
if (match) {
|
|
535
|
+
if (match[1] === "none") return {};
|
|
536
|
+
if (match[1] === "full") return { maxWidth: "100%" };
|
|
537
|
+
const value = FARM_NATIVE_THEME.container[match[1]];
|
|
538
|
+
return value === void 0 ? void 0 : { maxWidth: value };
|
|
539
|
+
}
|
|
540
|
+
match = /^text-(.+)$/.exec(token);
|
|
541
|
+
if (match) {
|
|
542
|
+
const text = FARM_NATIVE_THEME.text[match[1]];
|
|
543
|
+
if (text) return { fontSize: text[0], lineHeight: text[1] };
|
|
544
|
+
const value = color(match[1]);
|
|
545
|
+
return value === void 0 ? void 0 : { color: value };
|
|
546
|
+
}
|
|
547
|
+
match = /^font-(.+)$/.exec(token);
|
|
548
|
+
if (match) {
|
|
549
|
+
if (match[1] === "sans" || match[1] === "serif" || match[1] === "mono") {
|
|
550
|
+
return { fontFamily: match[1] };
|
|
551
|
+
}
|
|
552
|
+
const weight = FARM_NATIVE_THEME.fontWeight[match[1]];
|
|
553
|
+
return weight === void 0 ? void 0 : { fontWeight: weight };
|
|
554
|
+
}
|
|
555
|
+
match = /^leading-(.+)$/.exec(token);
|
|
556
|
+
if (match) {
|
|
557
|
+
if (match[1] === "none") return { lineHeightScale: 1 };
|
|
558
|
+
const scale = FARM_NATIVE_THEME.leading[match[1]];
|
|
559
|
+
if (scale !== void 0) return { lineHeightScale: scale };
|
|
560
|
+
const value = spacing(match[1]);
|
|
561
|
+
return typeof value === "number" ? { lineHeightPx: value } : void 0;
|
|
562
|
+
}
|
|
563
|
+
match = /^tracking-(.+)$/.exec(token);
|
|
564
|
+
if (match) {
|
|
565
|
+
const value = FARM_NATIVE_THEME.tracking[match[1]];
|
|
566
|
+
return value === void 0 ? void 0 : { letterSpacing: value };
|
|
567
|
+
}
|
|
568
|
+
match = /^bg-(.+)$/.exec(token);
|
|
569
|
+
if (match) {
|
|
570
|
+
const value = color(match[1]);
|
|
571
|
+
return value === void 0 ? void 0 : { backgroundColor: value };
|
|
572
|
+
}
|
|
573
|
+
match = /^border-([trblxy])$/.exec(token);
|
|
574
|
+
if (match) {
|
|
575
|
+
return each(
|
|
576
|
+
SIDES[match[1]].map((side) => `border${side}Width`),
|
|
577
|
+
1
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
match = /^border(?:-([trblxy]))?-(.+)$/.exec(token);
|
|
581
|
+
if (match) {
|
|
582
|
+
const sides = match[1] ? SIDES[match[1]] : ALL_SIDES;
|
|
583
|
+
if (/^(?:0|2|4|8)$/.test(match[2])) {
|
|
584
|
+
return Object.fromEntries(sides.map((side) => [`border${side}Width`, Number(match[2])]));
|
|
585
|
+
}
|
|
586
|
+
const value = color(match[2]);
|
|
587
|
+
if (value === void 0) return void 0;
|
|
588
|
+
return Object.fromEntries(sides.map((side) => [`border${side}Color`, value]));
|
|
589
|
+
}
|
|
590
|
+
match = /^rounded(?:-([trbl]{1,2}))?(?:-([a-z0-9]+))?$/.exec(token);
|
|
591
|
+
if (match) {
|
|
592
|
+
const radius = match[2] === void 0 ? FARM_NATIVE_THEME.radius.sm : match[2] === "none" ? 0 : match[2] === "full" ? 9999 : FARM_NATIVE_THEME.radius[match[2]];
|
|
593
|
+
if (radius === void 0) return void 0;
|
|
594
|
+
const corners = match[1] ? CORNERS[match[1]] : [...ALL_CORNERS];
|
|
595
|
+
if (!corners) return void 0;
|
|
596
|
+
return Object.fromEntries(corners.map((corner) => [`border${corner}Radius`, radius]));
|
|
597
|
+
}
|
|
598
|
+
match = /^opacity-(\d{1,3})$/.exec(token);
|
|
599
|
+
if (match && Number(match[1]) <= 100) return { opacity: Number(match[1]) / 100 };
|
|
600
|
+
return void 0;
|
|
601
|
+
}
|
|
602
|
+
function farmNativeClassProblem(token) {
|
|
603
|
+
const parts = token.split(":");
|
|
604
|
+
const base = parts.pop().replace(/^!/, "");
|
|
605
|
+
if (parts.some((variant) => variant !== "dark")) {
|
|
606
|
+
return `"${token}" needs a variant the native tier cannot apply`;
|
|
607
|
+
}
|
|
608
|
+
if (base.includes("[")) return `"${token}" is an arbitrary value`;
|
|
609
|
+
return utility(base) === void 0 ? `class "${token}" has no native-tier style` : void 0;
|
|
610
|
+
}
|
|
611
|
+
function resolveFarmNativeClasses(className) {
|
|
612
|
+
const light = [];
|
|
613
|
+
const darkParts = [];
|
|
614
|
+
const unsupported = [];
|
|
615
|
+
for (const token of className.split(/\s+/)) {
|
|
616
|
+
if (!token) continue;
|
|
617
|
+
if (farmNativeClassProblem(token)) {
|
|
618
|
+
unsupported.push(token);
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
const parts = token.split(":");
|
|
622
|
+
(parts.length > 1 ? darkParts : light).push(utility(parts.pop().replace(/^!/, "")));
|
|
623
|
+
}
|
|
624
|
+
const merge = (parts) => Object.assign(
|
|
625
|
+
{},
|
|
626
|
+
...parts.sort((left, right) => Object.keys(right).length - Object.keys(left).length)
|
|
627
|
+
);
|
|
628
|
+
const style = merge(light);
|
|
629
|
+
return { style, ...darkParts.length > 0 ? { dark: merge(darkParts) } : {}, unsupported };
|
|
630
|
+
}
|
|
631
|
+
function longhands(style) {
|
|
632
|
+
const [[key, value]] = Object.entries(style);
|
|
633
|
+
if (key === "gap") return { rowGap: value, columnGap: value };
|
|
634
|
+
if (key === "borderWidth")
|
|
635
|
+
return each(
|
|
636
|
+
ALL_SIDES.map((side) => `border${side}Width`),
|
|
637
|
+
value
|
|
638
|
+
);
|
|
639
|
+
if (key === "borderColor")
|
|
640
|
+
return each(
|
|
641
|
+
ALL_SIDES.map((side) => `border${side}Color`),
|
|
642
|
+
value
|
|
643
|
+
);
|
|
644
|
+
if (key === "borderRadius") {
|
|
645
|
+
return each(
|
|
646
|
+
ALL_CORNERS.map((corner) => `border${corner}Radius`),
|
|
647
|
+
value
|
|
648
|
+
);
|
|
649
|
+
}
|
|
650
|
+
return style;
|
|
651
|
+
}
|
|
652
|
+
var PX = /^(-?\d*\.?\d+)px$/;
|
|
653
|
+
function cssLength(value) {
|
|
654
|
+
if (value === "0") return 0;
|
|
655
|
+
if (value === "auto") return "auto";
|
|
656
|
+
const px = PX.exec(value);
|
|
657
|
+
if (px) return Number(px[1]);
|
|
658
|
+
if (/^-?\d*\.?\d+%$/.test(value)) return value;
|
|
659
|
+
const rem = /^(-?\d*\.?\d+)rem$/.exec(value);
|
|
660
|
+
return rem ? Number(rem[1]) * 16 : void 0;
|
|
661
|
+
}
|
|
662
|
+
var CSS_LENGTHS = new Set(
|
|
663
|
+
"gap row-gap column-gap padding-top padding-right padding-bottom padding-left margin-top margin-right margin-bottom margin-left width height min-width min-height max-width max-height border-width border-top-width border-right-width border-bottom-width border-left-width border-radius font-size line-height letter-spacing flex-basis".split(" ")
|
|
664
|
+
);
|
|
665
|
+
var CSS_KEYWORDS = {
|
|
666
|
+
display: /* @__PURE__ */ new Set(["flex", "none"]),
|
|
667
|
+
"flex-direction": /* @__PURE__ */ new Set(["row", "column"]),
|
|
668
|
+
"align-items": /* @__PURE__ */ new Set(["flex-start", "flex-end", "center", "stretch", "baseline"]),
|
|
669
|
+
"align-self": /* @__PURE__ */ new Set(["auto", "flex-start", "flex-end", "center", "stretch", "baseline"]),
|
|
670
|
+
"justify-content": /* @__PURE__ */ new Set([
|
|
671
|
+
"flex-start",
|
|
672
|
+
"flex-end",
|
|
673
|
+
"center",
|
|
674
|
+
"space-between",
|
|
675
|
+
"space-around",
|
|
676
|
+
"space-evenly"
|
|
677
|
+
]),
|
|
678
|
+
"font-style": /* @__PURE__ */ new Set(["normal", "italic"]),
|
|
679
|
+
"text-align": /* @__PURE__ */ new Set(["left", "center", "right", "justify"]),
|
|
680
|
+
"text-transform": /* @__PURE__ */ new Set(["none", "uppercase", "lowercase", "capitalize"]),
|
|
681
|
+
"text-decoration-line": /* @__PURE__ */ new Set(["none", "underline", "line-through"]),
|
|
682
|
+
"border-style": /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "none"]),
|
|
683
|
+
overflow: /* @__PURE__ */ new Set(["hidden", "visible"])
|
|
684
|
+
};
|
|
685
|
+
var CSS_COLORS = /* @__PURE__ */ new Set(["color", "background-color", "border-color"]);
|
|
686
|
+
var CSS_NUMBERS = /* @__PURE__ */ new Set(["opacity", "flex-grow", "flex-shrink", "font-weight"]);
|
|
687
|
+
var SHORTHAND_SIDES = ["Top", "Right", "Bottom", "Left"];
|
|
688
|
+
var FARM_NATIVE_STYLE_PROPERTIES = new Set(
|
|
689
|
+
[
|
|
690
|
+
...CSS_LENGTHS,
|
|
691
|
+
...CSS_COLORS,
|
|
692
|
+
...CSS_NUMBERS,
|
|
693
|
+
...Object.keys(CSS_KEYWORDS),
|
|
694
|
+
"padding",
|
|
695
|
+
"margin",
|
|
696
|
+
"flex"
|
|
697
|
+
].map((property) => property.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()))
|
|
698
|
+
);
|
|
699
|
+
function camel(property) {
|
|
700
|
+
return property.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
701
|
+
}
|
|
702
|
+
function cssColor(value) {
|
|
703
|
+
if (/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(value)) return value.toLowerCase();
|
|
704
|
+
if (value === "transparent" || value === "currentcolor") {
|
|
705
|
+
return value === "currentcolor" ? "currentColor" : value;
|
|
706
|
+
}
|
|
707
|
+
const rgb = /^rgba?\((\d{1,3})[ ,]+(\d{1,3})[ ,]+(\d{1,3})(?:[ ,/]+([\d.]+%?))?\)$/i.exec(value);
|
|
708
|
+
if (!rgb) return value === "white" ? "#ffffff" : value === "black" ? "#000000" : void 0;
|
|
709
|
+
const hex = rgb.slice(1, 4).map((channel) => Math.min(255, Number(channel)).toString(16).padStart(2, "0")).join("");
|
|
710
|
+
if (rgb[4] === void 0) return `#${hex}`;
|
|
711
|
+
const alpha = rgb[4].endsWith("%") ? Number(rgb[4].slice(0, -1)) / 100 : Number(rgb[4]);
|
|
712
|
+
return `#${hex}${Math.round(Math.min(1, alpha) * 255).toString(16).padStart(2, "0")}`;
|
|
713
|
+
}
|
|
714
|
+
function resolveFarmNativeInlineStyle(css) {
|
|
715
|
+
const style = {};
|
|
716
|
+
const unsupported = [];
|
|
717
|
+
for (const declaration of css.split(";")) {
|
|
718
|
+
const colon = declaration.indexOf(":");
|
|
719
|
+
if (colon < 0) continue;
|
|
720
|
+
const property = declaration.slice(0, colon).trim().toLowerCase();
|
|
721
|
+
const value = declaration.slice(colon + 1).trim().toLowerCase();
|
|
722
|
+
if (!property) continue;
|
|
723
|
+
let resolved;
|
|
724
|
+
if (property === "padding" || property === "margin") {
|
|
725
|
+
const parts = value.split(/\s+/).map(cssLength);
|
|
726
|
+
if (parts.length <= 4 && parts.every((part) => part !== void 0)) {
|
|
727
|
+
const [top, right = top, bottom = top, left = right] = parts;
|
|
728
|
+
const values = [top, right, bottom, left];
|
|
729
|
+
resolved = Object.fromEntries(
|
|
730
|
+
SHORTHAND_SIDES.map((side, index) => [`${property}${side}`, values[index]])
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
} else if (CSS_LENGTHS.has(property)) {
|
|
734
|
+
const length = cssLength(value);
|
|
735
|
+
if (length !== void 0) resolved = { [camel(property)]: length };
|
|
736
|
+
} else if (CSS_COLORS.has(property)) {
|
|
737
|
+
const parsed = cssColor(value);
|
|
738
|
+
if (parsed) resolved = { [camel(property)]: parsed };
|
|
739
|
+
} else if (CSS_NUMBERS.has(property)) {
|
|
740
|
+
if (/^\d*\.?\d+$/.test(value)) resolved = { [camel(property)]: Number(value) };
|
|
741
|
+
} else if (_optionalChain([CSS_KEYWORDS, 'access', _2 => _2[property], 'optionalAccess', _3 => _3.has, 'call', _4 => _4(value)])) {
|
|
742
|
+
resolved = { [camel(property)]: value };
|
|
743
|
+
} else if (property === "flex" && /^\d+$/.test(value)) {
|
|
744
|
+
resolved = { flexGrow: Number(value), flexShrink: 1, flexBasis: 0 };
|
|
745
|
+
}
|
|
746
|
+
if (resolved) Object.assign(style, longhands(resolved));
|
|
747
|
+
else unsupported.push(`${property}: ${value}`);
|
|
748
|
+
}
|
|
749
|
+
return { style, unsupported };
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
exports.FARM_NATIVE_TEXT_KEYS = FARM_NATIVE_TEXT_KEYS; exports.farmNativeClassProblem = farmNativeClassProblem; exports.resolveFarmNativeClasses = resolveFarmNativeClasses; exports.FARM_NATIVE_STYLE_PROPERTIES = FARM_NATIVE_STYLE_PROPERTIES; exports.resolveFarmNativeInlineStyle = resolveFarmNativeInlineStyle;
|