diff --git a/README.md b/README.md index 32e18502..895bc737 100644 --- a/README.md +++ b/README.md @@ -95,12 +95,12 @@ You'll have your first app up and running in seconds! ## Status: Beta 🚧 -Rio is rapidly approaching its first stable release. Version 0.9.3 incoroparates +Rio is rapidly approaching its first stable release. Version 0.10 incoroparates all _planned_ breaking changes. Minor changes may still occur, but we are actively trying to avoid them. If you encounter any issues or would like to provide feedback, please let us -know on [our Discord server](https://discord.gg/7ejXaPwhyH). --> +know on [our Discord server](https://discord.gg/7ejXaPwhyH). 1.0 is expected later this year. diff --git a/changelog.md b/changelog.md index 016d548a..3f2da470 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,7 @@ # Changelog - `rio.Dropdown` will now open a fullscreen popup on mobile devices -- `riol.MediaPlayer` now also triggers the `on_playback_end` event when the +- `rio.MediaPlayer` now also triggers the `on_playback_end` event when the video loops - experimental support for base-URL - dialogs! diff --git a/frontend/code/components/textInput.ts b/frontend/code/components/textInput.ts index eb338145..3f013ca9 100644 --- a/frontend/code/components/textInput.ts +++ b/frontend/code/components/textInput.ts @@ -8,6 +8,7 @@ export type TextInputState = ComponentState & { text?: string; label?: string; accessibility_label?: string; + style?: 'rectangular' | 'pill'; prefix_text?: string; suffix_text?: string; is_secret?: boolean; @@ -152,6 +153,21 @@ export class TextInputComponent extends ComponentBase { if (deltaState.is_valid !== undefined) { this.inputBox.isValid = deltaState.is_valid; } + + // TODO: This isn't exposed to Python yet, so pretend the attribute + // exists by setting it here. + deltaState.style = 'rectangular'; + + if (deltaState.style !== undefined) { + this.element.classList.remove( + 'rio-input-box-style-rectangle', + 'rio-input-box-style-pill' + ); + + this.element.classList.add( + `rio-input-box-style-${this.state.style}` + ); + } } grabKeyboardFocus(): void { diff --git a/frontend/css/style.scss b/frontend/css/style.scss index b2d55f23..a2b96447 100644 --- a/frontend/css/style.scss +++ b/frontend/css/style.scss @@ -556,12 +556,24 @@ $rio-input-box-small-label-spacing-top: 0.5rem; align-items: stretch; background-color: var(--rio-local-bg-variant); - border-radius: var(--rio-global-corner-radius-small) - var(--rio-global-corner-radius-small) 0 0; transition: background-color 0.1s linear; } +.rio-input-box-style-rectangular { + border-radius: var(--rio-global-corner-radius-small) + var(--rio-global-corner-radius-small) 0 0; +} + +.rio-input-box-style-pill { + border-radius: $infinite-corner-radius; + + & > .rio-input-box-plain-bar, + & > .rio-input-box-color-bar { + display: none; + } +} + .rio-input-box:hover:not(.rio-insensitive) { background-color: var(--rio-local-bg-active); } diff --git a/rio/__init__.py b/rio/__init__.py index f1c6b5f9..8e989052 100644 --- a/rio/__init__.py +++ b/rio/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.9.3rc3" +__version__ = "0.10" # There is an issue with `rye test`. rye passes a `--rootdir` argument to diff --git a/rio/components/button.py b/rio/components/button.py index b2e93f4b..f3350633 100644 --- a/rio/components/button.py +++ b/rio/components/button.py @@ -218,7 +218,7 @@ class _ButtonInternal(FundamentalComponent): def _custom_serialize_(self) -> JsonDoc: if self.style == "plain": deprecations.warn( - since="0.9.3", + since="0.10", message=( "The `plain` button style has been renamed to `plain-text`. Please use the new name instead." ), diff --git a/rio/components/component.py b/rio/components/component.py index 09afe367..ae59e86e 100644 --- a/rio/components/component.py +++ b/rio/components/component.py @@ -340,7 +340,7 @@ class Component(abc.ABC, metaclass=ComponentMeta): pass else: deprecations.warn( - since="0.9.3", + since="0.10", message="The `width` attribute of `rio.Component` has been removed. Please use `min_width` and `grow_x` instead.", ) @@ -359,7 +359,7 @@ class Component(abc.ABC, metaclass=ComponentMeta): pass else: deprecations.warn( - since="0.9.3", + since="0.10", message="The `height` attribute of `rio.Component` has been removed. Please use `min_height` and `grow_y` instead.", ) diff --git a/rio/components/icon_button.py b/rio/components/icon_button.py index 3b1601ff..66ff078d 100644 --- a/rio/components/icon_button.py +++ b/rio/components/icon_button.py @@ -16,7 +16,7 @@ __all__ = ["IconButton"] @final @deprecations.component_kwarg_renamed( - since="0.9.3", + since="0.10", old_name="size", new_name="min_size", ) @@ -197,7 +197,7 @@ class _IconButtonInternal(FundamentalComponent): def _custom_serialize_(self) -> JsonDoc: if self.style == "plain": deprecations.warn( - since="0.9.3", + since="0.10", message=( "The `plain` button style has been renamed to `plain-text`. Please use the new name instead." ), diff --git a/rio/components/markdown.py b/rio/components/markdown.py index 4836e2f3..64c6aa75 100644 --- a/rio/components/markdown.py +++ b/rio/components/markdown.py @@ -76,7 +76,7 @@ class Markdown(FundamentalComponent): # value. if self.wrap is not True: deprecations.warn_parameter_renamed( - since="0.9.3", + since="0.10", old_name="wrap", new_name="overflow", owner="rio.Markdown", diff --git a/rio/components/progress_circle.py b/rio/components/progress_circle.py index 62ad0a6d..97ea5a7f 100644 --- a/rio/components/progress_circle.py +++ b/rio/components/progress_circle.py @@ -14,7 +14,7 @@ __all__ = [ @final @deprecations.component_kwarg_renamed( - since="0.9.3", + since="0.10", old_name="size", new_name="min_size", ) diff --git a/rio/components/text.py b/rio/components/text.py index f54f17b9..2c4690bd 100644 --- a/rio/components/text.py +++ b/rio/components/text.py @@ -94,7 +94,7 @@ class Text(FundamentalComponent): # value. if self.wrap is not False: deprecations.warn_parameter_renamed( - since="0.9.3", + since="0.10", old_name="wrap", new_name="overflow", owner="rio.Markdown", diff --git a/rio/icon_registry.py b/rio/icon_registry.py index 7c7f3a87..50ee243d 100644 --- a/rio/icon_registry.py +++ b/rio/icon_registry.py @@ -272,9 +272,7 @@ def register_icon_set( See the docs of `Icon.register_icon_set`. """ if set_name in icon_set_archives: - raise ValueError( - f"There is already an icon set named `{set_name}`" - ) + raise ValueError(f"There is already an icon set named `{set_name}`") icon_set_archives[set_name] = set_archive_path diff --git a/rio/routing.py b/rio/routing.py index 7885c30d..b40631d4 100644 --- a/rio/routing.py +++ b/rio/routing.py @@ -197,7 +197,7 @@ def _new_component_page_init(self, *args, **kwargs) -> None: # Rename the parameter if "page_url" in kwargs: deprecations.warn_parameter_renamed( - since="0.9.3", + since="0.10", old_name="page_url", new_name="url_segment", owner="rio.ComponentPage", @@ -214,7 +214,7 @@ ComponentPage.__init__ = _new_component_page_init @introspection.set_signature(ComponentPage) def Page(*args, **kwargs): deprecations.warn( - since="0.9.3", + since="0.10", message="`rio.Page` has been renamed to `rio.ComponentPage`", ) return ComponentPage(*args, **kwargs) diff --git a/rio/session.py b/rio/session.py index 9ea8b577..dd7ef10e 100644 --- a/rio/session.py +++ b/rio/session.py @@ -2042,7 +2042,7 @@ window.history.{method}(null, "", {json.dumps(active_page_url.path)}) ) -> list[utils.FileInfo]: ... @deprecations.function_kwarg_renamed( - since="0.9.3", + since="0.10", old_name="file_extension", new_name="file_types", ) @@ -2113,7 +2113,7 @@ window.history.{method}(null, "", {json.dumps(active_page_url.path)}) ) -> list[utils.FileInfo]: ... @deprecations.function_kwarg_renamed( - since="0.9.3", + since="0.10", old_name="file_extension", new_name="file_types", ) @@ -2127,7 +2127,7 @@ window.history.{method}(null, "", {json.dumps(active_page_url.path)}) """ # Warn deprecations.warn( - since="0.9.3", + since="0.10", message="`file_chooser` has been renamed to `pick_file`. Please use the new name instead.", ) diff --git a/rio/snippets/snippet-files/tutorial-tic-tac-toe-part-3/pages/tic_tac_toe_page.py b/rio/snippets/snippet-files/tutorial-tic-tac-toe-part-3/pages/tic_tac_toe_page.py index 6d449b0a..4ec569ef 100644 --- a/rio/snippets/snippet-files/tutorial-tic-tac-toe-part-3/pages/tic_tac_toe_page.py +++ b/rio/snippets/snippet-files/tutorial-tic-tac-toe-part-3/pages/tic_tac_toe_page.py @@ -20,7 +20,7 @@ class TicTacToePage(rio.Component): for index, field in enumerate(self.fields): field_components.append( comps.Field( - value=field, + value=field, ) )