-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[docs] Test products search #31351
Merged
Merged
[docs] Test products search #31351
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d40b521
base: add mockup button page
siriwatknp 488713d
joy: add mockup button and api pages
siriwatknp 61124b6
temp
siriwatknp d1a762b
add getUrlProduct
siriwatknp 8d03dea
include optionalFilters to AppSearch
siriwatknp fbe814f
joy: add link to button api
siriwatknp c457103
remove Joy button api page for now
siriwatknp c3934e1
Merge branch 'master' of https://github.com/mui/material-ui into docs…
siriwatknp 1c6e212
rename page to react-button
siriwatknp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,17 @@ | ||
--- | ||
product: base | ||
title: React button unstyled | ||
githubLabel: 'component: button' | ||
--- | ||
|
||
# Button unstyled | ||
|
||
<p class="description">Buttons allow users to take actions, and make choices, with a single tap.</p> | ||
|
||
## Basic usage | ||
|
||
## Customizing the root element | ||
|
||
## Complex customization | ||
|
||
## `useButton` hook |
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,22 @@ | ||
--- | ||
product: joy-ui | ||
title: React Button component | ||
--- | ||
|
||
# Button | ||
|
||
<p class="description">Buttons allow users to take actions, and make choices, with a single tap.</p> | ||
|
||
## Variants | ||
|
||
## Colors | ||
|
||
## Sizes | ||
|
||
## Icon | ||
|
||
## Loading | ||
|
||
## Upload | ||
|
||
## Third-party routing library |
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,14 @@ | ||
const pages = [ | ||
{ | ||
pathname: '/joy-ui/react-', | ||
title: 'Components', | ||
icon: 'ToggleOnIcon', | ||
children: [ | ||
{ | ||
pathname: '/joy-ui/react-button', | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
export default pages; |
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,11 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
import { | ||
demos, | ||
docs, | ||
demoComponents, | ||
} from 'docs/data/base/components/button/button.md?@mui/markdown'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs demos={demos} docs={docs} demoComponents={demoComponents} />; | ||
} |
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,11 @@ | ||
import * as React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
import { | ||
demos, | ||
docs, | ||
demoComponents, | ||
} from 'docs/data/joy/components/button/button.md?@mui/markdown'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs demos={demos} docs={docs} demoComponents={demoComponents} />; | ||
} |
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
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,29 @@ | ||
import { expect } from 'chai'; | ||
import getUrlProduct from './getUrlProduct'; | ||
|
||
describe('getUrlProduct', () => { | ||
it('get material-ui', () => { | ||
expect(getUrlProduct('/material-ui/react-button/')).to.equal('material-ui'); | ||
expect(getUrlProduct('/zh/material-ui/react-button/')).to.equal('material-ui'); | ||
}); | ||
|
||
it('get base', () => { | ||
expect(getUrlProduct('/base/react-button-unstyled/')).to.equal('base'); | ||
expect(getUrlProduct('/zh/base/react-button-unstyled/')).to.equal('base'); | ||
}); | ||
|
||
it('get joy-ui', () => { | ||
expect(getUrlProduct('/joy-ui/react-button/')).to.equal('joy-ui'); | ||
expect(getUrlProduct('/zh/joy-ui/react-button/')).to.equal('joy-ui'); | ||
}); | ||
|
||
it('get data-grid', () => { | ||
expect(getUrlProduct('/x/react-data-grid/components')).to.equal('data-grid'); | ||
expect(getUrlProduct('/zh/x/react-data-grid/components')).to.equal('data-grid'); | ||
}); | ||
|
||
it('get date-picker', () => { | ||
expect(getUrlProduct('/x/react-date-picker/components')).to.equal('date-picker'); | ||
expect(getUrlProduct('/zh/x/react-date-picker/components')).to.equal('date-picker'); | ||
}); | ||
}); |
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,7 @@ | ||
export default function getUrlProduct(asPath: string) { | ||
const urlWithoutLang = asPath.replace(/^\/[a-zA-Z]{2}\//, '/'); | ||
if (urlWithoutLang.startsWith('/x')) { | ||
return urlWithoutLang.replace('/x/react-', '').replace(/\/.*/, ''); | ||
} | ||
return urlWithoutLang.replace(/^\/([^/]+)\/.*/, '$1'); | ||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Oh interesting, so the current direction for the product names that I can infer from the URLs is:
Alright, sounds good 👍