@construct-space/ui 0.3.1 → 0.3.3
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 +53 -15
- package/dist/components/ConfirmationModal.vue.d.ts +27 -0
- package/dist/components/Group.vue.d.ts +25 -0
- package/dist/components/SplitPane.vue.d.ts +27 -0
- package/dist/components/Tab.vue.d.ts +19 -0
- package/dist/components/Tabs.vue.d.ts +7 -3
- package/dist/components/Tree.vue.d.ts +3 -3
- package/dist/composables/useAuth.d.ts +3 -3
- package/dist/composables/useClipboard.d.ts +2 -2
- package/dist/composables/useFormValidation.d.ts +3 -3
- package/dist/composables/useMediaQuery.d.ts +8 -8
- package/dist/composables/useNotification.d.ts +1 -1
- package/dist/composables/useSearch.d.ts +2 -2
- package/dist/composables/useTheme.d.ts +4 -4
- package/dist/construct-ui.js +3122 -2790
- package/dist/index.d.ts +5 -0
- package/package.json +9 -4
- package/dist/style.css +0 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @construct-space/ui
|
|
2
2
|
|
|
3
|
-
Vue 3 component library for Construct services.
|
|
3
|
+
Vue 3 component library for Construct services. Shared components, layouts, composables, and design tokens for apps, infra surfaces, and spaces.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -19,13 +19,15 @@ npm install vue reka-ui @iconify/vue
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// Import shared styles (tokens + utility classes)
|
|
22
|
+
// Always import shared styles once in your app entry.
|
|
23
|
+
// No extra Tailwind setup is required in the consumer.
|
|
26
24
|
import '@construct-space/ui/style.css'
|
|
27
25
|
|
|
28
|
-
//
|
|
26
|
+
// Import components individually
|
|
27
|
+
import { Button, Input, Modal, Notification, SplitPane } from '@construct-space/ui'
|
|
28
|
+
|
|
29
|
+
// Or register all components globally with a C prefix:
|
|
30
|
+
// CButton, CInput, CModal, CNotification, ...
|
|
29
31
|
import { createApp } from 'vue'
|
|
30
32
|
import ConstructUI from '@construct-space/ui'
|
|
31
33
|
|
|
@@ -33,16 +35,47 @@ const app = createApp(App)
|
|
|
33
35
|
app.use(ConstructUI)
|
|
34
36
|
```
|
|
35
37
|
|
|
38
|
+
## Tabs And Groups
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<script setup lang="ts">
|
|
42
|
+
import { ref } from 'vue'
|
|
43
|
+
import { Tabs, Tab, Group, Button } from '@construct-space/ui'
|
|
44
|
+
|
|
45
|
+
const activeTab = ref('developer')
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<Tabs v-model="activeTab" variant="segmented">
|
|
50
|
+
<Tab label="Developer" value="developer">
|
|
51
|
+
<Group gap="sm">
|
|
52
|
+
<Button label="Install CLI" />
|
|
53
|
+
<Button label="Run Dev" variant="soft" />
|
|
54
|
+
</Group>
|
|
55
|
+
</Tab>
|
|
56
|
+
|
|
57
|
+
<Tab label="Environment" value="environment">
|
|
58
|
+
Runtime checks go here.
|
|
59
|
+
</Tab>
|
|
60
|
+
</Tabs>
|
|
61
|
+
</template>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`Tabs` supports both patterns:
|
|
65
|
+
- `:items="[{ label, value }]"` plus named slots
|
|
66
|
+
- Declarative `<Tab label="..." value="...">...</Tab>` children
|
|
67
|
+
|
|
36
68
|
## Components
|
|
37
69
|
|
|
38
70
|
| Category | Components |
|
|
39
71
|
|----------|-----------|
|
|
40
|
-
| **Form** | `
|
|
41
|
-
| **Layout** | `
|
|
42
|
-
| **Data** | `
|
|
43
|
-
| **Feedback** | `
|
|
44
|
-
| **Menu** | `
|
|
45
|
-
| **Display** | `
|
|
72
|
+
| **Form** | `Button`, `Input`, `Textarea`, `Select`, `SelectMenu`, `Autocomplete`, `DatePicker`, `FileInput`, `MultiSelect`, `Checkbox`, `RadioGroup`, `Switch`, `Slider`, `ColorPicker`, `FormField`, `ToggleGroup` |
|
|
73
|
+
| **Layout** | `Card`, `Modal`, `ConfirmationModal`, `Drawer`, `Slideover`, `Popover`, `DashboardPanel`, `PanelSection`, `PropRow`, `Separator`, `ScrollArea`, `SplitPane`, `Group` |
|
|
74
|
+
| **Data** | `Table`, `Calendar`, `Tree`, `Timeline`, `Pagination` |
|
|
75
|
+
| **Feedback** | `Alert`, `Badge`, `Chip`, `Progress`, `Skeleton`, `Empty`, `Notification` |
|
|
76
|
+
| **Menu** | `Dropdown`, `DropdownMenu`, `DropdownMenuItem`, `ContextMenu`, `Tabs`, `Tab` |
|
|
77
|
+
| **Display** | `Icon`, `Avatar`, `Accordion`, `Tooltip`, `Kbd`, `Breadcrumbs` |
|
|
78
|
+
| **Shell** | `Sidebar3D`, `Toolbar3D`, `SidebarLayout`, `HeaderLayout` |
|
|
46
79
|
|
|
47
80
|
## Layouts
|
|
48
81
|
|
|
@@ -69,10 +102,10 @@ app.use(ConstructUI)
|
|
|
69
102
|
## Composables
|
|
70
103
|
|
|
71
104
|
```ts
|
|
72
|
-
import {
|
|
105
|
+
import { useNotification, useAuth } from '@construct-space/ui'
|
|
73
106
|
|
|
74
|
-
//
|
|
75
|
-
const { add, remove, clear } =
|
|
107
|
+
// Notification state
|
|
108
|
+
const { add, remove, clear } = useNotification()
|
|
76
109
|
add({ title: 'Saved', color: 'success' })
|
|
77
110
|
|
|
78
111
|
// Auth session management
|
|
@@ -82,6 +115,11 @@ const { user, login, logout, checkSession } = useAuth({
|
|
|
82
115
|
})
|
|
83
116
|
```
|
|
84
117
|
|
|
118
|
+
## Notes
|
|
119
|
+
|
|
120
|
+
- Prefer `Notification` and `useNotification()`. They are the primary feedback API.
|
|
121
|
+
- Import [`@construct-space/ui/style.css`](./dist/style.css) once per app. Components rely on that stylesheet for tokens and generated utility CSS.
|
|
122
|
+
|
|
85
123
|
## Theming
|
|
86
124
|
|
|
87
125
|
Override CSS variables to customize colors per service:
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
modelValue: boolean;
|
|
3
|
+
title?: string;
|
|
4
|
+
message: string;
|
|
5
|
+
details?: string;
|
|
6
|
+
confirmText?: string;
|
|
7
|
+
cancelText?: string;
|
|
8
|
+
confirmColor?: 'primary' | 'error' | 'success' | 'warning' | 'info';
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
"update:modelValue": (value: boolean) => any;
|
|
13
|
+
cancel: () => any;
|
|
14
|
+
confirm: () => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
17
|
+
onCancel?: (() => any) | undefined;
|
|
18
|
+
onConfirm?: (() => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
details: string;
|
|
21
|
+
title: string;
|
|
22
|
+
loading: boolean;
|
|
23
|
+
confirmText: string;
|
|
24
|
+
cancelText: string;
|
|
25
|
+
confirmColor: "primary" | "error" | "success" | "warning" | "info";
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg';
|
|
3
|
+
direction?: 'row' | 'column';
|
|
4
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
5
|
+
justify?: 'start' | 'center' | 'end' | 'between';
|
|
6
|
+
wrap?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_1: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
13
|
+
align: "start" | "center" | "end" | "stretch";
|
|
14
|
+
gap: "none" | "xs" | "sm" | "md" | "lg";
|
|
15
|
+
direction: "row" | "column";
|
|
16
|
+
justify: "start" | "center" | "end" | "between";
|
|
17
|
+
wrap: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
direction?: 'horizontal' | 'vertical';
|
|
3
|
+
initialSize?: number;
|
|
4
|
+
minSize?: number;
|
|
5
|
+
maxSize?: number;
|
|
6
|
+
minPaneSizePx?: number;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
first?: (props: typeof __VLS_1) => any;
|
|
11
|
+
} & {
|
|
12
|
+
second?: (props: typeof __VLS_3) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
15
|
+
direction: "horizontal" | "vertical";
|
|
16
|
+
initialSize: number;
|
|
17
|
+
minSize: number;
|
|
18
|
+
maxSize: number;
|
|
19
|
+
minPaneSizePx: number;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
icon?: string | Component;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_1: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { type Component } from 'vue';
|
|
1
2
|
export interface TabItem {
|
|
2
3
|
label: string;
|
|
3
4
|
value: string;
|
|
4
|
-
icon?: string;
|
|
5
|
+
icon?: string | Component;
|
|
6
|
+
disabled?: boolean;
|
|
5
7
|
}
|
|
6
8
|
type __VLS_Props = {
|
|
7
9
|
modelValue?: string;
|
|
8
10
|
items?: TabItem[];
|
|
11
|
+
variant?: 'line' | 'segmented';
|
|
9
12
|
};
|
|
10
|
-
declare var
|
|
13
|
+
declare var __VLS_31: string, __VLS_32: {};
|
|
11
14
|
type __VLS_Slots = {} & {
|
|
12
|
-
[K in NonNullable<typeof
|
|
15
|
+
[K in NonNullable<typeof __VLS_31>]?: (props: typeof __VLS_32) => any;
|
|
13
16
|
};
|
|
14
17
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
18
|
"update:modelValue": (value: string) => any;
|
|
@@ -18,6 +21,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
18
21
|
}>, {
|
|
19
22
|
items: TabItem[];
|
|
20
23
|
modelValue: string;
|
|
24
|
+
variant: "line" | "segmented";
|
|
21
25
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
26
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
23
27
|
export default _default;
|
|
@@ -47,7 +47,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
47
47
|
indentPx: number;
|
|
48
48
|
draggable: boolean;
|
|
49
49
|
}, {}, {
|
|
50
|
-
TreeNodeRow: import("vue").DefineComponent<
|
|
50
|
+
TreeNodeRow: import("vue").DefineComponent<globalThis.ExtractPropTypes<{
|
|
51
51
|
node: {
|
|
52
52
|
type: PropType<TreeNode>;
|
|
53
53
|
required: true;
|
|
@@ -88,9 +88,9 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
88
88
|
type: PropType<"before" | "inside" | "after">;
|
|
89
89
|
default: string;
|
|
90
90
|
};
|
|
91
|
-
}>, () =>
|
|
91
|
+
}>, () => globalThis.VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
92
92
|
[key: string]: any;
|
|
93
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "drop" | "toggle" | "drag-start" | "drag-over" | "drag-leave" | "drag-end")[], "select" | "drop" | "toggle" | "drag-start" | "drag-over" | "drag-leave" | "drag-end", import("vue").PublicProps, Readonly<
|
|
93
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "drop" | "toggle" | "drag-start" | "drag-over" | "drag-leave" | "drag-end")[], "select" | "drop" | "toggle" | "drag-start" | "drag-over" | "drag-leave" | "drag-end", import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
94
94
|
node: {
|
|
95
95
|
type: PropType<TreeNode>;
|
|
96
96
|
required: true;
|
|
@@ -18,7 +18,7 @@ export interface UseAuthOptions {
|
|
|
18
18
|
autoCheck?: boolean;
|
|
19
19
|
}
|
|
20
20
|
export declare function useAuth(options?: UseAuthOptions): {
|
|
21
|
-
user:
|
|
21
|
+
user: globalThis.Ref<{
|
|
22
22
|
id: string;
|
|
23
23
|
name: string;
|
|
24
24
|
email: string;
|
|
@@ -31,8 +31,8 @@ export declare function useAuth(options?: UseAuthOptions): {
|
|
|
31
31
|
avatar?: string | undefined;
|
|
32
32
|
username?: string | undefined;
|
|
33
33
|
} | null>;
|
|
34
|
-
loading:
|
|
35
|
-
error:
|
|
34
|
+
loading: globalThis.Ref<boolean, boolean>;
|
|
35
|
+
error: globalThis.Ref<string | null, string | null>;
|
|
36
36
|
checkSession: () => Promise<AuthUser | null>;
|
|
37
37
|
login: () => void;
|
|
38
38
|
logout: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare function copy(value: string): Promise<boolean>;
|
|
2
2
|
export declare function useClipboard(): {
|
|
3
|
-
copied:
|
|
4
|
-
text:
|
|
3
|
+
copied: globalThis.Ref<boolean, boolean>;
|
|
4
|
+
text: globalThis.Ref<string, string>;
|
|
5
5
|
copy: typeof copy;
|
|
6
6
|
};
|
|
7
7
|
export {};
|
|
@@ -4,9 +4,9 @@ export declare function useFormValidation<T extends Record<string, any>>(initial
|
|
|
4
4
|
values: T;
|
|
5
5
|
errors: Record<string, string>;
|
|
6
6
|
touched: Record<string, boolean>;
|
|
7
|
-
isValid:
|
|
8
|
-
isDirty:
|
|
9
|
-
submitting:
|
|
7
|
+
isValid: globalThis.ComputedRef<boolean>;
|
|
8
|
+
isDirty: globalThis.ComputedRef<boolean>;
|
|
9
|
+
submitting: globalThis.Ref<boolean, boolean>;
|
|
10
10
|
validate: (field?: string) => boolean;
|
|
11
11
|
touch: (field: string) => void;
|
|
12
12
|
reset: () => void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export declare function useMediaQuery(query: string):
|
|
1
|
+
export declare function useMediaQuery(query: string): globalThis.Ref<boolean, boolean>;
|
|
2
2
|
/** Preset breakpoints matching Tailwind defaults */
|
|
3
3
|
export declare function useBreakpoints(): {
|
|
4
|
-
sm:
|
|
5
|
-
md:
|
|
6
|
-
lg:
|
|
7
|
-
xl:
|
|
8
|
-
xxl:
|
|
9
|
-
preferseDark:
|
|
10
|
-
prefersReducedMotion:
|
|
4
|
+
sm: globalThis.Ref<boolean, boolean>;
|
|
5
|
+
md: globalThis.Ref<boolean, boolean>;
|
|
6
|
+
lg: globalThis.Ref<boolean, boolean>;
|
|
7
|
+
xl: globalThis.Ref<boolean, boolean>;
|
|
8
|
+
xxl: globalThis.Ref<boolean, boolean>;
|
|
9
|
+
preferseDark: globalThis.Ref<boolean, boolean>;
|
|
10
|
+
prefersReducedMotion: globalThis.Ref<boolean, boolean>;
|
|
11
11
|
};
|
|
@@ -13,7 +13,7 @@ declare function add(notification: Omit<Notification, 'id'>): string;
|
|
|
13
13
|
declare function remove(id: string): void;
|
|
14
14
|
declare function clear(): void;
|
|
15
15
|
export declare function useNotification(): {
|
|
16
|
-
notifications:
|
|
16
|
+
notifications: globalThis.Ref<{
|
|
17
17
|
id: string;
|
|
18
18
|
title: string;
|
|
19
19
|
description?: string | undefined;
|
|
@@ -9,7 +9,7 @@ export interface UseSearchOptions<T> {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function useSearch<T>(items: Ref<T[]>, options?: UseSearchOptions<T>): {
|
|
11
11
|
query: Ref<string, string>;
|
|
12
|
-
results:
|
|
13
|
-
isEmpty:
|
|
12
|
+
results: globalThis.ComputedRef<T[]>;
|
|
13
|
+
isEmpty: globalThis.ComputedRef<boolean>;
|
|
14
14
|
clear: () => void;
|
|
15
15
|
};
|
|
@@ -13,10 +13,10 @@ declare function setTheme(id: string): void;
|
|
|
13
13
|
declare function registerTheme(theme: Theme): void;
|
|
14
14
|
declare function init(): void;
|
|
15
15
|
export declare function useTheme(): {
|
|
16
|
-
themes:
|
|
17
|
-
currentTheme:
|
|
18
|
-
currentThemeId:
|
|
19
|
-
isDark:
|
|
16
|
+
themes: globalThis.ComputedRef<Theme[]>;
|
|
17
|
+
currentTheme: globalThis.ComputedRef<Theme>;
|
|
18
|
+
currentThemeId: globalThis.Ref<string, string>;
|
|
19
|
+
isDark: globalThis.ComputedRef<boolean>;
|
|
20
20
|
setTheme: typeof setTheme;
|
|
21
21
|
applyTheme: typeof applyTheme;
|
|
22
22
|
registerTheme: typeof registerTheme;
|