@timeax/form-palette 0.0.11 → 0.0.12

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
@@ -3638,10 +3638,31 @@ interface InputFieldBaseProps<TValue = unknown> {
3638
3638
  * NOTE: this is a type alias (not an interface) so we can safely intersect
3639
3639
  * unions coming from VariantPropsFor<K> / VariantValueFor<K>.
3640
3640
  */
3641
- type InputFieldProps<K extends VariantKey = VariantKey, H = unknown> = InputFieldBaseProps<VariantValueFor<K, H>> & VariantPropsFor<K, H> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> & {
3641
+ type InputFieldProps<K extends VariantKey = VariantKey, H = unknown> = InputFieldBaseProps<VariantValueFor<K, H>> & VariantPropsFor<K, H> & InputFieldClassNameProps & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & {
3642
3642
  variant: K;
3643
+ /**
3644
+ * @deprecated Use the specific *ClassName props instead
3645
+ * (className, labelClassName, errorClassName, etc.).
3646
+ */
3643
3647
  classes?: Partial<InputFieldClassNames>;
3644
3648
  };
3649
+ interface InputFieldClassNameProps {
3650
+ /** Root comes from `className` on HTMLDivElement */
3651
+ labelRowClassName?: string;
3652
+ inlineRowClassName?: string;
3653
+ labelClassName?: string;
3654
+ sublabelClassName?: string;
3655
+ descriptionClassName?: string;
3656
+ helpTextClassName?: string;
3657
+ errorClassName?: string;
3658
+ groupClassName?: string;
3659
+ contentClassName?: string;
3660
+ variantClassName?: string;
3661
+ inlineInputColumnClassName?: string;
3662
+ inlineLabelColumnClassName?: string;
3663
+ requiredClassName?: string;
3664
+ tagClassName?: string;
3665
+ }
3645
3666
  interface InputFieldClassNames {
3646
3667
  root?: string;
3647
3668
  labelRow?: string;
package/dist/index.d.ts CHANGED
@@ -3638,10 +3638,31 @@ interface InputFieldBaseProps<TValue = unknown> {
3638
3638
  * NOTE: this is a type alias (not an interface) so we can safely intersect
3639
3639
  * unions coming from VariantPropsFor<K> / VariantValueFor<K>.
3640
3640
  */
3641
- type InputFieldProps<K extends VariantKey = VariantKey, H = unknown> = InputFieldBaseProps<VariantValueFor<K, H>> & VariantPropsFor<K, H> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> & {
3641
+ type InputFieldProps<K extends VariantKey = VariantKey, H = unknown> = InputFieldBaseProps<VariantValueFor<K, H>> & VariantPropsFor<K, H> & InputFieldClassNameProps & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & {
3642
3642
  variant: K;
3643
+ /**
3644
+ * @deprecated Use the specific *ClassName props instead
3645
+ * (className, labelClassName, errorClassName, etc.).
3646
+ */
3643
3647
  classes?: Partial<InputFieldClassNames>;
3644
3648
  };
3649
+ interface InputFieldClassNameProps {
3650
+ /** Root comes from `className` on HTMLDivElement */
3651
+ labelRowClassName?: string;
3652
+ inlineRowClassName?: string;
3653
+ labelClassName?: string;
3654
+ sublabelClassName?: string;
3655
+ descriptionClassName?: string;
3656
+ helpTextClassName?: string;
3657
+ errorClassName?: string;
3658
+ groupClassName?: string;
3659
+ contentClassName?: string;
3660
+ variantClassName?: string;
3661
+ inlineInputColumnClassName?: string;
3662
+ inlineLabelColumnClassName?: string;
3663
+ requiredClassName?: string;
3664
+ tagClassName?: string;
3665
+ }
3645
3666
  interface InputFieldClassNames {
3646
3667
  root?: string;
3647
3668
  labelRow?: string;
package/dist/index.js CHANGED
@@ -42281,6 +42281,40 @@ function renderHelperSlot(root2, slot, classes) {
42281
42281
  return null;
42282
42282
  }
42283
42283
  }
42284
+ function mergeClass(legacy, next) {
42285
+ const value = [legacy, next].filter(Boolean).join(" ");
42286
+ return value || void 0;
42287
+ }
42288
+ function getClasses(props) {
42289
+ var _a;
42290
+ const legacy = (_a = props.classes) != null ? _a : {};
42291
+ return {
42292
+ root: mergeClass(legacy.root, props.className),
42293
+ labelRow: mergeClass(legacy.labelRow, props.labelRowClassName),
42294
+ inlineRow: mergeClass(legacy.inlineRow, props.inlineRowClassName),
42295
+ label: mergeClass(legacy.label, props.labelClassName),
42296
+ sublabel: mergeClass(legacy.sublabel, props.sublabelClassName),
42297
+ description: mergeClass(
42298
+ legacy.description,
42299
+ props.descriptionClassName
42300
+ ),
42301
+ helpText: mergeClass(legacy.helpText, props.helpTextClassName),
42302
+ error: mergeClass(legacy.error, props.errorClassName),
42303
+ group: mergeClass(legacy.group, props.groupClassName),
42304
+ content: mergeClass(legacy.content, props.contentClassName),
42305
+ variant: mergeClass(legacy.variant, props.variantClassName),
42306
+ inlineInputColumn: mergeClass(
42307
+ legacy.inlineInputColumn,
42308
+ props.inlineInputColumnClassName
42309
+ ),
42310
+ inlineLabelColumn: mergeClass(
42311
+ legacy.inlineLabelColumn,
42312
+ props.inlineLabelColumnClassName
42313
+ ),
42314
+ required: mergeClass(legacy.required, props.requiredClassName),
42315
+ tag: mergeClass(legacy.tag, props.tagClassName)
42316
+ };
42317
+ }
42284
42318
  function InputField(props) {
42285
42319
  var _a, _b, _c, _d, _e, _f, _g;
42286
42320
  const {
@@ -42321,7 +42355,7 @@ function InputField(props) {
42321
42355
  // Field wrapper props
42322
42356
  className,
42323
42357
  style,
42324
- classes,
42358
+ classes: _depreciated,
42325
42359
  // Everything else → forwarded to variant
42326
42360
  ...rest
42327
42361
  } = props;
@@ -42336,6 +42370,7 @@ function InputField(props) {
42336
42370
  }
42337
42371
  return null;
42338
42372
  }
42373
+ const classes = getClasses(props);
42339
42374
  const layout = React54__namespace.useMemo(() => {
42340
42375
  var _a2;
42341
42376
  const defaultsLayout = (_a2 = module2.defaults) == null ? void 0 : _a2.layout;