Conversation
|
Out of all of these, the most important ones are:
As for border radii, lines, sizes, etc, those are less important. If they're hard to do, we can probably skip (need to see it live!) |
karriebear
left a comment
There was a problem hiding this comment.
Here's some initial comments on the components. I assume the styles will get updated based on product comments and can take a look at the styling after
| export enum Kind { | ||
| PRIMARY = "primary", | ||
| SECONDARY = "secondary", | ||
| } |
There was a problem hiding this comment.
Curious why we have this? BaseUI's KIND enum has these + 2 more and in Modal.tsx we're using both enums
There was a problem hiding this comment.
This is more a precursor to the Button migration and preparation for a design system. We talked about this for the Alert conversion to have our own enum instead of using BaseWeb. I was migrating the same stuff. Since we only use two versions, I didn't add more, but we can certainly in the future
| const primary = SCSS_VARS.$primary | ||
| const primaryA50 = SCSS_VARS["$primary-a50"] | ||
| const textMargin = SCSS_VARS["$font-size-sm"] | ||
| const white = SCSS_VARS.$white |
There was a problem hiding this comment.
It could just be my preference but I didn't like doing this so I made the colors from widgetTheme exportable. If you pull in latest you can use that instead of reassigning values here.
| function ModalHeader({ children }: ModalHeaderProps): ReactElement { | ||
| return ( | ||
| <UIModalHeader> | ||
| <span className="ModalTitle">{children}</span> |
There was a problem hiding this comment.
According to our styleguide, we like camelCasing though that could all change
There was a problem hiding this comment.
Awesome. I'll make the change to conform for now.
| }, | ||
| } | ||
|
|
||
| const buttonKind = isPrimary ? KIND.primary : KIND.tertiary |
There was a problem hiding this comment.
Not sure if it's me but using tertiary here seems weird 🤷♀️ probably because I don't think we have a tertiary style in our brand. I think we can probably leave it and then when we do a whole design pass through, we can clean it up.
More of a FYI, the default minimal button kind matches tertiary. Not sure if that makes it better or worse but I'm using minimal for some fun icon buttons
There was a problem hiding this comment.
Wasn't sure where this goes (this comment or the one above). I think this is weird with the future proofing we're in the process of but I could live with this in the meantime. Linking to #1860?
There was a problem hiding this comment.
That sounds reasonable. I chose tertiary, cause visually it matches what we are looking for.
|
|
||
| function ModalButton({ | ||
| children, | ||
| kind, |
There was a problem hiding this comment.
Should we change this to isPrimary? It seems we don't actually care what kind of button, only if it's primary or not. Knowing that we overwrite this if it's not primary makes it odd when you declare a different kind of button like here
Or perhaps the thing to do is to update the buttonSecondary colors so that when we say we want secondary, we get secondary.
Sorry a lot of comment overlap between here and 👇 ☝️
There was a problem hiding this comment.
I guess I was future proofing it to support multiple kinds. Baseweb supports 4 kinds, and we may want to support all 4 as well. In addition, I think if we use ModalButton as essentially a Button with that margin update, I'd like their interface to be the same.
|
This looks to also fixes #1740 |
karriebear
left a comment
There was a problem hiding this comment.
Looks good. Can't wait to see everything transitioned over!
The only comment that gives me some concern is the one regarding class nesting for VideoRecordedDialog but not sure how that ties into the overall styling work that's going to happen. Risk of an issue arising in the meantime is pretty low.
|
|
||
| // The c key clears the cache. | ||
| c: (): void => this.openClearCacheDialog(), | ||
| CLEAR_CACHE: (): void => this.openClearCacheDialog(), |
There was a problem hiding this comment.
not annoying enough since keyMap is right above but the comments could be updated as well. more of a nice to have
| }, | ||
| } | ||
|
|
||
| const buttonKind = isPrimary ? KIND.primary : KIND.tertiary |
There was a problem hiding this comment.
Wasn't sure where this goes (this comment or the one above). I think this is weird with the future proofing we're in the process of but I could live with this in the meantime. Linking to #1860?
|
|
||
| @import "src/assets/css/theme"; | ||
|
|
||
| .streamlit-dialog.screencast { |
There was a problem hiding this comment.
I'm not sure this is the right move? While this is imported specifically in the VideoRecordedDialog component, this still gets compiled into a css file for the page. It does not look like we do [the fancy webpack term] with dynamic loading. With this change, these styles would then get applied to all other modal bodies. While most of them either make sense globally or is random enough, .download-button could be problematic in the future. If we do prefer this to ax the .streamlit-dialog.screencast parent, I would vote to move this into our assets folder instead for future developers to not go wondering why does my download-button have a margin-top though whole other topic you'll be addressing :)
There was a problem hiding this comment.
oh. you're probably right. Let me relook into this.
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ |
There was a problem hiding this comment.
I think we can ax this file? 50% of this looks like it's covered in our body default, BaseWeb's theme and/or JS. Given that we're doing styling in JS also, can we standardize one way or the other? Fine to leave as is if this is a transitional state.
There was a problem hiding this comment.
Yes. That's easy to address.
| } | ||
| .first-column, | ||
| .second-column, | ||
| .third-columnd { |
There was a problem hiding this comment.
sorry missed this on the first pass but also it's been like this so not sure if fixing the typo will actually cause more grief or not... the component itself does not have the typo so i guess we've been living without some y padding 🤷
| .third-columnd { | |
| .third-column { |
|
Looks amazing! Some final comments, no need to do another product pass once fixed: |
|
Thanks @tvst ! Modals do not have any theme variables. I think Buttons may have some, and we do use some, but we have a rich override set that does most of the work. In terms of Styletron, we are actually overriding the styles of these components, which is the only available way to override these. I think we haven't committed to a styled component engine. The truth is while Baseweb is great, I do not think we see a long term future in it. We do a lot of overrides that make the work more brittle. It's an open discussion though, so we didn't put much effort using it right now. If that changes, that will fall under the conforming to the style guide part of the project. |
* develop: Migrate Modal to Baseweb (streamlit#1930) Update bl dependency to resolve CVE (streamlit#1965) Force reinstall of setuptools to 49.6.0 (streamlit#1962) ComponentInstance unit tests (streamlit#1956) Update change log Fix alignment of `.. output::` command in st.write() (streamlit#1955) Fix alignment of `.. output::` command in st.write() (streamlit#1955) Add spacing to slider docs Up version to 0.66.0 Switch statement to include ArrowTable (streamlit#1951) Remove st.write from unsupported in sidebar (streamlit#1952) Remove st.write from unsupported in sidebar (streamlit#1952) Switch statement to include ArrowTable (streamlit#1951) Add deprecation label to st.deck_gl_chart (streamlit#1943) Pin setuptools to <= 49.6.0 (streamlit#1944) DuplicateWidgetID error message should surface widget name (streamlit#1942) Set z-index of balloons to 1000000 to allow it to display over other elements. (streamlit#1934)








Issue: #1862
Description:
Migrate Modal from Reactstrap to Baseweb
Before


















After
Before
After
Modal needed a header to make things look consistent and work visually.
Before
After
Before
After
Before
After
Before
After
Before
After
Before
After
Before
After
Made the modal a little wider
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.