@holmdigital/components 1.2.3 → 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.
Files changed (66) hide show
  1. package/README.md +137 -60
  2. package/dist/AccessibilityStatement/AccessibilityStatement.d.mts +29 -0
  3. package/dist/AccessibilityStatement/AccessibilityStatement.d.ts +29 -0
  4. package/dist/AccessibilityStatement/AccessibilityStatement.js +551 -0
  5. package/dist/AccessibilityStatement/AccessibilityStatement.mjs +6 -0
  6. package/dist/Button/Button.js +1 -1
  7. package/dist/Button/Button.mjs +1 -1
  8. package/dist/Card/Card.d.mts +12 -0
  9. package/dist/Card/Card.d.ts +12 -0
  10. package/dist/Card/Card.js +81 -0
  11. package/dist/Card/Card.mjs +6 -0
  12. package/dist/Combobox/Combobox.d.mts +19 -0
  13. package/dist/Combobox/Combobox.d.ts +19 -0
  14. package/dist/Combobox/Combobox.js +271 -0
  15. package/dist/Combobox/Combobox.mjs +6 -0
  16. package/dist/DataTable/DataTable.d.mts +18 -0
  17. package/dist/DataTable/DataTable.d.ts +18 -0
  18. package/dist/DataTable/DataTable.js +125 -0
  19. package/dist/DataTable/DataTable.mjs +6 -0
  20. package/dist/DatePicker/DatePicker.d.mts +11 -0
  21. package/dist/DatePicker/DatePicker.d.ts +11 -0
  22. package/dist/DatePicker/DatePicker.js +110 -0
  23. package/dist/DatePicker/DatePicker.mjs +6 -0
  24. package/dist/ErrorSummary/ErrorSummary.d.mts +14 -0
  25. package/dist/ErrorSummary/ErrorSummary.d.ts +14 -0
  26. package/dist/ErrorSummary/ErrorSummary.js +119 -0
  27. package/dist/ErrorSummary/ErrorSummary.mjs +6 -0
  28. package/dist/LiveRegion/LiveRegion.d.mts +10 -0
  29. package/dist/LiveRegion/LiveRegion.d.ts +10 -0
  30. package/dist/LiveRegion/LiveRegion.js +69 -0
  31. package/dist/LiveRegion/LiveRegion.mjs +6 -0
  32. package/dist/Modal/Modal.d.mts +1 -2
  33. package/dist/Modal/Modal.d.ts +1 -2
  34. package/dist/MultiSelect/MultiSelect.d.mts +19 -0
  35. package/dist/MultiSelect/MultiSelect.d.ts +19 -0
  36. package/dist/MultiSelect/MultiSelect.js +263 -0
  37. package/dist/MultiSelect/MultiSelect.mjs +6 -0
  38. package/dist/Pagination/Pagination.d.mts +12 -0
  39. package/dist/Pagination/Pagination.d.ts +12 -0
  40. package/dist/Pagination/Pagination.js +149 -0
  41. package/dist/Pagination/Pagination.mjs +6 -0
  42. package/dist/Tooltip/Tooltip.d.mts +1 -1
  43. package/dist/Tooltip/Tooltip.d.ts +1 -1
  44. package/dist/Tooltip/Tooltip.js +1 -1
  45. package/dist/Tooltip/Tooltip.mjs +1 -1
  46. package/dist/TreeView/TreeView.d.mts +16 -0
  47. package/dist/TreeView/TreeView.d.ts +16 -0
  48. package/dist/TreeView/TreeView.js +250 -0
  49. package/dist/TreeView/TreeView.mjs +6 -0
  50. package/dist/chunk-4UONERC6.mjs +45 -0
  51. package/dist/chunk-57NZTQBX.mjs +86 -0
  52. package/dist/chunk-6REI7HHO.mjs +226 -0
  53. package/dist/chunk-EVNHLNS5.mjs +125 -0
  54. package/dist/chunk-FKSBWEX3.mjs +529 -0
  55. package/dist/chunk-HSUDZAQ6.mjs +101 -0
  56. package/dist/{chunk-C5M6C7KT.mjs → chunk-MCEJNWZT.mjs} +1 -1
  57. package/dist/{chunk-7V2LETZ6.mjs → chunk-MYXIUDCP.mjs} +1 -1
  58. package/dist/chunk-NECEXNCF.mjs +57 -0
  59. package/dist/chunk-OMSIXECN.mjs +247 -0
  60. package/dist/chunk-P2IXX552.mjs +95 -0
  61. package/dist/chunk-VM3O36W4.mjs +239 -0
  62. package/dist/index.d.mts +42 -1
  63. package/dist/index.d.ts +42 -1
  64. package/dist/index.js +1941 -2
  65. package/dist/index.mjs +244 -6
  66. package/package.json +50 -6
package/README.md CHANGED
@@ -1,60 +1,137 @@
1
- # @holmdigital/components
2
-
3
- [![npm version](https://img.shields.io/npm/v/@holmdigital/components.svg)](https://www.npmjs.com/package/@holmdigital/components)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
- ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)
6
- [![Downloads](https://img.shields.io/npm/dm/@holmdigital/components.svg)](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
- ## Installation
22
-
23
- ```bash
24
- npm install @holmdigital/components
25
- ```
26
-
27
- ## Usage
28
-
29
- ```tsx
30
- import { Button, FormField, Heading } from '@holmdigital/components';
31
-
32
- function App() {
33
- return (
34
- <form>
35
- <Heading level={1}>Contact Us</Heading>
36
- <FormField
37
- label="Email Address"
38
- type="email"
39
- required
40
- autoComplete="email"
41
- helpText="We'll never share your email."
42
- />
43
-
44
- <Button variant="primary" type="submit">
45
- Submit
46
- </Button>
47
- </form>
48
- );
49
- }
50
- ```
51
-
52
- ## Compliance Features
53
-
54
- - **High Contrast**: Default styles meet WCAG AA requirements.
55
- - **Keyboard Navigation**: Full focus management and visible focus indicators.
56
- - **Screen Reader Support**: Correct ARIA attributes and labels built-in.
57
-
58
- ## License
59
-
60
- MIT © Holm Digital AB
1
+ # @holmdigital/components
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@holmdigital/components.svg)](https://www.npmjs.com/package/@holmdigital/components)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)
6
+ [![Downloads](https://img.shields.io/npm/dm/@holmdigital/components.svg)](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 };