@bcc-code/component-library-vue 0.0.0-dev.053d9fc → 0.0.0-dev.074c31f
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 +32 -32
- package/dist/component-library.js +35109 -30921
- package/dist/component-library.umd.cjs +6830 -5606
- package/dist/index.css +1 -1
- package/dist/quill-BfNQeuzX.js +7524 -0
- package/dist/theme.css +1208 -1064
- package/dist-types/components/custom/BccAppNavigation/BccAppNavigation.vue.d.ts +32 -0
- package/dist-types/components/custom/BccBadge/BccBadge.vue.d.ts +2 -0
- package/dist-types/components/custom/BccCapacityIndicator/BccCapacityIndicator.vue.d.ts +3 -0
- package/dist-types/components/custom/BccCircleLoader/BccCircleLoader.vue.d.ts +9 -1
- package/dist-types/components/custom/BccDialKnob/BccDialKnob.vue.d.ts +1 -1
- package/dist-types/components/custom/BccGraphic/BccGraphic.vue.d.ts +7 -4
- package/dist-types/components/custom/BccNpsResult/BccNpsResult.vue.d.ts +2 -2
- package/dist-types/components/custom/BccReact/BccReact.vue.d.ts +3 -2
- package/dist-types/components/custom/BccStepIndicator/BccStepIndicator.vue.d.ts +28 -0
- package/dist-types/components/custom/BccTag/BccTag.vue.d.ts +1 -0
- package/dist-types/components/custom/BccTopNavigation/BccTopNavigation.vue.d.ts +57 -0
- package/dist-types/components/custom/index.d.ts +6 -2
- package/dist-types/components/wrapped/BccAvatar/BccAvatar.vue.d.ts +2 -2
- package/dist-types/components/wrapped/BccButton.vue.d.ts +1 -0
- package/dist-types/components/wrapped/BccCheckbox.vue.d.ts +3 -0
- package/dist-types/components/wrapped/BccChip/BccChip.vue.d.ts +18 -0
- package/dist-types/components/wrapped/BccImage.vue.d.ts +17 -0
- package/dist-types/components/wrapped/BccMenu/BccMenu.vue.d.ts +28 -0
- package/dist-types/components/wrapped/BccMessage.vue.d.ts +8 -2
- package/dist-types/components/wrapped/BccRadioButton.vue.d.ts +21 -0
- package/dist-types/components/wrapped/BccSelectButton.vue.d.ts +20 -0
- package/dist-types/components/wrapped/BccTabs/BccTabs.vue.d.ts +2 -0
- package/dist-types/components/wrapped/BccToggle/BccToggle.vue.d.ts +12 -1
- package/dist-types/components/wrapped/index.d.ts +11 -0
- package/dist-types/index.d.ts +15 -7
- package/package.json +12 -7
- package/dist-types/components/custom/BccStepper/BccStepper.vue.d.ts +0 -16
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,7 +14,16 @@ 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
|
+
|
|
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
|
+
|
|
21
|
+
```ini
|
|
22
|
+
public-hoist-pattern[]=@bcc-code/icons-vue
|
|
23
|
+
public-hoist-pattern[]=@bcc-code/design-tokens
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then run `pnpm install` again. With npm or Yarn this is not needed.
|
|
18
27
|
|
|
19
28
|
## Quick start
|
|
20
29
|
|
|
@@ -32,11 +41,8 @@ app.mount('#app');
|
|
|
32
41
|
|
|
33
42
|
2. **Add styles** using one of the two options below.
|
|
34
43
|
|
|
35
|
-
---
|
|
36
44
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
### Option 1 — Recommended: full Tailwind in your app
|
|
45
|
+
### Styles Option 1 — Recommended: full Tailwind in your app
|
|
40
46
|
|
|
41
47
|
Use this if you want Tailwind utility classes in your own templates and only ship the classes you use (tree-shaking).
|
|
42
48
|
|
|
@@ -60,7 +66,7 @@ export default defineConfig({
|
|
|
60
66
|
|
|
61
67
|
Tailwind will run as part of your build and only include the utility classes that appear in your app and in the library.
|
|
62
68
|
|
|
63
|
-
### Option 2 — Pre-built CSS only
|
|
69
|
+
### Styles Option 2 — Pre-built CSS only
|
|
64
70
|
|
|
65
71
|
Use this if you don’t want Tailwind in your project and only need the library’s styles and components.
|
|
66
72
|
|
|
@@ -72,11 +78,10 @@ import '@bcc-code/component-library-vue/style.css';
|
|
|
72
78
|
|
|
73
79
|
You get the BCC theme and component styles only; no Tailwind utilities in your app.
|
|
74
80
|
|
|
75
|
-
---
|
|
76
81
|
|
|
77
|
-
|
|
82
|
+
# Components
|
|
78
83
|
|
|
79
|
-
All components are namespaced with `Bcc`. Use them in templates or register them globally
|
|
84
|
+
All components are namespaced with `Bcc`. Use them in templates or register them globally in your `main.ts`.
|
|
80
85
|
|
|
81
86
|
**Example:**
|
|
82
87
|
|
|
@@ -96,37 +101,23 @@ const name = ref('');
|
|
|
96
101
|
</script>
|
|
97
102
|
```
|
|
98
103
|
|
|
99
|
-
|
|
104
|
+
**Example:**
|
|
100
105
|
|
|
101
106
|
```ts
|
|
102
107
|
// main.ts
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const app = createApp(…)
|
|
106
|
-
BccComponentLibrary(app);
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
```css
|
|
110
|
-
/* styles.css */
|
|
111
|
-
@import '@bcc-code/component-library-vue/theme.css';
|
|
108
|
+
...
|
|
109
|
+
import { BccButton, BccInput } from '@bcc-code/component-library-vue';
|
|
112
110
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
Archivo,
|
|
117
|
-
system-ui,
|
|
118
|
-
-apple-system,
|
|
119
|
-
BlinkMacSystemFont,
|
|
120
|
-
'Segoe UI',
|
|
121
|
-
'Open Sans',
|
|
122
|
-
sans-serif;
|
|
111
|
+
// After app.use(BccComponentLibrary)
|
|
112
|
+
app.component('BccButton', BccButton);
|
|
113
|
+
app.component('BccInput', BccInput);
|
|
123
114
|
```
|
|
124
115
|
|
|
125
116
|
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.
|
|
126
117
|
|
|
127
118
|
---
|
|
128
119
|
|
|
129
|
-
|
|
120
|
+
# Development
|
|
130
121
|
|
|
131
122
|
```bash
|
|
132
123
|
pnpm install
|
|
@@ -135,6 +126,15 @@ pnpm run build # Typecheck, types, and Vite build
|
|
|
135
126
|
pnpm run build:vite # Vite build only (includes theme.css)
|
|
136
127
|
```
|
|
137
128
|
|
|
129
|
+
### Folder structure (where to work)
|
|
130
|
+
|
|
131
|
+
- `src/components/custom`: New BCC-first components and component-specific styles/logic.
|
|
132
|
+
- `src/components/wrapped`: PrimeVue wrapped components (`Bcc*`) where we adapt APIs, defaults, slots, and behavior.
|
|
133
|
+
- `src/styles`: Design-system CSS layers (theme, contexts, semantic tokens, utility classes).
|
|
134
|
+
- `src/index.ts`: Public exports; add new components/composables here so consumers can import them.
|
|
135
|
+
- `docs` and `*.mdx`: Storybook docs pages and design guidance content.
|
|
136
|
+
- `*.stories.ts`/`*.mdx` (in `src` or `docs`): Demos, docs, and regression coverage for components.
|
|
137
|
+
|
|
138
138
|
### Patching PrimeVue icons
|
|
139
139
|
|
|
140
140
|
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.
|