@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
@@ -145,6 +145,46 @@ var healthyStatusBadge = _objectSpread({
145
145
  var secondaryStatusBadge = _objectSpread({
146
146
  border: 'none'
147
147
  }, secondary);
148
+ var tableBaseBadgeBaseStyle = _objectSpread(_objectSpread({}, baseBadge), {}, {
149
+ minWidth: '100px',
150
+ border: 'none'
151
+ });
152
+ var tableBaseBadgeSpanStyle = {
153
+ fontSize: '11.25px',
154
+ lineHeight: '1'
155
+ };
156
+ var tableBaseBadge = {
157
+ active: _objectSpread(_objectSpread({}, tableBaseBadgeBaseStyle), {}, {
158
+ backgroundColor: "".concat(astroTokens.color.blue[100], " !important"),
159
+ '& > span': _objectSpread(_objectSpread({}, tableBaseBadgeSpanStyle), {}, {
160
+ color: astroTokens.color.blue[600]
161
+ })
162
+ }),
163
+ warning: _objectSpread(_objectSpread({}, tableBaseBadgeBaseStyle), {}, {
164
+ backgroundColor: "".concat(astroTokens.color.yellow[100], " !important"),
165
+ '& > span': _objectSpread(_objectSpread({}, tableBaseBadgeSpanStyle), {}, {
166
+ color: astroTokens.color.blue[600]
167
+ })
168
+ }),
169
+ critical: _objectSpread(_objectSpread({}, tableBaseBadgeBaseStyle), {}, {
170
+ backgroundColor: "".concat(astroTokens.color.red[100], " !important"),
171
+ '& > span': _objectSpread(_objectSpread({}, tableBaseBadgeSpanStyle), {}, {
172
+ color: astroTokens.color.red[800]
173
+ })
174
+ }),
175
+ healthy: _objectSpread(_objectSpread({}, tableBaseBadgeBaseStyle), {}, {
176
+ backgroundColor: "".concat(astroTokens.color.green[100], " !important"),
177
+ '& > span': _objectSpread(_objectSpread({}, tableBaseBadgeSpanStyle), {}, {
178
+ color: astroTokens.color.green[800]
179
+ })
180
+ }),
181
+ secondary: _objectSpread(_objectSpread({}, tableBaseBadgeBaseStyle), {}, {
182
+ backgroundColor: "".concat(astroTokens.color.gray[100], " !important"),
183
+ '& > span': _objectSpread(_objectSpread({}, tableBaseBadgeSpanStyle), {}, {
184
+ color: astroTokens.color.gray[800]
185
+ })
186
+ })
187
+ };
148
188
  var countBadge = _objectSpread(_objectSpread({}, baseBadge), {}, {
149
189
  backgroundColor: '#455469 !important',
150
190
  '& span': _objectSpread(_objectSpread({}, badgeFont), {}, {
@@ -198,5 +238,6 @@ export var badges = {
198
238
  },
199
239
  warningCalloutBadge: {
200
240
  backgroundColor: 'white !important'
201
- }
241
+ },
242
+ tableBaseBadge: tableBaseBadge
202
243
  };
@@ -82,7 +82,9 @@ var suggestionRow = _objectSpread(_objectSpread({}, baseSuggestion), {}, {
82
82
  var suggestionColumn = _objectSpread(_objectSpread({}, baseSuggestion), {}, {
83
83
  display: 'flex'
84
84
  });
85
- var tableWrapper = _objectSpread({}, container);
85
+ var tableWrapper = _objectSpread(_objectSpread({}, container), {}, {
86
+ boxShadow: 'standard'
87
+ });
86
88
  export default {
87
89
  interactive: interactive,
88
90
  dark: dark,
@@ -10,7 +10,6 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
10
10
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
11
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
12
12
  import { astroTokens } from '@pingux/onyx-tokens';
13
- import colors from '../colors/colors';
14
13
  import { defaultFocus as baseFocus } from './button';
15
14
  var borderRadius = '16px';
16
15
  var defaultFocus = _objectSpread(_objectSpread({}, baseFocus), {}, {
@@ -53,37 +52,38 @@ var container = {
53
52
  var caption = {
54
53
  backgroundColor: 'backgroundBase',
55
54
  px: 'lg',
56
- color: 'text.primary',
55
+ color: astroTokens.color.font.base,
57
56
  borderBottom: '1px solid',
58
- borderBottomColor: 'border.base',
57
+ borderBottomColor: astroTokens.color.common.border,
59
58
  borderTopLeftRadius: borderRadius,
60
59
  borderTopRightRadius: borderRadius
61
60
  };
62
61
  var row = {
63
62
  borderBottom: '1px solid',
64
- borderBottomColor: 'border.base',
63
+ borderBottomColor: astroTokens.color.common.border,
65
64
  '&.is-focused': _objectSpread({}, defaultFocus),
66
65
  '&.is-hovered': {
67
- bg: 'background.hover',
66
+ bg: astroTokens.color['table-row'].hover.bg,
68
67
  '& > td:last-of-type': {
69
- bg: 'background.hover'
68
+ bg: astroTokens.color['table-row'].hover.bg
70
69
  }
71
70
  },
72
71
  '&:nth-of-type(odd)': {
73
- bg: 'backgroundBase',
72
+ bg: astroTokens.color.common.bg.base,
74
73
  '&.is-hovered': {
75
- bg: 'background.hover'
74
+ bg: astroTokens.color['table-row'].hover.bg
76
75
  },
77
76
  '& > td:last-of-type': {
78
- bg: 'backgroundBase'
77
+ bg: astroTokens.color.common.bg.base
79
78
  }
80
79
  }
81
80
  };
82
81
  var thead = {
83
- borderBottomColor: 'border.base',
82
+ borderBottomColor: astroTokens.color.common.border,
84
83
  backgroundColor: 'backgroundBase',
85
84
  '&.is-sticky': {
86
- boxShadow: "0 1px 0 ".concat(colors.border.base)
85
+ border: 'none',
86
+ boxShadow: "0 1px 0 ".concat(astroTokens.color.common.border)
87
87
  }
88
88
  };
89
89
  var resizer = {
@@ -92,17 +92,13 @@ var resizer = {
92
92
  var head = {
93
93
  px: 'lg',
94
94
  py: 'sm',
95
- fontSize: 'md',
96
- fontWeight: '2',
97
- color: 'text.primary',
98
- lineHeight: 'body',
99
95
  '&.is-focused': _objectSpread({}, defaultFocus),
100
96
  '&:last-of-type': {
101
97
  backgroundColor: 'backgroundBase'
102
98
  }
103
99
  };
104
100
  var tbody = {
105
- borderTopColor: 'border.base',
101
+ borderTopColor: astroTokens.color.common.border,
106
102
  borderBottom: 'unset',
107
103
  backgroundColor: 'backgroundBase',
108
104
  borderBottomLeftRadius: borderRadius,
@@ -110,7 +106,7 @@ var tbody = {
110
106
  };
111
107
  var data = _objectSpread(_objectSpread({}, head), {}, {
112
108
  py: 'md',
113
- fontWeight: '1',
109
+ fontWeight: '0',
114
110
  '&:last-of-type': {
115
111
  backgroundColor: 'backgroundBase',
116
112
  zIndex: 1
@@ -255,6 +255,12 @@ export var text = _objectSpread(_objectSpread({
255
255
  },
256
256
  stepperTabContent: stepperTabContent,
257
257
  stepperTabContentHeader: stepperTabContentHeader,
258
+ headText: {
259
+ fontSize: 'md',
260
+ fontWeight: '2',
261
+ color: astroTokens.color.font.base,
262
+ lineHeight: 'xs'
263
+ },
258
264
  label: label,
259
265
  linkSelectFieldLabel: _objectSpread(_objectSpread({}, label), {}, {
260
266
  color: astroTokens.color.font.link
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ export * from './accessibilityTable';
1
2
  export * from './arrayField';
2
3
  export * from './avatar';
3
4
  export * from './badge';
@@ -0,0 +1,30 @@
1
+ import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
2
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
3
+ import React from 'react';
4
+ import Markdown from 'markdown-to-jsx';
5
+ import { v4 as uuid } from 'uuid';
6
+ import { jsx as ___EmotionJSX } from "@emotion/react";
7
+ var AccessibilityTable = function AccessibilityTable(_ref) {
8
+ var keyboardRows = _ref.keyboardRows,
9
+ keyboardDescription = _ref.keyboardDescription,
10
+ screenReaderRows = _ref.screenReaderRows;
11
+ var hasKeyboard = _Array$isArray(keyboardRows) && keyboardRows.length > 0;
12
+ var hasScreenReader = _Array$isArray(screenReaderRows) && screenReaderRows.length > 0;
13
+ if (!hasKeyboard && !hasScreenReader) {
14
+ return null;
15
+ }
16
+ return ___EmotionJSX(React.Fragment, null, hasKeyboard && ___EmotionJSX(React.Fragment, null, ___EmotionJSX("h4", null, "Keyboard Navigation"), ___EmotionJSX("p", null, keyboardDescription || 'These keys provide additional functionality to the component.'), ___EmotionJSX("table", null, ___EmotionJSX("thead", null, ___EmotionJSX("tr", null, ___EmotionJSX("th", null, "Key"), ___EmotionJSX("th", null, "Function"))), ___EmotionJSX("tbody", null, _mapInstanceProperty(keyboardRows).call(keyboardRows, function (row) {
17
+ return ___EmotionJSX("tr", {
18
+ key: row.key + uuid()
19
+ }, ___EmotionJSX("td", null, ___EmotionJSX("span", null, row.key)), ___EmotionJSX("td", null, ___EmotionJSX(Markdown, {
20
+ options: {
21
+ forceInline: true
22
+ }
23
+ }, row.description)));
24
+ })))), hasScreenReader && ___EmotionJSX(React.Fragment, null, ___EmotionJSX("h4", null, "Screen Readers"), ___EmotionJSX("p", null, "This component uses the following attributes to assist screen readers:"), ___EmotionJSX("ul", null, _mapInstanceProperty(screenReaderRows).call(screenReaderRows, function (item) {
25
+ return ___EmotionJSX("li", {
26
+ key: item + uuid()
27
+ }, ___EmotionJSX(Markdown, null, item));
28
+ }))));
29
+ };
30
+ export default AccessibilityTable;
@@ -0,0 +1,190 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
+ import React from 'react';
3
+ import { render, screen } from '@testing-library/react';
4
+ import { universalComponentTests } from '../testUtils/universalComponentTest';
5
+ import AccessibilityTable from './AccessibilityTable';
6
+
7
+ // Needs to be added to each component test file
8
+ import { jsx as ___EmotionJSX } from "@emotion/react";
9
+ universalComponentTests({
10
+ renderComponent: function renderComponent(props) {
11
+ return ___EmotionJSX(AccessibilityTable, _extends({
12
+ keyboardRows: [{
13
+ key: 'Tab',
14
+ description: 'Focus next element'
15
+ }]
16
+ }, props));
17
+ },
18
+ skipForwardRefTest: true
19
+ });
20
+ test('renders nothing when both keyboardRows and screenReaderRows are absent', function () {
21
+ var _render = render(___EmotionJSX(AccessibilityTable, null)),
22
+ container = _render.container;
23
+ expect(container).toBeEmptyDOMElement();
24
+ });
25
+ test('renders nothing when both props are provided as empty arrays', function () {
26
+ var _render2 = render(___EmotionJSX(AccessibilityTable, {
27
+ keyboardRows: [],
28
+ screenReaderRows: []
29
+ })),
30
+ container = _render2.container;
31
+ expect(container).toBeEmptyDOMElement();
32
+ });
33
+ describe('keyboard navigation section', function () {
34
+ var keyboardRows = [{
35
+ key: 'Tab',
36
+ description: 'Focus next element'
37
+ }, {
38
+ key: 'Shift+Tab',
39
+ description: 'Focus previous element'
40
+ }];
41
+ test('renders the Keyboard Navigation heading', function () {
42
+ render(___EmotionJSX(AccessibilityTable, {
43
+ keyboardRows: keyboardRows
44
+ }));
45
+ expect(screen.getByText('Keyboard Navigation')).toBeInTheDocument();
46
+ });
47
+ test('renders the keyboard section description paragraph', function () {
48
+ render(___EmotionJSX(AccessibilityTable, {
49
+ keyboardRows: keyboardRows
50
+ }));
51
+ expect(screen.getByText('These keys provide additional functionality to the component.')).toBeInTheDocument();
52
+ });
53
+ test('renders Key and Function column headers', function () {
54
+ render(___EmotionJSX(AccessibilityTable, {
55
+ keyboardRows: keyboardRows
56
+ }));
57
+ expect(screen.getByText('Key')).toBeInTheDocument();
58
+ expect(screen.getByText('Function')).toBeInTheDocument();
59
+ });
60
+ test('renders one row per keyboardRows entry', function () {
61
+ render(___EmotionJSX(AccessibilityTable, {
62
+ keyboardRows: keyboardRows
63
+ }));
64
+ var rows = screen.getAllByRole('row');
65
+ // thead has 1 row, tbody has 2 rows (one per entry)
66
+ expect(rows).toHaveLength(3);
67
+ });
68
+ test('renders the key cell for each row', function () {
69
+ render(___EmotionJSX(AccessibilityTable, {
70
+ keyboardRows: keyboardRows
71
+ }));
72
+ expect(screen.getByText('Tab')).toBeInTheDocument();
73
+ expect(screen.getByText('Shift+Tab')).toBeInTheDocument();
74
+ });
75
+ test('does not render the Screen Readers section', function () {
76
+ render(___EmotionJSX(AccessibilityTable, {
77
+ keyboardRows: keyboardRows
78
+ }));
79
+ expect(screen.queryByText('Screen Readers')).not.toBeInTheDocument();
80
+ });
81
+ test('renders a custom keyboardDescription when the prop is provided', function () {
82
+ render(___EmotionJSX(AccessibilityTable, {
83
+ keyboardRows: keyboardRows,
84
+ keyboardDescription: "Custom keyboard description for this component."
85
+ }));
86
+ expect(screen.getByText('Custom keyboard description for this component.')).toBeInTheDocument();
87
+ });
88
+ test('does not render a custom keyboardDescription when the prop is omitted', function () {
89
+ render(___EmotionJSX(AccessibilityTable, {
90
+ keyboardRows: keyboardRows
91
+ }));
92
+ expect(screen.queryByText('Custom keyboard description for this component.')).not.toBeInTheDocument();
93
+ });
94
+ test('falls back to the default description when keyboardDescription is an empty string', function () {
95
+ render(___EmotionJSX(AccessibilityTable, {
96
+ keyboardRows: keyboardRows,
97
+ keyboardDescription: ""
98
+ }));
99
+ expect(screen.getByText('These keys provide additional functionality to the component.')).toBeInTheDocument();
100
+ });
101
+ });
102
+ describe('screen reader section', function () {
103
+ var screenReaderRows = ['aria-label', 'aria-expanded'];
104
+ test('renders the Screen Readers heading', function () {
105
+ render(___EmotionJSX(AccessibilityTable, {
106
+ screenReaderRows: screenReaderRows
107
+ }));
108
+ expect(screen.getByText('Screen Readers')).toBeInTheDocument();
109
+ });
110
+ test('renders the screen reader section description paragraph', function () {
111
+ render(___EmotionJSX(AccessibilityTable, {
112
+ screenReaderRows: screenReaderRows
113
+ }));
114
+ expect(screen.getByText('This component uses the following attributes to assist screen readers:')).toBeInTheDocument();
115
+ });
116
+ test('renders a list with one item per screenReaderRows entry', function () {
117
+ render(___EmotionJSX(AccessibilityTable, {
118
+ screenReaderRows: screenReaderRows
119
+ }));
120
+ var items = screen.getAllByRole('listitem');
121
+ expect(items).toHaveLength(screenReaderRows.length);
122
+ });
123
+ test('renders text content for each screen reader row item', function () {
124
+ render(___EmotionJSX(AccessibilityTable, {
125
+ screenReaderRows: screenReaderRows
126
+ }));
127
+ expect(screen.getByText('aria-label')).toBeInTheDocument();
128
+ expect(screen.getByText('aria-expanded')).toBeInTheDocument();
129
+ });
130
+ test('does not render the Keyboard Navigation section', function () {
131
+ render(___EmotionJSX(AccessibilityTable, {
132
+ screenReaderRows: screenReaderRows
133
+ }));
134
+ expect(screen.queryByText('Keyboard Navigation')).not.toBeInTheDocument();
135
+ });
136
+ });
137
+ describe('both sections together', function () {
138
+ var keyboardRows = [{
139
+ key: 'Tab',
140
+ description: 'Focus next element'
141
+ }];
142
+ var screenReaderRows = ['aria-label'];
143
+ test('renders both headings when both props are provided', function () {
144
+ render(___EmotionJSX(AccessibilityTable, {
145
+ keyboardRows: keyboardRows,
146
+ screenReaderRows: screenReaderRows
147
+ }));
148
+ expect(screen.getByText('Keyboard Navigation')).toBeInTheDocument();
149
+ expect(screen.getByText('Screen Readers')).toBeInTheDocument();
150
+ });
151
+ test('renders both the table and the list', function () {
152
+ render(___EmotionJSX(AccessibilityTable, {
153
+ keyboardRows: keyboardRows,
154
+ screenReaderRows: screenReaderRows
155
+ }));
156
+ expect(screen.getByRole('table')).toBeInTheDocument();
157
+ expect(screen.getByRole('list')).toBeInTheDocument();
158
+ });
159
+ });
160
+ describe('markdown rendering', function () {
161
+ test('renders bold markdown in row.description as a strong element', function () {
162
+ var keyboardRows = [{
163
+ key: 'Enter',
164
+ description: '**Confirm** selection'
165
+ }];
166
+ render(___EmotionJSX(AccessibilityTable, {
167
+ keyboardRows: keyboardRows
168
+ }));
169
+ var strongEl = screen.getByText('Confirm');
170
+ expect(strongEl.tagName).toBe('STRONG');
171
+ });
172
+ test('renders plain text description via markdown-to-jsx without error', function () {
173
+ var keyboardRows = [{
174
+ key: 'Tab',
175
+ description: 'Focus next element'
176
+ }];
177
+ render(___EmotionJSX(AccessibilityTable, {
178
+ keyboardRows: keyboardRows
179
+ }));
180
+ expect(screen.getByText('Focus next element')).toBeInTheDocument();
181
+ });
182
+ test('renders bold markdown in screenReaderRows item as a strong element', function () {
183
+ var screenReaderRows = ['**aria-label**: describes the element'];
184
+ render(___EmotionJSX(AccessibilityTable, {
185
+ screenReaderRows: screenReaderRows
186
+ }));
187
+ var strongEl = screen.getByText('aria-label');
188
+ expect(strongEl.tagName).toBe('STRONG');
189
+ });
190
+ });
@@ -0,0 +1,130 @@
1
+ export var KeyboardRows = {
2
+ shiftTabFocusPrevious: {
3
+ key: 'Shift + Tab',
4
+ description: 'Moves focus to the previous focusable component.'
5
+ },
6
+ tabField: {
7
+ key: 'Tab',
8
+ description: 'The field is focusable using the Tab key and follows the page tab sequence.'
9
+ },
10
+ tabFocusesField: {
11
+ key: 'Tab',
12
+ description: 'Focuses the field and follows the page tab sequence.'
13
+ },
14
+ spaceEnterSelectsButton: {
15
+ key: 'Space or Enter',
16
+ description: 'Selects the button.'
17
+ },
18
+ tabFocusesButton: {
19
+ key: 'Tab',
20
+ description: 'Focuses the button and follows the page tab sequence.'
21
+ },
22
+ homeFirstListboxItem: {
23
+ key: 'Home(Fn + Right Arrow Key) Or Control/Command + Home',
24
+ description: 'Shifts the focus to the first item in the listbox.'
25
+ },
26
+ endLastListboxItem: {
27
+ key: 'End(Fn + Left Arrow Key) Or Control/Command + End',
28
+ description: 'Shifts the focus to the last item in the listbox.'
29
+ },
30
+ tabNextFocusableComponent: {
31
+ key: 'Tab',
32
+ description: 'Moves focus to the next focusable component and follows the page tab sequence.'
33
+ },
34
+ tabFocusesItem: {
35
+ key: 'Tab',
36
+ description: 'Focuses item and follows the page tab sequence.'
37
+ },
38
+ tabAccordionFocusable: {
39
+ key: 'Tab',
40
+ description: 'Moves focus to the next focusable component. All focusable components in the accordion are included in the page tab sequence.'
41
+ },
42
+ shiftTabAccordionFocusPrevious: {
43
+ key: 'Shift + Tab',
44
+ description: 'Moves focus to the previous focusable component. All focusable components in the accordion are included in the page tab sequence.'
45
+ },
46
+ spaceEnterToggleAccordion: {
47
+ key: 'Space or Enter',
48
+ description: 'Toggles the component when the accordion is focused.'
49
+ },
50
+ escCollapseAccordion: {
51
+ key: 'Esc',
52
+ description: 'Pressing the escape key when the accordion is open and focused collapses the component.'
53
+ },
54
+ tabCalendar: {
55
+ key: 'Tab',
56
+ description: 'Components in the calendar are focusable and follow the page tab sequence.'
57
+ },
58
+ homeFirstCalendarDate: {
59
+ key: 'Pressing Home:(Fn + Right Arrow Key) Or Control or Command + Home',
60
+ description: 'Shifts the focus to the first calendar date.'
61
+ },
62
+ pageUpPreviousMonth: {
63
+ key: 'Page up',
64
+ description: 'Changes the grid of dates to the previous month.'
65
+ },
66
+ pageDownNextMonth: {
67
+ key: 'Page down',
68
+ description: 'Changes the grid of dates to the next month.'
69
+ },
70
+ shiftPageUpPreviousYear: {
71
+ key: 'Shift + page up',
72
+ description: 'Changes the grid of dates to the same month in the previous year.'
73
+ },
74
+ shiftPageDownNextYear: {
75
+ key: 'Shift + page down',
76
+ description: 'Changes the grid of dates to the same month in the next year.'
77
+ },
78
+ spaceEnterSelectsComponent: {
79
+ key: 'Space or Enter',
80
+ description: 'Selects the component when it is focused.'
81
+ },
82
+ typingOpenPopover: {
83
+ key: 'Typing in input field',
84
+ description: 'Adds focus to it and opens the popover.'
85
+ },
86
+ spaceEnterSelectsItem: {
87
+ key: 'Space or Enter',
88
+ description: 'Selects the item.'
89
+ },
90
+ spaceEnterSelectsComponentSimple: {
91
+ key: 'Space or Enter',
92
+ description: 'Selects the component.'
93
+ },
94
+ tabFocusesComponent: {
95
+ key: 'Tab',
96
+ description: 'Focuses the component and follows the page tab sequence.'
97
+ },
98
+ tabInput: {
99
+ key: 'Tab',
100
+ description: 'The input is focusable using the Tab key and follows the page tab sequence.'
101
+ },
102
+ homeFirstRow: {
103
+ key: 'Home(Fn + Right Arrow Key) Or Control/Command + Home',
104
+ description: 'Shifts the focus to the first row.'
105
+ },
106
+ endLastVisibleRow: {
107
+ key: 'End(Fn + Left Arrow Key) Or Control/Command + End',
108
+ description: 'Shifts the focus to the last visible row.'
109
+ },
110
+ arrowKeysMovePopoverSelection: {
111
+ key: 'Arrow keys',
112
+ description: 'Moves the selection through the popover.'
113
+ },
114
+ escClosePopoverFocusPrevious: {
115
+ key: 'Esc',
116
+ description: 'Pressing the escape key closes the popover and focuses on the previous focusable component.'
117
+ }
118
+ };
119
+ export var ScreenReaderRows = {
120
+ ariaLabelAccessibleName: 'The **`aria-label`** attribute is used to provide an accessible name.',
121
+ eachLinkAriaLabel: 'Each Link component uses the **`aria-label`** attribute to provide an accessible name.',
122
+ ariaLiveAnnounce: 'The **`aria-live`** attribute is used to announce content changes in a live region.',
123
+ ariaOrientationWithTrailingSpace: 'The **`aria-orientation`** attribute indicates whether the orientation is horizontal, vertical, unknown, or ambiguous. ',
124
+ accordionAriaExpanded: 'The accordion header button uses the **`aria-expanded`** attribute to indicate when the content expands and collapses.',
125
+ iconAriaHidden: 'The Icon uses the **`aria-hidden`** attribute to hide its content from assistive technology.',
126
+ triggerAriaExpandedExpandCollapse: 'The trigger button uses the **`aria-expanded`** attribute to indicate when the content expands and collapses.',
127
+ 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
+ ariaOrientationNoTrailingSpace: 'The **`aria-orientation`** attribute indicates whether the orientation is horizontal, vertical, unknown, or ambiguous.',
129
+ componentAriaLabel: 'This component uses the **`aria-label`** attribute to provide an accessible name.'
130
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.207.1-alpha.0",
3
+ "version": "2.208.1-alpha.0",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",