+
+// Good
+
+
+// For decorative images
+
+```
+
+### Insufficient Color Contrast (color-contrast)
+
+**Issue**: Text must have sufficient contrast against its background.
+
+**Fix**:
+
+- Adjust text or background colors to meet WCAG 2.1 AA contrast requirements
+- Use the DaisyUI/Tailwind color system which has been designed with contrast in mind
+- For text elements, ensure a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text
+
+### Missing Form Labels (label)
+
+**Issue**: Form inputs must have associated labels.
+
+**Fix**:
+
+```jsx
+// Bad
+
+
+// Good
+
+
+
+// Or using our FormField components which handle this automatically
+
+
+
+ `);
+
+ // Inject axe
+ await injectAxe(page);
+
+ // Try/catch to show the violations
+ try {
+ console.log('Running axe-core tests...');
+ // This should fail due to accessibility violations
+ await checkA11y(page, 'body', {
+ detailedReport: true,
+ detailedReportOptions: {
+ html: true,
+ },
+ });
+ console.log('✅ No violations found (this should not happen)');
+ } catch (error) {
+ console.log('❌ Accessibility violations detected (expected)');
+ console.log('\nViolation details:');
+
+ // Extract and display violation information
+ if (error.message.includes('Found')) {
+ const violations = error.message.split('Found ')[1].split(' accessibility violations')[0];
+ console.log(`Found ${violations} accessibility violations`);
+
+ // Extract specific violations if possible
+ const violationMatches = error.message.match(/Impact: (critical|serious|moderate|minor).*?Rule: ([a-z-]+)/gs);
+ if (violationMatches) {
+ violationMatches.forEach(match => {
+ console.log(`\n${match.trim()}`);
+ });
+ }
+ } else {
+ console.log(error.message);
+ }
+ }
+
+ // Close the browser
+ await browser.close();
+}
+
+runA11yTest().catch(error => {
+ console.error('Test failed unexpectedly:', error);
+ process.exit(1);
+});
\ No newline at end of file
diff --git a/packages/ui-kit/scripts/test-component.sh b/packages/ui-kit/scripts/test-component.sh
new file mode 100755
index 0000000..dd17bc7
--- /dev/null
+++ b/packages/ui-kit/scripts/test-component.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+# A simple script to test a single component using Storybook and test-runner
+
+# Display usage if no pattern is provided
+if [ -z "$1" ]; then
+ echo "Usage: $0 + This action permanently removes the item and cannot be undone. +
+
+ The key to accessible checkboxes is using a proper id attribute and
+ associating it with a Label using htmlFor.
+
Select your preferred contact method:
+
+ For radio groups, each radio item needs its own unique id and
+ associated Label.
+
+ For select components, the SelectTrigger needs an id
+ that matches the htmlFor of the Label.
+
{description}
++ {description} +
)} {error && ( -{error}
++ {error} +
)}