create-becquerel 0.0.0-stage → 1.0.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 +72 -2
- package/index.js +409 -0
- package/overlays/pinia/src/components/pinia-counter.vue +30 -0
- package/overlays/pinia/src/stores/counter.js +19 -0
- package/overlays/router/src/router/index.js +15 -0
- package/package.json +53 -4
- package/template/README.md +25 -0
- package/template/_gitignore +24 -0
- package/template/index.html +12 -0
- package/template/package.json +22 -0
- package/template/src/App.vue +28 -0
- package/template/src/main.js +27 -0
- package/template/src/pages/hello-world.vue +27 -0
- package/template/src/styles/variables.css +353 -0
- package/template/vite.config.js +7 -0
package/README.md
CHANGED
|
@@ -1,3 +1,73 @@
|
|
|
1
|
-
#
|
|
1
|
+
# create-becquerel
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Scaffold a new Vue 3 + Vite project with [Becquerel UI](https://bcq-ui.brandcompete.com/) already installed and configured.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm create becquerel@latest my-app
|
|
7
|
+
pnpm create becquerel my-app
|
|
8
|
+
yarn create becquerel my-app
|
|
9
|
+
bun create becquerel my-app
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Use `.` as the folder name to scaffold into the current folder, or leave it out to be asked for a name.
|
|
13
|
+
The name is turned into a valid npm package name (`My Café App!` -> `my-cafe-app`) and used for the folder, `package.json`, the header of the starter page and the page title.
|
|
14
|
+
The dependencies are installed with the package manager you ran the command with.
|
|
15
|
+
|
|
16
|
+
## Options
|
|
17
|
+
|
|
18
|
+
| Option | Description |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `--theme <dark\|light>` | theme of the new app (`dark` in `App.vue`'s `data`), without asking; default `dark` |
|
|
21
|
+
| `--router` | add vue-router (`src/router/index.js`, the hello-world page becomes the `/` route) without asking |
|
|
22
|
+
| `--no-router` | don't add vue-router |
|
|
23
|
+
| `--axios` | add axios + vue-axios (`app.use(VueAxios, axios)`, then `this.axios` / `this.$http` in components) without asking |
|
|
24
|
+
| `--no-axios` | don't add axios + vue-axios |
|
|
25
|
+
| `--pinia` | add Pinia (`app.use(createPinia())`, an example counter store in `src/stores/` shown on the hello-world page) without asking |
|
|
26
|
+
| `--no-pinia` | don't add Pinia |
|
|
27
|
+
| `--install` | install dependencies without asking |
|
|
28
|
+
| `--no-install` | skip installing dependencies |
|
|
29
|
+
| `-f`, `--force` | empty the target folder if it is not empty (keeps `.git`) |
|
|
30
|
+
| `-h`, `--help` | show the help |
|
|
31
|
+
| `-v`, `--version` | show the version |
|
|
32
|
+
|
|
33
|
+
## What you get
|
|
34
|
+
|
|
35
|
+
- `src/main.js` with Becquerel UI and everything it needs: the `$emitter` event bus (`mitt`), Material Design Icons
|
|
36
|
+
(`@mdi/font`) and `RecycleScroller` (`vue-virtual-scroller`, used by `<bc-dropdown>`).
|
|
37
|
+
- `src/styles/variables.css`: the theme variables (colors, fonts, etc.), ready to customize.
|
|
38
|
+
- `src/App.vue`: a `<bc-layout>` with the project name in the header and `src/pages/hello-world.vue` in the main area,
|
|
39
|
+
which lists what was installed (Vue, Vite, Becquerel UI and the chosen options) and shows the Pinia example if chosen.
|
|
40
|
+
|
|
41
|
+
## Development (in the bcq-ui repository)
|
|
42
|
+
|
|
43
|
+
- `template/` is a normal, runnable Vite project and exactly what new projects get:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
cd create-becquerel/template
|
|
47
|
+
npm install
|
|
48
|
+
npm run dev
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
When copying it, the CLI skips `node_modules`, `dist` and lockfiles, renames `_gitignore` to `.gitignore`
|
|
52
|
+
(npm strips `.gitignore` from published packages) and sets the package name.
|
|
53
|
+
- Optional features (`FEATURES` in `index.js`) are applied on top of the base template: the files in
|
|
54
|
+
`overlays/<name>/` are copied over the project, `dependencies` are added to its `package.json`, and `edits`
|
|
55
|
+
(`[find, replace]` pairs) are applied to its files, e.g. the router feature replaces
|
|
56
|
+
`<page-hello-world />` in `App.vue`'s main slot with `<router-view />`. Features add their lines to
|
|
57
|
+
`hello-world.vue` before the `<!-- installed options -->` and `<!-- examples -->` anchor comments, which the CLI
|
|
58
|
+
removes afterwards. If a `find` text is missing
|
|
59
|
+
(because the template changed), scaffolding fails with an error naming the feature and file, so keep the template
|
|
60
|
+
and the edits in sync. Overlays aren't runnable on their own; test them by scaffolding, e.g.
|
|
61
|
+
`node index.js playground/my-app --router` (`playground/` is git-ignored).
|
|
62
|
+
- `npm run sync` (also runs before `npm publish`) sets the bcq-ui version in `template/package.json` to
|
|
63
|
+
`^<version of the root package.json>` and copies `lib/variables.css` to `template/src/styles/variables.css`.
|
|
64
|
+
- Try the whole flow without publishing:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
node create-becquerel/index.js /path/to/my-app
|
|
68
|
+
# or exactly as users get it:
|
|
69
|
+
cd create-becquerel && npm pack
|
|
70
|
+
npx --package=/path/to/create-becquerel-1.0.0.tgz create-becquerel /path/to/my-app
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- Publish: `cd create-becquerel && npm publish`. Versioned independently from the library.
|
package/index.js
ADDED
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// create-becquerel: scaffolds a new Vue 3 + Vite project with Becquerel UI preconfigured.
|
|
3
|
+
// Usage: npm create becquerel@latest [dir] | pnpm create becquerel [dir] | yarn create becquerel [dir] | bun create becquerel [dir]
|
|
4
|
+
import { existsSync, readdirSync, mkdirSync, copyFileSync, rmSync, readFileSync, writeFileSync, statSync } from 'node:fs'
|
|
5
|
+
import { basename, join, relative, resolve } from 'node:path'
|
|
6
|
+
import { fileURLToPath } from 'node:url'
|
|
7
|
+
import { spawnSync } from 'node:child_process'
|
|
8
|
+
import { parseArgs } from 'node:util'
|
|
9
|
+
import * as p from '@clack/prompts'
|
|
10
|
+
|
|
11
|
+
const DEFAULT_NAME = 'becquerel-app'
|
|
12
|
+
const DOCS_URL = 'https://bcq-ui.brandcompete.com/'
|
|
13
|
+
const TEMPLATE_DIR = fileURLToPath(new URL('./template', import.meta.url))
|
|
14
|
+
// files allowed in a target folder that otherwise counts as empty
|
|
15
|
+
const IGNORED_EXISTING = ['.git', '.DS_Store', 'Thumbs.db']
|
|
16
|
+
// local leftovers in template/ that must never be copied into a new project
|
|
17
|
+
const SKIPPED_TEMPLATE_FILES = ['node_modules', 'dist', 'package-lock.json', 'pnpm-lock.yaml', 'yarn.lock', 'bun.lock', 'bun.lockb']
|
|
18
|
+
const RENAMED_TEMPLATE_FILES = { _gitignore: '.gitignore' }
|
|
19
|
+
|
|
20
|
+
// Optional features, applied on top of the base template: the files in overlays/<name>/ are copied over the project,
|
|
21
|
+
// `dependencies` are added to its package.json and `edits` ([find, replace] pairs) are applied to its files.
|
|
22
|
+
// An edit whose `find` text is missing throws, so changes to the template that break a feature don't go unnoticed.
|
|
23
|
+
const OVERLAYS_DIR = fileURLToPath(new URL('./overlays', import.meta.url))
|
|
24
|
+
// Anchor comments in template/src/pages/hello-world.vue: features insert their lines before them,
|
|
25
|
+
// then the CLI removes them (see ANCHOR_LINES).
|
|
26
|
+
const INSTALLED_ANCHOR = '<!-- installed options -->'
|
|
27
|
+
const EXAMPLES_ANCHOR = '<!-- examples -->'
|
|
28
|
+
const ANCHOR_LINES = { 'src/pages/hello-world.vue': [INSTALLED_ANCHOR, EXAMPLES_ANCHOR] }
|
|
29
|
+
|
|
30
|
+
// edit that adds a line to the "What's installed" list of hello-world.vue
|
|
31
|
+
function installedLine (html) {
|
|
32
|
+
return [INSTALLED_ANCHOR, `<li>${html}</li>\n ${INSTALLED_ANCHOR}`]
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const FEATURES = [
|
|
36
|
+
{
|
|
37
|
+
name: 'router',
|
|
38
|
+
message: 'Add vue-router?',
|
|
39
|
+
initialValue: true,
|
|
40
|
+
dependencies: { 'vue-router': '^4.6.5' },
|
|
41
|
+
edits: {
|
|
42
|
+
'src/main.js': [
|
|
43
|
+
["import App from './App.vue'\n", "import App from './App.vue'\nimport router from './router'\n"],
|
|
44
|
+
['app.use(BcqUi)\n', 'app.use(router)\napp.use(BcqUi)\n']
|
|
45
|
+
],
|
|
46
|
+
// the page is now rendered by the router (route "/"), not by App.vue itself
|
|
47
|
+
'src/App.vue': [
|
|
48
|
+
['<template v-slot:main><page-hello-world /></template>', '<template v-slot:main><router-view /></template>'],
|
|
49
|
+
["import PageHelloWorld from './pages/hello-world.vue'\n\n", ''],
|
|
50
|
+
[' components: {\n PageHelloWorld\n },\n', '']
|
|
51
|
+
],
|
|
52
|
+
'src/pages/hello-world.vue': [
|
|
53
|
+
installedLine('<span :class="[\'font-semibold\']">vue-router</span>: this page is the <code>/</code> route, add more pages in <code>src/pages/</code> and register them in <code>src/router/index.js</code>')
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'axios',
|
|
59
|
+
message: 'Add axios + vue-axios?',
|
|
60
|
+
initialValue: true,
|
|
61
|
+
dependencies: { axios: '^1.21.1', 'vue-axios': '^3.6.0' },
|
|
62
|
+
edits: {
|
|
63
|
+
'src/main.js': [
|
|
64
|
+
["import BcqUi from '@martin.ivanov.brandcompete/bcq-ui'\n", "import axios from 'axios'\nimport VueAxios from 'vue-axios'\nimport BcqUi from '@martin.ivanov.brandcompete/bcq-ui'\n"],
|
|
65
|
+
['app.use(BcqUi)\n', '// HTTP client, available in components as this.axios and this.$http\napp.use(VueAxios, axios)\napp.use(BcqUi)\n']
|
|
66
|
+
],
|
|
67
|
+
'src/pages/hello-world.vue': [
|
|
68
|
+
installedLine('<span :class="[\'font-semibold\']">axios</span> + <span :class="[\'font-semibold\']">vue-axios</span>: make HTTP requests with <code>this.axios</code> or <code>this.$http</code> in any component')
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'pinia',
|
|
74
|
+
message: 'Add Pinia?',
|
|
75
|
+
initialValue: true,
|
|
76
|
+
// @vue/devtools-api is a required peer of Pinia 4; declared explicitly because vue-router 4 brings in v6 of it
|
|
77
|
+
dependencies: { pinia: '^4.1.0', '@vue/devtools-api': '^8.2.1' },
|
|
78
|
+
edits: {
|
|
79
|
+
'src/main.js': [
|
|
80
|
+
["import BcqUi from '@martin.ivanov.brandcompete/bcq-ui'\n", "import { createPinia } from 'pinia'\nimport BcqUi from '@martin.ivanov.brandcompete/bcq-ui'\n"],
|
|
81
|
+
['app.use(BcqUi)\n', '// state management, stores live in ./stores\napp.use(createPinia())\napp.use(BcqUi)\n']
|
|
82
|
+
],
|
|
83
|
+
'src/pages/hello-world.vue': [
|
|
84
|
+
installedLine('<span :class="[\'font-semibold\']">Pinia</span>: stores in <code>src/stores/</code>, see the counter example below'),
|
|
85
|
+
[EXAMPLES_ANCHOR, `<pinia-counter />\n ${EXAMPLES_ANCHOR}`],
|
|
86
|
+
['<script>\n', "<script>\nimport PiniaCounter from '../components/pinia-counter.vue'\n\n"],
|
|
87
|
+
[" name: 'PageHelloWorld'\n", " name: 'PageHelloWorld',\n components: {\n PiniaCounter\n }\n"]
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
const HELP = `Usage: create-becquerel [dir] [options]
|
|
94
|
+
|
|
95
|
+
Scaffold a new Vue 3 + Vite project with Becquerel UI preconfigured.
|
|
96
|
+
Use "." as dir to scaffold into the current folder.
|
|
97
|
+
|
|
98
|
+
Options:
|
|
99
|
+
--theme <theme> "dark" or "light" theme, without asking (default: dark)
|
|
100
|
+
--router add vue-router without asking
|
|
101
|
+
--no-router don't add vue-router
|
|
102
|
+
--axios add axios + vue-axios without asking
|
|
103
|
+
--no-axios don't add axios + vue-axios
|
|
104
|
+
--install install dependencies without asking
|
|
105
|
+
--no-install skip installing dependencies
|
|
106
|
+
-f, --force empty the target folder if it is not empty (keeps .git)
|
|
107
|
+
-h, --help show this help
|
|
108
|
+
-v, --version show the version
|
|
109
|
+
|
|
110
|
+
Docs: ${DOCS_URL}`
|
|
111
|
+
|
|
112
|
+
function parseCliArgs () {
|
|
113
|
+
const { values, positionals } = parseArgs({
|
|
114
|
+
allowPositionals: true,
|
|
115
|
+
options: {
|
|
116
|
+
...Object.fromEntries(FEATURES.flatMap(({ name }) => [[name, { type: 'boolean' }], [`no-${name}`, { type: 'boolean' }]])),
|
|
117
|
+
install: { type: 'boolean' },
|
|
118
|
+
'no-install': { type: 'boolean' },
|
|
119
|
+
theme: { type: 'string' },
|
|
120
|
+
force: { type: 'boolean', short: 'f' },
|
|
121
|
+
help: { type: 'boolean', short: 'h' },
|
|
122
|
+
version: { type: 'boolean', short: 'v' }
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
return {
|
|
126
|
+
dir: positionals[0],
|
|
127
|
+
// feature name -> true (--x), false (--no-x) or undefined (ask)
|
|
128
|
+
features: Object.fromEntries(FEATURES.map(({ name }) => [name, values[`no-${name}`] ? false : values[name]])),
|
|
129
|
+
install: values['no-install'] ? false : values.install,
|
|
130
|
+
theme: values.theme === undefined ? undefined : values.theme.trim().toLowerCase(),
|
|
131
|
+
force: Boolean(values.force),
|
|
132
|
+
help: Boolean(values.help),
|
|
133
|
+
version: Boolean(values.version)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// npm, pnpm, yarn and bun all set npm_config_user_agent to e.g. "pnpm/9.15.0 npm/? node/v22.12.0 darwin arm64"
|
|
138
|
+
function detectPackageManager () {
|
|
139
|
+
const name = (process.env.npm_config_user_agent || '').split(' ')[0].split('/')[0]
|
|
140
|
+
return ['npm', 'pnpm', 'yarn', 'bun'].includes(name) ? name : 'npm'
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function commandsFor (pm) {
|
|
144
|
+
return {
|
|
145
|
+
install: pm === 'yarn' ? 'yarn' : `${pm} install`,
|
|
146
|
+
dev: pm === 'npm' ? 'npm run dev' : `${pm} dev`
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// "My Cool App!" -> "my-cool-app": the one name used for the folder, package.json, the page header and <title>.
|
|
151
|
+
// Always a valid npm package name: lowercase, only a-z, 0-9, ".", "_", "~" and single dashes, none of them at the ends
|
|
152
|
+
// (so it is also safe to write into App.vue and index.html as is). Empty if nothing usable is left.
|
|
153
|
+
function toProjectName (name) {
|
|
154
|
+
return name
|
|
155
|
+
.trim()
|
|
156
|
+
.normalize('NFKD').replace(/[\u0300-\u036f]/g, '') // "Über Café" -> "Uber Cafe"
|
|
157
|
+
.toLowerCase()
|
|
158
|
+
.replace(/[^a-z\d._~-]+/g, '-')
|
|
159
|
+
.replace(/-{2,}/g, '-')
|
|
160
|
+
.replace(/^[-._~]+|[-._~]+$/g, '')
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const THEMES = ['dark', 'light']
|
|
164
|
+
const INVALID_NAME = 'Please use letters or digits, e.g. my-app'
|
|
165
|
+
|
|
166
|
+
// removes the lines that hold only an anchor comment (they're for the CLI, not for the new project)
|
|
167
|
+
function removeAnchorLines (root) {
|
|
168
|
+
for (const [file, anchors] of Object.entries(ANCHOR_LINES)) {
|
|
169
|
+
const path = join(root, file)
|
|
170
|
+
const lines = readFileSync(path, 'utf8').split('\n')
|
|
171
|
+
writeFileSync(path, lines.filter((line) => !anchors.includes(line.trim())).join('\n'))
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function applyEdits (root, edits, label) {
|
|
176
|
+
for (const [file, fileEdits] of Object.entries(edits)) {
|
|
177
|
+
const path = join(root, file)
|
|
178
|
+
let content = readFileSync(path, 'utf8')
|
|
179
|
+
for (const [find, replace] of fileEdits) {
|
|
180
|
+
if (!content.includes(find)) {
|
|
181
|
+
throw new Error(`${label}: "${find.trim()}" not found in ${file}`)
|
|
182
|
+
}
|
|
183
|
+
content = content.replace(find, () => replace)
|
|
184
|
+
}
|
|
185
|
+
writeFileSync(path, content)
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function isEmptyDir (dir) {
|
|
190
|
+
return !existsSync(dir) || readdirSync(dir).every((file) => IGNORED_EXISTING.includes(file))
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function emptyDir (dir) {
|
|
194
|
+
for (const file of readdirSync(dir)) {
|
|
195
|
+
if (file !== '.git') {
|
|
196
|
+
rmSync(join(dir, file), { recursive: true, force: true })
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function copyDir (from, to) {
|
|
202
|
+
mkdirSync(to, { recursive: true })
|
|
203
|
+
for (const file of readdirSync(from)) {
|
|
204
|
+
if (SKIPPED_TEMPLATE_FILES.includes(file)) {
|
|
205
|
+
continue
|
|
206
|
+
}
|
|
207
|
+
const source = join(from, file)
|
|
208
|
+
const target = join(to, RENAMED_TEMPLATE_FILES[file] || file)
|
|
209
|
+
if (statSync(source).isDirectory()) {
|
|
210
|
+
copyDir(source, target)
|
|
211
|
+
} else {
|
|
212
|
+
copyFileSync(source, target)
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function applyFeature (root, feature, pkg) {
|
|
218
|
+
const overlay = join(OVERLAYS_DIR, feature.name)
|
|
219
|
+
if (existsSync(overlay)) {
|
|
220
|
+
copyDir(overlay, root)
|
|
221
|
+
}
|
|
222
|
+
Object.assign(pkg.dependencies, feature.dependencies)
|
|
223
|
+
applyEdits(root, feature.edits || {}, `Feature "${feature.name}"`)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function sortKeys (object) {
|
|
227
|
+
return Object.fromEntries(Object.entries(object).sort(([a], [b]) => a.localeCompare(b)))
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function cancelled (value) {
|
|
231
|
+
if (p.isCancel(value)) {
|
|
232
|
+
p.cancel('Cancelled.')
|
|
233
|
+
process.exit(1)
|
|
234
|
+
}
|
|
235
|
+
return value
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
async function main () {
|
|
239
|
+
const args = parseCliArgs()
|
|
240
|
+
if (args.help) {
|
|
241
|
+
console.log(HELP)
|
|
242
|
+
return
|
|
243
|
+
}
|
|
244
|
+
if (args.version) {
|
|
245
|
+
console.log(JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')).version)
|
|
246
|
+
return
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const interactive = Boolean(process.stdin.isTTY && process.stdout.isTTY)
|
|
250
|
+
const pm = detectPackageManager()
|
|
251
|
+
const commands = commandsFor(pm)
|
|
252
|
+
|
|
253
|
+
p.intro('Becquerel UI: new Vue 3 + Vite project')
|
|
254
|
+
|
|
255
|
+
// 1. project name = target folder
|
|
256
|
+
let dir = args.dir
|
|
257
|
+
if (!dir) {
|
|
258
|
+
dir = interactive
|
|
259
|
+
? cancelled(await p.text({
|
|
260
|
+
message: 'Project name:',
|
|
261
|
+
placeholder: 'e.g. my-app',
|
|
262
|
+
validate: (value) => toProjectName(basename(value || '')) ? undefined : INVALID_NAME
|
|
263
|
+
}))
|
|
264
|
+
: DEFAULT_NAME
|
|
265
|
+
}
|
|
266
|
+
dir = dir.trim().replace(/[/\\]+$/, '') || '.'
|
|
267
|
+
const inCurrentDir = resolve(dir) === process.cwd()
|
|
268
|
+
let projectName
|
|
269
|
+
let root
|
|
270
|
+
if (inCurrentDir) {
|
|
271
|
+
// the existing folder keeps its own name, only the project name is cleaned up
|
|
272
|
+
root = process.cwd()
|
|
273
|
+
projectName = toProjectName(basename(root)) || DEFAULT_NAME
|
|
274
|
+
} else {
|
|
275
|
+
// the new folder's own name is cleaned up, its parent folders are left alone
|
|
276
|
+
const typedName = basename(dir)
|
|
277
|
+
projectName = toProjectName(typedName)
|
|
278
|
+
if (!projectName) {
|
|
279
|
+
p.cancel(`"${typedName}" can't be used as a project name. ${INVALID_NAME}.`)
|
|
280
|
+
process.exit(1)
|
|
281
|
+
}
|
|
282
|
+
dir = dir.slice(0, dir.length - typedName.length) + projectName
|
|
283
|
+
root = resolve(dir)
|
|
284
|
+
if (projectName !== typedName) {
|
|
285
|
+
p.log.info(`Project name: ${projectName}`)
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// 2. a target folder that is not empty
|
|
290
|
+
if (!isEmptyDir(root)) {
|
|
291
|
+
const where = inCurrentDir ? 'The current folder' : `Folder "${dir}"`
|
|
292
|
+
let action = args.force ? 'empty' : 'cancel'
|
|
293
|
+
if (!args.force && interactive) {
|
|
294
|
+
action = cancelled(await p.select({
|
|
295
|
+
message: `${where} is not empty. What should happen?`,
|
|
296
|
+
initialValue: 'cancel',
|
|
297
|
+
options: [
|
|
298
|
+
{ value: 'cancel', label: 'Cancel' },
|
|
299
|
+
{ value: 'empty', label: 'Remove existing files and continue', hint: 'keeps .git' },
|
|
300
|
+
{ value: 'merge', label: 'Keep existing files and continue', hint: 'files from the template overwrite files with the same name' }
|
|
301
|
+
]
|
|
302
|
+
}))
|
|
303
|
+
}
|
|
304
|
+
if (action === 'cancel') {
|
|
305
|
+
p.cancel(`${where} is not empty.${interactive ? '' : ' Use --force to empty it.'}`)
|
|
306
|
+
process.exit(1)
|
|
307
|
+
}
|
|
308
|
+
if (action === 'empty') {
|
|
309
|
+
emptyDir(root)
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// 3. theme (<bc-app :dark="dark"> in App.vue)
|
|
314
|
+
let theme = args.theme
|
|
315
|
+
if (theme !== undefined && !THEMES.includes(theme)) {
|
|
316
|
+
p.cancel(`Unknown theme "${args.theme}". Use ${THEMES.map((name) => `--theme ${name}`).join(' or ')}.`)
|
|
317
|
+
process.exit(1)
|
|
318
|
+
}
|
|
319
|
+
if (theme === undefined) {
|
|
320
|
+
theme = interactive
|
|
321
|
+
? cancelled(await p.select({
|
|
322
|
+
message: 'Theme:',
|
|
323
|
+
initialValue: 'dark',
|
|
324
|
+
options: [
|
|
325
|
+
{ value: 'dark', label: 'Dark' },
|
|
326
|
+
{ value: 'light', label: 'Light' }
|
|
327
|
+
]
|
|
328
|
+
}))
|
|
329
|
+
: 'dark'
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// 4. optional features (non-interactive: only the ones passed as flags)
|
|
333
|
+
const features = []
|
|
334
|
+
for (const feature of FEATURES) {
|
|
335
|
+
let enabled = args.features[feature.name]
|
|
336
|
+
if (enabled === undefined) {
|
|
337
|
+
enabled = interactive
|
|
338
|
+
? cancelled(await p.confirm({ message: feature.message, initialValue: feature.initialValue }))
|
|
339
|
+
: false
|
|
340
|
+
}
|
|
341
|
+
if (enabled) {
|
|
342
|
+
features.push(feature)
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// 5. install now?
|
|
347
|
+
let install = args.install
|
|
348
|
+
if (install === undefined) {
|
|
349
|
+
install = interactive
|
|
350
|
+
? cancelled(await p.confirm({ message: `Install dependencies with ${pm}?`, initialValue: true }))
|
|
351
|
+
: false
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// 6. copy the template, apply the features
|
|
355
|
+
copyDir(TEMPLATE_DIR, root)
|
|
356
|
+
const pkgPath = join(root, 'package.json')
|
|
357
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'))
|
|
358
|
+
pkg.name = projectName
|
|
359
|
+
applyEdits(root, {
|
|
360
|
+
'src/App.vue': [
|
|
361
|
+
['<template v-slot:header><!-- header --></template>', `<template v-slot:header>${projectName}</template>`],
|
|
362
|
+
[' dark: true\n', ` dark: ${theme === 'dark'}\n`]
|
|
363
|
+
],
|
|
364
|
+
'index.html': [
|
|
365
|
+
['<title>Becquerel App</title>', `<title>${projectName}</title>`]
|
|
366
|
+
]
|
|
367
|
+
}, 'Project name and theme')
|
|
368
|
+
for (const feature of features) {
|
|
369
|
+
applyFeature(root, feature, pkg)
|
|
370
|
+
}
|
|
371
|
+
removeAnchorLines(root)
|
|
372
|
+
pkg.dependencies = sortKeys(pkg.dependencies)
|
|
373
|
+
writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`)
|
|
374
|
+
p.log.success(`Project created in ${root}${features.length ? ` (with ${features.map(({ name }) => name).join(', ')})` : ''}`)
|
|
375
|
+
|
|
376
|
+
// 7. install
|
|
377
|
+
let installed = false
|
|
378
|
+
if (install) {
|
|
379
|
+
p.log.step(`Running ${commands.install}...`)
|
|
380
|
+
const [command, ...commandArgs] = commands.install.split(' ')
|
|
381
|
+
const result = spawnSync(command, commandArgs, {
|
|
382
|
+
cwd: root,
|
|
383
|
+
stdio: 'inherit',
|
|
384
|
+
shell: process.platform === 'win32'
|
|
385
|
+
})
|
|
386
|
+
installed = result.status === 0
|
|
387
|
+
if (!installed) {
|
|
388
|
+
p.log.error(`${commands.install} failed. Run it yourself in the project folder.`)
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// 8. next steps
|
|
393
|
+
const steps = []
|
|
394
|
+
if (!inCurrentDir) {
|
|
395
|
+
const cdPath = relative(process.cwd(), root)
|
|
396
|
+
steps.push(`cd ${cdPath.includes(' ') ? `"${cdPath}"` : cdPath}`)
|
|
397
|
+
}
|
|
398
|
+
if (!installed) {
|
|
399
|
+
steps.push(commands.install)
|
|
400
|
+
}
|
|
401
|
+
steps.push(commands.dev)
|
|
402
|
+
p.note(steps.join('\n'), 'Next steps')
|
|
403
|
+
p.outro(`Docs: ${DOCS_URL}`)
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
main().catch((error) => {
|
|
407
|
+
p.log.error(error.message)
|
|
408
|
+
process.exit(1)
|
|
409
|
+
})
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<bc-card :class="['mt-6']">
|
|
3
|
+
<bc-card-title :padding="['px-4', 'pt-4', 'pb-2']">Pinia example</bc-card-title>
|
|
4
|
+
<bc-card-text :padding="['px-4', 'py-2']">
|
|
5
|
+
<p>
|
|
6
|
+
The count lives in the <code>counter</code> store (<code>src/stores/counter.js</code>), so every component
|
|
7
|
+
using the store sees the same value.
|
|
8
|
+
</p>
|
|
9
|
+
<p :class="['mt-2']">Count: <span :class="['font-semibold']">{{ count }}</span>, doubled: <span :class="['font-semibold']">{{ double }}</span></p>
|
|
10
|
+
</bc-card-text>
|
|
11
|
+
<bc-card-actions :padding="['px-4', 'pt-2', 'pb-4']">
|
|
12
|
+
<bc-btn color="primary" icon-left="plus" :class="['mr-2']" @click="increment">Increment</bc-btn>
|
|
13
|
+
<bc-btn color="secondary" @click="reset">Reset</bc-btn>
|
|
14
|
+
</bc-card-actions>
|
|
15
|
+
</bc-card>
|
|
16
|
+
</template>
|
|
17
|
+
<script>
|
|
18
|
+
import { mapActions, mapState } from 'pinia'
|
|
19
|
+
import { useCounterStore } from '../stores/counter.js'
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'PiniaCounter',
|
|
23
|
+
computed: {
|
|
24
|
+
...mapState(useCounterStore, ['count', 'double'])
|
|
25
|
+
},
|
|
26
|
+
methods: {
|
|
27
|
+
...mapActions(useCounterStore, ['increment', 'reset'])
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
|
|
3
|
+
// Example store, used by src/components/pinia-counter.vue. Its state is shared by every component that uses it.
|
|
4
|
+
export const useCounterStore = defineStore('counter', {
|
|
5
|
+
state: () => ({
|
|
6
|
+
count: 0
|
|
7
|
+
}),
|
|
8
|
+
getters: {
|
|
9
|
+
double: (state) => state.count * 2
|
|
10
|
+
},
|
|
11
|
+
actions: {
|
|
12
|
+
increment () {
|
|
13
|
+
this.count++
|
|
14
|
+
},
|
|
15
|
+
reset () {
|
|
16
|
+
this.count = 0
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRouter, createWebHistory } from 'vue-router'
|
|
2
|
+
import PageHelloWorld from '../pages/hello-world.vue'
|
|
3
|
+
|
|
4
|
+
const router = createRouter({
|
|
5
|
+
history: createWebHistory(import.meta.env.BASE_URL),
|
|
6
|
+
routes: [
|
|
7
|
+
{
|
|
8
|
+
path: '/',
|
|
9
|
+
name: 'hello-world',
|
|
10
|
+
component: PageHelloWorld
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export default router
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-becquerel",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Scaffold a new Vue 3 + Vite project with Becquerel UI preconfigured",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"create-becquerel": "index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"index.js",
|
|
12
|
+
"template",
|
|
13
|
+
"overlays",
|
|
14
|
+
"!template/node_modules",
|
|
15
|
+
"!template/dist",
|
|
16
|
+
"!template/package-lock.json",
|
|
17
|
+
"!template/pnpm-lock.yaml",
|
|
18
|
+
"!template/yarn.lock",
|
|
19
|
+
"!template/bun.lock",
|
|
20
|
+
"!template/bun.lockb"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"becquerel",
|
|
24
|
+
"bcq-ui",
|
|
25
|
+
"vue",
|
|
26
|
+
"vite",
|
|
27
|
+
"create",
|
|
28
|
+
"scaffold",
|
|
29
|
+
"starter",
|
|
30
|
+
"template"
|
|
31
|
+
],
|
|
32
|
+
"author": "brandcompete GmbH (https://brandcompete.com/)",
|
|
33
|
+
"homepage": "https://bcq-ui.brandcompete.com/",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/brandcompete/bcq-ui.git",
|
|
37
|
+
"directory": "create-becquerel"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/brandcompete/bcq-ui/issues"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"sync": "node scripts/sync.js",
|
|
50
|
+
"prepublishOnly": "node scripts/sync.js"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@clack/prompts": "^1.9.0"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Becquerel App
|
|
2
|
+
|
|
3
|
+
A Vue 3 + Vite project with [Becquerel UI](https://bcq-ui.brandcompete.com/) preconfigured.
|
|
4
|
+
|
|
5
|
+
## Scripts
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm run dev # start the dev server
|
|
9
|
+
npm run build # build for production into dist/
|
|
10
|
+
npm run preview # preview the production build
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
(Use `pnpm`, `yarn` or `bun` instead of `npm run` if that's your package manager.)
|
|
14
|
+
|
|
15
|
+
## What's preconfigured
|
|
16
|
+
|
|
17
|
+
- `src/main.js` installs Becquerel UI and everything it needs: the `$emitter` event bus (`mitt`),
|
|
18
|
+
Material Design Icons (`@mdi/font`) and `RecycleScroller` (`vue-virtual-scroller`, used by `<bc-dropdown>`).
|
|
19
|
+
- `src/styles/variables.css` holds the theme variables (colors, fonts, etc.). Customize them there;
|
|
20
|
+
the file is imported before the Becquerel UI styles.
|
|
21
|
+
- `src/App.vue` is a small starter page. Replace it with your own.
|
|
22
|
+
|
|
23
|
+
## Documentation
|
|
24
|
+
|
|
25
|
+
All components, directives and utility classes: https://bcq-ui.brandcompete.com/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
pnpm-debug.log*
|
|
8
|
+
|
|
9
|
+
node_modules
|
|
10
|
+
dist
|
|
11
|
+
dist-ssr
|
|
12
|
+
*.local
|
|
13
|
+
.env
|
|
14
|
+
|
|
15
|
+
# Editor directories and files
|
|
16
|
+
.vscode/*
|
|
17
|
+
!.vscode/extensions.json
|
|
18
|
+
.idea
|
|
19
|
+
.DS_Store
|
|
20
|
+
*.suo
|
|
21
|
+
*.ntvs*
|
|
22
|
+
*.njsproj
|
|
23
|
+
*.sln
|
|
24
|
+
*.sw?
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Becquerel App</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="app"></div>
|
|
10
|
+
<script type="module" src="/src/main.js"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "becquerel-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@martin.ivanov.brandcompete/bcq-ui": "^3.1.0",
|
|
13
|
+
"@mdi/font": "^7.4.47",
|
|
14
|
+
"mitt": "^3.0.1",
|
|
15
|
+
"vue": "^3.5.26",
|
|
16
|
+
"vue-virtual-scroller": "^2.0.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@vitejs/plugin-vue": "^6.0.11",
|
|
20
|
+
"vite": "^8.3.8"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<bc-app :dark="dark">
|
|
3
|
+
<bc-layout>
|
|
4
|
+
<template v-slot:header><!-- header --></template>
|
|
5
|
+
<template v-slot:sidebar-left><!-- left sidebar --></template>
|
|
6
|
+
<template v-slot:sidebar-left-controls><!-- left sidebar controls --></template>
|
|
7
|
+
<template v-slot:main><page-hello-world /></template>
|
|
8
|
+
<template v-slot:sidebar-right><!-- right sidebar --></template>
|
|
9
|
+
<template v-slot:sidebar-right-controls><!-- right sidebar controls --></template>
|
|
10
|
+
<template v-slot:footer><!-- footer --></template>
|
|
11
|
+
</bc-layout>
|
|
12
|
+
</bc-app>
|
|
13
|
+
</template>
|
|
14
|
+
<script>
|
|
15
|
+
import PageHelloWorld from './pages/hello-world.vue'
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'App',
|
|
19
|
+
components: {
|
|
20
|
+
PageHelloWorld
|
|
21
|
+
},
|
|
22
|
+
data () {
|
|
23
|
+
return {
|
|
24
|
+
dark: true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createApp } from 'vue'
|
|
2
|
+
import mitt from 'mitt'
|
|
3
|
+
import { RecycleScroller } from 'vue-virtual-scroller'
|
|
4
|
+
import BcqUi from '@martin.ivanov.brandcompete/bcq-ui'
|
|
5
|
+
|
|
6
|
+
// Becquerel UI theme variables (colors, fonts, etc.). Customize them in ./styles/variables.css.
|
|
7
|
+
// They must be imported BEFORE the Becquerel UI styles.
|
|
8
|
+
import './styles/variables.css'
|
|
9
|
+
import '@martin.ivanov.brandcompete/bcq-ui/style.css'
|
|
10
|
+
// Material Design Icons, used by <bc-icon />
|
|
11
|
+
import '@mdi/font/css/materialdesignicons.css'
|
|
12
|
+
// RecycleScroller styles, used by <bc-dropdown />
|
|
13
|
+
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
|
|
14
|
+
|
|
15
|
+
import App from './App.vue'
|
|
16
|
+
|
|
17
|
+
const app = createApp(App)
|
|
18
|
+
|
|
19
|
+
// Global event bus, required by Becquerel UI. Use it as this.$emitter.on(event, handler), this.$emitter.emit(event, data), etc.
|
|
20
|
+
app.config.globalProperties.$emitter = mitt()
|
|
21
|
+
|
|
22
|
+
// <bc-dropdown /> renders its options with <recycle-scroller />
|
|
23
|
+
app.component('RecycleScroller', RecycleScroller)
|
|
24
|
+
|
|
25
|
+
app.use(BcqUi)
|
|
26
|
+
|
|
27
|
+
app.mount('#app')
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['p-4']">
|
|
3
|
+
<bc-heading tag="h1" font-size="2xl" :divider="true">Hello world</bc-heading>
|
|
4
|
+
<p :class="['mt-3']">
|
|
5
|
+
Your Becquerel UI project is ready. Edit <code>src/pages/hello-world.vue</code> and save to see your changes.
|
|
6
|
+
</p>
|
|
7
|
+
<p :class="['mt-3']">
|
|
8
|
+
All components, directives and utility classes, with live demos and code examples, are on the
|
|
9
|
+
<a href="https://bcq-ui.brandcompete.com/" target="_blank" :class="['underline']">Becquerel UI website</a>.
|
|
10
|
+
</p>
|
|
11
|
+
<bc-btn color="primary" tag="a" href="https://bcq-ui.brandcompete.com/" target="_blank" :class="['mt-3']">
|
|
12
|
+
Docs & Demo Website
|
|
13
|
+
</bc-btn>
|
|
14
|
+
<bc-heading tag="h2" font-size="lg" :class="['mt-6']">What's installed</bc-heading>
|
|
15
|
+
<ul :class="['mt-2', 'pl-5', 'list-disc']">
|
|
16
|
+
<li><span :class="['font-semibold']">Vue 3</span> + <span :class="['font-semibold']">Vite</span></li>
|
|
17
|
+
<li><span :class="['font-semibold']">Becquerel UI</span>, set up in <code>src/main.js</code>, theme variables in <code>src/styles/variables.css</code></li>
|
|
18
|
+
<!-- installed options -->
|
|
19
|
+
</ul>
|
|
20
|
+
<!-- examples -->
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
<script>
|
|
24
|
+
export default {
|
|
25
|
+
name: 'PageHelloWorld'
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Becquerel UI for Vue3 v3.1.0
|
|
3
|
+
* @martin.ivanov.brandcompete/bcq-ui
|
|
4
|
+
* (c) 2026 brandcompete GmbH - https://brandcompete.com/
|
|
5
|
+
* Docs: https://bcq-ui.brandcompete.com/
|
|
6
|
+
* Released under the MIT License
|
|
7
|
+
*/
|
|
8
|
+
:root
|
|
9
|
+
{
|
|
10
|
+
/* generic white and black bg-{color}, text-{color} and border-{color} */
|
|
11
|
+
--white: rgb(255, 255, 255);
|
|
12
|
+
--black: rgb(0, 0, 0);
|
|
13
|
+
|
|
14
|
+
--font-family-generic: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
15
|
+
--font-family-monospace: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
16
|
+
|
|
17
|
+
/* sidebars easing */
|
|
18
|
+
--sidebars-easing: .2s cubic-bezier(.4, 0, .2, 1);
|
|
19
|
+
|
|
20
|
+
/* backdrop blur */
|
|
21
|
+
--backdrop-blur: blur(4px);
|
|
22
|
+
|
|
23
|
+
/* light/dark theme colors */
|
|
24
|
+
--bg-theme-light: rgb(255, 255, 255);
|
|
25
|
+
--text-theme-light: rgb(0, 0, 0);
|
|
26
|
+
|
|
27
|
+
--bg-theme-dark: rgb(33, 33, 33);
|
|
28
|
+
--text-theme-dark: rgb(255, 255, 255);
|
|
29
|
+
|
|
30
|
+
--semi-transparent-light: rgba(255, 255, 255, .5);
|
|
31
|
+
--semi-transparent-dark: rgba(0, 0, 0, .5);
|
|
32
|
+
|
|
33
|
+
/* border-colors */
|
|
34
|
+
--border-color-light: rgb(222, 224, 230);
|
|
35
|
+
--border-color-dark: rgb(48, 50, 55);
|
|
36
|
+
|
|
37
|
+
/* <bc-card /> */
|
|
38
|
+
--card-background-light: rgb(249, 249, 249);
|
|
39
|
+
--card-background-dark: rgb(24, 24, 24);
|
|
40
|
+
|
|
41
|
+
/* <bc-text-field /> */
|
|
42
|
+
--text-field-color-light: rgb(0, 0, 0);
|
|
43
|
+
--text-field-color-dark: rgb(255, 255, 255);
|
|
44
|
+
--text-field-color-error: rgb(224, 46, 42);
|
|
45
|
+
|
|
46
|
+
/* <bc-collapsible /> */
|
|
47
|
+
--collapsible-header-background-light: rgb(250, 250, 250);
|
|
48
|
+
--collapsible-header-background-dark: rgb(24, 24, 24);
|
|
49
|
+
--collapsible-header-border-light: rgb(222, 224, 230);
|
|
50
|
+
--collapsible-header-border-dark: rgb(48, 50, 55);
|
|
51
|
+
--collapsible-header-background-expanded-light: rgb(229, 229, 229);
|
|
52
|
+
--collapsible-header-background-expanded-dark: rgb(0, 0, 0);
|
|
53
|
+
|
|
54
|
+
/* left sidebar */
|
|
55
|
+
--bg-sidebar-left-light: rgb(250, 250, 250);
|
|
56
|
+
--text-sidebar-left-light: rgba(0, 0, 0);
|
|
57
|
+
--border-sidebar-left-light: rgba(13, 13, 13, .1);
|
|
58
|
+
|
|
59
|
+
--bg-sidebar-left-dark: rgb(24, 24, 24);
|
|
60
|
+
--text-sidebar-left-dark: rgb(255, 255, 255);
|
|
61
|
+
--border-sidebar-left-dark: rgba(255, 255, 255, .1);
|
|
62
|
+
|
|
63
|
+
/* right sidebar */
|
|
64
|
+
--bg-sidebar-right-light: rgb(250, 250, 250);
|
|
65
|
+
--text-sidebar-right-light: rgb(0, 0, 0);
|
|
66
|
+
--border-sidebar-right-light: rgba(13, 13, 13, .1);
|
|
67
|
+
|
|
68
|
+
--bg-sidebar-right-dark: rgb(24, 24, 24);
|
|
69
|
+
--text-sidebar-right-dark: rgb(255, 255, 255);
|
|
70
|
+
--border-sidebar-right-dark: rgba(255, 255, 255, .1);
|
|
71
|
+
|
|
72
|
+
/* main */
|
|
73
|
+
--bg-main-light: var(--bg-theme-light);
|
|
74
|
+
--text-main-light: var(--text-theme-light);
|
|
75
|
+
|
|
76
|
+
--bg-main-dark: var(--bg-theme-dark);
|
|
77
|
+
--text-main-dark: var(--text-theme-dark);
|
|
78
|
+
|
|
79
|
+
/* header */
|
|
80
|
+
--bg-header-light: var(--bg-theme-light);
|
|
81
|
+
--text-header-light: var(--text-theme-light);
|
|
82
|
+
--border-header-light: rgba(13, 13, 13, .1);
|
|
83
|
+
|
|
84
|
+
--bg-header-dark: var(--bg-theme-dark);
|
|
85
|
+
--text-header-dark: var(--text-theme-dark);
|
|
86
|
+
--border-header-dark: rgba(255, 255, 255, .1);
|
|
87
|
+
|
|
88
|
+
/* footer */
|
|
89
|
+
--bg-footer-light: var(--bg-theme-light);
|
|
90
|
+
--text-footer-light: var(--text-theme-light);
|
|
91
|
+
--border-footer-light: rgba(13, 13, 13, .1);
|
|
92
|
+
|
|
93
|
+
--bg-footer-dark: var(--bg-theme-dark);
|
|
94
|
+
--text-footer-dark: var(--text-theme-dark);
|
|
95
|
+
--border-footer-dark: rgba(255, 255, 255, .1);
|
|
96
|
+
|
|
97
|
+
/* solid colors */
|
|
98
|
+
--bg-primary-solid: rgb(24, 24, 24);
|
|
99
|
+
--text-primary-solid: rgb(255, 255, 255);
|
|
100
|
+
--bg-primary-solid-dark: rgb(255, 255, 255);
|
|
101
|
+
--text-primary-solid-dark: rgb(13, 13, 13);
|
|
102
|
+
|
|
103
|
+
--bg-secondary-solid: rgb(94, 94, 94);
|
|
104
|
+
--text-secondary-solid: rgb(255, 255, 255);
|
|
105
|
+
--bg-secondary-solid-dark: rgb(65, 65, 65);
|
|
106
|
+
--text-secondary-solid-dark: rgb(255, 255, 255);
|
|
107
|
+
|
|
108
|
+
--tabs-bg-primary-solid-light: rgb(24, 24, 24);
|
|
109
|
+
--tabs-bg-primary-solid-dark: rgb(255, 255, 255);
|
|
110
|
+
--tabs-bg-secondary-solid-light: rgb(65, 65, 65);
|
|
111
|
+
--tabs-bg-secondary-solid-dark: rgb(255, 255, 255);
|
|
112
|
+
|
|
113
|
+
--bg-danger-solid: rgb(224, 46, 42);
|
|
114
|
+
--text-danger-solid: rgb(255, 255, 255);
|
|
115
|
+
--bg-danger-solid-dark: rgb(224, 46, 42);
|
|
116
|
+
--text-danger-solid-dark: rgb(255, 255, 255);
|
|
117
|
+
|
|
118
|
+
--tabs-bg-primary-solid-light: rgb(24, 24, 24);
|
|
119
|
+
--tabs-bg-primary-solid-dark: rgb(255, 255, 255);
|
|
120
|
+
--tabs-bg-secondary-solid-light: rgb(65, 65, 65);
|
|
121
|
+
--tabs-bg-secondary-solid-dark: rgb(255, 255, 255);
|
|
122
|
+
--tabs-bg-danger-solid-light: rgb(224, 46, 42);
|
|
123
|
+
--tabs-bg-danger-solid-dark: rgb(224, 46, 42);
|
|
124
|
+
|
|
125
|
+
--bg-info-solid: rgb(2, 133, 255);
|
|
126
|
+
--text-info-solid: rgb(255, 255, 255);
|
|
127
|
+
--bg-info-solid-dark: rgb(76, 133, 255);
|
|
128
|
+
--text-info-solid-dark: rgb(255, 255, 255);
|
|
129
|
+
|
|
130
|
+
--tabs-bg-primary-solid-light: rgb(24, 24, 24);
|
|
131
|
+
--tabs-bg-primary-solid-dark: rgb(255, 255, 255);
|
|
132
|
+
--tabs-bg-secondary-solid-light: rgb(65, 65, 65);
|
|
133
|
+
--tabs-bg-secondary-solid-dark: rgb(255, 255, 255);
|
|
134
|
+
--tabs-bg-danger-solid-light: rgb(224, 46, 42);
|
|
135
|
+
--tabs-bg-danger-solid-dark: rgb(224, 46, 42);
|
|
136
|
+
--tabs-bg-info-solid-light: rgb(2, 133, 255);
|
|
137
|
+
--tabs-bg-info-solid-dark: rgb(76, 133, 255);
|
|
138
|
+
|
|
139
|
+
--bg-discovery-solid: rgb(146, 80, 247);
|
|
140
|
+
--text-discovery-solid: rgb(255, 255, 255);
|
|
141
|
+
--bg-discovery-solid-dark: rgb(146, 79, 247);
|
|
142
|
+
--text-discovery-solid-dark: rgb(255, 255, 255);
|
|
143
|
+
|
|
144
|
+
--bg-success-solid: rgb(0, 162, 64);
|
|
145
|
+
--text-success-solid: rgb(255, 255, 255);
|
|
146
|
+
--bg-success-solid-dark: rgb(40, 134, 53);
|
|
147
|
+
--text-success-solid-dark: rgb(255, 255, 255);
|
|
148
|
+
|
|
149
|
+
--bg-caution-solid: rgb(186, 142, 0);
|
|
150
|
+
--text-caution-solid: rgb(255, 255, 255);
|
|
151
|
+
--bg-caution-solid-dark: rgb(186, 142, 1);
|
|
152
|
+
--text-caution-solid-dark: rgb(255, 255, 255);
|
|
153
|
+
|
|
154
|
+
/* soft colors */
|
|
155
|
+
--bg-primary-soft: rgb(239, 239, 239);
|
|
156
|
+
--text-primary-soft: rgb(13, 13, 13);
|
|
157
|
+
--bg-primary-soft-dark: rgb(60, 60, 60);
|
|
158
|
+
--text-primary-soft-dark: rgb(255, 255, 255);
|
|
159
|
+
|
|
160
|
+
--bg-secondary-soft: rgb(239, 239, 239);
|
|
161
|
+
--text-secondary-soft: rgb(13, 13, 13);
|
|
162
|
+
--bg-secondary-soft-dark: rgb(60, 60, 60);
|
|
163
|
+
--text-secondary-soft-dark: rgb(255, 255, 255);
|
|
164
|
+
|
|
165
|
+
--bg-danger-soft: rgb(254, 227, 227);
|
|
166
|
+
--text-danger-soft: rgb(186, 38, 35);
|
|
167
|
+
--bg-danger-soft-dark: rgb(67, 38, 38);
|
|
168
|
+
--text-danger-soft-dark: rgb(250, 66, 62);
|
|
169
|
+
|
|
170
|
+
--bg-info-soft: rgb(227, 240, 255);
|
|
171
|
+
--text-info-soft: rgb(0, 79, 153);
|
|
172
|
+
--bg-info-soft-dark: rgb(33, 46, 62);
|
|
173
|
+
--text-info-soft-dark: rgb(51, 156, 255);
|
|
174
|
+
|
|
175
|
+
--bg-discovery-soft: rgb(239, 231, 254);
|
|
176
|
+
--text-discovery-soft: rgb(107, 58, 180);
|
|
177
|
+
--bg-discovery-soft-dark: rgb(49, 41, 65);
|
|
178
|
+
--text-discovery-soft-dark: rgb(190, 149, 250);
|
|
179
|
+
|
|
180
|
+
--bg-success-soft: rgb(223, 245, 231);
|
|
181
|
+
--text-success-soft: rgb(0, 134, 53);
|
|
182
|
+
--bg-success-soft-dark: rgb(32, 55, 40);
|
|
183
|
+
--text-success-soft-dark: rgb(4, 184, 76);
|
|
184
|
+
|
|
185
|
+
--bg-caution-soft: rgb(255, 246, 222);
|
|
186
|
+
--text-caution-soft: rgb(110, 84, 0);
|
|
187
|
+
--bg-caution-soft-dark: rgb(66, 58, 34);
|
|
188
|
+
--text-caution-soft-dark: rgb(255, 195, 0);
|
|
189
|
+
|
|
190
|
+
/* outline colors */
|
|
191
|
+
--bg-primary-outline: rgb(255, 255, 255);
|
|
192
|
+
--text-primary-outline: rgb(13, 13, 13);
|
|
193
|
+
--outline-primary-outline: rgb(13, 13, 13);
|
|
194
|
+
--bg-primary-outline-dark: rgb(33, 33, 33);
|
|
195
|
+
--text-primary-outline-dark: rgb(255, 255, 255);
|
|
196
|
+
--outline-primary-outline-dark: rgb(89, 89, 89);
|
|
197
|
+
|
|
198
|
+
--bg-secondary-outline: rgb(255, 255, 255);
|
|
199
|
+
--text-secondary-outline: rgb(93, 93, 93);
|
|
200
|
+
--outline-secondary-outline: rgb(93, 93, 93);
|
|
201
|
+
--bg-secondary-outline-dark: rgb(33, 33, 33);
|
|
202
|
+
--text-secondary-outline-dark: rgb(175, 175, 175);
|
|
203
|
+
--outline-secondary-outline-dark: rgb(89, 89, 89);
|
|
204
|
+
|
|
205
|
+
--bg-danger-outline: rgb(255, 255, 255);
|
|
206
|
+
--text-danger-outline: rgb(224, 46, 42);
|
|
207
|
+
--outline-danger-outline: rgb(224, 46, 42);
|
|
208
|
+
--bg-danger-outline-dark: rgb(33, 33, 33);
|
|
209
|
+
--text-danger-outline-dark: rgb(224, 46, 42);
|
|
210
|
+
--outline-danger-outline-dark: rgb(224, 46, 42);
|
|
211
|
+
|
|
212
|
+
--bg-info-outline: rgb(255, 255, 255);
|
|
213
|
+
--text-info-outline: rgb(1, 105, 204);
|
|
214
|
+
--outline-info-outline: rgb(1, 105, 204);
|
|
215
|
+
--bg-info-outline-dark: rgb(33, 33, 33);
|
|
216
|
+
--text-info-outline-dark: rgb(102, 181, 255);
|
|
217
|
+
--outline-info-outline-dark: rgb(102, 181, 255);
|
|
218
|
+
|
|
219
|
+
--bg-discovery-outline: rgb(255, 255, 255);
|
|
220
|
+
--text-discovery-outline: rgb(107, 58, 180);
|
|
221
|
+
--outline-discovery-outline: rgb(107, 58, 180);
|
|
222
|
+
--bg-discovery-outline-dark: rgb(33, 33, 33);
|
|
223
|
+
--text-discovery-outline-dark: rgb(146, 79, 247);
|
|
224
|
+
--outline-discovery-outline-dark: rgb(146, 79, 247);
|
|
225
|
+
|
|
226
|
+
--bg-success-outline: rgb(255, 255, 255);
|
|
227
|
+
--text-success-outline: rgb(0, 162, 64);
|
|
228
|
+
--outline-success-outline: rgb(0, 162, 64);
|
|
229
|
+
--bg-success-outline-dark: rgb(33, 33, 33);
|
|
230
|
+
--text-success-outline-dark: rgb(0, 162, 64);
|
|
231
|
+
--outline-success-outline-dark: rgb(0, 162, 64);
|
|
232
|
+
|
|
233
|
+
--bg-caution-outline: rgb(255, 255, 255);
|
|
234
|
+
--text-caution-outline: rgb(145, 111, 0);
|
|
235
|
+
--outline-caution-outline: rgb(145, 111, 0);
|
|
236
|
+
--bg-caution-outline-dark: rgb(33, 33, 33);
|
|
237
|
+
--text-caution-outline-dark: rgb(145, 111, 0);
|
|
238
|
+
--outline-caution-outline-dark: rgb(145, 111, 0);
|
|
239
|
+
|
|
240
|
+
/* ghost colors */
|
|
241
|
+
--bg-primary-ghost: rgb(255, 255, 255);
|
|
242
|
+
--text-primary-ghost: rgb(13, 13, 13);
|
|
243
|
+
--bg-primary-ghost-dark: rgb(33, 33, 33);
|
|
244
|
+
--text-primary-ghost-dark: rgb(255, 255, 255);
|
|
245
|
+
|
|
246
|
+
--bg-secondary-ghost: rgb(255, 255, 255);
|
|
247
|
+
--text-secondary-ghost: rgb(93, 93, 93);
|
|
248
|
+
--bg-secondary-ghost-dark: rgb(33, 33, 33);
|
|
249
|
+
--text-secondary-ghost-dark: rgb(175, 175, 175);
|
|
250
|
+
|
|
251
|
+
--bg-danger-ghost: rgb(255, 255, 255);
|
|
252
|
+
--text-danger-ghost: rgb(224, 46, 42);
|
|
253
|
+
--bg-danger-ghost-dark: rgb(33, 33, 33);
|
|
254
|
+
--text-danger-ghost-dark: rgb(224, 46, 42);
|
|
255
|
+
|
|
256
|
+
--bg-info-ghost: rgb(255, 255, 255);
|
|
257
|
+
--text-info-ghost: rgb(1, 105, 204);
|
|
258
|
+
--bg-info-ghost-dark: rgb(33, 33, 33);
|
|
259
|
+
--text-info-ghost-dark: rgb(102, 181, 255);
|
|
260
|
+
|
|
261
|
+
--bg-discovery-ghost: rgb(255, 255, 255);
|
|
262
|
+
--text-discovery-ghost: rgb(107, 58, 180);
|
|
263
|
+
--bg-discovery-ghost-dark: rgb(33, 33, 33);
|
|
264
|
+
--text-discovery-ghost-dark: rgb(128, 70, 217);
|
|
265
|
+
|
|
266
|
+
--bg-success-ghost: rgb(255, 255, 255);
|
|
267
|
+
--text-success-ghost: rgb(0, 162, 64);
|
|
268
|
+
--bg-success-ghost-dark: rgb(33, 33, 33);
|
|
269
|
+
--text-success-ghost-dark: rgb(0, 162, 64);
|
|
270
|
+
|
|
271
|
+
--bg-caution-ghost: rgb(255, 255, 255);
|
|
272
|
+
--text-caution-ghost: rgb(145, 111, 0);
|
|
273
|
+
--bg-caution-ghost-dark: rgb(33, 33, 33);
|
|
274
|
+
--text-caution-ghost-dark: rgb(145, 111, 0);
|
|
275
|
+
|
|
276
|
+
/* speed-dial */
|
|
277
|
+
--bc-speed-dial-transition: all .250s cubic-bezier(0.18, 1.89, 0.32, 1.28);
|
|
278
|
+
|
|
279
|
+
/* tabs */
|
|
280
|
+
--bg-tab-button: rgb(250, 250, 250);
|
|
281
|
+
--bg-tab-button-dark: rgb(24, 24, 24);
|
|
282
|
+
--bg-tab-button-selected-dark: rgb(0, 0, 0);
|
|
283
|
+
|
|
284
|
+
--tabs-bg-primary-solid-light: rgb(24, 24, 24);
|
|
285
|
+
--tabs-bg-primary-solid-dark: rgb(255, 255, 255);
|
|
286
|
+
--tabs-bg-secondary-solid-light: rgb(65, 65, 65);
|
|
287
|
+
--tabs-bg-secondary-solid-dark: rgb(255, 255, 255);
|
|
288
|
+
--tabs-bg-danger-solid-light: rgb(224, 46, 42);
|
|
289
|
+
--tabs-bg-danger-solid-dark: rgb(224, 46, 42);
|
|
290
|
+
--tabs-bg-info-solid-light: rgb(2, 133, 255);
|
|
291
|
+
--tabs-bg-info-solid-dark: rgb(76, 133, 255);
|
|
292
|
+
--tabs-bg-discovery-solid-light: rgb(146, 80, 247);
|
|
293
|
+
--tabs-bg-discovery-solid-dark: rgb(146, 79, 247);
|
|
294
|
+
--tabs-bg-success-solid-light: rgb(0, 162, 64);
|
|
295
|
+
--tabs-bg-success-solid-dark: rgb(40, 134, 53);
|
|
296
|
+
--tabs-bg-caution-solid-light: rgb(186, 142, 0);
|
|
297
|
+
--tabs-bg-caution-solid-dark: rgb(186, 142, 1);
|
|
298
|
+
|
|
299
|
+
/* <bc-progressbar /> */
|
|
300
|
+
--progressbar-track-light: rgb(229, 229, 229);
|
|
301
|
+
--progressbar-track-dark: rgb(0, 0, 0);
|
|
302
|
+
|
|
303
|
+
/* <bc-meter-track /> */
|
|
304
|
+
--meter-track-light: rgb(229, 229, 229);
|
|
305
|
+
--meter-track-dark: rgb(0, 0, 0);
|
|
306
|
+
|
|
307
|
+
/* <bc-slider /> */
|
|
308
|
+
--slider-light: rgb(135, 135, 135);
|
|
309
|
+
--slider-dark: rgb(135, 135, 135);
|
|
310
|
+
|
|
311
|
+
/* router links in <bc-list /> */
|
|
312
|
+
--router-link-transition: background-color .2s ease-in;
|
|
313
|
+
|
|
314
|
+
--router-link-exact-active-light: rgba(0, 0, 0, .07);
|
|
315
|
+
--router-link\:hover-light: rgba(0, 0, 0, .1);
|
|
316
|
+
--router-link\:active-light: rgba(0, 0, 0, .15);
|
|
317
|
+
|
|
318
|
+
--router-link-exact-active-dark: rgba(255, 255, 255, .08);
|
|
319
|
+
--router-link\:hover-dark: rgba(255, 255, 255, .1);
|
|
320
|
+
--router-link\:active-dark: rgba(0, 0, 0, .5);
|
|
321
|
+
|
|
322
|
+
/* <bc-dropdown /> */
|
|
323
|
+
--dropdown-color-light: rgb(0, 0, 0);
|
|
324
|
+
--dropdown-color-dark: rgb(255, 255, 255);
|
|
325
|
+
--dropdown-color-error: rgb(224, 46, 42);
|
|
326
|
+
|
|
327
|
+
--dropdown-item-selected-light: rgba(0, 0, 0, .07);
|
|
328
|
+
--dropdown-item\:hover-light: rgba(0, 0, 0, .1);
|
|
329
|
+
|
|
330
|
+
--dropdown-item-selected-dark: rgba(255, 255, 255, .08);
|
|
331
|
+
--dropdown-item\:hover-dark: rgba(255, 255, 255, .1);
|
|
332
|
+
|
|
333
|
+
/* <bc-lazy-image /> */
|
|
334
|
+
--lazy-image-light: rgb(249, 249, 249);
|
|
335
|
+
--lazy-image-dark: rgb(13, 13, 13);
|
|
336
|
+
--lazy-image-error: rgb(224, 46, 42);
|
|
337
|
+
|
|
338
|
+
/* <bc-btn-group /> */
|
|
339
|
+
--bc-btn-group-btn-selected: rgba(0, 0, 0, .3);
|
|
340
|
+
|
|
341
|
+
/* v-default-btn */
|
|
342
|
+
--v-default-btn: solid 2px rgba(255, 255, 255, .25);
|
|
343
|
+
--v-default-btn-outline-offset: -4px;
|
|
344
|
+
|
|
345
|
+
/* icon cell width for certain components */
|
|
346
|
+
--icon-cell-width: 32px;
|
|
347
|
+
|
|
348
|
+
/* zebra rows in <data-table /> */
|
|
349
|
+
--data-table-zebra-rows-even: rgba(0, 0, 0, .07);
|
|
350
|
+
--data-table-row-\:hover: rgba(0, 0, 0, .1);
|
|
351
|
+
|
|
352
|
+
/* @todo: css scrollbars */
|
|
353
|
+
}
|