-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(site): add component-description component (#1547)
- Loading branch information
Showing
22 changed files
with
119 additions
and
142 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
packages/docs/components/component-description/component-description.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.description { | ||
color: var(--sl-fg-base-soft); | ||
font-family: var(--sl-font-family-sans); | ||
font-size: 18px; | ||
font-style: normal; | ||
font-weight: 500; | ||
line-height: 32px; | ||
letter-spacing: -0.96px; | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/docs/components/component-description/component-description.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
import allProps from '../../__props__' | ||
import styles from './component-description.module.css' | ||
|
||
export function ComponentDescription(props: PropsDocsProps) { | ||
const { name } = props | ||
|
||
const reference = allProps[name] | ||
|
||
if (!reference) { | ||
return <></> | ||
} | ||
|
||
return <p className={styles.description}>{reference.description}</p> | ||
} | ||
|
||
interface PropsDocsProps { | ||
name: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './component-description' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
|
||
.prop { | ||
padding: var(--sl-space-0) var(--sl-space-3); | ||
overflow-x: auto; | ||
overflow-y: hidden; | ||
} | ||
|
||
.tag { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import { AccessibleIcon, IconTrash } from '@vtex/shoreline' | ||
|
||
export default function Example() { | ||
return ( | ||
<AccessibleIcon label="Delete"> | ||
<IconTrash /> | ||
</AccessibleIcon> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
# AccessibleIcon | ||
|
||
Makes icons accessible by adding a label. | ||
<ComponentDescription name="accessible-icon" /> | ||
|
||
![AccessibleIcon example](public/assets/overview-accessibleicon.webp) | ||
<Preview name="accessible-icon" /> | ||
|
||
## Required props | ||
|
||
<PropsDocs name="accessible-icon" required /> | ||
|
||
## Optional props | ||
|
||
<PropsDocs name="accessible-icon" /> |
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
packages/docs/pages/components/accessible-icon/api-reference.mdx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "api-reference": "API Reference", "best-practices": "Best Practices" } | ||
{ "best-practices": "Best Practices" } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# Bleed | ||
|
||
Sometimes a component needs to trespass the parent padding to achieve alignment harmony and visual compensation to the layout. You can accomplish this with Bleed, which applies a negative margin to represent the amount of trespassing desired. | ||
<ComponentDescription name="bleed" /> | ||
|
||
![Bleed example](public/assets/overview-bleed.webp) | ||
<Preview name="bleed" /> | ||
|
||
## Optional props | ||
|
||
<PropsDocs name="bleed" /> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "api-reference": "API Reference", "best-practices": "Best Practices" } | ||
{ "best-practices": "Best Practices" } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters