@haklex/rich-style-token 0.0.30 → 0.0.32
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/index.mjs +20 -10
- package/dist/themes.d.ts +7 -1
- package/dist/themes.d.ts.map +1 -1
- package/dist/vars.css.d.ts +2 -0
- package/dist/vars.css.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useMemo, use } from "react";
|
|
3
|
-
var vars = { color: { text: "var(--rc-text)", textSecondary: "var(--rc-text-secondary)", bg: "var(--rc-bg)", bgSecondary: "var(--rc-bg-secondary)", bgTertiary: "var(--rc-bg-tertiary)", border: "var(--rc-border)", accent: "var(--rc-accent)", accentLight: "var(--rc-accent-light)", link: "var(--rc-link)", codeText: "var(--rc-code-text)", codeBg: "var(--rc-code-bg)", quoteBorder: "var(--rc-quote-border)", quoteBg: "var(--rc-quote-bg)", alertInfo: "var(--rc-alert-info)", alertWarning: "var(--rc-alert-warning)", alertTip: "var(--rc-alert-tip)", alertCaution: "var(--rc-alert-caution)", alertImportant: "var(--rc-alert-important)" }, spacing: { xs: "var(--rc-space-xs)", sm: "var(--rc-space-sm)", md: "var(--rc-space-md)", lg: "var(--rc-space-lg)", xl: "var(--rc-space-xl)" }, typography: { fontFamily: "var(--rc-font-family)", fontFamilySerif: "var(--rc-font-family-serif)", fontMono: "var(--rc-font-mono)", fontSize2xs: "var(--rc-font-size-2xs)", fontSizeXs: "var(--rc-font-size-xs)", fontSizeSm: "var(--rc-font-size-sm)", fontSizeMd: "var(--rc-font-size-md)", fontSizeLg: "var(--rc-font-size-lg)", fontSizeBase: "var(--rc-font-size-base)", fontSizeSmall: "var(--rc-font-size-small)", lineHeight: "var(--rc-line-height)", lineHeightTight: "var(--rc-line-height-tight)" }, borderRadius: { sm: "var(--rc-radius-sm)", md: "var(--rc-radius-md)", lg: "var(--rc-radius-lg)" }, layout: { maxWidth: "var(--rc-max-width)" } };
|
|
3
|
+
var vars = { color: { text: "var(--rc-text)", textSecondary: "var(--rc-text-secondary)", bg: "var(--rc-bg)", bgSecondary: "var(--rc-bg-secondary)", bgTertiary: "var(--rc-bg-tertiary)", border: "var(--rc-border)", accent: "var(--rc-accent)", accentLight: "var(--rc-accent-light)", link: "var(--rc-link)", codeText: "var(--rc-code-text)", codeBg: "var(--rc-code-bg)", hrBorder: "var(--rc-hr-border)", quoteBorder: "var(--rc-quote-border)", quoteBg: "var(--rc-quote-bg)", alertInfo: "var(--rc-alert-info)", alertWarning: "var(--rc-alert-warning)", alertTip: "var(--rc-alert-tip)", alertCaution: "var(--rc-alert-caution)", alertImportant: "var(--rc-alert-important)" }, spacing: { xs: "var(--rc-space-xs)", sm: "var(--rc-space-sm)", md: "var(--rc-space-md)", lg: "var(--rc-space-lg)", xl: "var(--rc-space-xl)" }, typography: { fontFamily: "var(--rc-font-family)", fontFamilySans: "var(--rc-font-family-sans)", fontFamilySerif: "var(--rc-font-family-serif)", fontMono: "var(--rc-font-mono)", fontSize2xs: "var(--rc-font-size-2xs)", fontSizeXs: "var(--rc-font-size-xs)", fontSizeSm: "var(--rc-font-size-sm)", fontSizeMd: "var(--rc-font-size-md)", fontSizeLg: "var(--rc-font-size-lg)", fontSizeBase: "var(--rc-font-size-base)", fontSizeSmall: "var(--rc-font-size-small)", lineHeight: "var(--rc-line-height)", lineHeightTight: "var(--rc-line-height-tight)" }, borderRadius: { sm: "var(--rc-radius-sm)", md: "var(--rc-radius-md)", lg: "var(--rc-radius-lg)" }, layout: { maxWidth: "var(--rc-max-width)" } };
|
|
4
4
|
function extractVarName(cssVarRef) {
|
|
5
5
|
const match = cssVarRef.match(/^var\((.+)\)$/);
|
|
6
6
|
return match ? match[1] : cssVarRef;
|
|
@@ -45,7 +45,7 @@ function PortalThemeWrapper({ children }) {
|
|
|
45
45
|
return /* @__PURE__ */ jsx("div", { style: { display: "contents" }, className, children });
|
|
46
46
|
}
|
|
47
47
|
const fonts = {
|
|
48
|
-
|
|
48
|
+
fontFamilySans: '"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji',
|
|
49
49
|
fontFamilySerif: '"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif',
|
|
50
50
|
fontMono: '"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace'
|
|
51
51
|
};
|
|
@@ -59,9 +59,12 @@ const lightArticleColors = {
|
|
|
59
59
|
accent: "#2563eb",
|
|
60
60
|
accentLight: "#2563eb20",
|
|
61
61
|
link: "#2563eb",
|
|
62
|
-
codeText: "#
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
codeText: "#404040",
|
|
63
|
+
// neutral-700
|
|
64
|
+
codeBg: "#f5f5f5",
|
|
65
|
+
// neutral-100
|
|
66
|
+
hrBorder: "#d4d4d4",
|
|
67
|
+
// neutral-300
|
|
65
68
|
quoteBorder: "#2563eb",
|
|
66
69
|
quoteBg: "#eff6ff",
|
|
67
70
|
alertInfo: "#006bb7",
|
|
@@ -85,9 +88,12 @@ const darkColors = {
|
|
|
85
88
|
accent: "#60a5fa",
|
|
86
89
|
accentLight: "#60a5fa20",
|
|
87
90
|
link: "#60a5fa",
|
|
88
|
-
codeText: "#
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
codeText: "#e5e5e5",
|
|
92
|
+
// neutral-200
|
|
93
|
+
codeBg: "#262626",
|
|
94
|
+
// neutral-800
|
|
95
|
+
hrBorder: "#525252",
|
|
96
|
+
// neutral-600
|
|
91
97
|
quoteBorder: "#60a5fa",
|
|
92
98
|
quoteBg: "#1e3a5f",
|
|
93
99
|
alertInfo: "#7db9e5",
|
|
@@ -105,6 +111,7 @@ const sharedSpacing = {
|
|
|
105
111
|
};
|
|
106
112
|
const sharedBorderRadius = { sm: "4px", md: "8px", lg: "12px" };
|
|
107
113
|
const baseTypography = {
|
|
114
|
+
fontFamilySans: fonts.fontFamilySans,
|
|
108
115
|
fontFamilySerif: fonts.fontFamilySerif,
|
|
109
116
|
fontMono: fonts.fontMono,
|
|
110
117
|
fontSize2xs: "0.625em",
|
|
@@ -120,7 +127,10 @@ const baseTypography = {
|
|
|
120
127
|
const articleLayout = {
|
|
121
128
|
layout: { maxWidth: "700px" },
|
|
122
129
|
spacing: sharedSpacing,
|
|
123
|
-
typography: {
|
|
130
|
+
typography: {
|
|
131
|
+
...baseTypography,
|
|
132
|
+
fontFamily: fonts.fontFamilySans
|
|
133
|
+
},
|
|
124
134
|
borderRadius: sharedBorderRadius
|
|
125
135
|
};
|
|
126
136
|
const noteLayout = {
|
|
@@ -138,7 +148,7 @@ const commentLayout = {
|
|
|
138
148
|
spacing: { xs: "2px", sm: "4px", md: "10px", lg: "16px", xl: "20px" },
|
|
139
149
|
typography: {
|
|
140
150
|
...baseTypography,
|
|
141
|
-
fontFamily: fonts.
|
|
151
|
+
fontFamily: fonts.fontFamilySans,
|
|
142
152
|
fontSizeBase: "14px",
|
|
143
153
|
fontSizeSmall: "12px",
|
|
144
154
|
lineHeight: "1.5",
|
package/dist/themes.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const fonts: {
|
|
2
|
-
|
|
2
|
+
fontFamilySans: string;
|
|
3
3
|
fontFamilySerif: string;
|
|
4
4
|
fontMono: string;
|
|
5
5
|
};
|
|
@@ -15,6 +15,7 @@ export declare const lightArticleColors: {
|
|
|
15
15
|
link: string;
|
|
16
16
|
codeText: string;
|
|
17
17
|
codeBg: string;
|
|
18
|
+
hrBorder: string;
|
|
18
19
|
quoteBorder: string;
|
|
19
20
|
quoteBg: string;
|
|
20
21
|
alertInfo: string;
|
|
@@ -37,6 +38,7 @@ export declare const lightCommentColors: {
|
|
|
37
38
|
link: string;
|
|
38
39
|
codeText: string;
|
|
39
40
|
codeBg: string;
|
|
41
|
+
hrBorder: string;
|
|
40
42
|
alertInfo: string;
|
|
41
43
|
alertWarning: string;
|
|
42
44
|
alertTip: string;
|
|
@@ -55,6 +57,7 @@ export declare const darkColors: {
|
|
|
55
57
|
link: string;
|
|
56
58
|
codeText: string;
|
|
57
59
|
codeBg: string;
|
|
60
|
+
hrBorder: string;
|
|
58
61
|
quoteBorder: string;
|
|
59
62
|
quoteBg: string;
|
|
60
63
|
alertInfo: string;
|
|
@@ -76,6 +79,7 @@ export declare const articleLayout: {
|
|
|
76
79
|
};
|
|
77
80
|
typography: {
|
|
78
81
|
fontFamily: string;
|
|
82
|
+
fontFamilySans: string;
|
|
79
83
|
fontFamilySerif: string;
|
|
80
84
|
fontMono: string;
|
|
81
85
|
fontSize2xs: string;
|
|
@@ -108,6 +112,7 @@ export declare const noteLayout: {
|
|
|
108
112
|
typography: {
|
|
109
113
|
fontFamily: string;
|
|
110
114
|
lineHeight: string;
|
|
115
|
+
fontFamilySans: string;
|
|
111
116
|
fontFamilySerif: string;
|
|
112
117
|
fontMono: string;
|
|
113
118
|
fontSize2xs: string;
|
|
@@ -142,6 +147,7 @@ export declare const commentLayout: {
|
|
|
142
147
|
fontSizeSmall: string;
|
|
143
148
|
lineHeight: string;
|
|
144
149
|
lineHeightTight: string;
|
|
150
|
+
fontFamilySans: string;
|
|
145
151
|
fontFamilySerif: string;
|
|
146
152
|
fontMono: string;
|
|
147
153
|
fontSize2xs: string;
|
package/dist/themes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;;;;CAOjB,CAAA;AAGD,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;;;;CAOjB,CAAA;AAGD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;CAoB9B,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;CAI9B,CAAA;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;CAoBtB,CAAA;AA0BD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQzB,CAAA;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAStB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYzB,CAAA"}
|
package/dist/vars.css.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const vars: {
|
|
|
11
11
|
link: `var(--${string})`;
|
|
12
12
|
codeText: `var(--${string})`;
|
|
13
13
|
codeBg: `var(--${string})`;
|
|
14
|
+
hrBorder: `var(--${string})`;
|
|
14
15
|
quoteBorder: `var(--${string})`;
|
|
15
16
|
quoteBg: `var(--${string})`;
|
|
16
17
|
alertInfo: `var(--${string})`;
|
|
@@ -28,6 +29,7 @@ export declare const vars: {
|
|
|
28
29
|
};
|
|
29
30
|
typography: {
|
|
30
31
|
fontFamily: `var(--${string})`;
|
|
32
|
+
fontFamilySans: `var(--${string})`;
|
|
31
33
|
fontFamilySerif: `var(--${string})`;
|
|
32
34
|
fontMono: `var(--${string})`;
|
|
33
35
|
fontSize2xs: `var(--${string})`;
|
package/dist/vars.css.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vars.css.d.ts","sourceRoot":"","sources":["../src/vars.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"vars.css.d.ts","sourceRoot":"","sources":["../src/vars.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDf,CAAA"}
|