@removify/tailwind-preset 0.1.9 → 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.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,178 @@
1
1
  import * as tailwindcss_types_config from 'tailwindcss/types/config';
2
2
  import { Config } from 'tailwindcss';
3
3
 
4
+ declare const colorsNames: readonly ["primary", "bateau", "secondary", "pompelmo", "green", "fuchsia", "indigo", "neutral", "orange", "red", "amber", "seafoam"];
5
+
6
+ type ColorsNames = typeof colorsNames[number];
7
+ type ColorsVariations = 'DEFAULT' | 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950;
8
+ interface MainColors {
9
+ black: string;
10
+ white: string;
11
+ inherit: 'inherit';
12
+ current: 'currentColor';
13
+ transparent: 'transparent';
14
+ }
15
+ interface DefaultColors {
16
+ danger: string;
17
+ warning: string;
18
+ success: string;
19
+ info: string;
20
+ special: string;
21
+ }
22
+ type Colors = DefaultColors & MainColors & Record<ColorsNames, {
23
+ [K in ColorsVariations]: string;
24
+ }>;
25
+ type ColorString = `${ColorsNames}-${ColorsVariations}` | keyof DefaultColors | keyof MainColors;
26
+
27
+ interface BuildThemeOptions {
28
+ colors?: boolean;
29
+ boxShadow?: boolean;
30
+ fontSize?: boolean;
31
+ fontFamily?: boolean;
32
+ animation?: boolean;
33
+ keyframes?: boolean;
34
+ screens?: boolean;
35
+ }
36
+
37
+ /**
38
+ * Converts the given string from camel-case to kebab-case.
39
+ * @template T The string to convert the case.
40
+ * @see https://gist.github.com/albertms10/09f14ef7ebdc3ce0e95683c728616253
41
+ * @example
42
+ * type Kebab = CamelToKebab<'exampleVarName'>;
43
+ * // 'example-var-name'
44
+ */
45
+ type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${CamelToKebab<U>}` : `${Uncapitalize<T>}-${CamelToKebab<U>}` : '';
46
+ type CamelToKebabKeys<T> = {
47
+ [K in keyof T as K extends string ? CamelToKebab<K> : K]: T[K];
48
+ };
49
+
50
+ /**
51
+ * tailwindcss font-size configuration
52
+ * @see https://tailwindcss.com/docs/font-size
53
+ *
54
+ * @note For unocss, the keys are kebab-case
55
+ * @see https://github.com/unocss/unocss/issues/3663#issuecomment-2024909371
56
+ */
57
+
58
+ interface FontSizeDetail {
59
+ lineHeight?: string;
60
+ letterSpacing?: string;
61
+ fontWeight?: number;
62
+ }
63
+ type FontValue = `${number}px` | `${number}rem`;
64
+ type FontAndLineHeight = [FontValue, FontValue];
65
+ type DetailFont = [
66
+ FontValue,
67
+ FontSizeDetail
68
+ ];
69
+ type UnocssDetailFont = [FontValue, CamelToKebabKeys<FontSizeDetail>];
70
+ type FontSize = FontAndLineHeight | FontValue | DetailFont;
71
+ type UnocssFontSize = FontValue | FontAndLineHeight | UnocssDetailFont;
72
+ type SizeKeys = `${number}xs` | 'xs' | 'sm' | 'base' | 'md' | 'lg' | 'xl' | `${number}xl`;
73
+ type HeadingKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
74
+ type DisplayKeys = 'display1' | 'display2' | 'display3' | 'display4';
75
+ type FontSizeKeys = SizeKeys | HeadingKeys | DisplayKeys;
76
+ declare function isDetailFont(value: FontSize): value is DetailFont;
77
+ type FontSizes = {
78
+ [K in FontSizeKeys]?: FontSize;
79
+ };
80
+ type UnocssFontSizes = {
81
+ [K in FontSizeKeys]?: UnocssFontSize;
82
+ };
83
+
84
+ declare const screenSizes: readonly ["sm", "md", "lg", "xl", "2xl", "tablet", "laptop", "desktop"];
85
+ type Screens = Record<typeof screenSizes[number], `${number}px`>;
86
+ type ExtractNumber<T extends string> = T extends `${infer N extends number}px` ? N : never;
87
+ type ScreensNumber = {
88
+ [K in keyof Screens]: ExtractNumber<Screens[K]>;
89
+ };
90
+
91
+ type BorderSize = 0 | `${number}px`;
92
+ type RgbValue = number;
93
+ type Shadow = `${BorderSize} ${BorderSize} ${BorderSize} ${BorderSize} rgba(${RgbValue}, ${RgbValue}, ${RgbValue}, ${RgbValue})`;
94
+ type ShadowSize = 0 | 1 | 2 | 3 | 4 | 5;
95
+ type Shadows = {
96
+ [K in ShadowSize as `elevation-${K}`]?: Shadow;
97
+ };
98
+
99
+ declare const animation: {
100
+ 'radix-accordion-down': string;
101
+ 'radix-accordion-up': string;
102
+ 'radix-collapsible-down': string;
103
+ 'radix-collapsible-up': string;
104
+ 'reka-accordion-down': string;
105
+ 'reka-accordion-up': string;
106
+ 'reka-collapsible-down': string;
107
+ 'reka-collapsible-up': string;
108
+ };
109
+ declare const keyframes: {
110
+ 'radix-accordion-down': {
111
+ from: {
112
+ height: string;
113
+ };
114
+ to: {
115
+ height: string;
116
+ };
117
+ };
118
+ 'radix-accordion-up': {
119
+ from: {
120
+ height: string;
121
+ };
122
+ to: {
123
+ height: string;
124
+ };
125
+ };
126
+ 'radix-collapsible-down': {
127
+ from: {
128
+ height: string;
129
+ };
130
+ to: {
131
+ height: string;
132
+ };
133
+ };
134
+ 'radix-collapsible-up': {
135
+ from: {
136
+ height: string;
137
+ };
138
+ to: {
139
+ height: string;
140
+ };
141
+ };
142
+ 'reka-accordion-down': {
143
+ from: {
144
+ height: string;
145
+ };
146
+ to: {
147
+ height: string;
148
+ };
149
+ };
150
+ 'reka-accordion-up': {
151
+ from: {
152
+ height: string;
153
+ };
154
+ to: {
155
+ height: string;
156
+ };
157
+ };
158
+ 'reka-collapsible-down': {
159
+ from: {
160
+ height: string;
161
+ };
162
+ to: {
163
+ height: string;
164
+ };
165
+ };
166
+ 'reka-collapsible-up': {
167
+ from: {
168
+ height: string;
169
+ };
170
+ to: {
171
+ height: string;
172
+ };
173
+ };
174
+ };
175
+
4
176
  declare const colors: {
5
177
  primary: {
6
178
  DEFAULT: string;
@@ -182,58 +354,16 @@ declare const colors: {
182
354
  };
183
355
  };
184
356
 
185
- /**
186
- * Converts the given string from camel-case to kebab-case.
187
- * @template T The string to convert the case.
188
- * @see https://gist.github.com/albertms10/09f14ef7ebdc3ce0e95683c728616253
189
- * @example
190
- * type Kebab = CamelToKebab<'exampleVarName'>;
191
- * // 'example-var-name'
192
- */
193
- type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${CamelToKebab<U>}` : `${Uncapitalize<T>}-${CamelToKebab<U>}` : '';
194
- type CamelToKebabKeys<T> = {
195
- [K in keyof T as K extends string ? CamelToKebab<K> : K]: T[K];
196
- };
197
-
198
- /**
199
- * tailwindcss font-size configuration
200
- * @see https://tailwindcss.com/docs/font-size
201
- *
202
- * @note For unocss, the keys are kebab-case
203
- * @see https://github.com/unocss/unocss/issues/3663#issuecomment-2024909371
204
- */
205
-
206
- interface FontSizeDetail {
207
- lineHeight?: string;
208
- letterSpacing?: string;
209
- fontWeight?: number;
210
- }
211
- type FontValue = `${number}px` | `${number}rem`;
212
- type FontAndLineHeight = [FontValue, FontValue];
213
- type DetailFont = [
214
- FontValue,
215
- FontSizeDetail
216
- ];
217
- type UnocssDetailFont = [FontValue, CamelToKebabKeys<FontSizeDetail>];
218
- type FontSize = FontAndLineHeight | FontValue | DetailFont;
219
- type UnocssFontSize = FontValue | FontAndLineHeight | UnocssDetailFont;
220
- type SizeKeys = `${number}xs` | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | `${number}xl`;
221
- type HeadingKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
222
- type DisplayKeys = 'display1' | 'display2' | 'display3' | 'display4';
223
- type FontSizeKeys = SizeKeys | HeadingKeys | DisplayKeys;
224
- declare function isDetailFont(value: FontSize): value is DetailFont;
225
- type FontSizes = {
226
- [K in FontSizeKeys]?: FontSize;
227
- };
228
- type UnocssFontSizes = {
229
- [K in FontSizeKeys]?: UnocssFontSize;
357
+ declare const customFontFamily: {
358
+ sans: string[];
230
359
  };
231
360
 
232
- declare const fontSizes: {
361
+ declare const fontSize: {
233
362
  '2xs': ["0.6875rem", "1rem"];
234
363
  xs: ["0.75rem", "1rem"];
235
364
  sm: ["0.875rem", "1.25rem"];
236
365
  base: ["1rem", "1.5rem"];
366
+ md: ["1.125rem", "1.5rem"];
237
367
  lg: ["1.25rem", "1.625rem"];
238
368
  display1: ["3.75rem", {
239
369
  fontWeight: number;
@@ -282,60 +412,6 @@ declare const fontSizes: {
282
412
  }];
283
413
  };
284
414
 
285
- declare const shadows: {
286
- 'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
287
- 'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
288
- 'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
289
- 'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
290
- 'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
291
- 'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
292
- };
293
-
294
- declare const customFontFamily: {
295
- sans: string[];
296
- };
297
-
298
- declare const animation: {
299
- 'radix-accordion-down': string;
300
- 'radix-accordion-up': string;
301
- 'radix-collapsible-down': string;
302
- 'radix-collapsible-up': string;
303
- };
304
- declare const keyframes: {
305
- 'radix-accordion-down': {
306
- from: {
307
- height: string;
308
- };
309
- to: {
310
- height: string;
311
- };
312
- };
313
- 'radix-accordion-up': {
314
- from: {
315
- height: string;
316
- };
317
- to: {
318
- height: string;
319
- };
320
- };
321
- 'radix-collapsible-down': {
322
- from: {
323
- height: string;
324
- };
325
- to: {
326
- height: string;
327
- };
328
- };
329
- 'radix-collapsible-up': {
330
- from: {
331
- height: string;
332
- };
333
- to: {
334
- height: string;
335
- };
336
- };
337
- };
338
-
339
415
  declare const screensNumber: {
340
416
  sm: number;
341
417
  md: number;
@@ -357,7 +433,17 @@ declare const screens: {
357
433
  desktop: `${number}px`;
358
434
  };
359
435
 
360
- declare const theme: Config['theme'];
436
+ declare const boxShadow: {
437
+ 'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
438
+ 'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
439
+ 'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
440
+ 'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
441
+ 'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
442
+ 'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
443
+ };
444
+
445
+ declare function buildTheme(options?: BuildThemeOptions): Config['theme'];
446
+ declare const defaultTheme: Config['theme'];
361
447
  declare const unocssTheme: {
362
448
  colors: {
363
449
  primary: {
@@ -550,45 +636,7 @@ declare const unocssTheme: {
550
636
  fontSize: UnocssFontSizes;
551
637
  };
552
638
 
553
- declare const colorsNames: readonly ["primary", "bateau", "secondary", "pompelmo", "green", "fuchsia", "indigo", "neutral", "orange", "red", "amber", "seafoam"];
554
-
555
- type ColorsNames = typeof colorsNames[number];
556
- type ColorsVariations = 'DEFAULT' | 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950;
557
- interface MainColors {
558
- black: string;
559
- white: string;
560
- inherit: 'inherit';
561
- current: 'currentColor';
562
- transparent: 'transparent';
563
- }
564
- interface DefaultColors {
565
- danger: string;
566
- warning: string;
567
- success: string;
568
- info: string;
569
- special: string;
570
- }
571
- type Colors = DefaultColors & MainColors & Record<ColorsNames, {
572
- [K in ColorsVariations]: string;
573
- }>;
574
- type ColorString = `${ColorsNames}-${ColorsVariations}` | keyof DefaultColors | keyof MainColors;
575
-
576
- type BorderSize = 0 | `${number}px`;
577
- type RgbValue = number;
578
- type Shadow = `${BorderSize} ${BorderSize} ${BorderSize} ${BorderSize} rgba(${RgbValue}, ${RgbValue}, ${RgbValue}, ${RgbValue})`;
579
- type ShadowSize = 0 | 1 | 2 | 3 | 4 | 5;
580
- type Shadows = {
581
- [K in ShadowSize as `elevation-${K}`]?: Shadow;
582
- };
583
-
584
- declare const screenSizes: readonly ["sm", "md", "lg", "xl", "2xl", "tablet", "laptop", "desktop"];
585
- type Screens = Record<typeof screenSizes[number], `${number}px`>;
586
- type ExtractNumber<T extends string> = T extends `${infer N extends number}px` ? N : never;
587
- type ScreensNumber = {
588
- [K in keyof Screens]: ExtractNumber<Screens[K]>;
589
- };
590
-
591
- declare function config(extend?: boolean): Partial<Config>;
639
+ declare function buildPreset(extend?: boolean, buildOptions?: BuildThemeOptions): Partial<Config>;
592
640
  declare const _default: Partial<tailwindcss_types_config.Config>;
593
641
 
594
- export { type ColorString, type Colors, type ColorsNames, type FontSizes, type Screens, type ScreensNumber, type Shadows, type UnocssFontSizes, animation, colors, colorsNames, config, _default as default, customFontFamily as fontFamily, fontSizes, isDetailFont, keyframes, screenSizes, screens, screensNumber, shadows, theme, unocssTheme };
642
+ export { type BuildThemeOptions, type ColorString, type Colors, type ColorsNames, type FontSizes, type Screens, type ScreensNumber, type Shadows, type UnocssFontSizes, animation, boxShadow, buildPreset, buildTheme, colors, colorsNames, _default as default, defaultTheme, customFontFamily as fontFamily, fontSize, isDetailFont, keyframes, screenSizes, screens, screensNumber, unocssTheme };