Skip to content
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

sync: release-23.x to next #3404

Merged
merged 3 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/analyze-dependents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ jobs:
id: cpr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.requirements_bot_github_token }}
commit-message: "docs: update dependent-usage.json"
title: "docs: update dependent-usage.json"
body: "Contains automated changes to the dependent-usage.json file, which provides the data for Paragon Usage Insights."
Expand All @@ -273,10 +274,10 @@ jobs:
uses: hmarr/auto-approve-action@v4
with:
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
github-token: ${{ secrets.requirements_bot_github_token }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Auto-merge pull request for dependent project usages
uses: pascalgn/automerge-action@v0.16.4
env:
GITHUB_TOKEN: ${{ secrets.requirements_bot_github_token }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_METHOD: squash
MERGE_RETRY_SLEEP: 240000
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions www/src/pages/foundations/elevation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,14 @@ export default function ElevationPage({ pageContext }) {
<h4>Example variables usage</h4>
<p>Variables are available with following pattern: </p>
<code className="d-block mb-2 bg-gray-100 p-3">
{'$box-shadow-{direction}-{level}'}
{'var(--pgn-elevation-box-shadow-{direction}-{level})'}
</code>
<p>For example:</p>
<code className="d-block mb-2 bg-gray-100 p-3">
$box-shadow-right-2
var(--pgn-elevation-box-shadow-right-2)
</code>
<code className="d-block mb-2 bg-gray-100 p-3">
$box-shadow-up-3
var(--pgn-elevation-box-shadow-up-3)
</code>
<br />

Expand Down
86 changes: 85 additions & 1 deletion www/src/pages/foundations/responsive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,34 @@ const BREAKPOINT_DESCRIPTIONS = {
extraExtraLarge: { name: 'Extra extra large', identifier: 'xxl' },
};

const customBreakpoints = [
{ name: '--pgn-size-breakpoint-min-width-xs', property: 'min-width', value: '0px' },
{ name: '--pgn-size-breakpoint-max-width-xs', property: 'max-width', value: '576px' },
{ name: '--pgn-size-breakpoint-min-width-sm', property: 'min-width', value: '576px' },
{ name: '--pgn-size-breakpoint-max-width-sm', property: 'max-width', value: '768px' },
{ name: '--pgn-size-breakpoint-min-width-md', property: 'min-width', value: '768px' },
{ name: '--pgn-size-breakpoint-max-width-md', property: 'max-width', value: '992px' },
{ name: '--pgn-size-breakpoint-min-width-lg', property: 'min-width', value: '992px' },
{ name: '--pgn-size-breakpoint-max-width-lg', property: 'max-width', value: '1200px' },
{ name: '--pgn-size-breakpoint-min-width-xl', property: 'min-width', value: '1200px' },
{ name: '--pgn-size-breakpoint-max-width-xl', property: 'max-width', value: '1400px' },
{ name: '--pgn-size-breakpoint-min-width-xxl', property: 'min-width', value: '1400px' },
];

const getBreakpointDescription = (breakpoint) => BREAKPOINT_DESCRIPTIONS[breakpoint] || {};

function IdentifierCell({ row }) {
return <code>{row.values.identifier}</code>;
}

function PropertyCell({ row }) {
return <code>{row.values.property}</code>;
}

function ValueCell({ row }) {
return <code>{row.values.value}</code>;
}

function MinWidthCell({ row }) {
if (row.values.identifier === 'xs') {
return (
Expand All @@ -45,6 +68,7 @@ function MinWidthCell({ row }) {
}
return <code>{row.values.minWidth ? `${row.values.minWidth}px` : '-'}</code>;
}

function MaxWidthCell({ row }) {
return <code>{row.values.maxWidth ? `${row.values.maxWidth}px` : '-'}</code>;
}
Expand Down Expand Up @@ -83,7 +107,8 @@ function Responsive({ pageContext }) {
>
<DataTable.Table />
</DataTable>
<h2 className="mt-3">Basic usage</h2>
<h2 className="mt-3">SCSS variables</h2>
<h3 className="mt-3">Basic usage</h3>
<p>
To access or change the breakpoints in the scss use <code>$grid-breakpoints</code> variable.
</p>
Expand All @@ -99,6 +124,57 @@ function Responsive({ pageContext }) {
<CodeBlock className="language-scss">
{'@include media-breakpoint-up(map.get($grid-breakpoints, \'lg\')) { // styles here }'}
</CodeBlock>

<h2 className="mt-3">CSS Custom Media Breakpoints</h2>
<p>
Media breakpoints in CSS are defined using the following variables.
</p>
<h3>Available Breakpoints</h3>
<DataTable
className="pgn-doc__spacing-table"
data={customBreakpoints}
columns={[
{ Header: 'Breakpoint', accessor: 'name' },
{ Header: 'Property', accessor: 'property', Cell: PropertyCell },
{ Header: 'Value', accessor: 'value', Cell: ValueCell },
]}
itemCount={0}
>
<DataTable.Table />
</DataTable>

<h3 className="mt-3">Basic Usage</h3>
<p>
The structure of a breakpoint variable is:
</p>
<CodeBlock className="language-scss">
{'--pgn-size-breakpoint-{width_type}-{class_infix}'}
</CodeBlock>
<p>
Explanation of the variable components:
<ul>
<li><code>{'{width_type}'}</code> specifies the width type, either <strong>min</strong> for a minimum width
(inclusive) or <strong>max</strong> for a maximum width (inclusive).
</li>
<li><code>{'{class_infix}'}</code> refers to the breakpoint name, such as <code>sm</code>, <code>md</code>,
or <code>lg</code>.
</li>
</ul>
</p>

<p>
Example for applying styles when the screen width is narrower than the <code>md</code> breakpoint:
</p>
<CodeBlock className="language-scss">
{'@media (--pgn-size-breakpoint-max-width-md) { // styles here }'}
</CodeBlock>

<p>
For applying styles when the screen width is wider than the <code>md</code> breakpoint:
</p>
<CodeBlock className="language-scss">
{'@media (--pgn-size-breakpoint-min-width-md) { // styles here }'}
</CodeBlock>
</Container>
</Layout>
);
Expand All @@ -116,6 +192,8 @@ const cellPropTypes = {
identifier: PropTypes.string,
minWidth: PropTypes.number,
maxWidth: PropTypes.number,
property: PropTypes.string,
value: PropTypes.string,
}),
}),
};
Expand All @@ -132,4 +210,10 @@ IdentifierCell.defaultProps = cellDefaultProps;
MinWidthCell.defaultProps = cellDefaultProps;
MaxWidthCell.defaultProps = cellDefaultProps;

PropertyCell.propTypes = cellPropTypes;
ValueCell.propTypes = cellPropTypes;

PropertyCell.defaultProps = cellDefaultProps;
ValueCell.defaultProps = cellDefaultProps;

export default Responsive;
Loading