diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ba99faaaf..8a7afb618 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,4 +1,4 @@ { - "packages/bootstrap-vue-next": "0.24.10", - "packages/nuxt": "0.24.10" + "packages/bootstrap-vue-next": "0.24.11", + "packages/nuxt": "0.24.11" } diff --git a/apps/docs/.vitepress/config.mts b/apps/docs/.vitepress/config.mts index 0a6e0841e..47c0b90ca 100644 --- a/apps/docs/.vitepress/config.mts +++ b/apps/docs/.vitepress/config.mts @@ -1,6 +1,9 @@ import {defineConfig} from 'vitepress' import Icons from 'unplugin-icons/vite' -import markdonnwItClass from '@toycode/markdown-it-class' +import markdownItClass from '@toycode/markdown-it-class' +import {demoContainer} from './plugins/demo-container' +import Components from 'unplugin-vue-components/vite' +import {BootstrapVueNextResolver} from 'bootstrap-vue-next' const title = 'BootstrapVueNext' const description = 'Quickly and Easily Integrate Bootstrap V5 Components With Vue 3' @@ -23,7 +26,16 @@ export default defineConfig({ ['meta', {property: 'twitter:description', name: 'twitter:description', content: description}], ], vite: { - plugins: [Icons()], + plugins: [ + Icons(), + Components({ + dirs: ['components', 'docs/components/demo'], + extensions: ['vue'], + dts: true, + include: [/\.vue$/, /\.vue\?vue/, /\.md$/], + resolvers: [BootstrapVueNextResolver()], + }), + ], }, locales: { root: { @@ -42,7 +54,8 @@ export default defineConfig({ }, markdown: { config: (md) => { - md.use(markdonnwItClass, {table: ['table', 'table-striped']}) + md.use(markdownItClass, {table: ['table', 'table-striped']}) + md.use(demoContainer, 'src') }, }, }) diff --git a/apps/docs/.vitepress/markdown-it-class.d.ts b/apps/docs/.vitepress/markdown-it-class.d.ts new file mode 100644 index 000000000..df32e882a --- /dev/null +++ b/apps/docs/.vitepress/markdown-it-class.d.ts @@ -0,0 +1,5 @@ +declare module '@toycode/markdown-it-class' { + import {PluginSimple} from 'markdown-it' + const markdownItClass: PluginSimple + export default markdownItClass +} diff --git a/apps/docs/.vitepress/plugins/demo-container.ts b/apps/docs/.vitepress/plugins/demo-container.ts new file mode 100644 index 000000000..356165793 --- /dev/null +++ b/apps/docs/.vitepress/plugins/demo-container.ts @@ -0,0 +1,83 @@ +import type {MarkdownEnv, MarkdownRenderer} from 'vitepress' +import type {RuleBlock} from 'markdown-it/lib/parser_block.mjs' +import path from 'path' + +// This plugin is inspired by vitepress' snippet plugin and must run before it to work +// It accepts all of the same syntax as the snippet plugin, but will render the demo +// _and_ display the example code inside of a HighlightCard component + +export const demoContainer = (md: MarkdownRenderer, srcDir: string) => { + const blockParser: RuleBlock = (state, startLine, endLine, silent) => { + const sentinal = '<<< DEMO ' + const pos = state.bMarks[startLine] + state.tShift[startLine] + const max = state.eMarks[startLine] + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false + } + + if (state.src.slice(pos, pos + sentinal.length) !== sentinal) { + return false + } + + if (silent) { + return true + } + + const start = pos + sentinal.length + const end = state.skipSpacesBack(max, pos) + + const rawPath = state.src.slice(start, end).trim().replace(/^@/, srcDir).trim() + + const {filepath, extension, region, lines, lang, title} = rawPathToToken(rawPath) + const component = title.substring(0, title.indexOf('.')) + + state.line += 1 + + const prefixToken = state.push('html_block', '', 0) + prefixToken.content = `<${component}/>` + + return true + } + + md.block.ruler.before('snippet', 'demo', blockParser) +} + +/** + * raw path format: "/path/to/file.extension#region {meta} [title]" + * where #region, {meta} and [title] are optional + * meta can be like '1,2,4-6 lang', 'lang' or '1,2,4-6' + * lang can contain special characters like C++, C#, F#, etc. + * path can be relative to the current file or absolute + * file extension is optional + * path can contain spaces and dots + * + * captures: ['/path/to/file.extension', 'extension', '#region', '{meta}', '[title]'] + */ +const rawPathRegexp = + /^(.+?(?:(?:\.([a-z0-9]+))?))(?:(#[\w-]+))?(?: ?(?:{(\d+(?:[,-]\d+)*)? ?(\S+)?}))? ?(?:\[(.+)\])?$/ + +function rawPathToToken(rawPath: string) { + const [filepath = '', extension = '', region = '', lines = '', lang = '', rawTitle = ''] = ( + rawPathRegexp.exec(rawPath) || [] + ).slice(1) + + const title = rawTitle || filepath.split('/').pop() || '' + + return {filepath, extension, region, lines, lang, title} +} diff --git a/apps/docs/package.json b/apps/docs/package.json index 7cd224e25..344904c67 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -31,6 +31,7 @@ "prettier": "^3.2.5", "typescript": "^5.4.5", "unplugin-icons": "^0.19.0", + "unplugin-vue-components": "^0.27.0", "vitepress": "1.1.4", "vue": "^3.4.27" }, diff --git a/apps/docs/src/data/components/buttonToolbar.data.ts b/apps/docs/src/data/components/buttonToolbar.data.ts index 466d96262..78fe5096c 100644 --- a/apps/docs/src/data/components/buttonToolbar.data.ts +++ b/apps/docs/src/data/components/buttonToolbar.data.ts @@ -1,5 +1,6 @@ import type {BvnComponentProps} from 'bootstrap-vue-next' import type {ComponentReference, PropertyReference} from '../../types' +import {buildCommonProps, pick} from '../../utils' export default { load: (): ComponentReference[] => [ @@ -7,25 +8,19 @@ export default { component: 'BButtonToolbar', props: { '': { - ariaLabel: { - type: 'string', - default: 'Group', - }, justify: { type: 'boolean', default: false, + description: + 'Make the toolbar span the maximum available width, by increasing spacing between the button groups, input groups and dropdowns', }, - role: { - type: 'string', - default: 'toolbar', - }, + ...pick(buildCommonProps(), ['ariaLabel', 'role']), } satisfies Record, }, slots: [ { - description: '', name: 'default', - scope: [], + description: 'Content to place in the button toolbar', }, ], emits: [], diff --git a/apps/docs/src/docs/components/breadcrumb.md b/apps/docs/src/docs/components/breadcrumb.md index b5a7b9184..e4f05e611 100644 --- a/apps/docs/src/docs/components/breadcrumb.md +++ b/apps/docs/src/docs/components/breadcrumb.md @@ -14,26 +14,7 @@ Indicate the current page’s location within a navigational hierarchy that auto ## Overview - - - - +<<< DEMO ./demo/BreadcrumbOverview.vue ## Breadcrumb items @@ -43,20 +24,7 @@ The active state of last element is automatically set if it is `undefined`. ### Breadcrumb items as array of strings - - - - +<<< DEMO ./demo/BreadcrumbAsArray.vue ## Manually placed items @@ -64,34 +32,7 @@ You may also manually place individual `BBreadcrumbItem` child components in the the `BBreadcrumb` component, as an alternative to using the `items` prop, for greater control over the content of each item: - - - - Home - - Foo - Bar - Baz - - - +<<< DEMO ./demo/BreadcrumbManual.vue Remember to set the `active` prop on the last item. @@ -103,52 +44,10 @@ Remember to set the `active` prop on the last item. Two slots are provided to put additional content before and after the breadcrumb. Use slot `prepend` to put content before the breadcrumb. Use slot `append` to put content after the breadcrumb. - - - - Home - - Foo - Bar - Baz - - - - - +<<< DEMO ./demo/BreadcrumbSlots.vue#template{vue-html} diff --git a/apps/docs/src/docs/components/demo/BreadcrumbAsArray.vue b/apps/docs/src/docs/components/demo/BreadcrumbAsArray.vue new file mode 100644 index 000000000..50de25071 --- /dev/null +++ b/apps/docs/src/docs/components/demo/BreadcrumbAsArray.vue @@ -0,0 +1,7 @@ + + + diff --git a/apps/docs/src/docs/components/demo/BreadcrumbManual.vue b/apps/docs/src/docs/components/demo/BreadcrumbManual.vue new file mode 100644 index 000000000..ca72f689b --- /dev/null +++ b/apps/docs/src/docs/components/demo/BreadcrumbManual.vue @@ -0,0 +1,15 @@ + + + diff --git a/apps/docs/src/docs/components/demo/BreadcrumbOverview.vue b/apps/docs/src/docs/components/demo/BreadcrumbOverview.vue new file mode 100644 index 000000000..740605946 --- /dev/null +++ b/apps/docs/src/docs/components/demo/BreadcrumbOverview.vue @@ -0,0 +1,14 @@ + + + diff --git a/apps/docs/src/docs/components/demo/BreadcrumbSlots.vue b/apps/docs/src/docs/components/demo/BreadcrumbSlots.vue new file mode 100644 index 000000000..04ba340fa --- /dev/null +++ b/apps/docs/src/docs/components/demo/BreadcrumbSlots.vue @@ -0,0 +1,12 @@ + diff --git a/apps/docs/src/docs/migration-guide.md b/apps/docs/src/docs/migration-guide.md index 949316807..e2c18512b 100644 --- a/apps/docs/src/docs/migration-guide.md +++ b/apps/docs/src/docs/migration-guide.md @@ -173,6 +173,11 @@ details. The `content` and `text-variant` props have been deprecated since Bootstrap 5 moved to using an embedded svg for the close icon. See [their migration guide](https://getbootstrap.com/docs/5.3/migration/#close-button-1) for details. +## BButtonToolbar + +[Keyboard navigation](https://bootstrap-vue.org/docs/components/button-toolbar#keyboard-navigation) is +not implemented. + ## BForm Bootstrap 5 has dropped form-specific layout classes for the grid system. See the @@ -280,7 +285,7 @@ BSVN no longer emits the `bv::link::clicked` event on `$root`. ### Replacement for Modal Message boxes [BootstrapVue](https://bootstrap-vue.org/docs/components/modal#modal-message-boxes) provided two methods on the `this.$bvModal` object called `msgBoxOk` and `msgBoxConfirm`. -In holding with the Vue3 first philosophy, BootstrapVueNext provides a composible called [`useModalController`](/docs/composables/useModalController) that +In holding with the Vue3 first philosophy, BootstrapVueNext provides a composable called [`useModalController`](/docs/composables/useModalController) that fills the same needs (and more). Please read the [`useModalController`](/docs/composables/useModalController) documentation and then come back here for examples of replacements diff --git a/apps/docs/src/index.md b/apps/docs/src/index.md index 0092734d4..e40eef62c 100644 --- a/apps/docs/src/index.md +++ b/apps/docs/src/index.md @@ -44,7 +44,7 @@ With BootstrapVueNext you can build fast, responsive, and ARIA accessible projec ## Overview -With more than 35 components, several directives and composibles (and growing), BootstrapVueNext provides one of the most comprehensive implementations of the Bootstrap v5 component and grid system available for Vue.js v3 / Nuxt.js 3, complete with extensive and automated WAI-ARIA accessibility markup. +With more than 35 components, several directives and composables (and growing), BootstrapVueNext provides one of the most comprehensive implementations of the Bootstrap v5 component and grid system available for Vue.js v3 / Nuxt.js 3, complete with extensive and automated WAI-ARIA accessibility markup.
Get Started diff --git a/packages/bootstrap-vue-next/CHANGELOG.md b/packages/bootstrap-vue-next/CHANGELOG.md index b971238df..c83965626 100644 --- a/packages/bootstrap-vue-next/CHANGELOG.md +++ b/packages/bootstrap-vue-next/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [0.24.11](https://github.com/bootstrap-vue-next/bootstrap-vue-next/compare/bootstrapvuenext-v0.24.10...bootstrapvuenext-v0.24.11) (2024-08-27) + + +### Bug Fixes + +* **BPagination:** Correctly position ellipses when hideGotoEndButtons=true. ([#2148](https://github.com/bootstrap-vue-next/bootstrap-vue-next/issues/2148)) ([d708aa4](https://github.com/bootstrap-vue-next/bootstrap-vue-next/commit/d708aa484200128799f40b69c0e66973d2e0f5f2)) +* **BPagination:** Get rid of bad binding on li ([#2150](https://github.com/bootstrap-vue-next/bootstrap-vue-next/issues/2150)) ([182dbc7](https://github.com/bootstrap-vue-next/bootstrap-vue-next/commit/182dbc7971456e80cdbf257d9700d61d43b106ba)) +* pass attributes through in BDropdownItemButton ([#2143](https://github.com/bootstrap-vue-next/bootstrap-vue-next/issues/2143)) ([951bbf0](https://github.com/bootstrap-vue-next/bootstrap-vue-next/commit/951bbf07bf7f4d99616da965b723014594cd6d41)) + ## [0.24.10](https://github.com/bootstrap-vue-next/bootstrap-vue-next/compare/bootstrapvuenext-v0.24.9...bootstrapvuenext-v0.24.10) (2024-08-20) diff --git a/packages/bootstrap-vue-next/package.json b/packages/bootstrap-vue-next/package.json index 3388439ac..ed3862689 100644 --- a/packages/bootstrap-vue-next/package.json +++ b/packages/bootstrap-vue-next/package.json @@ -2,7 +2,7 @@ "name": "bootstrap-vue-next", "displayName": "BootstrapVueNext", "description": "BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.", - "version": "0.24.10", + "version": "0.24.11", "license": "MIT", "main": "./dist/bootstrap-vue-next.umd.js", "module": "./dist/bootstrap-vue-next.mjs", diff --git a/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItemButton.vue b/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItemButton.vue index d3cda157b..4a75ca488 100644 --- a/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItemButton.vue +++ b/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItemButton.vue @@ -1,11 +1,12 @@