Repository navigation
[FEATURE] UI Customization. Add Grid Component - #394
Merged
jgbernalp merged 17 commits intoNov 2, 2026
Merged
Conversation
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
zhuje
force-pushed
the
zhuje/ou1609-ui-customization-grid-component
branch
2 times, most recently
from
October 28, 2026 02:00
3cef0d3 to
00b7139
Compare
zhuje
force-pushed
the
ui-customization
branch
from
October 28, 2026 20:57
f4df527 to
b67acc5
Compare
Add `Grid` and `GridItem` to `@perses-dev/components` `next` primitives as the replacement for MUI `Grid`/`Grid2`: - `Grid`: CSS grid container, `columns` (default 12, written to `--ps-grid-columns`) and `spacing` forwarded to the `gap` style prop. - `GridItem`: `size?: Responsive<number>` → `grid-column: span n` via a new `gridColumn` registry entry in `system/grid.ts` and `.ps-grid-column` rules in `system/layout.css`. - Both take spacing/sizing/overflow style props, forward refs and spread unregistered props to the `div`. - Registered in `PersesComponents`, `defaultComponents` and the primitives barrel; Ladle stories (Basic, Columns, Nested, Form layout). Audited against every MUI Grid call site in perses/shared, perses/plugins, perses/perses and openshift/monitoring-plugin; spacing is a `gap`, so the `!important` padding hacks and fractional spans are migrated by call-site changes rather than ported into the primitive. Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Nested grids and partially responsive nested items inherited the ancestor's --ps-grid-columns / --ps-grid-column* values. Declare them with @Property inherits: false so unset values fall through to the stylesheet fallbacks. Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Replace the @Property declarations (unsupported in Firefox < 128) with `--ps-grid-columns: initial` / `--ps-grid-column*: initial` resets on :where(.ps-Grid) / :where(.ps-GridItem). `initial` is the guaranteed-invalid value, so unset variables fall through to the stylesheet fallbacks in every browser; inline values from styleProps.ts still win. Also narrow GridStyle['--ps-grid-columns'] to number and document the valid GridItem size range. Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
- Drop the box-sizing declaration that duplicates the perses.reset layer. - Use the named clsx export and scope-justify the CSS side-effect imports so Grid adds no Oxlint warnings (Card pattern). - Move story presentation styles to .ladle/stories.css (.story-grid-*). - Replace an unfalsifiable paddingTop assertion with a check that the item carries no padding utility class. Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Declare `box-sizing: border-box` on `.ps-Grid` and `.ps-GridItem`, matching Box, Stack, Checkbox, Switch and Table, and flip the test to assert it is present. The design-tokens reset (`@layer perses.reset`) does set border-box on every element, but `@perses-dev/components/next/css` deliberately does not import that reset. A consumer who loads only the components CSS therefore gets content-box, and `<Grid width="100%" px="md">` overflows its container while the same props on Box and Stack do not. Also add the `@perses-dev/design-tokens/css/layers` import prelude that every primitive stylesheet must start with since #392 (layers.test.ts). Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Move the Grid story scaffolding out of .ladle/stories.css into inline CSSProperties constants in Grid.stories.tsx, matching the Box and Stack stories. No other primitive ships story-only CSS, and a co-located stylesheet under primitives/ would trip layers.test.ts. Also reword the story, test, and JSDoc copy to spell out what the breakpoint spans mean (e.g. "9 columns at md (900-1199px)") and drop stale implementation comments. Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
- Remove the `GridStyle` type so `columns` is the only way to set the column count; `--ps-grid-columns` is engine plumbing, not public API. The caller-style test now overrides `gap` and asserts `columns` wins. - Use design tokens (`--perses-border-width-sm`, `--perses-spacing-sm`) in the story presentation styles instead of raw `1px` / `0.5rem`. - Drop the MUI comparison from the public `size` JSDoc. - Use sentence case for the "Form layout" sample title. Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
…lasses Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Type style as PersesCSSProperties on GridProps and GridItemProps so the registry-derived check from #403 passes, and drop the as CSSProperties cast that only existed to smuggle --ps-grid-columns past the old type. Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
zhuje
force-pushed
the
zhuje/ou1609-ui-customization-grid-component
branch
from
October 28, 2026 21:09
00b7139 to
4c8e69d
Compare
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
jgbernalp
force-pushed
the
zhuje/ou1609-ui-customization-grid-component
branch
from
November 2, 2026 14:43
193bb79 to
7f2ed73
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds
GridandGridItemto@perses-dev/components/next, the replacement for MUI'sGrid/Grid itemin theUI customization effort (OU-1609, part of OU-1334 Phase 1).
API
Grid— a CSS-grid container.columnssets the number of equal-width columns (default12);spacingis aresponsive spacing token written to
gap. Also accepts the shared spacing, sizing andoverflowstyle props.GridItem— a cell.sizeis a responsive number of columns to span (grid-column: span n); omitted, theitem takes one column. Also accepts spacing, sizing and
overflow.className/styleon a singlediv, and are registered inPersesComponentsso apps can swap them via the provider.
Screenshots
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
See e2e docs for more details. Common issues include: