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

[docs][base] Show components & hooks API on the components page #35938

Merged
merged 101 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from 73 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
f1fde60
[docs] Add hooks API pages
mnajdova Jan 14, 2023
e079c7c
more progress
mnajdova Jan 16, 2023
0ae093f
more fixes
mnajdova Jan 16, 2023
092f1de
link hooks in the component's API section
mnajdova Jan 16, 2023
6c1ee0e
fix default values
mnajdova Jan 17, 2023
1f69369
cleanup
mnajdova Jan 17, 2023
542ce9f
link other hooks on the unstyled component pages
mnajdova Jan 17, 2023
a9400c4
add annotation on the hooks
mnajdova Jan 17, 2023
7c2c19b
small fixes
mnajdova Jan 18, 2023
dc56c8e
Add return value generation logic & UseButtonReturnValue interface
mnajdova Jan 18, 2023
bd3d393
Fix useMenuItem ts issue
mnajdova Jan 18, 2023
7f56ce9
Fix UseButtonReturnValue
mnajdova Jan 18, 2023
a5e213b
Update docs/src/modules/components/AppNavDrawer.js
mnajdova Jan 18, 2023
ce67b74
yarn docs:api
mnajdova Jan 18, 2023
6f0c397
Merge branch 'docs/build-hooks-interfaces' of https://github.com/mnaj…
mnajdova Jan 18, 2023
4a38c6a
updated parseMarkdown tests
mnajdova Jan 18, 2023
aa31bd7
Improve the demos link to point to the hook section
mnajdova Jan 19, 2023
54e5e19
Resolve comments from backlog grooming
mnajdova Jan 21, 2023
a5c2670
Renamed inputParams to parameters, renamed returnValue hash to return…
mnajdova Jan 23, 2023
1406831
Show optional abbr for return value
mnajdova Jan 23, 2023
ebf4760
Extract the PropertiesTable in a standalone component
mnajdova Jan 23, 2023
516d805
Merge branch 'master' into docs/build-hooks-interfaces
mnajdova Jan 24, 2023
ae9aa4a
prettier
mnajdova Jan 24, 2023
00c387c
Renamed Sidebar Component API group to API
mnajdova Jan 24, 2023
9109535
[poc] API tabs in the components pages
mnajdova Jan 24, 2023
818db5f
Make all tabs working
mnajdova Jan 24, 2023
9df6d1f
link component API page to the correct tab
mnajdova Jan 25, 2023
5a681bb
prettier
mnajdova Jan 25, 2023
88662d2
React on query change if on the same page
mnajdova Jan 25, 2023
4dac374
Remove API from toc
mnajdova Jan 25, 2023
cbd8c4e
Place the tabs before the ad, make the tabs sticky in the header
mnajdova Jan 25, 2023
3285aec
Append query param on tab click
mnajdova Jan 25, 2023
65bac95
Update docs/src/modules/components/ComponentPageTabs.js
mnajdova Jan 25, 2023
0a2714f
Hide tabs, instead of re-rendering them, updated the JSdocs for the u…
mnajdova Jan 27, 2023
070c23e
Merge branch 'poc/hook-api-links' of https://github.com/mnajdova/mate…
mnajdova Jan 27, 2023
7375be5
Fix layout shift on ad
mnajdova Jan 27, 2023
1ac4320
Merge branch 'master' into poc/hook-api-links
mnajdova Feb 6, 2023
76db35d
merge conflicts
mnajdova Feb 6, 2023
aeddc79
Add components & demo tabs for the react-tabs page
mnajdova Feb 6, 2023
7b63565
Link API pages correctly
mnajdova Feb 7, 2023
2a0bc36
Improve the tab bars sticky position styles in all screen sizes
mnajdova Feb 8, 2023
8bd1a99
tabs in the header design tweaks + a couple of things more
danilo-leal Feb 10, 2023
2599f1d
fix chips bg color on dark mode
danilo-leal Feb 10, 2023
cdcd600
Merge branch 'master' into poc/hook-api-links
mnajdova Feb 10, 2023
aa9150a
fix scroll margin top
danilo-leal Feb 12, 2023
ff825b8
fix tabs width on mobile
danilo-leal Feb 12, 2023
e18b6a3
remove seemingly unnecessary heading padding
danilo-leal Feb 12, 2023
9f1b2d7
Merge branch 'poc/hook-api-links' of https://github.com/mnajdova/mate…
mnajdova Feb 13, 2023
0ace11c
Merge branch 'master' into poc/hook-api-links
mnajdova Feb 13, 2023
ac029ae
Fix import spacing
mnajdova Feb 14, 2023
85683d1
Merge branch 'master' into poc/hook-api-links
mnajdova Feb 28, 2023
698b744
add step in the yarn docs:api to update the react pages js files
mnajdova Feb 28, 2023
f3e1ae5
add static paths
mnajdova Mar 1, 2023
4e046d8
Try different export mapping
mnajdova Mar 1, 2023
a7eb62e
few changes
mnajdova Mar 2, 2023
dedd0b1
conflicting paths
mnajdova Mar 2, 2023
29284a3
Fix ssr on the demos page
mnajdova Mar 2, 2023
a1eca78
active page should always be the components page
mnajdova Mar 2, 2023
ab1e1e5
active page fix
mnajdova Mar 2, 2023
b70263f
Improve open in new tab/window scenarios
mnajdova Mar 2, 2023
dcb2a53
prettier
mnajdova Mar 2, 2023
a3c8c81
generate correct api pages, update pages for all components
mnajdova Mar 3, 2023
8178f97
add the tabs on all pages
mnajdova Mar 3, 2023
fb9aec4
Merge branch 'master' into poc/hook-api-links
mnajdova Mar 3, 2023
d288bf3
update docs:api
mnajdova Mar 3, 2023
9b124cf
merge conflict correctly resolved
mnajdova Mar 3, 2023
b1ae2ea
[docs] Hooks api tabs alternative links v2
mnajdova Mar 6, 2023
4597e20
make server side tab indicator styles closer to hydrated
mnajdova Mar 13, 2023
488ec78
Fix scroll
mnajdova Mar 13, 2023
a3ad0bf
remove transition between shallow links
mnajdova Mar 13, 2023
a821950
Resolve the last comments
mnajdova Mar 13, 2023
6de66ba
Update the build script to generate the new structure of the files, r…
mnajdova Mar 15, 2023
8615acc
fixed some lint issues
mnajdova Mar 15, 2023
cffb308
fix wrong import
mnajdova Mar 15, 2023
b525835
Update docs/src/modules/components/AppTableOfContents.js
mnajdova Mar 15, 2023
d3ec3c7
improve the API links
mnajdova Mar 15, 2023
bafed49
change the api links to plural
mnajdova Mar 15, 2023
25d6777
Fix error for active page
mnajdova Mar 15, 2023
cb7deb7
Update the JSDocs descriptions
mnajdova Mar 16, 2023
dfadb05
Fix wrong prop type definition
mnajdova Mar 16, 2023
f3bd253
prettier
mnajdova Mar 16, 2023
0a888e2
Update the buildApi script to not generate the old format of the api …
mnajdova Mar 16, 2023
9f1f788
still generate the json files
mnajdova Mar 16, 2023
7c4fbf8
fix lint issues & add test
mnajdova Mar 16, 2023
d9f1b10
Merge branch 'master' into poc/hook-api-links
mnajdova Mar 16, 2023
197c8a5
simplify index pages, use translations
mnajdova Mar 16, 2023
d275fed
improve the name of the method for generating pages
mnajdova Mar 16, 2023
2cab5f2
simplify the code in buildApiUtils
mnajdova Mar 16, 2023
b120b8c
Merge branch 'master' into poc/hook-api-links
mnajdova Mar 23, 2023
500982e
fix hooks import statement, remove description from API page
mnajdova Mar 23, 2023
2371cc5
remove unused var
mnajdova Mar 23, 2023
e852285
update test
mnajdova Mar 23, 2023
5bdd759
Jun's review
mnajdova Mar 24, 2023
87f3bc9
Resolve comments
mnajdova Mar 28, 2023
df7ff54
tweak divider styles
danilo-leal Mar 28, 2023
db913bd
last batch of design tweaks
danilo-leal Mar 28, 2023
9c8b350
one more detail
danilo-leal Mar 28, 2023
051e12b
Merge branch 'master' into poc/hook-api-links
mnajdova Mar 29, 2023
e4f723b
add useOption hook in the docs
mnajdova Mar 29, 2023
4ae86fe
add redirects
mnajdova Mar 29, 2023
1ddf6e8
Merge branch 'master' into poc/hook-api-links
mnajdova Mar 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/data/base/components/badge/badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ githubLabel: 'component: badge'

<p class="description">The Unstyled Badge component generates a small label that is attached to its child element.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

A badge is a small descriptor for UI elements.
Expand All @@ -19,8 +23,6 @@ The Unstyled Badge component creates a badge that is applied to its child elemen

{{"demo": "UnstyledBadgeIntroduction.js", "defaultCodeOpen": false, "bg": "gradient"}}

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/button/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/button/

<p class="description">Buttons let users take actions and make choices with a single tap.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

The Unstyled Button component replaces the native HTML `<button>` element, and offers expanded options for styling and accessibility.

{{"demo": "UnstyledButtonIntroduction.js", "defaultCodeOpen": false, "bg": "gradient"}}

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ githubLabel: 'component: ClickAwayListener'

<p class="description">The Click-Away Listener component detects when a click event happens outside of its child element.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

Click-Away Listener is a utility component that listens for click events outside of its child.
Expand All @@ -18,8 +22,6 @@ This is useful for components like the [Unstyled Popper](/base/react-popper/) wh

Click-Away Listener also supports the [Portal](/base/react-portal/) component.

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/focus-trap/focus-trap.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ githubLabel: 'component: FocusTrap'

<p class="description">The Focus Trap component prevents the user's focus from escaping its children components.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

Focus Trap is a utility component that's useful when implementing an overlay such as a [modal dialog](/base/react-modal/), which should block all interactions outside of it while open.

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/form-control/form-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ githubLabel: 'component: FormControl'

<p class="description">The Unstyled Form Control component is a utility that lets you associate a form input with auxiliary components, such as labels, error indicators, or helper text.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

Unstyled Form Control is a utility that wraps an input component with other associated components in order to make the state of the input available to those components.

For instance, you may want to show an additional element asking the user to enter a value if the input is empty, or display a warning icon if the entered value is incorrect.

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/input/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ githubLabel: 'component: input'

<p class="description">The Unstyled Input component provides users with a field to enter and edit text.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

An input is a UI element that accepts text data from the user.
Expand All @@ -18,8 +22,6 @@ It can also be transformed into a `<textarea>` as needed.

{{"demo": "UnstyledInputIntroduction.js", "defaultCodeOpen": false, "bg": "gradient"}}

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/menu/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/

<p class="description">The Menu components provide your users with a list of options on temporary surfaces.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

The Unstyled Menu component gives users a list of items in a popup that they can navigate through with a mouse or keyboard.
Expand All @@ -21,8 +25,6 @@ These are rendered as `<li>` elements.

{{"demo": "UnstyledMenuIntroduction.js", "defaultCodeOpen": false, "bg": "gradient"}}

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Components

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/modal/modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/

<p class="description">The Unstyled Modal component lets you create dialogs, popovers, lightboxes, and other elements that force the user to take action before continuing.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

Unstyled Modal is a utility component that renders its children in front of a backdrop.
Expand All @@ -23,8 +27,6 @@ This lets you create an element that your users must interact with before contin
- ⌨️ Manages focus correctly between the modal and its parent app
- ♿️ Adds the appropriate ARIA roles automatically

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

:::info
The term "modal" is sometimes used interchangeably with "dialog," but this is incorrect.
A dialog may be _modal_ or _nonmodal (modeless)_.
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/no-ssr/no-ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ components: NoSsr

<p class="description">The No-SSR component defers the rendering of children components from the server to the client.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

No-SSR is a utility component that prevents its children from being rendered on the server.
Expand All @@ -20,8 +24,6 @@ This component can be useful in a variety of situations:
- To turn on service degradation when the server load is too heavy
- To improve the Time to Interactive (TTI) by only rendering what's important (using the `defer` prop)

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/popper/popper.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/

<p class="description">The Unstyled Popper component lets you create tooltips and popovers that display information about an element on the page.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

The Unstyled Popper is a utility component for creating various kinds of popups.
It relies on the third-party library ([Popper.js v2](https://popper.js.org/docs/v2/)) for positioning.

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/portal/portal.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ githubLabel: 'component: Portal'

<p class="description">The Portal component lets you render its children into a DOM node that exists outside of the Portal's own DOM hierarchy.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

Portal is a utility component built around [React's `createPortal()` API](https://reactjs.org/docs/portals.html).
It gives you the functionality of `createPortal()` in a convenient component form.

The Portal component is used internally by the [Unstyled Modal](/base/react-modal/) and [Unstyled Popper](/base/react-popper/) components.

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/select/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-sel

<p class="description">The Select components let you create lists of options for users to choose from.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

A select is a UI element that gives users a list of options to choose from.
Expand All @@ -26,8 +30,6 @@ It also includes Unstyled Option for creating the options on the list, and Unsty
- 🧬 Accepts custom elements and non-string values for options
- 🗃️ Options can be grouped and nested

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Components

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/slider/slider.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/slider-multithumb/
<p class="description">A slider is a UI element that lets users select a single value or a range of values along a bar.
</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

The Unstyled Slider component lets users make selections from a range of values along a horizontal or vertical bar.
Expand All @@ -20,8 +24,6 @@ Sliders are ideal for interface controls that benefit from a visual representati

{{"demo": "UnstyledSliderIntroduction.js", "defaultCodeOpen": false, "bg": "gradient"}}

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/snackbar/snackbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ githubLabel: 'component: snackbar'

<p class="description">The Unstyled Snackbar component informs users that an action has been or will be performed by the app.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

A snackbar provides users with a brief, temporary message about app processes without interrupting their activity or experience.

The Unstyled Snackbar component is built to appear on-screen to inform users about an action that the app is taking.

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/switch/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/switch/

<p class="description">Switches are UI elements that let users choose between two states—most commonly on/off.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

The Unstyled Switch component provides users with a switch for toggling between two mutually exclusive states.

{{"demo": "UnstyledSwitchIntroduction.js", "defaultCodeOpen": false, "bg": "gradient"}}

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ githubLabel: 'component: TablePagination'

<p class="description">Table Pagination is an interface tool for splitting up large amounts of data to make it easier for users to navigate.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

The Unstyled Table Pagination component lets you add pagination controls to a table.
Expand All @@ -23,8 +27,6 @@ See the [Slot props section](#slot-props) for details.

{{"demo": "UnstyledPaginationIntroduction.js", "defaultCodeOpen": false, "bg": "gradient"}}

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
6 changes: 4 additions & 2 deletions docs/data/base/components/tabs/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/tabs/

<p class="description">Tabs are UI elements for organizing and navigating between groups of related content.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

Tabs are implemented using a collection of related components:
Expand All @@ -22,8 +26,6 @@ Tabs are implemented using a collection of related components:

{{"demo": "UnstyledTabsIntroduction.js", "defaultCodeOpen": false, "bg": "gradient"}}

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Components

### Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ githubLabel: 'component: TextareaAutosize'

<p class="description">The Textarea Autosize component gives you a textarea HTML element that automatically adjusts its height to match the length of the content within.</p>

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

{{"component": "modules/components/ComponentPageTabs.js"}}

## Introduction

Textarea Autosize is a utility component that replaces the native `<textarea>` HTML.

The height of the Textarea Autosize component automatically adjusts as a response to keyboard inputs and window resizing events.

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Component

### Usage
Expand Down
2 changes: 1 addition & 1 deletion docs/data/base/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const pages = [
],
},
{
title: 'API',
title: 'APIs',
oliviertassinari marked this conversation as resolved.
Show resolved Hide resolved
pathname: '/base/api',
icon: 'CodeIcon',
children: pagesApi,
Expand Down