@squirkle-ui/nuxt 0.1.0 → 0.1.1

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 (2) hide show
  1. package/README.md +28 -6
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,19 +1,41 @@
1
1
  # @squirkle-ui/nuxt
2
2
 
3
- Nuxt 2, 3 and 4 module for Squirkle UI.
3
+ Nuxt module for [Squirkle UI](https://www.npmjs.com/package/squirkle-ui): auto-imports components, adds the styles, renders theme CSS on the server (no flash of the wrong theme) and sets up add-ons such as the map.
4
4
 
5
+ ## Install
5
6
  ```bash
6
7
  npm i @squirkle-ui/nuxt @squirkle-ui/ui
8
+ # plus each add-on you enable, e.g.
9
+ npm i @squirkle-ui/datagrid @squirkle-ui/map maplibre-gl
7
10
  ```
11
+
12
+ ## Nuxt 3 / 4
8
13
  ```ts
9
- // nuxt.config.ts (Nuxt 3 / 4)
14
+ // nuxt.config.ts
10
15
  export default defineNuxtConfig({
11
16
  modules: ['@squirkle-ui/nuxt'],
12
- squirkle: { addons: ['datagrid', 'map'], theme: { defaultTheme: 'light' } },
17
+ squirkle: {
18
+ addons: ['datagrid', 'charts', 'swiper', 'calendar', 'map', 'icons'], // only what you installed
19
+ prefix: 'Sq', // component prefix (SqBtn, SqCard, …)
20
+ css: true, // add the package stylesheets
21
+ theme: { defaultTheme: 'light' },
22
+ squircle: { mode: 'auto' },
23
+ appearance: { radiusScale: 1.1 },
24
+ icons: { api: false }, // offline icons
25
+ locale: { code: 'en' },
26
+ },
13
27
  })
28
+ ```
29
+ - `SqMap` is client-only. With `map` enabled the module registers MapLibre's worker and keeps it out of Vite's dependency pre-bundling.
30
+ - `useTheme()` works in components; theme CSS is rendered into `<head>` with `<html class="sq-theme--light">`.
14
31
 
15
- // Nuxt 2: buildModules: [['@squirkle-ui/nuxt/nuxt2', { addons: ['datagrid'] }]]
32
+ ## Nuxt 2
33
+ ```js
34
+ // nuxt.config.js
35
+ export default {
36
+ buildModules: [['@squirkle-ui/nuxt/nuxt2', { addons: ['datagrid'] }]],
37
+ }
16
38
  ```
17
- Install each add-on you list in `addons` (`@squirkle-ui/datagrid`, `@squirkle-ui/map`, …). With `map`, the module also registers MapLibre's worker for you.
18
39
 
19
- Part of [Squirkle UI](https://github.com/KheangLov/squirkle-ui) · MIT License
40
+ ## License
41
+ MIT © KheangLov · [Source and issues](https://github.com/KheangLov/squirkle-ui)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squirkle-ui/nuxt",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Nuxt 2, 3 and 4 module for Squirkle UI",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "@nuxt/kit": "^4.0.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "@squirkle-ui/ui": "^0.1.0"
36
+ "@squirkle-ui/ui": "^0.1.1"
37
37
  },
38
38
  "module": "./src/module.mjs",
39
39
  "publishConfig": {