Skip to content

Commit 419db53

Browse files
wchcpsievert
andauthored
Update JS/CSS from shiny and bslib (#1617)
Co-authored-by: Carson <[email protected]>
1 parent 11d3e94 commit 419db53

24 files changed

+7567
-7642
lines changed

shiny/_versions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
shiny_html_deps = "1.8.1.9001"
2-
bslib = "0.7.0.9000"
1+
shiny_html_deps = "1.9.1.9000"
2+
bslib = "0.8.0.9000"
33
htmltools = "0.5.8.9000"
44
bootstrap = "5.3.1"
55
requirejs = "2.3.6"

shiny/ui/busy_indicators.py

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pathlib import Path
55
from typing import get_args
66

7-
from htmltools import Tag, TagChild, TagList, tags
7+
from htmltools import TagChild, TagList, tags
88

99
from .._docstring import add_example, no_example
1010
from .._utils import private_random_int
@@ -25,6 +25,8 @@ def options(
2525
spinner_size: str | None = None,
2626
spinner_delay: str | None = None,
2727
spinner_selector: str | None = None,
28+
fade_opacity: float | None = None,
29+
fade_selector: str | None = None,
2830
pulse_background: str | None = None,
2931
pulse_height: str | None = None,
3032
pulse_speed: str | None = None,
@@ -64,6 +66,12 @@ def options(
6466
A character string containing a CSS selector for scoping the spinner
6567
customization. The default (`None`) will apply the spinner customization to the
6668
parent element of the spinner.
69+
fade_opacity
70+
The opacity (a number between 0 and 1) for recalculating output. Set to 1 to
71+
"disable" the fade.
72+
fade_selector
73+
A string containing a CSS selector for scoping the fade customization. The
74+
default (`None`) applies the fade customization to the parent element.
6775
pulse_background
6876
A CCS background definition for the pulse. The default uses a
6977
[linear-gradient](https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient)
@@ -86,6 +94,7 @@ def options(
8694
delay=spinner_delay,
8795
selector=spinner_selector,
8896
),
97+
fade_options(opacity=fade_opacity, selector=fade_selector),
8998
pulse_options(
9099
background=pulse_background,
91100
height=pulse_height,
@@ -157,8 +166,26 @@ def pulse_options(
157166
return tags.style(":root {" + css_vars + "}")
158167

159168

169+
def fade_options(
170+
*,
171+
opacity: float | None = None,
172+
selector: str | None = None,
173+
) -> TagChild:
174+
if opacity is None and selector is None:
175+
return None
176+
177+
css_vars = f"--shiny-fade-opacity: {opacity};" if opacity else ""
178+
179+
id = None
180+
if selector is None:
181+
id = f"fade-options-{private_random_int(1000, 1000000)}"
182+
selector = f":has(> #{id})"
183+
184+
return tags.style(f"{selector} {{ {css_vars} }}", id=id)
185+
186+
160187
@no_example()
161-
def use(*, spinners: bool = True, pulse: bool = True) -> Tag:
188+
def use(*, spinners: bool = True, pulse: bool = True, fade: bool = True) -> TagList:
162189
"""
163190
Enable/disable busy indication
164191
@@ -175,6 +202,9 @@ def use(*, spinners: bool = True, pulse: bool = True) -> Tag:
175202
pulse
176203
Whether to show a pulsing banner at the top of the page when the app is
177204
busy.
205+
fade
206+
Whether to fade recalculating outputs. A value of `False` is equivalent to
207+
`shiny.ui.busy_indicators.options(fade_opacity=1)`.
178208
179209
Note
180210
----
@@ -198,4 +228,7 @@ def use(*, spinners: bool = True, pulse: bool = True) -> Tag:
198228
else:
199229
js += f"delete document.documentElement.dataset.{key};"
200230

201-
return tags.script(js)
231+
return TagList(
232+
tags.script(js),
233+
None if fade else fade_options(opacity=1),
234+
)

shiny/www/shared/_version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"note!": "Generated by scripts/htmlDependencies.R: do not edit by hand",
33
"package": "shiny",
4-
"version": "1.8.1.9001 (rstudio/shiny@0b7fda707e4846d2de06f63db312ac35dacf503a)"
4+
"version": "1.9.1.9000 (rstudio/shiny@d84aa94762b4ffaf7533a007b6cb92c40f4f29af)"
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"note!": "Generated by scripts/htmlDependencies.R: do not edit by hand",
3-
"shiny_version": "1.8.1.9001 (rstudio/shiny@0b7fda707e4846d2de06f63db312ac35dacf503a)",
4-
"bslib_version": "0.7.0.9000 (rstudio/bslib@fd5c97de3b6957c6effb295f24e1739ef6f3709f)",
3+
"shiny_version": "1.9.1.9000 (rstudio/shiny@d84aa94762b4ffaf7533a007b6cb92c40f4f29af)",
4+
"bslib_version": "0.8.0.9000 (rstudio/bslib@556e932e5275dd2a64bf7544999abdafcf807e30)",
55
"htmltools_version": "0.5.8.9000 (rstudio/htmltools@487aa0bed7313d7597b6edd5810e53cab0061198)",
66
"bootstrap_version": "5.3.1"
77
}

shiny/www/shared/bootstrap/bootstrap.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"note!": "Generated by scripts/htmlDependencies.R: do not edit by hand",
33
"package": "bslib",
4-
"version": "0.7.0.9000 (rstudio/bslib@fd5c97de3b6957c6effb295f24e1739ef6f3709f)"
4+
"version": "0.8.0.9000 (rstudio/bslib@556e932e5275dd2a64bf7544999abdafcf807e30)"
55
}

shiny/www/shared/bslib/components/components.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shiny/www/shared/bslib/components/components.min.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shiny/www/shared/bslib/components/web-components.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shiny/www/shared/bslib/components/web-components.min.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)