@haklex/rich-style-token 0.0.63 → 0.0.65

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 CHANGED
@@ -1,37 +1,14 @@
1
+ import { articleLayout, articleTheme, commentLayout, commentTheme, createThemeStyle, darkColors, fonts, lightArticleColors, lightCommentColors, noteLayout, noteTheme, vars } from "./styles.mjs";
1
2
  import { jsx } from "react/jsx-runtime";
2
- import { createContext, useMemo, use } from "react";
3
- var vars = { color: { text: "var(--rc-text)", textSecondary: "var(--rc-text-secondary)", textTertiary: "var(--rc-text-tertiary)", textQuaternary: "var(--rc-text-quaternary)", bg: "var(--rc-bg)", bgSecondary: "var(--rc-bg-secondary)", bgTertiary: "var(--rc-bg-tertiary)", fill: "var(--rc-fill)", fillSecondary: "var(--rc-fill-secondary)", fillTertiary: "var(--rc-fill-tertiary)", fillQuaternary: "var(--rc-fill-quaternary)", 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)" }, boxShadow: { topBar: "var(--rc-shadow-top-bar)", modal: "var(--rc-shadow-modal)", menu: "var(--rc-shadow-menu)" } };
4
- var articleTheme = "yglj5t0";
5
- var noteTheme = "yglj5t1";
6
- var commentTheme = "yglj5t2";
7
- function extractVarName(cssVarRef) {
8
- const match = cssVarRef.match(/^var\((.+)\)$/);
9
- return match ? match[1] : cssVarRef;
10
- }
11
- function createThemeStyle(tokens) {
12
- const style = {};
13
- for (const [group, values] of Object.entries(tokens)) {
14
- if (!values) continue;
15
- const contractGroup = vars[group];
16
- if (!contractGroup) continue;
17
- for (const [key, value] of Object.entries(values)) {
18
- if (value == null) continue;
19
- const cssVarRef = contractGroup[key];
20
- if (cssVarRef) {
21
- style[extractVarName(cssVarRef)] = value;
22
- }
23
- }
24
- }
25
- return style;
26
- }
27
- const PortalThemeContext = createContext({
3
+ import * as React from "react";
4
+ const PortalThemeContext = React.createContext({
28
5
  className: "",
29
6
  theme: "light"
30
7
  });
31
- const PortalContainerContext = createContext(null);
8
+ const PortalContainerContext = React.createContext(null);
32
9
  const PortalContainerProvider = PortalContainerContext.Provider;
33
10
  function usePortalContainer() {
34
- return use(PortalContainerContext) ?? document.body;
11
+ return React.useContext(PortalContainerContext) ?? document.body;
35
12
  }
36
13
  function PortalThemeProvider({
37
14
  className,
@@ -41,15 +18,17 @@ function PortalThemeProvider({
41
18
  return /* @__PURE__ */ jsx(
42
19
  PortalThemeContext.Provider,
43
20
  {
44
- value: useMemo(() => ({ className, theme }), [className, theme]),
21
+ value: React.useMemo(() => ({ className, theme }), [className, theme]),
45
22
  children
46
23
  }
47
24
  );
48
25
  }
49
26
  function usePortalTheme() {
50
- return use(PortalThemeContext);
27
+ return React.useContext(PortalThemeContext);
51
28
  }
52
- function PortalThemeWrapper({ children }) {
29
+ function PortalThemeWrapper({
30
+ children
31
+ }) {
53
32
  const { className, theme } = usePortalTheme();
54
33
  if (!className) return children;
55
34
  return /* @__PURE__ */ jsx(
@@ -63,161 +42,6 @@ function PortalThemeWrapper({ children }) {
63
42
  }
64
43
  );
65
44
  }
66
- const fonts = {
67
- 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',
68
- fontFamilySerif: '"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif',
69
- fontMono: '"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace'
70
- };
71
- const lightArticleColors = {
72
- text: "#000",
73
- textSecondary: "#27272a",
74
- // zinc-800
75
- textTertiary: "#71717a",
76
- // zinc-500
77
- textQuaternary: "#a1a1aa",
78
- // zinc-400
79
- bg: "#ffffff",
80
- bgSecondary: "#fafafa",
81
- // zinc-50
82
- bgTertiary: "#f4f4f5",
83
- // zinc-100
84
- fill: "#e8e8ec",
85
- // interactive fill 1 — list item selected/hover
86
- fillSecondary: "#eeeeef",
87
- // interactive fill 2 — button/control hover
88
- fillTertiary: "#f4f4f6",
89
- // interactive fill 3 — large area hover (card, table row)
90
- fillQuaternary: "#f9f9fa",
91
- // interactive fill 4 — most subtle feedback
92
- border: "#f4f4f5",
93
- // zinc-100 - lighter, less prominent
94
- accent: "#2563eb",
95
- accentLight: "#2563eb20",
96
- link: "#2563eb",
97
- codeText: "#3f3f46",
98
- // zinc-700
99
- codeBg: "#f4f4f5",
100
- // zinc-100
101
- hrBorder: "#e4e4e7",
102
- // zinc-200 - one step darker than border
103
- quoteBorder: "#2563eb",
104
- quoteBg: "#eff6ff",
105
- alertInfo: "#006bb7",
106
- alertWarning: "#cc5500",
107
- alertTip: "#11cc00",
108
- alertCaution: "#cc0011",
109
- alertImportant: "#5500cc"
110
- };
111
- const lightCommentColors = {
112
- ...lightArticleColors,
113
- quoteBorder: "#a1a1aa",
114
- // zinc-400
115
- quoteBg: "#fafafa"
116
- // zinc-50
117
- };
118
- const darkColors = {
119
- text: "#fafafa",
120
- textSecondary: "#a1a1aa",
121
- // zinc-400
122
- textTertiary: "#71717a",
123
- // zinc-500
124
- textQuaternary: "#52525b",
125
- // zinc-600
126
- bg: "#09090b",
127
- // zinc-950
128
- bgSecondary: "#18181b",
129
- // zinc-900
130
- bgTertiary: "#27272a",
131
- // zinc-800
132
- fill: "#2a2a2f",
133
- // interactive fill 1 — list item selected/hover
134
- fillSecondary: "#222226",
135
- // interactive fill 2 — button/control hover
136
- fillTertiary: "#1b1b1f",
137
- // interactive fill 3 — large area hover
138
- fillQuaternary: "#131316",
139
- // interactive fill 4 — most subtle feedback
140
- border: "#27272a",
141
- // zinc-800 - lighter/less prominent
142
- accent: "#60a5fa",
143
- accentLight: "#60a5fa20",
144
- link: "#60a5fa",
145
- codeText: "#e4e4e7",
146
- // zinc-200
147
- codeBg: "#27272a",
148
- // zinc-800
149
- hrBorder: "#27272a",
150
- // zinc-800 - same as border
151
- quoteBorder: "#60a5fa",
152
- quoteBg: "#1e3a5f",
153
- alertInfo: "#7db9e5",
154
- alertWarning: "#da864a",
155
- alertTip: "#54da48",
156
- alertCaution: "#e16973",
157
- alertImportant: "#9966e0"
158
- };
159
- const sharedSpacing = {
160
- xs: "4px",
161
- sm: "8px",
162
- md: "16px",
163
- lg: "24px",
164
- xl: "32px"
165
- };
166
- const sharedBorderRadius = { sm: "4px", md: "8px", lg: "12px" };
167
- const sharedBoxShadow = {
168
- topBar: "0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06)",
169
- modal: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
170
- menu: "0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.08)"
171
- };
172
- const baseTypography = {
173
- fontFamilySans: fonts.fontFamilySans,
174
- fontFamilySerif: fonts.fontFamilySerif,
175
- fontMono: fonts.fontMono,
176
- fontSize2xs: "0.625em",
177
- fontSizeXs: "0.75em",
178
- fontSizeSm: "0.8125em",
179
- fontSizeMd: "0.875em",
180
- fontSizeLg: "1.25em",
181
- fontSizeBase: "16px",
182
- fontSizeSmall: "14px",
183
- lineHeight: "1.7",
184
- lineHeightTight: "1.4"
185
- };
186
- const articleLayout = {
187
- layout: { maxWidth: "700px" },
188
- boxShadow: sharedBoxShadow,
189
- spacing: sharedSpacing,
190
- typography: {
191
- ...baseTypography,
192
- fontFamily: fonts.fontFamilySans
193
- },
194
- borderRadius: sharedBorderRadius
195
- };
196
- const noteLayout = {
197
- layout: { maxWidth: "700px" },
198
- boxShadow: sharedBoxShadow,
199
- spacing: sharedSpacing,
200
- typography: {
201
- ...baseTypography,
202
- fontFamily: fonts.fontFamilySerif,
203
- lineHeight: "1.8"
204
- },
205
- borderRadius: sharedBorderRadius
206
- };
207
- const commentLayout = {
208
- layout: { maxWidth: "none" },
209
- boxShadow: sharedBoxShadow,
210
- spacing: { xs: "2px", sm: "4px", md: "10px", lg: "16px", xl: "20px" },
211
- typography: {
212
- ...baseTypography,
213
- fontFamily: fonts.fontFamilySans,
214
- fontSizeBase: "14px",
215
- fontSizeSmall: "12px",
216
- lineHeight: "1.5",
217
- lineHeightTight: "1.3"
218
- },
219
- borderRadius: { sm: "3px", md: "6px", lg: "8px" }
220
- };
221
45
  export {
222
46
  PortalContainerProvider,
223
47
  PortalThemeProvider,
@@ -1,19 +1,19 @@
1
- import { ReactNode } from 'react';
1
+ import * as React from 'react';
2
2
  export type PortalTheme = 'light' | 'dark';
3
3
  type PortalThemeContextType = {
4
4
  className: string;
5
5
  theme: PortalTheme;
6
6
  };
7
- export declare const PortalContainerProvider: import('react').Provider<Element | null>;
7
+ export declare const PortalContainerProvider: React.Provider<Element | null>;
8
8
  export declare function usePortalContainer(): Element;
9
9
  export declare function PortalThemeProvider({ className, theme, children, }: {
10
10
  className: string;
11
11
  theme: PortalTheme;
12
- children?: ReactNode;
12
+ children?: React.ReactNode;
13
13
  }): import("react/jsx-runtime").JSX.Element;
14
14
  export declare function usePortalTheme(): PortalThemeContextType;
15
- export declare function PortalThemeWrapper({ children }: {
16
- children: ReactNode;
17
- }): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
15
+ export declare function PortalThemeWrapper({ children, }: {
16
+ children: React.ReactNode;
17
+ }): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
18
18
  export {};
19
19
  //# sourceMappingURL=portal-theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"portal-theme.d.ts","sourceRoot":"","sources":["../src/portal-theme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAA;AAE1C,KAAK,sBAAsB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,WAAW,CAAA;CACnB,CAAA;AAUD,eAAO,MAAM,uBAAuB,0CAAkC,CAAA;AACtE,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,WAAW,CAAA;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,2CAQA;AAED,wBAAgB,cAAc,2BAE7B;AAED,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2UAavE"}
1
+ {"version":3,"file":"portal-theme.d.ts","sourceRoot":"","sources":["../src/portal-theme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAA;AAE1C,KAAK,sBAAsB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,WAAW,CAAA;CACnB,CAAA;AAQD,eAAO,MAAM,uBAAuB,gCAAkC,CAAA;AAEtE,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,WAAW,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,2CAQA;AAED,wBAAgB,cAAc,2BAE7B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,yTAaA"}
@@ -0,0 +1,5 @@
1
+ export type { ThemeTokens } from './create-theme-style';
2
+ export { createThemeStyle } from './create-theme-style';
3
+ export { articleLayout, commentLayout, darkColors, fonts, lightArticleColors, lightCommentColors, noteLayout, } from './themes';
4
+ export { articleTheme, commentTheme, noteTheme, vars } from './vars.css';
5
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,KAAK,EACL,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,GACX,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1,193 @@
1
+ var vars = { color: { text: "var(--rc-text)", textSecondary: "var(--rc-text-secondary)", textTertiary: "var(--rc-text-tertiary)", textQuaternary: "var(--rc-text-quaternary)", bg: "var(--rc-bg)", bgSecondary: "var(--rc-bg-secondary)", bgTertiary: "var(--rc-bg-tertiary)", fill: "var(--rc-fill)", fillSecondary: "var(--rc-fill-secondary)", fillTertiary: "var(--rc-fill-tertiary)", fillQuaternary: "var(--rc-fill-quaternary)", 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)" }, boxShadow: { topBar: "var(--rc-shadow-top-bar)", modal: "var(--rc-shadow-modal)", menu: "var(--rc-shadow-menu)" } };
2
+ var articleTheme = "yglj5t0";
3
+ var noteTheme = "yglj5t1";
4
+ var commentTheme = "yglj5t2";
5
+ function extractVarName(cssVarRef) {
6
+ const match = cssVarRef.match(/^var\((.+)\)$/);
7
+ return match ? match[1] : cssVarRef;
8
+ }
9
+ function createThemeStyle(tokens) {
10
+ const style = {};
11
+ for (const [group, values] of Object.entries(tokens)) {
12
+ if (!values) continue;
13
+ const contractGroup = vars[group];
14
+ if (!contractGroup) continue;
15
+ for (const [key, value] of Object.entries(values)) {
16
+ if (value == null) continue;
17
+ const cssVarRef = contractGroup[key];
18
+ if (cssVarRef) {
19
+ style[extractVarName(cssVarRef)] = value;
20
+ }
21
+ }
22
+ }
23
+ return style;
24
+ }
25
+ const fonts = {
26
+ 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',
27
+ fontFamilySerif: '"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif',
28
+ fontMono: '"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace'
29
+ };
30
+ const lightArticleColors = {
31
+ text: "#000",
32
+ textSecondary: "#27272a",
33
+ // zinc-800
34
+ textTertiary: "#71717a",
35
+ // zinc-500
36
+ textQuaternary: "#a1a1aa",
37
+ // zinc-400
38
+ bg: "#ffffff",
39
+ bgSecondary: "#fafafa",
40
+ // zinc-50
41
+ bgTertiary: "#f4f4f5",
42
+ // zinc-100
43
+ fill: "#e8e8ec",
44
+ // interactive fill 1 — list item selected/hover
45
+ fillSecondary: "#eeeeef",
46
+ // interactive fill 2 — button/control hover
47
+ fillTertiary: "#f4f4f6",
48
+ // interactive fill 3 — large area hover (card, table row)
49
+ fillQuaternary: "#f9f9fa",
50
+ // interactive fill 4 — most subtle feedback
51
+ border: "#f4f4f5",
52
+ // zinc-100 - lighter, less prominent
53
+ accent: "#2563eb",
54
+ accentLight: "#2563eb20",
55
+ link: "#2563eb",
56
+ codeText: "#3f3f46",
57
+ // zinc-700
58
+ codeBg: "#f4f4f5",
59
+ // zinc-100
60
+ hrBorder: "#e4e4e7",
61
+ // zinc-200 - one step darker than border
62
+ quoteBorder: "#2563eb",
63
+ quoteBg: "#eff6ff",
64
+ alertInfo: "#006bb7",
65
+ alertWarning: "#cc5500",
66
+ alertTip: "#11cc00",
67
+ alertCaution: "#cc0011",
68
+ alertImportant: "#5500cc"
69
+ };
70
+ const lightCommentColors = {
71
+ ...lightArticleColors,
72
+ quoteBorder: "#a1a1aa",
73
+ // zinc-400
74
+ quoteBg: "#fafafa"
75
+ // zinc-50
76
+ };
77
+ const darkColors = {
78
+ text: "#fafafa",
79
+ textSecondary: "#a1a1aa",
80
+ // zinc-400
81
+ textTertiary: "#71717a",
82
+ // zinc-500
83
+ textQuaternary: "#52525b",
84
+ // zinc-600
85
+ bg: "#09090b",
86
+ // zinc-950
87
+ bgSecondary: "#18181b",
88
+ // zinc-900
89
+ bgTertiary: "#27272a",
90
+ // zinc-800
91
+ fill: "#2a2a2f",
92
+ // interactive fill 1 — list item selected/hover
93
+ fillSecondary: "#222226",
94
+ // interactive fill 2 — button/control hover
95
+ fillTertiary: "#1b1b1f",
96
+ // interactive fill 3 — large area hover
97
+ fillQuaternary: "#131316",
98
+ // interactive fill 4 — most subtle feedback
99
+ border: "#27272a",
100
+ // zinc-800 - lighter/less prominent
101
+ accent: "#60a5fa",
102
+ accentLight: "#60a5fa20",
103
+ link: "#60a5fa",
104
+ codeText: "#e4e4e7",
105
+ // zinc-200
106
+ codeBg: "#27272a",
107
+ // zinc-800
108
+ hrBorder: "#27272a",
109
+ // zinc-800 - same as border
110
+ quoteBorder: "#60a5fa",
111
+ quoteBg: "#1e3a5f",
112
+ alertInfo: "#7db9e5",
113
+ alertWarning: "#da864a",
114
+ alertTip: "#54da48",
115
+ alertCaution: "#e16973",
116
+ alertImportant: "#9966e0"
117
+ };
118
+ const sharedSpacing = {
119
+ xs: "4px",
120
+ sm: "8px",
121
+ md: "16px",
122
+ lg: "24px",
123
+ xl: "32px"
124
+ };
125
+ const sharedBorderRadius = { sm: "4px", md: "8px", lg: "12px" };
126
+ const sharedBoxShadow = {
127
+ topBar: "0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06)",
128
+ modal: "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",
129
+ menu: "0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.08)"
130
+ };
131
+ const baseTypography = {
132
+ fontFamilySans: fonts.fontFamilySans,
133
+ fontFamilySerif: fonts.fontFamilySerif,
134
+ fontMono: fonts.fontMono,
135
+ fontSize2xs: "0.625em",
136
+ fontSizeXs: "0.75em",
137
+ fontSizeSm: "0.8125em",
138
+ fontSizeMd: "0.875em",
139
+ fontSizeLg: "1.25em",
140
+ fontSizeBase: "16px",
141
+ fontSizeSmall: "14px",
142
+ lineHeight: "1.7",
143
+ lineHeightTight: "1.4"
144
+ };
145
+ const articleLayout = {
146
+ layout: { maxWidth: "700px" },
147
+ boxShadow: sharedBoxShadow,
148
+ spacing: sharedSpacing,
149
+ typography: {
150
+ ...baseTypography,
151
+ fontFamily: fonts.fontFamilySans
152
+ },
153
+ borderRadius: sharedBorderRadius
154
+ };
155
+ const noteLayout = {
156
+ layout: { maxWidth: "700px" },
157
+ boxShadow: sharedBoxShadow,
158
+ spacing: sharedSpacing,
159
+ typography: {
160
+ ...baseTypography,
161
+ fontFamily: fonts.fontFamilySerif,
162
+ lineHeight: "1.8"
163
+ },
164
+ borderRadius: sharedBorderRadius
165
+ };
166
+ const commentLayout = {
167
+ layout: { maxWidth: "none" },
168
+ boxShadow: sharedBoxShadow,
169
+ spacing: { xs: "2px", sm: "4px", md: "10px", lg: "16px", xl: "20px" },
170
+ typography: {
171
+ ...baseTypography,
172
+ fontFamily: fonts.fontFamilySans,
173
+ fontSizeBase: "14px",
174
+ fontSizeSmall: "12px",
175
+ lineHeight: "1.5",
176
+ lineHeightTight: "1.3"
177
+ },
178
+ borderRadius: { sm: "3px", md: "6px", lg: "8px" }
179
+ };
180
+ export {
181
+ articleLayout,
182
+ articleTheme,
183
+ commentLayout,
184
+ commentTheme,
185
+ createThemeStyle,
186
+ darkColors,
187
+ fonts,
188
+ lightArticleColors,
189
+ lightCommentColors,
190
+ noteLayout,
191
+ noteTheme,
192
+ vars
193
+ };
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "@haklex/rich-style-token",
3
3
  "type": "module",
4
- "version": "0.0.63",
4
+ "version": "0.0.65",
5
5
  "description": "Style tokens and CSS variables for haklex rich editor",
6
6
  "license": "MIT",
7
7
  "exports": {
8
8
  ".": {
9
9
  "import": "./dist/index.mjs",
10
10
  "types": "./dist/index.d.ts"
11
+ },
12
+ "./styles": {
13
+ "import": "./dist/styles.mjs",
14
+ "types": "./dist/styles.d.ts"
11
15
  }
12
16
  },
13
17
  "main": "./dist/index.mjs",
package/LICENSE DELETED
@@ -1,28 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Innei
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
23
-
24
- Additional Terms and Conditions
25
-
26
- ----------------
27
-
28
- Use of this software is governed by the terms of MIT and, in addition, by the terms and conditions described in the additional file (ADDITIONAL_TERMS.md). By using this software, you agree to abide by these additional terms and conditions.