Skip to content

Commit bf55207

Browse files
glsdowntcbegley
andauthored
Documentation improvements (#747)
* Add details about icon CDN versions * Include info on python as default * Improve clarity * Improve dropdown documentation * Change fade to start faded * Fixed card image top bottom * Added justify evenly * Fixed form docs styling * Fixed input docs styling * Fixed spinner docs styling * Improved nav example * Added active style tab styling example * Make toast start closed * Improved card examples * Added faqs * Improved layout examples * Fix test * Restructure horizontal example * Format R and JL doc examples * Dash for R v1 changes * Fix R tests * Run CI Co-authored-by: tcbegley <tomcbegley@gmail.com>
1 parent 0e83a87 commit bf55207

File tree

168 files changed

+671
-639
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+671
-639
lines changed

docs/components_page/components/__tests__/test_fade.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,28 @@ def test_jl_fade(dashjl):
2323

2424

2525
def check_fade_callbacks(runner):
26+
# Check the fade element is present
2627
assert runner.find_element("#fade") != []
28+
29+
# Make sure it starts hidden
30+
wait.until(
31+
lambda: runner.find_element("#fade").get_attribute("style")
32+
== "visibility: hidden;",
33+
timeout=4,
34+
)
35+
36+
# Click the button and it should show
2737
runner.find_element("#fade-button").click()
38+
39+
wait.until(
40+
lambda: runner.find_element("#fade").get_attribute("style")
41+
!= "visibility: hidden;",
42+
timeout=4,
43+
)
44+
45+
# Click the button and it should hide
46+
runner.find_element("#fade-button").click()
47+
2848
wait.until(
2949
lambda: runner.find_element("#fade").get_attribute("style")
3050
== "visibility: hidden;",

docs/components_page/components/__tests__/test_tabs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def check_tabs_card_callbacks(runner):
4242
tab1_content <- dbcCard(
4343
dbcCardBody(
4444
list(
45-
htmlP("This is tab 1!", className = "card-text"),
45+
p("This is tab 1!", className = "card-text"),
4646
dbcButton("Click here", color = "success")
4747
)
4848
),
@@ -52,7 +52,7 @@ def check_tabs_card_callbacks(runner):
5252
tab2_content <- dbcCard(
5353
dbcCardBody(
5454
list(
55-
htmlP("This is tab 2!", className = "card-text"),
55+
p("This is tab 2!", className = "card-text"),
5656
dbcButton("Don't click here", color = "danger")
5757
)
5858
),

docs/components_page/components/__tests__/test_toast.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ def test_jl_toast_icon(dashjl):
5252

5353
def check_toast_icon_callbacks(runner):
5454

55+
# Click the button to show the toast
56+
runner.find_element("#simple-toast-toggle").click()
57+
58+
wait.until(
59+
lambda: len(runner.find_elements("#simple-toast")) > 0,
60+
timeout=4,
61+
)
62+
63+
# Check the right classes are showing
5564
wait.until(
5665
lambda: len(
5766
{"toast", "fade", "show"}
@@ -65,16 +74,10 @@ def check_toast_icon_callbacks(runner):
6574
timeout=4,
6675
)
6776

77+
# Click the button to dismiss the toast
6878
runner.find_element("button.btn-close").click()
6979

7080
wait.until(
7181
lambda: len(runner.find_elements("#simple-toast")) == 0,
7282
timeout=4,
7383
)
74-
75-
runner.find_element("#simple-toast-toggle").click()
76-
77-
wait.until(
78-
lambda: len(runner.find_elements("#simple-toast")) > 0,
79-
timeout=4,
80-
)

docs/components_page/components/__tests__/wrappers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
R_WRAPPER = """
1414
library(dash)
1515
library(dashBootstrapComponents)
16-
library(dashHtmlComponents)
1716
1817
app <- Dash$new(external_stylesheets = dbcThemes$BOOTSTRAP)
1918
2019
{snippet}
2120
22-
app$layout(htmlDiv(list({components})))
21+
app$layout(div(list({components})))
2322
app$run_server(port = {port})
2423
"""
2524

docs/components_page/components/accordion/callback.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
library(dashBootstrapComponents)
2-
library(dashCoreComponents)
3-
library(dashHtmlComponents)
42

5-
accordion <- htmlDiv(
3+
accordion <- div(
64
list(
75
dbcAccordion(
86
list(
@@ -25,7 +23,7 @@ accordion <- htmlDiv(
2523
id = "accordion",
2624
active_item = "item-1"
2725
),
28-
htmlDiv(id = "accordion-contents", className = "mt-3")
26+
div(id = "accordion-contents", className = "mt-3")
2927
)
3028
)
3129

docs/components_page/components/accordion/collapsed.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
library(dashBootstrapComponents)
2-
library(dashHtmlComponents)
32

4-
accordion <- htmlDiv(
3+
accordion <- div(
54
dbcAccordion(
65
list(
76
dbcAccordionItem(

docs/components_page/components/accordion/flush.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
library(dashBootstrapComponents)
2-
library(dashHtmlComponents)
32

4-
accordion <- htmlDiv(
3+
accordion <- div(
54
dbcAccordion(
65
list(
76
dbcAccordionItem(

docs/components_page/components/accordion/simple.R

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
library(dashBootstrapComponents)
2-
library(dashCoreComponents)
3-
library(dashHtmlComponents)
42

5-
accordion <- htmlDiv(
3+
accordion <- div(
64
dbcAccordion(
75
list(
86
dbcAccordionItem(
97
list(
10-
htmlP("This is the content of the first section"),
8+
p("This is the content of the first section"),
119
dbcButton("Click here")
1210
),
1311
title = "Item 1"
1412
),
1513
dbcAccordionItem(
1614
list(
17-
htmlP("This is the content of the second section"),
15+
p("This is the content of the second section"),
1816
dbcButton("Don't click me!", color = "danger")
1917
),
2018
title = "Item 2"

docs/components_page/components/alert/auto_dismiss.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
library(dashBootstrapComponents)
2-
library(dashHtmlComponents)
32

4-
alert <- htmlDiv(
3+
alert <- div(
54
list(
65
dbcButton("Toggle",
76
id = "alert-toggle-auto", className = "me-1",
87
n_clicks = 0
98
),
10-
htmlHr(),
9+
html$hr(),
1110
dbcAlert(
1211
"Hello! I am an auto-dismissing alert!",
1312
id = "alert-auto",
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
library(dashBootstrapComponents)
2-
library(dashHtmlComponents)
32

43
alert <- dbcAlert(
54
list(
6-
htmlH4("Well done!", className = "alert-heading"),
7-
htmlP(
5+
h4("Well done!", className = "alert-heading"),
6+
p(
87
paste(
98
"This is a success alert with loads of extra text in it. So much",
109
"that you can see how spacing within an alert works with this",
1110
"kind of content."
1211
)
1312
),
14-
htmlHr(),
15-
htmlP(
13+
html$hr(),
14+
p(
1615
"Let's put some more text down here, but remove the bottom margin",
17-
className = "mb-0",
16+
className = "mb-0"
1817
)
1918
)
2019
)

0 commit comments

Comments
 (0)