@bcc-code/component-library-vue 1.3.11 → 1.3.13

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 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,11 +41,8 @@ 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
47
  Use this if you want Tailwind utility classes in your own templates and only ship the classes you use (tree-shaking).
51
48
 
@@ -69,7 +66,7 @@ export default defineConfig({
69
66
 
70
67
  Tailwind will run as part of your build and only include the utility classes that appear in your app and in the library.
71
68
 
72
- ### Option 2 — Pre-built CSS only
69
+ ### Styles Option 2 — Pre-built CSS only
73
70
 
74
71
  Use this if you don’t want Tailwind in your project and only need the library’s styles and components.
75
72
 
@@ -81,11 +78,10 @@ import '@bcc-code/component-library-vue/style.css';
81
78
 
82
79
  You get the BCC theme and component styles only; no Tailwind utilities in your app.
83
80
 
84
- ---
85
81
 
86
- ## Using components
82
+ # Components
87
83
 
88
- All components are namespaced with `Bcc`. Use them in templates or register them globally after `app.use(BccComponentLibrary)`.
84
+ All components are namespaced with `Bcc`. Use them in templates or register them globally in your `main.ts`.
89
85
 
90
86
  **Example:**
91
87
 
@@ -105,37 +101,23 @@ const name = ref('');
105
101
  </script>
106
102
  ```
107
103
 
108
- # Setup
104
+ **Example:**
109
105
 
110
106
  ```ts
111
107
  // 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';
108
+ ...
109
+ import { BccButton, BccInput } from '@bcc-code/component-library-vue';
121
110
 
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;
111
+ // After app.use(BccComponentLibrary)
112
+ app.component('BccButton', BccButton);
113
+ app.component('BccInput', BccInput);
132
114
  ```
133
115
 
134
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.
135
117
 
136
118
  ---
137
119
 
138
- ## Development
120
+ # Development
139
121
 
140
122
  ```bash
141
123
  pnpm install
@@ -144,6 +126,15 @@ pnpm run build # Typecheck, types, and Vite build
144
126
  pnpm run build:vite # Vite build only (includes theme.css)
145
127
  ```
146
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
+
147
138
  ### Patching PrimeVue icons
148
139
 
149
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.