@bcc-code/component-library-vue 0.0.0-dev.f421703 → 0.0.0-dev.f4380ac
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 +29 -35
- package/dist/component-library.js +7540 -6333
- package/dist/component-library.umd.cjs +1214 -186
- package/dist/index.css +1 -1
- package/dist/library-utilities.css +2 -0
- package/dist/quill-BfNQeuzX.js +7524 -0
- package/dist/theme.css +651 -622
- package/dist-types/components/custom/BccAppNavigation/BccAppNavigation.vue.d.ts +1 -0
- package/dist-types/components/custom/BccGraphic/BccGraphic.vue.d.ts +7 -4
- package/dist-types/components/custom/BccReact/BccReact.vue.d.ts +1 -1
- package/dist-types/components/custom/BccTopNavigation/BccTopNavigation.vue.d.ts +1 -1
- package/dist-types/components/wrapped/BccCheckbox.vue.d.ts +3 -0
- package/dist-types/components/wrapped/BccMessage.vue.d.ts +5 -1
- package/dist-types/components/wrapped/BccRadioButton.vue.d.ts +2 -0
- package/dist-types/index.d.ts +1 -0
- package/package.json +109 -103
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @bcc-code/component-library-vue
|
|
2
2
|
|
|
3
|
-
Vue 3 component library built on [PrimeVue](https://primevue.org/) and BCC design tokens. You only need this package—no separate Tailwind or PrimeVue install.
|
|
3
|
+
Vue 3 component library built on [PrimeVue](https://primevue.org/) and BCC design tokens. You **only** need this package—no separate Tailwind or PrimeVue install.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### [Storybook Link](https://components.bcc.no)
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -14,9 +14,9 @@ npm install @bcc-code/component-library-vue
|
|
|
14
14
|
yarn add @bcc-code/component-library-vue
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
**
|
|
17
|
+
**Min requirements:** Vue 3.
|
|
18
18
|
|
|
19
|
-
**
|
|
19
|
+
**Note to PNPM installs:** The library uses `@bcc-code/icons-vue` and `@bcc-code/design-tokens`. To use them in your own app (e.g. `import { CheckIcon } from '@bcc-code/icons-vue'`) without needing to explicitly add install them in your own `package.json`, add this to your project’s **`.npmrc`** so pnpm hoists them:
|
|
20
20
|
|
|
21
21
|
```ini
|
|
22
22
|
public-hoist-pattern[]=@bcc-code/icons-vue
|
|
@@ -41,13 +41,10 @@ app.mount('#app');
|
|
|
41
41
|
|
|
42
42
|
2. **Add styles** using one of the two options below.
|
|
43
43
|
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Styling: two options
|
|
47
44
|
|
|
48
|
-
### Option 1 — Recommended: full Tailwind in your app
|
|
45
|
+
### Styles Option 1 — Recommended: full Tailwind in your app
|
|
49
46
|
|
|
50
|
-
Use this if you want Tailwind utility classes in your own templates
|
|
47
|
+
Use this if you want Tailwind utility classes in your own templates while still letting the library's components render correctly.
|
|
51
48
|
|
|
52
49
|
1. **Add the Tailwind Vite plugin** (the package brings Tailwind in as a dependency; you only wire it up):
|
|
53
50
|
|
|
@@ -67,9 +64,12 @@ export default defineConfig({
|
|
|
67
64
|
@import '@bcc-code/component-library-vue/theme.css';
|
|
68
65
|
```
|
|
69
66
|
|
|
70
|
-
|
|
67
|
+
That single import is enough. `theme.css` does two things:
|
|
71
68
|
|
|
72
|
-
|
|
69
|
+
- It exposes the BCC design tokens and Tailwind utilities.
|
|
70
|
+
- It also imports `library-utilities.css`, the pre-compiled CSS for the utility classes used **inside** the library's own components.
|
|
71
|
+
|
|
72
|
+
### Styles Option 2 — Pre-built CSS only
|
|
73
73
|
|
|
74
74
|
Use this if you don’t want Tailwind in your project and only need the library’s styles and components.
|
|
75
75
|
|
|
@@ -81,11 +81,10 @@ import '@bcc-code/component-library-vue/style.css';
|
|
|
81
81
|
|
|
82
82
|
You get the BCC theme and component styles only; no Tailwind utilities in your app.
|
|
83
83
|
|
|
84
|
-
---
|
|
85
84
|
|
|
86
|
-
|
|
85
|
+
# Components
|
|
87
86
|
|
|
88
|
-
All components are namespaced with `Bcc`. Use them in templates or register them globally
|
|
87
|
+
All components are namespaced with `Bcc`. Use them in templates or register them globally in your `main.ts`.
|
|
89
88
|
|
|
90
89
|
**Example:**
|
|
91
90
|
|
|
@@ -105,37 +104,23 @@ const name = ref('');
|
|
|
105
104
|
</script>
|
|
106
105
|
```
|
|
107
106
|
|
|
108
|
-
|
|
107
|
+
**Example:**
|
|
109
108
|
|
|
110
109
|
```ts
|
|
111
110
|
// main.ts
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const app = createApp(…)
|
|
115
|
-
BccComponentLibrary(app);
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
```css
|
|
119
|
-
/* styles.css */
|
|
120
|
-
@import '@bcc-code/component-library-vue/theme.css';
|
|
111
|
+
...
|
|
112
|
+
import { BccButton, BccInput } from '@bcc-code/component-library-vue';
|
|
121
113
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
Archivo,
|
|
126
|
-
system-ui,
|
|
127
|
-
-apple-system,
|
|
128
|
-
BlinkMacSystemFont,
|
|
129
|
-
'Segoe UI',
|
|
130
|
-
'Open Sans',
|
|
131
|
-
sans-serif;
|
|
114
|
+
// After app.use(BccComponentLibrary)
|
|
115
|
+
app.component('BccButton', BccButton);
|
|
116
|
+
app.component('BccInput', BccInput);
|
|
132
117
|
```
|
|
133
118
|
|
|
134
119
|
The library exports both **custom BCC components** (e.g. `BccBadge`, `BccFrame`, `BccReact`) and **wrapped PrimeVue components** (e.g. `BccButton`, `BccDialog`, `BccDataTable`). PrimeVue services (Toast, Confirm, Dialog) are configured by `BccComponentLibrary`; use the composables `useToast`, `useConfirm`, and `useDialog` from the library when you need them.
|
|
135
120
|
|
|
136
121
|
---
|
|
137
122
|
|
|
138
|
-
|
|
123
|
+
# Development
|
|
139
124
|
|
|
140
125
|
```bash
|
|
141
126
|
pnpm install
|
|
@@ -144,6 +129,15 @@ pnpm run build # Typecheck, types, and Vite build
|
|
|
144
129
|
pnpm run build:vite # Vite build only (includes theme.css)
|
|
145
130
|
```
|
|
146
131
|
|
|
132
|
+
### Folder structure (where to work)
|
|
133
|
+
|
|
134
|
+
- `src/components/custom`: New BCC-first components and component-specific styles/logic.
|
|
135
|
+
- `src/components/wrapped`: PrimeVue wrapped components (`Bcc*`) where we adapt APIs, defaults, slots, and behavior.
|
|
136
|
+
- `src/styles`: Design-system CSS layers (theme, contexts, semantic tokens, utility classes).
|
|
137
|
+
- `src/index.ts`: Public exports; add new components/composables here so consumers can import them.
|
|
138
|
+
- `docs` and `*.mdx`: Storybook docs pages and design guidance content.
|
|
139
|
+
- `*.stories.ts`/`*.mdx` (in `src` or `docs`): Demos, docs, and regression coverage for components.
|
|
140
|
+
|
|
147
141
|
### Patching PrimeVue icons
|
|
148
142
|
|
|
149
143
|
Some PrimeVue icons are replaced with [@bcc-code/icons-vue](https://www.npmjs.com/package/@bcc-code/icons-vue) so the library uses BCC iconography. The patch is maintained with pnpm’s built-in patching.
|