@stachelock/ui 0.6.18 → 0.8.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.
@@ -0,0 +1,80 @@
1
+ export type BadgeVariant = 'primary' | 'success' | 'warning' | 'error' | 'neutral';
2
+ interface Props {
3
+ /** Badge text above title (e.g., "Member Registration", "Event RSVP") */
4
+ badge?: string;
5
+ /** Badge color variant */
6
+ badgeVariant?: BadgeVariant;
7
+ /** Main title (e.g., project name) */
8
+ title?: string;
9
+ /** Subtitle or message below title */
10
+ subtitle?: string;
11
+ /** Description text */
12
+ description?: string;
13
+ /** Whether the header is in loading state */
14
+ loading?: boolean;
15
+ /** Image URL for the project logo */
16
+ imageUrl?: string;
17
+ /** Alt text for the image */
18
+ imageAlt?: string;
19
+ /** Whether to show image placeholder when no image */
20
+ showPlaceholder?: boolean;
21
+ /** Placeholder text when no image */
22
+ placeholderText?: string;
23
+ /** Image size variant */
24
+ imageSize?: 'sm' | 'md' | 'lg';
25
+ /** Show badge skeleton during loading */
26
+ showBadgeSkeleton?: boolean;
27
+ /** Show description skeleton during loading */
28
+ showDescriptionSkeleton?: boolean;
29
+ }
30
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
31
+ badgeVariant: string;
32
+ imageAlt: string;
33
+ showPlaceholder: boolean;
34
+ placeholderText: string;
35
+ imageSize: string;
36
+ showBadgeSkeleton: boolean;
37
+ showDescriptionSkeleton: boolean;
38
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
39
+ badgeVariant: string;
40
+ imageAlt: string;
41
+ showPlaceholder: boolean;
42
+ placeholderText: string;
43
+ imageSize: string;
44
+ showBadgeSkeleton: boolean;
45
+ showDescriptionSkeleton: boolean;
46
+ }>>> & Readonly<{}>, {
47
+ imageSize: "sm" | "md" | "lg";
48
+ badgeVariant: BadgeVariant;
49
+ imageAlt: string;
50
+ showPlaceholder: boolean;
51
+ placeholderText: string;
52
+ showBadgeSkeleton: boolean;
53
+ showDescriptionSkeleton: boolean;
54
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
55
+ content?(_: {}): any;
56
+ image?(_: {}): any;
57
+ }>;
58
+ export default _default;
59
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
60
+ type __VLS_TypePropsToRuntimeProps<T> = {
61
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
62
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
63
+ } : {
64
+ type: import('vue').PropType<T[K]>;
65
+ required: true;
66
+ };
67
+ };
68
+ type __VLS_WithDefaults<P, D> = {
69
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
70
+ default: D[K];
71
+ }> : P[K];
72
+ };
73
+ type __VLS_Prettify<T> = {
74
+ [K in keyof T]: T[K];
75
+ } & {};
76
+ type __VLS_WithTemplateSlots<T, S> = T & {
77
+ new (): {
78
+ $slots: S;
79
+ };
80
+ };
@@ -0,0 +1,75 @@
1
+ export type StatusPageStatus = 'loading' | 'success' | 'error' | 'info' | null;
2
+ interface Props {
3
+ /** Badge text displayed above the title */
4
+ badge?: string;
5
+ /** Main title */
6
+ title: string;
7
+ /** Current status state */
8
+ status?: StatusPageStatus;
9
+ /** Status message below the title */
10
+ statusMessage?: string;
11
+ /** Error message (used when status is 'error') */
12
+ errorMessage?: string;
13
+ /** Success message (used when status is 'success') */
14
+ successMessage?: string;
15
+ /** Action button label for error state */
16
+ actionLabel?: string;
17
+ /** Maximum width size variant */
18
+ size?: 'sm' | 'md' | 'lg';
19
+ /** Background style variant */
20
+ background?: 'gray' | 'white' | 'transparent';
21
+ /** Badge color variant based on status */
22
+ badgeVariant?: 'primary' | 'success' | 'error' | 'warning' | 'neutral';
23
+ }
24
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
25
+ status: null;
26
+ size: string;
27
+ background: string;
28
+ badgeVariant: string;
29
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
30
+ action: () => void;
31
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
32
+ status: null;
33
+ size: string;
34
+ background: string;
35
+ badgeVariant: string;
36
+ }>>> & Readonly<{
37
+ onAction?: (() => any) | undefined;
38
+ }>, {
39
+ size: "sm" | "md" | "lg";
40
+ background: "white" | "transparent" | "gray";
41
+ status: StatusPageStatus;
42
+ badgeVariant: "primary" | "success" | "warning" | "error" | "neutral";
43
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
44
+ loading?(_: {}): any;
45
+ success?(_: {}): any;
46
+ "error-icon"?(_: {}): any;
47
+ "error-actions"?(_: {}): any;
48
+ info?(_: {}): any;
49
+ default?(_: {}): any;
50
+ footer?(_: {}): any;
51
+ "below-card"?(_: {}): any;
52
+ }>;
53
+ export default _default;
54
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
55
+ type __VLS_TypePropsToRuntimeProps<T> = {
56
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
57
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
58
+ } : {
59
+ type: import('vue').PropType<T[K]>;
60
+ required: true;
61
+ };
62
+ };
63
+ type __VLS_WithDefaults<P, D> = {
64
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
65
+ default: D[K];
66
+ }> : P[K];
67
+ };
68
+ type __VLS_Prettify<T> = {
69
+ [K in keyof T]: T[K];
70
+ } & {};
71
+ type __VLS_WithTemplateSlots<T, S> = T & {
72
+ new (): {
73
+ $slots: S;
74
+ };
75
+ };
@@ -5,12 +5,16 @@ export { default as HeaderLayout } from './HeaderLayout';
5
5
  export { default as InfoCard } from './InfoCard';
6
6
  export { default as NavigationGroup } from './NavigationGroup';
7
7
  export { default as NavigationItem } from './NavigationItem';
8
+ export { default as NestedNavigationItem } from './NestedNavigationItem';
9
+ export { default as NestedSidebar } from './NestedSidebar';
8
10
  export { default as ProfileHeaderAvatar } from './ProfileHeaderAvatar';
11
+ export { default as ProjectInfoHeader } from './ProjectInfoHeader';
9
12
  export { default as ProjectLogo } from './ProjectLogo';
10
13
  export { default as PropsTable } from './PropsTable';
11
14
  export { default as ShowcaseCard } from './ShowcaseCard';
12
15
  export { default as ShowcaseLayout } from './ShowcaseLayout';
13
16
  export { default as SidebarLayout } from './SidebarLayout';
14
17
  export { default as StateDisplay } from './StateDisplay';
18
+ export { default as StatusPageLayout } from './StatusPageLayout';
15
19
  export { default as DetailPanel } from './UiDetailPanel';
16
20
  export { default as SplitPanelLayout } from './UiSplitPanelLayout';
@@ -6,6 +6,7 @@ export * from './useMap';
6
6
  export * from './useModal';
7
7
  export * from './useNotifications';
8
8
  export * from './useScreenSize';
9
+ export * from './useSidebarNavigation';
9
10
  export * from './useSimpleTabs';
10
11
  export * from './useStringTransform';
11
12
  export * from './useTabs';
@@ -0,0 +1,129 @@
1
+ import { Ref, ComputedRef } from 'vue';
2
+
3
+ /**
4
+ * Navigation item structure for nested sidebar
5
+ */
6
+ export interface SidebarNavItem {
7
+ /** Unique identifier */
8
+ id: string;
9
+ /** Display name */
10
+ name: string;
11
+ /** Route path or URL */
12
+ path: string;
13
+ /** Icon component (Vue component) */
14
+ icon?: unknown;
15
+ /** Badge text */
16
+ badge?: string;
17
+ /** Badge color theme */
18
+ badgeTheme?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
19
+ /** Whether item is disabled */
20
+ disabled?: boolean;
21
+ /** Child navigation items (for nesting) */
22
+ children?: SidebarNavItem[];
23
+ /** Custom metadata */
24
+ meta?: Record<string, unknown>;
25
+ }
26
+ /**
27
+ * Navigation tier levels
28
+ */
29
+ export type NavigationTier = 0 | 1 | 2;
30
+ /**
31
+ * Options for useSidebarNavigation composable
32
+ */
33
+ export interface UseSidebarNavigationOptions {
34
+ /** Navigation items */
35
+ items: SidebarNavItem[];
36
+ /** Initial route path */
37
+ initialPath?: string;
38
+ /** Auto-expand parents of active item */
39
+ autoExpandActive?: boolean;
40
+ /** Allow multiple sections to be expanded */
41
+ allowMultipleExpanded?: boolean;
42
+ /** Persist expanded state to localStorage */
43
+ persistExpanded?: boolean;
44
+ /** Storage key for persisted state */
45
+ storageKey?: string;
46
+ /** Callback when navigation occurs */
47
+ onNavigate?: (path: string, item: SidebarNavItem) => void;
48
+ }
49
+ /**
50
+ * Return type for useSidebarNavigation composable
51
+ */
52
+ export interface UseSidebarNavigationReturn {
53
+ /** Current navigation items */
54
+ items: ComputedRef<SidebarNavItem[]>;
55
+ /** Set of expanded item IDs */
56
+ expandedItems: Ref<Set<string>>;
57
+ /** Current active path */
58
+ currentPath: Ref<string>;
59
+ /** Whether mobile sidebar is open */
60
+ isMobileOpen: Ref<boolean>;
61
+ /** Whether sidebar is collapsed (icon only) */
62
+ isCollapsed: Ref<boolean>;
63
+ /** Toggle an item's expanded state */
64
+ toggleItem: (itemId: string) => void;
65
+ /** Expand an item */
66
+ expandItem: (itemId: string) => void;
67
+ /** Collapse an item */
68
+ collapseItem: (itemId: string) => void;
69
+ /** Expand all items */
70
+ expandAll: () => void;
71
+ /** Collapse all items */
72
+ collapseAll: () => void;
73
+ /** Set current path and auto-expand parents */
74
+ setCurrentPath: (path: string) => void;
75
+ /** Navigate to a path */
76
+ navigate: (path: string, item: SidebarNavItem) => void;
77
+ /** Open mobile sidebar */
78
+ openMobile: () => void;
79
+ /** Close mobile sidebar */
80
+ closeMobile: () => void;
81
+ /** Toggle mobile sidebar */
82
+ toggleMobile: () => void;
83
+ /** Toggle collapsed state */
84
+ toggleCollapsed: () => void;
85
+ /** Check if an item is active */
86
+ isItemActive: (item: SidebarNavItem) => boolean;
87
+ /** Check if an item has an active child */
88
+ hasActiveChild: (item: SidebarNavItem) => boolean;
89
+ /** Get all parent IDs for a given path */
90
+ getParentIds: (path: string) => string[];
91
+ /** Find an item by path */
92
+ findItemByPath: (path: string) => SidebarNavItem | undefined;
93
+ /** Get flat list of all items */
94
+ flatItems: ComputedRef<SidebarNavItem[]>;
95
+ }
96
+ /**
97
+ * Composable for managing nested sidebar navigation
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * const {
102
+ * items,
103
+ * expandedItems,
104
+ * currentPath,
105
+ * toggleItem,
106
+ * navigate,
107
+ * } = useSidebarNavigation({
108
+ * items: navigationItems,
109
+ * initialPath: route.path,
110
+ * autoExpandActive: true,
111
+ * });
112
+ * ```
113
+ */
114
+ export declare function useSidebarNavigation(options: UseSidebarNavigationOptions): UseSidebarNavigationReturn;
115
+ /**
116
+ * Build navigation tree from flat items with parent references
117
+ */
118
+ export declare function buildNavigationTree(items: Array<SidebarNavItem & {
119
+ parent?: string;
120
+ }>): SidebarNavItem[];
121
+ /**
122
+ * Create a navigation item with defaults
123
+ */
124
+ export declare function createNavItem(id: string, name: string, path: string, options?: Partial<SidebarNavItem>): SidebarNavItem;
125
+ /**
126
+ * Sort navigation items by a key
127
+ */
128
+ export declare function sortNavItems(items: SidebarNavItem[], key?: keyof SidebarNavItem, direction?: 'asc' | 'desc'): SidebarNavItem[];
129
+ export default useSidebarNavigation;
@@ -3,4 +3,5 @@ export { default as DashboardLayoutPage } from './DashboardLayoutPage';
3
3
  export { default as HeaderLayoutPage } from './HeaderLayoutPage';
4
4
  export { default as NavigationGroupPage } from './NavigationGroupPage';
5
5
  export { default as NavigationItemPage } from './NavigationItemPage';
6
+ export { default as NestedSidebarPage } from './NestedSidebarPage';
6
7
  export { default as SplitPanelLayoutPage } from './SplitPanelLayoutPage';