@urbicon-ui/shared-types 6.1.4

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.
Files changed (48) hide show
  1. package/README.md +63 -0
  2. package/dist/component.d.ts +185 -0
  3. package/dist/component.d.ts.map +1 -0
  4. package/dist/component.js +2 -0
  5. package/dist/component.js.map +1 -0
  6. package/dist/docs-config.d.ts +120 -0
  7. package/dist/docs-config.d.ts.map +1 -0
  8. package/dist/docs-config.js +2 -0
  9. package/dist/docs-config.js.map +1 -0
  10. package/dist/documentation-core.d.ts +217 -0
  11. package/dist/documentation-core.d.ts.map +1 -0
  12. package/dist/documentation-core.js +2 -0
  13. package/dist/documentation-core.js.map +1 -0
  14. package/dist/documentation.d.ts +44 -0
  15. package/dist/documentation.d.ts.map +1 -0
  16. package/dist/documentation.js +2 -0
  17. package/dist/documentation.js.map +1 -0
  18. package/dist/examples.d.ts +71 -0
  19. package/dist/examples.d.ts.map +1 -0
  20. package/dist/examples.js +2 -0
  21. package/dist/examples.js.map +1 -0
  22. package/dist/globals.d.ts +13 -0
  23. package/dist/globals.d.ts.map +1 -0
  24. package/dist/globals.js +6 -0
  25. package/dist/globals.js.map +1 -0
  26. package/dist/index.d.ts +13 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +12 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/navigation.d.ts +194 -0
  31. package/dist/navigation.d.ts.map +1 -0
  32. package/dist/navigation.js +2 -0
  33. package/dist/navigation.js.map +1 -0
  34. package/dist/playground.d.ts +153 -0
  35. package/dist/playground.d.ts.map +1 -0
  36. package/dist/playground.js +2 -0
  37. package/dist/playground.js.map +1 -0
  38. package/dist/tsconfig.tsbuildinfo +1 -0
  39. package/package.json +84 -0
  40. package/src/component.ts +200 -0
  41. package/src/docs-config.ts +134 -0
  42. package/src/documentation-core.ts +258 -0
  43. package/src/documentation.ts +49 -0
  44. package/src/examples.ts +73 -0
  45. package/src/globals.ts +17 -0
  46. package/src/index.ts +87 -0
  47. package/src/navigation.ts +206 -0
  48. package/src/playground.ts +184 -0
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Component metadata (shared across all packages)
3
+ */
4
+ export interface ComponentMetadata {
5
+ version?: string;
6
+ description: string;
7
+ tags: string[];
8
+ deprecated?: DeprecationInfo;
9
+ experimental?: boolean;
10
+ since?: string;
11
+ }
12
+
13
+ export interface DeprecationInfo {
14
+ message: string;
15
+ since: string;
16
+ alternative?: string;
17
+ removeIn?: string;
18
+ }
19
+
20
+ /**
21
+ * Badge configuration (used in multiple packages)
22
+ */
23
+ export interface ComponentBadge {
24
+ label: string;
25
+ intent?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info';
26
+ variant?: 'filled' | 'outlined' | 'soft';
27
+ }
28
+
29
+ /**
30
+ * Section ordering concept
31
+ */
32
+ export interface SectionOrder {
33
+ id: string;
34
+ order: number;
35
+ }
36
+
37
+ /**
38
+ * Basic LLM configuration (shared between docs generators)
39
+ */
40
+ export interface LLMConfig {
41
+ include?: boolean;
42
+ maxSections?: number;
43
+ priority?: string[];
44
+ excludeTypes?: string[];
45
+ simplifyContent?: boolean;
46
+ }
47
+
48
+ // Re-export for backward compatibility
49
+ export type { DeprecationInfo as ComponentDeprecationInfo };
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Component example definition
3
+ */
4
+ export interface ComponentExample {
5
+ /** Unique example identifier */
6
+ id: string;
7
+ /** Example title */
8
+ title: string;
9
+ /** Example description */
10
+ description?: string;
11
+ /** Example source code */
12
+ code: string;
13
+ /** Associated component name */
14
+ component?: string;
15
+ /** Include in LLM output */
16
+ includeLLM?: boolean;
17
+ /** Include in documentation */
18
+ includeDocs?: boolean;
19
+ /** Associated tags */
20
+ tags?: string[];
21
+ }
22
+
23
+ /**
24
+ * Usage pattern definition
25
+ */
26
+ export interface UsagePattern {
27
+ /** Unique pattern identifier */
28
+ id: string;
29
+ /** Pattern title */
30
+ title: string;
31
+ /** Pattern description */
32
+ description: string;
33
+ /** When to use this pattern */
34
+ when: string;
35
+ /** When to avoid this pattern */
36
+ avoid: string;
37
+ /** Example implementations */
38
+ examples: string[];
39
+ /** Related components */
40
+ relatedComponents?: string[];
41
+ /** Include in LLM output */
42
+ includeLLM?: boolean;
43
+ }
44
+
45
+ /**
46
+ * Example collection with grouping
47
+ */
48
+ export interface ExampleCollection {
49
+ /** Collection identifier */
50
+ id: string;
51
+ /** Collection title */
52
+ title: string;
53
+ /** Collection description */
54
+ description?: string;
55
+ /** Grouped examples */
56
+ groups: ExampleGroup[];
57
+ }
58
+
59
+ /**
60
+ * Example group within a collection
61
+ */
62
+ export interface ExampleGroup {
63
+ /** Group identifier */
64
+ id: string;
65
+ /** Group title */
66
+ title: string;
67
+ /** Group description */
68
+ description?: string;
69
+ /** Examples in this group */
70
+ examples: ComponentExample[];
71
+ /** Group order */
72
+ order?: number;
73
+ }
package/src/globals.ts ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Global type augmentations used across all packages
3
+ * Extends standard HTML attributes with custom properties
4
+ */
5
+
6
+ declare global {
7
+ // Svelte's type system requires the `svelteHTML` namespace for template-
8
+ // attribute augmentation; module syntax is not a valid alternative here.
9
+ // eslint-disable-next-line @typescript-eslint/no-namespace
10
+ namespace svelteHTML {
11
+ interface HTMLAttributes<T> {
12
+ onoutclick?: (event: CustomEvent) => void;
13
+ }
14
+ }
15
+ }
16
+
17
+ export {}; // Make this a module
package/src/index.ts ADDED
@@ -0,0 +1,87 @@
1
+ // Core documentation types (original)
2
+
3
+ // Core component types
4
+ export type {
5
+ ComponentInfo,
6
+ ComponentStats,
7
+ CrossReference,
8
+ InheritanceInfo,
9
+ PackageInfo,
10
+ PropExample,
11
+ PropInfo,
12
+ PropSource,
13
+ VariantExample,
14
+ VariantInfo
15
+ } from './component.js';
16
+
17
+ // Svelte docs configuration types (original)
18
+ export type {
19
+ ApiConfig,
20
+ DocsMetadata,
21
+ DocsPlaygroundConfig,
22
+ ExamplesConfig,
23
+ OverviewConfig,
24
+ SvelteDocsConfig,
25
+ UsageConfig,
26
+ VariantsConfig
27
+ } from './docs-config.js';
28
+ export type {
29
+ ComponentBadge,
30
+ ComponentMetadata,
31
+ DeprecationInfo,
32
+ LLMConfig,
33
+ SectionOrder
34
+ } from './documentation.js';
35
+
36
+ // (documentation-core types not re-exported anymore)
37
+
38
+ // Example and pattern types
39
+ export type {
40
+ ComponentExample,
41
+ ExampleCollection,
42
+ ExampleGroup,
43
+ UsagePattern
44
+ } from './examples.js';
45
+ // Navigation types
46
+ export type {
47
+ Breadcrumb,
48
+ BreadcrumbItem,
49
+ BreadcrumbSettings,
50
+ NavigationBadge,
51
+ NavigationContext,
52
+ NavigationItem,
53
+ NavigationMetadata,
54
+ NavigationSearchResult,
55
+ NavigationState,
56
+ SearchMatch,
57
+ SiteNavigation,
58
+ TableOfContents,
59
+ TOCItem,
60
+ TOCSettings
61
+ } from './navigation.js';
62
+ // Playground types
63
+ export type {
64
+ CodeGenerator,
65
+ CodeGeneratorConfig,
66
+ ControlCondition,
67
+ ControlDefinition,
68
+ ControlOption,
69
+ ControlType,
70
+ ImportStatement,
71
+ PlaygroundConfig,
72
+ PlaygroundExample,
73
+ PlaygroundFeature,
74
+ PlaygroundMetadata
75
+ } from './playground.js';
76
+
77
+ // ==========================================
78
+ // BARREL EXPORTS
79
+ // ==========================================
80
+
81
+ export * from './component.js';
82
+ export * from './docs-config.js';
83
+ // Re-export everything for convenience (except documentation-core)
84
+ export * from './documentation.js';
85
+ export * from './examples.js';
86
+ export * from './navigation.js';
87
+ export * from './playground.js';
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Navigation item
3
+ */
4
+ export interface NavigationItem {
5
+ /** Unique identifier */
6
+ id: string;
7
+ /** Display label */
8
+ label: string;
9
+ /** Navigation href/link */
10
+ href?: string;
11
+ /** Child navigation items */
12
+ children?: NavigationItem[];
13
+ /** Navigation metadata */
14
+ metadata?: NavigationMetadata;
15
+ /** Navigation state */
16
+ state?: NavigationState;
17
+ }
18
+
19
+ /**
20
+ * Navigation metadata
21
+ */
22
+ export interface NavigationMetadata {
23
+ /** Item type */
24
+ type: 'section' | 'component' | 'group' | 'page' | 'external';
25
+ /** Navigation level/depth (migrated from level property) */
26
+ level?: number;
27
+ /** Display order */
28
+ order?: number;
29
+ /** Associated tags */
30
+ tags?: string[];
31
+ /** Icon identifier */
32
+ icon?: string;
33
+ /** Badge information */
34
+ badge?: NavigationBadge;
35
+ }
36
+
37
+ /**
38
+ * Navigation state
39
+ */
40
+ export interface NavigationState {
41
+ /** Item is active/current */
42
+ active?: boolean;
43
+ /** Item is expanded (has visible children) */
44
+ expanded?: boolean;
45
+ /** Item is disabled */
46
+ disabled?: boolean;
47
+ /** Item is hidden */
48
+ hidden?: boolean;
49
+ /** Loading state */
50
+ loading?: boolean;
51
+ }
52
+
53
+ /**
54
+ * Navigation badge
55
+ */
56
+ export interface NavigationBadge {
57
+ /** Badge text */
58
+ text: string;
59
+ /** Badge intent/color */
60
+ intent?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info';
61
+ /** Badge variant */
62
+ variant?: 'filled' | 'outlined' | 'soft';
63
+ }
64
+
65
+ /**
66
+ * Table of contents
67
+ */
68
+ export interface TableOfContents {
69
+ /** TOC items */
70
+ items: TOCItem[];
71
+ /** TOC settings */
72
+ settings: TOCSettings;
73
+ }
74
+
75
+ /**
76
+ * Table of contents item
77
+ */
78
+ export interface TOCItem {
79
+ /** Unique identifier */
80
+ id: string;
81
+ /** Item title */
82
+ title: string;
83
+ /** Heading level (1-6) */
84
+ level: number;
85
+ /** Anchor/fragment identifier */
86
+ anchor: string;
87
+ /** Child TOC items */
88
+ children?: TOCItem[];
89
+ /** Item section type */
90
+ sectionType?: 'overview' | 'examples' | 'api' | 'patterns' | 'custom';
91
+ }
92
+
93
+ /**
94
+ * TOC settings
95
+ */
96
+ export interface TOCSettings {
97
+ /** Maximum depth to show */
98
+ maxDepth: number;
99
+ /** Highlight active item */
100
+ highlightActive?: boolean;
101
+ /** Collapse behavior */
102
+ collapsible?: boolean;
103
+ }
104
+
105
+ /**
106
+ * Breadcrumb navigation
107
+ */
108
+ export interface Breadcrumb {
109
+ /** Breadcrumb items */
110
+ items: BreadcrumbItem[];
111
+ /** Breadcrumb settings */
112
+ settings?: BreadcrumbSettings;
113
+ }
114
+
115
+ /**
116
+ * Breadcrumb item
117
+ */
118
+ export interface BreadcrumbItem {
119
+ /** Item label */
120
+ label: string;
121
+ /** Item href */
122
+ href?: string;
123
+ /** Item is current page */
124
+ current?: boolean;
125
+ /** Item icon */
126
+ icon?: string;
127
+ }
128
+
129
+ /**
130
+ * Breadcrumb settings
131
+ */
132
+ export interface BreadcrumbSettings {
133
+ /** Maximum items to show */
134
+ maxItems?: number;
135
+ /** Show home link */
136
+ showHome?: boolean;
137
+ /** Separator character/element */
138
+ separator?: string;
139
+ /** Collapse behavior */
140
+ collapseThreshold?: number;
141
+ }
142
+
143
+ /**
144
+ * Site navigation structure
145
+ */
146
+ export interface SiteNavigation {
147
+ /** Main navigation items */
148
+ main: NavigationItem[];
149
+ /** Footer navigation items */
150
+ footer?: NavigationItem[];
151
+ /** Utility navigation (user menu, etc.) */
152
+ utility?: NavigationItem[];
153
+ /** Mobile navigation settings */
154
+ mobile?: {
155
+ breakpoint?: number;
156
+ hamburgerMenu?: boolean;
157
+ collapsible?: boolean;
158
+ };
159
+ }
160
+
161
+ /**
162
+ * Navigation context for current page
163
+ */
164
+ export interface NavigationContext {
165
+ /** Current page */
166
+ current: NavigationItem;
167
+ /** Parent page (if any) */
168
+ parent?: NavigationItem;
169
+ /** Previous page in sequence */
170
+ previous?: NavigationItem;
171
+ /** Next page in sequence */
172
+ next?: NavigationItem;
173
+ /** Breadcrumb trail */
174
+ breadcrumb: BreadcrumbItem[];
175
+ /** Related pages */
176
+ related?: NavigationItem[];
177
+ }
178
+
179
+ /**
180
+ * Navigation search result
181
+ */
182
+ export interface NavigationSearchResult {
183
+ /** Matched navigation item */
184
+ item: NavigationItem;
185
+ /** Match score (0-1) */
186
+ score: number;
187
+ /** Matched text fragments */
188
+ matches: SearchMatch[];
189
+ /** Result metadata */
190
+ metadata?: {
191
+ searchTime?: number;
192
+ resultType?: 'exact' | 'fuzzy' | 'partial';
193
+ };
194
+ }
195
+
196
+ /**
197
+ * Search match information
198
+ */
199
+ export interface SearchMatch {
200
+ /** Matched field */
201
+ field: 'label' | 'description' | 'content' | 'tags';
202
+ /** Matched text */
203
+ text: string;
204
+ /** Match indices */
205
+ indices: [number, number][];
206
+ }
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Playground configuration
3
+ */
4
+ export interface PlaygroundConfig {
5
+ /** Interactive controls */
6
+ controls: ControlDefinition[];
7
+ /** Code generator function */
8
+ codeGenerator?: CodeGenerator | CodeGeneratorConfig;
9
+ /** Default values for controls */
10
+ defaultValues?: Record<string, unknown>;
11
+ /** Playground examples/presets */
12
+ examples?: PlaygroundExample[];
13
+ /** Include in LLM output */
14
+ includeLLM?: boolean;
15
+ /** Playground metadata */
16
+ metadata?: PlaygroundMetadata;
17
+ }
18
+
19
+ /**
20
+ * Control definition for playground
21
+ */
22
+ export interface ControlDefinition {
23
+ /** Control identifier */
24
+ key: string;
25
+ /** Control label */
26
+ label: string;
27
+ /** Control type */
28
+ type: ControlType;
29
+ /** Control options (for select/dropdown) */
30
+ items?: ControlOption[];
31
+ /** Default value */
32
+ defaultValue?: unknown;
33
+ /** Minimum value (for number/range) */
34
+ min?: number;
35
+ /** Maximum value (for number/range) */
36
+ max?: number;
37
+ /** Step value (for number/range) */
38
+ step?: number;
39
+ /** Placeholder text (for text inputs) */
40
+ placeholder?: string;
41
+ /** Control description */
42
+ description?: string;
43
+ /** Control group/category */
44
+ group?: string;
45
+ /** Control visibility condition */
46
+ condition?: ControlCondition;
47
+ }
48
+
49
+ /**
50
+ * Control types
51
+ */
52
+ export type ControlType =
53
+ | 'dropdown'
54
+ | 'select'
55
+ | 'checkbox'
56
+ | 'boolean'
57
+ | 'text'
58
+ | 'textarea'
59
+ | 'number'
60
+ | 'range'
61
+ | 'slider'
62
+ | 'color'
63
+ | 'radio'
64
+ | 'multi-select'
65
+ | 'json'
66
+ | 'code';
67
+
68
+ /**
69
+ * Control option for select/dropdown controls
70
+ */
71
+ export interface ControlOption {
72
+ /** Option label */
73
+ label: string;
74
+ /** Option value */
75
+ value: unknown;
76
+ /** Option description */
77
+ description?: string;
78
+ /** Option group */
79
+ group?: string;
80
+ /** Option disabled state */
81
+ disabled?: boolean;
82
+ }
83
+
84
+ /**
85
+ * Control visibility condition
86
+ */
87
+ export interface ControlCondition {
88
+ /** Dependent control key. Optional when a custom `condition` function is provided. */
89
+ dependsOn?: string;
90
+ /** Expected value(s) */
91
+ equals?: unknown;
92
+ /** Value array (for 'in' condition) */
93
+ in?: unknown[];
94
+ /** Custom condition function */
95
+ condition?: (values: Record<string, unknown>) => boolean;
96
+ }
97
+
98
+ /**
99
+ * Code generator function type
100
+ */
101
+ export type CodeGenerator = (values: Record<string, unknown>) => string;
102
+
103
+ /**
104
+ * Code generator configuration
105
+ */
106
+ export interface CodeGeneratorConfig {
107
+ /** Template string or function */
108
+ template: string | CodeGenerator;
109
+ /** Template variables */
110
+ variables?: Record<string, unknown>;
111
+ /** Import statements */
112
+ imports?: ImportStatement[];
113
+ /** Code formatting options */
114
+ formatting?: {
115
+ language?: 'typescript' | 'javascript' | 'svelte' | 'react';
116
+ prettier?: boolean;
117
+ indentation?: number;
118
+ };
119
+ }
120
+
121
+ /**
122
+ * Import statement for generated code
123
+ */
124
+ export interface ImportStatement {
125
+ /** What to import */
126
+ imports: string | string[] | Record<string, string>;
127
+ /** From which module */
128
+ from: string;
129
+ /** Import type (default, named, namespace) */
130
+ type?: 'default' | 'named' | 'namespace';
131
+ }
132
+
133
+ /**
134
+ * Playground example/preset
135
+ */
136
+ export interface PlaygroundExample {
137
+ /** Example title */
138
+ title: string;
139
+ /** Example description */
140
+ description?: string;
141
+ /** Control values for this example */
142
+ values: Record<string, unknown>;
143
+ /** Example category */
144
+ category?: 'basic' | 'advanced' | 'showcase' | 'use-case';
145
+ /** Example tags */
146
+ tags?: string[];
147
+ }
148
+
149
+ /**
150
+ * Playground metadata
151
+ */
152
+ export interface PlaygroundMetadata {
153
+ /** Playground version */
154
+ version?: string;
155
+ /** Last updated */
156
+ lastUpdated?: string;
157
+ /** Playground features */
158
+ features?: PlaygroundFeature[];
159
+ /** Performance settings */
160
+ performance?: {
161
+ debounceMs?: number;
162
+ lazyLoad?: boolean;
163
+ cacheResults?: boolean;
164
+ };
165
+ /** Accessibility settings */
166
+ accessibility?: {
167
+ announceChanges?: boolean;
168
+ keyboardNavigation?: boolean;
169
+ focusManagement?: boolean;
170
+ };
171
+ }
172
+
173
+ /**
174
+ * Playground features
175
+ */
176
+ export type PlaygroundFeature =
177
+ | 'live-preview'
178
+ | 'code-generation'
179
+ | 'export-code'
180
+ | 'share-link'
181
+ | 'responsive-preview'
182
+ | 'dark-mode'
183
+ | 'accessibility-checker'
184
+ | 'performance-monitor';