How to use the reakit/Form/utils/getIn.unstable_getIn function in reakit

To help you get started, we’ve selected a few reakit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github reakit / reakit / packages / reakit-system-bootstrap / src / Form.ts View on Github external
export function useFormInputOptions({
  unstable_system: { fill = "outline", ...system } = {},
  ...options
}: BootstrapFormInputOptions): BootstrapFormInputOptions {
  const isInvalid = Boolean(
    unstable_getIn(options.touched, options.name) &&
      unstable_getIn(options.errors, options.name)
  );
  return {
    unstable_system: {
      fill,
      ...system,
      palette: isInvalid ? "danger" : system.palette
    },
    ...options
  };
}
github reakit / reakit / packages / reakit-system-bootstrap / src / Form.ts View on Github external
export function useFormInputOptions({
  unstable_system: { fill = "outline", ...system } = {},
  ...options
}: BootstrapFormInputOptions): BootstrapFormInputOptions {
  const isInvalid = Boolean(
    unstable_getIn(options.touched, options.name) &&
      unstable_getIn(options.errors, options.name)
  );
  return {
    unstable_system: {
      fill,
      ...system,
      palette: isInvalid ? "danger" : system.palette
    },
    ...options
  };
}
github reakit / reakit / packages / reakit-system-bootstrap / src / Form.ts View on Github external
export function useFormGroupOptions({
  unstable_system: { fill = "outline", ...system } = {},
  ...options
}: BootstrapFormGroupOptions): BootstrapFormGroupOptions {
  const isInvalid = Boolean(
    unstable_getIn(options.touched, options.name) &&
      unstable_getIn(options.errors, options.name)
  );
  return {
    unstable_system: {
      fill,
      ...system,
      palette: isInvalid ? "danger" : system.palette
    },
    ...options
  };
}
github reakit / reakit / packages / reakit-system-bootstrap / src / Form.ts View on Github external
export function useFormGroupOptions({
  unstable_system: { fill = "outline", ...system } = {},
  ...options
}: BootstrapFormGroupOptions): BootstrapFormGroupOptions {
  const isInvalid = Boolean(
    unstable_getIn(options.touched, options.name) &&
      unstable_getIn(options.errors, options.name)
  );
  return {
    unstable_system: {
      fill,
      ...system,
      palette: isInvalid ? "danger" : system.palette
    },
    ...options
  };
}
github reakit / reakit / packages / reakit-system-bootstrap / src / Form.ts View on Github external
export function useFormMessageOptions({
  unstable_system: system = {},
  ...options
}: BootstrapFormMessageOptions): BootstrapFormMessageOptions {
  const isInvalid = Boolean(unstable_getIn(options.errors, options.name));
  return {
    unstable_system: {
      ...system,
      palette: isInvalid ? "danger" : system.palette || "success"
    },
    ...options
  };
}