@timeax/form-palette 0.0.6 → 0.0.8

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.
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { RefObject, ComponentType } from 'react';
3
3
  import { z } from 'zod';
4
- import { Method, AdapterResult, AdapterKey, AdapterSubmit } from './adapters.mjs';
4
+ import { Method, AdapterResult, AdapterKey, AdapterProps, AdapterSubmit } from './adapters.mjs';
5
5
  export { AdapterCallbacks, AdapterConfig, AdapterError, AdapterFactory, AdapterOk, Adapters, NamedAdapterConfig, NamedAdapterFactory, createAxiosAdapter, createInertiaAdapter, getAdapter, hasAdapter, localAdapter, registerAdapter, registerAxiosAdapter, registerInertiaAdapter, registerKnownAdapter } from './adapters.mjs';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import { DayPicker } from 'react-day-picker';
@@ -346,7 +346,7 @@ type InferFromSchema<S, V extends Dict> = S extends z.ZodType ? z.infer<S> & Dic
346
346
  *
347
347
  * @template TValues Shape of the outbound data for this submit event.
348
348
  */
349
- type SubmitEvent<TValues extends Dict> = {
349
+ type SubmitEvent<TValues extends Dict, K extends AdapterKey> = {
350
350
  /**
351
351
  * Prevent the default submit behavior.
352
352
  *
@@ -361,16 +361,13 @@ type SubmitEvent<TValues extends Dict> = {
361
361
  */
362
362
  editData(cb: (data: TValues) => TValues | void): void;
363
363
  /**
364
- * Override the route/URL for this submission only.
364
+ * Override the config for this adapter submission only.
365
365
  *
366
366
  * The core itself does not enforce any semantics here; the host
367
367
  * is expected to interpret this when wiring submissions.
368
368
  */
369
- setRoute(route: string): void;
370
- /**
371
- * Override the HTTP method for this submission only.
372
- */
373
- setMethod(method: Method): void;
369
+ setConfig(props: Partial<AdapterProps<K>>): void;
370
+ setConfig(key: keyof AdapterProps<K>, value: any): void;
374
371
  /**
375
372
  * The button that triggered this submit, if any.
376
373
  */
@@ -396,7 +393,7 @@ type SubmitEvent<TValues extends Dict> = {
396
393
  * @template V Shape of the underlying value map (pre-schema).
397
394
  * @template S Optional Zod schema type.
398
395
  */
399
- type BaseProps$7<V extends Dict, S extends z.ZodType | undefined> = {
396
+ type BaseProps$7<V extends Dict, S extends z.ZodType | undefined, K extends AdapterKey> = {
400
397
  /**
401
398
  * Field names that should be ignored when building diffs or snapshots.
402
399
  * Useful for excluding secrets like passwords from logs.
@@ -461,7 +458,7 @@ type BaseProps$7<V extends Dict, S extends z.ZodType | undefined> = {
461
458
  * - change route/method/xhr flags,
462
459
  * - abort by setting e.continue = false.
463
460
  */
464
- onSubmit?<T extends Dict = InferFromSchema<S, V>>(e: SubmitEvent<T>): Promise<void> | void;
461
+ onSubmit?<T extends Dict = InferFromSchema<S, V>>(e: SubmitEvent<T, K>): Promise<void> | void;
465
462
  /**
466
463
  * Optional Zod schema used for validation and value inference.
467
464
  */
@@ -480,7 +477,7 @@ type BaseProps$7<V extends Dict, S extends z.ZodType | undefined> = {
480
477
  * @template S Optional Zod schema type.
481
478
  * @template K Adapter key; defaults to 'local'.
482
479
  */
483
- interface CoreProps<V extends Dict, S extends z.ZodType | undefined, K extends AdapterKey = "local"> extends BaseProps$7<V, S> {
480
+ type CoreProps<V extends Dict, S extends z.ZodType | undefined, K extends AdapterKey = "local"> = BaseProps$7<V, S, K> & AdapterProps<K> & {
484
481
  /**
485
482
  * Which adapter flavour this core instance should use.
486
483
  *
@@ -496,7 +493,7 @@ interface CoreProps<V extends Dict, S extends z.ZodType | undefined, K extends A
496
493
  * AdapterSubmit<'axios'> → host-defined type, etc.
497
494
  */
498
495
  onSubmitted?(form: CoreContext<InferFromSchema<S, V>>, payload: AdapterSubmit<K>, resolve?: () => void): void | Promise<void>;
499
- }
496
+ };
500
497
  /**
501
498
  * Backwards-compatible alias for legacy naming, if you want it.
502
499
  */
@@ -3251,13 +3248,13 @@ declare function CoreRoot(props: CoreRootProps): react_jsx_runtime.JSX.Element;
3251
3248
  * {...fields + buttons...}
3252
3249
  * </CoreShell>
3253
3250
  */
3254
- interface CoreShellProps<V extends Dict = Dict, S extends z.ZodType | undefined = z.ZodType | undefined, K extends AdapterKey = "local"> extends CoreProps<V, S, K> {
3251
+ type CoreShellProps<V extends Dict = Dict, S extends z.ZodType | undefined = z.ZodType | undefined, K extends AdapterKey = "local"> = CoreProps<V, S, K> & {
3255
3252
  /**
3256
3253
  * Props passed directly to the underlying <form> element via CoreRoot.
3257
3254
  */
3258
3255
  formProps?: CoreRootProps;
3259
3256
  children?: React.ReactNode;
3260
- }
3257
+ };
3261
3258
  declare function CoreShell<V extends Dict, S extends z.ZodType | undefined, K extends AdapterKey = "local">(props: CoreShellProps<V, S, K>): react_jsx_runtime.JSX.Element;
3262
3259
 
3263
3260
  interface UseButtonOptions {
@@ -3825,4 +3822,4 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
3825
3822
  }
3826
3823
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
3827
3824
 
3828
- export { AdapterKey, AdapterResult, AdapterSubmit, type BaseProps$7 as BaseProps, type ButtonRef, type CoreContext, type CoreProps, CoreProvider, type CoreShellProps, type DescriptionPlacement, type Dict, type EffectiveFieldLayout, type ErrorBag, type ErrorBagMapResult, ErrorStrip, type ErrorStripProps, type ErrorTextPlacement, type Field, type FieldLayoutConfig, type FieldOrdering, type FieldRootId, type FieldRoots, type FieldSlotId, type FieldSlots, CoreShell as Form, type FormProps, CoreRoot as FormRoot, type HelpTextPlacement, type InferFromSchema, Input, InputField, type InputFieldBaseProps, type InputFieldProps, InputMask, InputNumber, type InputStore, type LabelPlacement, type LayoutResolveContext, type LayoutResolver, Method, type RelativeRootsMap, type SlotPlacement, type SublabelPlacement, type SubmitEvent, Textarea, type UseButtonOptions, type UseButtonReturn, type UseFieldOptions, type UseFieldReturn, type UseFieldValidate, type ValidateResult, type ValuesResult, type VariantEntry, type VariantKey, type VariantLayoutDefaults, type VariantModule, type VariantModuleFor, type VariantPropsFor, type VariantValidateFn, type VariantValueFor, type Variants, type ZodErrorMapResult, getVariant, listVariants, mapErrorBag, mapZodError, registerCoreVariants, registerVariant, useButton, useCore, useCoreContext, useField, useOptionalField };
3825
+ export { AdapterKey, AdapterProps, AdapterResult, AdapterSubmit, type BaseProps$7 as BaseProps, type ButtonRef, type CoreContext, type CoreProps, CoreProvider, type CoreShellProps, type DescriptionPlacement, type Dict, type EffectiveFieldLayout, type ErrorBag, type ErrorBagMapResult, ErrorStrip, type ErrorStripProps, type ErrorTextPlacement, type Field, type FieldLayoutConfig, type FieldOrdering, type FieldRootId, type FieldRoots, type FieldSlotId, type FieldSlots, CoreShell as Form, type FormProps, CoreRoot as FormRoot, type HelpTextPlacement, type InferFromSchema, Input, InputField, type InputFieldBaseProps, type InputFieldProps, InputMask, InputNumber, type InputStore, type LabelPlacement, type LayoutResolveContext, type LayoutResolver, Method, type RelativeRootsMap, type SlotPlacement, type SublabelPlacement, type SubmitEvent, Textarea, type UseButtonOptions, type UseButtonReturn, type UseFieldOptions, type UseFieldReturn, type UseFieldValidate, type ValidateResult, type ValuesResult, type VariantEntry, type VariantKey, type VariantLayoutDefaults, type VariantModule, type VariantModuleFor, type VariantPropsFor, type VariantValidateFn, type VariantValueFor, type Variants, type ZodErrorMapResult, getVariant, listVariants, mapErrorBag, mapZodError, registerCoreVariants, registerVariant, useButton, useCore, useCoreContext, useField, useOptionalField };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { RefObject, ComponentType } from 'react';
3
3
  import { z } from 'zod';
4
- import { Method, AdapterResult, AdapterKey, AdapterSubmit } from './adapters.js';
4
+ import { Method, AdapterResult, AdapterKey, AdapterProps, AdapterSubmit } from './adapters.js';
5
5
  export { AdapterCallbacks, AdapterConfig, AdapterError, AdapterFactory, AdapterOk, Adapters, NamedAdapterConfig, NamedAdapterFactory, createAxiosAdapter, createInertiaAdapter, getAdapter, hasAdapter, localAdapter, registerAdapter, registerAxiosAdapter, registerInertiaAdapter, registerKnownAdapter } from './adapters.js';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import { DayPicker } from 'react-day-picker';
@@ -346,7 +346,7 @@ type InferFromSchema<S, V extends Dict> = S extends z.ZodType ? z.infer<S> & Dic
346
346
  *
347
347
  * @template TValues Shape of the outbound data for this submit event.
348
348
  */
349
- type SubmitEvent<TValues extends Dict> = {
349
+ type SubmitEvent<TValues extends Dict, K extends AdapterKey> = {
350
350
  /**
351
351
  * Prevent the default submit behavior.
352
352
  *
@@ -361,16 +361,13 @@ type SubmitEvent<TValues extends Dict> = {
361
361
  */
362
362
  editData(cb: (data: TValues) => TValues | void): void;
363
363
  /**
364
- * Override the route/URL for this submission only.
364
+ * Override the config for this adapter submission only.
365
365
  *
366
366
  * The core itself does not enforce any semantics here; the host
367
367
  * is expected to interpret this when wiring submissions.
368
368
  */
369
- setRoute(route: string): void;
370
- /**
371
- * Override the HTTP method for this submission only.
372
- */
373
- setMethod(method: Method): void;
369
+ setConfig(props: Partial<AdapterProps<K>>): void;
370
+ setConfig(key: keyof AdapterProps<K>, value: any): void;
374
371
  /**
375
372
  * The button that triggered this submit, if any.
376
373
  */
@@ -396,7 +393,7 @@ type SubmitEvent<TValues extends Dict> = {
396
393
  * @template V Shape of the underlying value map (pre-schema).
397
394
  * @template S Optional Zod schema type.
398
395
  */
399
- type BaseProps$7<V extends Dict, S extends z.ZodType | undefined> = {
396
+ type BaseProps$7<V extends Dict, S extends z.ZodType | undefined, K extends AdapterKey> = {
400
397
  /**
401
398
  * Field names that should be ignored when building diffs or snapshots.
402
399
  * Useful for excluding secrets like passwords from logs.
@@ -461,7 +458,7 @@ type BaseProps$7<V extends Dict, S extends z.ZodType | undefined> = {
461
458
  * - change route/method/xhr flags,
462
459
  * - abort by setting e.continue = false.
463
460
  */
464
- onSubmit?<T extends Dict = InferFromSchema<S, V>>(e: SubmitEvent<T>): Promise<void> | void;
461
+ onSubmit?<T extends Dict = InferFromSchema<S, V>>(e: SubmitEvent<T, K>): Promise<void> | void;
465
462
  /**
466
463
  * Optional Zod schema used for validation and value inference.
467
464
  */
@@ -480,7 +477,7 @@ type BaseProps$7<V extends Dict, S extends z.ZodType | undefined> = {
480
477
  * @template S Optional Zod schema type.
481
478
  * @template K Adapter key; defaults to 'local'.
482
479
  */
483
- interface CoreProps<V extends Dict, S extends z.ZodType | undefined, K extends AdapterKey = "local"> extends BaseProps$7<V, S> {
480
+ type CoreProps<V extends Dict, S extends z.ZodType | undefined, K extends AdapterKey = "local"> = BaseProps$7<V, S, K> & AdapterProps<K> & {
484
481
  /**
485
482
  * Which adapter flavour this core instance should use.
486
483
  *
@@ -496,7 +493,7 @@ interface CoreProps<V extends Dict, S extends z.ZodType | undefined, K extends A
496
493
  * AdapterSubmit<'axios'> → host-defined type, etc.
497
494
  */
498
495
  onSubmitted?(form: CoreContext<InferFromSchema<S, V>>, payload: AdapterSubmit<K>, resolve?: () => void): void | Promise<void>;
499
- }
496
+ };
500
497
  /**
501
498
  * Backwards-compatible alias for legacy naming, if you want it.
502
499
  */
@@ -3251,13 +3248,13 @@ declare function CoreRoot(props: CoreRootProps): react_jsx_runtime.JSX.Element;
3251
3248
  * {...fields + buttons...}
3252
3249
  * </CoreShell>
3253
3250
  */
3254
- interface CoreShellProps<V extends Dict = Dict, S extends z.ZodType | undefined = z.ZodType | undefined, K extends AdapterKey = "local"> extends CoreProps<V, S, K> {
3251
+ type CoreShellProps<V extends Dict = Dict, S extends z.ZodType | undefined = z.ZodType | undefined, K extends AdapterKey = "local"> = CoreProps<V, S, K> & {
3255
3252
  /**
3256
3253
  * Props passed directly to the underlying <form> element via CoreRoot.
3257
3254
  */
3258
3255
  formProps?: CoreRootProps;
3259
3256
  children?: React.ReactNode;
3260
- }
3257
+ };
3261
3258
  declare function CoreShell<V extends Dict, S extends z.ZodType | undefined, K extends AdapterKey = "local">(props: CoreShellProps<V, S, K>): react_jsx_runtime.JSX.Element;
3262
3259
 
3263
3260
  interface UseButtonOptions {
@@ -3825,4 +3822,4 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
3825
3822
  }
3826
3823
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
3827
3824
 
3828
- export { AdapterKey, AdapterResult, AdapterSubmit, type BaseProps$7 as BaseProps, type ButtonRef, type CoreContext, type CoreProps, CoreProvider, type CoreShellProps, type DescriptionPlacement, type Dict, type EffectiveFieldLayout, type ErrorBag, type ErrorBagMapResult, ErrorStrip, type ErrorStripProps, type ErrorTextPlacement, type Field, type FieldLayoutConfig, type FieldOrdering, type FieldRootId, type FieldRoots, type FieldSlotId, type FieldSlots, CoreShell as Form, type FormProps, CoreRoot as FormRoot, type HelpTextPlacement, type InferFromSchema, Input, InputField, type InputFieldBaseProps, type InputFieldProps, InputMask, InputNumber, type InputStore, type LabelPlacement, type LayoutResolveContext, type LayoutResolver, Method, type RelativeRootsMap, type SlotPlacement, type SublabelPlacement, type SubmitEvent, Textarea, type UseButtonOptions, type UseButtonReturn, type UseFieldOptions, type UseFieldReturn, type UseFieldValidate, type ValidateResult, type ValuesResult, type VariantEntry, type VariantKey, type VariantLayoutDefaults, type VariantModule, type VariantModuleFor, type VariantPropsFor, type VariantValidateFn, type VariantValueFor, type Variants, type ZodErrorMapResult, getVariant, listVariants, mapErrorBag, mapZodError, registerCoreVariants, registerVariant, useButton, useCore, useCoreContext, useField, useOptionalField };
3825
+ export { AdapterKey, AdapterProps, AdapterResult, AdapterSubmit, type BaseProps$7 as BaseProps, type ButtonRef, type CoreContext, type CoreProps, CoreProvider, type CoreShellProps, type DescriptionPlacement, type Dict, type EffectiveFieldLayout, type ErrorBag, type ErrorBagMapResult, ErrorStrip, type ErrorStripProps, type ErrorTextPlacement, type Field, type FieldLayoutConfig, type FieldOrdering, type FieldRootId, type FieldRoots, type FieldSlotId, type FieldSlots, CoreShell as Form, type FormProps, CoreRoot as FormRoot, type HelpTextPlacement, type InferFromSchema, Input, InputField, type InputFieldBaseProps, type InputFieldProps, InputMask, InputNumber, type InputStore, type LabelPlacement, type LayoutResolveContext, type LayoutResolver, Method, type RelativeRootsMap, type SlotPlacement, type SublabelPlacement, type SubmitEvent, Textarea, type UseButtonOptions, type UseButtonReturn, type UseFieldOptions, type UseFieldReturn, type UseFieldValidate, type ValidateResult, type ValuesResult, type VariantEntry, type VariantKey, type VariantLayoutDefaults, type VariantModule, type VariantModuleFor, type VariantPropsFor, type VariantValidateFn, type VariantValueFor, type Variants, type ZodErrorMapResult, getVariant, listVariants, mapErrorBag, mapZodError, registerCoreVariants, registerVariant, useButton, useCore, useCoreContext, useField, useOptionalField };
package/dist/index.js CHANGED
@@ -13433,6 +13433,25 @@ var FieldRegistry = class {
13433
13433
  }
13434
13434
  };
13435
13435
  _binding = new WeakMap();
13436
+ var CORE_PROP_KEYS = /* @__PURE__ */ new Set([
13437
+ "adapter",
13438
+ "schema",
13439
+ "exceptions",
13440
+ "persist",
13441
+ "name",
13442
+ "activateButtonOnChange",
13443
+ "onChange",
13444
+ "onUpdate",
13445
+ "changeBefore",
13446
+ "formRef",
13447
+ "valueBag",
13448
+ "valueFeed",
13449
+ "onFinish",
13450
+ "init",
13451
+ "onSubmit",
13452
+ "onSubmitted",
13453
+ "children"
13454
+ ]);
13436
13455
  function isPlainObject(value) {
13437
13456
  return typeof value === "object" && value !== null && !Array.isArray(value);
13438
13457
  }
@@ -13593,7 +13612,16 @@ function CoreProvider(props) {
13593
13612
  }
13594
13613
  return valid;
13595
13614
  }
13596
- async function submitWithAdapter(method, route, extra, ignoreForm, autoErr = true, autoRun = true) {
13615
+ function getAdapterPropsFrom(current) {
13616
+ const result = {};
13617
+ for (const key in current) {
13618
+ if (!CORE_PROP_KEYS.has(key)) {
13619
+ result[key] = current[key];
13620
+ }
13621
+ }
13622
+ return result;
13623
+ }
13624
+ async function submitWithAdapter(adapterOverride, extra, ignoreForm, autoErr = true, autoRun = true) {
13597
13625
  var _a2, _b;
13598
13626
  const currentProps = propsRef.current;
13599
13627
  const btn = buttonRef.current;
@@ -13625,6 +13653,10 @@ function CoreProvider(props) {
13625
13653
  ...collectValues(),
13626
13654
  ...extra != null ? extra : {}
13627
13655
  };
13656
+ let adapterConfig = {
13657
+ ...getAdapterPropsFrom(currentProps),
13658
+ ...adapterOverride
13659
+ };
13628
13660
  const event = {
13629
13661
  preventDefault() {
13630
13662
  this.continue = false;
@@ -13635,11 +13667,15 @@ function CoreProvider(props) {
13635
13667
  submissionValues = result;
13636
13668
  }
13637
13669
  },
13638
- setRoute(newRoute) {
13639
- route = newRoute;
13640
- },
13641
- setMethod(newMethod) {
13642
- method = newMethod;
13670
+ setConfig(arg1, arg2) {
13671
+ if (typeof arg1 === "string") {
13672
+ adapterConfig[arg1] = arg2;
13673
+ } else if (arg1 && typeof arg1 === "object") {
13674
+ adapterConfig = {
13675
+ ...adapterConfig,
13676
+ ...arg1
13677
+ };
13678
+ }
13643
13679
  },
13644
13680
  button: (_a2 = buttonRef.current) != null ? _a2 : void 0,
13645
13681
  get formData() {
@@ -13662,8 +13698,9 @@ function CoreProvider(props) {
13662
13698
  }
13663
13699
  const factory2 = (_b = getAdapter(adapterKey)) != null ? _b : localAdapter;
13664
13700
  const adapter2 = factory2({
13665
- method,
13666
- url: route,
13701
+ // adapter-specific config (url, method, config, etc.)
13702
+ ...adapterConfig,
13703
+ // core config
13667
13704
  data: submissionValues,
13668
13705
  callbacks: {
13669
13706
  onSuccess(ok) {
@@ -13823,9 +13860,12 @@ function CoreProvider(props) {
13823
13860
  return !deepEqual(original, current);
13824
13861
  },
13825
13862
  async prepare(type, route, extra, ignoreForm, autoErr) {
13863
+ const override = {
13864
+ method: type,
13865
+ url: route
13866
+ };
13826
13867
  return submitWithAdapter(
13827
- type,
13828
- route,
13868
+ override,
13829
13869
  extra,
13830
13870
  ignoreForm,
13831
13871
  autoErr,
@@ -13931,7 +13971,13 @@ function CoreProvider(props) {
13931
13971
  }
13932
13972
  },
13933
13973
  go(data, ignoreForm) {
13934
- void submitWithAdapter("post", "", data, ignoreForm, true, true);
13974
+ void submitWithAdapter(
13975
+ void 0,
13976
+ data,
13977
+ ignoreForm,
13978
+ true,
13979
+ true
13980
+ );
13935
13981
  },
13936
13982
  reset(inputs) {
13937
13983
  if (!inputs.length) return;
@@ -13953,7 +13999,13 @@ function CoreProvider(props) {
13953
13999
  buttonRef.current = btn;
13954
14000
  },
13955
14001
  async forceSubmit() {
13956
- await submitWithAdapter("post", "", void 0, false, true, true);
14002
+ await submitWithAdapter(
14003
+ void 0,
14004
+ void 0,
14005
+ false,
14006
+ true,
14007
+ true
14008
+ );
13957
14009
  },
13958
14010
  get fields() {
13959
14011
  return fetchAllNamedFields();
@@ -18365,7 +18417,7 @@ var Input = React54__namespace.forwardRef(
18365
18417
  );
18366
18418
  const baseBoxClasses = cx(
18367
18419
  "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30",
18368
- "border-input w-full min-w-0 rounded-md border bg-transparent shadow-xs",
18420
+ "border-input w-full min-w-0 rounded-md border bg-[var(--surfaces-input, transparent)] shadow-xs",
18369
18421
  "transition-[color,box-shadow] outline-none",
18370
18422
  "file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium",
18371
18423
  "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
@@ -26356,7 +26408,7 @@ function SelectTrigger2({
26356
26408
  "data-slot": "select-trigger",
26357
26409
  "data-size": size4,
26358
26410
  className: cn(
26359
- "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
26411
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-[var(--surfaces-input, transparent)] px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
26360
26412
  className
26361
26413
  ),
26362
26414
  ...props,
@@ -33502,7 +33554,7 @@ var Textarea = React54__namespace.forwardRef(
33502
33554
  const frameClasses = cn(
33503
33555
  "border-input placeholder:text-muted-foreground focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",
33504
33556
  "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
33505
- "dark:bg-input/30 rounded-md border bg-transparent shadow-xs transition-[color,box-shadow] outline-none",
33557
+ "dark:bg-input/30 rounded-md border bg-[var(--surfaces-input, transparent)] shadow-xs transition-[color,box-shadow] outline-none",
33506
33558
  "disabled:cursor-not-allowed disabled:opacity-50"
33507
33559
  );
33508
33560
  const framePaddingClasses = cn(
@@ -41564,7 +41616,7 @@ var ShadcnFileVariant = React54__namespace.forwardRef(
41564
41616
  className: cn(
41565
41617
  "relative flex w-full cursor-pointer items-center gap-2 px-3 transition-all",
41566
41618
  heightCls,
41567
- (!joinControls || !hasExternalControls) && "rounded-md border border-input bg-background shadow-xs ring-offset-background hover:bg-accent/5 focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
41619
+ (!joinControls || !hasExternalControls) && "rounded-md border border-input bg-[var(--surfaces-input, transparent)] shadow-xs ring-offset-background hover:bg-accent/5 focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
41568
41620
  dragOver && "border-primary ring-2 ring-primary/20",
41569
41621
  isDisabled && "cursor-not-allowed opacity-50",
41570
41622
  error && "border-destructive text-destructive",
@@ -41767,7 +41819,7 @@ var ShadcnFileVariant = React54__namespace.forwardRef(
41767
41819
  children: [
41768
41820
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(
41769
41821
  "flex w-full",
41770
- joinControls && extendBoxToControls && !showDropArea ? "items-stretch rounded-md border border-input bg-background shadow-xs ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2" : "items-start gap-2"
41822
+ joinControls && extendBoxToControls && !showDropArea ? "items-stretch rounded-md border border-input bg-[var(--surfaces-input, transparent)] shadow-xs ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2" : "items-start gap-2"
41771
41823
  ), children: [
41772
41824
  leadingControl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
41773
41825
  "flex items-center",
@@ -41905,7 +41957,7 @@ function FieldGroup({ className, ...props }) {
41905
41957
  {
41906
41958
  "data-slot": "field-group",
41907
41959
  className: cn(
41908
- "group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
41960
+ "group/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
41909
41961
  className
41910
41962
  ),
41911
41963
  ...props
@@ -42456,6 +42508,22 @@ function InputField(props) {
42456
42508
  }),
42457
42509
  [layout, sublabel, description, helpText, visualError, tagsContent]
42458
42510
  );
42511
+ const hasLabelSlotsAt = (placement) => {
42512
+ let found = false;
42513
+ graph.getSlotsFor("label", placement).render((slots) => {
42514
+ if (slots.length > 0) {
42515
+ found = true;
42516
+ }
42517
+ return null;
42518
+ });
42519
+ return found;
42520
+ };
42521
+ const hasLabelLeftSlots = hasLabelSlotsAt("left");
42522
+ const hasLabelRightSlots = hasLabelSlotsAt("right");
42523
+ const hasLabelAboveSlots = hasLabelSlotsAt("above");
42524
+ const hasLabelBelowSlots = hasLabelSlotsAt("below");
42525
+ const hasAnyLabelBlockContent = !!label || hasLabelLeftSlots || hasLabelRightSlots || hasLabelAboveSlots || hasLabelBelowSlots;
42526
+ const hasLabelRowContent = !!label || hasLabelLeftSlots || hasLabelRightSlots;
42459
42527
  const inlineLabelSide = lp === "right" ? "right" : lp === "hidden" ? "hidden" : "left";
42460
42528
  const inlineInputColClass = [
42461
42529
  isCompactInline ? "flex-none" : "flex-1 min-w-0",
@@ -42503,7 +42571,7 @@ function InputField(props) {
42503
42571
  )
42504
42572
  )
42505
42573
  ] });
42506
- const inlineLabelColumn = inlineLabelSide === "hidden" ? null : /* @__PURE__ */ jsxRuntime.jsxs(
42574
+ const inlineLabelColumn = inlineLabelSide === "hidden" || !hasAnyLabelBlockContent ? null : /* @__PURE__ */ jsxRuntime.jsxs(
42507
42575
  "div",
42508
42576
  {
42509
42577
  className: ["flex flex-col gap-0", inlineLabelColClass].filter(Boolean).join(" "),
@@ -42513,7 +42581,7 @@ function InputField(props) {
42513
42581
  (slot) => renderHelperSlot("label", slot, classes)
42514
42582
  )
42515
42583
  ),
42516
- /* @__PURE__ */ jsxRuntime.jsxs(
42584
+ hasLabelRowContent && /* @__PURE__ */ jsxRuntime.jsxs(
42517
42585
  "div",
42518
42586
  {
42519
42587
  className: [
@@ -42540,7 +42608,16 @@ function InputField(props) {
42540
42608
  children: /* @__PURE__ */ jsxRuntime.jsxs(FieldTitle, { children: [
42541
42609
  label,
42542
42610
  " ",
42543
- required ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-destructive", classes == null ? void 0 : classes.required), children: "*" }) : ""
42611
+ required ? /* @__PURE__ */ jsxRuntime.jsx(
42612
+ "span",
42613
+ {
42614
+ className: cn(
42615
+ "text-destructive",
42616
+ classes == null ? void 0 : classes.required
42617
+ ),
42618
+ children: "*"
42619
+ }
42620
+ ) : ""
42544
42621
  ] })
42545
42622
  }
42546
42623
  ),
@@ -42566,7 +42643,11 @@ function InputField(props) {
42566
42643
  "flex items-start gap-2",
42567
42644
  classes == null ? void 0 : classes.inlineRow
42568
42645
  ].filter(Boolean).join(" ");
42569
- const stackedGroupClassName = ["mt-1", classes == null ? void 0 : classes.group].filter(Boolean).join(" ");
42646
+ const hasStackedLabelBlock = lp !== "hidden" && hasAnyLabelBlockContent;
42647
+ const stackedGroupClassName = [
42648
+ hasStackedLabelBlock && hasLabelRowContent ? "mt-1" : null,
42649
+ classes == null ? void 0 : classes.group
42650
+ ].filter(Boolean).join(" ");
42570
42651
  const Element2 = contain ? "div" : React54__namespace.Fragment;
42571
42652
  const attrs = (a = "l") => contain ? a === "l" ? { className: "p-4 border-b border-input" } : { className: "px-4 pt-2 pb-4" } : {};
42572
42653
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -42602,7 +42683,7 @@ function InputField(props) {
42602
42683
  ) : (
42603
42684
  // STACKED MODE
42604
42685
  /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
42605
- lp !== "hidden" && /* @__PURE__ */ jsxRuntime.jsxs(Element2, { ...attrs(), children: [
42686
+ hasStackedLabelBlock && /* @__PURE__ */ jsxRuntime.jsxs(Element2, { ...attrs(), children: [
42606
42687
  graph.getSlotsFor("label", "above").render(
42607
42688
  (slots) => slots.map(
42608
42689
  (slot) => renderHelperSlot(
@@ -42612,7 +42693,7 @@ function InputField(props) {
42612
42693
  )
42613
42694
  )
42614
42695
  ),
42615
- /* @__PURE__ */ jsxRuntime.jsxs(
42696
+ hasLabelRowContent && /* @__PURE__ */ jsxRuntime.jsxs(
42616
42697
  "div",
42617
42698
  {
42618
42699
  className: [
@@ -42639,7 +42720,16 @@ function InputField(props) {
42639
42720
  children: /* @__PURE__ */ jsxRuntime.jsxs(FieldTitle, { children: [
42640
42721
  label,
42641
42722
  " ",
42642
- required ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-destructive", classes == null ? void 0 : classes.required), children: "*" }) : ""
42723
+ required ? /* @__PURE__ */ jsxRuntime.jsx(
42724
+ "span",
42725
+ {
42726
+ className: cn(
42727
+ "text-destructive",
42728
+ classes == null ? void 0 : classes.required
42729
+ ),
42730
+ children: "*"
42731
+ }
42732
+ ) : ""
42643
42733
  ] })
42644
42734
  }
42645
42735
  ),
@@ -42798,7 +42888,7 @@ function normalizeInertiaError(raw) {
42798
42888
  return raw;
42799
42889
  }
42800
42890
  var createInertiaAdapter = (config3) => {
42801
- const { method, url, data, callbacks } = config3;
42891
+ const { method = "post", url, data, callbacks } = config3;
42802
42892
  const upperMethod = method.toUpperCase();
42803
42893
  function buildOptions(resolve, reject, extraOptions) {
42804
42894
  const merged = {