You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments