Components / core
RoleAssignmentForm
Presents controls for assigning a role.
Generated from @oods/foundry 0.19.0
- Categories
- core
- Contexts
- form
- Readiness
proven-in-generated-apps
Playground
This component's contract doesn't list typed props, so the playground shows its documented example.
Documented example role-assignment-form-roles : mount, a Role select listing Owner and viewer with viewer selected and an Assignee input holding the address.
The render follows the page's theme switch: light, dark or high contrast. Both frameworks render the same example.
Code
The documented example. HTML is the markup the React component renders for it, which @oods/component-styles styles.
import { RoleAssignmentForm } from '@oods/components-react';
import '@oods/component-styles/css';
const availableRoles = [
{
"id": "owner",
"label": "Owner"
},
"viewer"
];
export function Example() {
return (
<RoleAssignmentForm
title="Assign role"
availableRoles={availableRoles}
role="viewer"
assignee="ada@example.test"
/>
);
}Props, slots and events
Contract version 1.1.0. Types are from the React declarations in @oods/components-react.
| Prop | Type | Required | Documented example |
|---|---|---|---|
title | string | undefined | no | Assign role |
label | string | undefined | no | |
heading | string | undefined | no | |
name | string | undefined | no | |
description | string | undefined | no | |
subtitle | string | undefined | no | |
hint | string | undefined | no | |
roles | readonly unknown[] | undefined | no | |
available | readonly unknown[] | undefined | no | [{"id":"owner","label":"Owner"},"viewer"] |
role | string | undefined | no | viewer |
default | string | undefined | no | |
assignee | string | undefined | no | ada@example.test |
member | string | undefined | no |
Slots
default
Events
none
States
editing
Accessibility
- Role
textbox- How it gets its name
labeloninput[name="assignee"]
Keyboard
| Key | What it does |
|---|---|
| Tab | Move focus to the named native control |
| x | Edit the named control |
Obligations in the contract
- A real h3 heading names the form
- Role is a labelled select and Assignee a labelled text input
Mirrors renderRoleAssignmentForm over renderFormContainer with data-form-type=role-assignment: title aliases title/label/heading/name (default Role Assignment), subtitle aliases description/subtitle/hint, a Role select over roles, then availableRoles (record labels use label, then name; IDs remain values), selecting role, then defaultRoleId, and an Assignee input prefilled from assignee/member; authored children replace the generated body. availableRolesField lowers to availableRoles; membershipField is consumed unbound; defaultRoleParameter is consumed. The controls are unwired and submitting is a no-op.
Tokens
The token roles this component reads.
form.backgroundform.borderform.textform.hint
Readiness
The evidence recorded for this component, with its label.
proven-in-generated-apps: catalog_list gives this label when generated React and Vue apps in the runtime sweep that ships with this version both use the component. That sweep was measured on a build of 0.19.0's source before it was published, not on the published package.
| Evidence | React | Vue |
|---|---|---|
| state | implemented-evidence-complete | implemented-evidence-complete |
| versioned contract | passed | passed |
| target implementation | passed | passed |
| package export | passed | passed |
| public declaration | passed | passed |
| dependency closure | passed | passed |
| framework scenario | passed | passed |
| accessibility | verified | verified |
| interaction | verified | verified |
| visual themes | verified | verified |
Use your own
You can replace this component with your own React or Vue component. Map it, and generated code imports yours at the exact version you name. A contract report, run in a real browser, lists what your component met, what it didn't, and what wasn't checked.
The component_map call, with the parts in angle brackets yours to fill:
{
"action": "create",
"apply": true,
"externalSystem": "<your design system>",
"externalComponent": "<YourRoleAssignmentForm>",
"oodsTraits": [
"Authable"
],
"substitution": {
"component": "RoleAssignmentForm",
"react": {
"package": "<your-package>/react",
"version": "<exact version>",
"export": "<YourRoleAssignmentForm>"
},
"vue": {
"package": "<your-package>/vue",
"version": "<exact version>",
"export": "<YourRoleAssignmentForm>"
}
}
} How this page was made
Generated at build from the published data, each source with the hash of what was read. The page's manifest.
- Contract:
@oods/component-contracts@0.19.0 componentContracts.RoleAssignmentFormsha256:12864e29600d… - Documented example:
@oods/component-contracts@0.19.0 sharedScenarios role-assignment-form-rolessha256:5c46ea6140dc… - Catalog entry (catalog_list):
generated/0.19.0/system/catalog.json RoleAssignmentFormsha256:5f4a8d846480… - React readiness:
@oods/components-react@0.19.0 readiness RoleAssignmentFormsha256:cada232934ab… - Vue readiness:
@oods/components-vue@0.19.0 readiness RoleAssignmentFormsha256:0c84c3de3f79… - Prop types:
generated/0.19.0/components/prop-types.json RoleAssignmentFormsha256:6f0a0a3e7327…