@nembedemand/mindeportalen-v3 0.0.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.
- package/README.md +118 -0
- package/dist/favicon.ico +0 -0
- package/dist/frontend-DHAtLb6e.cjs +2 -0
- package/dist/frontend-DHAtLb6e.cjs.map +1 -0
- package/dist/frontend-ifAI3JOh.js +46 -0
- package/dist/frontend-ifAI3JOh.js.map +1 -0
- package/dist/index-BDoooERZ.js +15299 -0
- package/dist/index-BDoooERZ.js.map +1 -0
- package/dist/index-CF2U2mYT.cjs +996 -0
- package/dist/index-CF2U2mYT.cjs.map +1 -0
- package/dist/index.css +9 -0
- package/dist/index.d.ts +2381 -0
- package/dist/mindeportalen-v3.cjs +2 -0
- package/dist/mindeportalen-v3.cjs.map +1 -0
- package/dist/mindeportalen-v3.js +35 -0
- package/dist/mindeportalen-v3.js.map +1 -0
- package/package.json +86 -0
package/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Mindeportalen Component Library
|
|
2
|
+
|
|
3
|
+
A robust, reusable Vue 3 component library with Tailwind CSS and Pinia support, designed for seamless integration with Nuxt 3 and other Vue applications.
|
|
4
|
+
|
|
5
|
+
## ๐ Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install mindeportalen-components
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Required peer dependencies:**
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install vue@^3.0.0 pinia@^2.0.0 sass
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## ๐ Documentation
|
|
18
|
+
|
|
19
|
+
For comprehensive usage instructions, see [LIBRARY_USAGE.md](./LIBRARY_USAGE.md)
|
|
20
|
+
|
|
21
|
+
## โจ Features
|
|
22
|
+
|
|
23
|
+
- ๐จ **Style Isolated**: Tailwind CSS with custom `mp-` prefix
|
|
24
|
+
- ๐ช **Pinia Integration**: Optional stores with SSR-safe composables
|
|
25
|
+
- ๐ง **TypeScript**: Fully typed with comprehensive type safety
|
|
26
|
+
- ๐ **SSR Compatible**: Works seamlessly with Nuxt 3
|
|
27
|
+
- ๐ฆ **Tree Shakeable**: Import only what you need
|
|
28
|
+
- โฟ **Accessible**: Built-in accessibility features
|
|
29
|
+
|
|
30
|
+
## ๐ฏ Main Components
|
|
31
|
+
|
|
32
|
+
- `OverviewPage` - Main component for Vue 3 apps
|
|
33
|
+
- `OverviewPageNuxt` - Nuxt-optimized version with SSR support
|
|
34
|
+
|
|
35
|
+
## ๐ช Pinia Stores
|
|
36
|
+
|
|
37
|
+
- Authentication, Frontend config, Cart, Charity orgs
|
|
38
|
+
- Google Maps, Page management, Greetings, and more
|
|
39
|
+
- All with SSR-safe access patterns
|
|
40
|
+
|
|
41
|
+
## ๐ง Quick Usage
|
|
42
|
+
|
|
43
|
+
### Vue 3
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { OverviewPage, createMindeportalenStoresPlugin } from 'mindeportalen-components'
|
|
47
|
+
|
|
48
|
+
const pinia = createPinia()
|
|
49
|
+
pinia.use(createMindeportalenStoresPlugin())
|
|
50
|
+
app.use(pinia)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Nuxt 3
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { OverviewPageNuxt } from 'mindeportalen-components'
|
|
57
|
+
// + Nuxt plugin setup (see full docs)
|
|
58
|
+
// โ ๏ธ Always wrap in <ClientOnly> for SSR compatibility
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## ๐จ Style Isolation
|
|
62
|
+
|
|
63
|
+
The library uses Tailwind CSS with a custom `mp-` prefix to prevent conflicts:
|
|
64
|
+
|
|
65
|
+
- โ
**No utility class conflicts**: All classes prefixed with `mp-`
|
|
66
|
+
- โ
**Scoped styles**: Component styles are isolated
|
|
67
|
+
- โ
**SSR Compatible**: Works with Nuxt 3 and other SSR frameworks
|
|
68
|
+
- โ
**No global resets**: Doesn't override your application styles
|
|
69
|
+
|
|
70
|
+
## ๐ง Architecture
|
|
71
|
+
|
|
72
|
+
The library exports only the main components and utilities needed:
|
|
73
|
+
|
|
74
|
+
- **Components**: `OverviewPage`, `OverviewPageNuxt`
|
|
75
|
+
- **Stores**: Auth, Frontend, Cart, Page management, etc.
|
|
76
|
+
- **Composables**: `useSafePinia`, `useGetData`
|
|
77
|
+
- **Plugins**: Pinia integration for both Vue and Nuxt
|
|
78
|
+
- **Utilities**: Type-safe helpers for common operations
|
|
79
|
+
|
|
80
|
+
## ๐งช Type Safety
|
|
81
|
+
|
|
82
|
+
All exports are fully typed with comprehensive TypeScript support:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import type { User, AuthState, FrontendConfig } from 'mindeportalen-components'
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## ๐ SSR Compatibility
|
|
89
|
+
|
|
90
|
+
Every component and composable is designed for SSR:
|
|
91
|
+
|
|
92
|
+
- Safe hydration patterns
|
|
93
|
+
- Fallback values during server rendering
|
|
94
|
+
- No browser-only APIs during SSR
|
|
95
|
+
- Nuxt 3 optimized components
|
|
96
|
+
|
|
97
|
+
## Development
|
|
98
|
+
|
|
99
|
+
To set up the project for development:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
git clone <repository-url>
|
|
103
|
+
cd mindeportalen-v3
|
|
104
|
+
pnpm install
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Commands
|
|
108
|
+
|
|
109
|
+
- `pnpm dev` - Start development server with demo
|
|
110
|
+
- `pnpm build` - Build the library for production
|
|
111
|
+
- `pnpm build-demo` - Build the demo for production
|
|
112
|
+
- `pnpm type-check` - Run TypeScript type checking
|
|
113
|
+
- `pnpm lint` - Lint and fix code
|
|
114
|
+
- `pnpm format` - Format code with Prettier
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
[Add your license here]
|
package/dist/favicon.ico
ADDED
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("pinia"),r=require("./index-CF2U2mYT.cjs"),i=t.defineStore("mpFrontend",{state:()=>({widget:!1,widgetSecret:r.useStorage("mpNbaWidgetSecret",""),widgetTheme:"normal",ssr:!1,fbSdkInitialized:!1,tempCover:{assetId:"",url:""},tempPicture:{assetId:"",url:""},routeObject:{},routerObject:{},hostedUrl:void 0,overviewLoading:!1,searchForm:{name:null,city:null,period:null,all:0}}),actions:{setWidgetSecret(e){this.widgetSecret=e},resetSearchForm(){this.searchForm={name:null,city:null,period:null,all:0}}}});exports.useFrontendStore=i;
|
|
2
|
+
//# sourceMappingURL=frontend-DHAtLb6e.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend-DHAtLb6e.cjs","sources":["../src/stores/frontend.ts"],"sourcesContent":["import { defineStore } from 'pinia'\nimport { useStorage } from '@vueuse/core'\n\n// Make vue-router types optional since it's not always available in a component library\ntype Router = any\ntype RouteLocationNormalizedLoaded = any\ntype LocationQueryValue = string | string[] | null\n\ninterface SearchForm {\n name?: string | null | LocationQueryValue[]\n city?: string | null | LocationQueryValue[]\n period?: string | null | LocationQueryValue[]\n all?: number | null | LocationQueryValue[]\n}\n\nexport const useFrontendStore = defineStore('mpFrontend', {\n state: () => ({\n widget: false,\n widgetSecret: useStorage('mpNbaWidgetSecret', ''),\n widgetTheme: 'normal',\n ssr: false as boolean | undefined,\n fbSdkInitialized: false,\n tempCover: {\n assetId: '',\n url: '',\n },\n tempPicture: {\n assetId: '',\n url: '',\n },\n routeObject: {} as RouteLocationNormalizedLoaded,\n routerObject: {} as Router,\n hostedUrl: undefined as string | undefined,\n overviewLoading: false as boolean | undefined,\n searchForm: {\n name: null,\n city: null,\n period: null,\n all: 0,\n } as SearchForm,\n }),\n actions: {\n setWidgetSecret(secret: string) {\n this.widgetSecret = secret\n },\n resetSearchForm() {\n this.searchForm = {\n name: null,\n city: null,\n period: null,\n all: 0,\n }\n },\n },\n})\n"],"names":["useFrontendStore","defineStore","useStorage","secret"],"mappings":"2IAeaA,EAAmBC,EAAAA,YAAY,aAAc,CACxD,MAAO,KAAO,CACZ,OAAQ,GACR,aAAcC,EAAAA,WAAW,oBAAqB,EAAE,EAChD,YAAa,SACb,IAAK,GACL,iBAAkB,GAClB,UAAW,CACT,QAAS,GACT,IAAK,EAAA,EAEP,YAAa,CACX,QAAS,GACT,IAAK,EAAA,EAEP,YAAa,CAAA,EACb,aAAc,CAAA,EACd,UAAW,OACX,gBAAiB,GACjB,WAAY,CACV,KAAM,KACN,KAAM,KACN,OAAQ,KACR,IAAK,CAAA,CACP,GAEF,QAAS,CACP,gBAAgBC,EAAgB,CAC9B,KAAK,aAAeA,CAAA,EAEtB,iBAAkB,CAChB,KAAK,WAAa,CAChB,KAAM,KACN,KAAM,KACN,OAAQ,KACR,IAAK,CAAA,CACP,CACF,CAEJ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineStore as t } from "pinia";
|
|
2
|
+
import { u as r } from "./index-BDoooERZ.js";
|
|
3
|
+
const i = t("mpFrontend", {
|
|
4
|
+
state: () => ({
|
|
5
|
+
widget: !1,
|
|
6
|
+
widgetSecret: r("mpNbaWidgetSecret", ""),
|
|
7
|
+
widgetTheme: "normal",
|
|
8
|
+
ssr: !1,
|
|
9
|
+
fbSdkInitialized: !1,
|
|
10
|
+
tempCover: {
|
|
11
|
+
assetId: "",
|
|
12
|
+
url: ""
|
|
13
|
+
},
|
|
14
|
+
tempPicture: {
|
|
15
|
+
assetId: "",
|
|
16
|
+
url: ""
|
|
17
|
+
},
|
|
18
|
+
routeObject: {},
|
|
19
|
+
routerObject: {},
|
|
20
|
+
hostedUrl: void 0,
|
|
21
|
+
overviewLoading: !1,
|
|
22
|
+
searchForm: {
|
|
23
|
+
name: null,
|
|
24
|
+
city: null,
|
|
25
|
+
period: null,
|
|
26
|
+
all: 0
|
|
27
|
+
}
|
|
28
|
+
}),
|
|
29
|
+
actions: {
|
|
30
|
+
setWidgetSecret(e) {
|
|
31
|
+
this.widgetSecret = e;
|
|
32
|
+
},
|
|
33
|
+
resetSearchForm() {
|
|
34
|
+
this.searchForm = {
|
|
35
|
+
name: null,
|
|
36
|
+
city: null,
|
|
37
|
+
period: null,
|
|
38
|
+
all: 0
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
i as useFrontendStore
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=frontend-ifAI3JOh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend-ifAI3JOh.js","sources":["../src/stores/frontend.ts"],"sourcesContent":["import { defineStore } from 'pinia'\nimport { useStorage } from '@vueuse/core'\n\n// Make vue-router types optional since it's not always available in a component library\ntype Router = any\ntype RouteLocationNormalizedLoaded = any\ntype LocationQueryValue = string | string[] | null\n\ninterface SearchForm {\n name?: string | null | LocationQueryValue[]\n city?: string | null | LocationQueryValue[]\n period?: string | null | LocationQueryValue[]\n all?: number | null | LocationQueryValue[]\n}\n\nexport const useFrontendStore = defineStore('mpFrontend', {\n state: () => ({\n widget: false,\n widgetSecret: useStorage('mpNbaWidgetSecret', ''),\n widgetTheme: 'normal',\n ssr: false as boolean | undefined,\n fbSdkInitialized: false,\n tempCover: {\n assetId: '',\n url: '',\n },\n tempPicture: {\n assetId: '',\n url: '',\n },\n routeObject: {} as RouteLocationNormalizedLoaded,\n routerObject: {} as Router,\n hostedUrl: undefined as string | undefined,\n overviewLoading: false as boolean | undefined,\n searchForm: {\n name: null,\n city: null,\n period: null,\n all: 0,\n } as SearchForm,\n }),\n actions: {\n setWidgetSecret(secret: string) {\n this.widgetSecret = secret\n },\n resetSearchForm() {\n this.searchForm = {\n name: null,\n city: null,\n period: null,\n all: 0,\n }\n },\n },\n})\n"],"names":["useFrontendStore","defineStore","useStorage","secret"],"mappings":";;AAeO,MAAMA,IAAmBC,EAAY,cAAc;AAAA,EACxD,OAAO,OAAO;AAAA,IACZ,QAAQ;AAAA,IACR,cAAcC,EAAW,qBAAqB,EAAE;AAAA,IAChD,aAAa;AAAA,IACb,KAAK;AAAA,IACL,kBAAkB;AAAA,IAClB,WAAW;AAAA,MACT,SAAS;AAAA,MACT,KAAK;AAAA,IAAA;AAAA,IAEP,aAAa;AAAA,MACX,SAAS;AAAA,MACT,KAAK;AAAA,IAAA;AAAA,IAEP,aAAa,CAAA;AAAA,IACb,cAAc,CAAA;AAAA,IACd,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,YAAY;AAAA,MACV,MAAM;AAAA,MACN,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,KAAK;AAAA,IAAA;AAAA,EACP;AAAA,EAEF,SAAS;AAAA,IACP,gBAAgBC,GAAgB;AAC9B,WAAK,eAAeA;AAAA,IAAA;AAAA,IAEtB,kBAAkB;AAChB,WAAK,aAAa;AAAA,QAChB,MAAM;AAAA,QACN,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,KAAK;AAAA,MAAA;AAAA,IACP;AAAA,EACF;AAEJ,CAAC;"}
|