@statezero/core 0.2.34 → 0.2.36

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.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Create a default components registry (without Control - user must provide)
3
+ *
4
+ * @param {Object} options - Override specific components
5
+ * @returns {Object} Components registry for LayoutRenderer
6
+ */
7
+ export function createDefaultComponents(options?: Object): Object;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Default component implementations for LayoutRenderer
3
+ *
4
+ * These are minimal, unstyled implementations that follow the contracts.
5
+ * Users can use these as-is or as reference for custom implementations.
6
+ */
7
+ export { default as AlertElement } from './AlertElement.vue';
8
+ export { default as LabelElement } from './LabelElement.vue';
9
+ export { default as DividerElement } from './DividerElement.vue';
10
+ export { default as DisplayElement } from './DisplayElement.vue';
11
+ export { default as GroupElement } from './GroupElement.vue';
12
+ export { default as TabsElement } from './TabsElement.vue';
13
+ export { default as ErrorBlock } from './ErrorBlock.vue';
14
+ /**
15
+ * Create a default components registry (without Control - user must provide)
16
+ *
17
+ * @param {Object} options - Override specific components
18
+ * @returns {Object} Components registry for LayoutRenderer
19
+ */
20
+ export function createDefaultComponents(options = {}) {
21
+ return {
22
+ Alert: AlertElement,
23
+ Label: LabelElement,
24
+ Divider: DividerElement,
25
+ Display: DisplayElement,
26
+ Group: GroupElement,
27
+ Tabs: TabsElement,
28
+ ErrorBlock: ErrorBlock,
29
+ ...options
30
+ };
31
+ }
@@ -0,0 +1 @@
1
+ export { AlertElement, LabelElement, DividerElement, DisplayElement, GroupElement, TabsElement, ErrorBlock, createDefaultComponents } from "./defaults/index.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Vue components for StateZero
3
+ */
4
+ // Main layout renderer
5
+ export { default as LayoutRenderer } from './LayoutRenderer.vue';
6
+ // Default component implementations
7
+ export { AlertElement, LabelElement, DividerElement, DisplayElement, GroupElement, TabsElement, ErrorBlock, createDefaultComponents } from './defaults/index.js';
@@ -1,2 +1,3 @@
1
1
  export { useQueryset, querysets } from "./composables.js";
2
2
  export { ModelAdaptor, QuerySetAdaptor, MetricAdaptor } from "./reactivity.js";
3
+ export { LayoutRenderer, AlertElement, LabelElement, DividerElement, DisplayElement, GroupElement, TabsElement, ErrorBlock, createDefaultComponents } from "./components/index.js";
@@ -1,2 +1,4 @@
1
1
  export { useQueryset, querysets } from './composables.js';
2
2
  export { ModelAdaptor, QuerySetAdaptor, MetricAdaptor } from './reactivity.js';
3
+ // Layout components
4
+ export { LayoutRenderer, AlertElement, LabelElement, DividerElement, DisplayElement, GroupElement, TabsElement, ErrorBlock, createDefaultComponents } from './components/index.js';
@@ -3,4 +3,13 @@ import { QuerySetAdaptor } from './adaptors/vue/index.js';
3
3
  import { MetricAdaptor } from './adaptors/vue/index.js';
4
4
  import { useQueryset } from './adaptors/vue/index.js';
5
5
  import { querysets } from './adaptors/vue/index.js';
6
- export { ModelAdaptor, QuerySetAdaptor, MetricAdaptor, useQueryset, querysets };
6
+ import { LayoutRenderer } from './adaptors/vue/index.js';
7
+ import { AlertElement } from './adaptors/vue/index.js';
8
+ import { LabelElement } from './adaptors/vue/index.js';
9
+ import { DividerElement } from './adaptors/vue/index.js';
10
+ import { DisplayElement } from './adaptors/vue/index.js';
11
+ import { GroupElement } from './adaptors/vue/index.js';
12
+ import { TabsElement } from './adaptors/vue/index.js';
13
+ import { ErrorBlock } from './adaptors/vue/index.js';
14
+ import { createDefaultComponents } from './adaptors/vue/index.js';
15
+ export { ModelAdaptor, QuerySetAdaptor, MetricAdaptor, useQueryset, querysets, LayoutRenderer, AlertElement, LabelElement, DividerElement, DisplayElement, GroupElement, TabsElement, ErrorBlock, createDefaultComponents };
package/dist/vue-entry.js CHANGED
@@ -1,2 +1,7 @@
1
1
  import { ModelAdaptor, QuerySetAdaptor, MetricAdaptor, useQueryset, querysets } from './adaptors/vue/index.js';
2
- export { ModelAdaptor, QuerySetAdaptor, MetricAdaptor, useQueryset, querysets };
2
+ import { LayoutRenderer, AlertElement, LabelElement, DividerElement, DisplayElement, GroupElement, TabsElement, ErrorBlock, createDefaultComponents } from './adaptors/vue/index.js';
3
+ export {
4
+ // Reactivity
5
+ ModelAdaptor, QuerySetAdaptor, MetricAdaptor, useQueryset, querysets,
6
+ // Layout components
7
+ LayoutRenderer, AlertElement, LabelElement, DividerElement, DisplayElement, GroupElement, TabsElement, ErrorBlock, createDefaultComponents };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statezero/core",
3
- "version": "0.2.34",
3
+ "version": "0.2.36",
4
4
  "type": "module",
5
5
  "module": "ESNext",
6
6
  "description": "The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate",
@@ -26,11 +26,14 @@
26
26
  "import": "./dist/vue-entry.js",
27
27
  "require": "./dist/vue-entry.js"
28
28
  },
29
+ "./vue/layout.css": "./src/adaptors/vue/components/layout.css",
30
+ "./vue/layout.tailwind.css": "./src/adaptors/vue/components/layout.tailwind.css",
29
31
  "./testing": {
30
32
  "import": "./dist/testing.js",
31
33
  "require": "./dist/testing.js"
32
34
  },
33
- "./dist/*": "./dist/*"
35
+ "./dist/*": "./dist/*",
36
+ "./src/*": "./src/*"
34
37
  },
35
38
  "scripts": {
36
39
  "test": "vitest run --config=vitest.base.config.ts",
@@ -72,6 +75,8 @@
72
75
  },
73
76
  "files": [
74
77
  "dist",
78
+ "src/adaptors/vue/components/layout.css",
79
+ "src/adaptors/vue/components/layout.tailwind.css",
75
80
  "LICENSE",
76
81
  "README.md"
77
82
  ],
@@ -0,0 +1,51 @@
1
+ /**
2
+ * StateZero Layout Renderer - Base CSS Styles
3
+ *
4
+ * Import this file to get default styling for layout components:
5
+ * import '@statezero/core/vue/layout.css'
6
+ *
7
+ * Or define your own styles targeting these class names.
8
+ */
9
+
10
+ /* Layout containers */
11
+ .sz-layout {
12
+ display: flex;
13
+ }
14
+
15
+ .sz-layout-vertical {
16
+ flex-direction: column;
17
+ }
18
+
19
+ .sz-layout-horizontal {
20
+ flex-direction: row;
21
+ }
22
+
23
+ /* Gap utilities */
24
+ .sz-gap-sm {
25
+ gap: 0.5rem;
26
+ }
27
+
28
+ .sz-gap-md {
29
+ gap: 1rem;
30
+ }
31
+
32
+ .sz-gap-lg {
33
+ gap: 1.5rem;
34
+ }
35
+
36
+ /* Horizontal alignment */
37
+ .sz-align-start {
38
+ align-items: flex-start;
39
+ }
40
+
41
+ .sz-align-center {
42
+ align-items: center;
43
+ }
44
+
45
+ .sz-align-end {
46
+ align-items: flex-end;
47
+ }
48
+
49
+ .sz-align-stretch {
50
+ align-items: stretch;
51
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * StateZero Layout Renderer - Tailwind CSS Styles
3
+ *
4
+ * Import this file if you're using Tailwind CSS:
5
+ * import '@statezero/core/vue/layout.tailwind.css'
6
+ *
7
+ * This maps sz-* classes to Tailwind utilities via @apply.
8
+ */
9
+
10
+ /* Layout containers */
11
+ .sz-layout {
12
+ @apply flex;
13
+ }
14
+
15
+ .sz-layout-vertical {
16
+ @apply flex-col;
17
+ }
18
+
19
+ .sz-layout-horizontal {
20
+ @apply flex-row;
21
+ }
22
+
23
+ /* Gap utilities */
24
+ .sz-gap-sm {
25
+ @apply gap-2;
26
+ }
27
+
28
+ .sz-gap-md {
29
+ @apply gap-4;
30
+ }
31
+
32
+ .sz-gap-lg {
33
+ @apply gap-6;
34
+ }
35
+
36
+ /* Horizontal alignment */
37
+ .sz-align-start {
38
+ @apply items-start;
39
+ }
40
+
41
+ .sz-align-center {
42
+ @apply items-center;
43
+ }
44
+
45
+ .sz-align-end {
46
+ @apply items-end;
47
+ }
48
+
49
+ .sz-align-stretch {
50
+ @apply items-stretch;
51
+ }