Skip to content

Commit 155e59e

Browse files
author
shleewhite
committed
fix: incorporate feedback
1 parent c804105 commit 155e59e

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

website/docs/components/table/advanced-table/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Advanced Table
3-
description: Used to display organized, two-dimensional tabular data.
4-
caption: Used to display organized, two-dimensional tabular data.
3+
description: Used to display complex, structured tabular data with advanced features.
4+
caption: Used to display complex, structured tabular data with advanced features.
55
links:
66
figma: https://www.figma.com/design/iweq3r2Pi8xiJfD9e6lOhF/HDS-Components-v2.0?node-id=67216-35163&t=w8xQlWxzH7bwXLe2-1
77
github: https://github.com/hashicorp/design-system/tree/main/packages/components/src/components/hds/advanced-table

website/docs/components/table/advanced-table/partials/accessibility/accessibility.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The table row element cannot receive interactions, meaning actions cannot be att
1212

1313
### Focus in Advanced Tables
1414

15-
Unlike the Table component, each cell receives focus in the Advanced Table to let users navigate through the table efficiently with a keyboard. For any other interactions, you must use interactive elements (buttons, links, etc.) within the cells.
15+
Unlike the Table component, each cell receives focus in the Advanced Table to support users navigating through the table efficiently with a keyboard. For any other interactions, you must use interactive elements (buttons, links, etc.) within the cells.
1616

1717
### Row selection
1818

website/docs/components/table/advanced-table/partials/code/component-api.md

+26-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## Component API
22

3-
The AdvancedTable component itself is where most of the options will be applied. However, the APIs for the child components are also documented here, in case a custom implementation is desired.
3+
The Advanced Table component itself is where most of the options will be applied. However, the APIs for the child components are also documented here in case a custom implementation is desired.
44

55
### AdvancedTable
66

77
<Doc::ComponentApi as |C|>
88
<C.Property @name="<:body>" @type="named block">
9-
This is a named block where the content for the AdvancedTable body is rendered.
9+
This is a named block where the content for the Advanced Table body is rendered.
1010
<Doc::ComponentApi as |C|>
1111
<C.Property @name="[B].rowIndex" @type="number | string">
1212
The value of the index associated with the `@each` loop. Returns a number when there are no nested rows. Returns a string in the form `${parentIndex}.${childIndex}` when there are nested rows.
@@ -23,10 +23,10 @@ The AdvancedTable component itself is where most of the options will be applied.
2323
</Doc::ComponentApi>
2424
</C.Property>
2525
<C.Property @name="model" @type="array">
26-
The data model to be used by the AdvancedTable. The model can have any shape, but for nested rows there are two expected keys.
26+
The data model to be used by the Advanced Table. The model can have any shape, but for nested rows there are two expected keys.
2727
<Doc::ComponentApi as |C|>
2828
<C.Property @name="children" @type="array">
29-
If there are nested rows, the AdvancedTable will use the `children` key in the model to render the child content. The key can be changed by setting `childrenKey` argument on the `Hds::AdvancedTable`.
29+
If there are nested rows, the Advanced Table will use the `children` key in the model to render the child content. The key can be changed by setting `childrenKey` argument on the `Hds::AdvancedTable`.
3030
</C.Property>
3131
<C.Property @name="isExpanded" @type="boolean">
3232
If there are nested rows, the default state of the toggle can be set by adding `isExpanded` to the row in the model.
@@ -44,7 +44,7 @@ The AdvancedTable component itself is where most of the options will be applied.
4444
</C.Property>
4545
<C.Property @name="isSortable" @type="boolean" @default="false">
4646
If set to `true`, indicates that a column should be sortable.<br><br>
47-
**Important**: AdvancedTable does **not** support having `isSelectable` true when there are nested rows.
47+
**Important**: Advanced Table does **not** support setting `isSelectable` to true when there are nested rows.
4848
</C.Property>
4949
<C.Property @name="align" @type="enum" @values={{array "left" "center" "right" }} @default="left">
5050
Determines the horizontal content alignment (sometimes referred to as text alignment) for the column header.
@@ -56,10 +56,10 @@ The AdvancedTable component itself is where most of the options will be applied.
5656
If set to `true`, it visually hides the column’s text content (it will still be available to screen readers for accessibility). <em>Only available for non-sortable columns.</em>
5757
</C.Property>
5858
<C.Property @name="sortingFunction" @type="function">
59-
Callback function to provide support for custom sorting logic. It should implement a typical bubble-sorting algorithm using two elements and comparing them. For more details, see the example of custom sorting in the How To Use section.
59+
Callback function to provide support for custom sorting logic. It should implement a typical bubble-sorting algorithm using two elements and comparing them. For more details, see the example of custom sorting in the [How To Use section](#sortable-advanced-table).
6060
</C.Property>
6161
<C.Property @name="tooltip" @type="string">
62-
Text string which will appear in the tooltip (see [`Tooltip`](/components/tooltip) for details). May contain basic HTML tags for formatting text such as `strong` and `em` tags. Not intended for multi-paragraph text or other more complex content. May not contain interactive content such as links or buttons. The `placement` and `offset` are automatically set and can’t be overwritten.
62+
Text string which will appear in [`Tooltip`](/components/tooltip). May contain basic HTML tags for formatting text such as `strong` and `em` tags. Not intended for multi-paragraph text or other more complex content. May not contain interactive content such as links or buttons. The `placement` and `offset` are automatically set and can’t be overwritten.
6363
</C.Property>
6464
</Doc::ComponentApi>
6565
</C.Property>
@@ -79,18 +79,18 @@ The AdvancedTable component itself is where most of the options will be applied.
7979
When called, this function receives an object as argument, with different keys corresponding to different information:
8080
<ul>
8181
<li>`selectionKey`: the value of the `@selectionKey` argument associated with the row selected/deselected by the user or `all` if the “select all” checkbox has been toggled</li>
82-
<li>`selectionCheckboxElement`: the checkbox (DOM element) that has been toggled by the user</li>
83-
<li>`selectedRowsKeys`: an array containing all the `@selectionKey`s of the selected rows in the table (an empty array is returned if no row is selected)</li>
84-
<li>`selectableRowsStates`: an array of objects corresponding to all the rows displayed in the table when the user changed a selection; each object contains the `@selectionKey` value for the associated row and its `isSelected` boolean state (if the checkbox is checked or not)<br><br>
82+
<li>`selectionCheckboxElement`: the checkbox (DOM element) that has been toggled by the user.</li>
83+
<li>`selectedRowsKeys`: an array containing all the `@selectionKey`s of the selected rows in the table (an empty array is returned if no row is selected).</li>
84+
<li>`selectableRowsStates`: an array of objects corresponding to all the rows displayed in the table when the user changed a selection; each object contains the `@selectionKey` value for the associated row and its `isSelected` boolean state (if the checkbox is checked or not).<br><br>
8585
**Important**: the order of the rows in the array doesn’t necessarily follow the order of the rows in the table/DOM.</li>
8686
</ul>
8787
</C.Property>
8888
<C.Property @name="isStriped" @type="boolean" @default="false">
8989
Determines if even-numbered rows will have a different background color from odd-numbered rows.<br><br>
90-
**Important**: AdvancedTable does **not** support having `isStriped` true when there are nested rows.
90+
**Important**: Advanced Table does **not** support setting `isStriped` to true when there are nested rows.
9191
</C.Property>
9292
<C.Property @name="hasStickyHeader" @type="boolean" @default="false">
93-
Determines if the AdvancedTable has a sticky header.
93+
Determines if the Advanced Table has a sticky header.
9494
</C.Property>
9595
<C.Property @name="density" @type="enum" @values={{array "short" "medium" "tall" }} @default="medium">
9696
If set, determines the density (height) of the body’s rows.
@@ -123,19 +123,23 @@ The AdvancedTable component itself is where most of the options will be applied.
123123

124124
### AdvancedTable::Tr
125125

126+
!!! Info
127+
126128
Note: This component is not eligible to receive interactions (e.g., it cannot have an `onClick` event handler attached directly to it). Instead, an interactive element should be placed _inside_ of the `AdvancedTable::Th`, `AdvancedTable::Td` components.
127129

130+
!!!
131+
128132
This component can contain `Hds::AdvancedTable::Th` or `Hds::AdvancedTable::Td` components.
129133

130134
<Doc::ComponentApi as |C|>
131135
<C.Property @name="yield">
132136
Elements passed as children are yielded as inner content of a `<div role="row">` HTML element.
133137
</C.Property>
134138
<C.Property @name="isSelected" @type="boolean" @default="false">
135-
Sets the initial selection state for the row (used in conjunction with setting `isSelectable` on the `AdvancedTable`).
139+
Sets the initial selection state for the row (used in conjunction with setting `isSelectable` on the Advanced Table).
136140
</C.Property>
137141
<C.Property @name="selectionKey" @type="string | number">
138-
Required value to associate an unique identifier to each table row (used in conjunction with setting `isSelectable` on the `AdvancedTable` and returned in the `onSelectionChange` callback arguments). It’s required if `isSelectable={{true}}`.
142+
Required value to associate an unique identifier to each table row (used in conjunction with setting `isSelectable` on the Advanced Table and returned in the `onSelectionChange` callback arguments). It’s required if `isSelectable={{true}}`.
139143
</C.Property>
140144
<C.Property @name="selectionAriaLabelSuffix" @type="string">
141145
Descriptive `aria-label` attribute applied to the checkbox used to select the row (used in conjunction with setting `isSelectable` on the `AdvancedTable`). The component automatically prepends “Select/Deselect” to the string, depending on the selection status. It’s required if `isSelectable={{true}}`.
@@ -147,8 +151,12 @@ This component can contain `Hds::AdvancedTable::Th` or `Hds::AdvancedTable::Td`
147151

148152
### AdvancedTable::Th
149153

154+
!!! Info
155+
150156
Note: This component is not eligible to receive interactions (e.g., it cannot have an `onClick` event handler attached directly to it). Instead, an interactive element should be placed _inside_ of the `AdvancedTable::Th` component.
151157

158+
!!!
159+
152160
If the `Th` component is passed as the first cell of a body row, `role="rowheader"` is automatically applied for accessibility purposes.
153161

154162
<Doc::ComponentApi as |C|>
@@ -162,7 +170,7 @@ If the `Th` component is passed as the first cell of a body row, `role="rowheade
162170
If set, determines the column’s width.
163171
</C.Property>
164172
<C.Property @name="tooltip" @type="string">
165-
Text string which will appear in the tooltip (see [`Tooltip`](/components/tooltip) for details). May contain basic HTML tags for formatting text such as `strong` and `em` tags. Not intended for multi-paragraph text or other more complex content. May not contain interactive content such as links or buttons. The `placement` and `offset` are automatically set and can’t be overwritten.
173+
Text string which will appear in the [`Tooltip`](/components/tooltip). May contain basic HTML tags for formatting text such as `strong` and `em` tags. Not intended for multi-paragraph text or other more complex content. May not contain interactive content such as links or buttons. The `placement` and `offset` are automatically set and can’t be overwritten.
166174
</C.Property>
167175
<C.Property @name="isVisuallyHidden" @type="boolean" @default="false">
168176
If set to `true`, it visually hides the column’s text content (it will still be available to screen readers for accessibility).
@@ -182,9 +190,12 @@ If the `Th` component is passed as the first cell of a body row, `role="rowheade
182190
</Doc::ComponentApi>
183191

184192
### AdvancedTable::Td
193+
!!! Info
185194

186195
Note: This component is not eligible to receive interactions (e.g., it cannot have an `onClick` event handler attached directly to it). Instead, an interactive element should be placed _inside_ of the `AdvancedTable::Td` component.
187196

197+
!!!
198+
188199
<Doc::ComponentApi as |C|>
189200
<C.Property @name="align" @type="enum" @values={{array "left" "center" "right" }} @default="left">
190201
Determines the horizontal content alignment (sometimes referred to as text alignment) for the cell (make sure it is also set for the column header).

0 commit comments

Comments
 (0)