-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix: Disallow invalid number of columns for narrow and medium Grids #1628
Merged
VincentSmedinga
merged 14 commits into
develop
from
fix/DES-962-grid-max-span-for-smaller-viewports
Oct 17, 2024
Merged
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
84aa8d9
fix(ts): disallow invalid cols per breakpoint
RubenSibon d43e861
Merge branch 'develop' of github.com:Amsterdam/design-system into fix…
RubenSibon 2c76c97
Merge branch 'develop' of github.com:Amsterdam/design-system into fix…
RubenSibon ffab7f5
refactor(ts): grid col number types
RubenSibon fc2b6b9
refactor(ts): grid col number types
RubenSibon 74d91cd
Merge branch 'fix/DES-962-grid-max-span-for-smaller-viewports' of git…
RubenSibon 89643ad
Merge branch 'develop' of github.com:Amsterdam/design-system into fix…
RubenSibon fff570e
Merge branch 'develop' of github.com:Amsterdam/design-system into fix…
RubenSibon aa62efb
refactor(ts): enumerate and exclusive range
RubenSibon 2bcc58e
chore(ts): 🗑️ remove unneeded type
RubenSibon c95e2d7
refactor(ts): use Range in Breakout
RubenSibon d5bcbea
refactor(ts): KISS
RubenSibon 77b7a4f
refactor(ts): KISS
RubenSibon 7e0e1e8
Merge branch 'fix/DES-962-grid-max-span-for-smaller-viewports' of git…
RubenSibon 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
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
export { Grid } from './Grid' | ||
export type { GridProps, GridColumnNumber, GridColumnNumbers } from './Grid' | ||
export type { | ||
GridColumnNumbers, | ||
GridMediumColumnNumber, | ||
GridNarrowColumnNumber, | ||
GridProps, | ||
GridWideColumnNumber, | ||
} from './Grid' | ||
export type { GridCellProps } from './GridCell' |
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.
This has overlap: 1 | 2 | 3 | 4 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | …
We discussed
Pick<>
, but that’s for object types, not literals.This may be an option:
Types that accept all three variations can keep using
GridColumnNumber
.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.
This is an alternative. The definition is more complex, but usage is simpler.
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.
Subset seems best?
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.
Well, I like how simple it is to use
Range
even if the definition is more complex.I did something similar in the experimental branch:
design-system/packages/react/src/Grid/Grid.tsx
Line 12 in 9cad4c4
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.
In the end we chose the KISS solution. :-)