@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 +0 -2
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
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
|
|
38
|
-
* language tags in the form `{language}-{region}
|
|
39
|
-
*
|
|
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
|
|
34
|
-
* language tags in the form `{language}-{region}
|
|
35
|
-
*
|
|
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
|
package/dist/index.mjs.map
CHANGED
|
@@ -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
|
|
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"}
|