@kyco-utils/enums 0.1.0 → 0.1.1

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/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # @kyco-utils/enums
2
+
3
+ A set of utilities for TS projects.
4
+
5
+ ## License
6
+
7
+ [MIT](LICENSE)
package/dist/index.cjs CHANGED
@@ -1,15 +1,44 @@
1
1
  'use strict';
2
2
 
3
- var zod = require('zod');
3
+ var z = require('zod');
4
+
5
+ function _interopNamespace(e) {
6
+ if (e && e.__esModule) return e;
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var z__namespace = /*#__PURE__*/_interopNamespace(z);
4
24
 
5
25
  // src/index.ts
26
+ var ColorMode = {
27
+ SYSTEM: "system",
28
+ LIGHT: "light",
29
+ DARK: "dark"
30
+ };
31
+ var zColorMode = z__namespace.enum([ColorMode.SYSTEM, ColorMode.LIGHT, ColorMode.DARK]);
6
32
  var UserLocale = {
33
+ // @locale-updates
7
34
  EN_GB: "en-GB",
8
35
  DE_DE: "de-DE"
9
36
  };
10
- var zUserLocale = zod.z.enum(UserLocale);
37
+ var zUserLocale = z__namespace.enum(UserLocale);
11
38
 
39
+ exports.ColorMode = ColorMode;
12
40
  exports.UserLocale = UserLocale;
41
+ exports.zColorMode = zColorMode;
13
42
  exports.zUserLocale = zUserLocale;
14
43
  //# sourceMappingURL=index.cjs.map
15
44
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["z"],"mappings":";;;;;AAKO,IAAM,UAAA,GAAa;AAAA,EACxB,KAAA,EAAO,OAAA;AAAA,EACP,KAAA,EAAO;AACT;AAKO,IAAM,WAAA,GAAcA,KAAA,CAAE,IAAA,CAAK,UAAU","file":"index.cjs","sourcesContent":["import { z } from 'zod'\n\n/**\n * Supported user locales as BCP 47 language tags.\n */\nexport const UserLocale = {\n EN_GB: 'en-GB',\n DE_DE: 'de-DE',\n} as const\n\n/**\n * Zod schema for {@link UserLocale}.\n */\nexport const zUserLocale = z.enum(UserLocale)\n\nexport type UserLocale = z.infer<typeof zUserLocale>\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["z"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOO,IAAM,SAAA,GAAY;AAAA,EACvB,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO,OAAA;AAAA,EACP,IAAA,EAAM;AACR;AAEO,IAAM,UAAA,GAAeA,kBAAK,CAAC,SAAA,CAAU,QAAQ,SAAA,CAAU,KAAA,EAAO,SAAA,CAAU,IAAI,CAAU;AAUtF,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,KAAA,EAAO,OAAA;AAAA,EACP,KAAA,EAAO;AACT;AAEO,IAAM,WAAA,GAAgBA,kBAAK,UAAU","file":"index.cjs","sourcesContent":["import * as z from 'zod'\n\n// -------------------------------------------------------\n\n/**\n * Supported color modes available.\n */\nexport const ColorMode = {\n SYSTEM: 'system',\n LIGHT: 'light',\n DARK: 'dark',\n} as const\n\nexport const zColorMode = z.enum([ColorMode.SYSTEM, ColorMode.LIGHT, ColorMode.DARK] as const)\n\nexport type ColorMode = z.infer<typeof zColorMode>\n\n// -------------------------------------------------------\n\n/**\n * Supported locales available. Follows [BCP 47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag) language tags,\n * i.e. generally in the format of `{ISO 639-1}-{ISO 3166-1}`.\n */\nexport const UserLocale = {\n // @locale-updates\n EN_GB: 'en-GB',\n DE_DE: 'de-DE',\n} as const\n\nexport const zUserLocale = z.enum(UserLocale)\n\nexport type UserLocale = z.infer<typeof zUserLocale>\n\n// -------------------------------------------------------\n"]}
package/dist/index.d.cts CHANGED
@@ -1,14 +1,26 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod';
2
2
 
3
+ declare const zColorMode: z.ZodEnum<{
4
+ system: "system";
5
+ light: "light";
6
+ dark: "dark";
7
+ }>;
3
8
  /**
4
- * Zod schema for {@link UserLocale}.
9
+ * Supported color modes available.
5
10
  */
11
+ declare const ColorMode: {
12
+ readonly SYSTEM: "system";
13
+ readonly LIGHT: "light";
14
+ readonly DARK: "dark";
15
+ };
16
+ type ColorMode = z.infer<typeof zColorMode>;
6
17
  declare const zUserLocale: z.ZodEnum<{
7
18
  readonly EN_GB: "en-GB";
8
19
  readonly DE_DE: "de-DE";
9
20
  }>;
10
21
  /**
11
- * Supported user locales as BCP 47 language tags.
22
+ * Supported locales available. Follows [BCP 47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag) language tags,
23
+ * i.e. generally in the format of `{ISO 639-1}-{ISO 3166-1}`.
12
24
  */
13
25
  declare const UserLocale: {
14
26
  readonly EN_GB: "en-GB";
@@ -16,4 +28,4 @@ declare const UserLocale: {
16
28
  };
17
29
  type UserLocale = z.infer<typeof zUserLocale>;
18
30
 
19
- export { UserLocale, zUserLocale };
31
+ export { ColorMode, UserLocale, zColorMode, zUserLocale };
package/dist/index.d.ts CHANGED
@@ -1,14 +1,26 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod';
2
2
 
3
+ declare const zColorMode: z.ZodEnum<{
4
+ system: "system";
5
+ light: "light";
6
+ dark: "dark";
7
+ }>;
3
8
  /**
4
- * Zod schema for {@link UserLocale}.
9
+ * Supported color modes available.
5
10
  */
11
+ declare const ColorMode: {
12
+ readonly SYSTEM: "system";
13
+ readonly LIGHT: "light";
14
+ readonly DARK: "dark";
15
+ };
16
+ type ColorMode = z.infer<typeof zColorMode>;
6
17
  declare const zUserLocale: z.ZodEnum<{
7
18
  readonly EN_GB: "en-GB";
8
19
  readonly DE_DE: "de-DE";
9
20
  }>;
10
21
  /**
11
- * Supported user locales as BCP 47 language tags.
22
+ * Supported locales available. Follows [BCP 47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag) language tags,
23
+ * i.e. generally in the format of `{ISO 639-1}-{ISO 3166-1}`.
12
24
  */
13
25
  declare const UserLocale: {
14
26
  readonly EN_GB: "en-GB";
@@ -16,4 +28,4 @@ declare const UserLocale: {
16
28
  };
17
29
  type UserLocale = z.infer<typeof zUserLocale>;
18
30
 
19
- export { UserLocale, zUserLocale };
31
+ export { ColorMode, UserLocale, zColorMode, zUserLocale };
package/dist/index.js CHANGED
@@ -1,12 +1,19 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod';
2
2
 
3
3
  // src/index.ts
4
+ var ColorMode = {
5
+ SYSTEM: "system",
6
+ LIGHT: "light",
7
+ DARK: "dark"
8
+ };
9
+ var zColorMode = z.enum([ColorMode.SYSTEM, ColorMode.LIGHT, ColorMode.DARK]);
4
10
  var UserLocale = {
11
+ // @locale-updates
5
12
  EN_GB: "en-GB",
6
13
  DE_DE: "de-DE"
7
14
  };
8
15
  var zUserLocale = z.enum(UserLocale);
9
16
 
10
- export { UserLocale, zUserLocale };
17
+ export { ColorMode, UserLocale, zColorMode, zUserLocale };
11
18
  //# sourceMappingURL=index.js.map
12
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAKO,IAAM,UAAA,GAAa;AAAA,EACxB,KAAA,EAAO,OAAA;AAAA,EACP,KAAA,EAAO;AACT;AAKO,IAAM,WAAA,GAAc,CAAA,CAAE,IAAA,CAAK,UAAU","file":"index.js","sourcesContent":["import { z } from 'zod'\n\n/**\n * Supported user locales as BCP 47 language tags.\n */\nexport const UserLocale = {\n EN_GB: 'en-GB',\n DE_DE: 'de-DE',\n} as const\n\n/**\n * Zod schema for {@link UserLocale}.\n */\nexport const zUserLocale = z.enum(UserLocale)\n\nexport type UserLocale = z.infer<typeof zUserLocale>\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAOO,IAAM,SAAA,GAAY;AAAA,EACvB,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO,OAAA;AAAA,EACP,IAAA,EAAM;AACR;AAEO,IAAM,UAAA,GAAe,OAAK,CAAC,SAAA,CAAU,QAAQ,SAAA,CAAU,KAAA,EAAO,SAAA,CAAU,IAAI,CAAU;AAUtF,IAAM,UAAA,GAAa;AAAA;AAAA,EAExB,KAAA,EAAO,OAAA;AAAA,EACP,KAAA,EAAO;AACT;AAEO,IAAM,WAAA,GAAgB,OAAK,UAAU","file":"index.js","sourcesContent":["import * as z from 'zod'\n\n// -------------------------------------------------------\n\n/**\n * Supported color modes available.\n */\nexport const ColorMode = {\n SYSTEM: 'system',\n LIGHT: 'light',\n DARK: 'dark',\n} as const\n\nexport const zColorMode = z.enum([ColorMode.SYSTEM, ColorMode.LIGHT, ColorMode.DARK] as const)\n\nexport type ColorMode = z.infer<typeof zColorMode>\n\n// -------------------------------------------------------\n\n/**\n * Supported locales available. Follows [BCP 47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag) language tags,\n * i.e. generally in the format of `{ISO 639-1}-{ISO 3166-1}`.\n */\nexport const UserLocale = {\n // @locale-updates\n EN_GB: 'en-GB',\n DE_DE: 'de-DE',\n} as const\n\nexport const zUserLocale = z.enum(UserLocale)\n\nexport type UserLocale = z.infer<typeof zUserLocale>\n\n// -------------------------------------------------------\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kyco-utils/enums",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Shared runtime enums and Zod schemas for kyco-utils.",
5
5
  "type": "module",
6
6
  "sideEffects": false,