@bcc-code/component-library-vue 0.0.0-dev.5cf5377 → 0.0.0-dev.5dfa3f9

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 (34) hide show
  1. package/README.md +39 -34
  2. package/dist/component-library.js +37241 -33306
  3. package/dist/component-library.umd.cjs +7173 -6145
  4. package/dist/index.css +1 -1
  5. package/dist/library-utilities.css +2 -0
  6. package/dist/quill-BfNQeuzX.js +7524 -0
  7. package/dist/sfc-styles.css +1 -0
  8. package/dist/theme.css +1300 -1068
  9. package/dist-types/components/custom/BccAppNavigation/BccAppNavigation.vue.d.ts +33 -0
  10. package/dist-types/components/custom/BccBadge/BccBadge.vue.d.ts +2 -0
  11. package/dist-types/components/custom/BccCapacityIndicator/BccCapacityIndicator.vue.d.ts +3 -0
  12. package/dist-types/components/custom/BccDialKnob/BccDialKnob.vue.d.ts +1 -1
  13. package/dist-types/components/custom/BccGraphic/BccGraphic.vue.d.ts +7 -4
  14. package/dist-types/components/custom/BccNpsResult/BccNpsResult.vue.d.ts +2 -2
  15. package/dist-types/components/custom/BccReact/BccReact.vue.d.ts +2 -1
  16. package/dist-types/components/custom/BccStepIndicator/BccStepIndicator.vue.d.ts +28 -0
  17. package/dist-types/components/custom/BccTag/BccTag.vue.d.ts +1 -0
  18. package/dist-types/components/custom/BccTopNavigation/BccTopNavigation.vue.d.ts +57 -0
  19. package/dist-types/components/custom/index.d.ts +6 -7
  20. package/dist-types/components/{custom → wrapped}/BccAvatar/BccAvatar.vue.d.ts +2 -2
  21. package/dist-types/components/wrapped/BccButton.vue.d.ts +5 -3
  22. package/dist-types/components/wrapped/BccCheckbox.vue.d.ts +4 -0
  23. package/dist-types/components/wrapped/BccChip/BccChip.vue.d.ts +18 -0
  24. package/dist-types/components/wrapped/BccImage.vue.d.ts +17 -0
  25. package/dist-types/components/wrapped/BccMenu/BccMenu.vue.d.ts +28 -0
  26. package/dist-types/components/wrapped/BccMessage.vue.d.ts +8 -2
  27. package/dist-types/components/wrapped/BccRadioButton.vue.d.ts +21 -0
  28. package/dist-types/components/wrapped/BccSelectButton.vue.d.ts +20 -0
  29. package/dist-types/components/{custom → wrapped}/BccTabs/BccTabs.vue.d.ts +3 -1
  30. package/dist-types/components/{custom → wrapped}/BccToggle/BccToggle.vue.d.ts +12 -1
  31. package/dist-types/components/wrapped/index.d.ts +17 -0
  32. package/dist-types/index.d.ts +14 -8
  33. package/package.json +18 -8
  34. package/dist-types/components/custom/BccCircleLoader/BccCircleLoader.vue.d.ts +0 -3
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,7 +14,16 @@ 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
+
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,13 +41,10 @@ app.mount('#app');
32
41
 
33
42
  2. **Add styles** using one of the two options below.
34
43
 
35
- ---
36
-
37
- ## Styling: two options
38
44
 
39
- ### Option 1 — Recommended: full Tailwind in your app
45
+ ### Styles Option 1 — Recommended: full Tailwind in your app
40
46
 
41
- 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.
42
48
 
43
49
  1. **Add the Tailwind Vite plugin** (the package brings Tailwind in as a dependency; you only wire it up):
44
50
 
@@ -58,9 +64,14 @@ export default defineConfig({
58
64
  @import '@bcc-code/component-library-vue/theme.css';
59
65
  ```
60
66
 
61
- Tailwind will run as part of your build and only include the utility classes that appear in your app and in the library.
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.
62
73
 
63
- ### Option 2 — Pre-built CSS only
74
+ ### Styles Option 2 — Pre-built CSS only
64
75
 
65
76
  Use this if you don’t want Tailwind in your project and only need the library’s styles and components.
66
77
 
@@ -72,11 +83,10 @@ import '@bcc-code/component-library-vue/style.css';
72
83
 
73
84
  You get the BCC theme and component styles only; no Tailwind utilities in your app.
74
85
 
75
- ---
76
86
 
77
- ## Using components
87
+ # Components
78
88
 
79
- All components are namespaced with `Bcc`. Use them in templates or register them globally after `app.use(BccComponentLibrary)`.
89
+ All components are namespaced with `Bcc`. Use them in templates or register them globally in your `main.ts`.
80
90
 
81
91
  **Example:**
82
92
 
@@ -96,37 +106,23 @@ const name = ref('');
96
106
  </script>
97
107
  ```
98
108
 
99
- # Setup
109
+ **Example:**
100
110
 
101
111
  ```ts
102
112
  // main.ts
103
- import { BccComponentLibrary } from '@bcc-code/component-library-vue';
104
-
105
- const app = createApp(…)
106
- BccComponentLibrary(app);
107
- ```
108
-
109
- ```css
110
- /* styles.css */
111
- @import '@bcc-code/component-library-vue/theme.css';
113
+ ...
114
+ import { BccButton, BccInput } from '@bcc-code/component-library-vue';
112
115
 
113
- /* Optional include the archivo font */
114
- @import '@bcc-code/component-library-vue/archivo-font.css';
115
- font-family:
116
- Archivo,
117
- system-ui,
118
- -apple-system,
119
- BlinkMacSystemFont,
120
- 'Segoe UI',
121
- 'Open Sans',
122
- sans-serif;
116
+ // After app.use(BccComponentLibrary)
117
+ app.component('BccButton', BccButton);
118
+ app.component('BccInput', BccInput);
123
119
  ```
124
120
 
125
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.
126
122
 
127
123
  ---
128
124
 
129
- ## Development
125
+ # Development
130
126
 
131
127
  ```bash
132
128
  pnpm install
@@ -135,6 +131,15 @@ pnpm run build # Typecheck, types, and Vite build
135
131
  pnpm run build:vite # Vite build only (includes theme.css)
136
132
  ```
137
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
+
138
143
  ### Patching PrimeVue icons
139
144
 
140
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.