@removify/tailwind-preset 0.0.7 → 0.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.
@@ -10,7 +10,6 @@ var colors = {
10
10
  special: "#686DF4",
11
11
  black: "#000000",
12
12
  white: "#FFFFFF",
13
- overlay: "#00000080",
14
13
  primary: {
15
14
  50: "#E8F1F6",
16
15
  100: "#BED9E6",
@@ -106,6 +105,30 @@ var colors = {
106
105
  700: "#268085",
107
106
  800: "#1B5E62",
108
107
  900: "#113C3E"
108
+ },
109
+ red: {
110
+ 50: "#FEEAE9",
111
+ 100: "#FBC5C1",
112
+ 200: "#F8A09A",
113
+ 300: "#F47C74",
114
+ 400: "#EF584E",
115
+ 500: "#EA3529",
116
+ 600: "#C32A20",
117
+ 700: "#9B2018",
118
+ 800: "#731610",
119
+ 900: "#490D09"
120
+ },
121
+ amber: {
122
+ 50: "#FFF9E8",
123
+ 100: "#FFEEBF",
124
+ 200: "#FFE397",
125
+ 300: "#FFD770",
126
+ 400: "#FECB4A",
127
+ 500: "#FBBF24",
128
+ 600: "#D19F1C",
129
+ 700: "#A67E14",
130
+ 800: "#795C0D",
131
+ 900: "#4D3B08"
109
132
  }
110
133
  };
111
134
 
package/dist/cli.cjs CHANGED
@@ -39,7 +39,6 @@ var colors = {
39
39
  special: "#686DF4",
40
40
  black: "#000000",
41
41
  white: "#FFFFFF",
42
- overlay: "#00000080",
43
42
  primary: {
44
43
  50: "#E8F1F6",
45
44
  100: "#BED9E6",
@@ -135,6 +134,30 @@ var colors = {
135
134
  700: "#268085",
136
135
  800: "#1B5E62",
137
136
  900: "#113C3E"
137
+ },
138
+ red: {
139
+ 50: "#FEEAE9",
140
+ 100: "#FBC5C1",
141
+ 200: "#F8A09A",
142
+ 300: "#F47C74",
143
+ 400: "#EF584E",
144
+ 500: "#EA3529",
145
+ 600: "#C32A20",
146
+ 700: "#9B2018",
147
+ 800: "#731610",
148
+ 900: "#490D09"
149
+ },
150
+ amber: {
151
+ 50: "#FFF9E8",
152
+ 100: "#FFEEBF",
153
+ 200: "#FFE397",
154
+ 300: "#FFD770",
155
+ 400: "#FECB4A",
156
+ 500: "#FBBF24",
157
+ 600: "#D19F1C",
158
+ 700: "#A67E14",
159
+ 800: "#795C0D",
160
+ 900: "#4D3B08"
138
161
  }
139
162
  };
140
163
 
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  colors
3
- } from "./chunk-UJDFJG2Z.js";
3
+ } from "./chunk-5LOSNWQT.js";
4
4
 
5
5
  // src/cli.ts
6
6
  import { hideBin } from "yargs/helpers";
package/dist/index.cjs CHANGED
@@ -24,7 +24,9 @@ __export(src_exports, {
24
24
  config: () => config,
25
25
  default: () => src_default,
26
26
  fontSizes: () => fontSizes,
27
- shadows: () => shadows
27
+ shadows: () => shadows,
28
+ theme: () => theme,
29
+ unocssTheme: () => unocssTheme
28
30
  });
29
31
  module.exports = __toCommonJS(src_exports);
30
32
 
@@ -40,7 +42,6 @@ var colors = {
40
42
  special: "#686DF4",
41
43
  black: "#000000",
42
44
  white: "#FFFFFF",
43
- overlay: "#00000080",
44
45
  primary: {
45
46
  50: "#E8F1F6",
46
47
  100: "#BED9E6",
@@ -136,18 +137,58 @@ var colors = {
136
137
  700: "#268085",
137
138
  800: "#1B5E62",
138
139
  900: "#113C3E"
140
+ },
141
+ red: {
142
+ 50: "#FEEAE9",
143
+ 100: "#FBC5C1",
144
+ 200: "#F8A09A",
145
+ 300: "#F47C74",
146
+ 400: "#EF584E",
147
+ 500: "#EA3529",
148
+ 600: "#C32A20",
149
+ 700: "#9B2018",
150
+ 800: "#731610",
151
+ 900: "#490D09"
152
+ },
153
+ amber: {
154
+ 50: "#FFF9E8",
155
+ 100: "#FFEEBF",
156
+ 200: "#FFE397",
157
+ 300: "#FFD770",
158
+ 400: "#FECB4A",
159
+ 500: "#FBBF24",
160
+ 600: "#D19F1C",
161
+ 700: "#A67E14",
162
+ 800: "#795C0D",
163
+ 900: "#4D3B08"
139
164
  }
140
165
  };
141
166
 
142
- // src/theme/shadows.ts
143
- var shadows = {
144
- "elevation-0": "0 0 0 0 rgba(0, 0, 0, 0.10)",
145
- "elevation-1": "0 1px 2px 0 rgba(0, 0, 0, 0.10)",
146
- "elevation-2": "0 4px 8px 0 rgba(0, 0, 0, 0.10)",
147
- "elevation-3": "0 6px 12px 0 rgba(0, 0, 0, 0.10)",
148
- "elevation-4": "0 8px 16px 0 rgba(0, 0, 0, 0.10)",
149
- "elevation-5": "0 12px 24px 0 rgba(0, 0, 0, 0.10)"
150
- };
167
+ // src/util/font.ts
168
+ var import_string_ts = require("string-ts");
169
+
170
+ // src/types/fontSize.ts
171
+ function isDetailFont(value) {
172
+ return Array.isArray(value) && typeof value[1] === "object";
173
+ }
174
+
175
+ // src/util/font.ts
176
+ var entries = Object.entries;
177
+ function fontConfigKeysKebabCase(fontConfig) {
178
+ const result = {};
179
+ for (const [key, value] of entries(fontConfig)) {
180
+ if (value) {
181
+ if (isDetailFont(value)) {
182
+ const [size, detail] = value;
183
+ const kebabDetail = (0, import_string_ts.kebabKeys)(detail);
184
+ result[key] = [size, kebabDetail];
185
+ } else {
186
+ result[key] = value;
187
+ }
188
+ }
189
+ }
190
+ return result;
191
+ }
151
192
 
152
193
  // src/theme/fontSize.ts
153
194
  var fontSizes = {
@@ -202,13 +243,31 @@ var fontSizes = {
202
243
  letterSpacing: "-0.0125rem"
203
244
  }]
204
245
  };
246
+ var unocssFontSizes = fontConfigKeysKebabCase(fontSizes);
205
247
 
206
- // src/index.ts
248
+ // src/theme/shadows.ts
249
+ var shadows = {
250
+ "elevation-0": "0 0 0 0 rgba(0, 0, 0, 0.10)",
251
+ "elevation-1": "0 1px 2px 0 rgba(0, 0, 0, 0.10)",
252
+ "elevation-2": "0 4px 8px 0 rgba(0, 0, 0, 0.10)",
253
+ "elevation-3": "0 6px 12px 0 rgba(0, 0, 0, 0.10)",
254
+ "elevation-4": "0 8px 16px 0 rgba(0, 0, 0, 0.10)",
255
+ "elevation-5": "0 12px 24px 0 rgba(0, 0, 0, 0.10)"
256
+ };
257
+
258
+ // src/theme/index.ts
207
259
  var theme = {
208
260
  colors,
209
261
  boxShadow: shadows,
210
262
  fontSize: fontSizes
211
263
  };
264
+ var unocssTheme = {
265
+ colors,
266
+ boxShadow: shadows,
267
+ fontSize: unocssFontSizes
268
+ };
269
+
270
+ // src/index.ts
212
271
  function config(extend = false) {
213
272
  if (extend) {
214
273
  return {
@@ -227,5 +286,7 @@ var src_default = config();
227
286
  colors,
228
287
  config,
229
288
  fontSizes,
230
- shadows
289
+ shadows,
290
+ theme,
291
+ unocssTheme
231
292
  });
package/dist/index.d.cts CHANGED
@@ -1,6 +1,52 @@
1
1
  import * as tailwindcss_types_config from 'tailwindcss/types/config';
2
2
  import { Config } from 'tailwindcss';
3
3
 
4
+ /**
5
+ * Converts the given string from camel-case to kebab-case.
6
+ * @template T The string to convert the case.
7
+ * @see https://gist.github.com/albertms10/09f14ef7ebdc3ce0e95683c728616253
8
+ * @example
9
+ * type Kebab = CamelToKebab<'exampleVarName'>;
10
+ * // 'example-var-name'
11
+ */
12
+ type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${CamelToKebab<U>}` : `${Uncapitalize<T>}-${CamelToKebab<U>}` : '';
13
+ type CamelToKebabKeys<T> = {
14
+ [K in keyof T as K extends string ? CamelToKebab<K> : K]: T[K];
15
+ };
16
+
17
+ /**
18
+ * tailwindcss font-size configuration
19
+ * @see https://tailwindcss.com/docs/font-size
20
+ *
21
+ * @note For unocss, the keys are kebab-case
22
+ * @see https://github.com/unocss/unocss/issues/3663#issuecomment-2024909371
23
+ */
24
+
25
+ interface FontSizeDetail {
26
+ lineHeight?: string;
27
+ letterSpacing?: string;
28
+ fontWeight?: number;
29
+ }
30
+ type FontValue = `${number}px` | `${number}rem`;
31
+ type FontAndLineHeight = [FontValue, FontValue];
32
+ type DetailFont = [
33
+ FontValue,
34
+ FontSizeDetail
35
+ ];
36
+ type UnocssDetailFont = [FontValue, CamelToKebabKeys<FontSizeDetail>];
37
+ type FontSize = FontAndLineHeight | FontValue | DetailFont;
38
+ type UnocssFontSize = FontValue | FontAndLineHeight | UnocssDetailFont;
39
+ type SizeKeys = `${number}xs` | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | `${number}xl`;
40
+ type HeadingKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
41
+ type DisplayKeys = 'display1' | 'display2' | 'display3' | 'display4';
42
+ type FontSizeKeys = SizeKeys | HeadingKeys | DisplayKeys;
43
+ type FontSizes = {
44
+ [K in FontSizeKeys]?: FontSize;
45
+ };
46
+ type UnocssFontSizes = {
47
+ [K in FontSizeKeys]?: UnocssFontSize;
48
+ };
49
+
4
50
  declare const colors: {
5
51
  inherit: "inherit";
6
52
  current: "currentColor";
@@ -12,7 +58,6 @@ declare const colors: {
12
58
  special: string;
13
59
  black: string;
14
60
  white: string;
15
- overlay: string;
16
61
  primary: {
17
62
  50: string;
18
63
  100: string;
@@ -109,15 +154,30 @@ declare const colors: {
109
154
  800: string;
110
155
  900: string;
111
156
  };
112
- };
113
-
114
- declare const shadows: {
115
- 'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
116
- 'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
117
- 'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
118
- 'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
119
- 'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
120
- 'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
157
+ red: {
158
+ 50: string;
159
+ 100: string;
160
+ 200: string;
161
+ 300: string;
162
+ 400: string;
163
+ 500: string;
164
+ 600: string;
165
+ 700: string;
166
+ 800: string;
167
+ 900: string;
168
+ };
169
+ amber: {
170
+ 50: string;
171
+ 100: string;
172
+ 200: string;
173
+ 300: string;
174
+ 400: string;
175
+ 500: string;
176
+ 600: string;
177
+ 700: string;
178
+ 800: string;
179
+ 900: string;
180
+ };
121
181
  };
122
182
 
123
183
  declare const fontSizes: {
@@ -128,52 +188,206 @@ declare const fontSizes: {
128
188
  lg: ["1.25rem", "1.625rem"];
129
189
  display1: ["3.75rem", {
130
190
  fontWeight: number;
131
- lineHeight: "5rem";
132
- letterSpacing: "-0.0625rem";
191
+ lineHeight: string;
192
+ letterSpacing: string;
133
193
  }];
134
194
  display2: ["3.25rem", {
135
195
  fontWeight: number;
136
- lineHeight: "4.25rem";
137
- letterSpacing: "-0.05rem";
196
+ lineHeight: string;
197
+ letterSpacing: string;
138
198
  }];
139
199
  display3: ["2.75rem", {
140
200
  fontWeight: number;
141
- lineHeight: "3.625rem";
142
- letterSpacing: "-0.0375rem";
201
+ lineHeight: string;
202
+ letterSpacing: string;
143
203
  }];
144
204
  h1: ["3rem", {
145
205
  fontWeight: number;
146
- lineHeight: "3.75rem";
147
- letterSpacing: "-0.0125rem";
206
+ lineHeight: string;
207
+ letterSpacing: string;
148
208
  }];
149
209
  h2: ["2.5rem", {
150
210
  fontWeight: number;
151
- lineHeight: "3.25rem";
152
- letterSpacing: "-0.0125rem";
211
+ lineHeight: string;
212
+ letterSpacing: string;
153
213
  }];
154
214
  h3: ["2.25rem", {
155
215
  fontWeight: number;
156
- lineHeight: "3rem";
157
- letterSpacing: "-0.0125rem";
216
+ lineHeight: string;
217
+ letterSpacing: string;
158
218
  }];
159
219
  h4: ["2rem", {
160
220
  fontWeight: number;
161
- lineHeight: "2.625rem";
162
- letterSpacing: "-0.0125rem";
221
+ lineHeight: string;
222
+ letterSpacing: string;
163
223
  }];
164
224
  h5: ["1.5rem", {
165
225
  fontWeight: number;
166
- lineHeight: "2rem";
167
- letterSpacing: "-0.0125rem";
226
+ lineHeight: string;
227
+ letterSpacing: string;
168
228
  }];
169
229
  h6: ["1.25rem", {
170
230
  fontWeight: number;
171
- lineHeight: "1.625rem";
172
- letterSpacing: "-0.0125rem";
231
+ lineHeight: string;
232
+ letterSpacing: string;
173
233
  }];
174
234
  };
175
235
 
176
- type ColorsNames = 'primary' | 'secondary' | 'green' | 'fuchsia' | 'indigo' | 'neutral' | 'orange' | 'seafoam';
236
+ declare const shadows: {
237
+ 'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
238
+ 'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
239
+ 'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
240
+ 'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
241
+ 'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
242
+ 'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
243
+ };
244
+
245
+ declare const theme: Config['theme'];
246
+ declare const unocssTheme: {
247
+ colors: {
248
+ inherit: "inherit";
249
+ current: "currentColor";
250
+ transparent: "transparent";
251
+ danger: string;
252
+ warning: string;
253
+ success: string;
254
+ info: string;
255
+ special: string;
256
+ black: string;
257
+ white: string;
258
+ primary: {
259
+ 50: string;
260
+ 100: string;
261
+ 200: string;
262
+ 300: string;
263
+ 400: string;
264
+ 500: string;
265
+ 600: string;
266
+ 700: string;
267
+ 800: string;
268
+ 900: string;
269
+ };
270
+ secondary: {
271
+ 50: string;
272
+ 100: string;
273
+ 200: string;
274
+ 300: string;
275
+ 400: string;
276
+ 500: string;
277
+ 600: string;
278
+ 700: string;
279
+ 800: string;
280
+ 900: string;
281
+ };
282
+ green: {
283
+ 50: string;
284
+ 100: string;
285
+ 200: string;
286
+ 300: string;
287
+ 400: string;
288
+ 500: string;
289
+ 600: string;
290
+ 700: string;
291
+ 800: string;
292
+ 900: string;
293
+ };
294
+ fuchsia: {
295
+ 50: string;
296
+ 100: string;
297
+ 200: string;
298
+ 300: string;
299
+ 400: string;
300
+ 500: string;
301
+ 600: string;
302
+ 700: string;
303
+ 800: string;
304
+ 900: string;
305
+ };
306
+ indigo: {
307
+ 50: string;
308
+ 100: string;
309
+ 200: string;
310
+ 300: string;
311
+ 400: string;
312
+ 500: string;
313
+ 600: string;
314
+ 700: string;
315
+ 800: string;
316
+ 900: string;
317
+ };
318
+ neutral: {
319
+ 50: string;
320
+ 100: string;
321
+ 200: string;
322
+ 300: string;
323
+ 400: string;
324
+ 500: string;
325
+ 600: string;
326
+ 700: string;
327
+ 800: string;
328
+ 900: string;
329
+ };
330
+ orange: {
331
+ 50: string;
332
+ 100: string;
333
+ 200: string;
334
+ 300: string;
335
+ 400: string;
336
+ 500: string;
337
+ 600: string;
338
+ 700: string;
339
+ 800: string;
340
+ 900: string;
341
+ };
342
+ seafoam: {
343
+ 50: string;
344
+ 100: string;
345
+ 200: string;
346
+ 300: string;
347
+ 400: string;
348
+ 500: string;
349
+ 600: string;
350
+ 700: string;
351
+ 800: string;
352
+ 900: string;
353
+ };
354
+ red: {
355
+ 50: string;
356
+ 100: string;
357
+ 200: string;
358
+ 300: string;
359
+ 400: string;
360
+ 500: string;
361
+ 600: string;
362
+ 700: string;
363
+ 800: string;
364
+ 900: string;
365
+ };
366
+ amber: {
367
+ 50: string;
368
+ 100: string;
369
+ 200: string;
370
+ 300: string;
371
+ 400: string;
372
+ 500: string;
373
+ 600: string;
374
+ 700: string;
375
+ 800: string;
376
+ 900: string;
377
+ };
378
+ };
379
+ boxShadow: {
380
+ 'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
381
+ 'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
382
+ 'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
383
+ 'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
384
+ 'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
385
+ 'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
386
+ };
387
+ fontSize: UnocssFontSizes;
388
+ };
389
+
390
+ type ColorsNames = 'primary' | 'secondary' | 'green' | 'fuchsia' | 'indigo' | 'neutral' | 'orange' | 'red' | 'amber' | 'seafoam';
177
391
  type ColorsVariations = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
178
392
  interface MainColors {
179
393
  black: string;
@@ -188,7 +402,6 @@ interface DefaultColors {
188
402
  success: string;
189
403
  info: string;
190
404
  special: string;
191
- overlay: string;
192
405
  }
193
406
  type Colors = DefaultColors & MainColors & Record<ColorsNames, {
194
407
  [K in ColorsVariations]: string;
@@ -203,24 +416,7 @@ type Shadows = {
203
416
  [K in ShadowSize as `elevation-${K}`]?: Shadow;
204
417
  };
205
418
 
206
- type FontValue = `${number}px` | `${number}rem`;
207
- type FontSize = [FontValue, FontValue] | FontValue | [
208
- FontValue,
209
- {
210
- lineHeight?: FontValue;
211
- letterSpacing?: FontValue;
212
- fontWeight?: number;
213
- }
214
- ];
215
- type SizeKeys = `${number}xs` | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | `${number}xl`;
216
- type HeadingKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
217
- type DisplayKeys = 'display1' | 'display2' | 'display3' | 'display4';
218
- type FontSizeKeys = SizeKeys | HeadingKeys | DisplayKeys;
219
- type FontSizes = {
220
- [K in FontSizeKeys]?: FontSize;
221
- };
222
-
223
419
  declare function config(extend?: boolean): Partial<Config>;
224
420
  declare const _default: Partial<tailwindcss_types_config.Config>;
225
421
 
226
- export { type ColorString, type Colors, type FontSizes, type Shadows, colors, config, _default as default, fontSizes, shadows };
422
+ export { type ColorString, type Colors, type FontSizes, type Shadows, colors, config, _default as default, fontSizes, shadows, theme, unocssTheme };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,52 @@
1
1
  import * as tailwindcss_types_config from 'tailwindcss/types/config';
2
2
  import { Config } from 'tailwindcss';
3
3
 
4
+ /**
5
+ * Converts the given string from camel-case to kebab-case.
6
+ * @template T The string to convert the case.
7
+ * @see https://gist.github.com/albertms10/09f14ef7ebdc3ce0e95683c728616253
8
+ * @example
9
+ * type Kebab = CamelToKebab<'exampleVarName'>;
10
+ * // 'example-var-name'
11
+ */
12
+ type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${CamelToKebab<U>}` : `${Uncapitalize<T>}-${CamelToKebab<U>}` : '';
13
+ type CamelToKebabKeys<T> = {
14
+ [K in keyof T as K extends string ? CamelToKebab<K> : K]: T[K];
15
+ };
16
+
17
+ /**
18
+ * tailwindcss font-size configuration
19
+ * @see https://tailwindcss.com/docs/font-size
20
+ *
21
+ * @note For unocss, the keys are kebab-case
22
+ * @see https://github.com/unocss/unocss/issues/3663#issuecomment-2024909371
23
+ */
24
+
25
+ interface FontSizeDetail {
26
+ lineHeight?: string;
27
+ letterSpacing?: string;
28
+ fontWeight?: number;
29
+ }
30
+ type FontValue = `${number}px` | `${number}rem`;
31
+ type FontAndLineHeight = [FontValue, FontValue];
32
+ type DetailFont = [
33
+ FontValue,
34
+ FontSizeDetail
35
+ ];
36
+ type UnocssDetailFont = [FontValue, CamelToKebabKeys<FontSizeDetail>];
37
+ type FontSize = FontAndLineHeight | FontValue | DetailFont;
38
+ type UnocssFontSize = FontValue | FontAndLineHeight | UnocssDetailFont;
39
+ type SizeKeys = `${number}xs` | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | `${number}xl`;
40
+ type HeadingKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
41
+ type DisplayKeys = 'display1' | 'display2' | 'display3' | 'display4';
42
+ type FontSizeKeys = SizeKeys | HeadingKeys | DisplayKeys;
43
+ type FontSizes = {
44
+ [K in FontSizeKeys]?: FontSize;
45
+ };
46
+ type UnocssFontSizes = {
47
+ [K in FontSizeKeys]?: UnocssFontSize;
48
+ };
49
+
4
50
  declare const colors: {
5
51
  inherit: "inherit";
6
52
  current: "currentColor";
@@ -12,7 +58,6 @@ declare const colors: {
12
58
  special: string;
13
59
  black: string;
14
60
  white: string;
15
- overlay: string;
16
61
  primary: {
17
62
  50: string;
18
63
  100: string;
@@ -109,15 +154,30 @@ declare const colors: {
109
154
  800: string;
110
155
  900: string;
111
156
  };
112
- };
113
-
114
- declare const shadows: {
115
- 'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
116
- 'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
117
- 'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
118
- 'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
119
- 'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
120
- 'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
157
+ red: {
158
+ 50: string;
159
+ 100: string;
160
+ 200: string;
161
+ 300: string;
162
+ 400: string;
163
+ 500: string;
164
+ 600: string;
165
+ 700: string;
166
+ 800: string;
167
+ 900: string;
168
+ };
169
+ amber: {
170
+ 50: string;
171
+ 100: string;
172
+ 200: string;
173
+ 300: string;
174
+ 400: string;
175
+ 500: string;
176
+ 600: string;
177
+ 700: string;
178
+ 800: string;
179
+ 900: string;
180
+ };
121
181
  };
122
182
 
123
183
  declare const fontSizes: {
@@ -128,52 +188,206 @@ declare const fontSizes: {
128
188
  lg: ["1.25rem", "1.625rem"];
129
189
  display1: ["3.75rem", {
130
190
  fontWeight: number;
131
- lineHeight: "5rem";
132
- letterSpacing: "-0.0625rem";
191
+ lineHeight: string;
192
+ letterSpacing: string;
133
193
  }];
134
194
  display2: ["3.25rem", {
135
195
  fontWeight: number;
136
- lineHeight: "4.25rem";
137
- letterSpacing: "-0.05rem";
196
+ lineHeight: string;
197
+ letterSpacing: string;
138
198
  }];
139
199
  display3: ["2.75rem", {
140
200
  fontWeight: number;
141
- lineHeight: "3.625rem";
142
- letterSpacing: "-0.0375rem";
201
+ lineHeight: string;
202
+ letterSpacing: string;
143
203
  }];
144
204
  h1: ["3rem", {
145
205
  fontWeight: number;
146
- lineHeight: "3.75rem";
147
- letterSpacing: "-0.0125rem";
206
+ lineHeight: string;
207
+ letterSpacing: string;
148
208
  }];
149
209
  h2: ["2.5rem", {
150
210
  fontWeight: number;
151
- lineHeight: "3.25rem";
152
- letterSpacing: "-0.0125rem";
211
+ lineHeight: string;
212
+ letterSpacing: string;
153
213
  }];
154
214
  h3: ["2.25rem", {
155
215
  fontWeight: number;
156
- lineHeight: "3rem";
157
- letterSpacing: "-0.0125rem";
216
+ lineHeight: string;
217
+ letterSpacing: string;
158
218
  }];
159
219
  h4: ["2rem", {
160
220
  fontWeight: number;
161
- lineHeight: "2.625rem";
162
- letterSpacing: "-0.0125rem";
221
+ lineHeight: string;
222
+ letterSpacing: string;
163
223
  }];
164
224
  h5: ["1.5rem", {
165
225
  fontWeight: number;
166
- lineHeight: "2rem";
167
- letterSpacing: "-0.0125rem";
226
+ lineHeight: string;
227
+ letterSpacing: string;
168
228
  }];
169
229
  h6: ["1.25rem", {
170
230
  fontWeight: number;
171
- lineHeight: "1.625rem";
172
- letterSpacing: "-0.0125rem";
231
+ lineHeight: string;
232
+ letterSpacing: string;
173
233
  }];
174
234
  };
175
235
 
176
- type ColorsNames = 'primary' | 'secondary' | 'green' | 'fuchsia' | 'indigo' | 'neutral' | 'orange' | 'seafoam';
236
+ declare const shadows: {
237
+ 'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
238
+ 'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
239
+ 'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
240
+ 'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
241
+ 'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
242
+ 'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
243
+ };
244
+
245
+ declare const theme: Config['theme'];
246
+ declare const unocssTheme: {
247
+ colors: {
248
+ inherit: "inherit";
249
+ current: "currentColor";
250
+ transparent: "transparent";
251
+ danger: string;
252
+ warning: string;
253
+ success: string;
254
+ info: string;
255
+ special: string;
256
+ black: string;
257
+ white: string;
258
+ primary: {
259
+ 50: string;
260
+ 100: string;
261
+ 200: string;
262
+ 300: string;
263
+ 400: string;
264
+ 500: string;
265
+ 600: string;
266
+ 700: string;
267
+ 800: string;
268
+ 900: string;
269
+ };
270
+ secondary: {
271
+ 50: string;
272
+ 100: string;
273
+ 200: string;
274
+ 300: string;
275
+ 400: string;
276
+ 500: string;
277
+ 600: string;
278
+ 700: string;
279
+ 800: string;
280
+ 900: string;
281
+ };
282
+ green: {
283
+ 50: string;
284
+ 100: string;
285
+ 200: string;
286
+ 300: string;
287
+ 400: string;
288
+ 500: string;
289
+ 600: string;
290
+ 700: string;
291
+ 800: string;
292
+ 900: string;
293
+ };
294
+ fuchsia: {
295
+ 50: string;
296
+ 100: string;
297
+ 200: string;
298
+ 300: string;
299
+ 400: string;
300
+ 500: string;
301
+ 600: string;
302
+ 700: string;
303
+ 800: string;
304
+ 900: string;
305
+ };
306
+ indigo: {
307
+ 50: string;
308
+ 100: string;
309
+ 200: string;
310
+ 300: string;
311
+ 400: string;
312
+ 500: string;
313
+ 600: string;
314
+ 700: string;
315
+ 800: string;
316
+ 900: string;
317
+ };
318
+ neutral: {
319
+ 50: string;
320
+ 100: string;
321
+ 200: string;
322
+ 300: string;
323
+ 400: string;
324
+ 500: string;
325
+ 600: string;
326
+ 700: string;
327
+ 800: string;
328
+ 900: string;
329
+ };
330
+ orange: {
331
+ 50: string;
332
+ 100: string;
333
+ 200: string;
334
+ 300: string;
335
+ 400: string;
336
+ 500: string;
337
+ 600: string;
338
+ 700: string;
339
+ 800: string;
340
+ 900: string;
341
+ };
342
+ seafoam: {
343
+ 50: string;
344
+ 100: string;
345
+ 200: string;
346
+ 300: string;
347
+ 400: string;
348
+ 500: string;
349
+ 600: string;
350
+ 700: string;
351
+ 800: string;
352
+ 900: string;
353
+ };
354
+ red: {
355
+ 50: string;
356
+ 100: string;
357
+ 200: string;
358
+ 300: string;
359
+ 400: string;
360
+ 500: string;
361
+ 600: string;
362
+ 700: string;
363
+ 800: string;
364
+ 900: string;
365
+ };
366
+ amber: {
367
+ 50: string;
368
+ 100: string;
369
+ 200: string;
370
+ 300: string;
371
+ 400: string;
372
+ 500: string;
373
+ 600: string;
374
+ 700: string;
375
+ 800: string;
376
+ 900: string;
377
+ };
378
+ };
379
+ boxShadow: {
380
+ 'elevation-0': "0 0 0 0 rgba(0, 0, 0, 0.10)";
381
+ 'elevation-1': "0 1px 2px 0 rgba(0, 0, 0, 0.10)";
382
+ 'elevation-2': "0 4px 8px 0 rgba(0, 0, 0, 0.10)";
383
+ 'elevation-3': "0 6px 12px 0 rgba(0, 0, 0, 0.10)";
384
+ 'elevation-4': "0 8px 16px 0 rgba(0, 0, 0, 0.10)";
385
+ 'elevation-5': "0 12px 24px 0 rgba(0, 0, 0, 0.10)";
386
+ };
387
+ fontSize: UnocssFontSizes;
388
+ };
389
+
390
+ type ColorsNames = 'primary' | 'secondary' | 'green' | 'fuchsia' | 'indigo' | 'neutral' | 'orange' | 'red' | 'amber' | 'seafoam';
177
391
  type ColorsVariations = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
178
392
  interface MainColors {
179
393
  black: string;
@@ -188,7 +402,6 @@ interface DefaultColors {
188
402
  success: string;
189
403
  info: string;
190
404
  special: string;
191
- overlay: string;
192
405
  }
193
406
  type Colors = DefaultColors & MainColors & Record<ColorsNames, {
194
407
  [K in ColorsVariations]: string;
@@ -203,24 +416,7 @@ type Shadows = {
203
416
  [K in ShadowSize as `elevation-${K}`]?: Shadow;
204
417
  };
205
418
 
206
- type FontValue = `${number}px` | `${number}rem`;
207
- type FontSize = [FontValue, FontValue] | FontValue | [
208
- FontValue,
209
- {
210
- lineHeight?: FontValue;
211
- letterSpacing?: FontValue;
212
- fontWeight?: number;
213
- }
214
- ];
215
- type SizeKeys = `${number}xs` | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | `${number}xl`;
216
- type HeadingKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
217
- type DisplayKeys = 'display1' | 'display2' | 'display3' | 'display4';
218
- type FontSizeKeys = SizeKeys | HeadingKeys | DisplayKeys;
219
- type FontSizes = {
220
- [K in FontSizeKeys]?: FontSize;
221
- };
222
-
223
419
  declare function config(extend?: boolean): Partial<Config>;
224
420
  declare const _default: Partial<tailwindcss_types_config.Config>;
225
421
 
226
- export { type ColorString, type Colors, type FontSizes, type Shadows, colors, config, _default as default, fontSizes, shadows };
422
+ export { type ColorString, type Colors, type FontSizes, type Shadows, colors, config, _default as default, fontSizes, shadows, theme, unocssTheme };
package/dist/index.js CHANGED
@@ -1,16 +1,32 @@
1
1
  import {
2
2
  colors
3
- } from "./chunk-UJDFJG2Z.js";
3
+ } from "./chunk-5LOSNWQT.js";
4
4
 
5
- // src/theme/shadows.ts
6
- var shadows = {
7
- "elevation-0": "0 0 0 0 rgba(0, 0, 0, 0.10)",
8
- "elevation-1": "0 1px 2px 0 rgba(0, 0, 0, 0.10)",
9
- "elevation-2": "0 4px 8px 0 rgba(0, 0, 0, 0.10)",
10
- "elevation-3": "0 6px 12px 0 rgba(0, 0, 0, 0.10)",
11
- "elevation-4": "0 8px 16px 0 rgba(0, 0, 0, 0.10)",
12
- "elevation-5": "0 12px 24px 0 rgba(0, 0, 0, 0.10)"
13
- };
5
+ // src/util/font.ts
6
+ import { kebabKeys } from "string-ts";
7
+
8
+ // src/types/fontSize.ts
9
+ function isDetailFont(value) {
10
+ return Array.isArray(value) && typeof value[1] === "object";
11
+ }
12
+
13
+ // src/util/font.ts
14
+ var entries = Object.entries;
15
+ function fontConfigKeysKebabCase(fontConfig) {
16
+ const result = {};
17
+ for (const [key, value] of entries(fontConfig)) {
18
+ if (value) {
19
+ if (isDetailFont(value)) {
20
+ const [size, detail] = value;
21
+ const kebabDetail = kebabKeys(detail);
22
+ result[key] = [size, kebabDetail];
23
+ } else {
24
+ result[key] = value;
25
+ }
26
+ }
27
+ }
28
+ return result;
29
+ }
14
30
 
15
31
  // src/theme/fontSize.ts
16
32
  var fontSizes = {
@@ -65,13 +81,31 @@ var fontSizes = {
65
81
  letterSpacing: "-0.0125rem"
66
82
  }]
67
83
  };
84
+ var unocssFontSizes = fontConfigKeysKebabCase(fontSizes);
68
85
 
69
- // src/index.ts
86
+ // src/theme/shadows.ts
87
+ var shadows = {
88
+ "elevation-0": "0 0 0 0 rgba(0, 0, 0, 0.10)",
89
+ "elevation-1": "0 1px 2px 0 rgba(0, 0, 0, 0.10)",
90
+ "elevation-2": "0 4px 8px 0 rgba(0, 0, 0, 0.10)",
91
+ "elevation-3": "0 6px 12px 0 rgba(0, 0, 0, 0.10)",
92
+ "elevation-4": "0 8px 16px 0 rgba(0, 0, 0, 0.10)",
93
+ "elevation-5": "0 12px 24px 0 rgba(0, 0, 0, 0.10)"
94
+ };
95
+
96
+ // src/theme/index.ts
70
97
  var theme = {
71
98
  colors,
72
99
  boxShadow: shadows,
73
100
  fontSize: fontSizes
74
101
  };
102
+ var unocssTheme = {
103
+ colors,
104
+ boxShadow: shadows,
105
+ fontSize: unocssFontSizes
106
+ };
107
+
108
+ // src/index.ts
75
109
  function config(extend = false) {
76
110
  if (extend) {
77
111
  return {
@@ -90,5 +124,7 @@ export {
90
124
  config,
91
125
  src_default as default,
92
126
  fontSizes,
93
- shadows
127
+ shadows,
128
+ theme,
129
+ unocssTheme
94
130
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@removify/tailwind-preset",
3
3
  "type": "module",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "description": "Tailwind CSS preset for Removify",
6
6
  "keywords": [
7
7
  "tailwind"
@@ -26,26 +26,27 @@
26
26
  "tailwindcss": "^3.0.0"
27
27
  },
28
28
  "dependencies": {
29
+ "string-ts": "^2.1.0",
29
30
  "yargs": "17.7.2"
30
31
  },
31
32
  "devDependencies": {
32
- "@commitlint/cli": "^18.6.0",
33
- "@commitlint/config-conventional": "^18.6.0",
34
- "@types/node": "^20.11.10",
33
+ "@commitlint/cli": "^19.2.1",
34
+ "@commitlint/config-conventional": "^19.1.0",
35
+ "@types/node": "^20.12.2",
35
36
  "@types/yargs": "^17.0.32",
36
- "bumpp": "^9.3.0",
37
- "eslint": "^8.56.0",
38
- "eslint-config-removify": "^1.2.11",
39
- "husky": "^8.0.3",
40
- "lint-staged": "^15.2.0",
37
+ "bumpp": "^9.4.0",
38
+ "eslint": "^8.57.0",
39
+ "eslint-config-removify": "^1.2.14",
40
+ "husky": "^9.0.11",
41
+ "lint-staged": "^15.2.2",
41
42
  "rimraf": "^5.0.5",
42
- "tailwind-config-viewer": "^1.7.3",
43
- "tailwindcss": "^3.4.1",
44
- "tsup": "^8.0.1",
45
- "tsx": "^4.7.0",
46
- "typescript": "^5.3.3",
47
- "vitest": "^1.2.2",
48
- "@removify/tailwind-preset": "0.0.7"
43
+ "tailwind-config-viewer": "^2.0.1",
44
+ "tailwindcss": "^3.4.3",
45
+ "tsup": "^8.0.2",
46
+ "tsx": "^4.7.1",
47
+ "typescript": "^5.4.3",
48
+ "vitest": "^1.4.0",
49
+ "@removify/tailwind-preset": "0.0.8"
49
50
  },
50
51
  "lint-staged": {
51
52
  "**/*.{js,ts,vue,html}": [
@@ -60,9 +61,9 @@
60
61
  "test": "vitest",
61
62
  "lint": "eslint .",
62
63
  "lint:fix": "eslint --fix .",
63
- "husky:install": "husky install",
64
+ "husky:install": "husky",
64
65
  "release": "bumpp && pnpm publish --access=public",
65
- "tailwind-config-viewer": "tailwind-config-viewer -o -c tailwind.config.cjs",
66
- "tailwind-config-viewer:build": "tailwind-config-viewer export tailwind-dist -c tailwind.config.cjs"
66
+ "tailwind-config-viewer": "tailwind-config-viewer -o -c tailwind.config.js",
67
+ "tailwind-config-viewer:build": "tailwind-config-viewer export tailwind-dist -c tailwind.config.js"
67
68
  }
68
69
  }