@removify/tailwind-preset 1.0.7 → 1.0.8

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.js DELETED
@@ -1,556 +0,0 @@
1
- // src/plugins/index.ts
2
- import animation from "tailwindcss-animate";
3
- var plugins = [animation];
4
-
5
- // src/theme/animation.ts
6
- var 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
- // V2 aka reka animation
12
- "reka-accordion-down": "reka-accordion-down 0.1s ease-out",
13
- "reka-accordion-up": "reka-accordion-up 0.1s ease-out",
14
- "reka-collapsible-down": "reka-collapsible-down 0.1s ease-in-out",
15
- "reka-collapsible-up": "reka-collapsible-up 0.1s ease-in-out",
16
- // V4
17
- "accordion-down": "accordion-down 0.2s ease-out",
18
- "accordion-up": "accordion-up 0.2s ease-out",
19
- "collapsible-down": "collapsible-down 0.2s ease-in-out",
20
- "collapsible-up": "collapsible-up 0.2s ease-in-out"
21
- };
22
- var uiKeyframes = {
23
- "radix-accordion-down": {
24
- from: { height: "0" },
25
- to: { height: "var(--radix-accordion-content-height)" }
26
- },
27
- "radix-accordion-up": {
28
- from: { height: "var(--radix-accordion-content-height)" },
29
- to: { height: "0" }
30
- },
31
- "radix-collapsible-down": {
32
- from: { height: "0" },
33
- to: { height: "var(--radix-collapsible-content-height)" }
34
- },
35
- "radix-collapsible-up": {
36
- from: { height: "var(--radix-collapsible-content-height)" },
37
- to: { height: "0" }
38
- },
39
- // V2 aka reka animation
40
- "reka-accordion-down": {
41
- from: { height: "0" },
42
- to: { height: "var(--reka-accordion-content-height)" }
43
- },
44
- "reka-accordion-up": {
45
- from: { height: "var(--reka-accordion-content-height)" },
46
- to: { height: "0" }
47
- },
48
- "reka-collapsible-down": {
49
- from: { height: "0" },
50
- to: { height: "var(--reka-collapsible-content-height)" }
51
- },
52
- "reka-collapsible-up": {
53
- from: { height: "var(--reka-collapsible-content-height)" },
54
- to: { height: "0" }
55
- },
56
- "accordion-down": {
57
- from: { height: "0" },
58
- to: { height: "var(--radix-accordion-content-height)" }
59
- },
60
- "accordion-up": {
61
- from: { height: "var(--radix-accordion-content-height)" },
62
- to: { height: "0" }
63
- },
64
- "collapsible-down": {
65
- from: { height: "0" },
66
- to: { height: "var(--radix-collapsible-content-height)" }
67
- },
68
- "collapsible-up": {
69
- from: { height: "var(--radix-collapsible-content-height)" },
70
- to: { height: "0" }
71
- }
72
- };
73
- var animation2 = {
74
- ...uiAnimation
75
- };
76
- var keyframes = {
77
- ...uiKeyframes
78
- };
79
-
80
- // src/theme/colors.ts
81
- var mainColors = {
82
- inherit: "inherit",
83
- current: "currentColor",
84
- transparent: "transparent",
85
- danger: "#EA3529",
86
- warning: "#F97316",
87
- success: "#15A46E",
88
- info: "#3EC2C9",
89
- special: "#686DF4",
90
- black: "#000000",
91
- white: "#FFFFFF",
92
- bateau: {
93
- DEFAULT: "#1C749F",
94
- 50: "#F2F5F7",
95
- 100: "#E7ECF0",
96
- 200: "#CCD7E1",
97
- 300: "#ADC0D0",
98
- 400: "#6390B0",
99
- 500: "#1C749F",
100
- 600: "#1B6F98",
101
- 700: "#186388",
102
- 800: "#155675",
103
- 900: "#114660",
104
- 950: "#0C3144"
105
- },
106
- pompelmo: {
107
- DEFAULT: "#FF6663",
108
- 50: "#FFF4F4",
109
- 100: "#FFEBEA",
110
- 200: "#FFD4D4",
111
- 300: "#FFBCBB",
112
- 400: "#FF9F9E",
113
- 500: "#FF6663",
114
- 600: "#F3615E",
115
- 700: "#DA5754",
116
- 800: "#BC4B49",
117
- 900: "#9A3E3C",
118
- 950: "#6D2C2A"
119
- },
120
- neutral: {
121
- DEFAULT: "#BEC7D1",
122
- 50: "#F9FAFB",
123
- 100: "#F4F6F7",
124
- 200: "#E9ECEF",
125
- 300: "#DEE2E7",
126
- 400: "#D2D8DE",
127
- 500: "#BEC7D1",
128
- 600: "#B5BEC7",
129
- 700: "#A2AAB2",
130
- 800: "#8C939A",
131
- 900: "#73787E",
132
- 950: "#515559"
133
- },
134
- orange: {
135
- DEFAULT: "#F97316",
136
- 50: "#FEF5F2",
137
- 100: "#FEECE7",
138
- 200: "#FDD7CC",
139
- 300: "#FCC0AD",
140
- 400: "#FBA586",
141
- 500: "#F97316",
142
- 600: "#EE6E15",
143
- 700: "#D46213",
144
- 800: "#B85510",
145
- 900: "#96450D",
146
- 950: "#6A3109"
147
- },
148
- amber: {
149
- DEFAULT: "#FBBF24",
150
- 50: "#FFF9F2",
151
- 100: "#FEF5E7",
152
- 200: "#FEEACD",
153
- 300: "#FDDEAE",
154
- 400: "#FCD288",
155
- 500: "#FBBF24",
156
- 600: "#EFB622",
157
- 700: "#D6A31F",
158
- 800: "#B98D1B",
159
- 900: "#977316",
160
- 950: "#6B510F"
161
- },
162
- indigo: {
163
- DEFAULT: "#686DF4",
164
- 50: "#F4F4FE",
165
- 100: "#EBEBFD",
166
- 200: "#D5D6FB",
167
- 300: "#BCBEF9",
168
- 400: "#A0A2F7",
169
- 500: "#686DF4",
170
- 600: "#6368E9",
171
- 700: "#595DD0",
172
- 800: "#4D51B4",
173
- 900: "#3F4293",
174
- 950: "#2C2F68"
175
- },
176
- seafoam: {
177
- DEFAULT: "#3EC2C9",
178
- 50: "#F3FAFA",
179
- 100: "#E8F5F6",
180
- 200: "#CFEBED",
181
- 300: "#B2E0E3",
182
- 400: "#8FD4D9",
183
- 500: "#3EC2C9",
184
- 600: "#3BB9C0",
185
- 700: "#35A6AB",
186
- 800: "#2E8F95",
187
- 900: "#257579",
188
- 950: "#1A5356"
189
- },
190
- green: {
191
- DEFAULT: "#15A46E",
192
- 50: "#F2F7F4",
193
- 100: "#E7F1EB",
194
- 200: "#CCE2D6",
195
- 300: "#ADD2BE",
196
- 400: "#86C1A3",
197
- 500: "#15A46E",
198
- 600: "#149C69",
199
- 700: "#128C5E",
200
- 800: "#107951",
201
- 900: "#0D6342",
202
- 950: "#09462F"
203
- },
204
- fuchsia: {
205
- DEFAULT: "#C53DE7",
206
- 50: "#FAF3FD",
207
- 100: "#F5E8FB",
208
- 200: "#ECCFF7",
209
- 300: "#E1B2F2",
210
- 400: "#D68FEE",
211
- 500: "#C53DE7",
212
- 600: "#BC3ADC",
213
- 700: "#A834C5",
214
- 800: "#922DAB",
215
- 900: "#77258B",
216
- 950: "#541A63"
217
- },
218
- red: {
219
- DEFAULT: "#EA3529",
220
- 50: "#FDF2F2",
221
- 100: "#FBE8E7",
222
- 200: "#F8CECD",
223
- 300: "#F4B0AE",
224
- 400: "#F08C8A",
225
- 500: "#EA3529",
226
- 600: "#DF3327",
227
- 700: "#C82D23",
228
- 800: "#AD271E",
229
- 900: "#8D2019",
230
- 950: "#641711"
231
- },
232
- rating: {
233
- "high": "#15A46E",
234
- "medium": "#EC5818",
235
- "low": "#EA3529",
236
- "high-star": "#86C1A3",
237
- "medium-star": "#FCD288",
238
- "low-star": "#F08C8A"
239
- },
240
- table: {
241
- border: "#e8e9ed"
242
- }
243
- };
244
- var colors = {
245
- ...mainColors,
246
- primary: mainColors.bateau,
247
- secondary: mainColors.pompelmo
248
- };
249
-
250
- // src/theme/fontFamily.ts
251
- var fontFamilySans = [
252
- "ui-sans-serif",
253
- "system-ui",
254
- "sans-serif",
255
- '"Apple Color Emoji"',
256
- '"Segoe UI Emoji"',
257
- '"Segoe UI Symbol"',
258
- '"Noto Color Emoji"'
259
- ];
260
- var customFontFamily = {
261
- sans: ["DM Sans", ...fontFamilySans]
262
- };
263
-
264
- // src/util/font.ts
265
- import { kebabKeys } from "string-ts";
266
-
267
- // src/types/fontSize.ts
268
- function isDetailFont(value) {
269
- return Array.isArray(value) && typeof value[1] === "object";
270
- }
271
-
272
- // src/util/font.ts
273
- var entries = Object.entries;
274
- function fontConfigKeysKebabCase(fontConfig) {
275
- const result = {};
276
- for (const [key, value] of entries(fontConfig)) {
277
- if (value) {
278
- if (isDetailFont(value)) {
279
- const [size, detail] = value;
280
- const kebabDetail = kebabKeys(detail);
281
- result[key] = [size, kebabDetail];
282
- } else {
283
- result[key] = value;
284
- }
285
- }
286
- }
287
- return result;
288
- }
289
-
290
- // src/theme/fontSize.ts
291
- var fontSize = {
292
- "2xs": ["0.6875rem", "1rem"],
293
- "xs": ["0.75rem", "1rem"],
294
- "sm": ["0.875rem", "1.25rem"],
295
- "base": ["1rem", "1.5rem"],
296
- "md": ["1.125rem", "1.5rem"],
297
- "lg": ["1.25rem", "1.625rem"],
298
- "display1": ["3.75rem", {
299
- fontWeight: 700,
300
- lineHeight: "5rem",
301
- letterSpacing: "-0.0625rem"
302
- }],
303
- "display2": ["3.25rem", {
304
- fontWeight: 700,
305
- lineHeight: "4.25rem",
306
- letterSpacing: "-0.05rem"
307
- }],
308
- "display3": ["2.75rem", {
309
- fontWeight: 700,
310
- lineHeight: "3.625rem",
311
- letterSpacing: "-0.0375rem"
312
- }],
313
- "h1": ["3rem", {
314
- fontWeight: 700,
315
- lineHeight: "3.75rem",
316
- letterSpacing: "-0.0125rem"
317
- }],
318
- "h2": ["2.5rem", {
319
- fontWeight: 700,
320
- lineHeight: "3.25rem",
321
- letterSpacing: "-0.0125rem"
322
- }],
323
- "h3": ["2.25rem", {
324
- fontWeight: 700,
325
- lineHeight: "3rem",
326
- letterSpacing: "-0.0125rem"
327
- }],
328
- "h4": ["2rem", {
329
- fontWeight: 700,
330
- lineHeight: "2.625rem",
331
- letterSpacing: "-0.0125rem"
332
- }],
333
- "h5": ["1.5rem", {
334
- fontWeight: 700,
335
- lineHeight: "2rem",
336
- letterSpacing: "-0.0125rem"
337
- }],
338
- "h6": ["1.25rem", {
339
- fontWeight: 700,
340
- lineHeight: "1.625rem",
341
- letterSpacing: "-0.0125rem"
342
- }]
343
- };
344
- var unocssFontSizes = fontConfigKeysKebabCase(fontSize);
345
-
346
- // src/theme/screen.ts
347
- var screensNumber = {
348
- "xs": 480,
349
- "sm": 640,
350
- "md": 768,
351
- "lg": 1024,
352
- "xl": 1280,
353
- "2xl": 1536,
354
- "tablet": 640,
355
- "tablet-lg": 960,
356
- "laptop": 1024,
357
- "desktop": 1280
358
- };
359
- var screens = {
360
- "xs": `${screensNumber.xs}px`,
361
- "sm": `${screensNumber.sm}px`,
362
- "md": `${screensNumber.md}px`,
363
- "lg": `${screensNumber.lg}px`,
364
- "xl": `${screensNumber.xl}px`,
365
- "2xl": `${screensNumber["2xl"]}px`,
366
- "tablet": `${screensNumber.tablet}px`,
367
- "tablet-lg": `${screensNumber["tablet-lg"]}px`,
368
- "laptop": `${screensNumber.laptop}px`,
369
- "desktop": `${screensNumber.desktop}px`
370
- };
371
-
372
- // src/theme/shadows.ts
373
- var boxShadow = {
374
- "elevation-0": "0 0 0 0 rgba(0, 0, 0, 0.10)",
375
- "elevation-1": "0 1px 2px 0 rgba(0, 0, 0, 0.10)",
376
- "elevation-2": "0 4px 8px 0 rgba(0, 0, 0, 0.10)",
377
- "elevation-3": "0 6px 12px 0 rgba(0, 0, 0, 0.10)",
378
- "elevation-4": "0 8px 16px 0 rgba(0, 0, 0, 0.10)",
379
- "elevation-5": "0 12px 24px 0 rgba(0, 0, 0, 0.10)"
380
- };
381
-
382
- // src/theme/index.ts
383
- function buildTheme(object, option = {}) {
384
- const {
385
- enabled = true,
386
- prefix = ""
387
- } = option;
388
- if (!enabled) {
389
- return null;
390
- }
391
- if (prefix) {
392
- return Object.fromEntries(Object.entries(object).map(([k, v]) => [
393
- `${prefix}${k}`,
394
- v
395
- ]));
396
- }
397
- return object;
398
- }
399
- function factory(options = {}) {
400
- const theme = {};
401
- if (options.colors?.enabled !== false) {
402
- const _colors = buildTheme(colors, options.colors);
403
- if (_colors != null) {
404
- theme.colors = _colors;
405
- }
406
- }
407
- if (options.boxShadow?.enabled !== false) {
408
- const _boxShadow = buildTheme(boxShadow, options.boxShadow);
409
- if (_boxShadow != null) {
410
- theme.boxShadow = _boxShadow;
411
- }
412
- }
413
- if (options.fontSize?.enabled !== false) {
414
- const _fontSize = buildTheme(fontSize, options.fontSize);
415
- if (_fontSize != null) {
416
- theme.fontSize = _fontSize;
417
- }
418
- }
419
- if (options.fontFamily?.enabled !== false) {
420
- const _fontFamily = buildTheme(customFontFamily, options.fontFamily);
421
- if (_fontFamily != null) {
422
- theme.fontFamily = _fontFamily;
423
- }
424
- }
425
- if (options.animation?.enabled !== false) {
426
- const _animation = buildTheme(animation2, options.animation);
427
- if (_animation != null) {
428
- theme.animation = _animation;
429
- }
430
- }
431
- if (options.keyframes?.enabled !== false) {
432
- const _keyframes = buildTheme(keyframes, options.keyframes);
433
- if (_keyframes != null) {
434
- theme.keyframes = _keyframes;
435
- }
436
- }
437
- if (options.screens?.enabled !== false) {
438
- const _screens = buildTheme(screens, options.screens);
439
- if (_screens != null) {
440
- theme.screens = _screens;
441
- }
442
- }
443
- return theme;
444
- }
445
- var defaultTheme = {
446
- colors,
447
- boxShadow,
448
- fontSize,
449
- fontFamily: customFontFamily,
450
- animation: animation2,
451
- keyframes,
452
- screens
453
- };
454
- var unocssTheme = {
455
- colors,
456
- boxShadow,
457
- fontSize: unocssFontSizes
458
- };
459
-
460
- // src/constant/index.ts
461
- var colorsNames = [
462
- "primary",
463
- "bateau",
464
- "secondary",
465
- "pompelmo",
466
- "green",
467
- "fuchsia",
468
- "indigo",
469
- "neutral",
470
- "orange",
471
- "red",
472
- "amber",
473
- "seafoam"
474
- ];
475
-
476
- // src/types/color.ts
477
- var ratingColorVariations = [
478
- "low",
479
- "high",
480
- "medium",
481
- "low-star",
482
- "high-star",
483
- "medium-star"
484
- ];
485
-
486
- // src/types/factory.ts
487
- var configuredThemes = [
488
- "colors",
489
- "boxShadow",
490
- "fontSize",
491
- "fontFamily",
492
- "animation",
493
- "keyframes",
494
- "screens"
495
- ];
496
-
497
- // src/types/screen.ts
498
- var screenSizes = [
499
- "xs",
500
- "sm",
501
- "md",
502
- "lg",
503
- "xl",
504
- "2xl",
505
- "tablet",
506
- "tablet-lg",
507
- "laptop",
508
- "desktop"
509
- ];
510
-
511
- // src/types/shadow.ts
512
- var shadowVariations = [
513
- "elevation-0",
514
- "elevation-1",
515
- "elevation-2",
516
- "elevation-3",
517
- "elevation-4",
518
- "elevation-5"
519
- ];
520
-
521
- // src/index.ts
522
- function buildPreset(extend = true, buildOptions = {}) {
523
- if (extend === false) {
524
- return {
525
- theme: factory(buildOptions),
526
- plugins
527
- };
528
- }
529
- return {
530
- theme: {
531
- extend: factory(buildOptions)
532
- },
533
- plugins
534
- };
535
- }
536
- export {
537
- animation2 as animation,
538
- boxShadow,
539
- buildPreset,
540
- buildTheme,
541
- colors,
542
- colorsNames,
543
- configuredThemes,
544
- defaultTheme,
545
- factory,
546
- customFontFamily as fontFamily,
547
- fontSize,
548
- isDetailFont,
549
- keyframes,
550
- ratingColorVariations,
551
- screenSizes,
552
- screens,
553
- screensNumber,
554
- shadowVariations,
555
- unocssTheme
556
- };