@construct-space/ui 0.2.0 → 0.3.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.
@@ -0,0 +1,30 @@
1
+ export interface AutocompleteOption {
2
+ label: string;
3
+ value: string | number;
4
+ disabled?: boolean;
5
+ [key: string]: unknown;
6
+ }
7
+ type __VLS_Props = {
8
+ modelValue?: string | number | null;
9
+ options?: AutocompleteOption[] | string[];
10
+ placeholder?: string;
11
+ size?: 'xs' | 'sm' | 'md' | 'lg';
12
+ disabled?: boolean;
13
+ icon?: string;
14
+ emptyText?: string;
15
+ clearable?: boolean;
16
+ };
17
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ "update:modelValue": (value: string | number | null) => any;
19
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ "onUpdate:modelValue"?: ((value: string | number | null) => any) | undefined;
21
+ }>, {
22
+ disabled: boolean;
23
+ modelValue: string | number | null;
24
+ placeholder: string;
25
+ size: "xs" | "sm" | "md" | "lg";
26
+ options: AutocompleteOption[] | string[];
27
+ emptyText: string;
28
+ clearable: boolean;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ export default _default;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Breadcrumbs — Construct UI
3
+ * Navigation breadcrumb trail with chevron separators.
4
+ */
5
+ export interface BreadcrumbItem {
6
+ label: string;
7
+ to?: string;
8
+ icon?: string;
9
+ }
10
+ type __VLS_Props = {
11
+ items: BreadcrumbItem[];
12
+ };
13
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ navigate: (item: BreadcrumbItem) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ onNavigate?: ((item: BreadcrumbItem) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ export default _default;
@@ -0,0 +1,21 @@
1
+ type __VLS_Props = {
2
+ modelValue?: string | null;
3
+ placeholder?: string;
4
+ size?: 'xs' | 'sm' | 'md' | 'lg';
5
+ disabled?: boolean;
6
+ min?: string;
7
+ max?: string;
8
+ format?: 'iso' | 'locale';
9
+ };
10
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:modelValue": (value: string | null) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
14
+ }>, {
15
+ disabled: boolean;
16
+ modelValue: string | null;
17
+ placeholder: string;
18
+ size: "xs" | "sm" | "md" | "lg";
19
+ format: "iso" | "locale";
20
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ export default _default;
@@ -0,0 +1,21 @@
1
+ type __VLS_Props = {
2
+ modelValue?: File | File[] | null;
3
+ accept?: string;
4
+ multiple?: boolean;
5
+ disabled?: boolean;
6
+ maxSize?: number;
7
+ placeholder?: string;
8
+ };
9
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ "update:modelValue": (value: File | File[] | null) => any;
11
+ error: (message: string) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ "onUpdate:modelValue"?: ((value: File | File[] | null) => any) | undefined;
14
+ onError?: ((message: string) => any) | undefined;
15
+ }>, {
16
+ disabled: boolean;
17
+ multiple: boolean;
18
+ modelValue: File | File[] | null;
19
+ placeholder: string;
20
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ export default _default;
@@ -0,0 +1,27 @@
1
+ export interface MultiSelectOption {
2
+ label: string;
3
+ value: string;
4
+ disabled?: boolean;
5
+ }
6
+ type __VLS_Props = {
7
+ modelValue?: string[];
8
+ options?: MultiSelectOption[] | string[];
9
+ placeholder?: string;
10
+ size?: 'xs' | 'sm' | 'md' | 'lg';
11
+ disabled?: boolean;
12
+ searchable?: boolean;
13
+ max?: number;
14
+ };
15
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ "update:modelValue": (value: string[]) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
19
+ }>, {
20
+ disabled: boolean;
21
+ modelValue: string[];
22
+ placeholder: string;
23
+ size: "xs" | "sm" | "md" | "lg";
24
+ options: MultiSelectOption[] | string[];
25
+ searchable: boolean;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ export default _default;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Sidebar3D — Construct UI
3
+ * 3D rotating dock sidebar with front + side panel.
4
+ * 72px wide, CSS 3D cube rotation on space enter/exit.
5
+ */
6
+ export interface SidebarItem {
7
+ id: string;
8
+ icon: string;
9
+ label: string;
10
+ to?: string;
11
+ active?: boolean;
12
+ badge?: string | number;
13
+ color?: string;
14
+ }
15
+ export interface SidebarSection {
16
+ items: SidebarItem[];
17
+ separator?: boolean;
18
+ }
19
+ type __VLS_Props = {
20
+ /** Main panel sections (front face) */
21
+ sections?: SidebarSection[];
22
+ /** Side panel items (right face, shown when rotated) */
23
+ sideItems?: SidebarItem[];
24
+ /** Back button label for side panel */
25
+ sideBackLabel?: string;
26
+ /** Whether the sidebar is rotated to show side panel */
27
+ rotated?: boolean;
28
+ /** Logo slot or icon name */
29
+ logoIcon?: string;
30
+ /** Avatar initials for bottom */
31
+ avatar?: string;
32
+ /** Avatar active/menu state */
33
+ avatarActive?: boolean;
34
+ };
35
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_13: {};
36
+ type __VLS_Slots = {} & {
37
+ logo?: (props: typeof __VLS_1) => any;
38
+ } & {
39
+ 'logo-icon'?: (props: typeof __VLS_3) => any;
40
+ } & {
41
+ bottom?: (props: typeof __VLS_13) => any;
42
+ };
43
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
44
+ "item-click": (item: SidebarItem) => any;
45
+ back: () => any;
46
+ "logo-click": () => any;
47
+ "avatar-click": () => any;
48
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
49
+ "onItem-click"?: ((item: SidebarItem) => any) | undefined;
50
+ onBack?: (() => any) | undefined;
51
+ "onLogo-click"?: (() => any) | undefined;
52
+ "onAvatar-click"?: (() => any) | undefined;
53
+ }>, {
54
+ sections: SidebarSection[];
55
+ sideItems: SidebarItem[];
56
+ sideBackLabel: string;
57
+ rotated: boolean;
58
+ avatar: string;
59
+ avatarActive: boolean;
60
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
61
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
62
+ export default _default;
63
+ type __VLS_WithSlots<T, S> = T & {
64
+ new (): {
65
+ $slots: S;
66
+ };
67
+ };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * ToggleGroup — Construct UI
3
+ * Segmented control / button group for single or multi selection.
4
+ */
5
+ export interface ToggleOption {
6
+ label: string;
7
+ value: string;
8
+ icon?: string;
9
+ disabled?: boolean;
10
+ }
11
+ type __VLS_Props = {
12
+ modelValue?: string | string[];
13
+ options: ToggleOption[] | string[];
14
+ multiple?: boolean;
15
+ size?: 'xs' | 'sm' | 'md';
16
+ disabled?: boolean;
17
+ };
18
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
+ "update:modelValue": (value: string | string[]) => any;
20
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
21
+ "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
22
+ }>, {
23
+ disabled: boolean;
24
+ multiple: boolean;
25
+ modelValue: string | string[];
26
+ size: "xs" | "sm" | "md";
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ export default _default;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Toolbar3D — Construct UI
3
+ * 3D rotating toolbar that flips on page transitions.
4
+ * Rounded-right-only, inset margins, surface background.
5
+ */
6
+ export interface ToolbarAction {
7
+ id: string;
8
+ icon: string;
9
+ label: string;
10
+ active?: boolean;
11
+ disabled?: boolean;
12
+ }
13
+ export interface BreadcrumbItem {
14
+ label: string;
15
+ to?: string;
16
+ icon?: string;
17
+ }
18
+ type __VLS_Props = {
19
+ /** Breadcrumb items for front panel */
20
+ breadcrumbs?: BreadcrumbItem[];
21
+ /** Action buttons on the right */
22
+ actions?: ToolbarAction[];
23
+ /** Next page breadcrumbs (bottom panel, shown during rotation) */
24
+ nextBreadcrumbs?: BreadcrumbItem[];
25
+ /** Next page actions */
26
+ nextActions?: ToolbarAction[];
27
+ /** Whether currently rotating */
28
+ rotating?: boolean;
29
+ /** Space icon to show before breadcrumbs */
30
+ spaceIcon?: string;
31
+ /** Space accent color */
32
+ spaceColor?: string;
33
+ };
34
+ declare var __VLS_1: {}, __VLS_7: {}, __VLS_9: {}, __VLS_15: {};
35
+ type __VLS_Slots = {} & {
36
+ 'space-icon'?: (props: typeof __VLS_1) => any;
37
+ } & {
38
+ left?: (props: typeof __VLS_7) => any;
39
+ } & {
40
+ center?: (props: typeof __VLS_9) => any;
41
+ } & {
42
+ right?: (props: typeof __VLS_15) => any;
43
+ };
44
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
45
+ "action-click": (action: ToolbarAction) => any;
46
+ "breadcrumb-click": (crumb: BreadcrumbItem) => any;
47
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
48
+ "onAction-click"?: ((action: ToolbarAction) => any) | undefined;
49
+ "onBreadcrumb-click"?: ((crumb: BreadcrumbItem) => any) | undefined;
50
+ }>, {
51
+ breadcrumbs: BreadcrumbItem[];
52
+ actions: ToolbarAction[];
53
+ nextBreadcrumbs: BreadcrumbItem[];
54
+ nextActions: ToolbarAction[];
55
+ rotating: boolean;
56
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
57
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
58
+ export default _default;
59
+ type __VLS_WithSlots<T, S> = T & {
60
+ new (): {
61
+ $slots: S;
62
+ };
63
+ };
@@ -0,0 +1,9 @@
1
+ import { type Ref } from 'vue';
2
+ export interface AsyncState<T> {
3
+ data: Ref<T | null>;
4
+ loading: Ref<boolean>;
5
+ error: Ref<string | null>;
6
+ execute: (...args: any[]) => Promise<T | null>;
7
+ reset: () => void;
8
+ }
9
+ export declare function useAsync<T>(fn: (...args: any[]) => Promise<T>): AsyncState<T>;
@@ -0,0 +1,2 @@
1
+ import { type Ref } from 'vue';
2
+ export declare function useClickOutside(target: Ref<HTMLElement | null>, handler: (e: MouseEvent) => void): void;
@@ -0,0 +1,7 @@
1
+ declare function copy(value: string): Promise<boolean>;
2
+ export declare function useClipboard(): {
3
+ copied: import("vue").Ref<boolean, boolean>;
4
+ text: import("vue").Ref<string, string>;
5
+ copy: typeof copy;
6
+ };
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type Ref } from 'vue';
2
+ /** Returns a debounced ref that updates after `ms` delay */
3
+ export declare function useDebounce<T>(source: Ref<T>, ms?: number): Ref<T>;
4
+ /** Returns a throttled ref that updates at most once per `ms` */
5
+ export declare function useThrottle<T>(source: Ref<T>, ms?: number): Ref<T>;
6
+ /** Creates a debounced function */
7
+ export declare function debounce<T extends (...args: any[]) => any>(fn: T, ms?: number): T;
@@ -0,0 +1,20 @@
1
+ type ValidationRule = (value: any) => string | true;
2
+ type FieldRules = Record<string, ValidationRule[]>;
3
+ export declare function useFormValidation<T extends Record<string, any>>(initial: T, rules?: FieldRules): {
4
+ values: T;
5
+ errors: Record<string, string>;
6
+ touched: Record<string, boolean>;
7
+ isValid: import("vue").ComputedRef<boolean>;
8
+ isDirty: import("vue").ComputedRef<boolean>;
9
+ submitting: import("vue").Ref<boolean, boolean>;
10
+ validate: (field?: string) => boolean;
11
+ touch: (field: string) => void;
12
+ reset: () => void;
13
+ handleSubmit: (fn: (values: T) => Promise<void> | void) => Promise<void>;
14
+ };
15
+ export declare const required: (msg?: string) => ValidationRule;
16
+ export declare const minLength: (n: number, msg?: string) => ValidationRule;
17
+ export declare const maxLength: (n: number, msg?: string) => ValidationRule;
18
+ export declare const email: (msg?: string) => ValidationRule;
19
+ export declare const pattern: (re: RegExp, msg?: string) => ValidationRule;
20
+ export {};
@@ -0,0 +1,2 @@
1
+ import { type Ref } from 'vue';
2
+ export declare function useIntersectionObserver(target: Ref<HTMLElement | null>, options?: IntersectionObserverInit): Ref<boolean, boolean>;
@@ -0,0 +1,16 @@
1
+ export interface KeyBinding {
2
+ key: string;
3
+ ctrl?: boolean;
4
+ meta?: boolean;
5
+ shift?: boolean;
6
+ alt?: boolean;
7
+ handler: (e: KeyboardEvent) => void;
8
+ prevent?: boolean;
9
+ }
10
+ export declare function useKeyboard(bindings: KeyBinding[]): void;
11
+ /** Register a single keyboard shortcut */
12
+ export declare function useHotkey(key: string, handler: () => void, modifiers?: {
13
+ ctrl?: boolean;
14
+ shift?: boolean;
15
+ alt?: boolean;
16
+ }): void;
@@ -0,0 +1,2 @@
1
+ import { type Ref } from 'vue';
2
+ export declare function useLocalStorage<T>(key: string, defaultValue: T): Ref<T>;
@@ -0,0 +1,11 @@
1
+ export declare function useMediaQuery(query: string): import("vue").Ref<boolean, boolean>;
2
+ /** Preset breakpoints matching Tailwind defaults */
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>;
11
+ };
@@ -1,4 +1,4 @@
1
- export interface Toast {
1
+ export interface Notification {
2
2
  id: string;
3
3
  title: string;
4
4
  description?: string;
@@ -9,11 +9,11 @@ export interface Toast {
9
9
  onClick: () => void;
10
10
  };
11
11
  }
12
- declare function add(toast: Omit<Toast, 'id'>): string;
12
+ declare function add(notification: Omit<Notification, 'id'>): string;
13
13
  declare function remove(id: string): void;
14
14
  declare function clear(): void;
15
- export declare function useToast(): {
16
- toasts: import("vue").Ref<{
15
+ export declare function useNotification(): {
16
+ notifications: import("vue").Ref<{
17
17
  id: string;
18
18
  title: string;
19
19
  description?: string | undefined;
@@ -23,7 +23,7 @@ export declare function useToast(): {
23
23
  label: string;
24
24
  onClick: () => void;
25
25
  } | undefined;
26
- }[], Toast[] | {
26
+ }[], Notification[] | {
27
27
  id: string;
28
28
  title: string;
29
29
  description?: string | undefined;
@@ -37,10 +37,12 @@ export declare function useToast(): {
37
37
  add: typeof add;
38
38
  remove: typeof remove;
39
39
  clear: typeof clear;
40
- toast: {
40
+ notification: {
41
41
  add: typeof add;
42
42
  remove: typeof remove;
43
43
  clear: typeof clear;
44
44
  };
45
45
  };
46
+ /** Quick notification helper — `notify('Saved!')` or `notify('Error', 'error')` */
47
+ export declare function notify(title: string, color?: Notification['color'], description?: string): string;
46
48
  export {};
@@ -0,0 +1,15 @@
1
+ import { type Ref } from 'vue';
2
+ export interface UseSearchOptions<T> {
3
+ /** Fields to search in (dot notation supported) */
4
+ keys?: string[];
5
+ /** Debounce delay in ms */
6
+ debounce?: number;
7
+ /** Case sensitive */
8
+ caseSensitive?: boolean;
9
+ }
10
+ export declare function useSearch<T>(items: Ref<T[]>, options?: UseSearchOptions<T>): {
11
+ query: Ref<string, string>;
12
+ results: import("vue").ComputedRef<T[]>;
13
+ isEmpty: import("vue").ComputedRef<boolean>;
14
+ clear: () => void;
15
+ };
@@ -0,0 +1,25 @@
1
+ export interface Theme {
2
+ id: string;
3
+ name: string;
4
+ mode: 'light' | 'dark';
5
+ bg: string;
6
+ fg: string;
7
+ muted: string;
8
+ accent: string;
9
+ accentFg: string;
10
+ }
11
+ declare function applyTheme(theme: Theme): void;
12
+ declare function setTheme(id: string): void;
13
+ declare function registerTheme(theme: Theme): void;
14
+ declare function init(): void;
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>;
20
+ setTheme: typeof setTheme;
21
+ applyTheme: typeof applyTheme;
22
+ registerTheme: typeof registerTheme;
23
+ init: typeof init;
24
+ };
25
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type Ref } from 'vue';
2
+ export declare function useToggle(initial?: boolean): [Ref<boolean>, (value?: boolean) => void];
3
+ export declare function useCounter(initial?: number, options?: {
4
+ min?: number;
5
+ max?: number;
6
+ }): {
7
+ count: Ref<number, number>;
8
+ increment: (delta?: number) => void;
9
+ decrement: (delta?: number) => void;
10
+ reset: () => void;
11
+ set: (value: number) => void;
12
+ };