@udixio/tailwind 1.3.0 → 1.5.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 (56) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/browser/assets.d.ts +7 -0
  3. package/dist/browser/assets.d.ts.map +1 -0
  4. package/dist/browser/instrumentation.d.ts +7 -0
  5. package/dist/browser/instrumentation.d.ts.map +1 -0
  6. package/dist/browser/tailwind-browser.d.ts +2 -0
  7. package/dist/browser/tailwind-browser.d.ts.map +1 -0
  8. package/dist/browser/tailwind.plugin.d.ts +21 -0
  9. package/dist/browser/tailwind.plugin.d.ts.map +1 -0
  10. package/dist/browser.cjs +8 -0
  11. package/dist/browser.js +9 -0
  12. package/dist/index.browser.d.ts +5 -0
  13. package/dist/index.browser.d.ts.map +1 -0
  14. package/dist/{index.d.ts → index.node.d.ts} +2 -2
  15. package/dist/index.node.d.ts.map +1 -0
  16. package/dist/main.d.ts +9 -0
  17. package/dist/main.d.ts.map +1 -0
  18. package/dist/node/file.d.ts +6 -0
  19. package/dist/node/file.d.ts.map +1 -0
  20. package/dist/node/index.d.ts +3 -0
  21. package/dist/node/index.d.ts.map +1 -0
  22. package/dist/node/tailwind.plugin.d.ts +13 -0
  23. package/dist/node/tailwind.plugin.d.ts.map +1 -0
  24. package/dist/node.cjs +370 -0
  25. package/dist/node.js +332 -0
  26. package/dist/plugins-tailwind/font.d.ts +7 -0
  27. package/dist/plugins-tailwind/font.d.ts.map +1 -0
  28. package/dist/plugins-tailwind/shadow.d.ts +2 -0
  29. package/dist/plugins-tailwind/shadow.d.ts.map +1 -0
  30. package/dist/plugins-tailwind/state.d.ts +5 -0
  31. package/dist/plugins-tailwind/state.d.ts.map +1 -0
  32. package/dist/tailwind-browser-COFzjMN4.cjs +249 -0
  33. package/dist/tailwind-browser-CTGKNrKy.js +232 -0
  34. package/dist/tailwind.plugin-Ce1R9Jc0.js +222 -0
  35. package/dist/tailwind.plugin-JU5cwZvP.cjs +221 -0
  36. package/package.json +22 -10
  37. package/src/browser/assets.ts +11 -0
  38. package/src/browser/instrumentation.ts +29 -0
  39. package/src/browser/tailwind-browser.ts +327 -0
  40. package/src/browser/tailwind.plugin.ts +74 -0
  41. package/src/index.browser.ts +5 -0
  42. package/src/{index.ts → index.node.ts} +1 -1
  43. package/src/node/file.ts +340 -0
  44. package/src/node/index.ts +2 -0
  45. package/src/{tailwind.plugin.ts → node/tailwind.plugin.ts} +57 -71
  46. package/tsconfig.lib.json +1 -0
  47. package/vite.config.ts +21 -4
  48. package/dist/file.d.ts +0 -6
  49. package/dist/file.d.ts.map +0 -1
  50. package/dist/index.cjs +0 -428
  51. package/dist/index.d.ts.map +0 -1
  52. package/dist/index.js +0 -410
  53. package/dist/tailwind.plugin.d.ts +0 -16
  54. package/dist/tailwind.plugin.d.ts.map +0 -1
  55. package/src/file.ts +0 -227
  56. package/src/index.test.ts +0 -5
@@ -0,0 +1,222 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import plugin from "tailwindcss/plugin";
5
+ import { PluginAbstract, FontPlugin, PluginImplAbstract } from "@udixio/theme";
6
+ const defaultConfig = {
7
+ statePrefix: "state",
8
+ disabledStyles: {
9
+ textOpacity: 0.38,
10
+ backgroundOpacity: 0.12
11
+ },
12
+ transition: {
13
+ duration: 150
14
+ }
15
+ };
16
+ const state = plugin.withOptions(({ colorKeys }) => {
17
+ const resolved = {
18
+ ...defaultConfig,
19
+ disabledStyles: {
20
+ ...defaultConfig.disabledStyles,
21
+ ...{}
22
+ },
23
+ transition: {
24
+ ...defaultConfig.transition,
25
+ ...{}
26
+ }
27
+ };
28
+ return ({ addComponents }) => {
29
+ const newComponents = {};
30
+ for (const isGroup of [false, true]) {
31
+ const group = isGroup ? "group-" : "";
32
+ for (const colorName of colorKeys) {
33
+ const className = `.${group}${resolved.statePrefix}-${colorName}`;
34
+ newComponents[className] = {
35
+ [`@apply ${group}hover:bg-${colorName}/[0.08]`]: {},
36
+ [`@apply ${group}active:bg-${colorName}/[0.12]`]: {},
37
+ [`@apply ${group}focus-visible:bg-${colorName}/[0.12]`]: {},
38
+ [`@apply transition-colors`]: {},
39
+ [`@apply duration-${resolved.transition.duration}`]: {},
40
+ [`@apply ${group}disabled:text-on-surface/[${resolved.disabledStyles.textOpacity}]`]: {},
41
+ [`@apply ${group}disabled:bg-on-surface/[${resolved.disabledStyles.backgroundOpacity}]`]: {}
42
+ };
43
+ }
44
+ }
45
+ for (const colorName of colorKeys) {
46
+ for (const stateName of ["hover", "active", "focus", "disabled"]) {
47
+ const className = `.${stateName}-${resolved.statePrefix}-${colorName}`;
48
+ if (stateName === "disabled") {
49
+ newComponents[className] = {
50
+ [`@apply text-on-surface/[${resolved.disabledStyles.textOpacity}]`]: {},
51
+ [`@apply bg-on-surface/[${resolved.disabledStyles.backgroundOpacity}]`]: {}
52
+ };
53
+ } else {
54
+ const opacity = stateName === "hover" ? 0.08 : 0.12;
55
+ newComponents[className] = {
56
+ [`@apply bg-${colorName}/[${opacity}]`]: {}
57
+ };
58
+ }
59
+ }
60
+ }
61
+ addComponents(newComponents);
62
+ };
63
+ });
64
+ const font = plugin.withOptions((options) => {
65
+ return ({
66
+ addUtilities,
67
+ theme
68
+ }) => {
69
+ const { fontStyles, responsiveBreakPoints } = options;
70
+ const pixelUnit = "rem";
71
+ const newUtilities = {};
72
+ const baseTextStyle = (sizeValue) => ({
73
+ fontSize: sizeValue.fontSize + pixelUnit,
74
+ fontWeight: sizeValue.fontWeight,
75
+ lineHeight: sizeValue.lineHeight + pixelUnit,
76
+ letterSpacing: sizeValue.letterSpacing ? sizeValue.letterSpacing + pixelUnit : null,
77
+ fontFamily: theme("fontFamily." + sizeValue.fontFamily)
78
+ });
79
+ const responsiveTextStyle = (sizeValue, breakPointName, breakPointRatio) => ({
80
+ [`@media (min-width: ${theme("screens." + breakPointName, {})})`]: {
81
+ fontSize: sizeValue.fontSize * breakPointRatio + pixelUnit,
82
+ lineHeight: sizeValue.lineHeight * breakPointRatio + pixelUnit
83
+ }
84
+ });
85
+ for (const [roleName, roleValue] of Object.entries(fontStyles)) {
86
+ for (const [sizeName, sizeValue] of Object.entries(roleValue)) {
87
+ newUtilities[`.text-${roleName}-${sizeName}`] = {
88
+ ...baseTextStyle(sizeValue),
89
+ ...Object.entries(responsiveBreakPoints).reduce(
90
+ (acc, [breakPointName, breakPointRatio]) => ({
91
+ ...acc,
92
+ ...responsiveTextStyle(
93
+ sizeValue,
94
+ breakPointName,
95
+ breakPointRatio
96
+ )
97
+ }),
98
+ {}
99
+ )
100
+ };
101
+ }
102
+ }
103
+ addUtilities(newUtilities);
104
+ };
105
+ });
106
+ const shadow = plugin(
107
+ ({ addUtilities }) => {
108
+ addUtilities({
109
+ [".shadow"]: {
110
+ boxShadow: "0 4px 10px #00000008, 0 0 2px #0000000f, 0 2px 6px #0000001f"
111
+ },
112
+ [".shadow-1"]: {
113
+ boxShadow: "0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)"
114
+ },
115
+ [".shadow-2"]: {
116
+ boxShadow: "0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)"
117
+ },
118
+ [".shadow-3"]: {
119
+ boxShadow: "0px 1px 3px 0px rgba(0, 0, 0, 0.30), 0px 4px 8px 3px rgba(0, 0, 0, 0.15)"
120
+ },
121
+ [".shadow-4"]: {
122
+ boxShadow: "0px 2px 3px 0px rgba(0, 0, 0, 0.30), 0px 6px 10px 4px rgba(0, 0, 0, 0.15)"
123
+ },
124
+ [".box-shadow-5"]: {
125
+ boxShadow: "0px 4px 4px 0px rgba(0, 0, 0, 0.30), 0px 8px 12px 6px rgba(0, 0, 0, 0.15)"
126
+ }
127
+ });
128
+ }
129
+ );
130
+ const main = plugin.withOptions((args) => {
131
+ const configCss = args;
132
+ const fontStyles = {};
133
+ configCss.fontStyles.forEach((line) => {
134
+ const [styleToken, ...properties] = line.split(" ");
135
+ const [roleToken, sizeToken] = styleToken.split("-");
136
+ fontStyles[roleToken] ?? (fontStyles[roleToken] = {});
137
+ properties.forEach((properties2) => {
138
+ var _a;
139
+ (_a = fontStyles[roleToken])[sizeToken] ?? (_a[sizeToken] = {});
140
+ const [key, value] = properties2.slice(0, -1).split("[");
141
+ fontStyles[roleToken][sizeToken][key] = value;
142
+ });
143
+ });
144
+ let breakPointsCss = configCss.responsiveBreakPoints;
145
+ if (!Array.isArray(breakPointsCss)) {
146
+ breakPointsCss = [breakPointsCss];
147
+ }
148
+ const responsiveBreakPoints = {};
149
+ breakPointsCss.forEach((line) => {
150
+ const [key, value] = line.split(" ");
151
+ responsiveBreakPoints[key] = value;
152
+ });
153
+ const options = {
154
+ colorKeys: configCss.colorKeys,
155
+ fontStyles,
156
+ responsiveBreakPoints
157
+ };
158
+ return (api) => {
159
+ font(options).handler(api);
160
+ state(options).handler(api);
161
+ shadow.handler(api);
162
+ };
163
+ });
164
+ class TailwindPlugin extends PluginAbstract {
165
+ constructor() {
166
+ super(...arguments);
167
+ __publicField(this, "dependencies", [FontPlugin]);
168
+ __publicField(this, "name", "tailwind");
169
+ __publicField(this, "pluginClass", TailwindImplPluginBrowser);
170
+ }
171
+ }
172
+ class TailwindImplPluginBrowser extends PluginImplAbstract {
173
+ constructor() {
174
+ super(...arguments);
175
+ __publicField(this, "outputCss", "");
176
+ __publicField(this, "colors", {});
177
+ }
178
+ onInit() {
179
+ var _a;
180
+ (_a = this.options).responsiveBreakPoints ?? (_a.responsiveBreakPoints = {
181
+ lg: 1.125
182
+ });
183
+ }
184
+ loadColor() {
185
+ this.outputCss += `
186
+ @custom-variant dark (&:where(.dark, .dark *));
187
+ @theme {
188
+ --color-*: initial;
189
+ ${Object.entries(this.colors).map(([key, value]) => `--color-${key}: ${value.light};`).join("\n ")}
190
+ }
191
+ @layer theme {
192
+ .dark {
193
+ ${Object.entries(this.colors).map(([key, value]) => `--color-${key}: ${value.dark};`).join("\n ")}
194
+ }
195
+ }
196
+ `;
197
+ }
198
+ async onLoad() {
199
+ var _a;
200
+ this.colors = {};
201
+ for (const isDark of [false, true]) {
202
+ this.api.themes.update({ isDark });
203
+ for (const [key, value] of this.api.colors.getColors().entries()) {
204
+ const newKey = key.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
205
+ (_a = this.colors)[newKey] ?? (_a[newKey] = { light: "", dark: "" });
206
+ this.colors[newKey][isDark ? "dark" : "light"] = value.getHex();
207
+ }
208
+ }
209
+ if (typeof window !== "undefined") {
210
+ const { tailwindBrowserInit } = await import("./tailwind-browser-CTGKNrKy.js");
211
+ this.outputCss = await tailwindBrowserInit(this.outputCss);
212
+ }
213
+ this.loadColor();
214
+ }
215
+ }
216
+ export {
217
+ TailwindImplPluginBrowser as T,
218
+ TailwindPlugin as a,
219
+ font as f,
220
+ main as m,
221
+ state as s
222
+ };
@@ -0,0 +1,221 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ const plugin = require("tailwindcss/plugin");
6
+ const theme = require("@udixio/theme");
7
+ const defaultConfig = {
8
+ statePrefix: "state",
9
+ disabledStyles: {
10
+ textOpacity: 0.38,
11
+ backgroundOpacity: 0.12
12
+ },
13
+ transition: {
14
+ duration: 150
15
+ }
16
+ };
17
+ const state = plugin.withOptions(({ colorKeys }) => {
18
+ const resolved = {
19
+ ...defaultConfig,
20
+ disabledStyles: {
21
+ ...defaultConfig.disabledStyles,
22
+ ...{}
23
+ },
24
+ transition: {
25
+ ...defaultConfig.transition,
26
+ ...{}
27
+ }
28
+ };
29
+ return ({ addComponents }) => {
30
+ const newComponents = {};
31
+ for (const isGroup of [false, true]) {
32
+ const group = isGroup ? "group-" : "";
33
+ for (const colorName of colorKeys) {
34
+ const className = `.${group}${resolved.statePrefix}-${colorName}`;
35
+ newComponents[className] = {
36
+ [`@apply ${group}hover:bg-${colorName}/[0.08]`]: {},
37
+ [`@apply ${group}active:bg-${colorName}/[0.12]`]: {},
38
+ [`@apply ${group}focus-visible:bg-${colorName}/[0.12]`]: {},
39
+ [`@apply transition-colors`]: {},
40
+ [`@apply duration-${resolved.transition.duration}`]: {},
41
+ [`@apply ${group}disabled:text-on-surface/[${resolved.disabledStyles.textOpacity}]`]: {},
42
+ [`@apply ${group}disabled:bg-on-surface/[${resolved.disabledStyles.backgroundOpacity}]`]: {}
43
+ };
44
+ }
45
+ }
46
+ for (const colorName of colorKeys) {
47
+ for (const stateName of ["hover", "active", "focus", "disabled"]) {
48
+ const className = `.${stateName}-${resolved.statePrefix}-${colorName}`;
49
+ if (stateName === "disabled") {
50
+ newComponents[className] = {
51
+ [`@apply text-on-surface/[${resolved.disabledStyles.textOpacity}]`]: {},
52
+ [`@apply bg-on-surface/[${resolved.disabledStyles.backgroundOpacity}]`]: {}
53
+ };
54
+ } else {
55
+ const opacity = stateName === "hover" ? 0.08 : 0.12;
56
+ newComponents[className] = {
57
+ [`@apply bg-${colorName}/[${opacity}]`]: {}
58
+ };
59
+ }
60
+ }
61
+ }
62
+ addComponents(newComponents);
63
+ };
64
+ });
65
+ const font = plugin.withOptions((options) => {
66
+ return ({
67
+ addUtilities,
68
+ theme: theme2
69
+ }) => {
70
+ const { fontStyles, responsiveBreakPoints } = options;
71
+ const pixelUnit = "rem";
72
+ const newUtilities = {};
73
+ const baseTextStyle = (sizeValue) => ({
74
+ fontSize: sizeValue.fontSize + pixelUnit,
75
+ fontWeight: sizeValue.fontWeight,
76
+ lineHeight: sizeValue.lineHeight + pixelUnit,
77
+ letterSpacing: sizeValue.letterSpacing ? sizeValue.letterSpacing + pixelUnit : null,
78
+ fontFamily: theme2("fontFamily." + sizeValue.fontFamily)
79
+ });
80
+ const responsiveTextStyle = (sizeValue, breakPointName, breakPointRatio) => ({
81
+ [`@media (min-width: ${theme2("screens." + breakPointName, {})})`]: {
82
+ fontSize: sizeValue.fontSize * breakPointRatio + pixelUnit,
83
+ lineHeight: sizeValue.lineHeight * breakPointRatio + pixelUnit
84
+ }
85
+ });
86
+ for (const [roleName, roleValue] of Object.entries(fontStyles)) {
87
+ for (const [sizeName, sizeValue] of Object.entries(roleValue)) {
88
+ newUtilities[`.text-${roleName}-${sizeName}`] = {
89
+ ...baseTextStyle(sizeValue),
90
+ ...Object.entries(responsiveBreakPoints).reduce(
91
+ (acc, [breakPointName, breakPointRatio]) => ({
92
+ ...acc,
93
+ ...responsiveTextStyle(
94
+ sizeValue,
95
+ breakPointName,
96
+ breakPointRatio
97
+ )
98
+ }),
99
+ {}
100
+ )
101
+ };
102
+ }
103
+ }
104
+ addUtilities(newUtilities);
105
+ };
106
+ });
107
+ const shadow = plugin(
108
+ ({ addUtilities }) => {
109
+ addUtilities({
110
+ [".shadow"]: {
111
+ boxShadow: "0 4px 10px #00000008, 0 0 2px #0000000f, 0 2px 6px #0000001f"
112
+ },
113
+ [".shadow-1"]: {
114
+ boxShadow: "0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)"
115
+ },
116
+ [".shadow-2"]: {
117
+ boxShadow: "0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)"
118
+ },
119
+ [".shadow-3"]: {
120
+ boxShadow: "0px 1px 3px 0px rgba(0, 0, 0, 0.30), 0px 4px 8px 3px rgba(0, 0, 0, 0.15)"
121
+ },
122
+ [".shadow-4"]: {
123
+ boxShadow: "0px 2px 3px 0px rgba(0, 0, 0, 0.30), 0px 6px 10px 4px rgba(0, 0, 0, 0.15)"
124
+ },
125
+ [".box-shadow-5"]: {
126
+ boxShadow: "0px 4px 4px 0px rgba(0, 0, 0, 0.30), 0px 8px 12px 6px rgba(0, 0, 0, 0.15)"
127
+ }
128
+ });
129
+ }
130
+ );
131
+ const main = plugin.withOptions((args) => {
132
+ const configCss = args;
133
+ const fontStyles = {};
134
+ configCss.fontStyles.forEach((line) => {
135
+ const [styleToken, ...properties] = line.split(" ");
136
+ const [roleToken, sizeToken] = styleToken.split("-");
137
+ fontStyles[roleToken] ?? (fontStyles[roleToken] = {});
138
+ properties.forEach((properties2) => {
139
+ var _a;
140
+ (_a = fontStyles[roleToken])[sizeToken] ?? (_a[sizeToken] = {});
141
+ const [key, value] = properties2.slice(0, -1).split("[");
142
+ fontStyles[roleToken][sizeToken][key] = value;
143
+ });
144
+ });
145
+ let breakPointsCss = configCss.responsiveBreakPoints;
146
+ if (!Array.isArray(breakPointsCss)) {
147
+ breakPointsCss = [breakPointsCss];
148
+ }
149
+ const responsiveBreakPoints = {};
150
+ breakPointsCss.forEach((line) => {
151
+ const [key, value] = line.split(" ");
152
+ responsiveBreakPoints[key] = value;
153
+ });
154
+ const options = {
155
+ colorKeys: configCss.colorKeys,
156
+ fontStyles,
157
+ responsiveBreakPoints
158
+ };
159
+ return (api) => {
160
+ font(options).handler(api);
161
+ state(options).handler(api);
162
+ shadow.handler(api);
163
+ };
164
+ });
165
+ class TailwindPlugin extends theme.PluginAbstract {
166
+ constructor() {
167
+ super(...arguments);
168
+ __publicField(this, "dependencies", [theme.FontPlugin]);
169
+ __publicField(this, "name", "tailwind");
170
+ __publicField(this, "pluginClass", TailwindImplPluginBrowser);
171
+ }
172
+ }
173
+ class TailwindImplPluginBrowser extends theme.PluginImplAbstract {
174
+ constructor() {
175
+ super(...arguments);
176
+ __publicField(this, "outputCss", "");
177
+ __publicField(this, "colors", {});
178
+ }
179
+ onInit() {
180
+ var _a;
181
+ (_a = this.options).responsiveBreakPoints ?? (_a.responsiveBreakPoints = {
182
+ lg: 1.125
183
+ });
184
+ }
185
+ loadColor() {
186
+ this.outputCss += `
187
+ @custom-variant dark (&:where(.dark, .dark *));
188
+ @theme {
189
+ --color-*: initial;
190
+ ${Object.entries(this.colors).map(([key, value]) => `--color-${key}: ${value.light};`).join("\n ")}
191
+ }
192
+ @layer theme {
193
+ .dark {
194
+ ${Object.entries(this.colors).map(([key, value]) => `--color-${key}: ${value.dark};`).join("\n ")}
195
+ }
196
+ }
197
+ `;
198
+ }
199
+ async onLoad() {
200
+ var _a;
201
+ this.colors = {};
202
+ for (const isDark of [false, true]) {
203
+ this.api.themes.update({ isDark });
204
+ for (const [key, value] of this.api.colors.getColors().entries()) {
205
+ const newKey = key.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
206
+ (_a = this.colors)[newKey] ?? (_a[newKey] = { light: "", dark: "" });
207
+ this.colors[newKey][isDark ? "dark" : "light"] = value.getHex();
208
+ }
209
+ }
210
+ if (typeof window !== "undefined") {
211
+ const { tailwindBrowserInit } = await Promise.resolve().then(() => require("./tailwind-browser-COFzjMN4.cjs"));
212
+ this.outputCss = await tailwindBrowserInit(this.outputCss);
213
+ }
214
+ this.loadColor();
215
+ }
216
+ }
217
+ exports.TailwindImplPluginBrowser = TailwindImplPluginBrowser;
218
+ exports.TailwindPlugin = TailwindPlugin;
219
+ exports.font = font;
220
+ exports.main = main;
221
+ exports.state = state;
package/package.json CHANGED
@@ -1,24 +1,36 @@
1
1
  {
2
2
  "name": "@udixio/tailwind",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
5
+ "main": "./dist/node.js",
6
+ "module": "./dist/node.js",
7
+ "types": "./dist/node.d.ts",
8
8
  "exports": {
9
9
  "./package.json": "./package.json",
10
10
  ".": {
11
- "development": "./src/index.ts",
12
- "types": "./dist/index.d.ts",
13
- "import": "./dist/index.js",
14
- "require": "./dist/index.cjs",
15
- "default": "./dist/index.js"
11
+ "development": "./src/index.node.ts",
12
+ "types": "./dist/index.node.d.ts",
13
+ "browser": {
14
+ "import": "./dist/browser.js",
15
+ "require": "./dist/browser.cjs",
16
+ "default": "./dist/browser.js"
17
+ },
18
+ "node": {
19
+ "import": "./dist/node.js",
20
+ "require": "./dist/node.cjs",
21
+ "default": "./dist/node.js"
22
+ },
23
+ "import": "./dist/browser.js",
24
+ "require": "./dist/browser.cjs",
25
+ "default": "./dist/browser.js"
16
26
  }
17
27
  },
18
28
  "dependencies": {
29
+ "tailwindcss": "^4.1.12",
30
+ "chalk": "^5.6.0",
19
31
  "pathe": "^2.0.3",
20
32
  "tslib": "^2.3.0",
21
- "@udixio/theme": "1.1.0"
33
+ "@udixio/theme": "1.2.0"
22
34
  },
23
35
  "repository": {
24
36
  "type": "git",
@@ -0,0 +1,11 @@
1
+ import index from 'tailwindcss/index.css?inline';
2
+ import preflight from 'tailwindcss/preflight.css?inline';
3
+ import theme from 'tailwindcss/theme.css?inline';
4
+ import utilities from 'tailwindcss/utilities.css?inline';
5
+
6
+ export const css = {
7
+ index,
8
+ preflight,
9
+ theme,
10
+ utilities,
11
+ };
@@ -0,0 +1,29 @@
1
+ export class Instrumentation {
2
+ start(label: string) {
3
+ performance.mark(`${label} (start)`);
4
+ }
5
+
6
+ end(label: string, detail?: any) {
7
+ performance.mark(`${label} (end)`);
8
+
9
+ performance.measure(label, {
10
+ start: `${label} (start)`,
11
+ end: `${label} (end)`,
12
+ detail,
13
+ });
14
+ }
15
+
16
+ hit(label: string, detail?: any) {
17
+ performance.mark(label, {
18
+ detail,
19
+ });
20
+ }
21
+
22
+ error(error: any) {
23
+ performance.mark(`(error)`, {
24
+ detail: { error: `${error}` },
25
+ });
26
+
27
+ throw error;
28
+ }
29
+ }