-
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
Expose width and height of nimble-dialog & add tokens #1553
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7442a72
Expose width and height of nimble-dialog & add tokens
stefanc18 f1f4f45
Change files
stefanc18 832cbc4
lint
stefanc18 f316679
split into 2 stories
stefanc18 834afab
Merge branch 'main' of https://github.com/ni/nimble into users/sciuprβ¦
stefanc18 088a6a9
Merge branch 'main' of https://github.com/ni/nimble into users/sciuprβ¦
stefanc18 61867a2
style shadow dom using part
stefanc18 9a8bcb0
feedback
stefanc18 e1a9084
add usage docs
stefanc18 8b4c29e
remove margin-bottom
stefanc18 eebd05a
add padding bottom to p element
stefanc18 43ce4cb
Merge branch 'main' of https://github.com/ni/nimble into users/sciuprβ¦
stefanc18 6e3ec8c
feedback
stefanc18 e54e048
Merge branch 'main' of https://github.com/ni/nimble into users/sciuprβ¦
stefanc18 79374a6
Merge branch 'main' of https://github.com/ni/nimble into users/sciuprβ¦
stefanc18 ce9a2cb
feedback
stefanc18 703849d
fix
stefanc18 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
7 changes: 7 additions & 0 deletions
7
change/@ni-nimble-components-1e4a5579-af4c-4960-8cfc-32d8417d1a34.json
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 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "Expose width and height of nimble-dialog & add tokens", | ||
"packageName": "@ni/nimble-components", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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,46 @@ | ||
import { | ||
DocsStory, | ||
Meta, | ||
Controls, | ||
Stories, | ||
Title, | ||
Description | ||
} from '@storybook/blocks'; | ||
import * as dialogStories from './dialog.stories'; | ||
|
||
<Meta of={dialogStories} /> | ||
|
||
<Title of={dialogStories} /> | ||
<Description of={dialogStories} /> | ||
|
||
<DocsStory of={dialogStories.dialog} expanded={false} /> | ||
<Controls of={dialogStories.dialog} /> | ||
|
||
# Usage Docs | ||
|
||
<br /> | ||
|
||
## Sizing | ||
|
||
The dialog size can be customized by modyfing the width, height and max-height properties of `nimble-dialog::part(control)`. | ||
|
||
By default, the dialog is sized to be small and growable. This should be used for small dialogs like a confirmation dialog. | ||
This is equivalent of using the following style configuration: | ||
|
||
```scss | ||
nimble-dialog::part(control) { | ||
width: $ni-nimble-dialog-small-width; | ||
height: $ni-nimble-dialog-small-height; | ||
max-height: $ni-nimble-dialog-small-max-height; | ||
} | ||
``` | ||
|
||
For larger dialogs, for example a wizard-like dialog, the following style configuration should be used: | ||
|
||
```scss | ||
nimble-dialog::part(control) { | ||
width: $ni-nimble-dialog-large-width; | ||
height: $ni-nimble-dialog-large-height; | ||
max-height: $ni-nimble-dialog-large-max-height; | ||
} | ||
``` |
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
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
Oops, something went wrong.
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.
MaxHeight is a new token suffix and should be added to the list: https://github.com/ni/nimble/blob/main/packages/nimble-components/src/theme-provider/design-token-names.ts#L243
Note the comment at the top, it should come before Height in the list.
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.
FYI, that will result in you needing to add an entry here as well:
nimble/packages/nimble-components/src/theme-provider/tests/tokens.stories.ts
Line 100 in 73b899d
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.
added