-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add BooleanMetaDataField to support checkbox inputs on sign-up …
…form (#115) * 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. * Add documentation to README and minor code cleanup
- Loading branch information
Showing
4 changed files
with
332 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.