@removify/tailwind-preset 0.1.2 → 0.1.4

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.cjs CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
23
  colors: () => colors,
24
+ colorsNames: () => colorsNames,
24
25
  config: () => config,
25
26
  default: () => src_default,
26
27
  fontFamily: () => customFontFamily,
@@ -298,6 +299,22 @@ var unocssTheme = {
298
299
  fontSize: unocssFontSizes
299
300
  };
300
301
 
302
+ // src/constant/index.ts
303
+ var colorsNames = [
304
+ "primary",
305
+ "bateau",
306
+ "secondary",
307
+ "pompelmo",
308
+ "green",
309
+ "fuchsia",
310
+ "indigo",
311
+ "neutral",
312
+ "orange",
313
+ "red",
314
+ "amber",
315
+ "seafoam"
316
+ ];
317
+
301
318
  // src/index.ts
302
319
  function config(extend = true) {
303
320
  if (extend === false) {
@@ -315,6 +332,7 @@ var src_default = config();
315
332
  // Annotate the CommonJS export names for ESM import in node:
316
333
  0 && (module.exports = {
317
334
  colors,
335
+ colorsNames,
318
336
  config,
319
337
  fontFamily,
320
338
  fontSizes,
package/dist/index.d.cts CHANGED
@@ -1,52 +1,6 @@
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
-
50
4
  declare const colors: {
51
5
  primary: {
52
6
  50: string;
@@ -216,6 +170,53 @@ declare const colors: {
216
170
  };
217
171
  };
218
172
 
173
+ /**
174
+ * Converts the given string from camel-case to kebab-case.
175
+ * @template T The string to convert the case.
176
+ * @see https://gist.github.com/albertms10/09f14ef7ebdc3ce0e95683c728616253
177
+ * @example
178
+ * type Kebab = CamelToKebab<'exampleVarName'>;
179
+ * // 'example-var-name'
180
+ */
181
+ type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${CamelToKebab<U>}` : `${Uncapitalize<T>}-${CamelToKebab<U>}` : '';
182
+ type CamelToKebabKeys<T> = {
183
+ [K in keyof T as K extends string ? CamelToKebab<K> : K]: T[K];
184
+ };
185
+
186
+ /**
187
+ * tailwindcss font-size configuration
188
+ * @see https://tailwindcss.com/docs/font-size
189
+ *
190
+ * @note For unocss, the keys are kebab-case
191
+ * @see https://github.com/unocss/unocss/issues/3663#issuecomment-2024909371
192
+ */
193
+
194
+ interface FontSizeDetail {
195
+ lineHeight?: string;
196
+ letterSpacing?: string;
197
+ fontWeight?: number;
198
+ }
199
+ type FontValue = `${number}px` | `${number}rem`;
200
+ type FontAndLineHeight = [FontValue, FontValue];
201
+ type DetailFont = [
202
+ FontValue,
203
+ FontSizeDetail
204
+ ];
205
+ type UnocssDetailFont = [FontValue, CamelToKebabKeys<FontSizeDetail>];
206
+ type FontSize = FontAndLineHeight | FontValue | DetailFont;
207
+ type UnocssFontSize = FontValue | FontAndLineHeight | UnocssDetailFont;
208
+ type SizeKeys = `${number}xs` | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | `${number}xl`;
209
+ type HeadingKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
210
+ type DisplayKeys = 'display1' | 'display2' | 'display3' | 'display4';
211
+ type FontSizeKeys = SizeKeys | HeadingKeys | DisplayKeys;
212
+ declare function isDetailFont(value: FontSize): value is DetailFont;
213
+ type FontSizes = {
214
+ [K in FontSizeKeys]?: FontSize;
215
+ };
216
+ type UnocssFontSizes = {
217
+ [K in FontSizeKeys]?: UnocssFontSize;
218
+ };
219
+
219
220
  declare const fontSizes: {
220
221
  '2xs': ["0.6875rem", "1rem"];
221
222
  xs: ["0.75rem", "1rem"];
@@ -463,7 +464,9 @@ declare const unocssTheme: {
463
464
  fontSize: UnocssFontSizes;
464
465
  };
465
466
 
466
- type ColorsNames = 'primary' | 'bateau' | 'secondary' | 'pompelmo' | 'green' | 'fuchsia' | 'indigo' | 'neutral' | 'orange' | 'red' | 'amber' | 'seafoam';
467
+ declare const colorsNames: readonly ["primary", "bateau", "secondary", "pompelmo", "green", "fuchsia", "indigo", "neutral", "orange", "red", "amber", "seafoam"];
468
+
469
+ type ColorsNames = typeof colorsNames[number];
467
470
  type ColorsVariations = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950;
468
471
  interface MainColors {
469
472
  black: string;
@@ -495,4 +498,4 @@ type Shadows = {
495
498
  declare function config(extend?: boolean): Partial<Config>;
496
499
  declare const _default: Partial<tailwindcss_types_config.Config>;
497
500
 
498
- export { type ColorString, type Colors, type ColorsNames, type FontSizes, type Shadows, colors, config, _default as default, customFontFamily as fontFamily, fontSizes, shadows, theme, unocssTheme };
501
+ export { type ColorString, type Colors, type ColorsNames, type FontSizes, type Shadows, type UnocssFontSizes, colors, colorsNames, config, _default as default, customFontFamily as fontFamily, fontSizes, isDetailFont, shadows, theme, unocssTheme };
package/dist/index.d.ts CHANGED
@@ -1,52 +1,6 @@
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
-
50
4
  declare const colors: {
51
5
  primary: {
52
6
  50: string;
@@ -216,6 +170,53 @@ declare const colors: {
216
170
  };
217
171
  };
218
172
 
173
+ /**
174
+ * Converts the given string from camel-case to kebab-case.
175
+ * @template T The string to convert the case.
176
+ * @see https://gist.github.com/albertms10/09f14ef7ebdc3ce0e95683c728616253
177
+ * @example
178
+ * type Kebab = CamelToKebab<'exampleVarName'>;
179
+ * // 'example-var-name'
180
+ */
181
+ type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${CamelToKebab<U>}` : `${Uncapitalize<T>}-${CamelToKebab<U>}` : '';
182
+ type CamelToKebabKeys<T> = {
183
+ [K in keyof T as K extends string ? CamelToKebab<K> : K]: T[K];
184
+ };
185
+
186
+ /**
187
+ * tailwindcss font-size configuration
188
+ * @see https://tailwindcss.com/docs/font-size
189
+ *
190
+ * @note For unocss, the keys are kebab-case
191
+ * @see https://github.com/unocss/unocss/issues/3663#issuecomment-2024909371
192
+ */
193
+
194
+ interface FontSizeDetail {
195
+ lineHeight?: string;
196
+ letterSpacing?: string;
197
+ fontWeight?: number;
198
+ }
199
+ type FontValue = `${number}px` | `${number}rem`;
200
+ type FontAndLineHeight = [FontValue, FontValue];
201
+ type DetailFont = [
202
+ FontValue,
203
+ FontSizeDetail
204
+ ];
205
+ type UnocssDetailFont = [FontValue, CamelToKebabKeys<FontSizeDetail>];
206
+ type FontSize = FontAndLineHeight | FontValue | DetailFont;
207
+ type UnocssFontSize = FontValue | FontAndLineHeight | UnocssDetailFont;
208
+ type SizeKeys = `${number}xs` | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | `${number}xl`;
209
+ type HeadingKeys = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
210
+ type DisplayKeys = 'display1' | 'display2' | 'display3' | 'display4';
211
+ type FontSizeKeys = SizeKeys | HeadingKeys | DisplayKeys;
212
+ declare function isDetailFont(value: FontSize): value is DetailFont;
213
+ type FontSizes = {
214
+ [K in FontSizeKeys]?: FontSize;
215
+ };
216
+ type UnocssFontSizes = {
217
+ [K in FontSizeKeys]?: UnocssFontSize;
218
+ };
219
+
219
220
  declare const fontSizes: {
220
221
  '2xs': ["0.6875rem", "1rem"];
221
222
  xs: ["0.75rem", "1rem"];
@@ -463,7 +464,9 @@ declare const unocssTheme: {
463
464
  fontSize: UnocssFontSizes;
464
465
  };
465
466
 
466
- type ColorsNames = 'primary' | 'bateau' | 'secondary' | 'pompelmo' | 'green' | 'fuchsia' | 'indigo' | 'neutral' | 'orange' | 'red' | 'amber' | 'seafoam';
467
+ declare const colorsNames: readonly ["primary", "bateau", "secondary", "pompelmo", "green", "fuchsia", "indigo", "neutral", "orange", "red", "amber", "seafoam"];
468
+
469
+ type ColorsNames = typeof colorsNames[number];
467
470
  type ColorsVariations = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950;
468
471
  interface MainColors {
469
472
  black: string;
@@ -495,4 +498,4 @@ type Shadows = {
495
498
  declare function config(extend?: boolean): Partial<Config>;
496
499
  declare const _default: Partial<tailwindcss_types_config.Config>;
497
500
 
498
- export { type ColorString, type Colors, type ColorsNames, type FontSizes, type Shadows, colors, config, _default as default, customFontFamily as fontFamily, fontSizes, shadows, theme, unocssTheme };
501
+ export { type ColorString, type Colors, type ColorsNames, type FontSizes, type Shadows, type UnocssFontSizes, colors, colorsNames, config, _default as default, customFontFamily as fontFamily, fontSizes, isDetailFont, shadows, theme, unocssTheme };
package/dist/index.js CHANGED
@@ -7,6 +7,22 @@ import {
7
7
  unocssTheme
8
8
  } from "./chunk-IUSDLEUF.js";
9
9
 
10
+ // src/constant/index.ts
11
+ var colorsNames = [
12
+ "primary",
13
+ "bateau",
14
+ "secondary",
15
+ "pompelmo",
16
+ "green",
17
+ "fuchsia",
18
+ "indigo",
19
+ "neutral",
20
+ "orange",
21
+ "red",
22
+ "amber",
23
+ "seafoam"
24
+ ];
25
+
10
26
  // src/index.ts
11
27
  function config(extend = true) {
12
28
  if (extend === false) {
@@ -23,6 +39,7 @@ function config(extend = true) {
23
39
  var src_default = config();
24
40
  export {
25
41
  colors,
42
+ colorsNames,
26
43
  config,
27
44
  src_default as default,
28
45
  customFontFamily as fontFamily,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@removify/tailwind-preset",
3
3
  "type": "module",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "description": "Tailwind CSS preset for Removify",
6
6
  "keywords": [
7
7
  "tailwind"
@@ -46,7 +46,7 @@
46
46
  "tsx": "^4.7.3",
47
47
  "typescript": "^5.4.5",
48
48
  "vitest": "^1.5.2",
49
- "@removify/tailwind-preset": "0.1.2"
49
+ "@removify/tailwind-preset": "0.1.4"
50
50
  },
51
51
  "lint-staged": {
52
52
  "**/*.{js,ts,vue,html}": [