@aspect-ops/exon-ui 0.3.0 → 0.4.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.
Files changed (37) hide show
  1. package/README.md +0 -45
  2. package/dist/components/BottomNav/BottomNavItem.svelte +4 -3
  3. package/dist/components/BottomNav/BottomNavItem.svelte.d.ts +2 -1
  4. package/dist/components/DoughnutChart/DoughnutChart.svelte +4 -4
  5. package/dist/components/FlexibleGrid/FlexibleGrid.svelte +118 -0
  6. package/dist/components/FlexibleGrid/FlexibleGrid.svelte.d.ts +7 -0
  7. package/dist/components/FlexibleGrid/README.md +212 -0
  8. package/dist/components/FlexibleGrid/index.d.ts +2 -0
  9. package/dist/components/FlexibleGrid/index.js +1 -0
  10. package/dist/components/GlobalHeader/GlobalHeader.svelte +201 -87
  11. package/dist/components/HeroLeftAligned/HeroLeftAligned.svelte +182 -0
  12. package/dist/components/HeroLeftAligned/HeroLeftAligned.svelte.d.ts +8 -0
  13. package/dist/components/HeroLeftAligned/README.md +168 -0
  14. package/dist/components/HeroLeftAligned/index.d.ts +2 -0
  15. package/dist/components/HeroLeftAligned/index.js +1 -0
  16. package/dist/components/IconFeatureCard/IconFeatureCard.svelte +173 -0
  17. package/dist/components/IconFeatureCard/IconFeatureCard.svelte.d.ts +4 -0
  18. package/dist/components/IconFeatureCard/README.md +234 -0
  19. package/dist/components/IconFeatureCard/index.d.ts +2 -0
  20. package/dist/components/IconFeatureCard/index.js +1 -0
  21. package/dist/components/ImageTextCard/ImageTextCard.svelte +149 -0
  22. package/dist/components/ImageTextCard/ImageTextCard.svelte.d.ts +22 -0
  23. package/dist/components/ImageTextCard/README.md +177 -0
  24. package/dist/components/ImageTextCard/index.d.ts +2 -0
  25. package/dist/components/ImageTextCard/index.js +1 -0
  26. package/dist/components/Sidebar/SidebarGroup.svelte +1 -4
  27. package/dist/index.d.ts +7 -1
  28. package/dist/index.js +4 -1
  29. package/dist/types/index.d.ts +49 -1
  30. package/dist/types/layout.d.ts +20 -0
  31. package/dist/types/navigation.d.ts +2 -1
  32. package/package.json +9 -2
  33. package/dist/components/Mermaid/Mermaid.svelte +0 -320
  34. package/dist/components/Mermaid/Mermaid.svelte.d.ts +0 -38
  35. package/dist/components/Mermaid/index.d.ts +0 -1
  36. package/dist/components/Mermaid/index.js +0 -1
  37. package/dist/components/Mermaid/mermaid.d.ts +0 -21
@@ -1,320 +0,0 @@
1
- <script lang="ts">
2
- import { onMount } from 'svelte';
3
- import type { Snippet } from 'svelte';
4
-
5
- interface ThemeVariables {
6
- primaryColor?: string;
7
- primaryTextColor?: string;
8
- primaryBorderColor?: string;
9
- lineColor?: string;
10
- secondaryColor?: string;
11
- tertiaryColor?: string;
12
- background?: string;
13
- mainBkg?: string;
14
- nodeBorder?: string;
15
- clusterBkg?: string;
16
- titleColor?: string;
17
- edgeLabelBackground?: string;
18
- textColor?: string;
19
- // Sequence diagram specific
20
- actorLineColor?: string;
21
- signalColor?: string;
22
- signalTextColor?: string;
23
- labelTextColor?: string;
24
- actorTextColor?: string;
25
- messageTextColor?: string;
26
- loopTextColor?: string;
27
- activationBorderColor?: string;
28
- sequenceNumberColor?: string;
29
- }
30
-
31
- interface Props {
32
- /** Mermaid diagram code. If not provided, uses slot content */
33
- code?: string;
34
- /** Custom theme variables */
35
- theme?: ThemeVariables;
36
- /** Custom class */
37
- class?: string;
38
- /** Slot content for diagram code */
39
- children?: Snippet;
40
- }
41
-
42
- // Light theme colors
43
- const lightTheme: ThemeVariables = {
44
- primaryColor: '#4654A3',
45
- primaryTextColor: '#ffffff',
46
- primaryBorderColor: '#4654A3',
47
- lineColor: '#4b5563',
48
- secondaryColor: '#FF3131',
49
- tertiaryColor: '#f3f4f6',
50
- textColor: '#000000',
51
- // Sequence diagram - dark colors for light backgrounds
52
- actorLineColor: '#4b5563',
53
- signalColor: '#374151',
54
- signalTextColor: '#000000',
55
- labelTextColor: '#000000',
56
- actorTextColor: '#ffffff',
57
- messageTextColor: '#000000',
58
- loopTextColor: '#000000',
59
- activationBorderColor: '#4b5563',
60
- sequenceNumberColor: '#ffffff'
61
- };
62
-
63
- // Dark theme colors
64
- const darkTheme: ThemeVariables = {
65
- primaryColor: '#4654A3',
66
- primaryTextColor: '#ffffff',
67
- primaryBorderColor: '#4654A3',
68
- lineColor: '#9ca3af',
69
- secondaryColor: '#FF3131',
70
- tertiaryColor: '#1f2937',
71
- textColor: '#7dd3fc',
72
- // Sequence diagram - sky blue colors for dark backgrounds
73
- actorLineColor: '#38bdf8',
74
- signalColor: '#38bdf8',
75
- signalTextColor: '#7dd3fc',
76
- labelTextColor: '#7dd3fc',
77
- actorTextColor: '#ffffff',
78
- messageTextColor: '#7dd3fc',
79
- loopTextColor: '#7dd3fc',
80
- activationBorderColor: '#38bdf8',
81
- sequenceNumberColor: '#ffffff'
82
- };
83
-
84
- // Detect theme
85
- function getThemeColors(): ThemeVariables {
86
- if (typeof window === 'undefined') return lightTheme;
87
-
88
- const isDark =
89
- document.documentElement.classList.contains('dark') ||
90
- document.body.classList.contains('dark') ||
91
- window.matchMedia('(prefers-color-scheme: dark)').matches;
92
-
93
- return isDark ? darkTheme : lightTheme;
94
- }
95
-
96
- let { code, theme, class: className = '', children }: Props = $props();
97
-
98
- let containerRef: HTMLDivElement | undefined = $state();
99
- let slotRef: HTMLDivElement | undefined = $state();
100
- let isLoading = $state(true);
101
- let hasError = $state(false);
102
- let errorMessage = $state('');
103
- let renderedSvg = $state('');
104
-
105
- // Get diagram code from prop or slot
106
- function getDiagramCode(): string {
107
- if (code) return code;
108
- if (slotRef) {
109
- return slotRef.textContent?.trim() || '';
110
- }
111
- return '';
112
- }
113
-
114
- onMount(async () => {
115
- try {
116
- // Dynamically import mermaid (type assertion for dynamic import)
117
- const mermaidModule = await import('mermaid');
118
- const mermaid = mermaidModule.default;
119
-
120
- // Detect theme and merge with custom theme
121
- const detectedTheme = getThemeColors();
122
- const mergedTheme = { ...detectedTheme, ...theme };
123
-
124
- // Initialize mermaid with theme
125
- mermaid.initialize({
126
- startOnLoad: false,
127
- theme: 'base',
128
- themeVariables: mergedTheme,
129
- securityLevel: 'loose',
130
- fontFamily: 'inherit'
131
- });
132
-
133
- const diagramCode = getDiagramCode();
134
- if (!diagramCode) {
135
- hasError = true;
136
- errorMessage = 'No diagram code provided';
137
- isLoading = false;
138
- return;
139
- }
140
-
141
- // Generate unique ID
142
- const id = `mermaid-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
143
-
144
- // Render the diagram
145
- const { svg } = await mermaid.render(id, diagramCode);
146
- renderedSvg = svg;
147
- } catch (error) {
148
- hasError = true;
149
- errorMessage = error instanceof Error ? error.message : 'Failed to render diagram';
150
- } finally {
151
- isLoading = false;
152
- }
153
- });
154
- </script>
155
-
156
- <div class="mermaid-container {className}" bind:this={containerRef}>
157
- <!-- Hidden slot for extracting diagram code -->
158
- <div bind:this={slotRef} style="display: none;">
159
- {#if children}
160
- {@render children()}
161
- {/if}
162
- </div>
163
-
164
- {#if isLoading}
165
- <div class="mermaid-loading">
166
- <div class="mermaid-spinner"></div>
167
- <span>Rendering diagram...</span>
168
- </div>
169
- {:else if hasError}
170
- <div class="mermaid-error" role="alert">
171
- <svg
172
- xmlns="http://www.w3.org/2000/svg"
173
- width="24"
174
- height="24"
175
- viewBox="0 0 24 24"
176
- fill="none"
177
- stroke="currentColor"
178
- stroke-width="2"
179
- >
180
- <circle cx="12" cy="12" r="10" />
181
- <line x1="12" y1="8" x2="12" y2="12" />
182
- <line x1="12" y1="16" x2="12.01" y2="16" />
183
- </svg>
184
- <div>
185
- <strong>Failed to render diagram</strong>
186
- <p>{errorMessage}</p>
187
- </div>
188
- </div>
189
- {:else}
190
- <!-- eslint-disable-next-line svelte/no-at-html-tags -->
191
- <div class="mermaid-diagram">{@html renderedSvg}</div>
192
- {/if}
193
- </div>
194
-
195
- <style>
196
- .mermaid-container {
197
- width: 100%;
198
- font-family: inherit;
199
- }
200
-
201
- /* Loading */
202
- .mermaid-loading {
203
- display: flex;
204
- flex-direction: column;
205
- align-items: center;
206
- justify-content: center;
207
- gap: var(--space-md, 1rem);
208
- padding: var(--space-xl, 2rem);
209
- color: var(--color-text-muted, #6b7280);
210
- font-size: var(--text-sm, 0.875rem);
211
- }
212
-
213
- .mermaid-spinner {
214
- width: 2rem;
215
- height: 2rem;
216
- border: 3px solid var(--color-border, #e5e7eb);
217
- border-top-color: var(--color-primary, #3b82f6);
218
- border-radius: var(--radius-full, 9999px);
219
- animation: spin 0.75s linear infinite;
220
- }
221
-
222
- @keyframes spin {
223
- to {
224
- transform: rotate(360deg);
225
- }
226
- }
227
-
228
- /* Error */
229
- .mermaid-error {
230
- display: flex;
231
- align-items: flex-start;
232
- gap: var(--space-md, 1rem);
233
- padding: var(--space-md, 1rem);
234
- background: var(--color-error-bg, #fee2e2);
235
- color: var(--color-error, #dc2626);
236
- border-radius: var(--radius-md, 0.375rem);
237
- font-size: var(--text-sm, 0.875rem);
238
- }
239
-
240
- .mermaid-error svg {
241
- flex-shrink: 0;
242
- margin-top: 2px;
243
- }
244
-
245
- .mermaid-error strong {
246
- display: block;
247
- font-weight: var(--font-semibold, 600);
248
- }
249
-
250
- .mermaid-error p {
251
- margin: var(--space-xs, 0.25rem) 0 0;
252
- opacity: 0.9;
253
- }
254
-
255
- /* Diagram */
256
- .mermaid-diagram {
257
- width: 100%;
258
- overflow-x: auto;
259
- }
260
-
261
- .mermaid-diagram :global(svg) {
262
- max-width: 100%;
263
- height: auto;
264
- }
265
-
266
- /* Force text colors in dark mode for all diagrams (flowchart + sequence) */
267
- :global(.dark) .mermaid-diagram :global(svg text),
268
- :global(.dark) .mermaid-diagram :global(svg .messageText),
269
- :global(body.dark) .mermaid-diagram :global(svg text),
270
- :global(body.dark) .mermaid-diagram :global(svg .messageText),
271
- :global(html.dark) .mermaid-diagram :global(svg text),
272
- :global(html.dark) .mermaid-diagram :global(svg .messageText) {
273
- fill: #7dd3fc !important;
274
- }
275
-
276
- /* Force line colors in dark mode for all diagrams */
277
- :global(.dark) .mermaid-diagram :global(svg .messageLine0),
278
- :global(.dark) .mermaid-diagram :global(svg .messageLine1),
279
- :global(.dark) .mermaid-diagram :global(svg line),
280
- :global(.dark) .mermaid-diagram :global(svg path),
281
- :global(.dark) .mermaid-diagram :global(svg .edgePath path),
282
- :global(.dark) .mermaid-diagram :global(svg .flowchart-link),
283
- :global(body.dark) .mermaid-diagram :global(svg .messageLine0),
284
- :global(body.dark) .mermaid-diagram :global(svg .messageLine1),
285
- :global(body.dark) .mermaid-diagram :global(svg line),
286
- :global(body.dark) .mermaid-diagram :global(svg path),
287
- :global(body.dark) .mermaid-diagram :global(svg .edgePath path),
288
- :global(body.dark) .mermaid-diagram :global(svg .flowchart-link),
289
- :global(html.dark) .mermaid-diagram :global(svg .messageLine0),
290
- :global(html.dark) .mermaid-diagram :global(svg .messageLine1),
291
- :global(html.dark) .mermaid-diagram :global(svg line),
292
- :global(html.dark) .mermaid-diagram :global(svg path),
293
- :global(html.dark) .mermaid-diagram :global(svg .edgePath path),
294
- :global(html.dark) .mermaid-diagram :global(svg .flowchart-link) {
295
- stroke: #38bdf8 !important;
296
- }
297
-
298
- /* Flowchart edge labels */
299
- :global(.dark) .mermaid-diagram :global(svg .edgeLabel),
300
- :global(body.dark) .mermaid-diagram :global(svg .edgeLabel),
301
- :global(html.dark) .mermaid-diagram :global(svg .edgeLabel) {
302
- color: #7dd3fc !important;
303
- }
304
-
305
- :global(.dark) .mermaid-diagram :global(svg .edgeLabel text),
306
- :global(body.dark) .mermaid-diagram :global(svg .edgeLabel text),
307
- :global(html.dark) .mermaid-diagram :global(svg .edgeLabel text) {
308
- fill: #7dd3fc !important;
309
- }
310
-
311
- /* Keep actor text and node text white for readability */
312
- :global(.dark) .mermaid-diagram :global(svg .actor text),
313
- :global(.dark) .mermaid-diagram :global(svg .node text),
314
- :global(body.dark) .mermaid-diagram :global(svg .actor text),
315
- :global(body.dark) .mermaid-diagram :global(svg .node text),
316
- :global(html.dark) .mermaid-diagram :global(svg .actor text),
317
- :global(html.dark) .mermaid-diagram :global(svg .node text) {
318
- fill: #ffffff !important;
319
- }
320
- </style>
@@ -1,38 +0,0 @@
1
- import type { Snippet } from 'svelte';
2
- interface ThemeVariables {
3
- primaryColor?: string;
4
- primaryTextColor?: string;
5
- primaryBorderColor?: string;
6
- lineColor?: string;
7
- secondaryColor?: string;
8
- tertiaryColor?: string;
9
- background?: string;
10
- mainBkg?: string;
11
- nodeBorder?: string;
12
- clusterBkg?: string;
13
- titleColor?: string;
14
- edgeLabelBackground?: string;
15
- textColor?: string;
16
- actorLineColor?: string;
17
- signalColor?: string;
18
- signalTextColor?: string;
19
- labelTextColor?: string;
20
- actorTextColor?: string;
21
- messageTextColor?: string;
22
- loopTextColor?: string;
23
- activationBorderColor?: string;
24
- sequenceNumberColor?: string;
25
- }
26
- interface Props {
27
- /** Mermaid diagram code. If not provided, uses slot content */
28
- code?: string;
29
- /** Custom theme variables */
30
- theme?: ThemeVariables;
31
- /** Custom class */
32
- class?: string;
33
- /** Slot content for diagram code */
34
- children?: Snippet;
35
- }
36
- declare const Mermaid: import("svelte").Component<Props, {}, "">;
37
- type Mermaid = ReturnType<typeof Mermaid>;
38
- export default Mermaid;
@@ -1 +0,0 @@
1
- export { default as Mermaid } from './Mermaid.svelte';
@@ -1 +0,0 @@
1
- export { default as Mermaid } from './Mermaid.svelte';
@@ -1,21 +0,0 @@
1
- // Type declarations for mermaid
2
- declare module 'mermaid' {
3
- interface MermaidConfig {
4
- startOnLoad?: boolean;
5
- theme?: string;
6
- themeVariables?: Record<string, string | undefined>;
7
- securityLevel?: string;
8
- fontFamily?: string;
9
- }
10
-
11
- interface RenderResult {
12
- svg: string;
13
- }
14
-
15
- const mermaid: {
16
- initialize: (config: MermaidConfig) => void;
17
- render: (id: string, code: string) => Promise<RenderResult>;
18
- };
19
-
20
- export default mermaid;
21
- }