@timeax/form-palette 0.0.5 → 0.0.6

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
@@ -979,6 +979,90 @@ interface LayoutResolveContext<T = unknown> {
979
979
  */
980
980
  type LayoutResolver<T = unknown> = (ctx: LayoutResolveContext<T>) => FieldLayoutConfig;
981
981
 
982
+ type MaskMode$1 = "raw" | "masked";
983
+ /**
984
+ * Mask-related props for the Shadcn text variant.
985
+ *
986
+ * These are forwarded to the underlying <Input>, which in turn wires
987
+ * them into the InputMask implementation.
988
+ */
989
+ interface ShadcnTextMaskProps {
990
+ /**
991
+ * Mask pattern – Primereact style.
992
+ * Example: "99/99/9999", "(999) 999-9999"
993
+ */
994
+ mask?: string;
995
+ /**
996
+ * Per-symbol definitions for slots.
997
+ * Kept for future custom engine; not used by the current
998
+ * react-input-mask implementation.
999
+ */
1000
+ maskDefinitions?: Record<string, RegExp>;
1001
+ /**
1002
+ * Character used to visually represent an empty slot.
1003
+ * Default: "_".
1004
+ */
1005
+ slotChar?: string;
1006
+ /**
1007
+ * If true, when the value is effectively "empty" (no unmasked chars),
1008
+ * we emit an empty string "" instead of a fully-masked placeholder.
1009
+ *
1010
+ * NOTE: This behaviour is implemented in the variant, not Input,
1011
+ * so we preserve your existing semantics.
1012
+ */
1013
+ autoClear?: boolean;
1014
+ /**
1015
+ * Whether the *model* value is raw or masked.
1016
+ *
1017
+ * - "raw" or true → onValue receives unmasked value
1018
+ * - "masked" or false/undefined → onValue receives full masked string
1019
+ *
1020
+ * NOTE: detail.raw is **always** the masked string.
1021
+ */
1022
+ unmask?: MaskMode$1 | boolean;
1023
+ /**
1024
+ * Placeholder for future caret-mode logic when we go back
1025
+ * to a custom engine. Currently unused, kept for API compatibility.
1026
+ */
1027
+ maskInsertMode?: "stream" | "caret";
1028
+ }
1029
+ /**
1030
+ * Extra UI props for the Shadcn text input (pure HTML-level).
1031
+ *
1032
+ * These are forwarded straight to the underlying <Input />.
1033
+ */
1034
+ type ShadcnTextUiProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "size"> & {
1035
+ /**
1036
+ * Extra classes applied only to the *inner* input element
1037
+ * (the actual <input>, not the wrapper box).
1038
+ */
1039
+ inputClassName?: string;
1040
+ /**
1041
+ * Fixed prefix rendered as part of the input value, NOT as an icon.
1042
+ * E.g. "₦", "ID: ".
1043
+ *
1044
+ * The underlying <Input> will:
1045
+ * - take the model value (without prefix),
1046
+ * - render prefix + value,
1047
+ * - expose the full visible string in event.target.value.
1048
+ */
1049
+ prefix?: string;
1050
+ /**
1051
+ * Fixed suffix rendered as part of the input value, NOT as an icon.
1052
+ * E.g. "%", "kg".
1053
+ */
1054
+ suffix?: string;
1055
+ /**
1056
+ * If true (default), we strip the prefix from the value
1057
+ * before emitting it via `onValue`.
1058
+ */
1059
+ stripPrefix?: boolean;
1060
+ /**
1061
+ * If true (default), we strip the suffix from the value
1062
+ * before emitting it via `onValue`.
1063
+ */
1064
+ stripSuffix?: boolean;
1065
+ } & ShadcnTextMaskProps;
982
1066
  /**
983
1067
  * Props for the Shadcn-based text variant.
984
1068
  *
@@ -1000,7 +1084,7 @@ type ShadcnTextVariantProps = ExtraFieldProps<VariantBaseProps<string | undefine
1000
1084
  * (true) or controls are visually separate (false).
1001
1085
  */
1002
1086
  extendBoxToControls?: boolean;
1003
- };
1087
+ } & ShadcnTextUiProps;
1004
1088
 
1005
1089
  type InputRef = HTMLInputElement;
1006
1090
  interface InputNumberValueChangeEvent {
package/dist/index.d.ts CHANGED
@@ -979,6 +979,90 @@ interface LayoutResolveContext<T = unknown> {
979
979
  */
980
980
  type LayoutResolver<T = unknown> = (ctx: LayoutResolveContext<T>) => FieldLayoutConfig;
981
981
 
982
+ type MaskMode$1 = "raw" | "masked";
983
+ /**
984
+ * Mask-related props for the Shadcn text variant.
985
+ *
986
+ * These are forwarded to the underlying <Input>, which in turn wires
987
+ * them into the InputMask implementation.
988
+ */
989
+ interface ShadcnTextMaskProps {
990
+ /**
991
+ * Mask pattern – Primereact style.
992
+ * Example: "99/99/9999", "(999) 999-9999"
993
+ */
994
+ mask?: string;
995
+ /**
996
+ * Per-symbol definitions for slots.
997
+ * Kept for future custom engine; not used by the current
998
+ * react-input-mask implementation.
999
+ */
1000
+ maskDefinitions?: Record<string, RegExp>;
1001
+ /**
1002
+ * Character used to visually represent an empty slot.
1003
+ * Default: "_".
1004
+ */
1005
+ slotChar?: string;
1006
+ /**
1007
+ * If true, when the value is effectively "empty" (no unmasked chars),
1008
+ * we emit an empty string "" instead of a fully-masked placeholder.
1009
+ *
1010
+ * NOTE: This behaviour is implemented in the variant, not Input,
1011
+ * so we preserve your existing semantics.
1012
+ */
1013
+ autoClear?: boolean;
1014
+ /**
1015
+ * Whether the *model* value is raw or masked.
1016
+ *
1017
+ * - "raw" or true → onValue receives unmasked value
1018
+ * - "masked" or false/undefined → onValue receives full masked string
1019
+ *
1020
+ * NOTE: detail.raw is **always** the masked string.
1021
+ */
1022
+ unmask?: MaskMode$1 | boolean;
1023
+ /**
1024
+ * Placeholder for future caret-mode logic when we go back
1025
+ * to a custom engine. Currently unused, kept for API compatibility.
1026
+ */
1027
+ maskInsertMode?: "stream" | "caret";
1028
+ }
1029
+ /**
1030
+ * Extra UI props for the Shadcn text input (pure HTML-level).
1031
+ *
1032
+ * These are forwarded straight to the underlying <Input />.
1033
+ */
1034
+ type ShadcnTextUiProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "size"> & {
1035
+ /**
1036
+ * Extra classes applied only to the *inner* input element
1037
+ * (the actual <input>, not the wrapper box).
1038
+ */
1039
+ inputClassName?: string;
1040
+ /**
1041
+ * Fixed prefix rendered as part of the input value, NOT as an icon.
1042
+ * E.g. "₦", "ID: ".
1043
+ *
1044
+ * The underlying <Input> will:
1045
+ * - take the model value (without prefix),
1046
+ * - render prefix + value,
1047
+ * - expose the full visible string in event.target.value.
1048
+ */
1049
+ prefix?: string;
1050
+ /**
1051
+ * Fixed suffix rendered as part of the input value, NOT as an icon.
1052
+ * E.g. "%", "kg".
1053
+ */
1054
+ suffix?: string;
1055
+ /**
1056
+ * If true (default), we strip the prefix from the value
1057
+ * before emitting it via `onValue`.
1058
+ */
1059
+ stripPrefix?: boolean;
1060
+ /**
1061
+ * If true (default), we strip the suffix from the value
1062
+ * before emitting it via `onValue`.
1063
+ */
1064
+ stripSuffix?: boolean;
1065
+ } & ShadcnTextMaskProps;
982
1066
  /**
983
1067
  * Props for the Shadcn-based text variant.
984
1068
  *
@@ -1000,7 +1084,7 @@ type ShadcnTextVariantProps = ExtraFieldProps<VariantBaseProps<string | undefine
1000
1084
  * (true) or controls are visually separate (false).
1001
1085
  */
1002
1086
  extendBoxToControls?: boolean;
1003
- };
1087
+ } & ShadcnTextUiProps;
1004
1088
 
1005
1089
  type InputRef = HTMLInputElement;
1006
1090
  interface InputNumberValueChangeEvent {