@m2s2/vue-lib 1.0.0 → 2.0.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 ADDED
@@ -0,0 +1,96 @@
1
+ # @m2s2/vue-lib
2
+
3
+ Vue 3 component library by M²S² Engineering Group. Built with Composition API and `<script setup>` throughout.
4
+
5
+ For live component demos and prop documentation, see [Storybook](https://storybook.m2s2.io).
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @m2s2/vue-lib @m2s2/tokens
11
+ ```
12
+
13
+ ## Peer Dependencies
14
+
15
+ | Package | Version |
16
+ |---------|---------|
17
+ | `vue` | >=3.0.0 |
18
+ | `@m2s2/models` | >=0.1.0 |
19
+ | `@m2s2/tokens` | >=1.0.0 |
20
+
21
+ ## Setup
22
+
23
+ Import the stylesheet in your entry file:
24
+
25
+ ```typescript
26
+ import { createApp } from 'vue';
27
+ import App from './App.vue';
28
+ import '@m2s2/vue-lib/styles';
29
+
30
+ createApp(App).mount('#app');
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ ```vue
36
+ <script setup lang="ts">
37
+ import { Navbar, Footer } from '@m2s2/vue-lib';
38
+ import type { NavbarConfig, FooterConfig } from '@m2s2/vue-lib';
39
+
40
+ const navbar: NavbarConfig = { brand: 'My App', brandPath: '/', isFixed: true, buttons: [] };
41
+ const footer: FooterConfig = { brandName: 'My App', links: [] };
42
+ </script>
43
+
44
+ <template>
45
+ <Navbar :config="navbar" />
46
+ <main>...</main>
47
+ <Footer :config="footer" />
48
+ </template>
49
+ ```
50
+
51
+ ## Components
52
+
53
+ | Component | Description |
54
+ |-----------|-------------|
55
+ | `Navbar` | Application navigation bar |
56
+ | `Footer` | Application footer |
57
+ | `BaseCard` | Foundational card with variant support |
58
+ | `BlogCard` | Blog post card with cover image, tags, and reading time |
59
+ | `FeatureCard` | Feature highlight card with icon and items |
60
+ | `PageHeader` | Full-width page header with title and subtitle |
61
+ | `SectionHeader` | Section title with optional label and subtitle |
62
+ | `StatRow` | Horizontal row of key statistics |
63
+ | `ProcessSteps` | Numbered step sequence |
64
+ | `CtaSection` | Call-to-action banner |
65
+ | `StatusBadge` | Status indicator in badge or pill variant |
66
+ | `DataTable` | Sortable, resizable data table |
67
+ | `SubscribeForm` | Email subscription form (anon and authenticated modes) |
68
+ | `Dialog` | Modal dialog (use with `DialogProvider`) |
69
+ | `Panel` | Side panel/drawer (use with `PanelProvider`) |
70
+
71
+ ## Dialog and Panel
72
+
73
+ Dialog and Panel are provided via Vue's `provide`/`inject` system. Wrap your app (or the relevant subtree) with the providers and use the composables to open them imperatively:
74
+
75
+ ```vue
76
+ <script setup lang="ts">
77
+ import { DialogProvider, PanelProvider } from '@m2s2/vue-lib';
78
+ </script>
79
+
80
+ <template>
81
+ <DialogProvider>
82
+ <PanelProvider>
83
+ <RouterView />
84
+ </PanelProvider>
85
+ </DialogProvider>
86
+ </template>
87
+ ```
88
+
89
+ ```vue
90
+ <script setup lang="ts">
91
+ import { useDialog, usePanel } from '@m2s2/vue-lib';
92
+
93
+ const { dialog, confirm } = useDialog();
94
+ const { panel } = usePanel();
95
+ </script>
96
+ ```
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
+ export default _default;
8
+ type __VLS_WithSlots<T, S> = T & {
9
+ new (): {
10
+ $slots: S;
11
+ };
12
+ };
13
+ //# sourceMappingURL=DialogProvider.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogProvider.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dialog/DialogProvider.vue"],"names":[],"mappings":"AAwHA,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAoB/C,QAAA,MAAM,eAAe,+QAKnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAE1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type InjectionKey } from 'vue';
2
+ import type { M2S2DialogData } from '@m2s2/models';
3
+ export interface DialogContext {
4
+ dialog: (data: M2S2DialogData) => Promise<unknown>;
5
+ confirm: (title: string, message?: string) => Promise<boolean>;
6
+ }
7
+ export declare const DIALOG_KEY: InjectionKey<DialogContext>;
8
+ export declare function useDialog(): DialogContext;
9
+ //# sourceMappingURL=useDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dialog/useDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAG,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACpD,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAChE;AAED,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,aAAa,CAAoB,CAAC;AAExE,wBAAgB,SAAS,IAAI,aAAa,CAIzC"}
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
+ export default _default;
8
+ type __VLS_WithSlots<T, S> = T & {
9
+ new (): {
10
+ $slots: S;
11
+ };
12
+ };
13
+ //# sourceMappingURL=PanelProvider.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelProvider.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Panel/PanelProvider.vue"],"names":[],"mappings":"AAkGA,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAoB/C,QAAA,MAAM,eAAe,+QAKnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAE1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type InjectionKey } from 'vue';
2
+ import type { M2S2PanelData } from '@m2s2/models';
3
+ export interface PanelContext {
4
+ panel: (data: M2S2PanelData) => Promise<unknown>;
5
+ }
6
+ export declare const PANEL_KEY: InjectionKey<PanelContext>;
7
+ export declare function usePanel(): PanelContext;
8
+ //# sourceMappingURL=usePanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/Panel/usePanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,SAAS,EAAE,YAAY,CAAC,YAAY,CAAmB,CAAC;AAErE,wBAAgB,QAAQ,IAAI,YAAY,CAIvC"}
package/package.json CHANGED
@@ -1,10 +1,16 @@
1
1
  {
2
2
  "name": "@m2s2/vue-lib",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "Vue 3 component library by M²S² Engineering Group.",
5
5
  "author": "M²S² Engineering Group <contact@m2s2.io>",
6
6
  "license": "MIT",
7
- "keywords": ["vue", "vue3", "component-library", "ui", "m2s2"],
7
+ "keywords": [
8
+ "vue",
9
+ "vue3",
10
+ "component-library",
11
+ "ui",
12
+ "m2s2"
13
+ ],
8
14
  "repository": {
9
15
  "type": "git",
10
16
  "url": "https://github.com/M2S2-Engineering-Group/m2s2-design-system",
@@ -24,7 +30,9 @@
24
30
  },
25
31
  "./styles": "./dist/vue-lib.css"
26
32
  },
27
- "files": ["dist"],
33
+ "files": [
34
+ "dist"
35
+ ],
28
36
  "scripts": {
29
37
  "build": "vite build && vue-tsc --emitDeclarationOnly --declarationDir dist",
30
38
  "build:prod": "vite build && vue-tsc --emitDeclarationOnly --declarationDir dist",