lkd-web-kit 0.4.7 → 0.4.9

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.
Files changed (138) hide show
  1. package/dist/components/EmptyState/index.cjs +24 -12
  2. package/dist/components/EmptyState/index.js +24 -12
  3. package/dist/components/Icon.cjs +2 -3
  4. package/dist/components/Icon.js +2 -3
  5. package/dist/components/SelectInfinity/index.cjs +7 -4
  6. package/dist/components/SelectInfinity/index.js +7 -4
  7. package/dist/hooks/useZodConfig.cjs +2 -2
  8. package/dist/hooks/useZodConfig.js +2 -2
  9. package/dist/index.d.ts +4 -4
  10. package/package.json +7 -7
  11. package/dist/node_modules/zod/v4/classic/coerce.cjs +0 -28
  12. package/dist/node_modules/zod/v4/classic/coerce.js +0 -20
  13. package/dist/node_modules/zod/v4/classic/compat.cjs +0 -37
  14. package/dist/node_modules/zod/v4/classic/compat.js +0 -30
  15. package/dist/node_modules/zod/v4/classic/errors.cjs +0 -49
  16. package/dist/node_modules/zod/v4/classic/errors.js +0 -44
  17. package/dist/node_modules/zod/v4/classic/external.cjs +0 -231
  18. package/dist/node_modules/zod/v4/classic/external.js +0 -28
  19. package/dist/node_modules/zod/v4/classic/index.cjs +0 -10
  20. package/dist/node_modules/zod/v4/classic/index.js +0 -5
  21. package/dist/node_modules/zod/v4/classic/iso.cjs +0 -46
  22. package/dist/node_modules/zod/v4/classic/iso.js +0 -35
  23. package/dist/node_modules/zod/v4/classic/parse.cjs +0 -16
  24. package/dist/node_modules/zod/v4/classic/parse.js +0 -9
  25. package/dist/node_modules/zod/v4/classic/schemas.cjs +0 -1155
  26. package/dist/node_modules/zod/v4/classic/schemas.js +0 -1006
  27. package/dist/node_modules/zod/v4/core/api.cjs +0 -1016
  28. package/dist/node_modules/zod/v4/core/api.js +0 -903
  29. package/dist/node_modules/zod/v4/core/checks.cjs +0 -587
  30. package/dist/node_modules/zod/v4/core/checks.js +0 -562
  31. package/dist/node_modules/zod/v4/core/core.cjs +0 -72
  32. package/dist/node_modules/zod/v4/core/core.js +0 -63
  33. package/dist/node_modules/zod/v4/core/doc.cjs +0 -41
  34. package/dist/node_modules/zod/v4/core/doc.js +0 -37
  35. package/dist/node_modules/zod/v4/core/errors.cjs +0 -204
  36. package/dist/node_modules/zod/v4/core/errors.js +0 -194
  37. package/dist/node_modules/zod/v4/core/function.cjs +0 -81
  38. package/dist/node_modules/zod/v4/core/function.js +0 -76
  39. package/dist/node_modules/zod/v4/core/index.cjs +0 -261
  40. package/dist/node_modules/zod/v4/core/index.js +0 -20
  41. package/dist/node_modules/zod/v4/core/json-schema.cjs +0 -2
  42. package/dist/node_modules/zod/v4/core/json-schema.js +0 -1
  43. package/dist/node_modules/zod/v4/core/parse.cjs +0 -71
  44. package/dist/node_modules/zod/v4/core/parse.js +0 -60
  45. package/dist/node_modules/zod/v4/core/regexes.cjs +0 -139
  46. package/dist/node_modules/zod/v4/core/regexes.js +0 -95
  47. package/dist/node_modules/zod/v4/core/registries.cjs +0 -52
  48. package/dist/node_modules/zod/v4/core/registries.js +0 -44
  49. package/dist/node_modules/zod/v4/core/schemas.cjs +0 -1793
  50. package/dist/node_modules/zod/v4/core/schemas.js +0 -1720
  51. package/dist/node_modules/zod/v4/core/to-json-schema.cjs +0 -823
  52. package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -818
  53. package/dist/node_modules/zod/v4/core/util.cjs +0 -543
  54. package/dist/node_modules/zod/v4/core/util.js +0 -491
  55. package/dist/node_modules/zod/v4/core/versions.cjs +0 -11
  56. package/dist/node_modules/zod/v4/core/versions.js +0 -7
  57. package/dist/node_modules/zod/v4/index.cjs +0 -10
  58. package/dist/node_modules/zod/v4/index.js +0 -5
  59. package/dist/node_modules/zod/v4/locales/ar.cjs +0 -121
  60. package/dist/node_modules/zod/v4/locales/ar.js +0 -119
  61. package/dist/node_modules/zod/v4/locales/az.cjs +0 -120
  62. package/dist/node_modules/zod/v4/locales/az.js +0 -118
  63. package/dist/node_modules/zod/v4/locales/be.cjs +0 -169
  64. package/dist/node_modules/zod/v4/locales/be.js +0 -167
  65. package/dist/node_modules/zod/v4/locales/ca.cjs +0 -123
  66. package/dist/node_modules/zod/v4/locales/ca.js +0 -121
  67. package/dist/node_modules/zod/v4/locales/cs.cjs +0 -140
  68. package/dist/node_modules/zod/v4/locales/cs.js +0 -138
  69. package/dist/node_modules/zod/v4/locales/de.cjs +0 -121
  70. package/dist/node_modules/zod/v4/locales/de.js +0 -119
  71. package/dist/node_modules/zod/v4/locales/en.cjs +0 -125
  72. package/dist/node_modules/zod/v4/locales/en.js +0 -120
  73. package/dist/node_modules/zod/v4/locales/eo.cjs +0 -124
  74. package/dist/node_modules/zod/v4/locales/eo.js +0 -119
  75. package/dist/node_modules/zod/v4/locales/es.cjs +0 -122
  76. package/dist/node_modules/zod/v4/locales/es.js +0 -120
  77. package/dist/node_modules/zod/v4/locales/fa.cjs +0 -127
  78. package/dist/node_modules/zod/v4/locales/fa.js +0 -125
  79. package/dist/node_modules/zod/v4/locales/fi.cjs +0 -127
  80. package/dist/node_modules/zod/v4/locales/fi.js +0 -125
  81. package/dist/node_modules/zod/v4/locales/fr-CA.cjs +0 -122
  82. package/dist/node_modules/zod/v4/locales/fr-CA.js +0 -120
  83. package/dist/node_modules/zod/v4/locales/fr.cjs +0 -121
  84. package/dist/node_modules/zod/v4/locales/fr.js +0 -119
  85. package/dist/node_modules/zod/v4/locales/he.cjs +0 -122
  86. package/dist/node_modules/zod/v4/locales/he.js +0 -120
  87. package/dist/node_modules/zod/v4/locales/hu.cjs +0 -122
  88. package/dist/node_modules/zod/v4/locales/hu.js +0 -120
  89. package/dist/node_modules/zod/v4/locales/id.cjs +0 -121
  90. package/dist/node_modules/zod/v4/locales/id.js +0 -119
  91. package/dist/node_modules/zod/v4/locales/index.cjs +0 -85
  92. package/dist/node_modules/zod/v4/locales/index.js +0 -39
  93. package/dist/node_modules/zod/v4/locales/it.cjs +0 -122
  94. package/dist/node_modules/zod/v4/locales/it.js +0 -120
  95. package/dist/node_modules/zod/v4/locales/ja.cjs +0 -120
  96. package/dist/node_modules/zod/v4/locales/ja.js +0 -118
  97. package/dist/node_modules/zod/v4/locales/kh.cjs +0 -122
  98. package/dist/node_modules/zod/v4/locales/kh.js +0 -120
  99. package/dist/node_modules/zod/v4/locales/ko.cjs +0 -126
  100. package/dist/node_modules/zod/v4/locales/ko.js +0 -124
  101. package/dist/node_modules/zod/v4/locales/mk.cjs +0 -123
  102. package/dist/node_modules/zod/v4/locales/mk.js +0 -121
  103. package/dist/node_modules/zod/v4/locales/ms.cjs +0 -121
  104. package/dist/node_modules/zod/v4/locales/ms.js +0 -119
  105. package/dist/node_modules/zod/v4/locales/nl.cjs +0 -122
  106. package/dist/node_modules/zod/v4/locales/nl.js +0 -120
  107. package/dist/node_modules/zod/v4/locales/no.cjs +0 -121
  108. package/dist/node_modules/zod/v4/locales/no.js +0 -119
  109. package/dist/node_modules/zod/v4/locales/ota.cjs +0 -122
  110. package/dist/node_modules/zod/v4/locales/ota.js +0 -120
  111. package/dist/node_modules/zod/v4/locales/pl.cjs +0 -122
  112. package/dist/node_modules/zod/v4/locales/pl.js +0 -120
  113. package/dist/node_modules/zod/v4/locales/ps.cjs +0 -127
  114. package/dist/node_modules/zod/v4/locales/ps.js +0 -125
  115. package/dist/node_modules/zod/v4/locales/pt.cjs +0 -121
  116. package/dist/node_modules/zod/v4/locales/pt.js +0 -119
  117. package/dist/node_modules/zod/v4/locales/ru.cjs +0 -169
  118. package/dist/node_modules/zod/v4/locales/ru.js +0 -167
  119. package/dist/node_modules/zod/v4/locales/sl.cjs +0 -122
  120. package/dist/node_modules/zod/v4/locales/sl.js +0 -120
  121. package/dist/node_modules/zod/v4/locales/sv.cjs +0 -123
  122. package/dist/node_modules/zod/v4/locales/sv.js +0 -121
  123. package/dist/node_modules/zod/v4/locales/ta.cjs +0 -122
  124. package/dist/node_modules/zod/v4/locales/ta.js +0 -120
  125. package/dist/node_modules/zod/v4/locales/th.cjs +0 -122
  126. package/dist/node_modules/zod/v4/locales/th.js +0 -120
  127. package/dist/node_modules/zod/v4/locales/tr.cjs +0 -123
  128. package/dist/node_modules/zod/v4/locales/tr.js +0 -118
  129. package/dist/node_modules/zod/v4/locales/ua.cjs +0 -122
  130. package/dist/node_modules/zod/v4/locales/ua.js +0 -120
  131. package/dist/node_modules/zod/v4/locales/ur.cjs +0 -122
  132. package/dist/node_modules/zod/v4/locales/ur.js +0 -120
  133. package/dist/node_modules/zod/v4/locales/vi.cjs +0 -121
  134. package/dist/node_modules/zod/v4/locales/vi.js +0 -119
  135. package/dist/node_modules/zod/v4/locales/zh-CN.cjs +0 -121
  136. package/dist/node_modules/zod/v4/locales/zh-CN.js +0 -119
  137. package/dist/node_modules/zod/v4/locales/zh-TW.cjs +0 -122
  138. package/dist/node_modules/zod/v4/locales/zh-TW.js +0 -120
@@ -3,26 +3,26 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const jsxRuntime = require('react/jsx-runtime');
6
- const clsx = require('clsx');
7
6
  const Icon = require('../Icon.cjs');
7
+ const core = require('@mantine/core');
8
8
 
9
9
  const pxBySize = {
10
10
  sm: 48,
11
11
  md: 60,
12
12
  lg: 84
13
13
  };
14
- const EmptyState = ({
15
- label,
16
- action,
17
- icon,
18
- className,
19
- size = "md",
20
- ...props
21
- }) => {
14
+ const EmptyState = ({ label, action, icon, size = "md", ...props }) => {
15
+ const { colors } = core.useMantineTheme();
22
16
  return /* @__PURE__ */ jsxRuntime.jsxs(
23
17
  "div",
24
18
  {
25
- className: clsx("justfiy-center flex flex-col items-center gap-1", className),
19
+ style: {
20
+ display: "flex",
21
+ flexDirection: "column",
22
+ alignItems: "center",
23
+ justifyContent: "center",
24
+ gap: 4
25
+ },
26
26
  ...props,
27
27
  children: [
28
28
  icon && /* @__PURE__ */ jsxRuntime.jsx(
@@ -30,10 +30,22 @@ const EmptyState = ({
30
30
  {
31
31
  i: icon,
32
32
  size: pxBySize[size],
33
- className: "text-gray-2"
33
+ style: {
34
+ color: colors.gray[2]
35
+ }
36
+ }
37
+ ),
38
+ /* @__PURE__ */ jsxRuntime.jsx(
39
+ core.Text,
40
+ {
41
+ c: "gray.6",
42
+ style: {
43
+ fontSize: 14,
44
+ fontWeight: 600
45
+ },
46
+ children: label
34
47
  }
35
48
  ),
36
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-6 text-sm font-semibold", children: label }),
37
49
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: action })
38
50
  ]
39
51
  }
@@ -1,24 +1,24 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import clsx from 'clsx';
3
2
  import { Icon } from '../Icon.js';
3
+ import { useMantineTheme, Text } from '@mantine/core';
4
4
 
5
5
  const pxBySize = {
6
6
  sm: 48,
7
7
  md: 60,
8
8
  lg: 84
9
9
  };
10
- const EmptyState = ({
11
- label,
12
- action,
13
- icon,
14
- className,
15
- size = "md",
16
- ...props
17
- }) => {
10
+ const EmptyState = ({ label, action, icon, size = "md", ...props }) => {
11
+ const { colors } = useMantineTheme();
18
12
  return /* @__PURE__ */ jsxs(
19
13
  "div",
20
14
  {
21
- className: clsx("justfiy-center flex flex-col items-center gap-1", className),
15
+ style: {
16
+ display: "flex",
17
+ flexDirection: "column",
18
+ alignItems: "center",
19
+ justifyContent: "center",
20
+ gap: 4
21
+ },
22
22
  ...props,
23
23
  children: [
24
24
  icon && /* @__PURE__ */ jsx(
@@ -26,10 +26,22 @@ const EmptyState = ({
26
26
  {
27
27
  i: icon,
28
28
  size: pxBySize[size],
29
- className: "text-gray-2"
29
+ style: {
30
+ color: colors.gray[2]
31
+ }
32
+ }
33
+ ),
34
+ /* @__PURE__ */ jsx(
35
+ Text,
36
+ {
37
+ c: "gray.6",
38
+ style: {
39
+ fontSize: 14,
40
+ fontWeight: 600
41
+ },
42
+ children: label
30
43
  }
31
44
  ),
32
- /* @__PURE__ */ jsx("p", { className: "text-gray-6 text-sm font-semibold", children: label }),
33
45
  /* @__PURE__ */ jsx("div", { children: action })
34
46
  ]
35
47
  }
@@ -4,9 +4,8 @@
4
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
 
6
6
  const jsxRuntime = require('react/jsx-runtime');
7
- const clsx = require('clsx');
8
7
 
9
- const Icon = ({ i: I, size = "md", style, rotate, className, ...rest }) => {
8
+ const Icon = ({ i: I, size = "md", style, rotate, ...rest }) => {
10
9
  return /* @__PURE__ */ jsxRuntime.jsx(
11
10
  I,
12
11
  {
@@ -17,9 +16,9 @@ const Icon = ({ i: I, size = "md", style, rotate, className, ...rest }) => {
17
16
  viewBox: "0 0 24 24",
18
17
  style: {
19
18
  ...style,
19
+ flexShrink: 0,
20
20
  transform: `rotate(${rotate}deg)`
21
21
  },
22
- className: clsx("shrink-0", className),
23
22
  ...rest
24
23
  }
25
24
  );
@@ -1,8 +1,7 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import clsx from 'clsx';
4
3
 
5
- const Icon = ({ i: I, size = "md", style, rotate, className, ...rest }) => {
4
+ const Icon = ({ i: I, size = "md", style, rotate, ...rest }) => {
6
5
  return /* @__PURE__ */ jsx(
7
6
  I,
8
7
  {
@@ -13,9 +12,9 @@ const Icon = ({ i: I, size = "md", style, rotate, className, ...rest }) => {
13
12
  viewBox: "0 0 24 24",
14
13
  style: {
15
14
  ...style,
15
+ flexShrink: 0,
16
16
  transform: `rotate(${rotate}deg)`
17
17
  },
18
- className: clsx("shrink-0", className),
19
18
  ...rest
20
19
  }
21
20
  );
@@ -120,7 +120,9 @@ function InfinitySelect({
120
120
  core.Combobox.Options,
121
121
  {
122
122
  mah: 200,
123
- className: "overflow-y-auto",
123
+ style: {
124
+ overflowY: "auto"
125
+ },
124
126
  ref: scrollRef,
125
127
  children: [
126
128
  data.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { ...virtualStyles.getVirtualContainerProps(virtualizer), children: virtualizer.getVirtualItems().map((virtualItem) => {
@@ -139,15 +141,16 @@ function InfinitySelect({
139
141
  },
140
142
  renderOption ? renderOption({ option }) : getOptionLabel(option)
141
143
  );
142
- }) }) : !infinity.isFetching ? /* @__PURE__ */ jsxRuntime.jsx(core.Combobox.Empty, { className: "min-h-6", children: nothingFoundMessage ? typeof nothingFoundMessage === "function" ? nothingFoundMessage({ combobox }) : nothingFoundMessage : "No hay resultados" }) : null,
144
+ }) }) : !infinity.isFetching ? /* @__PURE__ */ jsxRuntime.jsx(core.Combobox.Empty, { mih: 24, children: nothingFoundMessage ? typeof nothingFoundMessage === "function" ? nothingFoundMessage({ combobox }) : nothingFoundMessage : "No hay resultados" }) : null,
143
145
  /* @__PURE__ */ jsxRuntime.jsx(
144
146
  index$1.InfinityLoader,
145
147
  {
146
148
  root: scrollRef,
147
149
  infinity,
148
150
  loaderProps: {
149
- size: "sm",
150
- className: "mt-1 mb-2"
151
+ mt: 4,
152
+ mb: 8,
153
+ size: "sm"
151
154
  }
152
155
  }
153
156
  )
@@ -116,7 +116,9 @@ function InfinitySelect({
116
116
  Combobox.Options,
117
117
  {
118
118
  mah: 200,
119
- className: "overflow-y-auto",
119
+ style: {
120
+ overflowY: "auto"
121
+ },
120
122
  ref: scrollRef,
121
123
  children: [
122
124
  data.length > 0 ? /* @__PURE__ */ jsx("div", { ...getVirtualContainerProps(virtualizer), children: virtualizer.getVirtualItems().map((virtualItem) => {
@@ -135,15 +137,16 @@ function InfinitySelect({
135
137
  },
136
138
  renderOption ? renderOption({ option }) : getOptionLabel(option)
137
139
  );
138
- }) }) : !infinity.isFetching ? /* @__PURE__ */ jsx(Combobox.Empty, { className: "min-h-6", children: nothingFoundMessage ? typeof nothingFoundMessage === "function" ? nothingFoundMessage({ combobox }) : nothingFoundMessage : "No hay resultados" }) : null,
140
+ }) }) : !infinity.isFetching ? /* @__PURE__ */ jsx(Combobox.Empty, { mih: 24, children: nothingFoundMessage ? typeof nothingFoundMessage === "function" ? nothingFoundMessage({ combobox }) : nothingFoundMessage : "No hay resultados" }) : null,
139
141
  /* @__PURE__ */ jsx(
140
142
  InfinityLoader,
141
143
  {
142
144
  root: scrollRef,
143
145
  infinity,
144
146
  loaderProps: {
145
- size: "sm",
146
- className: "mt-1 mb-2"
147
+ mt: 4,
148
+ mb: 8,
149
+ size: "sm"
147
150
  }
148
151
  }
149
152
  )
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const React = require('react');
6
- const external = require('../node_modules/zod/v4/classic/external.cjs');
6
+ const z = require('zod');
7
7
 
8
8
  const useZodConfig = () => {
9
9
  React.useEffect(() => {
10
- external.config({
10
+ z.config({
11
11
  customError: (iss) => {
12
12
  if (iss.code === "too_small")
13
13
  return iss.minimum === 1 ? `Campo requerido` : `Minimo ${iss.minimum} caracteres`;
@@ -1,9 +1,9 @@
1
1
  import { useEffect } from 'react';
2
- import * as external from '../node_modules/zod/v4/classic/external.js';
2
+ import z from 'zod';
3
3
 
4
4
  const useZodConfig = () => {
5
5
  useEffect(() => {
6
- external.config({
6
+ z.config({
7
7
  customError: (iss) => {
8
8
  if (iss.code === "too_small")
9
9
  return iss.minimum === 1 ? `Campo requerido` : `Minimo ${iss.minimum} caracteres`;
package/dist/index.d.ts CHANGED
@@ -45,8 +45,8 @@ import { TextInputProps } from '@mantine/core';
45
45
  import { TimeInputProps } from '@mantine/dates';
46
46
  import { UseFormReturn } from 'react-hook-form';
47
47
  import { VirtualItem } from '@tanstack/react-virtual';
48
- import { z } from 'zod/v4';
49
- import { ZodType } from 'zod/v4';
48
+ import { z } from 'zod';
49
+ import { ZodType } from 'zod';
50
50
 
51
51
  export declare const addBodyJsonHook: BeforeErrorHook;
52
52
 
@@ -86,7 +86,7 @@ export declare interface EmptyProps extends ComponentProps<'div'> {
86
86
  size?: keyof typeof pxBySize;
87
87
  }
88
88
 
89
- export declare const EmptyState: ({ label, action, icon, className, size, ...props }: EmptyProps) => JSX.Element;
89
+ export declare const EmptyState: ({ label, action, icon, size, ...props }: EmptyProps) => JSX.Element;
90
90
 
91
91
  declare type ExtractPathParams<T extends string> = T extends `${string}:${infer Param}/${infer Rest}` ? {
92
92
  [K in Param | keyof ExtractPathParams<`/${Rest}`>]: string | number;
@@ -257,7 +257,7 @@ export declare enum HttpStatus {
257
257
  NetworkAuthenticationRequired = 511
258
258
  }
259
259
 
260
- export declare const Icon: ({ i: I, size, style, rotate, className, ...rest }: IconProps) => JSX.Element;
260
+ export declare const Icon: ({ i: I, size, style, rotate, ...rest }: IconProps) => JSX.Element;
261
261
 
262
262
  export declare type IconFC = default_2.FC<ComponentPropsWithoutRef<'svg'>>;
263
263
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkd-web-kit",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "description": "A template for creating React component libraries with Vite.",
5
5
  "author": "LKD",
6
6
  "license": "MIT",
@@ -53,11 +53,11 @@
53
53
  "vitest": "^3.2.4"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mantine/core": "^8.1.2",
57
- "@mantine/dates": "^8.1.2",
58
- "@mantine/hooks": "^8.1.2",
59
- "@mantine/notifications": "^8.1.2",
60
- "@tanstack/react-query": "^5.81.5",
56
+ "@mantine/core": "^8.1.3",
57
+ "@mantine/dates": "^8.1.3",
58
+ "@mantine/hooks": "^8.1.3",
59
+ "@mantine/notifications": "^8.1.3",
60
+ "@tanstack/react-query": "^5.83.0",
61
61
  "clsx": "^2.1.1",
62
62
  "ky": "^1.8.1",
63
63
  "next": "^15.3.5",
@@ -65,7 +65,7 @@
65
65
  "react-dom": "^19.1.0",
66
66
  "react-hook-form": "^7.60.0",
67
67
  "react-query-kit": "^3.3.1",
68
- "zod": "^3.25.74"
68
+ "zod": "^4.0.5"
69
69
  },
70
70
  "dependencies": {
71
71
  "@tanstack/react-virtual": "^3.13.12"
@@ -1,28 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
-
5
- const schemas = require('./schemas.cjs');
6
- const api = require('../core/api.cjs');
7
-
8
- function string(params) {
9
- return api._coercedString(schemas.ZodString, params);
10
- }
11
- function number(params) {
12
- return api._coercedNumber(schemas.ZodNumber, params);
13
- }
14
- function boolean(params) {
15
- return api._coercedBoolean(schemas.ZodBoolean, params);
16
- }
17
- function bigint(params) {
18
- return api._coercedBigint(schemas.ZodBigInt, params);
19
- }
20
- function date(params) {
21
- return api._coercedDate(schemas.ZodDate, params);
22
- }
23
-
24
- exports.bigint = bigint;
25
- exports.boolean = boolean;
26
- exports.date = date;
27
- exports.number = number;
28
- exports.string = string;
@@ -1,20 +0,0 @@
1
- import { ZodString, ZodNumber, ZodBoolean, ZodBigInt, ZodDate } from './schemas.js';
2
- import { _coercedString, _coercedNumber, _coercedBoolean, _coercedBigint, _coercedDate } from '../core/api.js';
3
-
4
- function string(params) {
5
- return _coercedString(ZodString, params);
6
- }
7
- function number(params) {
8
- return _coercedNumber(ZodNumber, params);
9
- }
10
- function boolean(params) {
11
- return _coercedBoolean(ZodBoolean, params);
12
- }
13
- function bigint(params) {
14
- return _coercedBigint(ZodBigInt, params);
15
- }
16
- function date(params) {
17
- return _coercedDate(ZodDate, params);
18
- }
19
-
20
- export { bigint, boolean, date, number, string };
@@ -1,37 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
-
5
- const core = require('../core/core.cjs');
6
-
7
- // Zod 3 compat layer
8
- /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
9
- const ZodIssueCode = {
10
- invalid_type: "invalid_type",
11
- too_big: "too_big",
12
- too_small: "too_small",
13
- invalid_format: "invalid_format",
14
- not_multiple_of: "not_multiple_of",
15
- unrecognized_keys: "unrecognized_keys",
16
- invalid_union: "invalid_union",
17
- invalid_key: "invalid_key",
18
- invalid_element: "invalid_element",
19
- invalid_value: "invalid_value",
20
- custom: "custom",
21
- };
22
- /** @deprecated Use `z.config(params)` instead. */
23
- function setErrorMap(map) {
24
- core.config({
25
- customError: map,
26
- });
27
- }
28
- /** @deprecated Use `z.config()` instead. */
29
- function getErrorMap() {
30
- return core.config().customError;
31
- }
32
-
33
- exports.$brand = core.$brand;
34
- exports.config = core.config;
35
- exports.ZodIssueCode = ZodIssueCode;
36
- exports.getErrorMap = getErrorMap;
37
- exports.setErrorMap = setErrorMap;
@@ -1,30 +0,0 @@
1
- import { config } from '../core/core.js';
2
- export { $brand } from '../core/core.js';
3
-
4
- // Zod 3 compat layer
5
- /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
6
- const ZodIssueCode = {
7
- invalid_type: "invalid_type",
8
- too_big: "too_big",
9
- too_small: "too_small",
10
- invalid_format: "invalid_format",
11
- not_multiple_of: "not_multiple_of",
12
- unrecognized_keys: "unrecognized_keys",
13
- invalid_union: "invalid_union",
14
- invalid_key: "invalid_key",
15
- invalid_element: "invalid_element",
16
- invalid_value: "invalid_value",
17
- custom: "custom",
18
- };
19
- /** @deprecated Use `z.config(params)` instead. */
20
- function setErrorMap(map) {
21
- config({
22
- customError: map,
23
- });
24
- }
25
- /** @deprecated Use `z.config()` instead. */
26
- function getErrorMap() {
27
- return config().customError;
28
- }
29
-
30
- export { ZodIssueCode, config, getErrorMap, setErrorMap };
@@ -1,49 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
-
5
- const errors = require('../core/errors.cjs');
6
- const core = require('../core/core.cjs');
7
-
8
- const initializer = (inst, issues) => {
9
- errors.$ZodError.init(inst, issues);
10
- inst.name = "ZodError";
11
- Object.defineProperties(inst, {
12
- format: {
13
- value: (mapper) => errors.formatError(inst, mapper),
14
- // enumerable: false,
15
- },
16
- flatten: {
17
- value: (mapper) => errors.flattenError(inst, mapper),
18
- // enumerable: false,
19
- },
20
- addIssue: {
21
- value: (issue) => inst.issues.push(issue),
22
- // enumerable: false,
23
- },
24
- addIssues: {
25
- value: (issues) => inst.issues.push(...issues),
26
- // enumerable: false,
27
- },
28
- isEmpty: {
29
- get() {
30
- return inst.issues.length === 0;
31
- },
32
- // enumerable: false,
33
- },
34
- });
35
- // Object.defineProperty(inst, "isEmpty", {
36
- // get() {
37
- // return inst.issues.length === 0;
38
- // },
39
- // });
40
- };
41
- const ZodError = core.$constructor("ZodError", initializer);
42
- const ZodRealError = core.$constructor("ZodError", initializer, {
43
- Parent: Error,
44
- });
45
- // /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */
46
- // export type ErrorMapCtx = core.$ZodErrorMapCtx;
47
-
48
- exports.ZodError = ZodError;
49
- exports.ZodRealError = ZodRealError;
@@ -1,44 +0,0 @@
1
- import { $ZodError, flattenError, formatError } from '../core/errors.js';
2
- import { $constructor } from '../core/core.js';
3
-
4
- const initializer = (inst, issues) => {
5
- $ZodError.init(inst, issues);
6
- inst.name = "ZodError";
7
- Object.defineProperties(inst, {
8
- format: {
9
- value: (mapper) => formatError(inst, mapper),
10
- // enumerable: false,
11
- },
12
- flatten: {
13
- value: (mapper) => flattenError(inst, mapper),
14
- // enumerable: false,
15
- },
16
- addIssue: {
17
- value: (issue) => inst.issues.push(issue),
18
- // enumerable: false,
19
- },
20
- addIssues: {
21
- value: (issues) => inst.issues.push(...issues),
22
- // enumerable: false,
23
- },
24
- isEmpty: {
25
- get() {
26
- return inst.issues.length === 0;
27
- },
28
- // enumerable: false,
29
- },
30
- });
31
- // Object.defineProperty(inst, "isEmpty", {
32
- // get() {
33
- // return inst.issues.length === 0;
34
- // },
35
- // });
36
- };
37
- const ZodError = $constructor("ZodError", initializer);
38
- const ZodRealError = $constructor("ZodError", initializer, {
39
- Parent: Error,
40
- });
41
- // /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */
42
- // export type ErrorMapCtx = core.$ZodErrorMapCtx;
43
-
44
- export { ZodError, ZodRealError };