@tuuject/koi-tokens 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +39 -2
- package/dist/dimensions.d.ts +150 -0
- package/dist/dimensions.js +154 -0
- package/dist/native.d.ts +374 -0
- package/dist/native.js +380 -0
- package/dist/palette-kit.d.ts +35 -0
- package/dist/palette-kit.js +96 -0
- package/dist/palette.d.ts +779 -0
- package/dist/palette.js +1383 -0
- package/dist/panda-preset.d.ts +4 -0
- package/dist/panda-preset.js +1243 -0
- package/dist/theme-init.js +29 -0
- package/dist/tokens.css +420 -0
- package/fonts/00744f2b0f1e3a0e71521b7f5511b30c.woff2 +0 -0
- package/fonts/00b4ecd1817ecf947ca664b4fce8a4ad.woff2 +0 -0
- package/fonts/020f0fa79f25f5cfa8506d2f431df767.woff2 +0 -0
- package/fonts/03317bcae1fdca87a87769c43fd1ce47.woff2 +0 -0
- package/fonts/06d0a95f1efd8d124a255600ece94494.woff2 +0 -0
- package/fonts/06e7c4ae0fa82b85be634e3c308bf4b3.woff2 +0 -0
- package/fonts/0bad1aeeb4500b6301d8d3b64dcc3c73.woff2 +0 -0
- package/fonts/0d14b3729a41fc911ff13c3e4fe328c7.woff2 +0 -0
- package/fonts/0d6b7caaa1be1467b901364154c917b1.woff2 +0 -0
- package/fonts/0e73696b7f29da06cb67fe062f1b8a0c.woff2 +0 -0
- package/fonts/114edcf282654c7c63c8234c13b4b089.woff2 +0 -0
- package/fonts/1548b3024522036bb36484bbb82345c8.woff2 +0 -0
- package/fonts/17a63a64b5e2aac1dbe08b6b901f8856.woff2 +0 -0
- package/fonts/1f1f99649d10cf4638c162b7f5cd127a.woff2 +0 -0
- package/fonts/23f3a6ad5586406597914ccdfa6485a4.woff2 +0 -0
- package/fonts/242bc3d315aabb2c760c22901a294381.woff2 +0 -0
- package/fonts/28e0c9f4f663c3f04ba89ba81d19a2ad.woff2 +0 -0
- package/fonts/2928810ffc97278ca4fd2b599a1e9b6e.woff2 +0 -0
- package/fonts/2a66ebc75f6b74521f3042801a93ffe2.woff2 +0 -0
- package/fonts/2b46bd327dad644b0411ba6041e2e1cf.woff2 +0 -0
- package/fonts/30b3cf0ad50d03aeef55b669f99da4fa.woff2 +0 -0
- package/fonts/30c37e68fbeb4952e205077a53b7eab9.woff2 +0 -0
- package/fonts/333a4e28420bfab893a59cfa1c39c4b3.woff2 +0 -0
- package/fonts/34735fd05b36eaadb090efd3ba6409fa.woff2 +0 -0
- package/fonts/396b875417270491b2e4d246b980bbc8.woff2 +0 -0
- package/fonts/3a59340ca71997c84885188961d30e72.woff2 +0 -0
- package/fonts/3ab85b02fd30c5efe3dce62b69a7bea9.woff2 +0 -0
- package/fonts/3d54bf645647805f52d0281ed0228833.woff2 +0 -0
- package/fonts/409d74c42bdbae43d406a441af69a95f.woff2 +0 -0
- package/fonts/41050fd57f10e50907fd856f3a08346b.woff2 +0 -0
- package/fonts/418b784f58090a3a36c5dc1c53b62704.woff2 +0 -0
- package/fonts/42b4508a095cde5d8e9d25b07986f95f.woff2 +0 -0
- package/fonts/4409e57103e082215798f5214b4a3637.woff2 +0 -0
- package/fonts/44b889b0db6383d450ba3218ed64e108.woff2 +0 -0
- package/fonts/45f3d6d7263d515d4a2b58ff040fcc48.woff2 +0 -0
- package/fonts/46fe5b1f008721214771f40a4bd9bd72.woff2 +0 -0
- package/fonts/479f65c995cb67ce3a460c697dce9e22.woff2 +0 -0
- package/fonts/486b4a4a84c7578264e1303ecc433b16.woff2 +0 -0
- package/fonts/49b5445e12abe2d3eed431f38cfbb037.woff2 +0 -0
- package/fonts/4c4f826589fc39d61b1919ad8b627f80.woff2 +0 -0
- package/fonts/4cd5c9017bd228aca94124a40497f635.woff2 +0 -0
- package/fonts/4ecec2bf5c75f5ccb280052fb53157db.woff2 +0 -0
- package/fonts/4f0e75d692721110bee70b4e0d71300a.woff2 +0 -0
- package/fonts/518a6f44c506e83d1068d7515b0b8cb7.woff2 +0 -0
- package/fonts/5391ad919de181aa8608e4a0f1bd8c09.woff2 +0 -0
- package/fonts/53fe3ba2954fef70128d6733a90f8601.woff2 +0 -0
- package/fonts/56374bb0572ee6463de3cb83496d3f36.woff2 +0 -0
- package/fonts/574b1e1f154cecf2ac873c7a7544023b.woff2 +0 -0
- package/fonts/5a899d3bb4efd96c8fa0452768a3d456.woff2 +0 -0
- package/fonts/5e11c9b612776d9aee6b2062e3fccb55.woff2 +0 -0
- package/fonts/658767ed025bc501c3013e1f63c86bcb.woff2 +0 -0
- package/fonts/65c499c6e48d6c1b7827d6ff1d1eab60.woff2 +0 -0
- package/fonts/6760e79d75ce409f09427e56e3c025dc.woff2 +0 -0
- package/fonts/67d5234b7c17f407e8a242ce5ada493d.woff2 +0 -0
- package/fonts/6fbfc0af5a7ef4c448e8c1f5f1e91a60.woff2 +0 -0
- package/fonts/709e77d11c679cffc2dc25b032c67764.woff2 +0 -0
- package/fonts/75541edae19d80ac844e3d4a1b0e711a.woff2 +0 -0
- package/fonts/779acde69b4191ed711e89f176fae2d5.woff2 +0 -0
- package/fonts/7ade1c118b1bc97b3971f06048aa1e7a.woff2 +0 -0
- package/fonts/7f1ef4145bf986fb433cf7101594dbb8.woff2 +0 -0
- package/fonts/7ff32e4612a40f0203fe4d2409e515e8.woff2 +0 -0
- package/fonts/82afad3d44e99cbf1fb2a204740d7fd2.woff2 +0 -0
- package/fonts/86d79968a677302ec040c57fdbab6576.woff2 +0 -0
- package/fonts/8779a26aa266a22e886093a4ef65b0bd.woff2 +0 -0
- package/fonts/890aa53ea0c3bb3f35af8d1b17932473.woff2 +0 -0
- package/fonts/8cb1aba653e86d46fa31bf573631acd8.woff2 +0 -0
- package/fonts/8d9c6a762bbdfada274c0207bda44234.woff2 +0 -0
- package/fonts/8e9c72c231c8aa96c5b012f676fb54c3.woff2 +0 -0
- package/fonts/90501be40b3dbe4bb109d3f46dac3c61.woff2 +0 -0
- package/fonts/90e09d4c8c204194c134a583b5c1288b.woff2 +0 -0
- package/fonts/923694b5cdecd8647ba08a59697ab0cc.woff2 +0 -0
- package/fonts/9269e657048e89d04d79f8507e3cf1c3.woff2 +0 -0
- package/fonts/93de4eca97bc343ece70a4eeb03bd4a4.woff2 +0 -0
- package/fonts/98939883b0194fe74f877650c78b94c4.woff2 +0 -0
- package/fonts/993ac31171f7c467735857b80fe3cf7b.woff2 +0 -0
- package/fonts/9ae2fdcb005bd7479a071ecd605c4fd6.woff2 +0 -0
- package/fonts/9b4a1427f1fa323ed77767ee8f3a7321.woff2 +0 -0
- package/fonts/9c62c786a52ff747ef38e9acf9e65498.woff2 +0 -0
- package/fonts/9d53647c2ce0f4a1824203e0c644c41f.woff2 +0 -0
- package/fonts/9e1626f7a444a0a34b87a47d57de3e8b.woff2 +0 -0
- package/fonts/a07cb815b1d6dcee1e531a94d44aacdb.woff2 +0 -0
- package/fonts/a2a0ba09a982eca5baf40d99fd12196d.woff2 +0 -0
- package/fonts/a384403ad6999ff7528f25fff9ebf8cc.woff2 +0 -0
- package/fonts/aa37a3aaae61ab3cd934944af6ee9e10.woff2 +0 -0
- package/fonts/ab7939cba0d4b9d5a3b91073405b5704.woff2 +0 -0
- package/fonts/ad0be591acad4d101daab250ab3f6b13.woff2 +0 -0
- package/fonts/b1690dc0318a2d6ed494c70714c369fb.woff2 +0 -0
- package/fonts/b27ed0031d733b4f92aefe3a0bdad1a3.woff2 +0 -0
- package/fonts/b3a36aae2ce94efc1b33a812b0a63723.woff2 +0 -0
- package/fonts/b408e0a9c403f84d826fedddad4eafce.woff2 +0 -0
- package/fonts/b7552d432bbe1131f8b081a8a304c826.woff2 +0 -0
- package/fonts/b833866d3ed2eaf4157e4297f4db5818.woff2 +0 -0
- package/fonts/b86065dc8cf074e9da64f7cad2418175.woff2 +0 -0
- package/fonts/b90bb4ee23ef9b5e9a729a5a76885d8d.woff2 +0 -0
- package/fonts/bd6bc332a723d00071b7bd73098b1fca.woff2 +0 -0
- package/fonts/c1c4a62366427c476d7505d8d5607d43.woff2 +0 -0
- package/fonts/c37032acc02b2ec9bb82ea7e221a70f0.woff2 +0 -0
- package/fonts/c61c4905f06bdace00a01fee99fe4b4d.woff2 +0 -0
- package/fonts/c9e516ccf548caff87ac46d4a49d8439.woff2 +0 -0
- package/fonts/d29782161ecac8d5da44b6dbd63d98f1.woff2 +0 -0
- package/fonts/d5b155ab8ea80680e3a22b4b54282913.woff2 +0 -0
- package/fonts/d620b1ee2164749fe8d928f722896d1c.woff2 +0 -0
- package/fonts/d89b25cb16ce4004c3ba90531c1886d1.woff2 +0 -0
- package/fonts/d920f76005494dd4a42508a011b5bc7f.woff2 +0 -0
- package/fonts/d945c834b912b4ace6cf283b3731d66c.woff2 +0 -0
- package/fonts/deacad65f91899cb01176de287a9c00c.woff2 +0 -0
- package/fonts/dfb7d78b6b838654f246ad1b2b5b4b72.woff2 +0 -0
- package/fonts/dfe41a1b55be51bdac0d41e5c8b1e3b7.woff2 +0 -0
- package/fonts/e431ea7665f64dccbedcaa0ed19fccb7.woff2 +0 -0
- package/fonts/e71d1216d5e6b470598a17c11a0b132b.woff2 +0 -0
- package/fonts/e768b29b57d95b735c13984980dbd3b8.woff2 +0 -0
- package/fonts/e7efc76412d4935b4567b2760eb300fd.woff2 +0 -0
- package/fonts/ee11a2523b2c5b1ae3af86d162a95f8d.woff2 +0 -0
- package/fonts/efec9899498ea2c9be7453a7901c936e.woff2 +0 -0
- package/fonts/f1c118f9188115a5a596531b92587a83.woff2 +0 -0
- package/fonts/f36f25301e61cfb9d1f3200e047e927a.woff2 +0 -0
- package/fonts/f497194ba693571f76789df48028d494.woff2 +0 -0
- package/fonts/f6717ea5a513aacfe7494fdb6fdca2fa.woff2 +0 -0
- package/fonts/fab526c8b7ec2e57851baa1d4d61448f.woff2 +0 -0
- package/fonts/fb6e6ac34118a226d7cd3d1fbc5ddef1.woff2 +0 -0
- package/fonts/fd1d2083d4f38dc1f6f4dd0947f51f5d.woff2 +0 -0
- package/fonts/fonts.css +182 -0
- package/package.json +49 -3
- package/src/contrast-pairs.json +144 -0
- package/src/palette-kit.ts +140 -0
- package/src/tokens.json +1870 -0
package/dist/native.js
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
// GENERATED by packages/tokens/scripts/build.mjs from src/tokens.json. Do not edit.
|
|
2
|
+
// React Native has no CSS variables, no oklch() and no backdrop-filter: colors are pre-resolved per theme,
|
|
3
|
+
// sizes are plain numbers (dp). Shadows are not exported: build them per platform (iOS shadow*, Android elevation).
|
|
4
|
+
export { space, radii, sizes, layers, components } from './dimensions.js';
|
|
5
|
+
export const colors = {
|
|
6
|
+
"light": {
|
|
7
|
+
"page-bg": "#ffffff",
|
|
8
|
+
"surface": "#ffffff",
|
|
9
|
+
"surface-muted": "#f3f4f6",
|
|
10
|
+
"surface-glass": "rgba(255, 255, 255, 0.8)",
|
|
11
|
+
"surface-glass-tint": "rgba(255, 255, 255, 0.8)",
|
|
12
|
+
"backdrop": "rgba(0, 0, 0, 0.4)",
|
|
13
|
+
"tooltip-bg": "#101828",
|
|
14
|
+
"tooltip-text": "#ffffff",
|
|
15
|
+
"text": "#000000",
|
|
16
|
+
"text-muted": "rgba(0, 0, 0, 0.6)",
|
|
17
|
+
"text-disabled": "rgba(0, 0, 0, 0.38)",
|
|
18
|
+
"text-brand": "#0069a8",
|
|
19
|
+
"border": "#e5e7eb",
|
|
20
|
+
"border-control": "#6a7282",
|
|
21
|
+
"border-control-hover": "#4a5565",
|
|
22
|
+
"divider": "rgba(0, 0, 0, 0.1)",
|
|
23
|
+
"focus-ring": "#0084d1",
|
|
24
|
+
"action": "#0069a8",
|
|
25
|
+
"action-hover": "#00598a",
|
|
26
|
+
"on-action": "#ffffff",
|
|
27
|
+
"action-subtle": "#dff2fe",
|
|
28
|
+
"action-subtle-hover": "#b8e6fe",
|
|
29
|
+
"on-action-subtle": "#00598a",
|
|
30
|
+
"control-checked": "#0069a8",
|
|
31
|
+
"link": "#bb4d00",
|
|
32
|
+
"link-border": "#ffd230",
|
|
33
|
+
"link-hover-bg": "#fef3c6",
|
|
34
|
+
"link-hover-border": "#fe9a00",
|
|
35
|
+
"danger": "#e7000b",
|
|
36
|
+
"danger-hover": "#c10007",
|
|
37
|
+
"info-surface": "#f0f9ff",
|
|
38
|
+
"info-border": "#b8e6fe",
|
|
39
|
+
"info-text": "#00598a",
|
|
40
|
+
"warning-surface": "#fefce8",
|
|
41
|
+
"warning-border": "#ffdf20",
|
|
42
|
+
"warning-text": "#894b00",
|
|
43
|
+
"error-surface": "#fef2f2",
|
|
44
|
+
"error-border": "#ffa2a2",
|
|
45
|
+
"error-text": "#c10007",
|
|
46
|
+
"error-control": "#e7000b",
|
|
47
|
+
"highlight": "#fef3c6",
|
|
48
|
+
"on-highlight": "#973c00",
|
|
49
|
+
"nav-item-text": "#364153",
|
|
50
|
+
"nav-item-hover": "#f9fafb",
|
|
51
|
+
"table-row-hover": "#f9fafb",
|
|
52
|
+
"nav-item-active": "#f3f4f6",
|
|
53
|
+
"skeleton": "#f3f4f6",
|
|
54
|
+
"skeleton-highlight": "#f9fafb",
|
|
55
|
+
"prose-text": "#364153",
|
|
56
|
+
"code-block-bg": "#1e2939",
|
|
57
|
+
"code-block-text": "#e5e7eb",
|
|
58
|
+
"primary-solid": "#0069a8",
|
|
59
|
+
"primary-solid-hover": "#00598a",
|
|
60
|
+
"on-primary-solid": "#ffffff",
|
|
61
|
+
"primary-soft": "#dff2fe",
|
|
62
|
+
"primary-soft-hover": "#b8e6fe",
|
|
63
|
+
"on-primary-soft": "#00598a",
|
|
64
|
+
"primary-fg": "#0069a8",
|
|
65
|
+
"primary-edge": "#0084d1",
|
|
66
|
+
"accent-solid": "#ffb900",
|
|
67
|
+
"accent-solid-hover": "#ffd230",
|
|
68
|
+
"on-accent-solid": "#461901",
|
|
69
|
+
"accent-soft": "#fef3c6",
|
|
70
|
+
"accent-soft-hover": "#fee685",
|
|
71
|
+
"on-accent-soft": "#973c00",
|
|
72
|
+
"accent-fg": "#bb4d00",
|
|
73
|
+
"accent-edge": "#e17100",
|
|
74
|
+
"secondary-solid": "#364153",
|
|
75
|
+
"secondary-solid-hover": "#1e2939",
|
|
76
|
+
"on-secondary-solid": "#ffffff",
|
|
77
|
+
"secondary-soft": "#f3f4f6",
|
|
78
|
+
"secondary-soft-hover": "#e5e7eb",
|
|
79
|
+
"on-secondary-soft": "#1e2939",
|
|
80
|
+
"secondary-fg": "#364153",
|
|
81
|
+
"secondary-edge": "#6a7282",
|
|
82
|
+
"warning-solid": "#fdc700",
|
|
83
|
+
"warning-solid-hover": "#ffdf20",
|
|
84
|
+
"on-warning-solid": "#432004",
|
|
85
|
+
"warning-soft": "#fef9c2",
|
|
86
|
+
"warning-soft-hover": "#fff085",
|
|
87
|
+
"on-warning-soft": "#894b00",
|
|
88
|
+
"warning-fg": "#a65f00",
|
|
89
|
+
"warning-edge": "#a65f00",
|
|
90
|
+
"error-solid": "#e7000b",
|
|
91
|
+
"error-solid-hover": "#c10007",
|
|
92
|
+
"on-error-solid": "#ffffff",
|
|
93
|
+
"error-soft": "#ffe2e2",
|
|
94
|
+
"error-soft-hover": "#ffc9c9",
|
|
95
|
+
"on-error-soft": "#9f0712",
|
|
96
|
+
"error-fg": "#c10007",
|
|
97
|
+
"error-edge": "#e7000b",
|
|
98
|
+
"primary-50": "#f0f9ff",
|
|
99
|
+
"primary-100": "#dff2fe",
|
|
100
|
+
"primary-200": "#b8e6fe",
|
|
101
|
+
"primary-300": "#74d4ff",
|
|
102
|
+
"primary-400": "#00bcff",
|
|
103
|
+
"primary-500": "#00a6f4",
|
|
104
|
+
"primary-600": "#0084d1",
|
|
105
|
+
"primary-700": "#0069a8",
|
|
106
|
+
"primary-800": "#00598a",
|
|
107
|
+
"primary-900": "#024a70",
|
|
108
|
+
"primary-950": "#052f4a",
|
|
109
|
+
"accent-50": "#fffbeb",
|
|
110
|
+
"accent-100": "#fef3c6",
|
|
111
|
+
"accent-200": "#fee685",
|
|
112
|
+
"accent-300": "#ffd230",
|
|
113
|
+
"accent-400": "#ffb900",
|
|
114
|
+
"accent-500": "#fe9a00",
|
|
115
|
+
"accent-600": "#e17100",
|
|
116
|
+
"accent-700": "#bb4d00",
|
|
117
|
+
"accent-800": "#973c00",
|
|
118
|
+
"accent-900": "#7b3306",
|
|
119
|
+
"accent-950": "#461901",
|
|
120
|
+
"secondary-50": "#f9fafb",
|
|
121
|
+
"secondary-100": "#f3f4f6",
|
|
122
|
+
"secondary-200": "#e5e7eb",
|
|
123
|
+
"secondary-300": "#d1d5dc",
|
|
124
|
+
"secondary-400": "#99a1af",
|
|
125
|
+
"secondary-500": "#6a7282",
|
|
126
|
+
"secondary-600": "#4a5565",
|
|
127
|
+
"secondary-700": "#364153",
|
|
128
|
+
"secondary-800": "#1e2939",
|
|
129
|
+
"secondary-900": "#101828",
|
|
130
|
+
"secondary-950": "#030712",
|
|
131
|
+
"warning-50": "#fefce8",
|
|
132
|
+
"warning-100": "#fef9c2",
|
|
133
|
+
"warning-200": "#fff085",
|
|
134
|
+
"warning-300": "#ffdf20",
|
|
135
|
+
"warning-400": "#fdc700",
|
|
136
|
+
"warning-500": "#f0b100",
|
|
137
|
+
"warning-600": "#d08700",
|
|
138
|
+
"warning-700": "#a65f00",
|
|
139
|
+
"warning-800": "#894b00",
|
|
140
|
+
"warning-900": "#733e0a",
|
|
141
|
+
"warning-950": "#432004",
|
|
142
|
+
"error-50": "#fef2f2",
|
|
143
|
+
"error-100": "#ffe2e2",
|
|
144
|
+
"error-200": "#ffc9c9",
|
|
145
|
+
"error-300": "#ffa2a2",
|
|
146
|
+
"error-400": "#ff6467",
|
|
147
|
+
"error-500": "#fb2c36",
|
|
148
|
+
"error-600": "#e7000b",
|
|
149
|
+
"error-700": "#c10007",
|
|
150
|
+
"error-800": "#9f0712",
|
|
151
|
+
"error-900": "#82181a",
|
|
152
|
+
"error-950": "#460809",
|
|
153
|
+
"white": "#ffffff",
|
|
154
|
+
"black": "#000000"
|
|
155
|
+
},
|
|
156
|
+
"dark": {
|
|
157
|
+
"page-bg": "#030712",
|
|
158
|
+
"surface": "#101828",
|
|
159
|
+
"surface-muted": "#1e2939",
|
|
160
|
+
"surface-glass": "rgba(3, 7, 18, 0.7)",
|
|
161
|
+
"surface-glass-tint": "rgba(5, 47, 74, 0.8)",
|
|
162
|
+
"backdrop": "rgba(0, 0, 0, 0.6)",
|
|
163
|
+
"tooltip-bg": "#f3f4f6",
|
|
164
|
+
"tooltip-text": "#000000",
|
|
165
|
+
"text": "#ffffff",
|
|
166
|
+
"text-muted": "rgba(255, 255, 255, 0.6)",
|
|
167
|
+
"text-disabled": "rgba(255, 255, 255, 0.38)",
|
|
168
|
+
"text-brand": "#74d4ff",
|
|
169
|
+
"border": "#1e2939",
|
|
170
|
+
"border-control": "#6a7282",
|
|
171
|
+
"border-control-hover": "#99a1af",
|
|
172
|
+
"divider": "rgba(255, 255, 255, 0.1)",
|
|
173
|
+
"focus-ring": "#00bcff",
|
|
174
|
+
"action": "#0069a8",
|
|
175
|
+
"action-hover": "#00598a",
|
|
176
|
+
"on-action": "#ffffff",
|
|
177
|
+
"action-subtle": "#052f4a",
|
|
178
|
+
"action-subtle-hover": "#024a70",
|
|
179
|
+
"on-action-subtle": "#b8e6fe",
|
|
180
|
+
"control-checked": "#0084d1",
|
|
181
|
+
"link": "#ffb900",
|
|
182
|
+
"link-border": "#973c00",
|
|
183
|
+
"link-hover-bg": "#461901",
|
|
184
|
+
"link-hover-border": "#e17100",
|
|
185
|
+
"danger": "#e7000b",
|
|
186
|
+
"danger-hover": "#c10007",
|
|
187
|
+
"info-surface": "#052f4a",
|
|
188
|
+
"info-border": "#00598a",
|
|
189
|
+
"info-text": "#b8e6fe",
|
|
190
|
+
"warning-surface": "#432004",
|
|
191
|
+
"warning-border": "#894b00",
|
|
192
|
+
"warning-text": "#fff085",
|
|
193
|
+
"error-surface": "#460809",
|
|
194
|
+
"error-border": "#9f0712",
|
|
195
|
+
"error-text": "#ffa2a2",
|
|
196
|
+
"error-control": "#ff6467",
|
|
197
|
+
"highlight": "#461901",
|
|
198
|
+
"on-highlight": "#fee685",
|
|
199
|
+
"nav-item-text": "#d1d5dc",
|
|
200
|
+
"nav-item-hover": "#101828",
|
|
201
|
+
"table-row-hover": "rgba(30, 41, 57, 0.5)",
|
|
202
|
+
"nav-item-active": "#1e2939",
|
|
203
|
+
"skeleton": "#1e2939",
|
|
204
|
+
"skeleton-highlight": "#364153",
|
|
205
|
+
"prose-text": "#d1d5dc",
|
|
206
|
+
"code-block-bg": "#1e2939",
|
|
207
|
+
"code-block-text": "#d1d5dc",
|
|
208
|
+
"primary-solid": "#0069a8",
|
|
209
|
+
"primary-solid-hover": "#00598a",
|
|
210
|
+
"on-primary-solid": "#ffffff",
|
|
211
|
+
"primary-soft": "#052f4a",
|
|
212
|
+
"primary-soft-hover": "#024a70",
|
|
213
|
+
"on-primary-soft": "#b8e6fe",
|
|
214
|
+
"primary-fg": "#74d4ff",
|
|
215
|
+
"primary-edge": "#00bcff",
|
|
216
|
+
"accent-solid": "#ffb900",
|
|
217
|
+
"accent-solid-hover": "#ffd230",
|
|
218
|
+
"on-accent-solid": "#461901",
|
|
219
|
+
"accent-soft": "#461901",
|
|
220
|
+
"accent-soft-hover": "#7b3306",
|
|
221
|
+
"on-accent-soft": "#fee685",
|
|
222
|
+
"accent-fg": "#ffb900",
|
|
223
|
+
"accent-edge": "#fe9a00",
|
|
224
|
+
"secondary-solid": "#e5e7eb",
|
|
225
|
+
"secondary-solid-hover": "#d1d5dc",
|
|
226
|
+
"on-secondary-solid": "#030712",
|
|
227
|
+
"secondary-soft": "#1e2939",
|
|
228
|
+
"secondary-soft-hover": "#364153",
|
|
229
|
+
"on-secondary-soft": "#f3f4f6",
|
|
230
|
+
"secondary-fg": "#d1d5dc",
|
|
231
|
+
"secondary-edge": "#6a7282",
|
|
232
|
+
"warning-solid": "#fdc700",
|
|
233
|
+
"warning-solid-hover": "#ffdf20",
|
|
234
|
+
"on-warning-solid": "#432004",
|
|
235
|
+
"warning-soft": "#432004",
|
|
236
|
+
"warning-soft-hover": "#733e0a",
|
|
237
|
+
"on-warning-soft": "#fff085",
|
|
238
|
+
"warning-fg": "#fdc700",
|
|
239
|
+
"warning-edge": "#f0b100",
|
|
240
|
+
"error-solid": "#e7000b",
|
|
241
|
+
"error-solid-hover": "#c10007",
|
|
242
|
+
"on-error-solid": "#ffffff",
|
|
243
|
+
"error-soft": "#460809",
|
|
244
|
+
"error-soft-hover": "#82181a",
|
|
245
|
+
"on-error-soft": "#ffc9c9",
|
|
246
|
+
"error-fg": "#ff6467",
|
|
247
|
+
"error-edge": "#ff6467",
|
|
248
|
+
"primary-50": "#f0f9ff",
|
|
249
|
+
"primary-100": "#dff2fe",
|
|
250
|
+
"primary-200": "#b8e6fe",
|
|
251
|
+
"primary-300": "#74d4ff",
|
|
252
|
+
"primary-400": "#00bcff",
|
|
253
|
+
"primary-500": "#00a6f4",
|
|
254
|
+
"primary-600": "#0084d1",
|
|
255
|
+
"primary-700": "#0069a8",
|
|
256
|
+
"primary-800": "#00598a",
|
|
257
|
+
"primary-900": "#024a70",
|
|
258
|
+
"primary-950": "#052f4a",
|
|
259
|
+
"accent-50": "#fffbeb",
|
|
260
|
+
"accent-100": "#fef3c6",
|
|
261
|
+
"accent-200": "#fee685",
|
|
262
|
+
"accent-300": "#ffd230",
|
|
263
|
+
"accent-400": "#ffb900",
|
|
264
|
+
"accent-500": "#fe9a00",
|
|
265
|
+
"accent-600": "#e17100",
|
|
266
|
+
"accent-700": "#bb4d00",
|
|
267
|
+
"accent-800": "#973c00",
|
|
268
|
+
"accent-900": "#7b3306",
|
|
269
|
+
"accent-950": "#461901",
|
|
270
|
+
"secondary-50": "#f9fafb",
|
|
271
|
+
"secondary-100": "#f3f4f6",
|
|
272
|
+
"secondary-200": "#e5e7eb",
|
|
273
|
+
"secondary-300": "#d1d5dc",
|
|
274
|
+
"secondary-400": "#99a1af",
|
|
275
|
+
"secondary-500": "#6a7282",
|
|
276
|
+
"secondary-600": "#4a5565",
|
|
277
|
+
"secondary-700": "#364153",
|
|
278
|
+
"secondary-800": "#1e2939",
|
|
279
|
+
"secondary-900": "#101828",
|
|
280
|
+
"secondary-950": "#030712",
|
|
281
|
+
"warning-50": "#fefce8",
|
|
282
|
+
"warning-100": "#fef9c2",
|
|
283
|
+
"warning-200": "#fff085",
|
|
284
|
+
"warning-300": "#ffdf20",
|
|
285
|
+
"warning-400": "#fdc700",
|
|
286
|
+
"warning-500": "#f0b100",
|
|
287
|
+
"warning-600": "#d08700",
|
|
288
|
+
"warning-700": "#a65f00",
|
|
289
|
+
"warning-800": "#894b00",
|
|
290
|
+
"warning-900": "#733e0a",
|
|
291
|
+
"warning-950": "#432004",
|
|
292
|
+
"error-50": "#fef2f2",
|
|
293
|
+
"error-100": "#ffe2e2",
|
|
294
|
+
"error-200": "#ffc9c9",
|
|
295
|
+
"error-300": "#ffa2a2",
|
|
296
|
+
"error-400": "#ff6467",
|
|
297
|
+
"error-500": "#fb2c36",
|
|
298
|
+
"error-600": "#e7000b",
|
|
299
|
+
"error-700": "#c10007",
|
|
300
|
+
"error-800": "#9f0712",
|
|
301
|
+
"error-900": "#82181a",
|
|
302
|
+
"error-950": "#460809",
|
|
303
|
+
"white": "#ffffff",
|
|
304
|
+
"black": "#000000"
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
export const blur = {
|
|
308
|
+
"panel": 24,
|
|
309
|
+
"float": 40
|
|
310
|
+
};
|
|
311
|
+
export const type = {
|
|
312
|
+
"display": {
|
|
313
|
+
"fontSize": 30,
|
|
314
|
+
"lineHeight": 38,
|
|
315
|
+
"fontWeight": "700"
|
|
316
|
+
},
|
|
317
|
+
"heading-1": {
|
|
318
|
+
"fontSize": 24,
|
|
319
|
+
"lineHeight": 32,
|
|
320
|
+
"fontWeight": "700"
|
|
321
|
+
},
|
|
322
|
+
"heading-2": {
|
|
323
|
+
"fontSize": 20,
|
|
324
|
+
"lineHeight": 28,
|
|
325
|
+
"fontWeight": "700"
|
|
326
|
+
},
|
|
327
|
+
"heading-3": {
|
|
328
|
+
"fontSize": 16,
|
|
329
|
+
"lineHeight": 24,
|
|
330
|
+
"fontWeight": "700"
|
|
331
|
+
},
|
|
332
|
+
"prose": {
|
|
333
|
+
"fontSize": 16,
|
|
334
|
+
"lineHeight": 28,
|
|
335
|
+
"fontWeight": "400"
|
|
336
|
+
},
|
|
337
|
+
"body": {
|
|
338
|
+
"fontSize": 14,
|
|
339
|
+
"lineHeight": 20,
|
|
340
|
+
"fontWeight": "400"
|
|
341
|
+
},
|
|
342
|
+
"small": {
|
|
343
|
+
"fontSize": 12,
|
|
344
|
+
"lineHeight": 16,
|
|
345
|
+
"fontWeight": "400"
|
|
346
|
+
},
|
|
347
|
+
"caption": {
|
|
348
|
+
"fontSize": 12,
|
|
349
|
+
"lineHeight": 16,
|
|
350
|
+
"fontWeight": "700"
|
|
351
|
+
},
|
|
352
|
+
"label": {
|
|
353
|
+
"fontSize": 14,
|
|
354
|
+
"lineHeight": 20,
|
|
355
|
+
"fontWeight": "700"
|
|
356
|
+
},
|
|
357
|
+
"button": {
|
|
358
|
+
"fontSize": 14,
|
|
359
|
+
"lineHeight": 20,
|
|
360
|
+
"fontWeight": "600"
|
|
361
|
+
},
|
|
362
|
+
"button-sm": {
|
|
363
|
+
"fontSize": 12,
|
|
364
|
+
"lineHeight": 16,
|
|
365
|
+
"fontWeight": "600"
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
export const fontStacks = {
|
|
369
|
+
"sans": "-apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif",
|
|
370
|
+
"chill": "\"ChillRoundF\", -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif"
|
|
371
|
+
};
|
|
372
|
+
export const motion = {
|
|
373
|
+
"springBezier": [
|
|
374
|
+
0.47,
|
|
375
|
+
1.64,
|
|
376
|
+
0.41,
|
|
377
|
+
0.8
|
|
378
|
+
],
|
|
379
|
+
"fastMs": 150
|
|
380
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const SHADES: readonly ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', '950'];
|
|
2
|
+
export type Shade = (typeof SHADES)[number];
|
|
3
|
+
/** One scale, light to dark: #rrggbb or rgba(r, g, b, a) per shade. */
|
|
4
|
+
export type Scale = Readonly<Record<Shade, string>>;
|
|
5
|
+
/** What a palette swaps. Same shape as a Tailwind theme's two brand scales. */
|
|
6
|
+
export interface Palette {
|
|
7
|
+
readonly primary: Scale;
|
|
8
|
+
readonly accent: Scale;
|
|
9
|
+
}
|
|
10
|
+
export type Theme = 'light' | 'dark';
|
|
11
|
+
/** A role's value in one theme: a literal color, or another token (at an alpha). */
|
|
12
|
+
export type RoleValue = string | {
|
|
13
|
+
readonly ref: string;
|
|
14
|
+
readonly alpha?: number;
|
|
15
|
+
};
|
|
16
|
+
export interface PaletteKitData<Role extends string> {
|
|
17
|
+
/** Every role token per theme. */
|
|
18
|
+
readonly roles: Readonly<Record<Role, Readonly<Record<Theme, RoleValue>>>>;
|
|
19
|
+
/** The scales a palette doesn't swap (secondary-*, warning-*, error-*), plus white and black. */
|
|
20
|
+
readonly fixed: Readonly<Record<string, string>>;
|
|
21
|
+
/** src/contrast-pairs.json: [foreground, background, ground?]; text needs 4.5:1, ui 3:1. */
|
|
22
|
+
readonly pairs: Readonly<Record<'text' | 'ui', readonly (readonly string[])[]>>;
|
|
23
|
+
}
|
|
24
|
+
export interface ContrastFailure {
|
|
25
|
+
theme: Theme;
|
|
26
|
+
kind: 'text' | 'ui';
|
|
27
|
+
fg: string;
|
|
28
|
+
bg: string;
|
|
29
|
+
ratio: number;
|
|
30
|
+
need: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function createPaletteKit<Role extends string>(data: PaletteKitData<Role>): {
|
|
33
|
+
createColors: (palette: Palette, theme: Theme) => Record<Role, string>;
|
|
34
|
+
checkPalette: (palette: Palette) => ContrastFailure[];
|
|
35
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Palettes at runtime, on any platform (no DOM, no React Native). dist/palette.ts binds this to the generated data;
|
|
2
|
+
// import from `@tuuject/koi-tokens/palette`, not from here.
|
|
3
|
+
//
|
|
4
|
+
// A palette swaps the primary-* and accent-* scales. Every role that points at them follows, in both themes.
|
|
5
|
+
// Colors here are hex (#rrggbb) or rgba(): what React Native reads, and what a theme editor usually produces.
|
|
6
|
+
export const SHADES = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', '950'];
|
|
7
|
+
function parse(v) {
|
|
8
|
+
const s = v.trim();
|
|
9
|
+
let m = s.match(/^#([0-9a-f]{6})$/i);
|
|
10
|
+
if (m) {
|
|
11
|
+
const h = m[1];
|
|
12
|
+
return { rgb: [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16) / 255), a: 1 };
|
|
13
|
+
}
|
|
14
|
+
m = s.match(/^rgba?\(\s*([\d.]+),\s*([\d.]+),\s*([\d.]+)(?:,\s*([\d.]+))?\s*\)$/);
|
|
15
|
+
if (m) {
|
|
16
|
+
return { rgb: [+m[1] / 255, +m[2] / 255, +m[3] / 255], a: m[4] === undefined ? 1 : +m[4] };
|
|
17
|
+
}
|
|
18
|
+
throw new Error(`Koi palettes take #rrggbb or rgba() colors, got "${v}"`);
|
|
19
|
+
}
|
|
20
|
+
function format({ rgb, a }) {
|
|
21
|
+
const b = rgb.map((x) => Math.round(x * 255));
|
|
22
|
+
if (a >= 1) {
|
|
23
|
+
return `#${b.map((x) => x.toString(16).padStart(2, '0')).join('')}`;
|
|
24
|
+
}
|
|
25
|
+
return `rgba(${b[0]}, ${b[1]}, ${b[2]}, ${+a.toFixed(4)})`;
|
|
26
|
+
}
|
|
27
|
+
const lin = (c) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4);
|
|
28
|
+
const luminance = ([r, g, b]) => 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);
|
|
29
|
+
const ratio = (a, b) => {
|
|
30
|
+
const A = luminance(a), B = luminance(b);
|
|
31
|
+
return (Math.max(A, B) + 0.05) / (Math.min(A, B) + 0.05);
|
|
32
|
+
};
|
|
33
|
+
const over = (fg, bg) => fg.rgb.map((x, i) => fg.a * x + (1 - fg.a) * bg[i]);
|
|
34
|
+
const NEED = { text: 4.5, ui: 3 };
|
|
35
|
+
export function createPaletteKit(data) {
|
|
36
|
+
const SWAP = /^(primary|accent)-(\d+)$/;
|
|
37
|
+
function resolve(name, theme, palette, seen) {
|
|
38
|
+
const swap = name.match(SWAP);
|
|
39
|
+
if (swap) {
|
|
40
|
+
return palette[swap[1]][swap[2]];
|
|
41
|
+
}
|
|
42
|
+
if (name in data.fixed) {
|
|
43
|
+
return data.fixed[name];
|
|
44
|
+
}
|
|
45
|
+
const role = data.roles[name];
|
|
46
|
+
if (!role) {
|
|
47
|
+
throw new Error(`Unknown color token "${name}"`);
|
|
48
|
+
}
|
|
49
|
+
if (seen.includes(name)) {
|
|
50
|
+
throw new Error(`Reference cycle: ${[...seen, name].join(' -> ')}`);
|
|
51
|
+
}
|
|
52
|
+
const v = role[theme];
|
|
53
|
+
if (typeof v === 'string') {
|
|
54
|
+
return v;
|
|
55
|
+
}
|
|
56
|
+
const base = resolve(v.ref, theme, palette, [...seen, name]);
|
|
57
|
+
if (v.alpha === undefined) {
|
|
58
|
+
return base;
|
|
59
|
+
}
|
|
60
|
+
const c = parse(base);
|
|
61
|
+
return format({ rgb: c.rgb, a: c.a * v.alpha });
|
|
62
|
+
}
|
|
63
|
+
/** Every role token's color for `palette` in `theme` (hex or rgba), ready for StyleSheet or a Tamagui theme. */
|
|
64
|
+
function createColors(palette, theme) {
|
|
65
|
+
const out = {};
|
|
66
|
+
for (const name of Object.keys(data.roles)) {
|
|
67
|
+
out[name] = resolve(name, theme, palette, []);
|
|
68
|
+
}
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The contrast pairs `palette` fails, in either theme: empty when it's safe to use. Built-in palettes always
|
|
73
|
+
* pass (`pnpm contrast`); run this on a palette a user made before applying it.
|
|
74
|
+
*/
|
|
75
|
+
function checkPalette(palette) {
|
|
76
|
+
const solid = (name, theme, ground) => {
|
|
77
|
+
const c = parse(resolve(name, theme, palette, []));
|
|
78
|
+
return c.a >= 1 ? c.rgb : over(c, solid(ground, theme, 'page-bg'));
|
|
79
|
+
};
|
|
80
|
+
const failures = [];
|
|
81
|
+
for (const kind of ['text', 'ui']) {
|
|
82
|
+
for (const [fg, bg, ground = 'page-bg'] of data.pairs[kind]) {
|
|
83
|
+
for (const theme of ['light', 'dark']) {
|
|
84
|
+
const back = solid(bg, theme, ground);
|
|
85
|
+
const c = parse(resolve(fg, theme, palette, []));
|
|
86
|
+
const r = ratio(c.a >= 1 ? c.rgb : over(c, back), back);
|
|
87
|
+
if (r < NEED[kind]) {
|
|
88
|
+
failures.push({ theme, kind, fg, bg, ratio: +r.toFixed(2), need: NEED[kind] });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return failures;
|
|
94
|
+
}
|
|
95
|
+
return { createColors, checkPalette };
|
|
96
|
+
}
|