@bcc-code/component-library-vue 0.0.0-dev.d519e03 → 0.0.0-dev.d6deb51

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.
Files changed (43) hide show
  1. package/README.md +33 -35
  2. package/dist/archivo-font/archivo-v25-latin-500.woff2 +0 -0
  3. package/dist/archivo-font/archivo-v25-latin-600.woff2 +0 -0
  4. package/dist/archivo-font/archivo-v25-latin-600italic.woff2 +0 -0
  5. package/dist/archivo-font/archivo-v25-latin-italic.woff2 +0 -0
  6. package/dist/archivo-font/archivo-v25-latin-regular.woff2 +0 -0
  7. package/dist/archivo-font.css +40 -0
  8. package/dist/component-library.js +17735 -14139
  9. package/dist/component-library.umd.cjs +2525 -1630
  10. package/dist/index.css +1 -1
  11. package/dist/library-utilities.css +2 -0
  12. package/dist/quill-BfNQeuzX.js +7524 -0
  13. package/dist/sfc-styles.css +1 -0
  14. package/dist/theme.css +1020 -963
  15. package/dist-types/components/custom/BccAppNavigation/BccAppNavigation.vue.d.ts +33 -0
  16. package/dist-types/components/custom/BccCapacityIndicator/BccCapacityIndicator.vue.d.ts +3 -0
  17. package/dist-types/components/custom/BccDialKnob/BccDialKnob.vue.d.ts +1 -1
  18. package/dist-types/components/custom/BccGraphic/BccGraphic.vue.d.ts +7 -4
  19. package/dist-types/components/custom/BccImage/BccImage.vue.d.ts +54 -0
  20. package/dist-types/components/custom/BccNpsScore/BccNpsScore.vue.d.ts +1 -1
  21. package/dist-types/components/custom/BccReact/BccReact.vue.d.ts +2 -1
  22. package/dist-types/components/custom/BccStepIndicator/BccStepIndicator.vue.d.ts +3 -3
  23. package/dist-types/components/custom/BccTag/BccTag.vue.d.ts +1 -0
  24. package/dist-types/components/custom/BccTopNavigation/BccTopNavigation.vue.d.ts +57 -0
  25. package/dist-types/components/custom/index.d.ts +6 -1
  26. package/dist-types/components/wrapped/BccButton.vue.d.ts +4 -3
  27. package/dist-types/components/wrapped/BccCheckbox.vue.d.ts +3 -0
  28. package/dist-types/components/wrapped/BccMenu/BccMenu.vue.d.ts +16 -6
  29. package/dist-types/components/wrapped/BccMessage.vue.d.ts +8 -2
  30. package/dist-types/components/wrapped/BccRadioButton.vue.d.ts +21 -0
  31. package/dist-types/components/wrapped/BccSelectButton.vue.d.ts +20 -0
  32. package/dist-types/components/wrapped/BccTabs/BccTabs.vue.d.ts +2 -0
  33. package/dist-types/components/wrapped/BccToggle/BccToggle.vue.d.ts +7 -2
  34. package/dist-types/components/wrapped/index.d.ts +4 -0
  35. package/dist-types/index.d.ts +2 -3
  36. package/dist-types/lightbox/BccLightboxMedia.vue.d.ts +18 -0
  37. package/dist-types/lightbox/composables.d.ts +23 -0
  38. package/dist-types/lightbox/detectMedia.d.ts +4 -0
  39. package/dist-types/lightbox/index.d.ts +7 -0
  40. package/dist-types/lightbox/state.d.ts +30 -0
  41. package/dist-types/lightbox/types.d.ts +24 -0
  42. package/package.json +111 -103
  43. /package/dist-types/{components/custom/BccCircleLoader/BccCircleLoader.vue.d.ts → lightbox/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
- ## View on with [Storybook](https://components.bcc.no)
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
- **Peer dependency:** Vue 3.
17
+ **Min requirements:** Vue 3.
18
18
 
19
- **pnpm and BCC packages:** The library depends on `@bcc-code/icons-vue` and `@bcc-code/design-tokens`. To use them in your app (e.g. `import { CheckIcon } from '@bcc-code/icons-vue'` or design token imports) without adding those packages to your own `package.json`, add this to your project’s **`.npmrc`** so pnpm hoists them:
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 and only ship the classes you use (tree-shaking).
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
- Tailwind will run as part of your build and only include the utility classes that appear in your app and in the library.
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
- ## Using components
89
+ # Components
87
90
 
88
- All components are namespaced with `Bcc`. Use them in templates or register them globally after `app.use(BccComponentLibrary)`.
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
- # Setup
111
+ **Example:**
109
112
 
110
113
  ```ts
111
114
  // main.ts
112
- import { BccComponentLibrary } from '@bcc-code/component-library-vue';
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
- /* Optional include the archivo font */
123
- @import '@bcc-code/component-library-vue/archivo-font.css';
124
- font-family:
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
- ## Development
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.
@@ -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
+ }