Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdvancedTable: Website documentation #2628

Merged
merged 24 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions website/app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
@use "pages/foundations/icon" as foundations-icon;
@use "pages/foundations/typography" as foundations-typography;
@use "pages/components/accordion" as components-accordion;
@use "pages/components/advanced-table" as components-advanced-table;
@use "pages/components/alert" as components-alert;
@use "pages/components/app-footer" as components-app-footer;
@use "pages/components/application-state" as components-application-state;
Expand Down
23 changes: 23 additions & 0 deletions website/app/styles/pages/components/advanced-table.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

// COMPONENTS > TABLE > ADVANCEDTABLE

#show-content-components-table-advanced-table {
.doc-advanced-table-scrollable-wrapper {
overflow-x: auto;
}

.doc-advanced-table-vertical-scrollable-wrapper {
max-height: 500px;
overflow-y: auto;
}

.doc-advanced-table-multiselect-with-pagination-demo {
.hds-advanced-table + .hds-pagination {
margin-top: 16px;
}
}
}
4 changes: 2 additions & 2 deletions website/app/styles/pages/components/table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* SPDX-License-Identifier: MPL-2.0
*/

// COMPONENTS > TABLE
// COMPONENTS > TABLE > TABLE

#show-content-components-table {
#show-content-components-table-table {
.doc-table-valign-demo {
display: flex;
gap: 5px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The Copy Snippet comes in two colors: `primary` and `secondary`

!!! Do

When multiple Copy Snippets are needed in a single page, such as in a [Table](/components/table), consider using the `secondary` color to reduce the prominence of each Copy Snippet.
When multiple Copy Snippets are needed in a single page, such as in a [Table](/components/table/table), consider using the `secondary` color to reduce the prominence of each Copy Snippet.

![Example of the Copy Snippet component in a table](/assets/components/copy/copy-snippet-table-do.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Alternatively, pass `secondary` to `@color` to display a secondary button with a

#### ToggleIcon as overflow menu

Overflow menus are often found in the last column of a [Tables](/components/table). This is the only use case where it is acceptable to use
Overflow menus are often found in the last column of a [Table](/components/table/table). This is the only use case where it is acceptable to use
`@hasChevron={{false}}`. `@text` is still required, because it supplies the `aria-label` for ToggleIcon.

```handlebars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ ToggleIcons come in two sizes: **small** and **medium**.

!!! Info

While we provide a small size variant, we recommend only using this for the Overflow menu within [Tables](/components/table) because the icons and images start to become unrecognizable in smaller sizes.
While we provide a small size variant, we recommend only using this for the Overflow menu within [Tables](/components/table/table) because the icons and images start to become unrecognizable in smaller sizes.
!!!

<Doc::Layout @spacing="24px">
Expand Down Expand Up @@ -104,7 +104,7 @@ ToggleButtons require a visible chevron to indicate interactivity and provide di

![Example of open and closed dropdowns](/assets/components/dropdown/dropdown-button-chevrons.png =286x*)

We strongly recommend providing visible chevrons on most instances of ToggleIcons to indicate interactivity. That said, it’s common to see ToggleIcons that use the `more-horizontal` icon without chevrons. Their placement, usually in the last column of a [Table](/components/table), is typically indicative of this type of interaction.
We strongly recommend providing visible chevrons on most instances of ToggleIcons to indicate interactivity. That said, it’s common to see ToggleIcons that use the `more-horizontal` icon without chevrons. Their placement, usually in the last column of a [Table](/components/table/table), is typically indicative of this type of interaction.

![Example of open and closed dropdowns](/assets/components/dropdown/dropdown-icon-chevrons.png =750x*)

Expand Down
3 changes: 2 additions & 1 deletion website/docs/components/pagination/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ links:
github: >-
https://github.com/hashicorp/design-system/tree/main/packages/components/src/components/hds/pagination
related:
- components/table
- components/table/table
- components/table/advanced-table
- patterns/filter-patterns
- patterns/table-multi-select
previewImage: assets/illustrations/components/pagination.jpg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ The reason for using a consumer-side function to determine the `query` argument

Even if the Pagination is based on routing, the `onPageChange/onPageSizeChange` callbacks are still available and can be used to respond to the users’ actions (eg. for logging, tracking, etc.).

Below you can find an example of an integration between the sortable [`Table`](/components/table) component and the `Pagination::Numbered` component that uses query parameters in the URL to preserve the UI state:
Below you can find an example of an integration between the sortable [`Table`](/components/table/table) component and the `Pagination::Numbered` component that uses query parameters in the URL to preserve the UI state:

```handlebars
<div class="doc-pagination-table-demo">
Expand Down Expand Up @@ -271,7 +271,7 @@ The reason for using a consumer-side function to determine the `query` argument

Even if the Pagination is based on routing, the `onPageChange/onPageSizeChange` callbacks are still available and can be used to respond to the users' actions (eg. for logging, tracking, etc.).

Below you can find an example of an integration between the [`Table`](/components/table) component and the `Pagination::Compact` component that uses query parameters in the URL to preserve the UI state:
Below you can find an example of an integration between the [`Table`](/components/table/table) component and the `Pagination::Compact` component that uses query parameters in the URL to preserve the UI state:

```handlebars
<div class="doc-pagination-table-demo">
Expand Down
Loading
Loading