@pingux/astro 2.207.1-alpha.0 → 2.208.1-alpha.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 (182) hide show
  1. package/lib/cjs/components/AIComponents/PromptInput/PromptInputReadMe.mdx +12 -15
  2. package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.mdx +13 -19
  3. package/lib/cjs/components/AccordionGroup/AccordionGroup.mdx +16 -17
  4. package/lib/cjs/components/ArrayField/ArrayField.mdx +10 -15
  5. package/lib/cjs/components/Badge/Badge.mdx +6 -8
  6. package/lib/cjs/components/Badge/Badge.styles.d.ts +152 -0
  7. package/lib/cjs/components/Badge/Badge.styles.js +9 -1
  8. package/lib/cjs/components/Breadcrumbs/Breadcrumbs.mdx +11 -17
  9. package/lib/cjs/components/Button/Button.mdx +8 -12
  10. package/lib/cjs/components/Calendar/Calendar.mdx +17 -22
  11. package/lib/cjs/components/Callout/Callout.mdx +8 -13
  12. package/lib/cjs/components/Card/Card.mdx +6 -8
  13. package/lib/cjs/components/CheckboxField/CheckboxField.mdx +11 -16
  14. package/lib/cjs/components/CodeEditor/CodeEditor.mdx +8 -13
  15. package/lib/cjs/components/CodeView/CodeView.mdx +5 -8
  16. package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.mdx +10 -13
  17. package/lib/cjs/components/ColorField/ColorField.mdx +13 -18
  18. package/lib/cjs/components/ComboBoxField/ComboBoxField.mdx +13 -15
  19. package/lib/cjs/components/CopyText/CopyText.mdx +6 -8
  20. package/lib/cjs/components/DataTable/DataTable.mdx +17 -22
  21. package/lib/cjs/components/DatePicker/DatePicker.mdx +20 -27
  22. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.mdx +14 -19
  23. package/lib/cjs/components/ExpandableText/ExpandableText.mdx +9 -15
  24. package/lib/cjs/components/FileInputField/FileInputField.mdx +11 -16
  25. package/lib/cjs/components/Footer/Footer.mdx +9 -14
  26. package/lib/cjs/components/GridList/GridList.mdx +16 -21
  27. package/lib/cjs/components/HelpHint/HelpHint.mdx +8 -14
  28. package/lib/cjs/components/Icon/Icon.mdx +5 -3
  29. package/lib/cjs/components/IconButton/IconButton.mdx +7 -10
  30. package/lib/cjs/components/IconButtonToggle/IconButtonToggle.mdx +9 -15
  31. package/lib/cjs/components/Image/Image.mdx +4 -4
  32. package/lib/cjs/components/ImageUploadField/ImageUploadField.mdx +18 -24
  33. package/lib/cjs/components/Link/Link.mdx +5 -6
  34. package/lib/cjs/components/LinkSelectField/LinkSelectField.mdx +18 -24
  35. package/lib/cjs/components/ListItem/ListItem.mdx +6 -6
  36. package/lib/cjs/components/ListView/ListView.mdx +22 -23
  37. package/lib/cjs/components/Loader/Loader.mdx +6 -5
  38. package/lib/cjs/components/Menu/Menu.mdx +13 -18
  39. package/lib/cjs/components/Messages/Messages.mdx +9 -13
  40. package/lib/cjs/components/Modal/Modal.mdx +18 -19
  41. package/lib/cjs/components/MultivaluesField/MultivaluesField.mdx +14 -20
  42. package/lib/cjs/components/NavBar/NavBar.mdx +12 -17
  43. package/lib/cjs/components/NavSideBar/NavSideBar.mdx +12 -17
  44. package/lib/cjs/components/NavigationHeader/NavigationHeader.mdx +11 -16
  45. package/lib/cjs/components/NumberField/NumberField.mdx +16 -17
  46. package/lib/cjs/components/OverlayPanel/OverlayPanel.mdx +10 -14
  47. package/lib/cjs/components/Pagination/Pagination.js +4 -2
  48. package/lib/cjs/components/Pagination/Pagination.mdx +9 -13
  49. package/lib/cjs/components/Pagination/Pagination.styles.js +1 -1
  50. package/lib/cjs/components/PasswordField/PasswordField.mdx +10 -15
  51. package/lib/cjs/components/PopoverMenu/PopoverMenu.mdx +16 -22
  52. package/lib/cjs/components/ProgressBar/ProgressBar.mdx +6 -7
  53. package/lib/cjs/components/RadioGroupField/RadioGroupField.mdx +11 -17
  54. package/lib/cjs/components/RangeCalendar/RangeCalendar.mdx +17 -22
  55. package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.mdx +11 -16
  56. package/lib/cjs/components/SearchField/SearchField.mdx +8 -10
  57. package/lib/cjs/components/SelectField/SelectField.mdx +18 -23
  58. package/lib/cjs/components/Separator/Separator.mdx +4 -3
  59. package/lib/cjs/components/ServerErrorBoundary/ServerErrorBoundary.mdx +6 -8
  60. package/lib/cjs/components/SliderField/SliderField.mdx +12 -15
  61. package/lib/cjs/components/StatusIcon/StatusIcon.mdx +4 -3
  62. package/lib/cjs/components/Stepper/Stepper.mdx +18 -20
  63. package/lib/cjs/components/SwitchField/SwitchField.mdx +9 -14
  64. package/lib/cjs/components/TableBase/TableBase.js +4 -1
  65. package/lib/cjs/components/TableBase/TableBase.stories.js +8 -8
  66. package/lib/cjs/components/Tabs/Tabs.mdx +13 -18
  67. package/lib/cjs/components/TextAreaField/TextAreaField.mdx +8 -12
  68. package/lib/cjs/components/TextField/TextField.mdx +8 -12
  69. package/lib/cjs/components/TimeField/TimeField.mdx +12 -18
  70. package/lib/cjs/components/TooltipTrigger/TooltipTrigger.mdx +4 -3
  71. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/badges.d.ts +42 -0
  72. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/badges.js +38 -1
  73. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/cards.d.ts +3 -0
  74. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/cards.js +4 -0
  75. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/text.d.ts +3 -0
  76. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/text.js +3 -0
  77. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +26 -3
  78. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +27 -5
  79. package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +220 -18
  80. package/lib/cjs/styles/themes/next-gen/next-gen.js +1 -1
  81. package/lib/cjs/styles/themes/next-gen/variants/badges.d.ts +202 -0
  82. package/lib/cjs/styles/themes/next-gen/variants/badges.js +42 -1
  83. package/lib/cjs/styles/themes/next-gen/variants/cards.d.ts +1 -1
  84. package/lib/cjs/styles/themes/next-gen/variants/cards.js +3 -1
  85. package/lib/cjs/styles/themes/next-gen/variants/tableBase.d.ts +11 -17
  86. package/lib/cjs/styles/themes/next-gen/variants/tableBase.js +13 -17
  87. package/lib/cjs/styles/themes/next-gen/variants/text.d.ts +6 -0
  88. package/lib/cjs/styles/themes/next-gen/variants/text.js +6 -0
  89. package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +11 -17
  90. package/lib/cjs/types/accessibilityTable.d.ts +8 -0
  91. package/lib/cjs/types/accessibilityTable.js +6 -0
  92. package/lib/cjs/types/index.d.ts +1 -0
  93. package/lib/cjs/types/index.js +75 -64
  94. package/lib/cjs/utils/docUtils/AccessibilityTable.d.ts +3 -0
  95. package/lib/cjs/utils/docUtils/AccessibilityTable.js +38 -0
  96. package/lib/cjs/utils/docUtils/AccessibilityTable.test.js +192 -0
  97. package/lib/cjs/utils/docUtils/accessibilityTableConstants.d.ts +130 -0
  98. package/lib/cjs/utils/docUtils/accessibilityTableConstants.js +137 -0
  99. package/lib/components/AIComponents/PromptInput/PromptInputReadMe.mdx +12 -15
  100. package/lib/components/AccordionGridGroup/AccordionGridGroup.mdx +13 -19
  101. package/lib/components/AccordionGroup/AccordionGroup.mdx +16 -17
  102. package/lib/components/ArrayField/ArrayField.mdx +10 -15
  103. package/lib/components/Badge/Badge.mdx +6 -8
  104. package/lib/components/Badge/Badge.styles.js +9 -1
  105. package/lib/components/Breadcrumbs/Breadcrumbs.mdx +11 -17
  106. package/lib/components/Button/Button.mdx +8 -12
  107. package/lib/components/Calendar/Calendar.mdx +17 -22
  108. package/lib/components/Callout/Callout.mdx +8 -13
  109. package/lib/components/Card/Card.mdx +6 -8
  110. package/lib/components/CheckboxField/CheckboxField.mdx +11 -16
  111. package/lib/components/CodeEditor/CodeEditor.mdx +8 -13
  112. package/lib/components/CodeView/CodeView.mdx +5 -8
  113. package/lib/components/CollapsiblePanel/CollapsiblePanel.mdx +10 -13
  114. package/lib/components/ColorField/ColorField.mdx +13 -18
  115. package/lib/components/ComboBoxField/ComboBoxField.mdx +13 -15
  116. package/lib/components/CopyText/CopyText.mdx +6 -8
  117. package/lib/components/DataTable/DataTable.mdx +17 -22
  118. package/lib/components/DatePicker/DatePicker.mdx +20 -27
  119. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.mdx +14 -19
  120. package/lib/components/ExpandableText/ExpandableText.mdx +9 -15
  121. package/lib/components/FileInputField/FileInputField.mdx +11 -16
  122. package/lib/components/Footer/Footer.mdx +9 -14
  123. package/lib/components/GridList/GridList.mdx +16 -21
  124. package/lib/components/HelpHint/HelpHint.mdx +8 -14
  125. package/lib/components/Icon/Icon.mdx +5 -3
  126. package/lib/components/IconButton/IconButton.mdx +7 -10
  127. package/lib/components/IconButtonToggle/IconButtonToggle.mdx +9 -15
  128. package/lib/components/Image/Image.mdx +4 -4
  129. package/lib/components/ImageUploadField/ImageUploadField.mdx +18 -24
  130. package/lib/components/Link/Link.mdx +5 -6
  131. package/lib/components/LinkSelectField/LinkSelectField.mdx +18 -24
  132. package/lib/components/ListItem/ListItem.mdx +6 -6
  133. package/lib/components/ListView/ListView.mdx +22 -23
  134. package/lib/components/Loader/Loader.mdx +6 -5
  135. package/lib/components/Menu/Menu.mdx +13 -18
  136. package/lib/components/Messages/Messages.mdx +9 -13
  137. package/lib/components/Modal/Modal.mdx +18 -19
  138. package/lib/components/MultivaluesField/MultivaluesField.mdx +14 -20
  139. package/lib/components/NavBar/NavBar.mdx +12 -17
  140. package/lib/components/NavSideBar/NavSideBar.mdx +12 -17
  141. package/lib/components/NavigationHeader/NavigationHeader.mdx +11 -16
  142. package/lib/components/NumberField/NumberField.mdx +16 -17
  143. package/lib/components/OverlayPanel/OverlayPanel.mdx +10 -14
  144. package/lib/components/Pagination/Pagination.js +4 -2
  145. package/lib/components/Pagination/Pagination.mdx +9 -13
  146. package/lib/components/Pagination/Pagination.styles.js +1 -1
  147. package/lib/components/PasswordField/PasswordField.mdx +10 -15
  148. package/lib/components/PopoverMenu/PopoverMenu.mdx +16 -22
  149. package/lib/components/ProgressBar/ProgressBar.mdx +6 -7
  150. package/lib/components/RadioGroupField/RadioGroupField.mdx +11 -17
  151. package/lib/components/RangeCalendar/RangeCalendar.mdx +17 -22
  152. package/lib/components/RockerButtonGroup/RockerButtonGroup.mdx +11 -16
  153. package/lib/components/SearchField/SearchField.mdx +8 -10
  154. package/lib/components/SelectField/SelectField.mdx +18 -23
  155. package/lib/components/Separator/Separator.mdx +4 -3
  156. package/lib/components/ServerErrorBoundary/ServerErrorBoundary.mdx +6 -8
  157. package/lib/components/SliderField/SliderField.mdx +12 -15
  158. package/lib/components/StatusIcon/StatusIcon.mdx +4 -3
  159. package/lib/components/Stepper/Stepper.mdx +18 -20
  160. package/lib/components/SwitchField/SwitchField.mdx +9 -14
  161. package/lib/components/TableBase/TableBase.js +4 -1
  162. package/lib/components/TableBase/TableBase.stories.js +8 -8
  163. package/lib/components/Tabs/Tabs.mdx +13 -18
  164. package/lib/components/TextAreaField/TextAreaField.mdx +8 -12
  165. package/lib/components/TextField/TextField.mdx +8 -12
  166. package/lib/components/TimeField/TimeField.mdx +12 -18
  167. package/lib/components/TooltipTrigger/TooltipTrigger.mdx +4 -3
  168. package/lib/styles/themeOverrides/nextGenDarkMode/variants/badges.js +38 -1
  169. package/lib/styles/themeOverrides/nextGenDarkMode/variants/cards.js +4 -0
  170. package/lib/styles/themeOverrides/nextGenDarkMode/variants/text.js +3 -0
  171. package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +27 -5
  172. package/lib/styles/themes/next-gen/next-gen.js +1 -1
  173. package/lib/styles/themes/next-gen/variants/badges.js +42 -1
  174. package/lib/styles/themes/next-gen/variants/cards.js +3 -1
  175. package/lib/styles/themes/next-gen/variants/tableBase.js +13 -17
  176. package/lib/styles/themes/next-gen/variants/text.js +6 -0
  177. package/lib/types/accessibilityTable.js +1 -0
  178. package/lib/types/index.js +1 -0
  179. package/lib/utils/docUtils/AccessibilityTable.js +30 -0
  180. package/lib/utils/docUtils/AccessibilityTable.test.js +190 -0
  181. package/lib/utils/docUtils/accessibilityTableConstants.js +130 -0
  182. package/package.json +1 -1
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
+ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
5
+ var _react = _interopRequireDefault(require("react"));
6
+ var _react2 = require("@testing-library/react");
7
+ var _universalComponentTest = require("../testUtils/universalComponentTest");
8
+ var _AccessibilityTable = _interopRequireDefault(require("./AccessibilityTable"));
9
+ var _react3 = require("@emotion/react");
10
+ // Needs to be added to each component test file
11
+ (0, _universalComponentTest.universalComponentTests)({
12
+ renderComponent: function renderComponent(props) {
13
+ return (0, _react3.jsx)(_AccessibilityTable["default"], (0, _extends2["default"])({
14
+ keyboardRows: [{
15
+ key: 'Tab',
16
+ description: 'Focus next element'
17
+ }]
18
+ }, props));
19
+ },
20
+ skipForwardRefTest: true
21
+ });
22
+ test('renders nothing when both keyboardRows and screenReaderRows are absent', function () {
23
+ var _render = (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], null)),
24
+ container = _render.container;
25
+ expect(container).toBeEmptyDOMElement();
26
+ });
27
+ test('renders nothing when both props are provided as empty arrays', function () {
28
+ var _render2 = (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
29
+ keyboardRows: [],
30
+ screenReaderRows: []
31
+ })),
32
+ container = _render2.container;
33
+ expect(container).toBeEmptyDOMElement();
34
+ });
35
+ describe('keyboard navigation section', function () {
36
+ var keyboardRows = [{
37
+ key: 'Tab',
38
+ description: 'Focus next element'
39
+ }, {
40
+ key: 'Shift+Tab',
41
+ description: 'Focus previous element'
42
+ }];
43
+ test('renders the Keyboard Navigation heading', function () {
44
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
45
+ keyboardRows: keyboardRows
46
+ }));
47
+ expect(_react2.screen.getByText('Keyboard Navigation')).toBeInTheDocument();
48
+ });
49
+ test('renders the keyboard section description paragraph', function () {
50
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
51
+ keyboardRows: keyboardRows
52
+ }));
53
+ expect(_react2.screen.getByText('These keys provide additional functionality to the component.')).toBeInTheDocument();
54
+ });
55
+ test('renders Key and Function column headers', function () {
56
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
57
+ keyboardRows: keyboardRows
58
+ }));
59
+ expect(_react2.screen.getByText('Key')).toBeInTheDocument();
60
+ expect(_react2.screen.getByText('Function')).toBeInTheDocument();
61
+ });
62
+ test('renders one row per keyboardRows entry', function () {
63
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
64
+ keyboardRows: keyboardRows
65
+ }));
66
+ var rows = _react2.screen.getAllByRole('row');
67
+ // thead has 1 row, tbody has 2 rows (one per entry)
68
+ expect(rows).toHaveLength(3);
69
+ });
70
+ test('renders the key cell for each row', function () {
71
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
72
+ keyboardRows: keyboardRows
73
+ }));
74
+ expect(_react2.screen.getByText('Tab')).toBeInTheDocument();
75
+ expect(_react2.screen.getByText('Shift+Tab')).toBeInTheDocument();
76
+ });
77
+ test('does not render the Screen Readers section', function () {
78
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
79
+ keyboardRows: keyboardRows
80
+ }));
81
+ expect(_react2.screen.queryByText('Screen Readers')).not.toBeInTheDocument();
82
+ });
83
+ test('renders a custom keyboardDescription when the prop is provided', function () {
84
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
85
+ keyboardRows: keyboardRows,
86
+ keyboardDescription: "Custom keyboard description for this component."
87
+ }));
88
+ expect(_react2.screen.getByText('Custom keyboard description for this component.')).toBeInTheDocument();
89
+ });
90
+ test('does not render a custom keyboardDescription when the prop is omitted', function () {
91
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
92
+ keyboardRows: keyboardRows
93
+ }));
94
+ expect(_react2.screen.queryByText('Custom keyboard description for this component.')).not.toBeInTheDocument();
95
+ });
96
+ test('falls back to the default description when keyboardDescription is an empty string', function () {
97
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
98
+ keyboardRows: keyboardRows,
99
+ keyboardDescription: ""
100
+ }));
101
+ expect(_react2.screen.getByText('These keys provide additional functionality to the component.')).toBeInTheDocument();
102
+ });
103
+ });
104
+ describe('screen reader section', function () {
105
+ var screenReaderRows = ['aria-label', 'aria-expanded'];
106
+ test('renders the Screen Readers heading', function () {
107
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
108
+ screenReaderRows: screenReaderRows
109
+ }));
110
+ expect(_react2.screen.getByText('Screen Readers')).toBeInTheDocument();
111
+ });
112
+ test('renders the screen reader section description paragraph', function () {
113
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
114
+ screenReaderRows: screenReaderRows
115
+ }));
116
+ expect(_react2.screen.getByText('This component uses the following attributes to assist screen readers:')).toBeInTheDocument();
117
+ });
118
+ test('renders a list with one item per screenReaderRows entry', function () {
119
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
120
+ screenReaderRows: screenReaderRows
121
+ }));
122
+ var items = _react2.screen.getAllByRole('listitem');
123
+ expect(items).toHaveLength(screenReaderRows.length);
124
+ });
125
+ test('renders text content for each screen reader row item', function () {
126
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
127
+ screenReaderRows: screenReaderRows
128
+ }));
129
+ expect(_react2.screen.getByText('aria-label')).toBeInTheDocument();
130
+ expect(_react2.screen.getByText('aria-expanded')).toBeInTheDocument();
131
+ });
132
+ test('does not render the Keyboard Navigation section', function () {
133
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
134
+ screenReaderRows: screenReaderRows
135
+ }));
136
+ expect(_react2.screen.queryByText('Keyboard Navigation')).not.toBeInTheDocument();
137
+ });
138
+ });
139
+ describe('both sections together', function () {
140
+ var keyboardRows = [{
141
+ key: 'Tab',
142
+ description: 'Focus next element'
143
+ }];
144
+ var screenReaderRows = ['aria-label'];
145
+ test('renders both headings when both props are provided', function () {
146
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
147
+ keyboardRows: keyboardRows,
148
+ screenReaderRows: screenReaderRows
149
+ }));
150
+ expect(_react2.screen.getByText('Keyboard Navigation')).toBeInTheDocument();
151
+ expect(_react2.screen.getByText('Screen Readers')).toBeInTheDocument();
152
+ });
153
+ test('renders both the table and the list', function () {
154
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
155
+ keyboardRows: keyboardRows,
156
+ screenReaderRows: screenReaderRows
157
+ }));
158
+ expect(_react2.screen.getByRole('table')).toBeInTheDocument();
159
+ expect(_react2.screen.getByRole('list')).toBeInTheDocument();
160
+ });
161
+ });
162
+ describe('markdown rendering', function () {
163
+ test('renders bold markdown in row.description as a strong element', function () {
164
+ var keyboardRows = [{
165
+ key: 'Enter',
166
+ description: '**Confirm** selection'
167
+ }];
168
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
169
+ keyboardRows: keyboardRows
170
+ }));
171
+ var strongEl = _react2.screen.getByText('Confirm');
172
+ expect(strongEl.tagName).toBe('STRONG');
173
+ });
174
+ test('renders plain text description via markdown-to-jsx without error', function () {
175
+ var keyboardRows = [{
176
+ key: 'Tab',
177
+ description: 'Focus next element'
178
+ }];
179
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
180
+ keyboardRows: keyboardRows
181
+ }));
182
+ expect(_react2.screen.getByText('Focus next element')).toBeInTheDocument();
183
+ });
184
+ test('renders bold markdown in screenReaderRows item as a strong element', function () {
185
+ var screenReaderRows = ['**aria-label**: describes the element'];
186
+ (0, _react2.render)((0, _react3.jsx)(_AccessibilityTable["default"], {
187
+ screenReaderRows: screenReaderRows
188
+ }));
189
+ var strongEl = _react2.screen.getByText('aria-label');
190
+ expect(strongEl.tagName).toBe('STRONG');
191
+ });
192
+ });
@@ -0,0 +1,130 @@
1
+ export declare const KeyboardRows: {
2
+ readonly shiftTabFocusPrevious: {
3
+ readonly key: "Shift + Tab";
4
+ readonly description: "Moves focus to the previous focusable component.";
5
+ };
6
+ readonly tabField: {
7
+ readonly key: "Tab";
8
+ readonly description: "The field is focusable using the Tab key and follows the page tab sequence.";
9
+ };
10
+ readonly tabFocusesField: {
11
+ readonly key: "Tab";
12
+ readonly description: "Focuses the field and follows the page tab sequence.";
13
+ };
14
+ readonly spaceEnterSelectsButton: {
15
+ readonly key: "Space or Enter";
16
+ readonly description: "Selects the button.";
17
+ };
18
+ readonly tabFocusesButton: {
19
+ readonly key: "Tab";
20
+ readonly description: "Focuses the button and follows the page tab sequence.";
21
+ };
22
+ readonly homeFirstListboxItem: {
23
+ readonly key: "Home(Fn + Right Arrow Key) Or Control/Command + Home";
24
+ readonly description: "Shifts the focus to the first item in the listbox.";
25
+ };
26
+ readonly endLastListboxItem: {
27
+ readonly key: "End(Fn + Left Arrow Key) Or Control/Command + End";
28
+ readonly description: "Shifts the focus to the last item in the listbox.";
29
+ };
30
+ readonly tabNextFocusableComponent: {
31
+ readonly key: "Tab";
32
+ readonly description: "Moves focus to the next focusable component and follows the page tab sequence.";
33
+ };
34
+ readonly tabFocusesItem: {
35
+ readonly key: "Tab";
36
+ readonly description: "Focuses item and follows the page tab sequence.";
37
+ };
38
+ readonly tabAccordionFocusable: {
39
+ readonly key: "Tab";
40
+ readonly description: "Moves focus to the next focusable component. All focusable components in the accordion are included in the page tab sequence.";
41
+ };
42
+ readonly shiftTabAccordionFocusPrevious: {
43
+ readonly key: "Shift + Tab";
44
+ readonly description: "Moves focus to the previous focusable component. All focusable components in the accordion are included in the page tab sequence.";
45
+ };
46
+ readonly spaceEnterToggleAccordion: {
47
+ readonly key: "Space or Enter";
48
+ readonly description: "Toggles the component when the accordion is focused.";
49
+ };
50
+ readonly escCollapseAccordion: {
51
+ readonly key: "Esc";
52
+ readonly description: "Pressing the escape key when the accordion is open and focused collapses the component.";
53
+ };
54
+ readonly tabCalendar: {
55
+ readonly key: "Tab";
56
+ readonly description: "Components in the calendar are focusable and follow the page tab sequence.";
57
+ };
58
+ readonly homeFirstCalendarDate: {
59
+ readonly key: "Pressing Home:(Fn + Right Arrow Key) Or Control or Command + Home";
60
+ readonly description: "Shifts the focus to the first calendar date.";
61
+ };
62
+ readonly pageUpPreviousMonth: {
63
+ readonly key: "Page up";
64
+ readonly description: "Changes the grid of dates to the previous month.";
65
+ };
66
+ readonly pageDownNextMonth: {
67
+ readonly key: "Page down";
68
+ readonly description: "Changes the grid of dates to the next month.";
69
+ };
70
+ readonly shiftPageUpPreviousYear: {
71
+ readonly key: "Shift + page up";
72
+ readonly description: "Changes the grid of dates to the same month in the previous year.";
73
+ };
74
+ readonly shiftPageDownNextYear: {
75
+ readonly key: "Shift + page down";
76
+ readonly description: "Changes the grid of dates to the same month in the next year.";
77
+ };
78
+ readonly spaceEnterSelectsComponent: {
79
+ readonly key: "Space or Enter";
80
+ readonly description: "Selects the component when it is focused.";
81
+ };
82
+ readonly typingOpenPopover: {
83
+ readonly key: "Typing in input field";
84
+ readonly description: "Adds focus to it and opens the popover.";
85
+ };
86
+ readonly spaceEnterSelectsItem: {
87
+ readonly key: "Space or Enter";
88
+ readonly description: "Selects the item.";
89
+ };
90
+ readonly spaceEnterSelectsComponentSimple: {
91
+ readonly key: "Space or Enter";
92
+ readonly description: "Selects the component.";
93
+ };
94
+ readonly tabFocusesComponent: {
95
+ readonly key: "Tab";
96
+ readonly description: "Focuses the component and follows the page tab sequence.";
97
+ };
98
+ readonly tabInput: {
99
+ readonly key: "Tab";
100
+ readonly description: "The input is focusable using the Tab key and follows the page tab sequence.";
101
+ };
102
+ readonly homeFirstRow: {
103
+ readonly key: "Home(Fn + Right Arrow Key) Or Control/Command + Home";
104
+ readonly description: "Shifts the focus to the first row.";
105
+ };
106
+ readonly endLastVisibleRow: {
107
+ readonly key: "End(Fn + Left Arrow Key) Or Control/Command + End";
108
+ readonly description: "Shifts the focus to the last visible row.";
109
+ };
110
+ readonly arrowKeysMovePopoverSelection: {
111
+ readonly key: "Arrow keys";
112
+ readonly description: "Moves the selection through the popover.";
113
+ };
114
+ readonly escClosePopoverFocusPrevious: {
115
+ readonly key: "Esc";
116
+ readonly description: "Pressing the escape key closes the popover and focuses on the previous focusable component.";
117
+ };
118
+ };
119
+ export declare const ScreenReaderRows: {
120
+ readonly ariaLabelAccessibleName: "The **`aria-label`** attribute is used to provide an accessible name.";
121
+ readonly eachLinkAriaLabel: "Each Link component uses the **`aria-label`** attribute to provide an accessible name.";
122
+ readonly ariaLiveAnnounce: "The **`aria-live`** attribute is used to announce content changes in a live region.";
123
+ readonly ariaOrientationWithTrailingSpace: "The **`aria-orientation`** attribute indicates whether the orientation is horizontal, vertical, unknown, or ambiguous. ";
124
+ readonly accordionAriaExpanded: "The accordion header button uses the **`aria-expanded`** attribute to indicate when the content expands and collapses.";
125
+ readonly iconAriaHidden: "The Icon uses the **`aria-hidden`** attribute to hide its content from assistive technology.";
126
+ readonly triggerAriaExpandedExpandCollapse: "The trigger button uses the **`aria-expanded`** attribute to indicate when the content expands and collapses.";
127
+ readonly ariaLabelledByInvalidFalse: "This component uses the **`aria-labelledby`** attribute pointing to the label, and the **`aria-invalid`** attribute to detect incorrect values or status errors, which is set to \"False\" by default.";
128
+ readonly ariaOrientationNoTrailingSpace: "The **`aria-orientation`** attribute indicates whether the orientation is horizontal, vertical, unknown, or ambiguous.";
129
+ readonly componentAriaLabel: "This component uses the **`aria-label`** attribute to provide an accessible name.";
130
+ };
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ScreenReaderRows = exports.KeyboardRows = void 0;
8
+ var KeyboardRows = exports.KeyboardRows = {
9
+ shiftTabFocusPrevious: {
10
+ key: 'Shift + Tab',
11
+ description: 'Moves focus to the previous focusable component.'
12
+ },
13
+ tabField: {
14
+ key: 'Tab',
15
+ description: 'The field is focusable using the Tab key and follows the page tab sequence.'
16
+ },
17
+ tabFocusesField: {
18
+ key: 'Tab',
19
+ description: 'Focuses the field and follows the page tab sequence.'
20
+ },
21
+ spaceEnterSelectsButton: {
22
+ key: 'Space or Enter',
23
+ description: 'Selects the button.'
24
+ },
25
+ tabFocusesButton: {
26
+ key: 'Tab',
27
+ description: 'Focuses the button and follows the page tab sequence.'
28
+ },
29
+ homeFirstListboxItem: {
30
+ key: 'Home(Fn + Right Arrow Key) Or Control/Command + Home',
31
+ description: 'Shifts the focus to the first item in the listbox.'
32
+ },
33
+ endLastListboxItem: {
34
+ key: 'End(Fn + Left Arrow Key) Or Control/Command + End',
35
+ description: 'Shifts the focus to the last item in the listbox.'
36
+ },
37
+ tabNextFocusableComponent: {
38
+ key: 'Tab',
39
+ description: 'Moves focus to the next focusable component and follows the page tab sequence.'
40
+ },
41
+ tabFocusesItem: {
42
+ key: 'Tab',
43
+ description: 'Focuses item and follows the page tab sequence.'
44
+ },
45
+ tabAccordionFocusable: {
46
+ key: 'Tab',
47
+ description: 'Moves focus to the next focusable component. All focusable components in the accordion are included in the page tab sequence.'
48
+ },
49
+ shiftTabAccordionFocusPrevious: {
50
+ key: 'Shift + Tab',
51
+ description: 'Moves focus to the previous focusable component. All focusable components in the accordion are included in the page tab sequence.'
52
+ },
53
+ spaceEnterToggleAccordion: {
54
+ key: 'Space or Enter',
55
+ description: 'Toggles the component when the accordion is focused.'
56
+ },
57
+ escCollapseAccordion: {
58
+ key: 'Esc',
59
+ description: 'Pressing the escape key when the accordion is open and focused collapses the component.'
60
+ },
61
+ tabCalendar: {
62
+ key: 'Tab',
63
+ description: 'Components in the calendar are focusable and follow the page tab sequence.'
64
+ },
65
+ homeFirstCalendarDate: {
66
+ key: 'Pressing Home:(Fn + Right Arrow Key) Or Control or Command + Home',
67
+ description: 'Shifts the focus to the first calendar date.'
68
+ },
69
+ pageUpPreviousMonth: {
70
+ key: 'Page up',
71
+ description: 'Changes the grid of dates to the previous month.'
72
+ },
73
+ pageDownNextMonth: {
74
+ key: 'Page down',
75
+ description: 'Changes the grid of dates to the next month.'
76
+ },
77
+ shiftPageUpPreviousYear: {
78
+ key: 'Shift + page up',
79
+ description: 'Changes the grid of dates to the same month in the previous year.'
80
+ },
81
+ shiftPageDownNextYear: {
82
+ key: 'Shift + page down',
83
+ description: 'Changes the grid of dates to the same month in the next year.'
84
+ },
85
+ spaceEnterSelectsComponent: {
86
+ key: 'Space or Enter',
87
+ description: 'Selects the component when it is focused.'
88
+ },
89
+ typingOpenPopover: {
90
+ key: 'Typing in input field',
91
+ description: 'Adds focus to it and opens the popover.'
92
+ },
93
+ spaceEnterSelectsItem: {
94
+ key: 'Space or Enter',
95
+ description: 'Selects the item.'
96
+ },
97
+ spaceEnterSelectsComponentSimple: {
98
+ key: 'Space or Enter',
99
+ description: 'Selects the component.'
100
+ },
101
+ tabFocusesComponent: {
102
+ key: 'Tab',
103
+ description: 'Focuses the component and follows the page tab sequence.'
104
+ },
105
+ tabInput: {
106
+ key: 'Tab',
107
+ description: 'The input is focusable using the Tab key and follows the page tab sequence.'
108
+ },
109
+ homeFirstRow: {
110
+ key: 'Home(Fn + Right Arrow Key) Or Control/Command + Home',
111
+ description: 'Shifts the focus to the first row.'
112
+ },
113
+ endLastVisibleRow: {
114
+ key: 'End(Fn + Left Arrow Key) Or Control/Command + End',
115
+ description: 'Shifts the focus to the last visible row.'
116
+ },
117
+ arrowKeysMovePopoverSelection: {
118
+ key: 'Arrow keys',
119
+ description: 'Moves the selection through the popover.'
120
+ },
121
+ escClosePopoverFocusPrevious: {
122
+ key: 'Esc',
123
+ description: 'Pressing the escape key closes the popover and focuses on the previous focusable component.'
124
+ }
125
+ };
126
+ var ScreenReaderRows = exports.ScreenReaderRows = {
127
+ ariaLabelAccessibleName: 'The **`aria-label`** attribute is used to provide an accessible name.',
128
+ eachLinkAriaLabel: 'Each Link component uses the **`aria-label`** attribute to provide an accessible name.',
129
+ ariaLiveAnnounce: 'The **`aria-live`** attribute is used to announce content changes in a live region.',
130
+ ariaOrientationWithTrailingSpace: 'The **`aria-orientation`** attribute indicates whether the orientation is horizontal, vertical, unknown, or ambiguous. ',
131
+ accordionAriaExpanded: 'The accordion header button uses the **`aria-expanded`** attribute to indicate when the content expands and collapses.',
132
+ iconAriaHidden: 'The Icon uses the **`aria-hidden`** attribute to hide its content from assistive technology.',
133
+ triggerAriaExpandedExpandCollapse: 'The trigger button uses the **`aria-expanded`** attribute to indicate when the content expands and collapses.',
134
+ ariaLabelledByInvalidFalse: 'This component uses the **`aria-labelledby`** attribute pointing to the label, and the **`aria-invalid`** attribute to detect incorrect values or status errors, which is set to "False" by default.',
135
+ ariaOrientationNoTrailingSpace: 'The **`aria-orientation`** attribute indicates whether the orientation is horizontal, vertical, unknown, or ambiguous.',
136
+ componentAriaLabel: 'This component uses the **`aria-label`** attribute to provide an accessible name.'
137
+ };
@@ -1,5 +1,6 @@
1
1
  import { Meta } from '@storybook/addon-docs/blocks';
2
2
  import * as PromptInputStories from './PromptInput.stories';
3
+ import AccessibilityTable from '../../../utils/docUtils/AccessibilityTable';
3
4
 
4
5
  <Meta of={PromptInputStories} isTemplate />
5
6
 
@@ -38,21 +39,17 @@ The `PromptInput` component is used to capture user input in a conversational UI
38
39
 
39
40
  This component adheres to accessibility guidelines to ensure a better user experience for all users.
40
41
 
41
- #### Keyboard Navigation
42
-
43
- | Keys | Function |
44
- | ------------ | ----------------------------------------------------------------------- |
45
- | Tab | Focuses on the next focusable element within the input. |
46
- | Shift + Tab | Moves focus to the previous focusable element. |
47
- | Enter | Submits the input when `onSubmit` is defined. |
48
- | Shift + Enter| Adds a new line to the input. |
49
- | Escape | Cancels the input when `onCancel` is defined. |
50
-
51
- #### Screen Readers
52
-
53
- - **`aria-label`**: Describes the purpose of the input field.
54
- - **`aria-disabled`**: Indicates when the input is disabled.
55
- - **`aria-live`**: Announces changes to the input dynamically.
42
+ <AccessibilityTable keyboardRows={[
43
+ { key: 'Tab', description: 'Focuses on the next focusable element within the input.' },
44
+ { key: 'Shift + Tab', description: 'Moves focus to the previous focusable element.' },
45
+ { key: 'Enter', description: 'Submits the input when `onSubmit` is defined.' },
46
+ { key: 'Shift + Enter', description: 'Adds a new line to the input.' },
47
+ { key: 'Escape', description: 'Cancels the input when `onCancel` is defined.' },
48
+ ]} screenReaderRows={[
49
+ '**`aria-label`**: Describes the purpose of the input field.',
50
+ '**`aria-disabled`**: Indicates when the input is disabled.',
51
+ '**`aria-live`**: Announces changes to the input dynamically.',
52
+ ]} />
56
53
 
57
54
  ### Example Usage
58
55
 
@@ -1,5 +1,7 @@
1
1
  import { Meta } from '@storybook/addon-docs/blocks';
2
2
  import * as AccordionGridGroupStories from './AccordionGridGroup.stories';
3
+ import AccessibilityTable from '../../utils/docUtils/AccessibilityTable';
4
+ import { KeyboardRows, ScreenReaderRows } from '../../utils/docUtils/accessibilityTableConstants';
3
5
 
4
6
  <Meta of={AccordionGridGroupStories} isTemplate />
5
7
 
@@ -20,22 +22,14 @@ This component requires the Header, Body and Item originating from [react-statel
20
22
 
21
23
  This component should adhere to the [WAI-ARIA Accordion](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/examples/accordion) accessibility guidelines.
22
24
 
23
- #### Keyboard Navigation
24
-
25
- These keys provide additional functionality to the component.
26
-
27
- | Keys | Functions |
28
- | ---- | --------- |
29
- | Space or Enter | When focus is on the header panel of a collapsed section, these keys toggle the component. |
30
- | Tab | Moves focus to the next focusable component. All focusable components in the accordion are included in the page tab sequence.|
31
- | Shift + Tab | Moves focus to the previous focusable component. All focusable components in the accordion are included in the page tab sequence. |
32
- | Arrow Keys | All components are accessible using arrow keys. |
33
-
34
- #### Screen readers
35
-
36
- This component uses the following attributes to assist screen readers:
37
-
38
- - The accordion grid item header button uses the **`aria-selected`** attribute to indicate the selection state of the row.
39
- - The accordion header button uses the **`aria-expanded`** attribute to indicate when the content expands and collapses.
40
- - The **`aria-multiselectable`** attribute indicates that the user can toggle numerous items from the grid.
41
- - The grid uses the **`aria-label`** attribute to provide an accessible name.
25
+ <AccessibilityTable keyboardRows={[
26
+ { key: 'Space or Enter', description: 'When focus is on the header panel of a collapsed section, these keys toggle the component.' },
27
+ KeyboardRows.tabAccordionFocusable,
28
+ KeyboardRows.shiftTabAccordionFocusPrevious,
29
+ { key: 'Arrow Keys', description: 'All components are accessible using arrow keys.' },
30
+ ]} screenReaderRows={[
31
+ 'The accordion grid item header button uses the **`aria-selected`** attribute to indicate the selection state of the row.',
32
+ ScreenReaderRows.accordionAriaExpanded,
33
+ 'The **`aria-multiselectable`** attribute indicates that the user can toggle numerous items from the grid.',
34
+ 'The grid uses the **`aria-label`** attribute to provide an accessible name.',
35
+ ]} />
@@ -1,5 +1,7 @@
1
1
  import { Meta } from '@storybook/addon-docs/blocks';
2
2
  import * as AccordionGroupStories from './AccordionGroup.stories';
3
+ import AccessibilityTable from '../../utils/docUtils/AccessibilityTable';
4
+ import { KeyboardRows, ScreenReaderRows } from '../../utils/docUtils/accessibilityTableConstants';
3
5
 
4
6
  <Meta of={AccordionGroupStories} isTemplate />
5
7
 
@@ -27,24 +29,21 @@ This component requires Item originating from [react-stately/collections](https:
27
29
 
28
30
  This component should adhere to the [WAI-ARIA Accordion](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/examples/accordion) accessibility guidelines.
29
31
 
30
- #### Keyboard Navigation
31
-
32
- These keys provide additional functionality to the component.
33
-
34
- | Keys | Functions |
35
- | ---- | --------- |
36
- | Space or Enter | When focus is on the accordion header of a collapsed section, these keys expand the section. |
37
- | Tab | Moves focus to the next focusable component. All focusable components in the accordion are included in the page tab sequence.|
38
- | Shift + Tab | Moves focus to the previous focusable component. All focusable components in the accordion are included in the page tab sequence. |
39
-
32
+ <AccessibilityTable
33
+ keyboardRows={[
34
+ { key: 'Space or Enter', description: 'When focus is on the accordion header of a collapsed section, these keys expand the section.' },
35
+ KeyboardRows.tabAccordionFocusable,
36
+ KeyboardRows.shiftTabAccordionFocusPrevious,
37
+ ]}
38
+ screenReaderRows={[
39
+ ScreenReaderRows.accordionAriaExpanded,
40
+ 'When expanded, the **`aria-controls`** attribute is added to the button pointing to the content. The button uses **`aria-label`** to provide an accessible name.',
41
+ 'The **`aria-labelledby`** attribute is added to the entire accordion component, which is supplied with the button ID.',
42
+ ]}
43
+ />
44
+
45
+ {/* Non-standard section: '#### Slots' documents prop usage, not an accessibility pattern. Flagged for future migration. */}
40
46
  #### Slots
41
47
 
42
48
  The slots prop has been provided for added flexibility. Use the **`postHeading`** slot to add helpHint or icon elements next to the heading
43
49
  section. Keep in mind that this component is best suited for specific designs necessitates its use.
44
-
45
- #### Screen readers
46
-
47
- This component uses the following attributes to assist screen readers:
48
- - The accordion header button uses the **`aria-expanded`** attribute to indicate when the content expands and collapses.
49
- - When expanded, the **`aria-controls`** attribute is added to the button pointing to the content. The button uses **`aria-label`** to provide an accessible name.
50
- - The **`aria-labelledby`** attribute is added to the entire accordion component, which is supplied with the button ID.
@@ -1,5 +1,7 @@
1
1
  import { Meta } from '@storybook/addon-docs/blocks';
2
2
  import * as ArrayFieldStories from './ArrayField.stories';
3
+ import AccessibilityTable from '../../utils/docUtils/AccessibilityTable';
4
+ import { KeyboardRows } from '../../utils/docUtils/accessibilityTableConstants';
3
5
 
4
6
  <Meta of={ArrayFieldStories} isTemplate />
5
7
 
@@ -18,18 +20,11 @@ This component requires the appropriate field component ([TextField](./?path=/st
18
20
 
19
21
  ### Accessibility
20
22
 
21
- #### Keyboard Navigation
22
-
23
- These keys provide additional functionality to the component.
24
-
25
- | Keys | Functions |
26
- | ---- | ---- |
27
- | Space or Enter | When focused, selects the item. |
28
- | Tab | Moves focus to the next focusable component and follows the page tab sequence. |
29
- | Shift + Tab | Moves focus to the previous focusable component. |
30
-
31
- #### Screen Readers
32
-
33
- This component uses the following attributes to assist screen readers:
34
- - The input uses the **`aria-invalid`** attribute to alert users that the values entered are not in the expected format.
35
- - The field and buttons use the **`aria-label`** attribute to provide accessible names.
23
+ <AccessibilityTable keyboardRows={[
24
+ { key: 'Space or Enter', description: 'When focused, selects the item.' },
25
+ KeyboardRows.tabNextFocusableComponent,
26
+ KeyboardRows.shiftTabFocusPrevious,
27
+ ]} screenReaderRows={[
28
+ 'The input uses the **`aria-invalid`** attribute to alert users that the values entered are not in the expected format.',
29
+ 'The field and buttons use the **`aria-label`** attribute to provide accessible names.',
30
+ ]} />
@@ -1,5 +1,7 @@
1
1
  import { Meta } from '@storybook/addon-docs/blocks';
2
2
  import * as BadgeStories from './Badge.stories';
3
+ import AccessibilityTable from '../../utils/docUtils/AccessibilityTable';
4
+ import { KeyboardRows } from '../../utils/docUtils/accessibilityTableConstants';
3
5
 
4
6
  <Meta of={BadgeStories} isTemplate />
5
7
 
@@ -15,11 +17,7 @@ This component can be used independently, and does not require additional compon
15
17
 
16
18
  ### Accessibility
17
19
 
18
- #### Keyboard Navigation
19
-
20
- Badge itself is not focusable. However, when components are added to it, these keys provide additional functionality.
21
-
22
- | Keys | Functions |
23
- | ---- | --------- |
24
- | Space or Enter | Selects the component. |
25
- | Tab | Focuses the component and follows the page tab sequence. |
20
+ <AccessibilityTable keyboardRows={[
21
+ KeyboardRows.spaceEnterSelectsComponentSimple,
22
+ KeyboardRows.tabFocusesComponent,
23
+ ]} keyboardDescription="Badge itself is not focusable. However, when components are added to it, these keys provide additional functionality." />