Skip to content

Commit 89fe293

Browse files
authored
Documentation for Stable release (#1962)
<!-- Hello 👋 Thank you for submitting a pull request. To help us merge your PR, make sure to follow the instructions below: - Create or update the tests - Create or update the documentation at https://github.com/strapi/documentation - Refer to the issue you are closing in the PR description: Fix #issue - Specify if the PR is ready to be merged or work in progress (by opening a draft PR) Please ensure you read the Contributing Guide: https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md --> ### What does it do? - Fixes all component documentation pages (code snippets, imports, controls, props, story order and groups) - Add troubleshooting page ### Why is it needed? Describe the issue you are solving. ### How to test it? Provide information about the environment and the path to verify the behaviour. ### Related issue(s)/PR(s) Let us know if this is related to any issue/pull request
2 parents b1e6ae4 + 6158b73 commit 89fe293

File tree

100 files changed

+2608
-1348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2608
-1348
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { Meta } from '@storybook/addon-docs/blocks';
2+
3+
<Meta title="Getting Started/Troubleshooting" />
4+
5+
# Troubleshooting
6+
7+
## Layout shift when opening Modals or Dialogs (due to radix-ui -> react-remove-scroll)
8+
9+
If you notice a layout shift when opening Modals or Dialogs, this is caused by the `react-remove-scroll` library used by
10+
`@radix-ui/react-dialog` to prevent background scrolling when a dialog is open.
11+
12+
To fix this, you can add the following CSS to your global styles:
13+
14+
```css
15+
html,
16+
body {
17+
width: calc(100% - var(--removed-body-scroll-bar-size), 0px);
18+
}
19+
```
20+
21+
You will also need to set a background color on the `body` to avoid a white flash when opening a Modal or Dialog:
22+
23+
```css
24+
body {
25+
background: [your-background-color];
26+
}
27+
```
28+
29+
## Focus outline is visible when using mouse
30+
31+
By default, browsers show focus outlines when elements are focused, regardless of the input method (keyboard or mouse).
32+
This can lead to a less-than-ideal user interface when using a mouse.
33+
34+
To improve the user experience, you can use [`what-input`](https://github.com/ten1seven/what-input) library to
35+
conditionally apply focus styles based on the input method.
36+
37+
Install and import `what-input` in your project.
38+
39+
Then, add the following CSS to your global styles:
40+
41+
```css
42+
[data-whatintent='mouse'] *:focus {
43+
outline: none;
44+
}
45+
```
46+
47+
This will hide focus outlines when using a mouse, while still allowing keyboard users to see focus indicators for
48+
accessibility.
49+
50+
## Popovers not appearing above other elements
51+
52+
If you notice that Popovers are not appearing above other elements, you may need to adjust the default radix-ui popper
53+
z-index by adding the following CSS to your global styles:
54+
55+
```css
56+
[data-radix-popper-content-wrapper] {
57+
z-index: 300 !important;
58+
}
59+
```
60+
61+
## Disabled links are still clickable
62+
63+
If you have a link that is disabled but still clickable, you can add the following CSS to your global styles to prevent
64+
pointer events on disabled links:
65+
66+
```css
67+
a[aria-disabled='true'] {
68+
pointer-events: none;
69+
cursor: default;
70+
}
71+
```

docs/stories/00-getting started/migration guides/migration-v1-v2.mdx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,28 @@ If you don't do this, the props for `MyBox` are all inferred as `Record<string,
196196

197197
Some specific props have been removed from components:
198198

199-
- `error` prop from `Accordion` component
200-
- `noBorder` prop from `IconButton`
201-
- `active` prop from `PageLink`
202-
- `showBullet` from `Status`
199+
#### `Accordion` component
200+
201+
- `error` prop is no longer supported
202+
203+
#### `IconButton` component
204+
205+
- `noBorder` prop is no longer supported
206+
- To achieve the same effect, use styled-components:
207+
208+
```tsx
209+
const IconButtonWithoutBorder = styled(IconButton)`
210+
border: 0;
211+
`;
212+
```
213+
214+
#### `PageLink` component
215+
216+
- `active` prop has been removed
217+
218+
#### `Status` component
219+
220+
- `showBullet` prop has been removed
203221

204222
### Removed CMS specific components
205223

docs/stories/02-primitives/Combobox.mdx

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -74,30 +74,26 @@ The `Combobox` primitive is composed of the following components:
7474
and is combined in the following way:
7575

7676
```tsx
77-
() => {
78-
return (
79-
<Combobox.Root>
80-
<Combobox.Trigger>
81-
<Combobox.TextInput placeholder="Pick me" />
82-
<Combobox.Icon />
83-
</Combobox.Trigger>
84-
<Combobox.Portal>
85-
<Combobox.Content>
86-
<Combobox.Viewport>
87-
<Combobox.Item value="1">
88-
<Combobox.ItemText>Option 1</Combobox.ItemText>
89-
<Combobox.ItemIndicator>
90-
<Check />
91-
</Combobox.ItemIndicator>
92-
</Combobox.Item>
93-
<Combobox.NoValueFound>No value found</Combobox.NoValueFound>
94-
<Combobox.CreateItem>Create a new value</Combobox.CreateItem>
95-
</Combobox.Viewport>
96-
</Combobox.Content>
97-
</Combobox.Portal>
98-
</Combobox.Root>
99-
);
100-
};
77+
<Combobox.Root>
78+
<Combobox.Trigger>
79+
<Combobox.TextInput placeholder="Pick me" />
80+
<Combobox.Icon />
81+
</Combobox.Trigger>
82+
<Combobox.Portal>
83+
<Combobox.Content>
84+
<Combobox.Viewport>
85+
<Combobox.Item value="1">
86+
<Combobox.ItemText>Option 1</Combobox.ItemText>
87+
<Combobox.ItemIndicator>
88+
<Check />
89+
</Combobox.ItemIndicator>
90+
</Combobox.Item>
91+
<Combobox.NoValueFound>No value found</Combobox.NoValueFound>
92+
<Combobox.CreateItem>Create a new value</Combobox.CreateItem>
93+
</Combobox.Viewport>
94+
</Combobox.Content>
95+
</Combobox.Portal>
96+
</Combobox.Root>
10197
```
10298

10399
## API Reference
@@ -106,30 +102,22 @@ and is combined in the following way:
106102

107103
<ArgTypes of={Combobox.Root} />
108104

109-
### Trigger
110-
111-
### TextInput
112-
113-
### Icon
114-
115105
### Portal
116106

117107
<ArgTypes of={Combobox.Portal} />
118108

119109
### Content
120110

121-
### Viewport
111+
<ArgTypes of={Combobox.Content} />
122112

123113
### Item
124114

125-
### ItemText
126-
127-
### ItemIndicator
128-
129-
### NoValueFound
115+
<ArgTypes of={Combobox.Item} />
130116

131117
### CreateItem
132118

119+
<ArgTypes of={Combobox.CreateItem} />
120+
133121
## Accessibility
134122

135123
Adheres to the [Combobox WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/)

0 commit comments

Comments
 (0)