@columbia-libraries/cul-toolkit 5.1.3 → 5.3.0

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
@@ -2,43 +2,44 @@
2
2
 
3
3
  _Version 5.x_
4
4
 
5
- ## Development requirements
5
+ ## Requirements
6
6
  ```
7
- nodejs >= v20
8
- npm >= 10.2
7
+ nodejs >= v22
9
8
  ```
10
9
 
11
- ## Vite for development
12
- Dev server runs on http://localhost:8181 and auto-recompiles code when resources change.
10
+ ## Development
11
+ Start the Vite dev server:
13
12
  ```
14
- npm start
13
+ npm run dev
15
14
  ```
16
- Preview server runs on http://localhost:4173 and serves the built dist/ dir.
15
+ The app is available at http://localhost:5173
16
+
17
+ ## Preview production build
18
+ Serve the production build locally:
17
19
  ```
18
20
  npm run preview
19
21
  ```
20
22
 
21
- ## Vite Build Instructions
22
- Vite will bundle code and copy public/ files for distribution into the dist/ dir.
23
- ```
24
- npm install # run the first time you want to build, or if the package-lock.json file has changed
25
- ```
26
- ```
23
+ ## Build
24
+ Install dependencies and build:
25
+ ```bash
26
+ npm install
27
27
  npm run build
28
28
  ```
29
+ The output is written to the dist/ directory.
29
30
 
30
31
  ## Deployment requirements
31
32
 
32
33
  Local machine:
33
34
  ```
34
- ruby >= 2.5.3 (we currently have a .ruby-version file requiring 2.5.3)
35
+ ruby >= 2.7.5 (we currently have a .ruby-version file requiring 2.7.5)
35
36
  bundler
36
37
  ```
37
38
 
38
39
  Remote deployment server:
39
40
  ```
40
- node >= 10.17.0
41
- yarn >= 1.19.1
41
+ node >= 22
42
+ npm >= 10
42
43
  ```
43
44
  ## Deploying a versioned release
44
45
 
@@ -124,7 +125,7 @@ Requirements:
124
125
  Create root `.env`:
125
126
 
126
127
  ```env
127
- VITE_CUL_MENU_URL=https://menus.example.com/cul-main-menu.json
128
+ VITE_CUL_MENU_URL=https://toolkit.library.columbia.edu/v5/assets/cul-main-menu.json
128
129
  ```
129
130
 
130
131
  #### main.js
@@ -211,13 +212,13 @@ Standalone bundle:
211
212
 
212
213
  #### ES module app usage
213
214
 
214
- *Installation*
215
+ ##### *Installation*
215
216
 
216
217
  ```bash
217
218
  npm install @columbia-libraries/cul-toolkit
218
219
  ```
219
220
 
220
- *Import and usage*
221
+ ##### *Import and usage*
221
222
 
222
223
  ```js
223
224
  import '@columbia-libraries/cul-toolkit/styles';
@@ -232,7 +233,35 @@ const MENU_URL =
232
233
  makeCULmenu(MENU_URL);
233
234
  ```
234
235
 
235
- *Framework Notes*
236
+ ##### *Importing Individual SCSS Partials*
237
+
238
+ SCSS source files are exposed enabling finer‑grained control and theming.
239
+
240
+ **Important:** To ensure CUL Toolkit variable overrides work, import `_variables.scss` **before** Bootstrap's variables:
241
+
242
+ ```scss
243
+ // Step 1: Bootstrap core functions
244
+ @import "bootstrap/scss/functions";
245
+
246
+ // Step 2: CUL Toolkit variables (must come before Bootstrap variables)
247
+ @import "@columbia-libraries/cul-toolkit/src/scss/_variables";
248
+
249
+ // Step 3: Bootstrap variables and core
250
+ @import "bootstrap/scss/variables";
251
+ @import "bootstrap/scss/bootstrap";
252
+
253
+ // Step 4: Blacklight overrides (optional)
254
+ @import "blacklight-frontend/app/assets/stylesheets/blacklight/blacklight";
255
+
256
+ // Step 5: CUL Toolkit components
257
+ @import "@columbia-libraries/cul-toolkit/src/scss/_cul";
258
+ @import "@columbia-libraries/cul-toolkit/src/scss/_sidebars";
259
+ ```
260
+
261
+ This allows you to override variables, functions, or partials before compiling with your own build pipeline (Sass, Rails asset pipeline, Webpack, Vite, etc.).
262
+
263
+
264
+ ##### *Framework Notes*
236
265
 
237
266
  makeCULmenu(MENU_URL) manipulates DOM elements with [data-cul-menu].
238
267
  It must be called after the elements exist in the DOM:
@@ -240,7 +269,7 @@ makeCULmenu(MENU_URL);
240
269
  - Vue: call after app.mount() or inside onMounted() / nextTick().
241
270
  - React: call inside useEffect(() => { ... }, []).
242
271
 
243
- *Vue note:*
272
+ ###### *Vue note:*
244
273
  ```js
245
274
  import { createApp, nextTick } from 'vue';
246
275
  import App from './App.vue';
@@ -260,11 +289,11 @@ onMounted(() => {
260
289
  });
261
290
  ```
262
291
 
263
- *React/other frameworks:*
292
+ ###### *React/other frameworks:*
264
293
 
265
294
  Call after the component that contains [data-my-menu] has mounted.
266
295
 
267
- *Markup requirement*
296
+ ##### *Markup requirement*
268
297
 
269
298
  Must include target element: <nav data-my-menu></nav>
270
299
 
@@ -4,10 +4,6 @@
4
4
  "href": "https://library.columbia.edu/services.html",
5
5
  "value": "Services & Tools"
6
6
  },
7
- {
8
- "href": "https://library.columbia.edu/services/faq.html",
9
- "value": "FAQ"
10
- },
11
7
  {
12
8
  "href": "https://library.columbia.edu/using-libraries/alumni.html",
13
9
  "value": "For Alumni"
@@ -78,10 +74,6 @@
78
74
  "href": "https://library.columbia.edu/libraries/math.html",
79
75
  "value": "Mathematics Library"
80
76
  },
81
- {
82
- "href": "https://library.columbia.edu/libraries/undergraduate.html",
83
- "value": "Milstein Undergraduate Library"
84
- },
85
77
  {
86
78
  "href": "https://library.columbia.edu/libraries/rbml.html",
87
79
  "value": "Rare Book & Manuscript Library"
@@ -117,17 +109,13 @@
117
109
  "value": "Collection Development"
118
110
  },
119
111
  {
120
- "href": "https://library.columbia.edu/collections/digital-collections.html",
121
- "value": "Digital Collections & Exhibitions"
112
+ "href": "https://dlc.library.columbia.edu",
113
+ "value": "Digital Collections"
122
114
  },
123
115
  {
124
116
  "href": "https://library.columbia.edu/collections/eresources.html",
125
117
  "value": "E-Resources"
126
118
  },
127
- {
128
- "href": "https://library.columbia.edu/collections/oral-history-portal.html",
129
- "value": "Oral History Collections"
130
- },
131
119
  {
132
120
  "href": "https://resolver.library.columbia.edu/lweb0004",
133
121
  "value": "Recommend a Title for Purchase"
@@ -177,13 +165,17 @@
177
165
  "value": "Research & Teaching"
178
166
  },
179
167
  {
180
- "href": "https://copyright.columbia.edu/index.html",
181
- "value": "Copyright Advisory Services"
168
+ "href": "https://library.columbia.edu/research-teaching/copyright.html",
169
+ "value": "Copyright Information"
182
170
  },
183
171
  {
184
172
  "href": "https://library.columbia.edu/research-teaching/getting-started.html",
185
173
  "value": "Getting Started with the Libraries"
186
174
  },
175
+ {
176
+ "href": "https://library.columbia.edu/research-teaching/global.html",
177
+ "value": "Global Studies"
178
+ },
187
179
  {
188
180
  "href": "https://library.columbia.edu/research-teaching/open-scholarship.html",
189
181
  "value": "Open Scholarship Services"