@martin.ivanov.brandcompete/bcq-ui 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,48 @@
1
- # This is a work in progress yet, so bear with us for a while
1
+ # Becquerel for Vue 3
2
2
 
3
- # brandcompete-becquerel-3
3
+ #### This a work in progress, so bear with us
4
4
 
5
5
  The Vue3 UI library developed by us at brandcompete GmbH provides a comprehensive and growing set of tools for building modern, consistent user interfaces. It includes a continuously expanding collection of ready-to-use UI components, flexible form controls, and versatile layout elements. In addition, the library offers practical directives, along with a wide range of carefully designed typography styles and utility CSS classes to help streamline development and maintain visual consistency.
6
6
 
7
+ ## Installing BCQ and adding it to a Vue project
8
+
9
+ ```bash
10
+ # BCQ UI
11
+ $ npm install --save bcq-ui
12
+ # Virtual scroller, required by <bc-dropdown />: https://www.npmjs.com/package/vue-virtual-scroller
13
+ $ npm install --save vue-virtual-scroller
14
+ # Event bus: https://www.npmjs.com/package/mitt
15
+ $ npm install --save mitt
16
+ # Material Design font: https://www.npmjs.com/package/@mdi/font, required by <bc-icon />
17
+ $ npm install --save @mdi/font
18
+ ```
19
+
20
+ // main.js
21
+ ```javascript
22
+ // Import BCQ UI
23
+ // Copy variables.css from 'bcq-ui/lib/variables.css' to your 'src' folder, modify colors, etc. if needed,
24
+ // and import it BEFORE the BCQ UI styles
25
+ import '/your/path/to/variables.css'
26
+ import 'bcq-ui/style.css'
27
+ import BcqUi from 'bcq-ui'
28
+ // Import RecycleScroller, required by <bc-dropdown />
29
+ import { RecycleScroller } from 'vue-virtual-scroller'
30
+ import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
31
+ // Import mitt
32
+ import mitt from 'mitt'
33
+ // Import Material Design Icon font, required by <bc-icon />
34
+ import '@mdi/font/css/materialdesignicons.css'
35
+
36
+ // Add mitt event emitter to the global properties
37
+ app.config.globalProperties.$emitter = mitt() // Use as this.$emitter.on(event, data), this.$emitter.emit(event, data), etc.
38
+
39
+ // Register RecycleScroller globally, <bc-dropdown /> uses it as <recycle-scroller />
40
+ app.component('RecycleScroller', RecycleScroller)
41
+
42
+ // use BCQ UI
43
+ app.use(BcqUi)
44
+ ```
45
+
7
46
  ## Recommended IDE Setup
8
47
 
9
48
  [VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
@@ -23,18 +62,86 @@ See [Vite Configuration Reference](https://vite.dev/config/).
23
62
 
24
63
  ## Project Setup
25
64
 
65
+ Install the dependencies:
66
+
26
67
  ```sh
27
68
  npm install
28
69
  ```
29
70
 
30
- ### Compile and Hot-Reload for Development
71
+ ### Development
31
72
 
32
73
  ```sh
33
74
  npm run dev
34
75
  ```
35
76
 
36
- ### Compile and Minify for Production
77
+ Starts the Vite dev server with hot reload for the documentation/demo site. The site uses the unbundled library sources (`src/lib.js`), so changes in `src/bcq-ui/` show up immediately.
78
+
79
+ ```sh
80
+ npm run dev:bundle
81
+ ```
82
+
83
+ Builds the npm bundle (`npm run build:bundle`), then starts the dev server with the docs site running on the bundled files from `lib/` instead of the sources. Use it to check that the bundle works exactly like the sources; any difference compared to `npm run dev` is a bundling bug. Add `BCQ_BUNDLE=full` to test the non-minified files instead of the minified ones.
84
+
85
+ ### Building
37
86
 
38
87
  ```sh
39
88
  npm run build
40
89
  ```
90
+
91
+ Builds everything: updates the root `CHANGELOG.md` (`npm run bcq:changelog`), builds the docs site into `dist/` (including the sitemap), generates `dist/llms.txt` and the pre-rendered static pages in `snapshots/`, then runs `npm run build:bundle` (component types + the npm bundle in `lib/`).
92
+
93
+ ```sh
94
+ npm run build:bundle
95
+ ```
96
+
97
+ Generates the component types (`npm run bcq:types`), then builds the library bundle that is published to npm into `lib/`:
98
+
99
+ - `bcq-ui.js` / `bcq-ui.min.js` - the library as an ES module (readable and minified)
100
+ - `bcq-ui.css` / `bcq-ui.min.css` - the library styles (readable and minified)
101
+ - `variables.css` - the CSS variables (colors, fonts, etc.), not minified, to be copied and customized by the users
102
+ - `bcq-ui.d.ts` / `bcq-ui.min.d.ts` - TypeScript type declarations, copied from `src/lib.d.ts`
103
+ - `bcq-ui-components.d.ts` - TypeScript types for all `<bc-*>` components (props and events), generated by `npm run bcq:types`
104
+
105
+ `lib/` is emptied before each build. It is already part of `npm run build`; run it on its own for a quick library-only rebuild after changing anything in `src/bcq-ui/`.
106
+
107
+ ```sh
108
+ npm run preview
109
+ ```
110
+
111
+ Serves the production build from `dist/` locally. Run `npm run build` first.
112
+
113
+ ### Tools
114
+
115
+ ```sh
116
+ npm run bcq:create
117
+ ```
118
+
119
+ Interactive scaffolder for a new UI component. Asks for a category (`content`, `ui` or `forms`) and a name, creates the component, its demo page, documentation, page metadata and code snippet from the templates in `bcq-cli/templates/`, and prints the remaining manual steps.
120
+
121
+ ```sh
122
+ npm run bcq:types
123
+ ```
124
+
125
+ Generates `src/bcq-ui-components.d.ts`, the TypeScript types for every component installed by the library, from the `name`, `props` and `emits` of each `.vue` file listed in `src/bcq-ui/components/index.js`. Gives TypeScript users prop autocomplete and type checking for `<bc-*>` components in their templates. Already part of `npm run build:bundle`; never edit the generated file by hand.
126
+
127
+ ```sh
128
+ npm run bcq:changelog
129
+ ```
130
+
131
+ Copies `public/data/components-md/CHANGELOG.md` (the changelog shown on the docs site) over the root `CHANGELOG.md`. Edit the changelog only in `public/data/components-md/CHANGELOG.md`. Already part of `npm run build`.
132
+
133
+ ```sh
134
+ npm run bcq:llms
135
+ ```
136
+
137
+ Regenerates `dist/llms.txt`, an LLM-readable summary of the documentation in `public/data/pages-md/`. Already part of `npm run build`.
138
+
139
+ ```sh
140
+ npm run bcq:ssr
141
+ ```
142
+
143
+ Regenerates the pre-rendered static HTML pages in `snapshots/` (used by crawlers and social media previews). Already part of `npm run build`.
144
+
145
+ ### Publishing
146
+
147
+ `prepublishOnly` is not meant to be run manually: npm runs it automatically before `npm publish`, and it rebuilds the bundle (`npm run build:bundle`), so the published package always contains the latest bundle.