feat(modal): add radio element support#292
Open
uttam12331 wants to merge 4 commits into
Open
Conversation
Add a new `radio` input type to the modal component. A radio field renders its `options` as a single-selection group sharing one name; the selected option's value is stored in `data[name]`. - elements.json: register the `radio` element (`requires-options`, input tag, radiogroup aria role). - constants.js: expose `DYVIX_MODAL_ELEMENT.RADIO`. - modal.jsx: compute options for any `requires-options` element (covers select, d-select and radio) and render a dedicated accessible radiogroup with per-option labels and checked state bound to `data`. - elements.css: styles for the radio group, legend and inputs. - devbench: add a radio example. Closes younisdev#85
|
@uttam12331 is attempting to deploy a commit to the younis' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
younisdev
requested changes
Jul 4, 2026
younisdev
left a comment
Owner
There was a problem hiding this comment.
Hey, @uttam12331. I made a few CSS adjustments to create a compact inline layout for the radio element. However, allowing multiple radio groups in a single row doesn't fit the current design. Could you update InputValidation.jsx to prevent developers from adding more than one radio group? Thanks!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #85 — adds a new
radioinput type to the modal component.What changed
As outlined in the issue, all four touch-points are covered:
elements.json— registers theradioelement (input tag,requires-options: true,radiogrouparia role).constants.js— exposesDYVIX_MODAL_ELEMENT.RADIO(single line, matching the generator output).modal.jsx— theoptionslookup now applies to anyrequires-optionselement (so it uniformly coversselect,d-selectand the newradio), plus a dedicated render branch that draws an accessible radio group: one<input type="radio">per option sharing the fieldname, withcheckedbound todata[name]and selection written back through the existinghandleInputChangeflow.elements.css— styles for the radio group, legend and inputs.The selected option's value is stored in
data[name]like any other field, so existing validation and submit logic work unchanged. Existing element types are unaffected.Testing
devbench/src/component/modal.jsx).npm run build -w devbenchsucceeds (96 modules transformed).Closes #85