Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add BooleanMetaDataField to support checkbox inputs on sign-up form #115

Merged
merged 2 commits into from
Oct 4, 2024

Commits on Oct 3, 2024

  1. Add BooleanMetaDataField for checkbox inputs in SupaEmailAuth

    This commit introduces a new BooleanMetaDataField class to support checkbox inputs
    in the SupaEmailAuth component. This enhancement allows for more versatile form
    creation, particularly useful for consent checkboxes or boolean preferences.
    
    Key changes:
    
    1. New BooleanMetaDataField class:
       - Extends MetaDataField to maintain compatibility
       - Supports both simple text labels and rich text labels with interactive elements
         (allowing links to be inserted within the text)
       - Supports semantic labeling for accessability
       - Allows customization of checkbox position (leading or trailing)
       - Includes a 'required' option for mandatory fields
    
    2. Updates to SupaEmailAuth:
       - Modified to handle both MetaDataField and BooleanMetaDataField
       - Implemented rendering logic for checkbox fields
       - Added support for rich text labels in checkboxes
       - Implemented validation for required checkbox fields
    
    3. Styling improvements:
       - Ensured checkbox styling matches other form elements
       - Added support for dark mode theming
       - Implemented error message display for invalid checkbox fields
       - Error message added to localization class
    
    4. Documentation:
       - Added comprehensive documentation for BooleanMetaDataField
       - Updated existing documentation to reflect new capabilities
    
    5. Example updates:
       - Modified example code to demonstrate usage of BooleanMetaDataField
       - Included examples of both simple and rich text labels
    
    6. Backward compatibility:
       - Maintained support for existing MetaDataField usage
       - No breaking changes to public API
    
    This enhancement provides developers with more flexibility in creating
    sign-up forms, particularly for scenarios requiring user consent or
    boolean preferences, while maintaining the existing functionality
    of the SupaEmailAuth component.
    bcorman committed Oct 3, 2024
    Configuration menu
    Copy the full SHA
    e5f4e7f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0b0b50f View commit details
    Browse the repository at this point in the history