@eduardoalvarez/arrecife 0.5.0 → 0.6.0

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 (66) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +706 -470
  3. package/dist/brand/index.cjs +112 -95
  4. package/dist/brand/index.d.cts +40 -39
  5. package/dist/brand/index.d.ts +40 -39
  6. package/dist/brand/index.js +5 -4
  7. package/dist/catalog-D13txprv.d.cts +78 -0
  8. package/dist/catalog-D13txprv.d.ts +78 -0
  9. package/dist/chart/index.cjs +100 -83
  10. package/dist/chart/index.d.cts +66 -66
  11. package/dist/chart/index.d.ts +66 -66
  12. package/dist/chart/index.js +14 -12
  13. package/dist/chunk-25YNFCIF.js +141 -0
  14. package/dist/{chunk-YZ2SDOVZ.js → chunk-6O3KWB6P.js} +30 -30
  15. package/dist/chunk-CKRSQPTX.js +36 -0
  16. package/dist/{chunk-ZEOQKRQ7.js → chunk-DKCN7BAL.js} +1 -1
  17. package/dist/chunk-GCRII2KQ.js +86 -0
  18. package/dist/chunk-JMOOFZ3B.js +42 -0
  19. package/dist/chunk-O4TAH7YJ.js +276 -0
  20. package/dist/chunk-ODBFN44D.js +45 -0
  21. package/dist/{chunk-VPT32GPG.js → chunk-PMN7NR3G.js} +2 -2
  22. package/dist/chunk-XKYHTOUJ.js +27 -0
  23. package/dist/form/index.cjs +109 -92
  24. package/dist/form/index.d.cts +43 -42
  25. package/dist/form/index.d.ts +43 -42
  26. package/dist/form/index.js +25 -23
  27. package/dist/index.cjs +1068 -929
  28. package/dist/index.d.cts +770 -773
  29. package/dist/index.d.ts +770 -773
  30. package/dist/index.js +629 -675
  31. package/dist/{label-DuTvJGxD.d.ts → label-MgHFKnFy.d.cts} +3 -3
  32. package/dist/{label-DuTvJGxD.d.cts → label-MgHFKnFy.d.ts} +3 -3
  33. package/dist/og/index.cjs +130 -130
  34. package/dist/og/index.d.cts +93 -89
  35. package/dist/og/index.d.ts +93 -89
  36. package/dist/og/index.js +106 -106
  37. package/dist/shiki/index.cjs +28 -30
  38. package/dist/shiki/index.d.cts +4 -4
  39. package/dist/shiki/index.d.ts +4 -4
  40. package/dist/shiki/index.js +12 -12
  41. package/dist/theme/index.cjs +97 -0
  42. package/dist/theme/index.d.cts +144 -0
  43. package/dist/theme/index.d.ts +144 -0
  44. package/dist/theme/index.js +2 -0
  45. package/dist/tokens/index.cjs +133 -86
  46. package/dist/tokens/index.d.cts +246 -161
  47. package/dist/tokens/index.d.ts +246 -161
  48. package/dist/tokens/index.js +2 -2
  49. package/dist/tokens/theme.css +133 -98
  50. package/dist/variants/index.cjs +192 -0
  51. package/dist/variants/index.d.cts +192 -0
  52. package/dist/variants/index.d.ts +192 -0
  53. package/dist/variants/index.js +3 -0
  54. package/llms.txt +810 -744
  55. package/package.json +20 -11
  56. package/dist/catalogo-Du5ID-Hi.d.cts +0 -77
  57. package/dist/catalogo-Du5ID-Hi.d.ts +0 -77
  58. package/dist/chunk-E3OMP2DL.js +0 -36
  59. package/dist/chunk-KPZNNMV5.js +0 -83
  60. package/dist/chunk-NHS7ETKJ.js +0 -27
  61. package/dist/chunk-TSPJOM6K.js +0 -229
  62. package/dist/chunk-UOWIDFCB.js +0 -81
  63. package/dist/tema/index.cjs +0 -94
  64. package/dist/tema/index.d.cts +0 -110
  65. package/dist/tema/index.d.ts +0 -110
  66. package/dist/tema/index.js +0 -2
@@ -1,7 +1,9 @@
1
- import { Label } from '../chunk-ZEOQKRQ7.js';
2
- import { Text } from '../chunk-UOWIDFCB.js';
3
- import { cn } from '../chunk-NHS7ETKJ.js';
4
- import '../chunk-TSPJOM6K.js';
1
+ 'use client';
2
+ import { Label } from '../chunk-DKCN7BAL.js';
3
+ import { Text } from '../chunk-JMOOFZ3B.js';
4
+ import '../chunk-ODBFN44D.js';
5
+ import { cn } from '../chunk-XKYHTOUJ.js';
6
+ import '../chunk-O4TAH7YJ.js';
5
7
  import '../chunk-MLKGABMK.js';
6
8
  import { createContext, useContext, useId } from 'react';
7
9
  import { FormProvider, Controller, useFormContext, useFormState } from 'react-hook-form';
@@ -9,24 +11,24 @@ import { Slot } from '@radix-ui/react-slot';
9
11
  import { jsx } from 'react/jsx-runtime';
10
12
 
11
13
  var Form = FormProvider;
12
- var Campo = createContext(null);
14
+ var Field = createContext(null);
13
15
  var Item = createContext(null);
14
16
  function FormField(props) {
15
- return /* @__PURE__ */ jsx(Campo.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
17
+ return /* @__PURE__ */ jsx(Field.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
16
18
  }
17
19
  function useFormField() {
18
- const campo = useContext(Campo);
20
+ const field = useContext(Field);
19
21
  const item = useContext(Item);
20
22
  const { getFieldState } = useFormContext();
21
- const estado = useFormState({ name: campo?.name ?? "" });
22
- if (!campo) throw new Error("useFormField se usa dentro de un <FormField>.");
23
- if (!item) throw new Error("useFormField se usa dentro de un <FormItem>.");
23
+ const state = useFormState({ name: field?.name ?? "" });
24
+ if (!field) throw new Error("useFormField must be used inside a <FormField>.");
25
+ if (!item) throw new Error("useFormField must be used inside a <FormItem>.");
24
26
  return {
25
- name: campo.name,
27
+ name: field.name,
26
28
  id: item.id,
27
- idDescripcion: `${item.id}-descripcion`,
28
- idMensaje: `${item.id}-mensaje`,
29
- ...getFieldState(campo.name, estado)
29
+ descriptionId: `${item.id}-descripcion`,
30
+ messageId: `${item.id}-mensaje`,
31
+ ...getFieldState(field.name, state)
30
32
  };
31
33
  }
32
34
  function FormItem({ className, ...props }) {
@@ -38,45 +40,45 @@ function FormLabel({ className, ...props }) {
38
40
  return /* @__PURE__ */ jsx(Label, { htmlFor: id, className, ...props });
39
41
  }
40
42
  function FormControl({ ...props }) {
41
- const { error, id, idDescripcion, idMensaje } = useFormField();
43
+ const { error, id, descriptionId, messageId } = useFormField();
42
44
  return /* @__PURE__ */ jsx(
43
45
  Slot,
44
46
  {
45
47
  id,
46
- "aria-describedby": error ? `${idDescripcion} ${idMensaje}` : idDescripcion,
48
+ "aria-describedby": error ? `${descriptionId} ${messageId}` : descriptionId,
47
49
  "aria-invalid": error ? true : void 0,
48
50
  ...props
49
51
  }
50
52
  );
51
53
  }
52
54
  function FormDescription({ className, ...props }) {
53
- const { idDescripcion } = useFormField();
55
+ const { descriptionId } = useFormField();
54
56
  return /* @__PURE__ */ jsx(
55
57
  Text,
56
58
  {
57
59
  as: "p",
58
60
  variant: "label",
59
61
  tone: "muted",
60
- id: idDescripcion,
62
+ id: descriptionId,
61
63
  className: cn("font-normal", className),
62
64
  ...props
63
65
  }
64
66
  );
65
67
  }
66
68
  function FormMessage({ className, children, ...props }) {
67
- const { error, idMensaje } = useFormField();
68
- const cuerpo = error?.message ? String(error.message) : children;
69
- if (!cuerpo) return null;
69
+ const { error, messageId } = useFormField();
70
+ const body = error?.message ? String(error.message) : children;
71
+ if (!body) return null;
70
72
  return /* @__PURE__ */ jsx(
71
73
  Text,
72
74
  {
73
75
  as: "p",
74
76
  variant: "label",
75
77
  tone: "error",
76
- id: idMensaje,
78
+ id: messageId,
77
79
  className,
78
80
  ...props,
79
- children: cuerpo
81
+ children: body
80
82
  }
81
83
  );
82
84
  }