@puzzle-ui/theme 0.0.0-stage → 0.2.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.
Files changed (87) hide show
  1. package/README.md +112 -2
  2. package/dist/LICENSE +21 -0
  3. package/dist/breakpoints.cjs +10 -0
  4. package/dist/breakpoints.cjs.map +1 -0
  5. package/dist/breakpoints.d.cts +7 -0
  6. package/dist/breakpoints.d.ts +7 -0
  7. package/dist/breakpoints.js +10 -0
  8. package/dist/breakpoints.js.map +1 -0
  9. package/dist/components-context.cjs +19 -0
  10. package/dist/components-context.cjs.map +1 -0
  11. package/dist/components-context.d.cts +8 -0
  12. package/dist/components-context.d.ts +8 -0
  13. package/dist/components-context.js +17 -0
  14. package/dist/components-context.js.map +1 -0
  15. package/dist/components.types.d.cts +46 -0
  16. package/dist/components.types.d.ts +46 -0
  17. package/dist/constants.cjs +567 -0
  18. package/dist/constants.cjs.map +1 -0
  19. package/dist/constants.d.cts +363 -0
  20. package/dist/constants.d.ts +363 -0
  21. package/dist/constants.js +565 -0
  22. package/dist/constants.js.map +1 -0
  23. package/dist/create-theme-css.cjs +7 -0
  24. package/dist/create-theme-css.cjs.map +1 -0
  25. package/dist/create-theme-css.js +7 -0
  26. package/dist/create-theme-css.js.map +1 -0
  27. package/dist/create-theme-variables.cjs +135 -0
  28. package/dist/create-theme-variables.cjs.map +1 -0
  29. package/dist/create-theme-variables.js +134 -0
  30. package/dist/create-theme-variables.js.map +1 -0
  31. package/dist/fonts/constants.cjs +9 -0
  32. package/dist/fonts/constants.cjs.map +1 -0
  33. package/dist/fonts/constants.js +9 -0
  34. package/dist/fonts/constants.js.map +1 -0
  35. package/dist/fonts/create-google-font-url.cjs +27 -0
  36. package/dist/fonts/create-google-font-url.cjs.map +1 -0
  37. package/dist/fonts/create-google-font-url.d.cts +2 -0
  38. package/dist/fonts/create-google-font-url.d.ts +2 -0
  39. package/dist/fonts/create-google-font-url.js +27 -0
  40. package/dist/fonts/create-google-font-url.js.map +1 -0
  41. package/dist/fonts/google-font-familiy.d.cts +1 -0
  42. package/dist/fonts/google-font-familiy.d.ts +1 -0
  43. package/dist/fonts/google-font.cjs +42 -0
  44. package/dist/fonts/google-font.cjs.map +1 -0
  45. package/dist/fonts/google-font.d.cts +4 -0
  46. package/dist/fonts/google-font.d.ts +4 -0
  47. package/dist/fonts/google-font.js +42 -0
  48. package/dist/fonts/google-font.js.map +1 -0
  49. package/dist/fonts/index.d.cts +4 -0
  50. package/dist/fonts/resolve-font-config.cjs +28 -0
  51. package/dist/fonts/resolve-font-config.cjs.map +1 -0
  52. package/dist/fonts/resolve-font-config.js +28 -0
  53. package/dist/fonts/resolve-font-config.js.map +1 -0
  54. package/dist/fonts/resolve-font-stylesheets.cjs +47 -0
  55. package/dist/fonts/resolve-font-stylesheets.cjs.map +1 -0
  56. package/dist/fonts/resolve-font-stylesheets.js +47 -0
  57. package/dist/fonts/resolve-font-stylesheets.js.map +1 -0
  58. package/dist/fonts/types.d.cts +28 -0
  59. package/dist/fonts/types.d.ts +28 -0
  60. package/dist/fonts/typography.cjs +172 -0
  61. package/dist/fonts/typography.cjs.map +1 -0
  62. package/dist/fonts/typography.d.cts +2 -0
  63. package/dist/fonts/typography.d.ts +2 -0
  64. package/dist/fonts/typography.js +170 -0
  65. package/dist/fonts/typography.js.map +1 -0
  66. package/dist/global.css +135 -0
  67. package/dist/index.cjs +9 -0
  68. package/dist/index.d.cts +10 -0
  69. package/dist/index.d.ts +9 -0
  70. package/dist/index.js +5 -0
  71. package/dist/scope-context.cjs +58 -0
  72. package/dist/scope-context.cjs.map +1 -0
  73. package/dist/scope-context.d.cts +14 -0
  74. package/dist/scope-context.d.ts +14 -0
  75. package/dist/scope-context.js +56 -0
  76. package/dist/scope-context.js.map +1 -0
  77. package/dist/theme-scopes.css +90 -0
  78. package/dist/theme.cjs +56 -0
  79. package/dist/theme.cjs.map +1 -0
  80. package/dist/theme.css +194 -0
  81. package/dist/theme.d.cts +18 -0
  82. package/dist/theme.d.ts +17 -0
  83. package/dist/theme.js +56 -0
  84. package/dist/theme.js.map +1 -0
  85. package/dist/types.d.cts +185 -0
  86. package/dist/types.d.ts +185 -0
  87. package/package.json +73 -4
@@ -0,0 +1,185 @@
1
+ import { COLOR_THEMES } from "./constants.cjs";
2
+ import { DeepPartial } from "@puzzle-ui/core";
3
+ export type ThemeMode = "light" | "dark" | "system";
4
+ export type TypographyStyle = "display1" | "display2" | "headline1" | "headline2" | "headline3" | "headline4" | "subtitle1" | "subtitle2" | "body1" | "body2" | "button" | "caption" | "overline";
5
+ export type ThemeTypographyFontRole = "heading" | "body" | "accent";
6
+ export type ThemeTypographyRoleTokens = {
7
+ font: ThemeTypographyFontRole;
8
+ fontSize: string;
9
+ fontWeight: string;
10
+ lineHeight: string;
11
+ letterSpacing: string;
12
+ };
13
+ export type ThemeColorSchemeTokens = {
14
+ background: string;
15
+ surface: string;
16
+ surfaceElevated: string;
17
+ surfaceSunken: string;
18
+ text: string;
19
+ textMuted: string;
20
+ textSubtle: string;
21
+ border: string;
22
+ borderStrong: string;
23
+ primary: string;
24
+ primaryForeground: string;
25
+ secondary: string;
26
+ secondaryForeground: string;
27
+ accent: string;
28
+ accentForeground: string;
29
+ ring: string;
30
+ success: string;
31
+ successForeground: string;
32
+ warning: string;
33
+ warningForeground: string;
34
+ danger: string;
35
+ dangerForeground: string;
36
+ info: string;
37
+ infoForeground: string;
38
+ };
39
+ export type ThemeTokens = {
40
+ colorSchemes: {
41
+ light: ThemeColorSchemeTokens;
42
+ dark: ThemeColorSchemeTokens;
43
+ };
44
+ typography: {
45
+ fontSize: {
46
+ xs: string;
47
+ sm: string;
48
+ base: string;
49
+ lg: string;
50
+ xl: string;
51
+ "2xl": string;
52
+ "3xl": string;
53
+ "4xl": string;
54
+ "5xl": string;
55
+ "6xl": string;
56
+ };
57
+ fontWeight: {
58
+ normal: string;
59
+ medium: string;
60
+ semibold: string;
61
+ bold: string;
62
+ extrabold: string;
63
+ };
64
+ lineHeight: {
65
+ none: string;
66
+ tight: string;
67
+ snug: string;
68
+ normal: string;
69
+ relaxed: string;
70
+ loose: string;
71
+ };
72
+ letterSpacing: {
73
+ tighter: string;
74
+ tight: string;
75
+ normal: string;
76
+ wide: string;
77
+ wider: string;
78
+ widest: string;
79
+ };
80
+ fontGap: {
81
+ headingStackGap: string;
82
+ headingParagraphGap: string;
83
+ paragraphGap: string;
84
+ sectionGap: string;
85
+ };
86
+ /**
87
+ * Named typography roles.
88
+ *
89
+ * Optional to keep existing user-defined theme objects backwards
90
+ * compatible. The resolver supplies defaults for every role.
91
+ */
92
+ roles?: Partial<Record<TypographyStyle, ThemeTypographyRoleTokens>>;
93
+ };
94
+ spacing: {
95
+ 0: string;
96
+ px: string;
97
+ "0.5": string;
98
+ 1: string;
99
+ "1.5": string;
100
+ 2: string;
101
+ 3: string;
102
+ 4: string;
103
+ 5: string;
104
+ 6: string;
105
+ 8: string;
106
+ 10: string;
107
+ 12: string;
108
+ 16: string;
109
+ 20: string;
110
+ 24: string;
111
+ };
112
+ radius: {
113
+ none: string;
114
+ sm: string;
115
+ md: string;
116
+ lg: string;
117
+ xl: string;
118
+ "2xl": string;
119
+ "3xl": string;
120
+ full: string;
121
+ };
122
+ shadows: {
123
+ none: string;
124
+ xs: string;
125
+ sm: string;
126
+ md: string;
127
+ lg: string;
128
+ xl: string;
129
+ };
130
+ elevation: {
131
+ 1: string;
132
+ 2: string;
133
+ 3: string;
134
+ 4: string;
135
+ 6: string;
136
+ 8: string;
137
+ 12: string;
138
+ 16: string;
139
+ 24: string;
140
+ };
141
+ borders: {
142
+ width: string;
143
+ widthStrong: string;
144
+ style: string;
145
+ };
146
+ breakpoints: {
147
+ tablet: string;
148
+ desktop: string;
149
+ hd: string;
150
+ };
151
+ layout: {
152
+ container: string;
153
+ content: string;
154
+ prose: string;
155
+ };
156
+ overlays: {
157
+ backdrop: string;
158
+ backdropBlur: string;
159
+ };
160
+ motion: {
161
+ fast: string;
162
+ normal: string;
163
+ slow: string;
164
+ easingStandard: string;
165
+ easingIn: string;
166
+ easingOut: string;
167
+ };
168
+ zIndex: {
169
+ base: string;
170
+ dropdown: string;
171
+ sticky: string;
172
+ navigation: string;
173
+ overlay: string;
174
+ modal: string;
175
+ popover: string;
176
+ toast: string;
177
+ tooltip: string;
178
+ };
179
+ };
180
+ export type ColorTheme = {
181
+ light: ThemeTokens["colorSchemes"]["light"];
182
+ dark: Pick<ThemeTokens["colorSchemes"]["dark"], "primary" | "primaryForeground" | "secondary" | "secondaryForeground" | "accent" | "accentForeground">;
183
+ };
184
+ export type ColorThemes = keyof typeof COLOR_THEMES;
185
+ export type ThemeTokenOverrides = DeepPartial<ThemeTokens>;
@@ -0,0 +1,185 @@
1
+ import { COLOR_THEMES } from "./constants.js";
2
+ import { DeepPartial } from "@puzzle-ui/core";
3
+ export type ThemeMode = "light" | "dark" | "system";
4
+ export type TypographyStyle = "display1" | "display2" | "headline1" | "headline2" | "headline3" | "headline4" | "subtitle1" | "subtitle2" | "body1" | "body2" | "button" | "caption" | "overline";
5
+ export type ThemeTypographyFontRole = "heading" | "body" | "accent";
6
+ export type ThemeTypographyRoleTokens = {
7
+ font: ThemeTypographyFontRole;
8
+ fontSize: string;
9
+ fontWeight: string;
10
+ lineHeight: string;
11
+ letterSpacing: string;
12
+ };
13
+ export type ThemeColorSchemeTokens = {
14
+ background: string;
15
+ surface: string;
16
+ surfaceElevated: string;
17
+ surfaceSunken: string;
18
+ text: string;
19
+ textMuted: string;
20
+ textSubtle: string;
21
+ border: string;
22
+ borderStrong: string;
23
+ primary: string;
24
+ primaryForeground: string;
25
+ secondary: string;
26
+ secondaryForeground: string;
27
+ accent: string;
28
+ accentForeground: string;
29
+ ring: string;
30
+ success: string;
31
+ successForeground: string;
32
+ warning: string;
33
+ warningForeground: string;
34
+ danger: string;
35
+ dangerForeground: string;
36
+ info: string;
37
+ infoForeground: string;
38
+ };
39
+ export type ThemeTokens = {
40
+ colorSchemes: {
41
+ light: ThemeColorSchemeTokens;
42
+ dark: ThemeColorSchemeTokens;
43
+ };
44
+ typography: {
45
+ fontSize: {
46
+ xs: string;
47
+ sm: string;
48
+ base: string;
49
+ lg: string;
50
+ xl: string;
51
+ "2xl": string;
52
+ "3xl": string;
53
+ "4xl": string;
54
+ "5xl": string;
55
+ "6xl": string;
56
+ };
57
+ fontWeight: {
58
+ normal: string;
59
+ medium: string;
60
+ semibold: string;
61
+ bold: string;
62
+ extrabold: string;
63
+ };
64
+ lineHeight: {
65
+ none: string;
66
+ tight: string;
67
+ snug: string;
68
+ normal: string;
69
+ relaxed: string;
70
+ loose: string;
71
+ };
72
+ letterSpacing: {
73
+ tighter: string;
74
+ tight: string;
75
+ normal: string;
76
+ wide: string;
77
+ wider: string;
78
+ widest: string;
79
+ };
80
+ fontGap: {
81
+ headingStackGap: string;
82
+ headingParagraphGap: string;
83
+ paragraphGap: string;
84
+ sectionGap: string;
85
+ };
86
+ /**
87
+ * Named typography roles.
88
+ *
89
+ * Optional to keep existing user-defined theme objects backwards
90
+ * compatible. The resolver supplies defaults for every role.
91
+ */
92
+ roles?: Partial<Record<TypographyStyle, ThemeTypographyRoleTokens>>;
93
+ };
94
+ spacing: {
95
+ 0: string;
96
+ px: string;
97
+ "0.5": string;
98
+ 1: string;
99
+ "1.5": string;
100
+ 2: string;
101
+ 3: string;
102
+ 4: string;
103
+ 5: string;
104
+ 6: string;
105
+ 8: string;
106
+ 10: string;
107
+ 12: string;
108
+ 16: string;
109
+ 20: string;
110
+ 24: string;
111
+ };
112
+ radius: {
113
+ none: string;
114
+ sm: string;
115
+ md: string;
116
+ lg: string;
117
+ xl: string;
118
+ "2xl": string;
119
+ "3xl": string;
120
+ full: string;
121
+ };
122
+ shadows: {
123
+ none: string;
124
+ xs: string;
125
+ sm: string;
126
+ md: string;
127
+ lg: string;
128
+ xl: string;
129
+ };
130
+ elevation: {
131
+ 1: string;
132
+ 2: string;
133
+ 3: string;
134
+ 4: string;
135
+ 6: string;
136
+ 8: string;
137
+ 12: string;
138
+ 16: string;
139
+ 24: string;
140
+ };
141
+ borders: {
142
+ width: string;
143
+ widthStrong: string;
144
+ style: string;
145
+ };
146
+ breakpoints: {
147
+ tablet: string;
148
+ desktop: string;
149
+ hd: string;
150
+ };
151
+ layout: {
152
+ container: string;
153
+ content: string;
154
+ prose: string;
155
+ };
156
+ overlays: {
157
+ backdrop: string;
158
+ backdropBlur: string;
159
+ };
160
+ motion: {
161
+ fast: string;
162
+ normal: string;
163
+ slow: string;
164
+ easingStandard: string;
165
+ easingIn: string;
166
+ easingOut: string;
167
+ };
168
+ zIndex: {
169
+ base: string;
170
+ dropdown: string;
171
+ sticky: string;
172
+ navigation: string;
173
+ overlay: string;
174
+ modal: string;
175
+ popover: string;
176
+ toast: string;
177
+ tooltip: string;
178
+ };
179
+ };
180
+ export type ColorTheme = {
181
+ light: ThemeTokens["colorSchemes"]["light"];
182
+ dark: Pick<ThemeTokens["colorSchemes"]["dark"], "primary" | "primaryForeground" | "secondary" | "secondaryForeground" | "accent" | "accentForeground">;
183
+ };
184
+ export type ColorThemes = keyof typeof COLOR_THEMES;
185
+ export type ThemeTokenOverrides = DeepPartial<ThemeTokens>;
package/package.json CHANGED
@@ -1,6 +1,75 @@
1
1
  {
2
2
  "name": "@puzzle-ui/theme",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Theme components for Puzzle",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public",
8
+ "registry": "https://registry.npmjs.org/"
9
+ },
10
+ "type": "module",
11
+ "sideEffects": [
12
+ "**/*.css"
13
+ ],
14
+ "main": "./dist/index.cjs",
15
+ "module": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "import": {
20
+ "types": "./dist/index.d.ts",
21
+ "default": "./dist/index.js"
22
+ },
23
+ "require": {
24
+ "types": "./dist/index.d.cts",
25
+ "default": "./dist/index.cjs"
26
+ }
27
+ },
28
+ "./components-context": {
29
+ "import": {
30
+ "types": "./dist/components-context.d.ts",
31
+ "default": "./dist/components-context.js"
32
+ },
33
+ "require": {
34
+ "types": "./dist/components-context.d.cts",
35
+ "default": "./dist/components-context.cjs"
36
+ }
37
+ },
38
+ "./scope-context": {
39
+ "import": {
40
+ "types": "./dist/scope-context.d.ts",
41
+ "default": "./dist/scope-context.js"
42
+ },
43
+ "require": {
44
+ "types": "./dist/scope-context.d.cts",
45
+ "default": "./dist/scope-context.cjs"
46
+ }
47
+ }
48
+ },
49
+ "files": [
50
+ "dist"
51
+ ],
52
+ "scripts": {
53
+ "build": "tsdown",
54
+ "vitest": "bunx vitest run",
55
+ "vitest:watch": "bunx vitest",
56
+ "clean": "rm -rf dist",
57
+ "prepack": "tsdown"
58
+ },
59
+ "dependencies": {
60
+ "@puzzle-ui/core": "^0.2.0"
61
+ },
62
+ "peerDependencies": {
63
+ "react": "^19.0.0",
64
+ "react-dom": "^19.0.0"
65
+ },
66
+ "devDependencies": {
67
+ "@tsdown/css": "^0.23.1",
68
+ "@types/node": "^26.6.6",
69
+ "@types/react": "^19.0.0",
70
+ "@types/react-dom": "^19.0.0",
71
+ "tsdown": "^0.23.1",
72
+ "typescript": "^6.0.3",
73
+ "vitest": "latest"
74
+ }
75
+ }