@btst/stack 1.9.0 → 1.9.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.
Files changed (67) hide show
  1. package/dist/packages/better-stack/src/plugins/cms/client/components/forms/content-form.cjs +4 -4
  2. package/dist/packages/better-stack/src/plugins/cms/client/components/forms/content-form.mjs +1 -1
  3. package/dist/packages/better-stack/src/plugins/form-builder/client/components/forms/form-renderer.cjs +2 -2
  4. package/dist/packages/better-stack/src/plugins/form-builder/client/components/forms/form-renderer.mjs +1 -1
  5. package/dist/packages/ui/src/components/auto-form/fields/array.cjs +2 -2
  6. package/dist/packages/ui/src/components/auto-form/fields/array.mjs +1 -1
  7. package/dist/packages/ui/src/components/auto-form/fields/date.cjs +2 -2
  8. package/dist/packages/ui/src/components/auto-form/fields/date.mjs +1 -1
  9. package/dist/packages/ui/src/components/auto-form/fields/enum.cjs +2 -2
  10. package/dist/packages/ui/src/components/auto-form/fields/enum.mjs +1 -1
  11. package/dist/packages/ui/src/components/auto-form/fields/object.cjs +9 -9
  12. package/dist/packages/ui/src/components/auto-form/fields/object.mjs +1 -1
  13. package/dist/packages/ui/src/components/auto-form/fields/radio-group.cjs +2 -2
  14. package/dist/packages/ui/src/components/auto-form/fields/radio-group.mjs +1 -1
  15. package/dist/packages/ui/src/components/auto-form/index.cjs +5 -5
  16. package/dist/packages/ui/src/components/auto-form/index.mjs +1 -1
  17. package/dist/packages/ui/src/components/button.cjs +4 -2
  18. package/dist/packages/ui/src/components/button.mjs +4 -2
  19. package/dist/packages/ui/src/components/dialog.cjs +1 -1
  20. package/dist/packages/ui/src/components/dialog.mjs +1 -1
  21. package/dist/packages/ui/src/components/form-builder/edit-field-dialog.cjs +2 -2
  22. package/dist/packages/ui/src/components/form-builder/edit-field-dialog.mjs +1 -1
  23. package/dist/packages/ui/src/components/form-builder/form-preview.cjs +5 -5
  24. package/dist/packages/ui/src/components/form-builder/form-preview.mjs +1 -1
  25. package/dist/packages/ui/src/components/select.cjs +9 -2
  26. package/dist/packages/ui/src/components/select.mjs +9 -2
  27. package/dist/plugins/blog/api/index.d.cts +1 -1
  28. package/dist/plugins/blog/api/index.d.mts +1 -1
  29. package/dist/plugins/blog/api/index.d.ts +1 -1
  30. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  31. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  32. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  33. package/dist/plugins/blog/client/index.d.cts +1 -1
  34. package/dist/plugins/blog/client/index.d.mts +1 -1
  35. package/dist/plugins/blog/client/index.d.ts +1 -1
  36. package/dist/plugins/blog/query-keys.d.cts +2 -2
  37. package/dist/plugins/blog/query-keys.d.mts +2 -2
  38. package/dist/plugins/blog/query-keys.d.ts +2 -2
  39. package/dist/plugins/cms/api/index.d.cts +1 -1
  40. package/dist/plugins/cms/api/index.d.mts +1 -1
  41. package/dist/plugins/cms/api/index.d.ts +1 -1
  42. package/dist/plugins/cms/client/index.d.cts +2 -2
  43. package/dist/plugins/cms/client/index.d.mts +2 -2
  44. package/dist/plugins/cms/client/index.d.ts +2 -2
  45. package/dist/plugins/form-builder/api/index.d.cts +1 -1
  46. package/dist/plugins/form-builder/api/index.d.mts +1 -1
  47. package/dist/plugins/form-builder/api/index.d.ts +1 -1
  48. package/dist/plugins/form-builder/client/components/index.d.cts +1 -1
  49. package/dist/plugins/form-builder/client/components/index.d.mts +1 -1
  50. package/dist/plugins/form-builder/client/components/index.d.ts +1 -1
  51. package/dist/plugins/form-builder/client/index.d.cts +2 -2
  52. package/dist/plugins/form-builder/client/index.d.mts +2 -2
  53. package/dist/plugins/form-builder/client/index.d.ts +2 -2
  54. package/dist/shared/{stack.AX5nZ6A3.d.ts → stack.Co034Fpm.d.cts} +0 -21
  55. package/dist/shared/{stack.AX5nZ6A3.d.cts → stack.Co034Fpm.d.mts} +0 -21
  56. package/dist/shared/{stack.AX5nZ6A3.d.mts → stack.Co034Fpm.d.ts} +0 -21
  57. package/dist/shared/{stack.BIh2AXaW.d.cts → stack.DGjhPqmF.d.cts} +0 -9
  58. package/dist/shared/{stack.BIh2AXaW.d.mts → stack.DGjhPqmF.d.mts} +0 -9
  59. package/dist/shared/{stack.BIh2AXaW.d.ts → stack.DGjhPqmF.d.ts} +0 -9
  60. package/package.json +1 -1
  61. package/src/plugins/cms/client/components/forms/content-form.tsx +2 -2
  62. package/src/plugins/form-builder/client/components/forms/form-renderer.tsx +1 -1
  63. package/dist/packages/ui/src/components/auto-form/{utils.cjs → helpers.cjs} +0 -0
  64. package/dist/packages/ui/src/components/auto-form/{utils.mjs → helpers.mjs} +0 -0
  65. package/dist/shared/{stack.DLhzx1-D.d.mts → stack.CcI4sYJP.d.cts} +1 -1
  66. package/dist/shared/{stack.DLhzx1-D.d.cts → stack.CcI4sYJP.d.mts} +1 -1
  67. package/dist/shared/{stack.DLhzx1-D.d.ts → stack.CcI4sYJP.d.ts} +1 -1
@@ -5,19 +5,19 @@ const jsxRuntime = require('react/jsx-runtime');
5
5
  const React = require('react');
6
6
  const z = require('zod');
7
7
  const steppedAutoForm = require('../../../../../../../ui/src/components/auto-form/stepped-auto-form.cjs');
8
- const utils = require('../../../../../../../ui/src/components/auto-form/utils.cjs');
8
+ const helpers = require('../../../../../../../ui/src/components/auto-form/helpers.cjs');
9
9
  const schemaConverter = require('../../../../../../../ui/src/lib/schema-converter.cjs');
10
10
  const input = require('../../../../../../../ui/src/components/input.cjs');
11
11
  const label = require('../../../../../../../ui/src/components/label.cjs');
12
12
  const badge = require('../../../../../../../ui/src/components/badge.cjs');
13
13
  const context = require('@btst/stack/context');
14
- const utils$1 = require('../../../utils.cjs');
14
+ const utils = require('../../../utils.cjs');
15
15
  const index = require('../../localization/index.cjs');
16
16
  const fileUpload = require('./file-upload.cjs');
17
17
  const relationField = require('./relation-field.cjs');
18
18
 
19
19
  function buildFieldConfigFromJsonSchema(jsonSchema, uploadImage, fieldComponents) {
20
- const baseConfig = utils.buildFieldConfigFromJsonSchema(jsonSchema, fieldComponents);
20
+ const baseConfig = helpers.buildFieldConfigFromJsonSchema(jsonSchema, fieldComponents);
21
21
  const properties = jsonSchema.properties;
22
22
  if (!properties) return baseConfig;
23
23
  for (const [key, prop] of Object.entries(properties)) {
@@ -127,7 +127,7 @@ function ContentForm({
127
127
  if (!isEditing && !slugManuallyEdited && slugSourceField) {
128
128
  const sourceValue = values[slugSourceField];
129
129
  if (typeof sourceValue === "string" && sourceValue.trim()) {
130
- setSlug(utils$1.slugify(sourceValue));
130
+ setSlug(utils.slugify(sourceValue));
131
131
  }
132
132
  }
133
133
  };
@@ -3,7 +3,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { useState, useRef, useEffect, useMemo } from 'react';
4
4
  import { z } from 'zod';
5
5
  import SteppedAutoForm from '../../../../../../../ui/src/components/auto-form/stepped-auto-form.mjs';
6
- import { buildFieldConfigFromJsonSchema as buildFieldConfigFromJsonSchema$1 } from '../../../../../../../ui/src/components/auto-form/utils.mjs';
6
+ import { buildFieldConfigFromJsonSchema as buildFieldConfigFromJsonSchema$1 } from '../../../../../../../ui/src/components/auto-form/helpers.mjs';
7
7
  import { formSchemaToZod } from '../../../../../../../ui/src/lib/schema-converter.mjs';
8
8
  import { Input } from '../../../../../../../ui/src/components/input.mjs';
9
9
  import { Label } from '../../../../../../../ui/src/components/label.mjs';
@@ -5,7 +5,7 @@ const jsxRuntime = require('react/jsx-runtime');
5
5
  const React = require('react');
6
6
  const context = require('@btst/stack/context');
7
7
  const steppedAutoForm = require('../../../../../../../ui/src/components/auto-form/stepped-auto-form.cjs');
8
- const utils = require('../../../../../../../ui/src/components/auto-form/utils.cjs');
8
+ const helpers = require('../../../../../../../ui/src/components/auto-form/helpers.cjs');
9
9
  const schemaConverter = require('../../../../../../../ui/src/lib/schema-converter.cjs');
10
10
  const skeleton = require('../../../../../../../ui/src/components/skeleton.cjs');
11
11
  const lucideReact = require('lucide-react');
@@ -69,7 +69,7 @@ function FormRenderer({
69
69
  try {
70
70
  const parsedSchema = JSON.parse(form.schema);
71
71
  const zod = schemaConverter.formSchemaToZod(parsedSchema);
72
- const config = utils.buildFieldConfigFromJsonSchema(
72
+ const config = helpers.buildFieldConfigFromJsonSchema(
73
73
  parsedSchema,
74
74
  mergedFieldComponents
75
75
  );
@@ -3,7 +3,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { useState, useMemo } from 'react';
4
4
  import { usePluginOverrides } from '@btst/stack/context';
5
5
  import SteppedAutoForm from '../../../../../../../ui/src/components/auto-form/stepped-auto-form.mjs';
6
- import { buildFieldConfigFromJsonSchema } from '../../../../../../../ui/src/components/auto-form/utils.mjs';
6
+ import { buildFieldConfigFromJsonSchema } from '../../../../../../../ui/src/components/auto-form/helpers.mjs';
7
7
  import { formSchemaToZod } from '../../../../../../../ui/src/lib/schema-converter.mjs';
8
8
  import { Skeleton } from '../../../../../../../ui/src/components/skeleton.mjs';
9
9
  import { AlertCircle, CheckCircle } from 'lucide-react';
@@ -6,7 +6,7 @@ const button = require('../../button.cjs');
6
6
  const separator = require('../../separator.cjs');
7
7
  const lucideReact = require('lucide-react');
8
8
  const reactHookForm = require('react-hook-form');
9
- const utils = require('../utils.cjs');
9
+ const helpers = require('../helpers.cjs');
10
10
  const object = require('./object.cjs');
11
11
 
12
12
  function getDefType(schema) {
@@ -38,7 +38,7 @@ function AutoFormArray({
38
38
  control: form.control,
39
39
  name: fieldPath
40
40
  });
41
- const title = fieldConfig?.label ?? utils.beautifyObjectName(name);
41
+ const title = fieldConfig?.label ?? helpers.beautifyObjectName(name);
42
42
  const itemDefType = getArrayElementType(item);
43
43
  return /* @__PURE__ */ jsxRuntime.jsxs(accordion.AccordionItem, { value: name, className: "border-none", children: [
44
44
  /* @__PURE__ */ jsxRuntime.jsx(accordion.AccordionTrigger, { children: title }),
@@ -4,7 +4,7 @@ import { Button } from '../../button.mjs';
4
4
  import { Separator } from '../../separator.mjs';
5
5
  import { Trash, Plus } from 'lucide-react';
6
6
  import { useFieldArray } from 'react-hook-form';
7
- import { beautifyObjectName } from '../utils.mjs';
7
+ import { beautifyObjectName } from '../helpers.mjs';
8
8
  import AutoFormObject from './object.mjs';
9
9
 
10
10
  function getDefType(schema) {
@@ -5,7 +5,7 @@ const datePicker = require('../../date-picker.cjs');
5
5
  const form = require('../../form.cjs');
6
6
  const label = require('../common/label.cjs');
7
7
  const tooltip = require('../common/tooltip.cjs');
8
- const utils = require('../utils.cjs');
8
+ const helpers = require('../helpers.cjs');
9
9
 
10
10
  function toDate(value) {
11
11
  if (!value) return void 0;
@@ -24,7 +24,7 @@ function AutoFormDate({
24
24
  fieldProps,
25
25
  zodItem
26
26
  }) {
27
- const baseType = utils.getBaseType(zodItem);
27
+ const baseType = helpers.getBaseType(zodItem);
28
28
  const expectsDateObject = baseType === "ZodDate";
29
29
  const handleChange = (date) => {
30
30
  if (!date) {
@@ -3,7 +3,7 @@ import { DatePicker } from '../../date-picker.mjs';
3
3
  import { FormItem, FormControl, FormMessage } from '../../form.mjs';
4
4
  import AutoFormLabel from '../common/label.mjs';
5
5
  import AutoFormTooltip from '../common/tooltip.mjs';
6
- import { getBaseType } from '../utils.mjs';
6
+ import { getBaseType } from '../helpers.mjs';
7
7
 
8
8
  function toDate(value) {
9
9
  if (!value) return void 0;
@@ -5,7 +5,7 @@ const form = require('../../form.cjs');
5
5
  const select = require('../../select.cjs');
6
6
  const label = require('../common/label.cjs');
7
7
  const tooltip = require('../common/tooltip.cjs');
8
- const utils = require('../utils.cjs');
8
+ const helpers = require('../helpers.cjs');
9
9
 
10
10
  function getEnumValues(schema) {
11
11
  if (Array.isArray(schema.options)) {
@@ -28,7 +28,7 @@ function AutoFormEnum({
28
28
  zodItem,
29
29
  fieldProps
30
30
  }) {
31
- const baseSchema = utils.getBaseSchema(zodItem);
31
+ const baseSchema = helpers.getBaseSchema(zodItem);
32
32
  const baseValues = getEnumValues(baseSchema);
33
33
  let values = [];
34
34
  if (!baseValues || baseValues.length === 0) {
@@ -3,7 +3,7 @@ import { FormItem, FormControl, FormMessage } from '../../form.mjs';
3
3
  import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../../select.mjs';
4
4
  import AutoFormLabel from '../common/label.mjs';
5
5
  import AutoFormTooltip from '../common/tooltip.mjs';
6
- import { getBaseSchema } from '../utils.mjs';
6
+ import { getBaseSchema } from '../helpers.mjs';
7
7
 
8
8
  function getEnumValues(schema) {
9
9
  if (Array.isArray(schema.options)) {
@@ -6,7 +6,7 @@ const form = require('../../form.cjs');
6
6
  const reactHookForm = require('react-hook-form');
7
7
  const z = require('zod');
8
8
  const config = require('../config.cjs');
9
- const utils = require('../utils.cjs');
9
+ const helpers = require('../helpers.cjs');
10
10
  const array = require('./array.cjs');
11
11
  const dependencies = require('../dependencies.cjs');
12
12
 
@@ -38,7 +38,7 @@ function AutoFormObject({
38
38
  if (!schema) {
39
39
  return null;
40
40
  }
41
- const { shape } = utils.getBaseSchema(schema) || {};
41
+ const { shape } = helpers.getBaseSchema(schema) || {};
42
42
  if (!shape) {
43
43
  return null;
44
44
  }
@@ -55,12 +55,12 @@ function AutoFormObject({
55
55
  }
56
56
  return item;
57
57
  };
58
- const sortedFieldKeys = utils.sortFieldsByOrder(fieldConfig, Object.keys(shape));
58
+ const sortedFieldKeys = helpers.sortFieldsByOrder(fieldConfig, Object.keys(shape));
59
59
  return /* @__PURE__ */ jsxRuntime.jsx(accordion.Accordion, { type: "multiple", className: "space-y-5 border-none", children: sortedFieldKeys.map((name) => {
60
60
  let item = shape[name];
61
61
  item = handleIfZodNumber(item);
62
- const zodBaseType = utils.getBaseType(item);
63
- const itemName = utils.beautifyObjectName(name);
62
+ const zodBaseType = helpers.getBaseType(item);
63
+ const itemName = helpers.beautifyObjectName(name);
64
64
  const key = [...path, name].join(".");
65
65
  const {
66
66
  isHidden,
@@ -74,7 +74,7 @@ function AutoFormObject({
74
74
  if (zodBaseType === "ZodObject") {
75
75
  const objectFieldConfig = fieldConfig?.[name] ?? {};
76
76
  if (typeof objectFieldConfig.fieldType === "function") {
77
- const zodInputProps2 = utils.zodToHtmlInputProps(item);
77
+ const zodInputProps2 = helpers.zodToHtmlInputProps(item);
78
78
  let isRequired2 = isRequiredByDependency || zodInputProps2.required || false;
79
79
  if (objectFieldConfig.inputProps?.required !== void 0) {
80
80
  isRequired2 = objectFieldConfig.inputProps.required;
@@ -128,7 +128,7 @@ function AutoFormObject({
128
128
  if (zodBaseType === "ZodArray") {
129
129
  const arrayFieldConfig = fieldConfig?.[name] ?? {};
130
130
  if (typeof arrayFieldConfig.fieldType === "function") {
131
- const zodInputProps2 = utils.zodToHtmlInputProps(item);
131
+ const zodInputProps2 = helpers.zodToHtmlInputProps(item);
132
132
  let isRequired2 = isRequiredByDependency || zodInputProps2.required || false;
133
133
  if (arrayFieldConfig.inputProps?.required !== void 0) {
134
134
  isRequired2 = arrayFieldConfig.inputProps.required;
@@ -179,7 +179,7 @@ function AutoFormObject({
179
179
  );
180
180
  }
181
181
  const fieldConfigItem = fieldConfig?.[name] ?? {};
182
- const zodInputProps = utils.zodToHtmlInputProps(item);
182
+ const zodInputProps = helpers.zodToHtmlInputProps(item);
183
183
  let isRequired = isRequiredByDependency || zodInputProps.required || false;
184
184
  if (fieldConfigItem.inputProps?.required !== void 0) {
185
185
  isRequired = fieldConfigItem.inputProps.required;
@@ -199,7 +199,7 @@ function AutoFormObject({
199
199
  const defaultValue = fieldConfigItem.inputProps?.defaultValue;
200
200
  const value = field.value ?? defaultValue ?? "";
201
201
  const fieldProps = {
202
- ...utils.zodToHtmlInputProps(item),
202
+ ...helpers.zodToHtmlInputProps(item),
203
203
  ...field,
204
204
  ...fieldConfigItem.inputProps,
205
205
  disabled: fieldConfigItem.inputProps?.disabled || isDisabled,
@@ -4,7 +4,7 @@ import { FormField } from '../../form.mjs';
4
4
  import { useFormContext } from 'react-hook-form';
5
5
  import * as z from 'zod';
6
6
  import { DEFAULT_ZOD_HANDLERS, INPUT_COMPONENTS } from '../config.mjs';
7
- import { getBaseSchema, sortFieldsByOrder, getBaseType, beautifyObjectName, zodToHtmlInputProps } from '../utils.mjs';
7
+ import { getBaseSchema, sortFieldsByOrder, getBaseType, beautifyObjectName, zodToHtmlInputProps } from '../helpers.mjs';
8
8
  import AutoFormArray from './array.mjs';
9
9
  import resolveDependencies from '../dependencies.mjs';
10
10
 
@@ -5,7 +5,7 @@ const form = require('../../form.cjs');
5
5
  const radioGroup = require('../../radio-group.cjs');
6
6
  const label = require('../common/label.cjs');
7
7
  const tooltip = require('../common/tooltip.cjs');
8
- const utils = require('../utils.cjs');
8
+ const helpers = require('../helpers.cjs');
9
9
 
10
10
  function getEnumValues(schema) {
11
11
  if (Array.isArray(schema.options)) {
@@ -28,7 +28,7 @@ function AutoFormRadioGroup({
28
28
  fieldProps,
29
29
  fieldConfigItem
30
30
  }) {
31
- const baseSchema = utils.getBaseSchema(zodItem);
31
+ const baseSchema = helpers.getBaseSchema(zodItem);
32
32
  const values = getEnumValues(baseSchema);
33
33
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
34
34
  /* @__PURE__ */ jsxRuntime.jsxs(form.FormItem, { children: [
@@ -3,7 +3,7 @@ import { FormItem, FormControl, FormLabel, FormMessage } from '../../form.mjs';
3
3
  import { RadioGroup, RadioGroupItem } from '../../radio-group.mjs';
4
4
  import AutoFormLabel from '../common/label.mjs';
5
5
  import AutoFormTooltip from '../common/tooltip.mjs';
6
- import { getBaseSchema } from '../utils.mjs';
6
+ import { getBaseSchema } from '../helpers.mjs';
7
7
 
8
8
  function getEnumValues(schema) {
9
9
  if (Array.isArray(schema.options)) {
@@ -6,10 +6,10 @@ const form = require('../form.cjs');
6
6
  const React = require('react');
7
7
  const reactHookForm = require('react-hook-form');
8
8
  require('../button.cjs');
9
- const utils$1 = require('../../lib/utils.cjs');
9
+ const utils = require('../../lib/utils.cjs');
10
10
  const zod = require('@hookform/resolvers/zod');
11
11
  const object = require('./fields/object.cjs');
12
- const utils = require('./utils.cjs');
12
+ const helpers = require('./helpers.cjs');
13
13
 
14
14
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
15
15
 
@@ -26,8 +26,8 @@ function AutoForm({
26
26
  className,
27
27
  dependencies
28
28
  }) {
29
- const objectFormSchema = utils.getObjectFormSchema(formSchema);
30
- const defaultValues = utils.getDefaultValues(objectFormSchema, fieldConfig);
29
+ const objectFormSchema = helpers.getObjectFormSchema(formSchema);
30
+ const defaultValues = helpers.getDefaultValues(objectFormSchema, fieldConfig);
31
31
  const form$1 = reactHookForm.useForm({
32
32
  // Cast to any to handle Zod v4 type compatibility with @hookform/resolvers
33
33
  resolver: zod.zodResolver(formSchema),
@@ -57,7 +57,7 @@ function AutoForm({
57
57
  onSubmit: (e) => {
58
58
  form$1.handleSubmit(onSubmit)(e);
59
59
  },
60
- className: utils$1.cn("space-y-5", className),
60
+ className: utils.cn("space-y-5", className),
61
61
  children: [
62
62
  /* @__PURE__ */ jsxRuntime.jsx(
63
63
  object,
@@ -7,7 +7,7 @@ import '../button.mjs';
7
7
  import { cn } from '../../lib/utils.mjs';
8
8
  import { zodResolver } from '@hookform/resolvers/zod';
9
9
  import AutoFormObject from './fields/object.mjs';
10
- import { getObjectFormSchema, getDefaultValues } from './utils.mjs';
10
+ import { getObjectFormSchema, getDefaultValues } from './helpers.mjs';
11
11
 
12
12
  function AutoForm({
13
13
  formSchema,
@@ -34,8 +34,8 @@ const buttonVariants = classVarianceAuthority.cva(
34
34
  );
35
35
  function Button({
36
36
  className,
37
- variant,
38
- size,
37
+ variant = "default",
38
+ size = "default",
39
39
  asChild = false,
40
40
  ...props
41
41
  }) {
@@ -44,6 +44,8 @@ function Button({
44
44
  Comp,
45
45
  {
46
46
  "data-slot": "button",
47
+ "data-variant": variant,
48
+ "data-size": size,
47
49
  className: utils.cn(buttonVariants({ variant, size, className })),
48
50
  ...props
49
51
  }
@@ -32,8 +32,8 @@ const buttonVariants = cva(
32
32
  );
33
33
  function Button({
34
34
  className,
35
- variant,
36
- size,
35
+ variant = "default",
36
+ size = "default",
37
37
  asChild = false,
38
38
  ...props
39
39
  }) {
@@ -42,6 +42,8 @@ function Button({
42
42
  Comp,
43
43
  {
44
44
  "data-slot": "button",
45
+ "data-variant": variant,
46
+ "data-size": size,
45
47
  className: cn(buttonVariants({ variant, size, className })),
46
48
  ...props
47
49
  }
@@ -64,7 +64,7 @@ function DialogContent({
64
64
  {
65
65
  "data-slot": "dialog-content",
66
66
  className: utils.cn(
67
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
67
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
68
68
  className
69
69
  ),
70
70
  ...props,
@@ -48,7 +48,7 @@ function DialogContent({
48
48
  {
49
49
  "data-slot": "dialog-content",
50
50
  className: cn(
51
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
51
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
52
52
  className
53
53
  ),
54
54
  ...props,
@@ -4,7 +4,7 @@
4
4
  const jsxRuntime = require('react/jsx-runtime');
5
5
  const React = require('react');
6
6
  const index = require('../auto-form/index.cjs');
7
- const utils = require('../auto-form/utils.cjs');
7
+ const helpers = require('../auto-form/helpers.cjs');
8
8
  const input = require('../input.cjs');
9
9
  const label = require('../label.cjs');
10
10
  const button = require('../button.cjs');
@@ -68,7 +68,7 @@ function EditFieldDialog({
68
68
  }
69
69
  const Icon = component.icon;
70
70
  const jsonSchema = component.propertiesSchema.toJSONSchema();
71
- const fieldConfig = utils.buildFieldConfigFromJsonSchema(jsonSchema);
71
+ const fieldConfig = helpers.buildFieldConfigFromJsonSchema(jsonSchema);
72
72
  return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { className: "max-w-md max-h-[90vh] overflow-y-auto", children: [
73
73
  /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogHeader, { children: [
74
74
  /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogTitle, { className: "flex items-center gap-2", children: [
@@ -2,7 +2,7 @@
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { useMemo, useState, useCallback } from 'react';
4
4
  import AutoForm from '../auto-form/index.mjs';
5
- import { buildFieldConfigFromJsonSchema } from '../auto-form/utils.mjs';
5
+ import { buildFieldConfigFromJsonSchema } from '../auto-form/helpers.mjs';
6
6
  import { Input } from '../input.mjs';
7
7
  import { Label } from '../label.mjs';
8
8
  import { Button } from '../button.mjs';
@@ -4,9 +4,9 @@
4
4
  const jsxRuntime = require('react/jsx-runtime');
5
5
  const React = require('react');
6
6
  const steppedAutoForm = require('../auto-form/stepped-auto-form.cjs');
7
- const utils = require('../auto-form/utils.cjs');
7
+ const helpers = require('../auto-form/helpers.cjs');
8
8
  const button = require('../button.cjs');
9
- const utils$1 = require('../../lib/utils.cjs');
9
+ const utils = require('../../lib/utils.cjs');
10
10
  const schemaConverter = require('../../lib/schema-converter.cjs');
11
11
 
12
12
  function FormPreview({ schema, className, fieldComponents, defaultValues }) {
@@ -25,7 +25,7 @@ function FormPreview({ schema, className, fieldComponents, defaultValues }) {
25
25
  const mergedFieldComponents = React.useMemo(() => fieldComponents ?? {}, [fieldComponents]);
26
26
  const fieldConfig = React.useMemo(() => {
27
27
  try {
28
- return utils.buildFieldConfigFromJsonSchema(
28
+ return helpers.buildFieldConfigFromJsonSchema(
29
29
  schema,
30
30
  mergedFieldComponents
31
31
  );
@@ -41,12 +41,12 @@ function FormPreview({ schema, className, fieldComponents, defaultValues }) {
41
41
  setSubmittedValues(null);
42
42
  };
43
43
  if (!zodSchema) {
44
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils$1.cn("p-8 text-center text-muted-foreground", className), children: [
44
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cn("p-8 text-center text-muted-foreground", className), children: [
45
45
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-lg font-medium mb-2", children: "No fields to preview" }),
46
46
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: "Add some fields to your form to see a preview" })
47
47
  ] });
48
48
  }
49
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils$1.cn("p-4 md:p-6", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-2xl mx-auto", children: submittedValues ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
49
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn("p-4 md:p-6", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-2xl mx-auto", children: submittedValues ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
50
50
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
51
51
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold", children: "Submitted Values" }),
52
52
  /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", onClick: handleReset, children: "Try Again" })
@@ -2,7 +2,7 @@
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { useState, useMemo } from 'react';
4
4
  import SteppedAutoForm from '../auto-form/stepped-auto-form.mjs';
5
- import { buildFieldConfigFromJsonSchema } from '../auto-form/utils.mjs';
5
+ import { buildFieldConfigFromJsonSchema } from '../auto-form/helpers.mjs';
6
6
  import { Button } from '../button.mjs';
7
7
  import { cn } from '../../lib/utils.mjs';
8
8
  import { formSchemaToZod } from '../../lib/schema-converter.mjs';
@@ -42,7 +42,7 @@ function SelectTrigger({
42
42
  function SelectContent({
43
43
  className,
44
44
  children,
45
- position = "popper",
45
+ position = "item-aligned",
46
46
  align = "center",
47
47
  ...props
48
48
  }) {
@@ -90,7 +90,14 @@ function SelectItem({
90
90
  ),
91
91
  ...props,
92
92
  children: [
93
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(index.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4" }) }) }),
93
+ /* @__PURE__ */ jsxRuntime.jsx(
94
+ "span",
95
+ {
96
+ "data-slot": "select-item-indicator",
97
+ className: "absolute right-2 flex size-3.5 items-center justify-center",
98
+ children: /* @__PURE__ */ jsxRuntime.jsx(index.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4" }) })
99
+ }
100
+ ),
94
101
  /* @__PURE__ */ jsxRuntime.jsx(index.ItemText, { children })
95
102
  ]
96
103
  }
@@ -40,7 +40,7 @@ function SelectTrigger({
40
40
  function SelectContent({
41
41
  className,
42
42
  children,
43
- position = "popper",
43
+ position = "item-aligned",
44
44
  align = "center",
45
45
  ...props
46
46
  }) {
@@ -88,7 +88,14 @@ function SelectItem({
88
88
  ),
89
89
  ...props,
90
90
  children: [
91
- /* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
91
+ /* @__PURE__ */ jsx(
92
+ "span",
93
+ {
94
+ "data-slot": "select-item-indicator",
95
+ className: "absolute right-2 flex size-3.5 items-center justify-center",
96
+ children: /* @__PURE__ */ jsx(ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
97
+ }
98
+ ),
92
99
  /* @__PURE__ */ jsx(ItemText, { children })
93
100
  ]
94
101
  }
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.DLhzx1-D.cjs';
5
+ import '../../../shared/stack.CcI4sYJP.cjs';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.DLhzx1-D.mjs';
5
+ import '../../../shared/stack.CcI4sYJP.mjs';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
2
2
  import '@btst/stack/plugins/api';
3
3
  import 'better-call';
4
4
  import 'zod';
5
- import '../../../shared/stack.DLhzx1-D.js';
5
+ import '../../../shared/stack.CcI4sYJP.js';
6
6
  import '@tanstack/react-query';
7
7
  import '@btst/stack/plugins/client';
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.cjs';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CcI4sYJP.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
128
128
  };
129
129
  /** Create a new post */
130
130
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
131
- title: string;
132
131
  published: boolean;
132
+ title: string;
133
133
  content: string;
134
134
  excerpt: string;
135
135
  tags: ({
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.mjs';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CcI4sYJP.mjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
128
128
  };
129
129
  /** Create a new post */
130
130
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
131
- title: string;
132
131
  published: boolean;
132
+ title: string;
133
133
  content: string;
134
134
  excerpt: string;
135
135
  tags: ({
@@ -1,5 +1,5 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.js';
2
+ import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.CcI4sYJP.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
128
128
  };
129
129
  /** Create a new post */
130
130
  declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
131
- title: string;
132
131
  published: boolean;
132
+ title: string;
133
133
  content: string;
134
134
  excerpt: string;
135
135
  tags: ({
@@ -3,7 +3,7 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.cjs';
6
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.CcI4sYJP.cjs';
7
7
  export { UsePostsOptions, UsePostsResult } from './hooks/index.cjs';
8
8
  import 'zod';
9
9
 
@@ -3,7 +3,7 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.mjs';
6
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.CcI4sYJP.mjs';
7
7
  export { UsePostsOptions, UsePostsResult } from './hooks/index.mjs';
8
8
  import 'zod';
9
9
 
@@ -3,7 +3,7 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.js';
6
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.CcI4sYJP.js';
7
7
  export { UsePostsOptions, UsePostsResult } from './hooks/index.js';
8
8
  import 'zod';
9
9
 
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.cjs';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CcI4sYJP.cjs';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
144
144
  readonly createPost: better_call.StrictEndpoint<"/posts", {
145
145
  method: "POST";
146
146
  body: z.ZodObject<{
147
- title: z.ZodString;
148
147
  slug: z.ZodOptional<z.ZodString>;
149
148
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
150
149
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
150
+ title: z.ZodString;
151
151
  content: z.ZodString;
152
152
  excerpt: z.ZodString;
153
153
  image: z.ZodOptional<z.ZodString>;
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.mjs';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CcI4sYJP.mjs';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
144
144
  readonly createPost: better_call.StrictEndpoint<"/posts", {
145
145
  method: "POST";
146
146
  body: z.ZodObject<{
147
- title: z.ZodString;
148
147
  slug: z.ZodOptional<z.ZodString>;
149
148
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
150
149
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
150
+ title: z.ZodString;
151
151
  content: z.ZodString;
152
152
  excerpt: z.ZodString;
153
153
  image: z.ZodOptional<z.ZodString>;
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.js';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CcI4sYJP.js';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
144
144
  readonly createPost: better_call.StrictEndpoint<"/posts", {
145
145
  method: "POST";
146
146
  body: z.ZodObject<{
147
- title: z.ZodString;
148
147
  slug: z.ZodOptional<z.ZodString>;
149
148
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
150
149
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
150
+ title: z.ZodString;
151
151
  content: z.ZodString;
152
152
  excerpt: z.ZodString;
153
153
  image: z.ZodOptional<z.ZodString>;
@@ -16,8 +16,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
16
16
  itemCount: number;
17
17
  createdAt: string;
18
18
  updatedAt: string;
19
- id: string;
20
19
  name: string;
20
+ id: string;
21
21
  slug: string;
22
22
  description?: string | undefined;
23
23
  jsonSchema: string;
@@ -16,8 +16,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
16
16
  itemCount: number;
17
17
  createdAt: string;
18
18
  updatedAt: string;
19
- id: string;
20
19
  name: string;
20
+ id: string;
21
21
  slug: string;
22
22
  description?: string | undefined;
23
23
  jsonSchema: string;
@@ -16,8 +16,8 @@ declare const cmsBackendPlugin: (config: CMSBackendConfig) => _btst_stack_plugin
16
16
  itemCount: number;
17
17
  createdAt: string;
18
18
  updatedAt: string;
19
- id: string;
20
19
  name: string;
20
+ id: string;
21
21
  slug: string;
22
22
  description?: string | undefined;
23
23
  jsonSchema: string;
@@ -3,8 +3,8 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { A as AutoFormInputComponentProps } from '../../../shared/stack.BIh2AXaW.cjs';
7
- export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.AX5nZ6A3.cjs';
6
+ import { A as AutoFormInputComponentProps } from '../../../shared/stack.DGjhPqmF.cjs';
7
+ export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.Co034Fpm.cjs';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
9
  import 'react-hook-form';
10
10
  import 'zod';
@@ -3,8 +3,8 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { A as AutoFormInputComponentProps } from '../../../shared/stack.BIh2AXaW.mjs';
7
- export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.AX5nZ6A3.mjs';
6
+ import { A as AutoFormInputComponentProps } from '../../../shared/stack.DGjhPqmF.mjs';
7
+ export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.Co034Fpm.mjs';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
9
  import 'react-hook-form';
10
10
  import 'zod';
@@ -3,8 +3,8 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { A as AutoFormInputComponentProps } from '../../../shared/stack.BIh2AXaW.js';
7
- export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.AX5nZ6A3.js';
6
+ import { A as AutoFormInputComponentProps } from '../../../shared/stack.DGjhPqmF.js';
7
+ export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.Co034Fpm.js';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
9
  import 'react-hook-form';
10
10
  import 'zod';
@@ -97,8 +97,8 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
97
97
  };
98
98
  submittedAt: string;
99
99
  id: string;
100
- formId: string;
101
100
  data: string;
101
+ formId: string;
102
102
  submittedBy?: string | undefined;
103
103
  ipAddress?: string | undefined;
104
104
  userAgent?: string | undefined;
@@ -97,8 +97,8 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
97
97
  };
98
98
  submittedAt: string;
99
99
  id: string;
100
- formId: string;
101
100
  data: string;
101
+ formId: string;
102
102
  submittedBy?: string | undefined;
103
103
  ipAddress?: string | undefined;
104
104
  userAgent?: string | undefined;
@@ -97,8 +97,8 @@ declare const formBuilderBackendPlugin: (config?: FormBuilderBackendConfig) => _
97
97
  };
98
98
  submittedAt: string;
99
99
  id: string;
100
- formId: string;
101
100
  data: string;
101
+ formId: string;
102
102
  submittedBy?: string | undefined;
103
103
  ipAddress?: string | undefined;
104
104
  userAgent?: string | undefined;
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ComponentType } from 'react';
3
- import { A as AutoFormInputComponentProps } from '../../../../shared/stack.BIh2AXaW.cjs';
3
+ import { A as AutoFormInputComponentProps } from '../../../../shared/stack.DGjhPqmF.cjs';
4
4
  import { a as SerializedFormSubmission } from '../../../../shared/stack.DzH_wcvr.cjs';
5
5
  import 'react-hook-form';
6
6
  import 'zod';
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ComponentType } from 'react';
3
- import { A as AutoFormInputComponentProps } from '../../../../shared/stack.BIh2AXaW.mjs';
3
+ import { A as AutoFormInputComponentProps } from '../../../../shared/stack.DGjhPqmF.mjs';
4
4
  import { a as SerializedFormSubmission } from '../../../../shared/stack.DzH_wcvr.mjs';
5
5
  import 'react-hook-form';
6
6
  import 'zod';
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ComponentType } from 'react';
3
- import { A as AutoFormInputComponentProps } from '../../../../shared/stack.BIh2AXaW.js';
3
+ import { A as AutoFormInputComponentProps } from '../../../../shared/stack.DGjhPqmF.js';
4
4
  import { a as SerializedFormSubmission } from '../../../../shared/stack.DzH_wcvr.js';
5
5
  import 'react-hook-form';
6
6
  import 'zod';
@@ -3,8 +3,8 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { A as AutoFormInputComponentProps } from '../../../shared/stack.BIh2AXaW.cjs';
7
- export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.AX5nZ6A3.cjs';
6
+ import { A as AutoFormInputComponentProps } from '../../../shared/stack.DGjhPqmF.cjs';
7
+ export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.Co034Fpm.cjs';
8
8
  import 'react-hook-form';
9
9
  import 'zod';
10
10
  import 'react/jsx-runtime';
@@ -3,8 +3,8 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { A as AutoFormInputComponentProps } from '../../../shared/stack.BIh2AXaW.mjs';
7
- export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.AX5nZ6A3.mjs';
6
+ import { A as AutoFormInputComponentProps } from '../../../shared/stack.DGjhPqmF.mjs';
7
+ export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.Co034Fpm.mjs';
8
8
  import 'react-hook-form';
9
9
  import 'zod';
10
10
  import 'react/jsx-runtime';
@@ -3,8 +3,8 @@ import * as react from 'react';
3
3
  import { ComponentType } from 'react';
4
4
  import * as _btst_yar from '@btst/yar';
5
5
  import { QueryClient } from '@tanstack/react-query';
6
- import { A as AutoFormInputComponentProps } from '../../../shared/stack.BIh2AXaW.js';
7
- export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.AX5nZ6A3.js';
6
+ import { A as AutoFormInputComponentProps } from '../../../shared/stack.DGjhPqmF.js';
7
+ export { b as FormSchemaMetadata, F as FormStep, f as formSchemaToZod, a as getStepGroupMap, g as getSteps, h as hasSteps, z as zodToFormSchema } from '../../../shared/stack.Co034Fpm.js';
8
8
  import 'react-hook-form';
9
9
  import 'zod';
10
10
  import 'react/jsx-runtime';
@@ -1,26 +1,5 @@
1
1
  import { z } from 'zod';
2
2
 
3
- /**
4
- * Unified Schema Converter Module
5
- *
6
- * Provides consistent bidirectional conversion between Zod schemas and JSON Schema,
7
- * handling all edge cases in one place:
8
- *
9
- * 1. Date handling: z.date() ↔ { type: "string", format: "date-time" }
10
- * 2. Steps metadata: Preserves multi-step form configuration
11
- * 3. Step group mapping: Tracks which fields belong to which step
12
- * 4. Date constraints: Preserves min/max date validations
13
- *
14
- * Usage:
15
- * ```ts
16
- * // Zod → JSON Schema (for storage/transport)
17
- * const jsonSchema = zodToFormSchema(myZodSchema);
18
- *
19
- * // JSON Schema → Zod (for validation)
20
- * const zodSchema = formSchemaToZod(jsonSchema);
21
- * ```
22
- */
23
-
24
3
  interface FormStep {
25
4
  id: string;
26
5
  title: string;
@@ -1,26 +1,5 @@
1
1
  import { z } from 'zod';
2
2
 
3
- /**
4
- * Unified Schema Converter Module
5
- *
6
- * Provides consistent bidirectional conversion between Zod schemas and JSON Schema,
7
- * handling all edge cases in one place:
8
- *
9
- * 1. Date handling: z.date() ↔ { type: "string", format: "date-time" }
10
- * 2. Steps metadata: Preserves multi-step form configuration
11
- * 3. Step group mapping: Tracks which fields belong to which step
12
- * 4. Date constraints: Preserves min/max date validations
13
- *
14
- * Usage:
15
- * ```ts
16
- * // Zod → JSON Schema (for storage/transport)
17
- * const jsonSchema = zodToFormSchema(myZodSchema);
18
- *
19
- * // JSON Schema → Zod (for validation)
20
- * const zodSchema = formSchemaToZod(jsonSchema);
21
- * ```
22
- */
23
-
24
3
  interface FormStep {
25
4
  id: string;
26
5
  title: string;
@@ -1,26 +1,5 @@
1
1
  import { z } from 'zod';
2
2
 
3
- /**
4
- * Unified Schema Converter Module
5
- *
6
- * Provides consistent bidirectional conversion between Zod schemas and JSON Schema,
7
- * handling all edge cases in one place:
8
- *
9
- * 1. Date handling: z.date() ↔ { type: "string", format: "date-time" }
10
- * 2. Steps metadata: Preserves multi-step form configuration
11
- * 3. Step group mapping: Tracks which fields belong to which step
12
- * 4. Date constraints: Preserves min/max date validations
13
- *
14
- * Usage:
15
- * ```ts
16
- * // Zod → JSON Schema (for storage/transport)
17
- * const jsonSchema = zodToFormSchema(myZodSchema);
18
- *
19
- * // JSON Schema → Zod (for validation)
20
- * const zodSchema = formSchemaToZod(jsonSchema);
21
- * ```
22
- */
23
-
24
3
  interface FormStep {
25
4
  id: string;
26
5
  title: string;
@@ -29,15 +29,6 @@ declare const INPUT_COMPONENTS: {
29
29
  fallback: typeof AutoFormInput;
30
30
  };
31
31
 
32
- /**
33
- * Shared types between form-builder and auto-form.
34
- *
35
- * These types ensure consistency when:
36
- * - form-builder creates JSON Schema properties
37
- * - auto-form consumes JSON Schema properties
38
- * - inputProps flow from form-builder → JSON Schema → auto-form
39
- */
40
-
41
32
  /**
42
33
  * Common input props shared by all field types.
43
34
  */
@@ -29,15 +29,6 @@ declare const INPUT_COMPONENTS: {
29
29
  fallback: typeof AutoFormInput;
30
30
  };
31
31
 
32
- /**
33
- * Shared types between form-builder and auto-form.
34
- *
35
- * These types ensure consistency when:
36
- * - form-builder creates JSON Schema properties
37
- * - auto-form consumes JSON Schema properties
38
- * - inputProps flow from form-builder → JSON Schema → auto-form
39
- */
40
-
41
32
  /**
42
33
  * Common input props shared by all field types.
43
34
  */
@@ -29,15 +29,6 @@ declare const INPUT_COMPONENTS: {
29
29
  fallback: typeof AutoFormInput;
30
30
  };
31
31
 
32
- /**
33
- * Shared types between form-builder and auto-form.
34
- *
35
- * These types ensure consistency when:
36
- * - form-builder creates JSON Schema properties
37
- * - auto-form consumes JSON Schema properties
38
- * - inputProps flow from form-builder → JSON Schema → auto-form
39
- */
40
-
41
32
  /**
42
33
  * Common input props shared by all field types.
43
34
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btst/stack",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "A composable, plugin-based library for building full-stack applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -7,7 +7,7 @@ import type {
7
7
  FieldConfig,
8
8
  AutoFormInputComponentProps,
9
9
  } from "@workspace/ui/components/auto-form/types";
10
- import { buildFieldConfigFromJsonSchema as buildFieldConfigBase } from "@workspace/ui/components/auto-form/utils";
10
+ import { buildFieldConfigFromJsonSchema as buildFieldConfigBase } from "@workspace/ui/components/auto-form/helpers";
11
11
  import { formSchemaToZod } from "@workspace/ui/lib/schema-converter";
12
12
  import { Input } from "@workspace/ui/components/input";
13
13
  import { Label } from "@workspace/ui/components/label";
@@ -35,7 +35,7 @@ interface ContentFormProps {
35
35
  /**
36
36
  * Build field configuration for AutoForm with CMS-specific file upload handling.
37
37
  *
38
- * Uses the shared buildFieldConfigFromJsonSchema from auto-form/utils as a base,
38
+ * Uses the shared buildFieldConfigFromJsonSchema from auto-form/helpers as a base,
39
39
  * then adds special handling for "file" fieldType to inject CMSFileUpload component
40
40
  * ONLY if no custom component is provided via fieldComponents.
41
41
  *
@@ -3,7 +3,7 @@
3
3
  import { useState, useMemo, type ComponentType } from "react";
4
4
  import { usePluginOverrides } from "@btst/stack/context";
5
5
  import { SteppedAutoForm } from "@workspace/ui/components/auto-form/stepped-auto-form";
6
- import { buildFieldConfigFromJsonSchema } from "@workspace/ui/components/auto-form/utils";
6
+ import { buildFieldConfigFromJsonSchema } from "@workspace/ui/components/auto-form/helpers";
7
7
  import { formSchemaToZod } from "@workspace/ui/lib/schema-converter";
8
8
  import { Skeleton } from "@workspace/ui/components/skeleton";
9
9
  import { AlertCircle, CheckCircle } from "lucide-react";
@@ -35,10 +35,10 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
35
35
  }
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
- title: z.ZodString;
39
38
  slug: z.ZodOptional<z.ZodString>;
40
39
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
41
40
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
+ title: z.ZodString;
42
42
  content: z.ZodString;
43
43
  excerpt: z.ZodString;
44
44
  image: z.ZodOptional<z.ZodString>;
@@ -35,10 +35,10 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
35
35
  }
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
- title: z.ZodString;
39
38
  slug: z.ZodOptional<z.ZodString>;
40
39
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
41
40
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
+ title: z.ZodString;
42
42
  content: z.ZodString;
43
43
  excerpt: z.ZodString;
44
44
  image: z.ZodOptional<z.ZodString>;
@@ -35,10 +35,10 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
35
35
  }
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
- title: z.ZodString;
39
38
  slug: z.ZodOptional<z.ZodString>;
40
39
  published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
41
40
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
+ title: z.ZodString;
42
42
  content: z.ZodString;
43
43
  excerpt: z.ZodString;
44
44
  image: z.ZodOptional<z.ZodString>;