Skip to content

Commit cee9d6d

Browse files
authored
Nav & Tab docs updates, plus add Chip Input to JS bundle (#42214)
* Document data attributes * Split nav and tab docs * Fix v6 todo: reduce selectors in JS tab plugin * fix css lint * bump bw * fix ids
1 parent e9a79ea commit cee9d6d

32 files changed

Lines changed: 818 additions & 847 deletions

.bundlewatch.config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
},
3535
{
3636
"path": "./dist/js/bootstrap.bundle.js",
37-
"maxSize": "70.0 kB"
37+
"maxSize": "72.5 kB"
3838
},
3939
{
4040
"path": "./dist/js/bootstrap.bundle.min.js",
41-
"maxSize": "49.25 kB"
41+
"maxSize": "51.0 kB"
4242
},
4343
{
4444
"path": "./dist/js/bootstrap.js",
45-
"maxSize": "41.0 kB"
45+
"maxSize": "43.5 kB"
4646
},
4747
{
4848
"path": "./dist/js/bootstrap.min.js",
49-
"maxSize": "27.0 kB"
49+
"maxSize": "28.75 kB"
5050
}
5151
],
5252
"ci": {

js/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export { default as NavOverflow } from './src/nav-overflow.js'
1717
export { default as Offcanvas } from './src/offcanvas.js'
1818
export { default as Strength } from './src/strength.js'
1919
export { default as OtpInput } from './src/otp-input.js'
20+
export { default as ChipInput } from './src/chip-input.js'
2021
export { default as Popover } from './src/popover.js'
2122
export { default as ScrollSpy } from './src/scrollspy.js'
2223
export { default as Tab } from './src/tab.js'

js/src/tab.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ const NOT_SELECTOR_MENU_TOGGLE = `:not(${SELECTOR_MENU_TOGGLE})`
4343
const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]'
4444
const SELECTOR_OUTER = '.nav-item, .list-group-item'
4545
const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_MENU_TOGGLE}, .list-group-item${NOT_SELECTOR_MENU_TOGGLE}, [role="tab"]${NOT_SELECTOR_MENU_TOGGLE}`
46-
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]' // TODO: could only be `tab` in v6
46+
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"]'
4747
const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`
4848

49-
const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`
49+
const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"]`
5050

5151
/**
5252
* Class definition

site/data/plugins.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
- name: Tab
4242
description: Allow Bootstrap nav components to toggle contents.
43-
link: components/navs-tabs/
43+
link: components/tab/
4444

4545
- name: Toast
4646
description: Show and hide notifications to your visitors.

site/data/sidebar.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
pages:
110110
- title: Breadcrumb
111111
- title: Menu
112-
- title: Navs & tabs
112+
- title: Nav
113+
- title: Tab
113114
- title: Nav overflow
114115
- title: Navbar
115116
- title: Pagination

site/src/assets/examples/cheatsheet/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ export const body_class = 'bg-body-tertiary'
11181118
<article class="my-3" id="navs">
11191119
<div class="bd-heading sticky-xl-top align-self-start mt-5 mb-3 mt-xl-0 mb-xl-2">
11201120
<h3>Navs</h3>
1121-
<a class="d-flex align-items-center" href={getVersionedDocsPath('components/navs-tabs')}>Documentation</a>
1121+
<a class="d-flex align-items-center" href={getVersionedDocsPath('components/nav')}>Documentation</a>
11221122
</div>
11231123

11241124
<div>

site/src/content/docs/components/alert.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ For the sole purpose of dismissing an alert, it isn’t necessary to initialize
120120
See the [triggers](#triggers) section for more details.
121121
</Callout>
122122

123+
### Via data attributes
124+
125+
<BsTable>
126+
| Attribute | Description |
127+
| --- | --- |
128+
| `data-bs-dismiss="alert"` | On a close control, dismisses (and removes) the alert when activated. |
129+
</BsTable>
130+
123131
### Triggers
124132

125133
<JsDismiss name="alert" />

site/src/content/docs/components/button-group.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Wrap a series of buttons in `.btn-group`.
1818
Button groups require an appropriate `role` attribute and explicit label to ensure assistive technologies like screen readers identify buttons as grouped and announce them. Use `role="group"` for button groups or `role="toolbar"` for button toolbars. Then use `aria-label` or `aria-labelledby` to label them.
1919
</Callout>
2020

21-
These classes can also be added to groups of links, as an alternative to the [`.nav` navigation components]([[docsref:/components/navs-tabs]]).
21+
These classes can also be added to groups of links, as an alternative to the [`.nav` navigation components]([[docsref:/components/nav]]).
2222

2323
<Example code={`<div class="btn-group">
2424
<a href="#" class="btn-solid theme-primary active" aria-current="page">Active link</a>

site/src/content/docs/components/buttons.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,14 @@ Add `data-bs-toggle="button"` to toggle a button’s `active` state. If you’re
248248
<a href="#" class="btn-solid theme-primary active" role="button" data-bs-toggle="button" aria-pressed="true">Active toggle link</a>
249249
<a class="btn-solid theme-primary disabled" aria-disabled="true" role="button" data-bs-toggle="button">Disabled toggle link</a>`} />
250250

251+
### Via data attributes
252+
253+
<BsTable>
254+
| Attribute | Description |
255+
| --- | --- |
256+
| `data-bs-toggle="button"` | Toggles the button’s active (`pressed`) state via the Button plugin. |
257+
</BsTable>
258+
251259
### Methods
252260

253261
You can create a button instance with the button constructor, for example:

site/src/content/docs/components/card.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Use custom CSS in your stylesheets or as inline styles to set a width.
257257

258258
## Navigation
259259

260-
Add some navigation to a card’s header (or block) with Bootstrap’s [nav components]([[docsref:/components/navs-tabs]]).
260+
Add some navigation to a card’s header (or block) with Bootstrap’s [nav components]([[docsref:/components/nav]]).
261261

262262
<Example code={`<div class="card text-center">
263263
<div class="card-header">

0 commit comments

Comments
 (0)