specra 0.2.1 → 0.2.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.
@@ -9,7 +9,7 @@
9
9
  let { title, children }: Props = $props();
10
10
  </script>
11
11
 
12
- <div class="step-item relative pl-8 pb-6 border-l-2 border-border last:border-l-0 last:pb-0">
12
+ <div class="step-item relative pl-8 pb-8 border-l-2 border-border last:border-l-0 last:pb-0">
13
13
  <div class="mb-2">
14
14
  <h3 class="text-lg font-semibold text-foreground">{title}</h3>
15
15
  </div>
@@ -27,7 +27,8 @@
27
27
  .step-item::before {
28
28
  content: counter(step);
29
29
  position: absolute;
30
- left: 0;
30
+ top: 0;
31
+ left: -1px;
31
32
  transform: translateX(-50%);
32
33
  width: 2rem;
33
34
  height: 2rem;
@@ -38,7 +39,7 @@
38
39
  font-size: 0.875rem;
39
40
  font-weight: 600;
40
41
  z-index: 10;
41
- background: hsl(var(--primary));
42
- color: hsl(var(--primary-foreground));
42
+ background: var(--primary);
43
+ color: var(--primary-foreground);
43
44
  }
44
45
  </style>
@@ -8,7 +8,7 @@
8
8
  let { children }: Props = $props();
9
9
  </script>
10
10
 
11
- <div class="my-6 ml-4 space-y-6" style="counter-reset: step;">
11
+ <div class="my-6 ml-4" style="counter-reset: step;">
12
12
  {#if children}
13
13
  {@render children()}
14
14
  {/if}
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ children?: Snippet;
6
+ }
7
+
8
+ let { children }: Props = $props();
9
+ </script>
10
+
11
+ <div class="my-6 ml-4" style="counter-reset: timeline-step;">
12
+ {#if children}
13
+ {@render children()}
14
+ {/if}
15
+ </div>
@@ -0,0 +1,7 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ children?: Snippet;
4
+ }
5
+ declare const Timeline: import("svelte").Component<Props, {}, "">;
6
+ type Timeline = ReturnType<typeof Timeline>;
7
+ export default Timeline;
@@ -0,0 +1,50 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ title: string;
6
+ date?: string;
7
+ icon?: string;
8
+ children?: Snippet;
9
+ }
10
+
11
+ let { title, date, icon, children }: Props = $props();
12
+ </script>
13
+
14
+ <div class="timeline-item relative pl-8 pb-8 border-l-2 border-border last:border-l-0 last:pb-0">
15
+ <div class="mb-2">
16
+ <h3 class="text-lg font-semibold text-foreground">{title}</h3>
17
+ {#if date}
18
+ <span class="text-sm text-muted-foreground">{date}</span>
19
+ {/if}
20
+ </div>
21
+ <div class="prose prose-sm dark:prose-invert max-w-none [&>*:last-child]:mb-0">
22
+ {#if children}
23
+ {@render children()}
24
+ {/if}
25
+ </div>
26
+ </div>
27
+
28
+ <style>
29
+ .timeline-item {
30
+ counter-increment: timeline-step;
31
+ }
32
+ .timeline-item::before {
33
+ content: counter(timeline-step);
34
+ position: absolute;
35
+ top: 0;
36
+ left: -1px;
37
+ transform: translateX(-50%);
38
+ width: 2rem;
39
+ height: 2rem;
40
+ border-radius: 9999px;
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ font-size: 0.875rem;
45
+ font-weight: 600;
46
+ z-index: 10;
47
+ background: var(--primary);
48
+ color: var(--primary-foreground);
49
+ }
50
+ </style>
@@ -0,0 +1,10 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ title: string;
4
+ date?: string;
5
+ icon?: string;
6
+ children?: Snippet;
7
+ }
8
+ declare const TimelineItem: import("svelte").Component<Props, {}, "">;
9
+ type TimelineItem = ReturnType<typeof TimelineItem>;
10
+ export default TimelineItem;
@@ -24,6 +24,8 @@ export const COMPONENT_TEXT_PROPS = {
24
24
  CodeBlock: ["filename"],
25
25
  // Step components
26
26
  Step: ["title"],
27
+ // Timeline components
28
+ TimelineItem: ["title", "date"],
27
29
  };
28
30
  export function extractComponentPropsText(mdx) {
29
31
  return mdx.replace(/<([A-Z][\w]*)\b([^/>]*)\/>/g, (_, component, props) => {
@@ -46,6 +46,8 @@ export { default as Steps } from './Steps.svelte';
46
46
  export { default as Tab } from './Tab.svelte';
47
47
  export { default as TabGroups } from './TabGroups.svelte';
48
48
  export { default as TableOfContents } from './TableOfContents.svelte';
49
+ export { default as Timeline } from './Timeline.svelte';
50
+ export { default as TimelineItem } from './TimelineItem.svelte';
49
51
  export { default as Tabs } from './Tabs.svelte';
50
52
  export { default as ThemeToggle } from './ThemeToggle.svelte';
51
53
  export { default as Tooltip } from './Tooltip.svelte';
@@ -47,6 +47,8 @@ export { default as Steps } from './Steps.svelte';
47
47
  export { default as Tab } from './Tab.svelte';
48
48
  export { default as TabGroups } from './TabGroups.svelte';
49
49
  export { default as TableOfContents } from './TableOfContents.svelte';
50
+ export { default as Timeline } from './Timeline.svelte';
51
+ export { default as TimelineItem } from './TimelineItem.svelte';
50
52
  export { default as Tabs } from './Tabs.svelte';
51
53
  export { default as ThemeToggle } from './ThemeToggle.svelte';
52
54
  export { default as Tooltip } from './Tooltip.svelte';
@@ -13,9 +13,9 @@
13
13
  * <Callout type="info">This is a callout</Callout>
14
14
  * ```
15
15
  */
16
- import { Callout, Accordion, AccordionItem, Tabs, Tab, Image, Video, Card, CardGrid, ImageCard, ImageCardGrid, Steps, Step, Icon, Mermaid, Math, Columns, Column, DocBadge, Tooltip, Frame, CodeBlock, ApiEndpoint, ApiParams, ApiResponse, ApiPlayground, ApiReference, } from './components/docs';
16
+ import { Callout, Accordion, AccordionItem, Tabs, Tab, Image, Video, Card, CardGrid, ImageCard, ImageCardGrid, Steps, Step, Icon, Mermaid, Math, Columns, Column, DocBadge, Tooltip, Frame, CodeBlock, Timeline, TimelineItem, ApiEndpoint, ApiParams, ApiResponse, ApiPlayground, ApiReference, } from './components/docs';
17
17
  // Re-export all MDX-usable components
18
- export { Callout, Accordion, AccordionItem, Tabs, Tab, Image, Video, Card, CardGrid, ImageCard, ImageCardGrid, Steps, Step, Icon, Mermaid, Math, Columns, Column, DocBadge, Tooltip, Frame, CodeBlock, ApiEndpoint, ApiParams, ApiResponse, ApiPlayground, ApiReference, };
18
+ export { Callout, Accordion, AccordionItem, Tabs, Tab, Image, Video, Card, CardGrid, ImageCard, ImageCardGrid, Steps, Step, Icon, Mermaid, Math, Columns, Column, DocBadge, Tooltip, Frame, CodeBlock, Timeline, TimelineItem, ApiEndpoint, ApiParams, ApiResponse, ApiPlayground, ApiReference, };
19
19
  /**
20
20
  * Component map for passing to layout components that render MDX content.
21
21
  */
@@ -43,6 +43,8 @@ export const mdxComponents = {
43
43
  Tooltip,
44
44
  Frame,
45
45
  CodeBlock,
46
+ Timeline,
47
+ TimelineItem,
46
48
  ApiEndpoint,
47
49
  ApiParams,
48
50
  ApiResponse,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specra",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "A modern documentation library for SvelteKit with built-in versioning, API reference generation, full-text search, and MDX support",
5
5
  "svelte": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",