Skip to content

Commit

Permalink
Added documentation for placeholder components (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraincs authored Oct 11, 2024
2 parents cc983eb + 4d1fb4e commit b02506a
Show file tree
Hide file tree
Showing 20 changed files with 375 additions and 9 deletions.
5 changes: 2 additions & 3 deletions apps/docs/content/components/collections/Listbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ links:
TODO: links to related concepts
</FeatureFlag>


#### Header

The Header component represents a `header` within a Hopper container.
Expand All @@ -44,8 +43,8 @@ The Section component represents a `section` within a Hopper container.

A `ListBox` uses the following components.

- [Header](./Listbox#header)
- [Section](./Listbox#section)
- [Header](./Header)
- [Section](/Section)
- [ListBoxItem](./Listbox#listboxitem)

#### ListBoxItem
Expand Down
70 changes: 70 additions & 0 deletions apps/docs/content/components/collections/Section.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: Section
description: A Section serves as a versatile container component, encapsulating an HTML section element.
category: "collections"
links:
source: https://github.com/gsoft-inc/wl-hopper/blob/main/packages/components/src/Section/src/Section.tsx
---

Section is a subcomponent of [Listbox](./Listbox), it's used within [Combobox](./ComboBox) and [Select](./Select).

<Example src="Section/docs/preview" isOpen />

<FeatureFlag flag="next">
## Guidelines

TODO: If we have some guidelines about this component&apos;s usage

### Accessibility ?

TODO: If we have some guidelines about this component and accessibility
</FeatureFlag>

## Anatomy

### Composed Components

A `Section` uses the following components.

#### Listbox

- [ListboxItem](./Listbox#listboxitem)
- [Header](./Header)

#### Combobox

- [ComboBoxOption](./ComboBox#comboboxoption)
- [Header](./Header)

#### Select

- [SelectOption](./Select#selectoption)
- [Header](./Header)

<FeatureFlag flag="rc">

TODO: We have anatomy screenshots from the Figma, we could most likely use them here

### Concepts

TODO: links to related concepts
</FeatureFlag>

<FeatureFlag flag="next">
## Advanced customization

### Contexts
TODO: Example of context + content about the context

### Custom Children

TODO: Example of passing custom childrens to the components to fake a slot

### Custom Component

TODO: Example of creating a custom version of this component
</FeatureFlag>

## Props

<PropTable component="Section" />
4 changes: 2 additions & 2 deletions apps/docs/content/components/overlays/Popover.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ A `Popover` uses the following components.

- [Button](./Button)
- [ButtonGroup](./ButtonGroup)
- Content
- Footer
- [Content](./Content)
- [Footer](./Footer)
- [Heading](./Heading)
- [Link](./Link)

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/components/pickers/ComboBox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ A `ComboBox` uses the following components.
- [Label](./Label)
- [Helper Message](./HelperMessage)
- [Error Message](./ErrorMessage)
- [Header](./ComboBox#header)
- [Header](./Header)
- [Section](./ComboBox#section)

#### ComboBoxOption
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/components/pickers/Select.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ A `Select` uses the following components.
- [Label](./Label)
- [Helper Message](./HelperMessage)
- [Error Message](./ErrorMessage)
- [Header](./Select#header)
- [Section](./Select#section)
- [Header](./Header)
- [Section](./Section)

#### SelectOption

Expand Down
50 changes: 50 additions & 0 deletions apps/docs/content/components/placeholders/Content.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: Content
description: A placeholder for the main content section of a component.
category: "placeholders"
links:
source: https://github.com/gsoft-inc/wl-hopper/blob/main/packages/components/src/layout/src/Content.tsx
---

A content placeholder component provides no specific styling by itself, but receives styling from the parent container. In addition, a content placeholder will be automatically placed within the container's layout according to Hopper guidelines.

<Example src="layout/docs/content/preview" isOpen />

<FeatureFlag flag="next">
## Guidelines

TODO: If we have some guidelines about this component&apos;s usage

### Accessibility ?

TODO: If we have some guidelines about this component and accessibility
</FeatureFlag>

<FeatureFlag flag="rc">
## Anatomy

TODO: We have anatomy screenshots from the Figma, we could most likely use them here

### Concepts

TODO: links to related concepts
</FeatureFlag>

<FeatureFlag flag="next">
## Advanced customization

### Contexts
TODO: Example of context + content about the context

### Custom Children

TODO: Example of passing custom childrens to the components to fake a slot

### Custom Component

TODO: Example of creating a custom version of this component
</FeatureFlag>

## Props

<PropTable component="Content" />
50 changes: 50 additions & 0 deletions apps/docs/content/components/placeholders/Footer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: Footer
description: A placeholder for a footer section.
category: "placeholders"
links:
source: https://github.com/gsoft-inc/wl-hopper/blob/main/packages/components/src/layout/src/Footer.tsx
---

A footer placeholder component provides no specific styling by itself, but receives styling from the parent container. In addition, a footer placeholder will be automatically placed within the container's layout according to Hopper guidelines.

<Example src="layout/docs/footer/preview" isOpen />

<FeatureFlag flag="next">
## Guidelines

TODO: If we have some guidelines about this component&apos;s usage

### Accessibility ?

TODO: If we have some guidelines about this component and accessibility
</FeatureFlag>

<FeatureFlag flag="rc">
## Anatomy

TODO: We have anatomy screenshots from the Figma, we could most likely use them here

### Concepts

TODO: links to related concepts
</FeatureFlag>

<FeatureFlag flag="next">
## Advanced customization

### Contexts
TODO: Example of context + content about the context

### Custom Children

TODO: Example of passing custom childrens to the components to fake a slot

### Custom Component

TODO: Example of creating a custom version of this component
</FeatureFlag>

## Props

<PropTable component="Footer" />
50 changes: 50 additions & 0 deletions apps/docs/content/components/placeholders/Header.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: Header
description: A placeholder for an header section.
category: "placeholders"
links:
source: https://github.com/gsoft-inc/wl-hopper/blob/main/packages/components/src/Header/src/Header.tsx
---

An header placeholder component provides no specific styling by itself, but receives styling from the parent container. In addition, an header placeholder will be automatically placed within the container's layout according to Hopper guidelines.

<Example src="Header/docs/preview" />

<FeatureFlag flag="next">
## Guidelines

TODO: If we have some guidelines about this component&apos;s usage

### Accessibility ?

TODO: If we have some guidelines about this component and accessibility
</FeatureFlag>

<FeatureFlag flag="rc">
## Anatomy

TODO: We have anatomy screenshots from the Figma, we could most likely use them here

### Concepts

TODO: links to related concepts
</FeatureFlag>

<FeatureFlag flag="next">
## Advanced customization

### Contexts
TODO: Example of context + content about the context

### Custom Children

TODO: Example of passing custom childrens to the components to fake a slot

### Custom Component

TODO: Example of creating a custom version of this component
</FeatureFlag>

## Props

<PropTable component="Header" />
12 changes: 12 additions & 0 deletions apps/docs/examples/Preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,18 @@ export const Previews: Record<string, Preview> = {
"Select/docs/selectDropdown/description": {
component: lazy(() => import("@/../../packages/components/src/Select/docs/selectDropdown/description.tsx"))
},
"layout/docs/content/preview": {
component: lazy(() => import("@/../../packages/components/src/layout/docs/content/preview.tsx"))
},
"layout/docs/footer/preview": {
component: lazy(() => import("@/../../packages/components/src/layout/docs/footer/preview.tsx"))
},
"Header/docs/preview": {
component: lazy(() => import("@/../../packages/components/src/Header/docs/preview.tsx"))
},
"Section/docs/preview": {
component: lazy(() => import("@/../../packages/components/src/Section/docs/preview.tsx"))
},
"Badge/docs/badge/preview": {
component: lazy(() => import("@/../../packages/components/src/Badge/docs/badge/preview.tsx"))
},
Expand Down
1 change: 1 addition & 0 deletions apps/docs/examples/overview/Content.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/docs/examples/overview/Footer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/docs/examples/overview/Form.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/docs/examples/overview/Header.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/docs/examples/overview/Section.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions apps/docs/examples/overview/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import ButtonGroup from "./ButtonGroup.svg";
import Checkbox from "./Checkbox.svg";
import CheckboxGroup from "./CheckboxGroup.svg";
import Combobox from "./Combobox.svg";
import Content from "./Content.svg";
import Divider from "./Divider.svg";
import ErrorMessage from "./ErrorMessage.svg";
import Flex from "./Flex.svg";
import FloatingBadge from "./FloatingBadge.svg";
import Footer from "./Footer.svg";
import Form from "./Form.svg";
import Grid from "./Grid.svg";
import Header from "./Header.svg";
import Heading from "./Heading.svg";
import HelperMessage from "./HelperMessage.svg";
import IconList from "./IconList.svg";
Expand All @@ -25,6 +28,7 @@ import PasswordField from "./PasswordField.svg";
import Popover from "./Popover.svg";
import RadioGroup from "./RadioGroup.svg";
import SearchField from "./SearchField.svg";
import Section from "./Section.svg";
import Select from "./Select.svg";
import Spinner from "./Spinner.svg";
import Stack from "./Stack.svg";
Expand All @@ -48,12 +52,15 @@ export const OverviewComponents: OverviewComponentsType = {
Checkbox,
CheckboxGroup,
Combobox,
Content,
Divider,
ErrorMessage,
Flex,
FloatingBadge,
Footer,
Form,
Grid,
Header,
Heading,
HelperMessage,
IconList,
Expand All @@ -66,6 +73,7 @@ export const OverviewComponents: OverviewComponentsType = {
Popover,
RadioGroup,
SearchField,
Section,
Select,
Spinner,
Stack,
Expand Down
Loading

0 comments on commit b02506a

Please sign in to comment.