@timeax/form-palette 0.2.0 → 0.2.2

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, P as PhoneCountry, k as PasswordDefinitionMap, l as CustomFileLoader, m as FileItem } from './core-DQr56obQ.mjs';
2
- export { B as BaseProps, s as ButtonRef, z as EffectiveFieldLayout, y as FieldLayoutConfig, x as FieldOrdering, w as FieldRootId, u as FieldRoots, v as FieldSlotId, t as FieldSlots, p as FormProps, n as InferFromSchema, I as InputNumber, r as InputStore, A as LayoutResolveContext, G as LayoutResolver, R as RelativeRootsMap, o as SubmitEvent, T as Textarea, q as ValuesResult, J as VariantEntry, N as VariantLayoutDefaults, O as VariantModuleFor, M as VariantValidateFn, K as Variants } from './core-DQr56obQ.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, m as FileItem } from './core-ClbfF5iz.mjs';
2
+ export { B as BaseProps, s as ButtonRef, z as EffectiveFieldLayout, y as FieldLayoutConfig, x as FieldOrdering, w as FieldRootId, u as FieldRoots, v as FieldSlotId, t as FieldSlots, p as FormProps, n as InferFromSchema, I as InputNumber, r as InputStore, A as LayoutResolveContext, G as LayoutResolver, R as RelativeRootsMap, o as SubmitEvent, T as Textarea, q as ValuesResult, J as VariantEntry, N as VariantLayoutDefaults, O as VariantModuleFor, M as VariantValidateFn, K as Variants } from './core-ClbfF5iz.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';
@@ -460,6 +460,10 @@ interface InputFieldBaseProps<TValue = unknown> {
460
460
  density?: FieldDensity;
461
461
  inline?: boolean;
462
462
  fullWidth?: boolean;
463
+ /**
464
+ * Inline style overrides for specific elements of the field layout.
465
+ */
466
+ styles?: Partial<Record<keyof InputFieldClassNames, React.CSSProperties>>;
463
467
  onValidate?(value: TValue | undefined, field: Field, form: CoreContext<Dict>): ValidateResult;
464
468
  /**
465
469
  * Per-field change hook at the InputField level.
@@ -692,6 +696,7 @@ interface InputKeyFilterProps {
692
696
  keyFilterOnPaste?: boolean;
693
697
  }
694
698
  interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, InputMaskProps, InputAffixProps, InputIconControlProps, InputSizeProps, InputKeyFilterProps {
699
+ invalid?: boolean;
695
700
  }
696
701
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
697
702
 
@@ -727,4 +732,36 @@ declare function registerPaletteUtil<K extends keyof PaletteRegistry>(key: K, va
727
732
  */
728
733
  declare function getPaletteUtil<K extends keyof PaletteRegistry>(key: K, defaultValue?: PaletteRegistry[K]): PaletteRegistry[K] | undefined;
729
734
 
730
- 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 };
735
+ interface FormPaletteTheme {
736
+ /**
737
+ * Default props to merge into every <InputField /> instance.
738
+ */
739
+ defaultProps?: Partial<InputFieldProps<any>>;
740
+ /**
741
+ * Default classNames to merge for specific elements of the field layout.
742
+ */
743
+ classes?: Partial<InputFieldClassNames>;
744
+ /**
745
+ * Inline style overrides for specific elements of the field layout.
746
+ */
747
+ styles?: Partial<Record<keyof InputFieldClassNames, React.CSSProperties>>;
748
+ /**
749
+ * Variant-specific overrides.
750
+ */
751
+ variants?: {
752
+ [key in VariantKey]?: {
753
+ defaultProps?: Partial<InputFieldProps<key>>;
754
+ classes?: Partial<InputFieldClassNames>;
755
+ styles?: Partial<Record<keyof InputFieldClassNames, React.CSSProperties>>;
756
+ };
757
+ };
758
+ }
759
+ interface ThemeProviderProps {
760
+ theme: FormPaletteTheme;
761
+ children: React.ReactNode;
762
+ }
763
+ declare function ThemeProvider({ theme, children }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
764
+ declare const PaletteThemeProvider: typeof ThemeProvider;
765
+ declare function usePaletteTheme(): FormPaletteTheme;
766
+
767
+ export { AdapterKey, CoreContext, CoreProps, CoreProvider, type CoreShellProps, DescriptionPlacement, Dict, type ErrorBag, type ErrorBagMapResult, ErrorStrip, type ErrorStripProps, ErrorTextPlacement, Field, CoreShell as Form, type FormPaletteTheme, CoreRoot as FormRoot, HelpTextPlacement, Input, InputField, type InputFieldBaseProps, type InputFieldProps, InputMask, LabelPlacement, PaletteThemeProvider, SlotPlacement, SublabelPlacement, ThemeProvider, 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, usePaletteTheme };
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, P as PhoneCountry, k as PasswordDefinitionMap, l as CustomFileLoader, m as FileItem } from './core-Cg8uXa6v.js';
2
- export { B as BaseProps, s as ButtonRef, z as EffectiveFieldLayout, y as FieldLayoutConfig, x as FieldOrdering, w as FieldRootId, u as FieldRoots, v as FieldSlotId, t as FieldSlots, p as FormProps, n as InferFromSchema, I as InputNumber, r as InputStore, A as LayoutResolveContext, G as LayoutResolver, R as RelativeRootsMap, o as SubmitEvent, T as Textarea, q as ValuesResult, J as VariantEntry, N as VariantLayoutDefaults, O as VariantModuleFor, M as VariantValidateFn, K as Variants } from './core-Cg8uXa6v.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, m as FileItem } from './core-Uq5vFxo3.js';
2
+ export { B as BaseProps, s as ButtonRef, z as EffectiveFieldLayout, y as FieldLayoutConfig, x as FieldOrdering, w as FieldRootId, u as FieldRoots, v as FieldSlotId, t as FieldSlots, p as FormProps, n as InferFromSchema, I as InputNumber, r as InputStore, A as LayoutResolveContext, G as LayoutResolver, R as RelativeRootsMap, o as SubmitEvent, T as Textarea, q as ValuesResult, J as VariantEntry, N as VariantLayoutDefaults, O as VariantModuleFor, M as VariantValidateFn, K as Variants } from './core-Uq5vFxo3.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';
@@ -460,6 +460,10 @@ interface InputFieldBaseProps<TValue = unknown> {
460
460
  density?: FieldDensity;
461
461
  inline?: boolean;
462
462
  fullWidth?: boolean;
463
+ /**
464
+ * Inline style overrides for specific elements of the field layout.
465
+ */
466
+ styles?: Partial<Record<keyof InputFieldClassNames, React.CSSProperties>>;
463
467
  onValidate?(value: TValue | undefined, field: Field, form: CoreContext<Dict>): ValidateResult;
464
468
  /**
465
469
  * Per-field change hook at the InputField level.
@@ -692,6 +696,7 @@ interface InputKeyFilterProps {
692
696
  keyFilterOnPaste?: boolean;
693
697
  }
694
698
  interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, InputMaskProps, InputAffixProps, InputIconControlProps, InputSizeProps, InputKeyFilterProps {
699
+ invalid?: boolean;
695
700
  }
696
701
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
697
702
 
@@ -727,4 +732,36 @@ declare function registerPaletteUtil<K extends keyof PaletteRegistry>(key: K, va
727
732
  */
728
733
  declare function getPaletteUtil<K extends keyof PaletteRegistry>(key: K, defaultValue?: PaletteRegistry[K]): PaletteRegistry[K] | undefined;
729
734
 
730
- 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 };
735
+ interface FormPaletteTheme {
736
+ /**
737
+ * Default props to merge into every <InputField /> instance.
738
+ */
739
+ defaultProps?: Partial<InputFieldProps<any>>;
740
+ /**
741
+ * Default classNames to merge for specific elements of the field layout.
742
+ */
743
+ classes?: Partial<InputFieldClassNames>;
744
+ /**
745
+ * Inline style overrides for specific elements of the field layout.
746
+ */
747
+ styles?: Partial<Record<keyof InputFieldClassNames, React.CSSProperties>>;
748
+ /**
749
+ * Variant-specific overrides.
750
+ */
751
+ variants?: {
752
+ [key in VariantKey]?: {
753
+ defaultProps?: Partial<InputFieldProps<key>>;
754
+ classes?: Partial<InputFieldClassNames>;
755
+ styles?: Partial<Record<keyof InputFieldClassNames, React.CSSProperties>>;
756
+ };
757
+ };
758
+ }
759
+ interface ThemeProviderProps {
760
+ theme: FormPaletteTheme;
761
+ children: React.ReactNode;
762
+ }
763
+ declare function ThemeProvider({ theme, children }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
764
+ declare const PaletteThemeProvider: typeof ThemeProvider;
765
+ declare function usePaletteTheme(): FormPaletteTheme;
766
+
767
+ export { AdapterKey, CoreContext, CoreProps, CoreProvider, type CoreShellProps, DescriptionPlacement, Dict, type ErrorBag, type ErrorBagMapResult, ErrorStrip, type ErrorStripProps, ErrorTextPlacement, Field, CoreShell as Form, type FormPaletteTheme, CoreRoot as FormRoot, HelpTextPlacement, Input, InputField, type InputFieldBaseProps, type InputFieldProps, InputMask, LabelPlacement, PaletteThemeProvider, SlotPlacement, SublabelPlacement, ThemeProvider, 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, usePaletteTheme };