-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Visually hidden docs #691
Visually hidden docs #691
Changes from 1 commit
f12b246
6afc571
8acf074
9f77350
e04d71e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const code = { | ||
javascript: { | ||
code: `import VisuallyHidden from "@radui/ui/VisuallyHidden"" | ||
|
||
const VisualltHiddenExample = () => ( | ||
<VisuallyHidden asChild> | ||
<span>This is a visually hidden text</span> | ||
</VisuallyHidden> | ||
)` | ||
}, | ||
scss: { | ||
code: `.rad-ui-visually-hidden { | ||
display: none; | ||
}` | ||
}, | ||
} | ||
|
||
export default code; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const PAGE_NAME = 'VISUALLY_HIDDEN_DOCS' | ||
import Documentation from "@/components/layout/Documentation/Documentation" | ||
|
||
|
||
import VisuallyHidden from "@radui/ui/VisuallyHidden" | ||
import SEO from "../../docsIndex" | ||
export const metadata = SEO.getMetadata(PAGE_NAME) | ||
|
||
import codeUsage from "./docs/codeUsage" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification The import path needs to be corrected The current import path
🔗 Analysis chainSuggest verifying the import path. Kindly double-check that 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Validate that codeUsage is exported from docs/app/docs/components/visually-hidden/docs/codeUsage.js
rg --context 3 'export .* codeUsage'
Length of output: 38 Script: #!/bin/bash
# Let's first check if the file exists at the expected location
fd "codeUsage" --extension js --extension ts --extension tsx
# Let's also check for any file that might export codeUsage using ast-grep
ast-grep --pattern 'export $_ codeUsage'
# Let's also check the directory structure to understand the context better
ls -R docs/app/docs/components/visually-hidden/
Length of output: 1236 Script: #!/bin/bash
# Let's check the content of the codeUsage.js file to verify the export
cat docs/app/docs/components/visually-hidden/docs/codeUsage.js
# Let's also check the actual import statement in page.js
cat docs/app/docs/components/visually-hidden/page.js
Length of output: 1872 |
||
|
||
const VisuallyHiddenDocs = () => { | ||
|
||
const columns = [ | ||
{name: 'Prop', key: 'prop'}, | ||
{name: 'Type', key: 'type'}, | ||
{name: 'Default', key: 'default'}, | ||
{name: 'Description', key: 'description'}, | ||
]; | ||
|
||
const data = [ | ||
{prop: 'asChild', type: 'boolean', default: 'false', description: 'renders the children in desired element'}, | ||
|
||
]; | ||
|
||
|
||
return <div> | ||
<Documentation currentPage={PAGE_NAME} title='Visually Hidden' description={`Use these helpers to visually hide elements but keep them accessible to assistive technologies.`}> | ||
<Documentation.ComponentHero codeUsage={codeUsage}> | ||
<div> | ||
<VisuallyHidden asChild> | ||
<span>This is a visually hidden text</span> | ||
</VisuallyHidden> | ||
</div> | ||
</Documentation.ComponentHero> | ||
|
||
|
||
<div > | ||
<Documentation.Table columns={columns} data={data} /> | ||
</div> | ||
</Documentation> | ||
</div> | ||
} | ||
|
||
export default VisuallyHiddenDocs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do this via js as an inline style, we wont need the CSS, this wont work without CSS, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The component was made this way although it has a line of styling but inline styling might have conflicts with customclass styling. Not tested I might be wrong too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if people wanna inline style and override, that's fine - but out of the box this should work without CSS
Coz we are a headless library first, without CSS - this component will be visible even though we call it visually hidden :D