mirror of
https://github.com/rio-labs/rio.git
synced 2026-05-04 09:59:16 -05:00
rename button style bold-text to colored-text
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@
|
||||
- `rio.Link` can now optionally display an icon
|
||||
- Rio will automatically create basic navigation for you, if your app has more
|
||||
than one page
|
||||
- Updated button styles: Added `bold-text` and renamed `plain` -> `plain-text`
|
||||
- Updated button styles: Added `colored-text` and renamed `plain` -> `plain-text`
|
||||
- TODO: Automatic page scan
|
||||
|
||||
## 0.9.2
|
||||
|
||||
@@ -6,7 +6,7 @@ import { markEventAsHandled } from '../eventHandling';
|
||||
|
||||
type AbstractButtonState = ComponentState & {
|
||||
shape?: 'pill' | 'rounded' | 'rectangle' | 'circle';
|
||||
style?: 'major' | 'minor' | 'bold-text' | 'plain-text';
|
||||
style?: 'major' | 'minor' | 'colored-text' | 'plain-text';
|
||||
color?: ColorSet;
|
||||
content?: ComponentId;
|
||||
is_sensitive?: boolean;
|
||||
@@ -95,7 +95,7 @@ abstract class AbstractButtonComponent extends ComponentBase {
|
||||
this.childContainer.classList.remove(
|
||||
'rio-buttonstyle-major',
|
||||
'rio-buttonstyle-minor',
|
||||
'rio-buttonstyle-bold-text',
|
||||
'rio-buttonstyle-colored-text',
|
||||
'rio-buttonstyle-plain-text'
|
||||
);
|
||||
|
||||
|
||||
@@ -1211,7 +1211,7 @@ $rio-input-box-small-label-spacing-top: 0.5rem;
|
||||
color 0.1s ease-in-out,
|
||||
border-color 0.1s ease-in-out;
|
||||
|
||||
// Create a stacking context. This is needed so the `bold-text` and
|
||||
// Create a stacking context. This is needed so the `colored-text` and
|
||||
// `plain-text` styles can reliably create an ::after element behind the
|
||||
// text.
|
||||
z-index: 0;
|
||||
@@ -1265,7 +1265,7 @@ $rio-input-box-small-label-spacing-top: 0.5rem;
|
||||
--rio-local-text-color: var(--rio-global-disabled-bg) !important;
|
||||
}
|
||||
|
||||
.rio-buttonstyle-bold-text {
|
||||
.rio-buttonstyle-colored-text {
|
||||
--rio-local-text-color: var(--rio-local-bg);
|
||||
}
|
||||
|
||||
@@ -1273,7 +1273,7 @@ $rio-input-box-small-label-spacing-top: 0.5rem;
|
||||
--rio-local-text-color: var(--outer-text-color);
|
||||
}
|
||||
|
||||
.rio-buttonstyle-bold-text:hover,
|
||||
.rio-buttonstyle-colored-text:hover,
|
||||
.rio-buttonstyle-plain-text:hover {
|
||||
cursor: pointer;
|
||||
--rio-local-text-color: var(--rio-local-bg);
|
||||
|
||||
@@ -48,7 +48,7 @@ class Button(Component):
|
||||
|
||||
- `"major"`: A highly visible button with bold visuals.
|
||||
- `"minor"`: A less visible button that doesn't stand out.
|
||||
- `"bold-text"`: A minimalistic button with bold text.
|
||||
- `"colored-text"`: A minimalistic button with bold text.
|
||||
- `"plain-text"`: A button with no background or border. Use this to
|
||||
blend less important buttons into the background.
|
||||
|
||||
@@ -113,7 +113,7 @@ class Button(Component):
|
||||
_: KW_ONLY
|
||||
icon: str | None = None
|
||||
shape: Literal["pill", "rounded", "rectangle"] = "pill"
|
||||
style: Literal["major", "minor", "bold-text", "plain-text", "plain"] = (
|
||||
style: Literal["major", "minor", "colored-text", "plain-text", "plain"] = (
|
||||
"major"
|
||||
)
|
||||
color: rio.ColorSet = "keep"
|
||||
@@ -163,7 +163,7 @@ class Button(Component):
|
||||
margin_y=CHILD_MARGIN_Y if n_children == 1 else None,
|
||||
style=(
|
||||
rio.TextStyle(font_weight="bold")
|
||||
if self.style in ("major", "bold-text")
|
||||
if self.style in ("major", "colored-text")
|
||||
else "text"
|
||||
),
|
||||
selectable=False,
|
||||
@@ -208,7 +208,7 @@ class _ButtonInternal(FundamentalComponent):
|
||||
on_press: rio.EventHandler[[]]
|
||||
content: rio.Component
|
||||
shape: Literal["pill", "rounded", "rectangle", "circle"]
|
||||
style: Literal["major", "minor", "bold-text", "plain-text", "plain"] = (
|
||||
style: Literal["major", "minor", "colored-text", "plain-text", "plain"] = (
|
||||
"major"
|
||||
)
|
||||
color: rio.ColorSet
|
||||
|
||||
@@ -207,7 +207,7 @@ class DateInput(Component):
|
||||
),
|
||||
rio.Button(
|
||||
"Cancel",
|
||||
style="bold-text",
|
||||
style="colored-text",
|
||||
on_press=self._on_close,
|
||||
),
|
||||
margin=1,
|
||||
|
||||
@@ -44,7 +44,7 @@ class IconButton(Component):
|
||||
|
||||
- `"major"`: A highly visible button with bold visuals.
|
||||
- `"minor"`: A less visible button that doesn't stand out.
|
||||
- `"bold-text"`: A minimalistic button with bold text.
|
||||
- `"colored-text"`: A minimalistic button with bold text.
|
||||
- `"plain-text"`: A button with no background or border. Use this to
|
||||
blend less important buttons into the background.
|
||||
|
||||
@@ -109,7 +109,7 @@ class IconButton(Component):
|
||||
|
||||
icon: str
|
||||
_: KW_ONLY
|
||||
style: Literal["major", "minor", "bold-text", "plain-text", "plain"]
|
||||
style: Literal["major", "minor", "colored-text", "plain-text", "plain"]
|
||||
color: rio.ColorSet
|
||||
is_sensitive: bool
|
||||
min_size: float
|
||||
@@ -120,7 +120,7 @@ class IconButton(Component):
|
||||
icon: str,
|
||||
*,
|
||||
style: Literal[
|
||||
"major", "minor", "bold-text", "plain-text", "plain"
|
||||
"major", "minor", "colored-text", "plain-text", "plain"
|
||||
] = "major",
|
||||
color: rio.ColorSet = "keep",
|
||||
is_sensitive: bool = True,
|
||||
@@ -188,7 +188,7 @@ class IconButton(Component):
|
||||
|
||||
class _IconButtonInternal(FundamentalComponent):
|
||||
content: rio.Component
|
||||
style: Literal["major", "minor", "bold-text", "plain-text", "plain"]
|
||||
style: Literal["major", "minor", "colored-text", "plain-text", "plain"]
|
||||
color: rio.ColorSet
|
||||
is_sensitive: bool
|
||||
on_press: rio.EventHandler[[]]
|
||||
|
||||
@@ -43,7 +43,7 @@ def default_fallback_build(sess: rio.Session) -> rio.Component:
|
||||
rio.Button(
|
||||
"Take me home",
|
||||
icon="material/arrow_back",
|
||||
style="bold-text",
|
||||
style="colored-text",
|
||||
on_press=lambda: sess.navigate_to("/"),
|
||||
),
|
||||
spacing=3,
|
||||
|
||||
@@ -258,7 +258,7 @@ class IconsPage(rio.Component):
|
||||
rio.IconButton(
|
||||
full_name,
|
||||
style=(
|
||||
"bold-text"
|
||||
"colored-text"
|
||||
if variant == self.selected_variant
|
||||
else "plain-text"
|
||||
),
|
||||
@@ -366,7 +366,7 @@ Use the `rio.Icon` component like this:
|
||||
results.append(
|
||||
rio.IconButton(
|
||||
icon_identifier,
|
||||
style="bold-text" if is_selected else "plain-text",
|
||||
style="colored-text" if is_selected else "plain-text",
|
||||
on_press=functools.partial(
|
||||
self._on_select_icon,
|
||||
icon_set,
|
||||
|
||||
@@ -79,7 +79,7 @@ class SampleIconsGrid(rio.Component):
|
||||
rio.Button(
|
||||
"Randomize",
|
||||
icon="material/refresh",
|
||||
style="bold-text",
|
||||
style="colored-text",
|
||||
on_press=self._on_randomize,
|
||||
align_y=0.5,
|
||||
),
|
||||
|
||||
+2
-2
@@ -2827,13 +2827,13 @@ a.remove();
|
||||
rio.Button(
|
||||
yes_text,
|
||||
color=yes_color,
|
||||
style="major" if default is True else "bold-text",
|
||||
style="major" if default is True else "colored-text",
|
||||
on_press=lambda: dialog.close(True),
|
||||
),
|
||||
rio.Button(
|
||||
no_text,
|
||||
color=no_color,
|
||||
style="major" if default is True else "bold-text",
|
||||
style="major" if default is True else "colored-text",
|
||||
on_press=lambda: dialog.close(False),
|
||||
),
|
||||
spacing=inner_margin,
|
||||
|
||||
@@ -142,7 +142,7 @@ class TicTacToePage(rio.Component):
|
||||
rio.Button(
|
||||
"Reset",
|
||||
icon="material/refresh",
|
||||
style="bold-text",
|
||||
style="colored-text",
|
||||
on_press=self.on_reset,
|
||||
),
|
||||
spacing=2,
|
||||
|
||||
@@ -74,7 +74,7 @@ class TicTacToePage(rio.Component):
|
||||
rio.Button(
|
||||
"Reset",
|
||||
icon="material/refresh",
|
||||
style="bold-text",
|
||||
style="colored-text",
|
||||
on_press=self.on_reset,
|
||||
),
|
||||
spacing=2,
|
||||
|
||||
@@ -139,7 +139,7 @@ class TicTacToePage(rio.Component):
|
||||
rio.Button(
|
||||
"Reset",
|
||||
icon="material/refresh",
|
||||
style="bold-text",
|
||||
style="colored-text",
|
||||
on_press=self.on_reset,
|
||||
),
|
||||
spacing=2,
|
||||
|
||||
Reference in New Issue
Block a user