@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @construct-space/ui
2
2
 
3
- Vue 3 component library for Construct services. 43 production components, shared layouts, composables, and design tokens.
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
- // Import components individually
23
- import { CButton, CInput, CModal, CToast } from '@construct-space/ui'
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
- // Or register all components globally
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** | `CButton`, `CInput`, `CTextarea`, `CSelect`, `CSelectMenu`, `CCheckbox`, `CRadioGroup`, `CSwitch`, `CSlider`, `CColorPicker`, `CFormField` |
41
- | **Layout** | `CCard`, `CModal`, `CDrawer`, `CSlideover`, `CPopover`, `CDashboardPanel`, `CPanelSection`, `CPropRow`, `CSeparator`, `CScrollArea` |
42
- | **Data** | `CTable`, `CCalendar`, `CTree`, `CTimeline`, `CPagination` |
43
- | **Feedback** | `CAlert`, `CBadge`, `CChip`, `CProgress`, `CSkeleton`, `CEmpty`, `CToast` |
44
- | **Menu** | `CDropdown`, `CDropdownMenu`, `CDropdownMenuItem`, `CContextMenu` |
45
- | **Display** | `CIcon`, `CAvatar`, `CAccordion`, `CTabs`, `CTooltip`, `CKbd` |
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 { useToast, useAuth } from '@construct-space/ui'
105
+ import { useNotification, useAuth } from '@construct-space/ui'
73
106
 
74
- // Toast notifications
75
- const { add, remove, clear } = useToast()
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 __VLS_27: string, __VLS_28: {};
13
+ declare var __VLS_31: string, __VLS_32: {};
11
14
  type __VLS_Slots = {} & {
12
- [K in NonNullable<typeof __VLS_27>]?: (props: typeof __VLS_28) => any;
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<import("vue").ExtractPropTypes<{
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
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
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<import("vue").ExtractPropTypes<{
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: import("vue").Ref<{
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: import("vue").Ref<boolean, boolean>;
35
- error: import("vue").Ref<string | null, string | null>;
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: import("vue").Ref<boolean, boolean>;
4
- text: import("vue").Ref<string, string>;
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: import("vue").ComputedRef<boolean>;
8
- isDirty: import("vue").ComputedRef<boolean>;
9
- submitting: import("vue").Ref<boolean, boolean>;
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): import("vue").Ref<boolean, boolean>;
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: import("vue").Ref<boolean, boolean>;
5
- md: import("vue").Ref<boolean, boolean>;
6
- lg: import("vue").Ref<boolean, boolean>;
7
- xl: import("vue").Ref<boolean, boolean>;
8
- xxl: import("vue").Ref<boolean, boolean>;
9
- preferseDark: import("vue").Ref<boolean, boolean>;
10
- prefersReducedMotion: import("vue").Ref<boolean, boolean>;
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: import("vue").Ref<{
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: import("vue").ComputedRef<T[]>;
13
- isEmpty: import("vue").ComputedRef<boolean>;
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: import("vue").ComputedRef<Theme[]>;
17
- currentTheme: import("vue").ComputedRef<Theme>;
18
- currentThemeId: import("vue").Ref<string, string>;
19
- isDark: import("vue").ComputedRef<boolean>;
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;