@szum-tech/design-system 2.5.1 → 2.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 (55) hide show
  1. package/dist/{chunk-75T7KAAY.js → chunk-36YD6ICC.js} +2 -2
  2. package/dist/chunk-3WSQRFUY.cjs +11 -0
  3. package/dist/chunk-5RNHEHRL.js +996 -0
  4. package/dist/chunk-7EYMOUWG.cjs +51 -0
  5. package/dist/{chunk-MOOWZNA6.js → chunk-7V34QHYR.js} +3 -3
  6. package/dist/chunk-AIXT3Q3I.cjs +1043 -0
  7. package/dist/chunk-DFD2WUOU.js +27 -0
  8. package/dist/chunk-EW6TE3N5.cjs +38 -0
  9. package/dist/{chunk-BJ553XYM.cjs → chunk-G6VXQ7DJ.cjs} +3 -3
  10. package/dist/chunk-H5O5L6XT.js +14 -0
  11. package/dist/{chunk-3PV6NLP5.js → chunk-IAI7BIAG.js} +3 -3
  12. package/dist/{chunk-XKXP3W3H.cjs → chunk-K4TRAPRN.cjs} +3 -3
  13. package/dist/{chunk-4C7M4HBP.js → chunk-MI3CQBHC.js} +3 -3
  14. package/dist/{chunk-KXTNZ4UO.cjs → chunk-NHFHKMX2.cjs} +3 -3
  15. package/dist/{chunk-6L3QPLRR.cjs → chunk-OIWEXHFE.cjs} +3 -3
  16. package/dist/chunk-P5IUC7HJ.js +9 -0
  17. package/dist/{chunk-WMMJEZ7Y.js → chunk-YJFJLF7Y.js} +3 -3
  18. package/dist/{chunk-FPK72OV4.cjs → chunk-ZZ3EBGSD.cjs} +2 -2
  19. package/dist/components/badge/index.cjs +2 -2
  20. package/dist/components/badge/index.js +1 -1
  21. package/dist/components/button/index.cjs +2 -2
  22. package/dist/components/button/index.js +1 -1
  23. package/dist/components/form/index.cjs +20 -17
  24. package/dist/components/form/index.js +13 -10
  25. package/dist/components/index.cjs +147 -64
  26. package/dist/components/index.d.cts +3 -0
  27. package/dist/components/index.d.ts +3 -0
  28. package/dist/components/index.js +13 -10
  29. package/dist/components/input/index.cjs +2 -2
  30. package/dist/components/input/index.js +1 -1
  31. package/dist/components/select/index.cjs +3 -3
  32. package/dist/components/select/index.js +1 -1
  33. package/dist/components/spinner/index.cjs +11 -0
  34. package/dist/components/spinner/index.d.cts +7 -0
  35. package/dist/components/spinner/index.d.ts +7 -0
  36. package/dist/components/spinner/index.js +2 -0
  37. package/dist/components/stepper/index.cjs +102 -0
  38. package/dist/components/stepper/index.d.cts +162 -0
  39. package/dist/components/stepper/index.d.ts +162 -0
  40. package/dist/components/stepper/index.js +21 -0
  41. package/dist/components/textarea/index.cjs +2 -2
  42. package/dist/components/textarea/index.js +1 -1
  43. package/dist/contexts/index.cjs +18 -0
  44. package/dist/contexts/index.d.cts +11 -0
  45. package/dist/contexts/index.d.ts +11 -0
  46. package/dist/contexts/index.js +1 -0
  47. package/dist/hooks/index.cjs +18 -0
  48. package/dist/hooks/index.d.cts +14 -0
  49. package/dist/hooks/index.d.ts +14 -0
  50. package/dist/hooks/index.js +1 -0
  51. package/dist/icons/index.d.cts +3 -0
  52. package/dist/icons/index.d.ts +3 -0
  53. package/package.json +22 -1
  54. package/dist/chunk-DH5YKYXV.cjs +0 -116
  55. package/dist/chunk-SPCZ3GVM.js +0 -88
@@ -1,88 +0,0 @@
1
- import { HelperText } from './chunk-5PBHBOXI.js';
2
- import { Label } from './chunk-VZKTT6CG.js';
3
- import { useFormContext, FormProvider, Controller } from 'react-hook-form';
4
- import * as React2 from 'react';
5
- import { twMerge } from 'tailwind-merge';
6
- import { jsx, jsxs } from 'react/jsx-runtime';
7
- import { Slot } from '@radix-ui/react-slot';
8
-
9
- var Form = FormProvider;
10
- var FormItemContext = React2.createContext({});
11
- var FormItem = React2.forwardRef(function({ className, ...props }, ref) {
12
- const id = React2.useId();
13
- return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { ref, className: twMerge("space-y-2", className), ...props }) });
14
- });
15
- FormItem.displayName = "FormItem";
16
- var FormFieldContext = React2.createContext({});
17
- var FormField = ({
18
- ...props
19
- }) => {
20
- return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
21
- };
22
- var useFormField = () => {
23
- const fieldContext = React2.useContext(FormFieldContext);
24
- const itemContext = React2.useContext(FormItemContext);
25
- const { getFieldState, formState } = useFormContext();
26
- const fieldState = getFieldState(fieldContext.name, formState);
27
- if (!fieldContext) {
28
- throw new Error("useFormField should be used within <FormField>");
29
- }
30
- const { id } = itemContext;
31
- return {
32
- id,
33
- name: fieldContext.name,
34
- formItemId: `${id}-form-item`,
35
- formDescriptionId: `${id}-form-item-description`,
36
- formMessageId: `${id}-form-item-message`,
37
- ...fieldState
38
- };
39
- };
40
- var FormLabel = React2.forwardRef(
41
- ({ className, caption, ...props }, ref) => {
42
- const { error, formItemId } = useFormField();
43
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-end justify-between", children: [
44
- /* @__PURE__ */ jsx(
45
- Label,
46
- {
47
- ref,
48
- className: twMerge(error ? "text-error-500" : null, className),
49
- htmlFor: formItemId,
50
- ...props
51
- }
52
- ),
53
- caption ? /* @__PURE__ */ jsx("div", { className: "typography-caption text-gray-200", children: caption }) : null
54
- ] });
55
- }
56
- );
57
- FormLabel.displayName = "FormLabel";
58
- var FormControl = React2.forwardRef(function(props, ref) {
59
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
60
- const newProps = { ...props, invalid: !!error };
61
- return /* @__PURE__ */ jsx(
62
- Slot,
63
- {
64
- ref,
65
- id: formItemId,
66
- "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
67
- "aria-invalid": !!error,
68
- ...newProps
69
- }
70
- );
71
- });
72
- FormControl.displayName = "FormControl";
73
- var FormMessage = React2.forwardRef(function({ children, ...props }, ref) {
74
- const { error, formMessageId } = useFormField();
75
- const body = error ? String(error?.message) : children;
76
- if (!body) {
77
- return null;
78
- }
79
- return /* @__PURE__ */ jsx(HelperText, { ref, type: "error", id: formMessageId, ...props, children: body });
80
- });
81
- FormMessage.displayName = "FormMessage";
82
- var FormDescription = React2.forwardRef(function(props, ref) {
83
- const { formDescriptionId } = useFormField();
84
- return /* @__PURE__ */ jsx(HelperText, { ref, id: formDescriptionId, ...props });
85
- });
86
- FormDescription.displayName = "FormDescription";
87
-
88
- export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage };