Skip to content

Commit 971eb86

Browse files
authored
chore: fix specs location (#29642)
1 parent d22e99a commit 971eb86

5 files changed

Lines changed: 557 additions & 676 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "chore: move the component spec",
4+
"packageName": "@fluentui/react-table",
5+
"email": "olfedias@microsoft.com",
6+
"dependentChangeType": "none"
7+
}

packages/react-components/react-skeleton/SPEC.md

Lines changed: 0 additions & 105 deletions
This file was deleted.

packages/react-components/react-skeleton/docs/Spec.md

Lines changed: 75 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,104 @@
22

33
## Background
44

5-
_Description and use cases of this component_
5+
The `Skeleton` component is a temporary placeholder for UI that is in a loading state.
66

77
## Prior Art
88

9-
_Include background research done for this component_
9+
| Library | Component Name | Spec Link | Notes |
10+
| ----------- | -------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11+
| Ant Design | Skeleton | [Skeleton](https://ant.design/components/skeleton/) | Has an `avatar`, `button`, `list`, and `togglebutton`. Has animated and non-animated versions, and shape variants for the component skeletons(rounded or rectangular). |
12+
| Fast | Skeleton | [Skeleton](https://explore.fast.design/components/fast-skeleton) | Has three components: `Avatar`, `List`, and `Button`. No shape variants. |
13+
| Semantic UI | Placeholder | [Placeholder](https://react.semantic-ui.com/elements/placeholder/) | Has `Header` and `Paragraph` subcomponents. The `Header` can take in an image as a prop |
14+
| UI Fabric | Shimmer | [Shimmer](https://developer.microsoft.com/en-us/fluentui#/controls/web/shimmer) | Shimmer has a way to pass in custom elements as well as the defaults. There is also a prop to change the colors of the Skeleton components. |
1015

11-
- _Link to Open UI research_
12-
- _Link to comparison of v7 and v0_
13-
- _Link to GitHub epic issue for the converged component_
16+
### Comparison of v8 and v0
17+
18+
The existing components are:
19+
20+
- v8
21+
- `Shimmer`
22+
- v0
23+
- Does not have an existing `Skeleton` component.
1424

1525
## Sample Code
1626

17-
_Provide some representative example code that uses the proposed API for the component_
27+
Basic example:
28+
29+
```jsx
30+
import { Skeleton, SkeletonItem } from '@fluentui/react-skeleton';
31+
32+
function App() {
33+
return (
34+
<Skeleton>
35+
<SkeletonItem shape="circle" size={24} />
36+
<SkeletonItem shape="rectangle" size={16} />
37+
</Skeleton>
38+
);
39+
}
40+
```
1841

1942
## Variants
2043

21-
_Describe visual or functional variants of this control, if applicable. For example, a slider could have a 2D variant._
44+
- There are three basic `Skeleton` shapes
45+
- `Rectangle`
46+
- `Circle`
47+
- `Square`
48+
49+
### Shape
50+
51+
The `Skeleton` is a combination of any of the two shapes in order to represent the content that will be loaded onto the screen. That is, it is a combination of rectangles and circles that is a visual representation of the wireframe of a page.
2252

2353
## API
2454

25-
_List the **Props** and **Slots** proposed for the component. Ideally this would just be a link to the component's `.types.ts` file_
55+
### Slots
56+
57+
- `root` - The root slot of the `Skeleton` is the container that will contain the items that make up a `Skeleton` in representation of the data that is loading. The default html element is a `svg`.
58+
59+
### Props
60+
61+
See API at:
62+
63+
- [Skeleton.types.ts](./src/components/Skeleton/Skeleton.types.ts).
64+
- [SkeletonItem.types.ts](./src/components/SkeletonItem/SkeletonItem.types.ts).
2665

2766
## Structure
2867

29-
- _**Public**_
30-
- _**Internal**_
31-
- _**DOM** - how the component will be rendered as HTML elements_
68+
```html
69+
<!-- Container for Skeleton -->
3270

33-
## Migration
71+
<div class="fui-Skeleton">
72+
<!-- Container for SkeletonElement -->
3473

35-
_Describe what will need to be done to upgrade from the existing implementations:_
74+
<div class="fui-SkeletonItem" />
75+
</div>
76+
```
3677

37-
- _Migration from v8_
38-
- _Migration from v0_
78+
## Migration
79+
80+
See [MIGRATION.md](./MIGRATION.md).
3981

4082
## Behaviors
4183

42-
_Explain how the component will behave in use, including:_
84+
### States
85+
86+
- **Display** - The `Skeleton` will use the following priority:
87+
88+
- The `appearance` prop will allow the use of a `translucent` appearance.
89+
- Specifying `wave` or `pulse` will change the animation style of the `Skeleton`
90+
- The component also has `rtl` support and will animate the `Skeleton` from right to left if set.
91+
- Setting the `shape` prop in `<SkeletonItem />` will render a `rectangle`, `square`, or a `circle` (default is `rectangle`).
92+
- Setting the `size` prop in `<SkeletonItem />` will allow the user to specify the size of the element (default is 16).
93+
94+
### Interaction
95+
96+
The Skeleton is non-interactive.
97+
98+
- **Keyboard** - Not keyboard focusable.
99+
- **Mouse** - Nothing
43100

44-
- _Component States_
45-
- _Interaction_
46-
- _Keyboard_
47-
- _Cursor_
48-
- _Touch_
49-
- _Screen readers_
101+
- **Touch** - Nothing
50102

51103
## Accessibility
52104

53-
Base accessibility information is included in the design document. After the spec is filled and review, outcomes from it need to be communicated to design and incorporated in the design document.
54-
55-
- Decide whether to use **native element** or folow **ARIA** and provide reasons
56-
- Identify the **[ARIA](https://www.w3.org/TR/wai-aria-practices-1.2/) pattern** and, if the component is listed there, follow its specification as possible.
57-
- Identify accessibility **variants**, the `role` ([ARIA roles](https://www.w3.org/TR/wai-aria-1.1/#role_definitions)) of the component, its `slots` and `aria-*` props.
58-
- Describe the **keyboard navigation**: Tab Oder and Arrow Key Navigation. Describe any other keyboard **shortcuts** used
59-
- Specify texts for **state change announcements** - [ARIA live regions
60-
](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) (number of available items in dropdown, error messages, confirmations, ...)
61-
- Identify UI parts that appear on **hover or focus** and specify keyboard and screen reader interaction with them
62-
- List cases when **focus** needs to be **trapped** in sections of the UI (for dialogs and popups or for hierarchical navigation)
63-
- List cases when **focus** needs to be **moved programatically** (if parts of the UI are appearing/disappearing or other cases)
105+
- An `aria-label` is added to the `Skeleton` container to let users know that content is loading

0 commit comments

Comments
 (0)