@bcc-code/component-library-vue 0.0.0-dev.f6647b3 → 0.0.0-dev.f9b52cc
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 +31 -35
- package/dist/component-library.js +9218 -7967
- package/dist/component-library.umd.cjs +1223 -195
- package/dist/index.css +1 -1
- package/dist/library-utilities.css +2 -0
- package/dist/quill-BfNQeuzX.js +7524 -0
- package/dist/sfc-styles.css +1 -0
- package/dist/theme.css +737 -704
- 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 +3 -2
- package/dist-types/components/custom/BccStepIndicator/BccStepIndicator.vue.d.ts +3 -3
- package/dist-types/components/custom/BccTag/BccTag.vue.d.ts +1 -0
- package/dist-types/components/custom/BccTopNavigation/BccTopNavigation.vue.d.ts +14 -4
- 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 +3 -0
- package/dist-types/components/wrapped/BccSelectButton.vue.d.ts +5 -2
- package/dist-types/index.d.ts +1 -0
- package/package.json +111 -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,14 @@ 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` includes:
|
|
68
|
+
|
|
69
|
+
- BCC design tokens, `@theme` / `@utility` definitions, and the rest of the design-system CSS inlined from `src/style.css` (including component-specific rules such as `BccInput` icon sizing and `BccButton` context tokens).
|
|
70
|
+
- `library-utilities.css`, the pre-compiled Tailwind **utility class** rules used inside library templates (which your build cannot infer from the published JS).
|
|
71
|
+
|
|
72
|
+
Do **not** rely on `library-utilities.css` alone with a minimal “base” import: you still need the full `theme.css` (or `style.css` for Option 2) so non-utility component styles and tokens are present.
|
|
71
73
|
|
|
72
|
-
### Option 2 — Pre-built CSS only
|
|
74
|
+
### Styles Option 2 — Pre-built CSS only
|
|
73
75
|
|
|
74
76
|
Use this if you don’t want Tailwind in your project and only need the library’s styles and components.
|
|
75
77
|
|
|
@@ -81,11 +83,10 @@ import '@bcc-code/component-library-vue/style.css';
|
|
|
81
83
|
|
|
82
84
|
You get the BCC theme and component styles only; no Tailwind utilities in your app.
|
|
83
85
|
|
|
84
|
-
---
|
|
85
86
|
|
|
86
|
-
|
|
87
|
+
# Components
|
|
87
88
|
|
|
88
|
-
All components are namespaced with `Bcc`. Use them in templates or register them globally
|
|
89
|
+
All components are namespaced with `Bcc`. Use them in templates or register them globally in your `main.ts`.
|
|
89
90
|
|
|
90
91
|
**Example:**
|
|
91
92
|
|
|
@@ -105,37 +106,23 @@ const name = ref('');
|
|
|
105
106
|
</script>
|
|
106
107
|
```
|
|
107
108
|
|
|
108
|
-
|
|
109
|
+
**Example:**
|
|
109
110
|
|
|
110
111
|
```ts
|
|
111
112
|
// 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';
|
|
113
|
+
...
|
|
114
|
+
import { BccButton, BccInput } from '@bcc-code/component-library-vue';
|
|
121
115
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
Archivo,
|
|
126
|
-
system-ui,
|
|
127
|
-
-apple-system,
|
|
128
|
-
BlinkMacSystemFont,
|
|
129
|
-
'Segoe UI',
|
|
130
|
-
'Open Sans',
|
|
131
|
-
sans-serif;
|
|
116
|
+
// After app.use(BccComponentLibrary)
|
|
117
|
+
app.component('BccButton', BccButton);
|
|
118
|
+
app.component('BccInput', BccInput);
|
|
132
119
|
```
|
|
133
120
|
|
|
134
121
|
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
122
|
|
|
136
123
|
---
|
|
137
124
|
|
|
138
|
-
|
|
125
|
+
# Development
|
|
139
126
|
|
|
140
127
|
```bash
|
|
141
128
|
pnpm install
|
|
@@ -144,6 +131,15 @@ pnpm run build # Typecheck, types, and Vite build
|
|
|
144
131
|
pnpm run build:vite # Vite build only (includes theme.css)
|
|
145
132
|
```
|
|
146
133
|
|
|
134
|
+
### Folder structure (where to work)
|
|
135
|
+
|
|
136
|
+
- `src/components/custom`: New BCC-first components and component-specific styles/logic.
|
|
137
|
+
- `src/components/wrapped`: PrimeVue wrapped components (`Bcc*`) where we adapt APIs, defaults, slots, and behavior.
|
|
138
|
+
- `src/styles`: Design-system CSS layers (theme, contexts, semantic tokens, utility classes).
|
|
139
|
+
- `src/index.ts`: Public exports; add new components/composables here so consumers can import them.
|
|
140
|
+
- `docs` and `*.mdx`: Storybook docs pages and design guidance content.
|
|
141
|
+
- `*.stories.ts`/`*.mdx` (in `src` or `docs`): Demos, docs, and regression coverage for components.
|
|
142
|
+
|
|
147
143
|
### Patching PrimeVue icons
|
|
148
144
|
|
|
149
145
|
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.
|