@bcc-code/component-library-vue 0.0.0-dev.f3f88c3 → 0.0.0-dev.f41f3d5
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 +33 -35
- package/dist/archivo-font/archivo-v25-latin-500.woff2 +0 -0
- package/dist/archivo-font/archivo-v25-latin-600.woff2 +0 -0
- package/dist/archivo-font/archivo-v25-latin-600italic.woff2 +0 -0
- package/dist/archivo-font/archivo-v25-latin-italic.woff2 +0 -0
- package/dist/archivo-font/archivo-v25-latin-regular.woff2 +0 -0
- package/dist/archivo-font.css +40 -0
- package/dist/component-library.js +13516 -12428
- package/dist/component-library.umd.cjs +1294 -399
- 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 +808 -800
- 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/BccImage/BccImage.vue.d.ts +54 -0
- package/dist-types/components/custom/BccLightbox/BccLightboxMedia.vue.d.ts +18 -0
- package/dist-types/components/custom/BccLightbox/composables.d.ts +23 -0
- package/dist-types/components/custom/BccLightbox/detectMedia.d.ts +4 -0
- package/dist-types/components/custom/BccLightbox/index.d.ts +6 -0
- package/dist-types/components/custom/BccLightbox/state.d.ts +33 -0
- package/dist-types/components/custom/BccLightbox/types.d.ts +31 -0
- package/dist-types/components/custom/BccNpsScore/BccNpsScore.vue.d.ts +1 -1
- 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/custom/index.d.ts +3 -1
- package/dist-types/components/wrapped/BccButton.vue.d.ts +4 -3
- package/dist-types/components/wrapped/BccCheckbox.vue.d.ts +3 -0
- package/dist-types/components/wrapped/BccMenu/BccMenu.vue.d.ts +15 -1
- package/dist-types/components/wrapped/BccMessage.vue.d.ts +6 -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/components/wrapped/index.d.ts +0 -2
- package/dist-types/index.d.ts +1 -0
- package/package.json +111 -103
- package/dist-types/components/wrapped/BccImage.vue.d.ts +0 -17
- /package/dist-types/components/custom/{BccCircleLoader/BccCircleLoader.vue.d.ts → BccLightbox/BccLightbox.vue.d.ts} +0 -0
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
|
|
|
@@ -65,11 +62,18 @@ export default defineConfig({
|
|
|
65
62
|
|
|
66
63
|
```css
|
|
67
64
|
@import '@bcc-code/component-library-vue/theme.css';
|
|
65
|
+
/* Optional, if not already included */
|
|
66
|
+
@import '@bcc-code/component-library-vue/archivo-font.css';
|
|
68
67
|
```
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
That single import is enough. `theme.css` includes:
|
|
70
|
+
|
|
71
|
+
- 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).
|
|
72
|
+
- `library-utilities.css`, the pre-compiled Tailwind **utility class** rules used inside library templates (which your build cannot infer from the published JS).
|
|
73
|
+
|
|
74
|
+
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
75
|
|
|
72
|
-
### Option 2 — Pre-built CSS only
|
|
76
|
+
### Styles Option 2 — Pre-built CSS only
|
|
73
77
|
|
|
74
78
|
Use this if you don’t want Tailwind in your project and only need the library’s styles and components.
|
|
75
79
|
|
|
@@ -81,11 +85,10 @@ import '@bcc-code/component-library-vue/style.css';
|
|
|
81
85
|
|
|
82
86
|
You get the BCC theme and component styles only; no Tailwind utilities in your app.
|
|
83
87
|
|
|
84
|
-
---
|
|
85
88
|
|
|
86
|
-
|
|
89
|
+
# Components
|
|
87
90
|
|
|
88
|
-
All components are namespaced with `Bcc`. Use them in templates or register them globally
|
|
91
|
+
All components are namespaced with `Bcc`. Use them in templates or register them globally in your `main.ts`.
|
|
89
92
|
|
|
90
93
|
**Example:**
|
|
91
94
|
|
|
@@ -105,37 +108,23 @@ const name = ref('');
|
|
|
105
108
|
</script>
|
|
106
109
|
```
|
|
107
110
|
|
|
108
|
-
|
|
111
|
+
**Example:**
|
|
109
112
|
|
|
110
113
|
```ts
|
|
111
114
|
// 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';
|
|
115
|
+
...
|
|
116
|
+
import { BccButton, BccInput } from '@bcc-code/component-library-vue';
|
|
121
117
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
Archivo,
|
|
126
|
-
system-ui,
|
|
127
|
-
-apple-system,
|
|
128
|
-
BlinkMacSystemFont,
|
|
129
|
-
'Segoe UI',
|
|
130
|
-
'Open Sans',
|
|
131
|
-
sans-serif;
|
|
118
|
+
// After app.use(BccComponentLibrary)
|
|
119
|
+
app.component('BccButton', BccButton);
|
|
120
|
+
app.component('BccInput', BccInput);
|
|
132
121
|
```
|
|
133
122
|
|
|
134
123
|
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
124
|
|
|
136
125
|
---
|
|
137
126
|
|
|
138
|
-
|
|
127
|
+
# Development
|
|
139
128
|
|
|
140
129
|
```bash
|
|
141
130
|
pnpm install
|
|
@@ -144,6 +133,15 @@ pnpm run build # Typecheck, types, and Vite build
|
|
|
144
133
|
pnpm run build:vite # Vite build only (includes theme.css)
|
|
145
134
|
```
|
|
146
135
|
|
|
136
|
+
### Folder structure (where to work)
|
|
137
|
+
|
|
138
|
+
- `src/components/custom`: New BCC-first components and component-specific styles/logic.
|
|
139
|
+
- `src/components/wrapped`: PrimeVue wrapped components (`Bcc*`) where we adapt APIs, defaults, slots, and behavior.
|
|
140
|
+
- `src/styles`: Design-system CSS layers (theme, contexts, semantic tokens, utility classes).
|
|
141
|
+
- `src/index.ts`: Public exports; add new components/composables here so consumers can import them.
|
|
142
|
+
- `docs` and `*.mdx`: Storybook docs pages and design guidance content.
|
|
143
|
+
- `*.stories.ts`/`*.mdx` (in `src` or `docs`): Demos, docs, and regression coverage for components.
|
|
144
|
+
|
|
147
145
|
### Patching PrimeVue icons
|
|
148
146
|
|
|
149
147
|
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.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* archivo-regular - latin */
|
|
2
|
+
@font-face {
|
|
3
|
+
font-display: swap;
|
|
4
|
+
font-family: 'Archivo';
|
|
5
|
+
font-style: normal;
|
|
6
|
+
font-weight: 400;
|
|
7
|
+
src: url('./archivo-font/archivo-v25-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
|
|
8
|
+
}
|
|
9
|
+
/* archivo-italic - latin */
|
|
10
|
+
@font-face {
|
|
11
|
+
font-display: swap;
|
|
12
|
+
font-family: 'Archivo';
|
|
13
|
+
font-style: italic;
|
|
14
|
+
font-weight: 400;
|
|
15
|
+
src: url('./archivo-font/archivo-v25-latin-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
|
|
16
|
+
}
|
|
17
|
+
/* archivo-500 - latin */
|
|
18
|
+
@font-face {
|
|
19
|
+
font-display: swap;
|
|
20
|
+
font-family: 'Archivo';
|
|
21
|
+
font-style: normal;
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
src: url('./archivo-font/archivo-v25-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
|
|
24
|
+
}
|
|
25
|
+
/* archivo-600 - latin */
|
|
26
|
+
@font-face {
|
|
27
|
+
font-display: swap;
|
|
28
|
+
font-family: 'Archivo';
|
|
29
|
+
font-style: normal;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
src: url('./archivo-font/archivo-v25-latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
|
|
32
|
+
}
|
|
33
|
+
/* archivo-600italic - latin */
|
|
34
|
+
@font-face {
|
|
35
|
+
font-display: swap;
|
|
36
|
+
font-family: 'Archivo';
|
|
37
|
+
font-style: italic;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
src: url('./archivo-font/archivo-v25-latin-600italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
|
|
40
|
+
}
|