Skip to content

Commit 74c9566

Browse files
authored
Merge pull request #159 from oanelson/140-documentation-editorial-cleanup----design-system
Editorial changes. Closes 140.
2 parents 7d95cfe + ee37f15 commit 74c9566

File tree

6 files changed

+38
-22
lines changed

6 files changed

+38
-22
lines changed

docs/design-system/custom-components/application-container.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ sidebar_position: 1
44

55
# Application Container
66

7-
The `Application` container is designed to handle network status changes and display appropriate toast notifications. It comes with **built-in** functionality that automatically handles these changes.
7+
The `Application` container handles network status changes and displays appropriate toast notifications. It has **built-in** functionality that automatically handles these changes.
88

99
## Features
1010

11-
- **Built-in Offline/Online Notifications**: The `Application` component monitors the network status and shows toast messages when the app goes offline or comes back online.
11+
- **Built-in Offline/Online Notifications**: The `Application` component monitors the network status. It shows toast messages when the app goes offline or comes back online.
1212
- **Custom Hooks**: It leverages the `useToasts` and `useOfflineStatus` hooks from within `@nmfs-radfish/react-radfish` package.
1313

1414
## How It Works
1515

1616
### Built-in Offline/Online Notifications
1717

18-
The `Application` component has **built-in** functionality to check the application's network status and display toast notifications when the state changes:
18+
The `Application` component has **built-in** functionality to check the application's network status. It displays toast notifications when the state changes:
1919

2020
- **When the application goes offline**: A warning toast is displayed with the message `"Application is offline"`.
2121
- **When the application comes back online**: An info toast is displayed with the message `"Application is online"`.
@@ -24,7 +24,7 @@ This feature is provided **out of the box** and requires no additional setup fro
2424

2525
### Example Usage
2626

27-
To use the `Application` component, wrap it around your app in the entry file (e.g., `index.js` or `index.jsx`):
27+
To use the `Application` component, wrap it around your app in the entry file (e.g. `index.js` or `index.jsx`):
2828

2929
```jsx
3030
import { Application } from "@nmfs-radfish/react-radfish";

docs/design-system/custom-components/date-picker.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ sidebar_position: 2
44

55
# DatePicker
66

7-
The `DatePicker` component is a reusable form input designed to capture date-related information from users. It provides a consistent and accessible user interface element for selecting dates, ensuring seamless integration within NOAA web applications.
7+
The `DatePicker` component is an essential, versitile, reusable form input. It's designed to capture date-related information from users. It is customizable, easy to integrate, and adheres to accessibility standards. It seamlessly integrates with NOAA web applications, so developers can build consistent, accessible, and user-friendly forms and data entry interfaces.
8+
9+
By following the best practices and examples below, developers can add the DatePicker to their projects.
810

911
## **Features**
1012

@@ -25,7 +27,7 @@ The `DatePicker` component is a reusable form input designed to capture date-rel
2527
| `hint` | `string` | `undefined` | No | Supplemental text that provides additional guidance or information about the input field. |
2628
| `label` | `string` | **** | Yes | The text label associated with the input field. |
2729
| `className` | `string` | `""` | No | Additional CSS classes to apply to the root element for custom styling. |
28-
| `...props` | `object` | `-` | No | Any other valid HTML input attributes (e.g., `onChange`, `disabled`, etc.) |
30+
| `...props` | `object` | `-` | No | Any other valid HTML input attributes (e.g. `onChange`, `disabled`, etc.). |
2931

3032
## **Installation**
3133

@@ -39,7 +41,7 @@ import { DatePicker } from "@nmfs-radfish/react-radfish";
3941

4042
### 1. Basic Usage
4143

42-
A simple date picker with essential props
44+
A simple date picker with essential props:
4345

4446
```jsx
4547
import React from "react";
@@ -64,7 +66,7 @@ export default BasicForm;
6466

6567
### 2. With Default Value and Custom Type
6668

67-
Using a different input type and setting a default value
69+
Using a different input type and setting a default value:
6870

6971
```jsx
7072
import React from "react";
@@ -129,7 +131,7 @@ export default ControlledForm;
129131

130132
### 4. Custom Styling
131133

132-
Applying custom CSS classes to the DatePicker
134+
Applying custom CSS classes to the DatePicker:
133135

134136
```jsx
135137
import React from "react";
@@ -156,12 +158,10 @@ export default StyledForm;
156158

157159
### 508 Compliance
158160

159-
The DatePicker component ensures accessibility by using the native HTML input element, which is inherently 508 compliant. It supports keyboard navigation, allowing users to interact with the date picker without a mouse. Additionally, the component is fully compatible with screen readers, providing clear labels and descriptive hints through proper ARIA attributes. This ensures that all users, including those with disabilities, can effectively utilize the DatePicker in forms and data entry interfaces.
161+
The DatePicker component ensures accessibility by using the native HTML input element, which is inherently 508 compliant. It supports keyboard navigation, allowing users to interact with the date picker without a mouse. Additionally, the component is fully compatible with screen readers, providing clear labels and descriptive hints through proper ARIA attributes. This means that all users, including those with disabilities, can use the DatePicker in forms and data entry interfaces.
160162

161163
### RADFish DatePicker vs. Trussworks DatePicker
162164

163-
The RADFish DatePicker offers flexibility by supporting both controlled and uncontrolled modes. In controlled mode, developers manage the value via React state, allowing for precise control over the input. In uncontrolled mode, the browser manages the form state, simplifying development for straightforward use cases. On the other hand, the Trussworks date picker only supports uncontrolled behavior, which limits flexibility in scenarios where managing the input programmatically is required. This makes the RADFish DatePicker a more versatile choice for a wider range of applications, offering developers greater control when needed.
164-
165-
### Conclusion
165+
The RADFish DatePicker offers flexibility by supporting both controlled and uncontrolled modes. In controlled mode, developers manage the value via React state, allowing for precise control over the input. In uncontrolled mode, the browser manages the form state, simplifying development for straightforward use cases.
166166

167-
The DatePicker component is a versatile and accessible tool for capturing date information within NOAA web applications. Its customizable props, ease of integration, and adherence to accessibility standards make it an essential component for building user-friendly forms and data entry interfaces. By following the best practices and examples provided, developers can efficiently incorporate the DatePicker into their projects, enhancing both functionality and user experience.
167+
The Trussworks date picker only supports uncontrolled behavior. This limits flexibility in scenarios where managing the input programmatically is required. This makes the RADFish DatePicker a more versatile choice for a wider range of applications, offering developers greater control when needed.

docs/design-system/custom-components/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ sidebar_position: 1
44

55
# RADFish Custom Components
66

7-
{/* Write top text here */}
7+
Most of RADFish uses standard components from React libraries and the [U.S. Design System](https://designsystem.digital.gov/), as implemented by the [react-uswds open source project](https://github.com/trussworks/react-uswds).
8+
9+
Custom components which are not part of these standardized libraries are listed here:
810

911

1012
```mdx-code-block

docs/design-system/custom-components/table.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ sidebar_position: 3
44

55
# Table
66

7-
The Table component is a flexible and customizable table designed for displaying tabular data.
7+
The `Table` component is a flexible and customizable table designed for displaying sortable data.
88

99
## Features
1010

1111
- **Sorting**: Click on any column header to sort the table by that column. Sorting toggles between ascending, descending, and unsorted states.
1212
- **Multi-Column Sorting**: Multi-column sorting allows you to sort data by multiple columns. Click additional column headers in the desired order of sorting priority.
13-
- **Pagination**: Use the pagination controls below the table to navigate through multiple pages of data. You can move between the first, previous, next, and last page, and see the current page number and total pages.
14-
- **Custom Rendering**: Certain columns (like the image and price) use custom render functions to display data in a more user-friendly way.
13+
- **Pagination**: Use the pagination controls below the table to navigate through multiple pages of data. You can move between the first, previous, next, and last page. You can also see the current page number and total pages.
14+
- **Custom Rendering**: Certain columns (like image and price) use custom render functions to display data in a more user-friendly way.
1515

1616
## How to Use the `<Table>` Component
1717

@@ -32,7 +32,7 @@ For a practical implementation, refer to the [Simple Table Example](https://gith
3232
| **`defaultSort`** | `Array<Object>` | Sets the default sorting for the table, with each object specifying a key for the column and direction ("asc" or "desc"). |
3333
| **`className`** | `string` | An optional `className` for custom styling. |
3434

35-
#### Trussworks Table Props
35+
### Trussworks Table Props
3636

3737
The `<Table>` component is built on top of the Trussworks table component, allowing you to pass Trussworks-specific props like `striped`, `bordered`, and others for additional customization.
3838

@@ -61,6 +61,7 @@ For more details on available Trussworks props, refer to the [Trussworks Table D
6161
## Usage Examples
6262

6363
### Simple
64+
This example shows a simple table, with two columns and two rows.
6465

6566
```jsx
6667
import { Table } from "@nmfs-radfish/react-radfish";
@@ -77,9 +78,11 @@ import { Table } from "@nmfs-radfish/react-radfish";
7778
/>
7879
```
7980

81+
This code will render as shown in this screenshot:
8082
![Table Example Screenshot](/img/example-table-simple.png)
8183

8284
### Pagination
85+
This example shows a table with multiple pages by using `paginationOptions`.
8386

8487
```jsx
8588
import { Table } from "@nmfs-radfish/react-radfish";
@@ -100,10 +103,11 @@ import { Table } from "@nmfs-radfish/react-radfish";
100103
}}
101104
/>
102105
```
103-
106+
This code will render as shown in this screenshot:
104107
![Table Example Screenshot](/img/example-table-pagination.png)
105108

106109
### Column Render Property
110+
Certain data types, such as images, require special rendering properties.
107111

108112
```jsx
109113
<Table
@@ -130,10 +134,11 @@ import { Table } from "@nmfs-radfish/react-radfish";
130134
}}
131135
/>
132136
```
133-
137+
This code will render as shown in this screenshot:
134138
![Table Example Screenshot](/img/example-table-render-property.png)
135139

136140
### onRowClick Prop
141+
You can use `onRowClick` to pass functions using React.
137142

138143
```jsx
139144
<Table
@@ -164,9 +169,11 @@ import { Table } from "@nmfs-radfish/react-radfish";
164169
/>
165170
```
166171

172+
This code will render as shown in this animated gif:
167173
![Table Example Screenshot](/img/example-table-onClickRow.gif)
168174

169175
### defaultSort Prop
176+
You can set how the table is displayed by default.
170177

171178
```jsx
172179
<Table
@@ -189,9 +196,11 @@ import { Table } from "@nmfs-radfish/react-radfish";
189196
/>
190197
```
191198

199+
This code will render as shown in this screenshot:
192200
![Table Example Screenshot](/img/example-table-defaultSort.png)
193201

194202
### Trussworks Table Props
203+
You can add styles like `bordered` or `striped` to your table.
195204

196205
```jsx
197206
<Table
@@ -221,4 +230,5 @@ import { Table } from "@nmfs-radfish/react-radfish";
221230
/>
222231
```
223232

233+
This code will render as shown in this animated gif:
224234
![Table Example Screenshot](/img/example-table-trussworks-prop.png)

docs/design-system/us-web-design-system.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ sidebar_position: 2
33
---
44

55
# U.S. Web Design System
6+
7+
The [U.S. Web Design System (USWDS)](https://designsystem.digital.gov/) is a set of design and development principles and guidelines. It helps deveolpers create standardized, accessible, consistent, and user-friendly websites and applications.
8+
9+
In most cases, RADFish uses standard components from React libraries and the U.S. Design System, as implemented by the [react-uswds open source project](https://github.com/trussworks/react-uswds). RADFish also uses some custom components which are not part of these standardized libraries. These custom components are listed [here](https://nmfs-radfish.github.io/radfish/design-system/custom-components).

docs/developer-documentation/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ Please visit [upgrading](./upgrading.md) for more information.
8282

8383
This script starts the Vite development server. It runs the app locally with hot module reloading, allowing for fast development and instant updates as you make changes. Open [http://localhost:3000](http://localhost:3000/) to view it in the browser.
8484

85-
See [Available Scripts](./building-your-application/available-scripts/available-scripts.md) for full list of commands.
85+
See [Available Scripts](./building-your-application/available-scripts) for full list of commands.
8686

8787
Now that you are up and running, see the [Components & Usage](./building-your-application/patterns/components.md) section to start building out your first pages!

0 commit comments

Comments
 (0)