@timeax/form-palette 0.0.37 → 0.0.39

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,5 +1,5 @@
1
- import { D as Dict, C as CoreProps, a as CoreContext, F as Field, V as VariantKey, L as LabelPlacement, S as SublabelPlacement, b as DescriptionPlacement, H as HelpTextPlacement, E as ErrorTextPlacement, c as SlotPlacement, d as FieldSize, e as FieldDensity, f as ValidateResult, g as ChangeDetail, h as VariantValueFor, i as VariantPropsFor, j as VariantModule } from './variant-BYqslKTy.mjs';
2
- export { B as BaseProps, p as ButtonRef, w as EffectiveFieldLayout, v as FieldLayoutConfig, u as FieldOrdering, t as FieldRootId, r as FieldRoots, s as FieldSlotId, q as FieldSlots, m as FormProps, k as InferFromSchema, I as InputNumber, o as InputStore, x as LayoutResolveContext, y as LayoutResolver, R as RelativeRootsMap, l as SubmitEvent, T as Textarea, n as ValuesResult, z as VariantEntry, J as VariantLayoutDefaults, K as VariantModuleFor, G as VariantValidateFn, A as Variants } from './variant-BYqslKTy.mjs';
1
+ import { D as Dict, C as CoreProps, a as CoreContext, F as Field, V as VariantKey, L as LabelPlacement, S as SublabelPlacement, b as DescriptionPlacement, H as HelpTextPlacement, E as ErrorTextPlacement, c as SlotPlacement, d as FieldSize, e as FieldDensity, f as ValidateResult, g as ChangeDetail, h as VariantValueFor, i as VariantPropsFor, j as VariantModule, P as PhoneCountry, k as PasswordDefinitionMap, l as CustomFileLoader } from './variant-aFXJGBXI.mjs';
2
+ export { B as BaseProps, r as ButtonRef, y as EffectiveFieldLayout, x as FieldLayoutConfig, w as FieldOrdering, v as FieldRootId, t as FieldRoots, u as FieldSlotId, s as FieldSlots, o as FormProps, m as InferFromSchema, I as InputNumber, q as InputStore, z as LayoutResolveContext, A as LayoutResolver, R as RelativeRootsMap, n as SubmitEvent, T as Textarea, p as ValuesResult, G as VariantEntry, M as VariantLayoutDefaults, N as VariantModuleFor, K as VariantValidateFn, J as Variants } from './variant-aFXJGBXI.mjs';
3
3
  import { A as AdapterKey } from './adapter-CvjXO9Gi.mjs';
4
4
  export { a as AdapterCallbacks, c as AdapterConfig, h as AdapterError, d as AdapterFactory, g as AdapterOk, f as AdapterProps, b as AdapterResult, i as AdapterSubmit, e as Adapters, M as Method, N as NamedAdapterConfig, j as NamedAdapterFactory } from './adapter-CvjXO9Gi.mjs';
5
5
  export { createAxiosAdapter, createInertiaAdapter, getAdapter, hasAdapter, localAdapter, registerAdapter, registerAllAdapters, registerAxiosAdapter, registerInertiaAdapter, registerKnownAdapter } from './adapters.mjs';
@@ -384,35 +384,15 @@ type ZodErrorMapResult = {
384
384
  declare function mapZodError(error: $ZodError): ZodErrorMapResult;
385
385
 
386
386
  interface ErrorStripProps extends React.HTMLAttributes<HTMLElement> {
387
- /**
388
- * Optional explicit form context. If omitted, the strip will use
389
- * the nearest CoreProvider via useCore().
390
- */
391
387
  form?: CoreContext<Dict>;
392
- /**
393
- * Optional explicit messages. If provided, these are used instead of
394
- * form.getUncaught().
395
- */
396
388
  messages?: readonly string[];
397
- /**
398
- * Custom renderer for each message.
399
- */
400
389
  renderMessage?: (message: string, index: number) => React.ReactNode;
401
- /**
402
- * Wrapper element type. Defaults to "div".
403
- */
404
390
  as?: React.ElementType;
405
- /**
406
- * Props forwarded to the inner <ul> element.
407
- */
408
391
  listProps?: React.HTMLAttributes<HTMLUListElement>;
392
+ dismissible?: boolean;
393
+ onDismiss?: () => void;
394
+ title?: string;
409
395
  }
410
- /**
411
- * Simple global/uncaught error renderer.
412
- *
413
- * Reads messages from `form.getUncaught()` (unless `messages` is provided)
414
- * and renders them as a list.
415
- */
416
396
  declare function ErrorStrip(props: ErrorStripProps): react_jsx_runtime.JSX.Element | null;
417
397
 
418
398
  /**
@@ -696,4 +676,26 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
696
676
  }
697
677
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
698
678
 
699
- export { AdapterKey, CoreContext, CoreProps, CoreProvider, type CoreShellProps, DescriptionPlacement, Dict, type ErrorBag, type ErrorBagMapResult, ErrorStrip, type ErrorStripProps, ErrorTextPlacement, Field, CoreShell as Form, CoreRoot as FormRoot, HelpTextPlacement, Input, InputField, type InputFieldBaseProps, type InputFieldProps, InputMask, LabelPlacement, SlotPlacement, SublabelPlacement, type UseButtonOptions, type UseButtonReturn, type UseFieldOptions, type UseFieldReturn, type UseFieldValidate, ValidateResult, VariantKey, VariantModule, VariantPropsFor, VariantValueFor, type ZodErrorMapResult, getVariant, listVariants, mapErrorBag, mapZodError, registerCoreVariants, registerVariant, useButton, useCore, useCoreContext, useField, useOptionalField };
679
+ interface PaletteRegistry {
680
+ countries: PhoneCountry[];
681
+ ruleDefinition: PasswordDefinitionMap;
682
+ customLoader: CustomFileLoader;
683
+ getCountries: () => Promise<PhoneCountry[]>;
684
+ }
685
+ declare global {
686
+ interface Window {
687
+ "form-palette"?: Partial<PaletteRegistry>;
688
+ }
689
+ }
690
+ /**
691
+ * Registers a value to the global window['form-palette'] object.
692
+ * Safe to call in SSR environments (it will just no-op).
693
+ */
694
+ declare function registerPaletteUtil<K extends keyof PaletteRegistry>(key: K, value: PaletteRegistry[K]): void;
695
+ /**
696
+ * Retrieves a value from the global window['form-palette'] object.
697
+ * Returns the value if found, otherwise returns the optional defaultValue or undefined.
698
+ */
699
+ declare function getPaletteUtil<K extends keyof PaletteRegistry>(key: K, defaultValue?: PaletteRegistry[K]): PaletteRegistry[K] | undefined;
700
+
701
+ export { AdapterKey, CoreContext, CoreProps, CoreProvider, type CoreShellProps, DescriptionPlacement, Dict, type ErrorBag, type ErrorBagMapResult, ErrorStrip, type ErrorStripProps, ErrorTextPlacement, Field, CoreShell as Form, CoreRoot as FormRoot, HelpTextPlacement, Input, InputField, type InputFieldBaseProps, type InputFieldProps, InputMask, LabelPlacement, SlotPlacement, SublabelPlacement, type UseButtonOptions, type UseButtonReturn, type UseFieldOptions, type UseFieldReturn, type UseFieldValidate, ValidateResult, VariantKey, VariantModule, VariantPropsFor, VariantValueFor, type ZodErrorMapResult, getPaletteUtil, getVariant, listVariants, mapErrorBag, mapZodError, registerCoreVariants, registerPaletteUtil, registerVariant, useButton, useCore, useCoreContext, useField, useOptionalField };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as Dict, C as CoreProps, a as CoreContext, F as Field, V as VariantKey, L as LabelPlacement, S as SublabelPlacement, b as DescriptionPlacement, H as HelpTextPlacement, E as ErrorTextPlacement, c as SlotPlacement, d as FieldSize, e as FieldDensity, f as ValidateResult, g as ChangeDetail, h as VariantValueFor, i as VariantPropsFor, j as VariantModule } from './variant-DLlGPgPJ.js';
2
- export { B as BaseProps, p as ButtonRef, w as EffectiveFieldLayout, v as FieldLayoutConfig, u as FieldOrdering, t as FieldRootId, r as FieldRoots, s as FieldSlotId, q as FieldSlots, m as FormProps, k as InferFromSchema, I as InputNumber, o as InputStore, x as LayoutResolveContext, y as LayoutResolver, R as RelativeRootsMap, l as SubmitEvent, T as Textarea, n as ValuesResult, z as VariantEntry, J as VariantLayoutDefaults, K as VariantModuleFor, G as VariantValidateFn, A as Variants } from './variant-DLlGPgPJ.js';
1
+ import { D as Dict, C as CoreProps, a as CoreContext, F as Field, V as VariantKey, L as LabelPlacement, S as SublabelPlacement, b as DescriptionPlacement, H as HelpTextPlacement, E as ErrorTextPlacement, c as SlotPlacement, d as FieldSize, e as FieldDensity, f as ValidateResult, g as ChangeDetail, h as VariantValueFor, i as VariantPropsFor, j as VariantModule, P as PhoneCountry, k as PasswordDefinitionMap, l as CustomFileLoader } from './variant-Jrd0I0Ey.js';
2
+ export { B as BaseProps, r as ButtonRef, y as EffectiveFieldLayout, x as FieldLayoutConfig, w as FieldOrdering, v as FieldRootId, t as FieldRoots, u as FieldSlotId, s as FieldSlots, o as FormProps, m as InferFromSchema, I as InputNumber, q as InputStore, z as LayoutResolveContext, A as LayoutResolver, R as RelativeRootsMap, n as SubmitEvent, T as Textarea, p as ValuesResult, G as VariantEntry, M as VariantLayoutDefaults, N as VariantModuleFor, K as VariantValidateFn, J as Variants } from './variant-Jrd0I0Ey.js';
3
3
  import { A as AdapterKey } from './adapter-CvjXO9Gi.js';
4
4
  export { a as AdapterCallbacks, c as AdapterConfig, h as AdapterError, d as AdapterFactory, g as AdapterOk, f as AdapterProps, b as AdapterResult, i as AdapterSubmit, e as Adapters, M as Method, N as NamedAdapterConfig, j as NamedAdapterFactory } from './adapter-CvjXO9Gi.js';
5
5
  export { createAxiosAdapter, createInertiaAdapter, getAdapter, hasAdapter, localAdapter, registerAdapter, registerAllAdapters, registerAxiosAdapter, registerInertiaAdapter, registerKnownAdapter } from './adapters.js';
@@ -384,35 +384,15 @@ type ZodErrorMapResult = {
384
384
  declare function mapZodError(error: $ZodError): ZodErrorMapResult;
385
385
 
386
386
  interface ErrorStripProps extends React.HTMLAttributes<HTMLElement> {
387
- /**
388
- * Optional explicit form context. If omitted, the strip will use
389
- * the nearest CoreProvider via useCore().
390
- */
391
387
  form?: CoreContext<Dict>;
392
- /**
393
- * Optional explicit messages. If provided, these are used instead of
394
- * form.getUncaught().
395
- */
396
388
  messages?: readonly string[];
397
- /**
398
- * Custom renderer for each message.
399
- */
400
389
  renderMessage?: (message: string, index: number) => React.ReactNode;
401
- /**
402
- * Wrapper element type. Defaults to "div".
403
- */
404
390
  as?: React.ElementType;
405
- /**
406
- * Props forwarded to the inner <ul> element.
407
- */
408
391
  listProps?: React.HTMLAttributes<HTMLUListElement>;
392
+ dismissible?: boolean;
393
+ onDismiss?: () => void;
394
+ title?: string;
409
395
  }
410
- /**
411
- * Simple global/uncaught error renderer.
412
- *
413
- * Reads messages from `form.getUncaught()` (unless `messages` is provided)
414
- * and renders them as a list.
415
- */
416
396
  declare function ErrorStrip(props: ErrorStripProps): react_jsx_runtime.JSX.Element | null;
417
397
 
418
398
  /**
@@ -696,4 +676,26 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
696
676
  }
697
677
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
698
678
 
699
- export { AdapterKey, CoreContext, CoreProps, CoreProvider, type CoreShellProps, DescriptionPlacement, Dict, type ErrorBag, type ErrorBagMapResult, ErrorStrip, type ErrorStripProps, ErrorTextPlacement, Field, CoreShell as Form, CoreRoot as FormRoot, HelpTextPlacement, Input, InputField, type InputFieldBaseProps, type InputFieldProps, InputMask, LabelPlacement, SlotPlacement, SublabelPlacement, type UseButtonOptions, type UseButtonReturn, type UseFieldOptions, type UseFieldReturn, type UseFieldValidate, ValidateResult, VariantKey, VariantModule, VariantPropsFor, VariantValueFor, type ZodErrorMapResult, getVariant, listVariants, mapErrorBag, mapZodError, registerCoreVariants, registerVariant, useButton, useCore, useCoreContext, useField, useOptionalField };
679
+ interface PaletteRegistry {
680
+ countries: PhoneCountry[];
681
+ ruleDefinition: PasswordDefinitionMap;
682
+ customLoader: CustomFileLoader;
683
+ getCountries: () => Promise<PhoneCountry[]>;
684
+ }
685
+ declare global {
686
+ interface Window {
687
+ "form-palette"?: Partial<PaletteRegistry>;
688
+ }
689
+ }
690
+ /**
691
+ * Registers a value to the global window['form-palette'] object.
692
+ * Safe to call in SSR environments (it will just no-op).
693
+ */
694
+ declare function registerPaletteUtil<K extends keyof PaletteRegistry>(key: K, value: PaletteRegistry[K]): void;
695
+ /**
696
+ * Retrieves a value from the global window['form-palette'] object.
697
+ * Returns the value if found, otherwise returns the optional defaultValue or undefined.
698
+ */
699
+ declare function getPaletteUtil<K extends keyof PaletteRegistry>(key: K, defaultValue?: PaletteRegistry[K]): PaletteRegistry[K] | undefined;
700
+
701
+ export { AdapterKey, CoreContext, CoreProps, CoreProvider, type CoreShellProps, DescriptionPlacement, Dict, type ErrorBag, type ErrorBagMapResult, ErrorStrip, type ErrorStripProps, ErrorTextPlacement, Field, CoreShell as Form, CoreRoot as FormRoot, HelpTextPlacement, Input, InputField, type InputFieldBaseProps, type InputFieldProps, InputMask, LabelPlacement, SlotPlacement, SublabelPlacement, type UseButtonOptions, type UseButtonReturn, type UseFieldOptions, type UseFieldReturn, type UseFieldValidate, ValidateResult, VariantKey, VariantModule, VariantPropsFor, VariantValueFor, type ZodErrorMapResult, getPaletteUtil, getVariant, listVariants, mapErrorBag, mapZodError, registerCoreVariants, registerPaletteUtil, registerVariant, useButton, useCore, useCoreContext, useField, useOptionalField };