@truecms/form
v2.0.0
Published
The form component contains layout, labelling and inline validations for form fields
Maintainers
Readme
@truecms/form
The form component contains layout, labelling and inline validations for form fields
Contents
Install
pnpm add @truecms/formnpm install @truecms/formDependency graph
form
└─ coreTests
The visual test: https://design-system-components.truecms.com.au/packages/form/tests/site/
Release History
v1.0.0 - 7f941cd: Document stewardship responsibilities under the TrueCMS organisation, lock the Node 22 baseline into the governance docs, and ship bundle parity plus dry-run release safeguards so Drupal 11 users and npm consumers remain supported
v0.1.6 - Update core package dependency to use the latest version
v0.1.5 - Update version for the dependency: @truecms/core
v0.1.4 - Add margin between text area and form labels, hint text and error messages.
v0.1.3 - Remove --save-dev flag from readme instructions.
v0.1.2 - Remove hint text colours as they are now in core.
v0.1.1 - Update selector to add
margin-topfor allinputelements that are preceded by a label elementv0.1.0 - 💥 Initial version
License
Copyright (c) Commonwealth of Australia. Licensed under MIT.
};
Usage
React
Usage:
import { AUlabel, AUhintText, AUerrorText, AUformGroup, AUfieldset, AUlegend } from '@truecms/form';
<AUlabel text="Email" />
<AUhintText text="We will only use this email to respond to your query." />
<AUerrorText text="Enter an email address in the correct format, like [email protected]" />
<AUformGroup>
// labels, hint text, and form controls here
</AUformGroup>
<AUfieldset>
<AUlegend>
// labels/hint text here
</AUlegend>
// form controls here
</AUfieldset>All props:
<AUlabel
text="Email" {/* The text of the label */}
dark={ true } {/* The dark variation of the component */}
inline={ true } {/* Label inline*/}
/>
<AUhintText
text="We will only use this email to respond to your query." {/* The hint text */}
dark = { true } {/* The dark variation of the component */}
alt={ false } {/* The alt variation of the component */}
/>
<AUerrorText
text="Enter an email in the valid format." {/* The error text */}
dark={ true } {/* The dark variation of the component */}
inline={ true } {/* Display the error text inline*/}
/>
<AUformGroup
status="invalid" {/* Adds invalid state to form group */}
dark = { true } {/* The dark variation of the component */}
/>
<AUfieldset
dark = { true } {/* The dark variation of the component */}
/>