@removify/tailwind-preset 1.0.7 → 1.0.9

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 ADDED
@@ -0,0 +1,468 @@
1
+ import animation$1 from "tailwindcss-animate";
2
+ //#region src/plugins/index.ts
3
+ const plugins = [animation$1];
4
+ //#endregion
5
+ //#region src/theme/animation.ts
6
+ const uiAnimation = {
7
+ "radix-accordion-down": "radix-accordion-down 0.1s ease-out",
8
+ "radix-accordion-up": "radix-accordion-up 0.1s ease-out",
9
+ "radix-collapsible-down": "radix-collapsible-down 0.1s ease-in-out",
10
+ "radix-collapsible-up": "radix-collapsible-up 0.1s ease-in-out",
11
+ "reka-accordion-down": "reka-accordion-down 0.1s ease-out",
12
+ "reka-accordion-up": "reka-accordion-up 0.1s ease-out",
13
+ "reka-collapsible-down": "reka-collapsible-down 0.1s ease-in-out",
14
+ "reka-collapsible-up": "reka-collapsible-up 0.1s ease-in-out",
15
+ "accordion-down": "accordion-down 0.2s ease-out",
16
+ "accordion-up": "accordion-up 0.2s ease-out",
17
+ "collapsible-down": "collapsible-down 0.2s ease-in-out",
18
+ "collapsible-up": "collapsible-up 0.2s ease-in-out"
19
+ };
20
+ const uiKeyframes = {
21
+ "radix-accordion-down": {
22
+ from: { height: "0" },
23
+ to: { height: "var(--radix-accordion-content-height)" }
24
+ },
25
+ "radix-accordion-up": {
26
+ from: { height: "var(--radix-accordion-content-height)" },
27
+ to: { height: "0" }
28
+ },
29
+ "radix-collapsible-down": {
30
+ from: { height: "0" },
31
+ to: { height: "var(--radix-collapsible-content-height)" }
32
+ },
33
+ "radix-collapsible-up": {
34
+ from: { height: "var(--radix-collapsible-content-height)" },
35
+ to: { height: "0" }
36
+ },
37
+ "reka-accordion-down": {
38
+ from: { height: "0" },
39
+ to: { height: "var(--reka-accordion-content-height)" }
40
+ },
41
+ "reka-accordion-up": {
42
+ from: { height: "var(--reka-accordion-content-height)" },
43
+ to: { height: "0" }
44
+ },
45
+ "reka-collapsible-down": {
46
+ from: { height: "0" },
47
+ to: { height: "var(--reka-collapsible-content-height)" }
48
+ },
49
+ "reka-collapsible-up": {
50
+ from: { height: "var(--reka-collapsible-content-height)" },
51
+ to: { height: "0" }
52
+ },
53
+ "accordion-down": {
54
+ from: { height: "0" },
55
+ to: { height: "var(--radix-accordion-content-height)" }
56
+ },
57
+ "accordion-up": {
58
+ from: { height: "var(--radix-accordion-content-height)" },
59
+ to: { height: "0" }
60
+ },
61
+ "collapsible-down": {
62
+ from: { height: "0" },
63
+ to: { height: "var(--radix-collapsible-content-height)" }
64
+ },
65
+ "collapsible-up": {
66
+ from: { height: "var(--radix-collapsible-content-height)" },
67
+ to: { height: "0" }
68
+ }
69
+ };
70
+ const animation = { ...uiAnimation };
71
+ const keyframes = { ...uiKeyframes };
72
+ //#endregion
73
+ //#region src/theme/colors.ts
74
+ const mainColors = {
75
+ inherit: "inherit",
76
+ current: "currentColor",
77
+ transparent: "transparent",
78
+ danger: "#EA3529",
79
+ warning: "#F97316",
80
+ success: "#15A46E",
81
+ info: "#3EC2C9",
82
+ special: "#686DF4",
83
+ black: "#000000",
84
+ white: "#FFFFFF",
85
+ bateau: {
86
+ DEFAULT: "#1C749F",
87
+ 50: "#F2F5F7",
88
+ 100: "#E7ECF0",
89
+ 200: "#CCD7E1",
90
+ 300: "#ADC0D0",
91
+ 400: "#6390B0",
92
+ 500: "#1C749F",
93
+ 600: "#1B6F98",
94
+ 700: "#186388",
95
+ 800: "#155675",
96
+ 900: "#114660",
97
+ 950: "#0C3144"
98
+ },
99
+ pompelmo: {
100
+ DEFAULT: "#FF6663",
101
+ 50: "#FFF4F4",
102
+ 100: "#FFEBEA",
103
+ 200: "#FFD4D4",
104
+ 300: "#FFBCBB",
105
+ 400: "#FF9F9E",
106
+ 500: "#FF6663",
107
+ 600: "#F3615E",
108
+ 700: "#DA5754",
109
+ 800: "#BC4B49",
110
+ 900: "#9A3E3C",
111
+ 950: "#6D2C2A"
112
+ },
113
+ neutral: {
114
+ DEFAULT: "#BEC7D1",
115
+ 50: "#F9FAFB",
116
+ 100: "#F4F6F7",
117
+ 200: "#E9ECEF",
118
+ 300: "#DEE2E7",
119
+ 400: "#D2D8DE",
120
+ 500: "#BEC7D1",
121
+ 600: "#B5BEC7",
122
+ 700: "#A2AAB2",
123
+ 800: "#8C939A",
124
+ 900: "#73787E",
125
+ 950: "#515559"
126
+ },
127
+ orange: {
128
+ DEFAULT: "#F97316",
129
+ 50: "#FEF5F2",
130
+ 100: "#FEECE7",
131
+ 200: "#FDD7CC",
132
+ 300: "#FCC0AD",
133
+ 400: "#FBA586",
134
+ 500: "#F97316",
135
+ 600: "#EE6E15",
136
+ 700: "#D46213",
137
+ 800: "#B85510",
138
+ 900: "#96450D",
139
+ 950: "#6A3109"
140
+ },
141
+ amber: {
142
+ DEFAULT: "#FBBF24",
143
+ 50: "#FFF9F2",
144
+ 100: "#FEF5E7",
145
+ 200: "#FEEACD",
146
+ 300: "#FDDEAE",
147
+ 400: "#FCD288",
148
+ 500: "#FBBF24",
149
+ 600: "#EFB622",
150
+ 700: "#D6A31F",
151
+ 800: "#B98D1B",
152
+ 900: "#977316",
153
+ 950: "#6B510F"
154
+ },
155
+ indigo: {
156
+ DEFAULT: "#686DF4",
157
+ 50: "#F4F4FE",
158
+ 100: "#EBEBFD",
159
+ 200: "#D5D6FB",
160
+ 300: "#BCBEF9",
161
+ 400: "#A0A2F7",
162
+ 500: "#686DF4",
163
+ 600: "#6368E9",
164
+ 700: "#595DD0",
165
+ 800: "#4D51B4",
166
+ 900: "#3F4293",
167
+ 950: "#2C2F68"
168
+ },
169
+ seafoam: {
170
+ DEFAULT: "#3EC2C9",
171
+ 50: "#F3FAFA",
172
+ 100: "#E8F5F6",
173
+ 200: "#CFEBED",
174
+ 300: "#B2E0E3",
175
+ 400: "#8FD4D9",
176
+ 500: "#3EC2C9",
177
+ 600: "#3BB9C0",
178
+ 700: "#35A6AB",
179
+ 800: "#2E8F95",
180
+ 900: "#257579",
181
+ 950: "#1A5356"
182
+ },
183
+ green: {
184
+ DEFAULT: "#15A46E",
185
+ 50: "#F2F7F4",
186
+ 100: "#E7F1EB",
187
+ 200: "#CCE2D6",
188
+ 300: "#ADD2BE",
189
+ 400: "#86C1A3",
190
+ 500: "#15A46E",
191
+ 600: "#149C69",
192
+ 700: "#128C5E",
193
+ 800: "#107951",
194
+ 900: "#0D6342",
195
+ 950: "#09462F"
196
+ },
197
+ fuchsia: {
198
+ DEFAULT: "#C53DE7",
199
+ 50: "#FAF3FD",
200
+ 100: "#F5E8FB",
201
+ 200: "#ECCFF7",
202
+ 300: "#E1B2F2",
203
+ 400: "#D68FEE",
204
+ 500: "#C53DE7",
205
+ 600: "#BC3ADC",
206
+ 700: "#A834C5",
207
+ 800: "#922DAB",
208
+ 900: "#77258B",
209
+ 950: "#541A63"
210
+ },
211
+ red: {
212
+ DEFAULT: "#EA3529",
213
+ 50: "#FDF2F2",
214
+ 100: "#FBE8E7",
215
+ 200: "#F8CECD",
216
+ 300: "#F4B0AE",
217
+ 400: "#F08C8A",
218
+ 500: "#EA3529",
219
+ 600: "#DF3327",
220
+ 700: "#C82D23",
221
+ 800: "#AD271E",
222
+ 900: "#8D2019",
223
+ 950: "#641711"
224
+ },
225
+ rating: {
226
+ "high": "#15A46E",
227
+ "medium": "#EC5818",
228
+ "low": "#EA3529",
229
+ "high-star": "#86C1A3",
230
+ "medium-star": "#FCD288",
231
+ "low-star": "#F08C8A"
232
+ },
233
+ table: { border: "#e8e9ed" }
234
+ };
235
+ const colors = {
236
+ ...mainColors,
237
+ primary: mainColors.bateau,
238
+ secondary: mainColors.pompelmo
239
+ };
240
+ const customFontFamily = { sans: ["DM Sans", ...[
241
+ "ui-sans-serif",
242
+ "system-ui",
243
+ "sans-serif",
244
+ "\"Apple Color Emoji\"",
245
+ "\"Segoe UI Emoji\"",
246
+ "\"Segoe UI Symbol\"",
247
+ "\"Noto Color Emoji\""
248
+ ]] };
249
+ //#endregion
250
+ //#region src/theme/fontSize.ts
251
+ const fontSize = {
252
+ "2xs": ["0.6875rem", "1rem"],
253
+ "xs": ["0.75rem", "1rem"],
254
+ "sm": ["0.875rem", "1.25rem"],
255
+ "base": ["1rem", "1.5rem"],
256
+ "md": ["1.125rem", "1.5rem"],
257
+ "lg": ["1.25rem", "1.625rem"],
258
+ "display1": ["3.75rem", {
259
+ fontWeight: 700,
260
+ lineHeight: "5rem",
261
+ letterSpacing: "-0.0625rem"
262
+ }],
263
+ "display2": ["3.25rem", {
264
+ fontWeight: 700,
265
+ lineHeight: "4.25rem",
266
+ letterSpacing: "-0.05rem"
267
+ }],
268
+ "display3": ["2.75rem", {
269
+ fontWeight: 700,
270
+ lineHeight: "3.625rem",
271
+ letterSpacing: "-0.0375rem"
272
+ }],
273
+ "h1": ["3rem", {
274
+ fontWeight: 700,
275
+ lineHeight: "3.75rem",
276
+ letterSpacing: "-0.0125rem"
277
+ }],
278
+ "h2": ["2.5rem", {
279
+ fontWeight: 700,
280
+ lineHeight: "3.25rem",
281
+ letterSpacing: "-0.0125rem"
282
+ }],
283
+ "h3": ["2.25rem", {
284
+ fontWeight: 700,
285
+ lineHeight: "3rem",
286
+ letterSpacing: "-0.0125rem"
287
+ }],
288
+ "h4": ["2rem", {
289
+ fontWeight: 700,
290
+ lineHeight: "2.625rem",
291
+ letterSpacing: "-0.0125rem"
292
+ }],
293
+ "h5": ["1.5rem", {
294
+ fontWeight: 700,
295
+ lineHeight: "2rem",
296
+ letterSpacing: "-0.0125rem"
297
+ }],
298
+ "h6": ["1.25rem", {
299
+ fontWeight: 700,
300
+ lineHeight: "1.625rem",
301
+ letterSpacing: "-0.0125rem"
302
+ }]
303
+ };
304
+ //#endregion
305
+ //#region src/theme/screen.ts
306
+ const screensNumber = {
307
+ "xs": 480,
308
+ "sm": 640,
309
+ "md": 768,
310
+ "lg": 1024,
311
+ "xl": 1280,
312
+ "2xl": 1536,
313
+ "tablet": 640,
314
+ "tablet-lg": 960,
315
+ "laptop": 1024,
316
+ "desktop": 1280
317
+ };
318
+ const screens = {
319
+ "xs": `${screensNumber.xs}px`,
320
+ "sm": `${screensNumber.sm}px`,
321
+ "md": `${screensNumber.md}px`,
322
+ "lg": `${screensNumber.lg}px`,
323
+ "xl": `${screensNumber.xl}px`,
324
+ "2xl": `${screensNumber["2xl"]}px`,
325
+ "tablet": `${screensNumber.tablet}px`,
326
+ "tablet-lg": `${screensNumber["tablet-lg"]}px`,
327
+ "laptop": `${screensNumber.laptop}px`,
328
+ "desktop": `${screensNumber.desktop}px`
329
+ };
330
+ //#endregion
331
+ //#region src/theme/shadows.ts
332
+ const boxShadow = {
333
+ "elevation-0": "0 0 0 0 rgba(0, 0, 0, 0.10)",
334
+ "elevation-1": "0 1px 2px 0 rgba(0, 0, 0, 0.10)",
335
+ "elevation-2": "0 4px 8px 0 rgba(0, 0, 0, 0.10)",
336
+ "elevation-3": "0 6px 12px 0 rgba(0, 0, 0, 0.10)",
337
+ "elevation-4": "0 8px 16px 0 rgba(0, 0, 0, 0.10)",
338
+ "elevation-5": "0 12px 24px 0 rgba(0, 0, 0, 0.10)"
339
+ };
340
+ //#endregion
341
+ //#region src/theme/index.ts
342
+ function buildTheme(object, option = {}) {
343
+ const { enabled = true, prefix = "" } = option;
344
+ if (!enabled) return null;
345
+ if (prefix) return Object.fromEntries(Object.entries(object).map(([k, v]) => [`${prefix}${k}`, v]));
346
+ return object;
347
+ }
348
+ function factory(options = {}) {
349
+ const theme = {};
350
+ if (options.colors?.enabled !== false) {
351
+ const _colors = buildTheme(colors, options.colors);
352
+ if (_colors != null) theme.colors = _colors;
353
+ }
354
+ if (options.boxShadow?.enabled !== false) {
355
+ const _boxShadow = buildTheme(boxShadow, options.boxShadow);
356
+ if (_boxShadow != null) theme.boxShadow = _boxShadow;
357
+ }
358
+ if (options.fontSize?.enabled !== false) {
359
+ const _fontSize = buildTheme(fontSize, options.fontSize);
360
+ if (_fontSize != null) theme.fontSize = _fontSize;
361
+ }
362
+ if (options.fontFamily?.enabled !== false) {
363
+ const _fontFamily = buildTheme(customFontFamily, options.fontFamily);
364
+ if (_fontFamily != null) theme.fontFamily = _fontFamily;
365
+ }
366
+ if (options.animation?.enabled !== false) {
367
+ const _animation = buildTheme(animation, options.animation);
368
+ if (_animation != null) theme.animation = _animation;
369
+ }
370
+ if (options.keyframes?.enabled !== false) {
371
+ const _keyframes = buildTheme(keyframes, options.keyframes);
372
+ if (_keyframes != null) theme.keyframes = _keyframes;
373
+ }
374
+ if (options.screens?.enabled !== false) {
375
+ const _screens = buildTheme(screens, options.screens);
376
+ if (_screens != null) theme.screens = _screens;
377
+ }
378
+ return theme;
379
+ }
380
+ const defaultTheme = {
381
+ colors,
382
+ boxShadow,
383
+ fontSize,
384
+ fontFamily: customFontFamily,
385
+ animation,
386
+ keyframes,
387
+ screens
388
+ };
389
+ //#endregion
390
+ //#region src/constant/index.ts
391
+ const colorsNames = [
392
+ "primary",
393
+ "bateau",
394
+ "secondary",
395
+ "pompelmo",
396
+ "green",
397
+ "fuchsia",
398
+ "indigo",
399
+ "neutral",
400
+ "orange",
401
+ "red",
402
+ "amber",
403
+ "seafoam"
404
+ ];
405
+ //#endregion
406
+ //#region src/types/color.ts
407
+ const ratingColorVariations = [
408
+ "low",
409
+ "high",
410
+ "medium",
411
+ "low-star",
412
+ "high-star",
413
+ "medium-star"
414
+ ];
415
+ //#endregion
416
+ //#region src/types/factory.ts
417
+ const configuredThemes = [
418
+ "colors",
419
+ "boxShadow",
420
+ "fontSize",
421
+ "fontFamily",
422
+ "animation",
423
+ "keyframes",
424
+ "screens"
425
+ ];
426
+ //#endregion
427
+ //#region src/types/fontSize.ts
428
+ function isDetailFont(value) {
429
+ return Array.isArray(value) && typeof value[1] === "object";
430
+ }
431
+ //#endregion
432
+ //#region src/types/screen.ts
433
+ const screenSizes = [
434
+ "xs",
435
+ "sm",
436
+ "md",
437
+ "lg",
438
+ "xl",
439
+ "2xl",
440
+ "tablet",
441
+ "tablet-lg",
442
+ "laptop",
443
+ "desktop"
444
+ ];
445
+ //#endregion
446
+ //#region src/types/shadow.ts
447
+ const shadowVariations = [
448
+ "elevation-0",
449
+ "elevation-1",
450
+ "elevation-2",
451
+ "elevation-3",
452
+ "elevation-4",
453
+ "elevation-5"
454
+ ];
455
+ //#endregion
456
+ //#region src/index.ts
457
+ function buildPreset(extend = true, buildOptions = {}) {
458
+ if (extend === false) return {
459
+ theme: factory(buildOptions),
460
+ plugins
461
+ };
462
+ return {
463
+ theme: { extend: factory(buildOptions) },
464
+ plugins
465
+ };
466
+ }
467
+ //#endregion
468
+ export { animation, boxShadow, buildPreset, buildTheme, colors, colorsNames, configuredThemes, defaultTheme, factory, customFontFamily as fontFamily, fontSize, isDetailFont, keyframes, ratingColorVariations, screenSizes, screens, screensNumber, shadowVariations };
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@removify/tailwind-preset",
3
3
  "type": "module",
4
- "version": "1.0.7",
5
- "packageManager": "pnpm@10.13.1",
4
+ "version": "1.0.9",
6
5
  "description": "Tailwind CSS preset for Removify",
7
6
  "keywords": [
8
7
  "tailwind"
@@ -10,7 +9,7 @@
10
9
  "sideEffects": false,
11
10
  "exports": {
12
11
  ".": {
13
- "import": "./dist/index.js",
12
+ "import": "./dist/index.mjs",
14
13
  "require": "./dist/index.cjs"
15
14
  },
16
15
  "./index.css": {
@@ -32,57 +31,51 @@
32
31
  "engines": {
33
32
  "node": ">=22"
34
33
  },
35
- "scripts": {
36
- "start": "pnpm exec tsx ./src/index.ts",
37
- "build": "rimraf dist && tsup src/index.ts --format esm,cjs --clean --dts && pnpm generate:tailwind-v4",
38
- "generate:tailwind-v4": "tsx ./scripts/generate-tailwind-v4.ts",
39
- "update-animation:v4": "curl https://raw.githubusercontent.com/Wombosvideo/tw-animate-css/refs/heads/main/src/tw-animate.css > ./tailwind-dist/tailwindcss-animate.css",
40
- "typecheck": "tsc --noEmit",
41
- "prepack": "pnpm build",
42
- "watch": "tsup --format esm,cjs --watch",
43
- "dev": "tsx watch ./src/index.ts",
44
- "dev:playground": "pnpm --filter playground dev",
45
- "test": "vitest",
46
- "lint": "eslint .",
47
- "lint:fix": "eslint --fix .",
48
- "husky:install": "husky",
49
- "release": "bumpp && pnpm publish --access=public",
50
- "tailwind-config-viewer": "tailwind-config-viewer -o -c tailwind.config.js",
51
- "tailwind-config-viewer:build": "pnpm build && tailwind-config-viewer export tailwind-dist -c tailwind.config.js"
52
- },
53
34
  "peerDependencies": {
54
35
  "tailwindcss": "^3.0.0 || ^4.0.0"
55
36
  },
56
37
  "dependencies": {
57
- "string-ts": "^2.2.1",
38
+ "string-ts": "^2.3.1",
58
39
  "tailwindcss-animate": "^1.0.7"
59
40
  },
60
41
  "devDependencies": {
61
- "@commitlint/cli": "^19.8.1",
62
- "@commitlint/config-conventional": "^19.8.1",
63
- "@removify/eslint-config": "^3.1.2",
64
- "@removify/tailwind-preset": "workspace:*",
65
- "@types/node": "^22.16.5",
66
- "bumpp": "^10.2.0",
67
- "eslint": "^9.31.0",
42
+ "@commitlint/cli": "^20.5.0",
43
+ "@commitlint/config-conventional": "^20.5.0",
44
+ "@removify/eslint-config": "^5.1.0",
45
+ "@types/node": "^25.5.0",
46
+ "bumpp": "^11.0.1",
47
+ "eslint": "^10.0.3",
68
48
  "husky": "^9.1.7",
69
- "lint-staged": "^16.1.2",
70
- "rimraf": "^6.0.1",
49
+ "lint-staged": "^16.4.0",
50
+ "rimraf": "^6.1.3",
71
51
  "tailwind-config-viewer": "^2.0.4",
72
- "tailwindcss": "^4.0.0",
73
- "tsup": "^8.5.0",
74
- "tsx": "^4.20.3",
75
- "typescript": "^5.8.3",
76
- "vitest": "^3.2.4"
77
- },
78
- "pnpm": {
79
- "overrides": {
80
- "koa": ">=3.0.1"
81
- }
52
+ "tailwindcss": "^4.2.1",
53
+ "tsdown": "^0.21.3",
54
+ "tsx": "^4.21.0",
55
+ "typescript": "^5.9.3",
56
+ "vitest": "^4.1.0",
57
+ "@removify/tailwind-preset": "1.0.9"
82
58
  },
83
59
  "lint-staged": {
84
60
  "**/*.{js,ts,vue,html}": [
85
61
  "pnpm lint:fix"
86
62
  ]
63
+ },
64
+ "scripts": {
65
+ "start": "pnpm exec tsx ./src/index.ts",
66
+ "build": "rimraf dist && tsdown src/index.ts --format esm,cjs --clean --dts && pnpm generate:tailwind-v4",
67
+ "generate:tailwind-v4": "tsx ./scripts/generate-tailwind-v4.ts",
68
+ "update-animation:v4": "curl https://raw.githubusercontent.com/Wombosvideo/tw-animate-css/refs/heads/main/src/tw-animate.css > ./tailwind-dist/tailwindcss-animate.css",
69
+ "typecheck": "tsc --noEmit",
70
+ "watch": "tsdown --format esm,cjs --watch",
71
+ "dev": "tsx watch ./src/index.ts",
72
+ "dev:playground": "pnpm --filter playground dev",
73
+ "test": "vitest",
74
+ "lint": "eslint .",
75
+ "lint:fix": "eslint --fix .",
76
+ "husky:install": "husky",
77
+ "release": "bumpp && pnpm publish --access=public",
78
+ "tailwind-config-viewer": "tailwind-config-viewer -o -c tailwind.config.js",
79
+ "tailwind-config-viewer:build": "pnpm build && tailwind-config-viewer export tailwind-dist -c tailwind.config.js"
87
80
  }
88
- }
81
+ }