@holmdigital/components 1.2.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -60
- package/dist/AccessibilityStatement/AccessibilityStatement.d.mts +29 -0
- package/dist/AccessibilityStatement/AccessibilityStatement.d.ts +29 -0
- package/dist/AccessibilityStatement/AccessibilityStatement.js +551 -0
- package/dist/AccessibilityStatement/AccessibilityStatement.mjs +6 -0
- package/dist/Button/Button.js +1 -1
- package/dist/Button/Button.mjs +1 -1
- package/dist/Card/Card.d.mts +12 -0
- package/dist/Card/Card.d.ts +12 -0
- package/dist/Card/Card.js +81 -0
- package/dist/Card/Card.mjs +6 -0
- package/dist/Combobox/Combobox.d.mts +19 -0
- package/dist/Combobox/Combobox.d.ts +19 -0
- package/dist/Combobox/Combobox.js +271 -0
- package/dist/Combobox/Combobox.mjs +6 -0
- package/dist/DataTable/DataTable.d.mts +18 -0
- package/dist/DataTable/DataTable.d.ts +18 -0
- package/dist/DataTable/DataTable.js +125 -0
- package/dist/DataTable/DataTable.mjs +6 -0
- package/dist/DatePicker/DatePicker.d.mts +11 -0
- package/dist/DatePicker/DatePicker.d.ts +11 -0
- package/dist/DatePicker/DatePicker.js +110 -0
- package/dist/DatePicker/DatePicker.mjs +6 -0
- package/dist/ErrorSummary/ErrorSummary.d.mts +14 -0
- package/dist/ErrorSummary/ErrorSummary.d.ts +14 -0
- package/dist/ErrorSummary/ErrorSummary.js +119 -0
- package/dist/ErrorSummary/ErrorSummary.mjs +6 -0
- package/dist/LiveRegion/LiveRegion.d.mts +10 -0
- package/dist/LiveRegion/LiveRegion.d.ts +10 -0
- package/dist/LiveRegion/LiveRegion.js +69 -0
- package/dist/LiveRegion/LiveRegion.mjs +6 -0
- package/dist/Modal/Modal.d.mts +1 -2
- package/dist/Modal/Modal.d.ts +1 -2
- package/dist/MultiSelect/MultiSelect.d.mts +19 -0
- package/dist/MultiSelect/MultiSelect.d.ts +19 -0
- package/dist/MultiSelect/MultiSelect.js +263 -0
- package/dist/MultiSelect/MultiSelect.mjs +6 -0
- package/dist/Pagination/Pagination.d.mts +12 -0
- package/dist/Pagination/Pagination.d.ts +12 -0
- package/dist/Pagination/Pagination.js +149 -0
- package/dist/Pagination/Pagination.mjs +6 -0
- package/dist/Tooltip/Tooltip.d.mts +1 -1
- package/dist/Tooltip/Tooltip.d.ts +1 -1
- package/dist/Tooltip/Tooltip.js +1 -1
- package/dist/Tooltip/Tooltip.mjs +1 -1
- package/dist/TreeView/TreeView.d.mts +16 -0
- package/dist/TreeView/TreeView.d.ts +16 -0
- package/dist/TreeView/TreeView.js +250 -0
- package/dist/TreeView/TreeView.mjs +6 -0
- package/dist/chunk-4UONERC6.mjs +45 -0
- package/dist/chunk-57NZTQBX.mjs +86 -0
- package/dist/chunk-6REI7HHO.mjs +226 -0
- package/dist/chunk-EVNHLNS5.mjs +125 -0
- package/dist/chunk-FKSBWEX3.mjs +529 -0
- package/dist/chunk-HSUDZAQ6.mjs +101 -0
- package/dist/{chunk-C5M6C7KT.mjs → chunk-MCEJNWZT.mjs} +1 -1
- package/dist/{chunk-7V2LETZ6.mjs → chunk-MYXIUDCP.mjs} +1 -1
- package/dist/chunk-NECEXNCF.mjs +57 -0
- package/dist/chunk-OMSIXECN.mjs +247 -0
- package/dist/chunk-P2IXX552.mjs +95 -0
- package/dist/chunk-VM3O36W4.mjs +239 -0
- package/dist/index.d.mts +42 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.js +1941 -2
- package/dist/index.mjs +244 -6
- package/package.json +48 -6
package/README.md
CHANGED
|
@@ -1,60 +1,137 @@
|
|
|
1
|
-
# @holmdigital/components
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@holmdigital/components)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-

|
|
6
|
-
[](https://www.npmjs.com/package/@holmdigital/components)
|
|
7
|
-
|
|
8
|
-
> Prescriptive, accessible React components for regulatory compliance.
|
|
9
|
-
|
|
10
|
-
## Why this package?
|
|
11
|
-
|
|
12
|
-
Building accessible components from scratch is hard. Ensuring they comply with **EN 301 549** and national laws is even harder.
|
|
13
|
-
|
|
14
|
-
These components are **Compliant by Default**. They automatically handle:
|
|
15
|
-
- **ARIA attributes**: No need to manually manage `aria-expanded`, `aria-controls`, etc.
|
|
16
|
-
- **Focus Management**: Built-in keyboard navigation for modal traps, dropdowns, and menus.
|
|
17
|
-
- **Contrast**: Default styles are tested against WCAG AA/AAA requirements.
|
|
18
|
-
|
|
19
|
-
Using these components significantly reduces the risk of regulatory violations in your UI.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
1
|
+
# @holmdigital/components
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@holmdigital/components)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+

|
|
6
|
+
[](https://www.npmjs.com/package/@holmdigital/components)
|
|
7
|
+
|
|
8
|
+
> Prescriptive, accessible React components for regulatory compliance.
|
|
9
|
+
|
|
10
|
+
## Why this package?
|
|
11
|
+
|
|
12
|
+
Building accessible components from scratch is hard. Ensuring they comply with **EN 301 549** and national laws is even harder.
|
|
13
|
+
|
|
14
|
+
These components are **Compliant by Default**. They automatically handle:
|
|
15
|
+
- **ARIA attributes**: No need to manually manage `aria-expanded`, `aria-controls`, etc.
|
|
16
|
+
- **Focus Management**: Built-in keyboard navigation for modal traps, dropdowns, and menus.
|
|
17
|
+
- **Contrast**: Default styles are tested against WCAG AA/AAA requirements.
|
|
18
|
+
|
|
19
|
+
Using these components significantly reduces the risk of regulatory violations in your UI.
|
|
20
|
+
|
|
21
|
+
For a full list of all 29 accessible components, including practical code examples and advanced usage patterns, see the **[Component Library Catalog](../../docs/reference/components.md)**.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @holmdigital/components
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { Button, FormField, Heading, ErrorSummary, AccessibilityStatement, Combobox, DatePicker, MultiSelect, DataTable, Pagination, Card, TreeView } from '@holmdigital/components';
|
|
33
|
+
|
|
34
|
+
function App() {
|
|
35
|
+
return (
|
|
36
|
+
<ErrorSummary
|
|
37
|
+
errors={[
|
|
38
|
+
{ id: 'email', message: 'Enter a valid email address' },
|
|
39
|
+
{ id: 'country', message: 'Select a country' }
|
|
40
|
+
]}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<Heading level={1}>Contact Us</Heading>
|
|
44
|
+
|
|
45
|
+
<FormField
|
|
46
|
+
label="Email Address"
|
|
47
|
+
id="email"
|
|
48
|
+
type="email"
|
|
49
|
+
required
|
|
50
|
+
autoComplete="email"
|
|
51
|
+
helpText="We'll never share your email."
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
<Combobox
|
|
55
|
+
label="Country"
|
|
56
|
+
id="country"
|
|
57
|
+
options={[
|
|
58
|
+
{ label: 'Sweden', value: 'se' },
|
|
59
|
+
{ label: 'Norway', value: 'no' }
|
|
60
|
+
]}
|
|
61
|
+
onChange={(val) => console.log(val)}
|
|
62
|
+
/>
|
|
63
|
+
|
|
64
|
+
<DatePicker
|
|
65
|
+
label="Preferred Date"
|
|
66
|
+
required
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
<MultiSelect
|
|
70
|
+
label="Interests"
|
|
71
|
+
options={[
|
|
72
|
+
{ label: 'Accessibility', value: 'a11y' },
|
|
73
|
+
{ label: 'Performance', value: 'perf' }
|
|
74
|
+
]}
|
|
75
|
+
selected={['a11y']}
|
|
76
|
+
onChange={(val) => console.log(val)}
|
|
77
|
+
/>
|
|
78
|
+
|
|
79
|
+
<Card title="Latest Updates" href="/updates">
|
|
80
|
+
Checking out the new components!
|
|
81
|
+
</Card>
|
|
82
|
+
|
|
83
|
+
<DataTable
|
|
84
|
+
caption="Users"
|
|
85
|
+
data={[{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]}
|
|
86
|
+
columns={[
|
|
87
|
+
{ header: 'ID', accessor: 'id', sortable: true },
|
|
88
|
+
{ header: 'Name', accessor: 'name' }
|
|
89
|
+
]}
|
|
90
|
+
/>
|
|
91
|
+
|
|
92
|
+
<Pagination
|
|
93
|
+
currentPage={1}
|
|
94
|
+
totalPages={10}
|
|
95
|
+
onPageChange={(page) => console.log(page)}
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<TreeView
|
|
99
|
+
data={[
|
|
100
|
+
{ id: '1', label: 'Documents', children: [
|
|
101
|
+
{ id: '1-1', label: 'Work' },
|
|
102
|
+
{ id: '1-2', label: 'Private' }
|
|
103
|
+
]},
|
|
104
|
+
{ id: '2', label: 'Images' }
|
|
105
|
+
]}
|
|
106
|
+
/>
|
|
107
|
+
|
|
108
|
+
<AccessibilityStatement
|
|
109
|
+
country="SE"
|
|
110
|
+
sector="public"
|
|
111
|
+
organizationName="HolmDigital"
|
|
112
|
+
websiteUrl="https://holmdigital.se"
|
|
113
|
+
complianceLevel="partial"
|
|
114
|
+
lastReviewDate={new Date()}
|
|
115
|
+
publishDate={new Date('2024-02-06')}
|
|
116
|
+
contactEmail="hej@holmdigital.se"
|
|
117
|
+
badgeUrl="https://img.shields.io/badge/HolmDigital_Engine-100%25-00703C?style=flat-square"
|
|
118
|
+
locale="sv"
|
|
119
|
+
/>
|
|
120
|
+
|
|
121
|
+
<Button variant="primary" type="submit">
|
|
122
|
+
Submit
|
|
123
|
+
</Button>
|
|
124
|
+
</form>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Compliance Features
|
|
130
|
+
|
|
131
|
+
- **High Contrast**: Default styles meet WCAG AA requirements.
|
|
132
|
+
- **Keyboard Navigation**: Full focus management and visible focus indicators.
|
|
133
|
+
- **Screen Reader Support**: Correct ARIA attributes and labels built-in.
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
MIT © Holm Digital AB
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { Country } from '@holmdigital/standards';
|
|
3
|
+
|
|
4
|
+
interface AccessibilityStatementProps {
|
|
5
|
+
country: Country;
|
|
6
|
+
sector: 'public' | 'private';
|
|
7
|
+
organizationName: string;
|
|
8
|
+
websiteUrl: string;
|
|
9
|
+
complianceLevel: 'full' | 'partial' | 'non-compliant';
|
|
10
|
+
lastReviewDate: Date;
|
|
11
|
+
contactEmail: string;
|
|
12
|
+
assessmentDate?: Date;
|
|
13
|
+
evaluationMethod?: string;
|
|
14
|
+
generatorTool?: {
|
|
15
|
+
name: string;
|
|
16
|
+
url: string;
|
|
17
|
+
};
|
|
18
|
+
logoUrl?: string;
|
|
19
|
+
nonComplianceItems?: string[];
|
|
20
|
+
locale?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
phoneNumber?: string;
|
|
23
|
+
responseTime?: string;
|
|
24
|
+
badgeUrl?: string;
|
|
25
|
+
publishDate?: Date;
|
|
26
|
+
}
|
|
27
|
+
declare const AccessibilityStatement: React__default.FC<AccessibilityStatementProps>;
|
|
28
|
+
|
|
29
|
+
export { AccessibilityStatement, type AccessibilityStatementProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { Country } from '@holmdigital/standards';
|
|
3
|
+
|
|
4
|
+
interface AccessibilityStatementProps {
|
|
5
|
+
country: Country;
|
|
6
|
+
sector: 'public' | 'private';
|
|
7
|
+
organizationName: string;
|
|
8
|
+
websiteUrl: string;
|
|
9
|
+
complianceLevel: 'full' | 'partial' | 'non-compliant';
|
|
10
|
+
lastReviewDate: Date;
|
|
11
|
+
contactEmail: string;
|
|
12
|
+
assessmentDate?: Date;
|
|
13
|
+
evaluationMethod?: string;
|
|
14
|
+
generatorTool?: {
|
|
15
|
+
name: string;
|
|
16
|
+
url: string;
|
|
17
|
+
};
|
|
18
|
+
logoUrl?: string;
|
|
19
|
+
nonComplianceItems?: string[];
|
|
20
|
+
locale?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
phoneNumber?: string;
|
|
23
|
+
responseTime?: string;
|
|
24
|
+
badgeUrl?: string;
|
|
25
|
+
publishDate?: Date;
|
|
26
|
+
}
|
|
27
|
+
declare const AccessibilityStatement: React__default.FC<AccessibilityStatementProps>;
|
|
28
|
+
|
|
29
|
+
export { AccessibilityStatement, type AccessibilityStatementProps };
|