@omer-x/tailwind-ui-kit 1.0.0-alpha.15 → 1.0.0-alpha.17

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.
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
- import { ComponentProps } from 'react';
2
+ import { ComponentPropsWithoutRef, ComponentProps } from 'react';
3
3
  import JustDiv from '../elements/JustDiv.js';
4
4
  import '@base-ui/react/use-render';
5
5
 
6
- type BaseFormProps = Omit<ComponentProps<"form">, "action"> & {
6
+ type BaseFormProps = Omit<ComponentPropsWithoutRef<"form">, "action"> & {
7
7
  action: (initialState: unknown, formData: FormData) => Promise<Record<string, string>>;
8
8
  defaultValues?: Record<string, unknown>;
9
9
  onlyDirty?: boolean;
@@ -11,6 +11,6 @@ type BaseFormProps = Omit<ComponentProps<"form">, "action"> & {
11
11
  renderMessages?: ComponentProps<typeof JustDiv>["render"];
12
12
  onStateChange?: (state: Record<string, string>) => void;
13
13
  };
14
- declare const BaseForm: ({ action, defaultValues, onlyDirty, messages: messageTranslations, renderMessages, onStateChange, className, children, }: BaseFormProps) => react.JSX.Element;
14
+ declare const BaseForm: ({ action, defaultValues, onlyDirty, messages: messageTranslations, renderMessages, onStateChange, children, ...otherProps }: BaseFormProps) => react.JSX.Element;
15
15
 
16
16
  export { BaseForm as default };
@@ -12,8 +12,8 @@ const BaseForm = ({
12
12
  messages: messageTranslations = {},
13
13
  renderMessages,
14
14
  onStateChange,
15
- className,
16
- children
15
+ children,
16
+ ...otherProps
17
17
  }) => {
18
18
  const [state, formAction, _loading] = useActionState(action, {});
19
19
  const fieldsRef = useRef(/* @__PURE__ */ new Set());
@@ -48,18 +48,27 @@ const BaseForm = ({
48
48
  if (!form) return formAction(fd);
49
49
  return formAction(getDirtyFormData(form, defaultValues));
50
50
  };
51
- return /* @__PURE__ */ jsxs(Form, { ref: formRef, action: alteredAction, className, errors: fieldMessages, children: [
52
- Object.entries(formMessages).map(([messageKey, message]) => /* @__PURE__ */ jsx(
53
- JustDiv,
54
- {
55
- "data-message-type": messageKey.startsWith("[") ? messageKey.replace(/^\[|\]$/g, "") : "default",
56
- render: renderMessages,
57
- children: messageTranslations[message] || message
58
- },
59
- messageKey
60
- )),
61
- /* @__PURE__ */ jsx(FormContext, { value: { getFieldMessage, messageTranslations, registerField, unregisterField }, children })
62
- ] });
51
+ return /* @__PURE__ */ jsxs(
52
+ Form,
53
+ {
54
+ ...otherProps,
55
+ ref: formRef,
56
+ action: alteredAction,
57
+ errors: fieldMessages,
58
+ children: [
59
+ Object.entries(formMessages).map(([messageKey, message]) => /* @__PURE__ */ jsx(
60
+ JustDiv,
61
+ {
62
+ "data-message-type": messageKey.startsWith("[") ? messageKey.replace(/^\[|\]$/g, "") : "default",
63
+ render: renderMessages,
64
+ children: messageTranslations[message] || message
65
+ },
66
+ messageKey
67
+ )),
68
+ /* @__PURE__ */ jsx(FormContext, { value: { getFieldMessage, messageTranslations, registerField, unregisterField }, children })
69
+ ]
70
+ }
71
+ );
63
72
  };
64
73
  var BaseForm_default = BaseForm;
65
74
  export {
@@ -1,9 +1,11 @@
1
1
  export { default as BaseInput } from './BaseInput.js';
2
+ export { default as BaseSwitch } from './BaseSwitch.js';
2
3
  export { default as BaseForm } from './BaseForm.js';
3
4
  export { default as BaseFormField } from './BaseFormField.js';
4
5
  import 'react';
5
6
  import '../elements/JustInput.js';
6
7
  import '@base-ui/react/use-render';
8
+ import '@base-ui/react/switch';
7
9
  import '../elements/JustDiv.js';
8
10
  import '@base-ui/react/field';
9
11
  import 'zod';
@@ -1,8 +1,10 @@
1
1
  import { default as default2 } from "./BaseInput.js";
2
- import { default as default3 } from "./BaseForm.js";
3
- import { default as default4 } from "./BaseFormField.js";
2
+ import { default as default3 } from "./BaseSwitch.js";
3
+ import { default as default4 } from "./BaseForm.js";
4
+ import { default as default5 } from "./BaseFormField.js";
4
5
  export {
5
- default3 as BaseForm,
6
- default4 as BaseFormField,
7
- default2 as BaseInput
6
+ default4 as BaseForm,
7
+ default5 as BaseFormField,
8
+ default2 as BaseInput,
9
+ default3 as BaseSwitch
8
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omer-x/tailwind-ui-kit",
3
- "version": "1.0.0-alpha.15",
3
+ "version": "1.0.0-alpha.17",
4
4
  "description": "Tailwind CSS-based React component library for building user interfaces",
5
5
  "keywords": [
6
6
  "tailwind",