-
Notifications
You must be signed in to change notification settings - Fork 380
feat(Page): added styles for glass #12293
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
Changes from all commits
e705c5d
8e145c1
092a301
d592068
45d986b
1adf003
631e4e4
511d8e0
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 |
|---|---|---|
|
|
@@ -67,6 +67,10 @@ export interface PageSectionProps extends React.HTMLProps<HTMLDivElement> { | |
| 'aria-label'?: string; | ||
| /** Sets the base component to render. Defaults to section */ | ||
| component?: keyof React.JSX.IntrinsicElements; | ||
| /** Adds plain styling to the page section. */ | ||
| isPlain?: boolean; | ||
| /** @beta Prevents the page section from automatically applying plain styling when glass theme is enabled. */ | ||
| isNoPlainOnGlass?: boolean; | ||
| } | ||
|
|
||
| const variantType = { | ||
|
|
@@ -98,6 +102,8 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({ | |
| 'aria-label': ariaLabel, | ||
| component = 'section', | ||
| hasBodyWrapper = true, | ||
| isPlain = false, | ||
| isNoPlainOnGlass = false, | ||
| ...props | ||
| }: PageSectionProps) => { | ||
| const { height, getVerticalBreakpoint } = useContext(PageContext); | ||
|
|
@@ -126,6 +132,8 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({ | |
| hasShadowTop && styles.modifiers.shadowTop, | ||
| hasShadowBottom && styles.modifiers.shadowBottom, | ||
| hasOverflowScroll && styles.modifiers.overflowScroll, | ||
| isPlain && styles.modifiers.plain, | ||
| isNoPlainOnGlass && styles.modifiers.noPlainOnGlass, | ||
|
Comment on lines
+135
to
+136
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Check if PageGroup applies the same modifiers consistently and verify test coverage for the precedence behavior.
# Check PageGroup for consistent implementation
rg -n -A5 'isPlain && styles\.modifiers\.plain' packages/react-core/src/components/Page/
# Check test coverage for combined isPlain + isNoPlainOnGlass scenario
rg -n -B2 -A5 'isPlain.*isNoPlainOnGlass|isNoPlainOnGlass.*isPlain' packages/react-core/src/components/Page/__tests__/Repository: patternfly/patternfly-react Length of output: 1213 🏁 Script executed: # Locate the JSDoc for isPlain and isNoPlainOnGlass in PageSection
rg -n -B10 'isPlain' packages/react-core/src/components/Page/PageSection.tsx | head -80Repository: patternfly/patternfly-react Length of output: 1895 🏁 Script executed: # Look for JSDoc or prop definitions that mention the precedence behavior
rg -n 'When both.*isPlain|precedence' packages/react-core/src/components/Page/Repository: patternfly/patternfly-react Length of output: 534 🏁 Script executed: # Check for any test files that verify the combined isPlain + isNoPlainOnGlass behavior
find packages/react-core/src/components/Page/__tests__ -name '*.test.tsx' -o -name '*.test.ts'Repository: patternfly/patternfly-react Length of output: 719 🏁 Script executed: # Check PageSection.test.tsx for tests with both isPlain and isNoPlainOnGlass
cat packages/react-core/src/components/Page/__tests__/PageSection.test.tsxRepository: patternfly/patternfly-react Length of output: 7002 🏁 Script executed: # Check PageGroup.test.tsx for tests with both isPlain and isNoPlainOnGlass
cat packages/react-core/src/components/Page/__tests__/PageGroup.test.tsxRepository: patternfly/patternfly-react Length of output: 3715 Add test coverage for combined The JSDoc documents the intended behavior ("When both this and isPlain are true, isPlain takes precedence"), and the implementation applies both modifier classes consistently in PageSection and PageGroup. However, test coverage is missing for when both props are true simultaneously; currently only individual modifiers are tested. 🤖 Prompt for AI Agents |
||
| className | ||
| )} | ||
| {...(hasOverflowScroll && { tabIndex: 0 })} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { render, screen } from '@testing-library/react'; | ||
| import { PageSidebar } from '../PageSidebar'; | ||
| import styles from '@patternfly/react-styles/css/components/Page/page'; | ||
|
|
||
| test(`Renders with ${styles.pageSidebarMain} wrapper`, () => { | ||
| render(<PageSidebar data-testid="sidebar">Test</PageSidebar>); | ||
|
|
||
| expect(screen.getByText('Test')).toHaveClass(styles.pageSidebarMain); | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.