@kyco-utils/enums 0.2.0 → 0.2.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 CHANGED
@@ -8,8 +8,6 @@ Shared runtime enums and their [Zod](https://zod.dev) schemas.
8
8
  pnpm add @kyco-utils/enums zod
9
9
  ```
10
10
 
11
- Requires `zod` v4 as a peer dependency. ESM only.
12
-
13
11
  ## Usage
14
12
 
15
13
  ```ts
package/dist/index.d.mts CHANGED
@@ -34,9 +34,10 @@ export declare const zColorMode: z.ZodEnum<{
34
34
  }>;
35
35
  export type ColorMode = z.infer<typeof zColorMode>;
36
36
  /**
37
- * Locales supported across kyco-utils, as [BCP 47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag)
38
- * language tags in the form `{language}-{region}`: an [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)
39
- * language code and an [ISO 3166-1](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) region code.
37
+ * Locales supported across kyco-utils. Uses [BCP 47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag)
38
+ * language tags in the form `{language}-{region}`, where `{language}` is an
39
+ * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code and
40
+ * `{region}` is an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
40
41
  *
41
42
  * @enum
42
43
  * @example
package/dist/index.mjs CHANGED
@@ -30,9 +30,10 @@ const ColorMode = {
30
30
  */
31
31
  const zColorMode = z.enum(ColorMode);
32
32
  /**
33
- * Locales supported across kyco-utils, as [BCP 47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag)
34
- * language tags in the form `{language}-{region}`: an [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)
35
- * language code and an [ISO 3166-1](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) region code.
33
+ * Locales supported across kyco-utils. Uses [BCP 47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag)
34
+ * language tags in the form `{language}-{region}`, where `{language}` is an
35
+ * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code and
36
+ * `{region}` is an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
36
37
  *
37
38
  * @enum
38
39
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import * as z from 'zod'\n\n// -------------------------------------------------------\n\n/**\n * Color modes a user can choose for the UI.\n *\n * @enum\n * @example\n * ```ts\n * import { ColorMode } from '@kyco-utils/enums'\n *\n * const mode: ColorMode = ColorMode.DARK // 'dark'\n * ```\n */\nexport const ColorMode = {\n SYSTEM: 'system',\n LIGHT: 'light',\n DARK: 'dark',\n} as const\n\n/**\n * Zod schema that validates a {@link ColorMode}.\n *\n * @group Schemas\n * @example\n * ```ts\n * import { zColorMode } from '@kyco-utils/enums'\n *\n * zColorMode.parse('dark') // 'dark'\n * zColorMode.safeParse('blue').success // false\n * ```\n */\nexport const zColorMode = z.enum(ColorMode)\n\nexport type ColorMode = z.infer<typeof zColorMode>\n\n// -------------------------------------------------------\n\n/**\n * Locales supported across kyco-utils, as [BCP 47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag)\n * language tags in the form `{language}-{region}`: an [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)\n * language code and an [ISO 3166-1](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) region code.\n *\n * @enum\n * @example\n * ```ts\n * import { UserLocale } from '@kyco-utils/enums'\n *\n * const locale: UserLocale = UserLocale.DE_DE // 'de-DE'\n * ```\n */\nexport const UserLocale = {\n // @locale-updates\n EN_GB: 'en-GB',\n DE_DE: 'de-DE',\n} as const\n\n/**\n * Zod schema that validates a {@link UserLocale}.\n *\n * @group Schemas\n * @example\n * ```ts\n * import { zUserLocale } from '@kyco-utils/enums'\n *\n * zUserLocale.parse('en-GB') // 'en-GB'\n * zUserLocale.safeParse('fr-FR').success // false\n * ```\n */\nexport const zUserLocale = z.enum(UserLocale)\n\nexport type UserLocale = z.infer<typeof zUserLocale>\n\n// -------------------------------------------------------\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAa,YAAY;CACvB,QAAQ;CACR,OAAO;CACP,MAAM;AACR;;;;;;;;;;;;;AAcA,MAAa,aAAa,EAAE,KAAK,SAAS;;;;;;;;;;;;;;AAmB1C,MAAa,aAAa;CAExB,OAAO;CACP,OAAO;AACT;;;;;;;;;;;;;AAcA,MAAa,cAAc,EAAE,KAAK,UAAU"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import * as z from 'zod'\n\n// -------------------------------------------------------\n\n/**\n * Color modes a user can choose for the UI.\n *\n * @enum\n * @example\n * ```ts\n * import { ColorMode } from '@kyco-utils/enums'\n *\n * const mode: ColorMode = ColorMode.DARK // 'dark'\n * ```\n */\nexport const ColorMode = {\n SYSTEM: 'system',\n LIGHT: 'light',\n DARK: 'dark',\n} as const\n\n/**\n * Zod schema that validates a {@link ColorMode}.\n *\n * @group Schemas\n * @example\n * ```ts\n * import { zColorMode } from '@kyco-utils/enums'\n *\n * zColorMode.parse('dark') // 'dark'\n * zColorMode.safeParse('blue').success // false\n * ```\n */\nexport const zColorMode = z.enum(ColorMode)\n\nexport type ColorMode = z.infer<typeof zColorMode>\n\n// -------------------------------------------------------\n\n/**\n * Locales supported across kyco-utils. Uses [BCP 47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag)\n * language tags in the form `{language}-{region}`, where `{language}` is an\n * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code and\n * `{region}` is an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.\n *\n * @enum\n * @example\n * ```ts\n * import { UserLocale } from '@kyco-utils/enums'\n *\n * const locale: UserLocale = UserLocale.DE_DE // 'de-DE'\n * ```\n */\nexport const UserLocale = {\n // @locale-updates\n EN_GB: 'en-GB',\n DE_DE: 'de-DE',\n} as const\n\n/**\n * Zod schema that validates a {@link UserLocale}.\n *\n * @group Schemas\n * @example\n * ```ts\n * import { zUserLocale } from '@kyco-utils/enums'\n *\n * zUserLocale.parse('en-GB') // 'en-GB'\n * zUserLocale.safeParse('fr-FR').success // false\n * ```\n */\nexport const zUserLocale = z.enum(UserLocale)\n\nexport type UserLocale = z.infer<typeof zUserLocale>\n\n// -------------------------------------------------------\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAa,YAAY;CACvB,QAAQ;CACR,OAAO;CACP,MAAM;AACR;;;;;;;;;;;;;AAcA,MAAa,aAAa,EAAE,KAAK,SAAS;;;;;;;;;;;;;;;AAoB1C,MAAa,aAAa;CAExB,OAAO;CACP,OAAO;AACT;;;;;;;;;;;;;AAcA,MAAa,cAAc,EAAE,KAAK,UAAU"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kyco-utils/enums",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Shared runtime enums and Zod schemas for kyco-utils.",
5
5
  "type": "module",
6
6
  "sideEffects": false,