dssoca 0.5.0 → 0.9.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.
Files changed (56) hide show
  1. package/README.md +39 -13
  2. package/dist/components/Accordion.svelte +297 -0
  3. package/dist/components/Accordion.svelte.d.ts +51 -0
  4. package/dist/components/Badge.svelte +113 -18
  5. package/dist/components/Badge.svelte.d.ts +28 -2
  6. package/dist/components/BottomNav.svelte +254 -0
  7. package/dist/components/BottomNav.svelte.d.ts +32 -0
  8. package/dist/components/Button.svelte +147 -10
  9. package/dist/components/Button.svelte.d.ts +21 -4
  10. package/dist/components/Card.svelte +173 -8
  11. package/dist/components/Card.svelte.d.ts +16 -1
  12. package/dist/components/Container.svelte +55 -0
  13. package/dist/components/Container.svelte.d.ts +16 -0
  14. package/dist/components/EmptyState.svelte +91 -9
  15. package/dist/components/EmptyState.svelte.d.ts +20 -3
  16. package/dist/components/Heading.svelte +83 -0
  17. package/dist/components/Heading.svelte.d.ts +17 -0
  18. package/dist/components/Icon.svelte +199 -24
  19. package/dist/components/Icon.svelte.d.ts +70 -2
  20. package/dist/components/Image.svelte +428 -0
  21. package/dist/components/Image.svelte.d.ts +49 -0
  22. package/dist/components/Input.svelte +173 -39
  23. package/dist/components/Input.svelte.d.ts +22 -0
  24. package/dist/components/Link.svelte +183 -0
  25. package/dist/components/Link.svelte.d.ts +29 -0
  26. package/dist/components/LogStream.svelte +403 -47
  27. package/dist/components/LogStream.svelte.d.ts +35 -7
  28. package/dist/components/Menu.svelte +408 -0
  29. package/dist/components/Menu.svelte.d.ts +66 -0
  30. package/dist/components/MetricTile.svelte +124 -12
  31. package/dist/components/MetricTile.svelte.d.ts +20 -0
  32. package/dist/components/SegmentedControl.svelte +220 -0
  33. package/dist/components/SegmentedControl.svelte.d.ts +37 -0
  34. package/dist/components/ServiceCard.svelte +226 -30
  35. package/dist/components/ServiceCard.svelte.d.ts +13 -1
  36. package/dist/components/Sidebar.svelte +377 -40
  37. package/dist/components/Sidebar.svelte.d.ts +18 -7
  38. package/dist/components/Sparkline.svelte +198 -13
  39. package/dist/components/Sparkline.svelte.d.ts +20 -1
  40. package/dist/components/Spinner.svelte +124 -0
  41. package/dist/components/Spinner.svelte.d.ts +74 -0
  42. package/dist/components/Textarea.svelte +214 -0
  43. package/dist/components/Textarea.svelte.d.ts +38 -0
  44. package/dist/components/Toaster.svelte +209 -12
  45. package/dist/components/Toaster.svelte.d.ts +3 -0
  46. package/dist/components/Topbar.svelte +293 -42
  47. package/dist/components/Topbar.svelte.d.ts +48 -1
  48. package/dist/dssoca.config.d.ts +1 -1
  49. package/dist/dssoca.config.js +10 -0
  50. package/dist/index.d.ts +16 -3
  51. package/dist/index.js +18 -2
  52. package/dist/theme.css +406 -24
  53. package/dist/toast.svelte.d.ts +49 -5
  54. package/dist/toast.svelte.js +165 -9
  55. package/dist/tokens.css +597 -0
  56. package/package.json +25 -4
@@ -3,23 +3,87 @@
3
3
  import { resolveComponentSize, type Size } from '../config.js'
4
4
 
5
5
  interface Props {
6
- title?: string
6
+ /** Heading text, or a Snippet for inline icons/badges in the title. */
7
+ title?: string | Snippet
8
+ /** Secondary label rendered to the right of the title. */
7
9
  meta?: string
10
+ /** Muted description rendered under the heading. */
11
+ description?: string
12
+ /** Header controls (buttons, menus) rendered to the right. */
8
13
  action?: Snippet
14
+ /** Full-bleed visual rendered above the head (zero side padding). */
15
+ media?: Snippet
16
+ /** Footer band mirroring the head, rendered only when provided. */
17
+ footer?: Snippet
9
18
  children: Snippet
19
+ /** Makes the whole card a primary link to this href. */
20
+ href?: string
21
+ /** Makes the whole card clickable; pairs with keyboard activation. */
22
+ onclick?: (e: MouseEvent | KeyboardEvent) => void
23
+ /** Surface style: outlined (default) or elevated (shadow tokens). */
24
+ variant?: 'outlined' | 'elevated'
10
25
  /** Token size (sm|md|lg); inherits the global size when unset. */
11
26
  size?: Size
12
27
  /** Heading level for the title (aria-level), for correct document outline. */
13
28
  titleLevel?: number
14
29
  }
15
- let { title, meta, action, children, size, titleLevel = 3 }: Props = $props()
30
+ let {
31
+ title,
32
+ meta,
33
+ description,
34
+ action,
35
+ media,
36
+ footer,
37
+ children,
38
+ href,
39
+ onclick,
40
+ variant = 'outlined',
41
+ size,
42
+ titleLevel = 3,
43
+ }: Props = $props()
44
+
45
+ // A stable id so the region can be labelled by its title for assistive tech.
46
+ const titleId = $props.id()
47
+
48
+ const isTitleSnippet = $derived(typeof title === 'function')
49
+ const interactive = $derived(Boolean(href || onclick))
50
+
51
+ function onKeydown(e: KeyboardEvent) {
52
+ if (onclick && !href && (e.key === 'Enter' || e.key === ' ')) {
53
+ e.preventDefault()
54
+ onclick(e)
55
+ }
56
+ }
16
57
  </script>
17
58
 
18
- <div class="ss-panel" data-size-variant={resolveComponentSize('Card', size)}>
19
- {#if title}
59
+ <!-- svelte-ignore a11y_no_noninteractive_tabindex -- role is set to "button" in the same condition -->
60
+ <div
61
+ class="ss-card"
62
+ class:elevated={variant === 'elevated'}
63
+ class:interactive
64
+ data-size-variant={resolveComponentSize('Card', size)}
65
+ role={interactive && !href ? 'button' : undefined}
66
+ tabindex={interactive && !href ? 0 : undefined}
67
+ aria-labelledby={title ? titleId : undefined}
68
+ onclick={!href ? onclick : undefined}
69
+ onkeydown={!href ? onKeydown : undefined}
70
+ >
71
+ {#if media}
72
+ <div class="media">{@render media()}</div>
73
+ {/if}
74
+ {#if title || meta || description || action}
20
75
  <div class="head">
21
- <div class="title" role="heading" aria-level={titleLevel}>{title}</div>
22
- <div style="display:flex;gap:12px;align-items:center">
76
+ <div class="heading">
77
+ <div class="title" id={titleId} role="heading" aria-level={titleLevel}>
78
+ {#if isTitleSnippet}
79
+ {@render (title as Snippet)()}
80
+ {:else}
81
+ {title}
82
+ {/if}
83
+ </div>
84
+ {#if description}<div class="desc">{description}</div>{/if}
85
+ </div>
86
+ <div class="actions">
23
87
  {#if meta}<div class="meta">{meta}</div>{/if}
24
88
  {#if action}{@render action()}{/if}
25
89
  </div>
@@ -28,35 +92,136 @@
28
92
  <div class="body">
29
93
  {@render children()}
30
94
  </div>
95
+ {#if footer}
96
+ <div class="foot">{@render footer()}</div>
97
+ {/if}
98
+ {#if href}
99
+ <a
100
+ class="overlay"
101
+ {href}
102
+ {onclick}
103
+ onkeydown={onKeydown}
104
+ aria-labelledby={title ? titleId : undefined}
105
+ >
106
+ <span class="sr-only">{typeof title === 'string' ? title : 'Open'}</span>
107
+ </a>
108
+ {/if}
31
109
  </div>
32
110
 
33
- <style>.ss-panel {
111
+ <style>.ss-card {
112
+ position: relative;
34
113
  border: 1px solid var(--ss-line);
35
114
  background: var(--ss-bg-elev);
115
+ border-radius: 0;
116
+ }
117
+ .ss-card.elevated {
118
+ border-color: transparent;
119
+ box-shadow: var(--ss-shadow-1);
120
+ }
121
+ .ss-card.interactive {
122
+ cursor: pointer;
123
+ transition: box-shadow var(--ss-dur-fast) var(--ss-ease), border-color var(--ss-dur-fast) var(--ss-ease);
124
+ }
125
+ .ss-card.interactive:hover {
126
+ border-color: var(--ss-line-strong);
127
+ }
128
+ .ss-card.interactive.elevated:hover {
129
+ box-shadow: var(--ss-shadow-2);
130
+ }
131
+ .ss-card.interactive:focus-within {
132
+ border-color: var(--ss-line-strong);
133
+ }
134
+
135
+ .media {
136
+ display: block;
137
+ line-height: 0;
138
+ }
139
+ .media :global(img),
140
+ .media :global(svg),
141
+ .media :global(video) {
142
+ display: block;
143
+ width: 100%;
36
144
  }
37
145
 
38
146
  .head {
39
147
  padding: var(--ss-panel-head-py) var(--ss-panel-head-px);
40
148
  border-bottom: 1px solid var(--ss-line);
41
149
  display: flex;
42
- align-items: center;
150
+ align-items: flex-start;
43
151
  justify-content: space-between;
152
+ gap: var(--ss-gap-sm);
44
153
  font-family: var(--ss-font-mono);
45
154
  font-size: var(--ss-ui-sm);
46
155
  color: var(--ss-fg-faint);
47
156
  text-transform: uppercase;
48
157
  letter-spacing: 0.06em;
49
158
  }
159
+ .head .heading {
160
+ display: flex;
161
+ flex-direction: column;
162
+ gap: var(--ss-s-1);
163
+ min-width: 0;
164
+ }
50
165
  .head .title {
51
166
  color: var(--ss-fg);
52
167
  letter-spacing: 0.06em;
53
168
  }
169
+ .head .desc {
170
+ color: var(--ss-fg-muted);
171
+ text-transform: none;
172
+ letter-spacing: normal;
173
+ font-family: var(--ss-font-body);
174
+ }
54
175
  .head .meta {
55
176
  color: var(--ss-fg-faint);
56
177
  text-transform: lowercase;
57
178
  letter-spacing: 0.04em;
58
179
  }
59
180
 
181
+ .actions {
182
+ position: relative;
183
+ z-index: 1;
184
+ display: flex;
185
+ gap: var(--ss-gap);
186
+ align-items: center;
187
+ }
188
+
60
189
  .body {
61
190
  padding: var(--ss-panel-body-py) var(--ss-panel-body-px);
191
+ }
192
+
193
+ .foot {
194
+ position: relative;
195
+ z-index: 1;
196
+ padding: var(--ss-panel-head-py) var(--ss-panel-head-px);
197
+ border-top: 1px solid var(--ss-line);
198
+ display: flex;
199
+ align-items: center;
200
+ justify-content: space-between;
201
+ gap: var(--ss-gap-sm);
202
+ font-family: var(--ss-font-mono);
203
+ font-size: var(--ss-ui-sm);
204
+ color: var(--ss-fg-faint);
205
+ }
206
+
207
+ .overlay {
208
+ position: static;
209
+ }
210
+ .overlay::after {
211
+ content: "";
212
+ position: absolute;
213
+ inset: 0;
214
+ z-index: 0;
215
+ }
216
+
217
+ .sr-only {
218
+ position: absolute;
219
+ width: 1px;
220
+ height: 1px;
221
+ padding: 0;
222
+ margin: -1px;
223
+ overflow: hidden;
224
+ clip: rect(0 0 0 0);
225
+ white-space: nowrap;
226
+ border: 0;
62
227
  }</style>
@@ -1,10 +1,25 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import { type Size } from '../config.js';
3
3
  interface Props {
4
- title?: string;
4
+ /** Heading text, or a Snippet for inline icons/badges in the title. */
5
+ title?: string | Snippet;
6
+ /** Secondary label rendered to the right of the title. */
5
7
  meta?: string;
8
+ /** Muted description rendered under the heading. */
9
+ description?: string;
10
+ /** Header controls (buttons, menus) rendered to the right. */
6
11
  action?: Snippet;
12
+ /** Full-bleed visual rendered above the head (zero side padding). */
13
+ media?: Snippet;
14
+ /** Footer band mirroring the head, rendered only when provided. */
15
+ footer?: Snippet;
7
16
  children: Snippet;
17
+ /** Makes the whole card a primary link to this href. */
18
+ href?: string;
19
+ /** Makes the whole card clickable; pairs with keyboard activation. */
20
+ onclick?: (e: MouseEvent | KeyboardEvent) => void;
21
+ /** Surface style: outlined (default) or elevated (shadow tokens). */
22
+ variant?: 'outlined' | 'elevated';
8
23
  /** Token size (sm|md|lg); inherits the global size when unset. */
9
24
  size?: Size;
10
25
  /** Heading level for the title (aria-level), for correct document outline. */
@@ -0,0 +1,55 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte'
3
+ import { resolveComponentSize, type Size } from '../config.js'
4
+
5
+ interface Props {
6
+ /**
7
+ * Page mode — behaves like a route page: fills the viewport height and
8
+ * adds vertical page padding on top of the horizontal gutters.
9
+ */
10
+ page?: boolean
11
+ /** Token size (sm|md|lg); inherits the global size when unset. */
12
+ size?: Size
13
+ /** Page content. */
14
+ children?: Snippet
15
+ }
16
+
17
+ let { page = false, size, children }: Props = $props()
18
+ </script>
19
+
20
+ <!--
21
+ Centered, max-width page-content wrapper (DS-0085) — the DS-owned version of
22
+ the per-site "AppContent" wrappers. Full-bleed at narrow viewports (the
23
+ max-width simply stops binding); gutters stay via the inline padding.
24
+ -->
25
+ <div class="ss-container" class:page data-size-variant={resolveComponentSize('Container', size)}>
26
+ {@render children?.()}
27
+ </div>
28
+
29
+ <style>.ss-container {
30
+ --ss-container-max-w: 875px;
31
+ --ss-container-px: var(--ss-main-px);
32
+ --ss-container-page-py: var(--ss-s-10);
33
+ }
34
+ .ss-container[data-size-variant=sm] {
35
+ --ss-container-max-w: 760px;
36
+ --ss-container-px: var(--ss-s-5);
37
+ --ss-container-page-py: var(--ss-s-8);
38
+ }
39
+ .ss-container[data-size-variant=lg] {
40
+ --ss-container-max-w: 1000px;
41
+ --ss-container-px: var(--ss-s-12);
42
+ --ss-container-page-py: var(--ss-s-12);
43
+ }
44
+ .ss-container {
45
+ box-sizing: border-box;
46
+ width: 100%;
47
+ max-width: var(--ss-container-max-w);
48
+ margin-inline: auto;
49
+ padding-inline: var(--ss-container-px);
50
+ }
51
+ .ss-container.page {
52
+ min-height: 100vh;
53
+ min-height: 100svh;
54
+ padding-block: var(--ss-container-page-py);
55
+ }</style>
@@ -0,0 +1,16 @@
1
+ import type { Snippet } from 'svelte';
2
+ import { type Size } from '../config.js';
3
+ interface Props {
4
+ /**
5
+ * Page mode — behaves like a route page: fills the viewport height and
6
+ * adds vertical page padding on top of the horizontal gutters.
7
+ */
8
+ page?: boolean;
9
+ /** Token size (sm|md|lg); inherits the global size when unset. */
10
+ size?: Size;
11
+ /** Page content. */
12
+ children?: Snippet;
13
+ }
14
+ declare const Container: import("svelte").Component<Props, {}, "">;
15
+ type Container = ReturnType<typeof Container>;
16
+ export default Container;
@@ -3,28 +3,80 @@
3
3
  import { resolveComponentSize, type Size } from '../config.js'
4
4
 
5
5
  interface Props {
6
- variant?: 'empty' | 'error'
6
+ variant?: 'empty' | 'error' | 'no-results'
7
7
  title: string
8
8
  message?: string
9
+ /** Decorative glyph fallback when no `visual` snippet is given. */
9
10
  icon?: string
11
+ /** Visual slot — drop in an <Icon>, illustration or <img>; rendered aria-hidden. */
12
+ visual?: Snippet
10
13
  action?: Snippet
14
+ /** Secondary, lower-emphasis action rendered beside the primary one. */
15
+ secondaryAction?: Snippet
16
+ /** Low-emphasis footer (tertiary links) rendered below everything. */
17
+ footer?: Snippet
18
+ /**
19
+ * Accessible name for the live region (DS-0078) — distinguishes multiple
20
+ * status/alert regions on one page. Optional; the visible `title` already
21
+ * provides the content.
22
+ */
23
+ ariaLabel?: string
11
24
  /** Token size (sm|md|lg); inherits the global size when unset. */
12
25
  size?: Size
13
- /** Heading level for the title (aria-level), for correct document outline. */
14
- headingLevel?: number
26
+ /** Heading level for the title (aria-level). `false` renders a plain <p> with no heading role. */
27
+ headingLevel?: number | false
28
+ /** Compact density — drops padding and shrinks the title for inline/cell use. */
29
+ compact?: boolean
30
+ /** Remove the centered max-width cap and span the container. */
31
+ fullWidth?: boolean
15
32
  }
16
- let { variant = 'empty', title, message, icon, action, size, headingLevel = 2 }: Props = $props()
33
+ let {
34
+ variant = 'empty',
35
+ title,
36
+ message,
37
+ icon,
38
+ visual,
39
+ action,
40
+ secondaryAction,
41
+ footer,
42
+ ariaLabel,
43
+ size,
44
+ headingLevel = 2,
45
+ compact = false,
46
+ fullWidth = false,
47
+ }: Props = $props()
48
+
49
+ // error → assertive alert; everything else announces politely without moving focus (WCAG 4.1.3).
50
+ const role = $derived(variant === 'error' ? 'alert' : 'status')
17
51
  </script>
18
52
 
19
53
  <div
20
54
  class="ss-empty {variant}"
55
+ class:compact
56
+ class:full-width={fullWidth}
21
57
  data-size-variant={resolveComponentSize('EmptyState', size)}
22
- role={variant === 'error' ? 'alert' : undefined}
58
+ {role}
59
+ aria-label={ariaLabel}
60
+ aria-atomic="true"
23
61
  >
24
- {#if icon}<div class="ic" aria-hidden="true">{icon}</div>{/if}
25
- <p class="title" role="heading" aria-level={headingLevel}>{title}</p>
62
+ {#if visual}
63
+ <div class="ic" aria-hidden="true">{@render visual()}</div>
64
+ {:else if icon}
65
+ <div class="ic glyph" aria-hidden="true">{icon}</div>
66
+ {/if}
67
+ {#if headingLevel === false}
68
+ <p class="title">{title}</p>
69
+ {:else}
70
+ <p class="title" role="heading" aria-level={headingLevel}>{title}</p>
71
+ {/if}
26
72
  {#if message}<p class="msg">{message}</p>{/if}
27
- {#if action}<div class="act">{@render action()}</div>{/if}
73
+ {#if action || secondaryAction}
74
+ <div class="act">
75
+ {#if action}{@render action()}{/if}
76
+ {#if secondaryAction}{@render secondaryAction()}{/if}
77
+ </div>
78
+ {/if}
79
+ {#if footer}<div class="foot">{@render footer()}</div>{/if}
28
80
  </div>
29
81
 
30
82
  <style>.ss-empty {
@@ -34,12 +86,19 @@
34
86
  gap: var(--ss-s-3);
35
87
  text-align: center;
36
88
  padding: var(--ss-s-12) var(--ss-s-4);
89
+ max-width: var(--ss-empty-max-w);
90
+ margin-inline: auto;
91
+ }
92
+ .ss-empty.full-width {
93
+ max-width: none;
37
94
  }
38
95
  .ss-empty .ic {
39
- font-size: 40px;
40
96
  line-height: 1;
41
97
  margin-bottom: var(--ss-s-1);
42
98
  }
99
+ .ss-empty .ic.glyph {
100
+ font-size: var(--ss-empty-glyph);
101
+ }
43
102
  .ss-empty .title {
44
103
  margin: 0;
45
104
  font-family: var(--ss-font-display);
@@ -58,4 +117,27 @@
58
117
  }
59
118
  .ss-empty .act {
60
119
  margin-top: var(--ss-s-4);
120
+ display: flex;
121
+ align-items: center;
122
+ justify-content: center;
123
+ gap: var(--ss-s-3);
124
+ flex-wrap: wrap;
125
+ }
126
+ .ss-empty .foot {
127
+ margin-top: var(--ss-s-2);
128
+ color: var(--ss-fg-faint);
129
+ font-size: var(--ss-ui-sm);
130
+ }
131
+ .ss-empty.compact {
132
+ gap: var(--ss-s-2);
133
+ padding: var(--ss-s-6) var(--ss-s-3);
134
+ }
135
+ .ss-empty.compact .title {
136
+ font-size: var(--ss-size-h3);
137
+ }
138
+ .ss-empty.compact .ic.glyph {
139
+ font-size: var(--ss-empty-glyph-compact);
140
+ }
141
+ .ss-empty.compact .act {
142
+ margin-top: var(--ss-s-3);
61
143
  }</style>
@@ -1,15 +1,32 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import { type Size } from '../config.js';
3
3
  interface Props {
4
- variant?: 'empty' | 'error';
4
+ variant?: 'empty' | 'error' | 'no-results';
5
5
  title: string;
6
6
  message?: string;
7
+ /** Decorative glyph fallback when no `visual` snippet is given. */
7
8
  icon?: string;
9
+ /** Visual slot — drop in an <Icon>, illustration or <img>; rendered aria-hidden. */
10
+ visual?: Snippet;
8
11
  action?: Snippet;
12
+ /** Secondary, lower-emphasis action rendered beside the primary one. */
13
+ secondaryAction?: Snippet;
14
+ /** Low-emphasis footer (tertiary links) rendered below everything. */
15
+ footer?: Snippet;
16
+ /**
17
+ * Accessible name for the live region (DS-0078) — distinguishes multiple
18
+ * status/alert regions on one page. Optional; the visible `title` already
19
+ * provides the content.
20
+ */
21
+ ariaLabel?: string;
9
22
  /** Token size (sm|md|lg); inherits the global size when unset. */
10
23
  size?: Size;
11
- /** Heading level for the title (aria-level), for correct document outline. */
12
- headingLevel?: number;
24
+ /** Heading level for the title (aria-level). `false` renders a plain <p> with no heading role. */
25
+ headingLevel?: number | false;
26
+ /** Compact density — drops padding and shrinks the title for inline/cell use. */
27
+ compact?: boolean;
28
+ /** Remove the centered max-width cap and span the container. */
29
+ fullWidth?: boolean;
13
30
  }
14
31
  declare const EmptyState: import("svelte").Component<Props, {}, "">;
15
32
  type EmptyState = ReturnType<typeof EmptyState>;
@@ -0,0 +1,83 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte'
3
+ import { resolveComponentSize, type Size } from '../config.js'
4
+
5
+ interface Props {
6
+ /** Heading level (1–6) — picks the rendered element (h1…h6); styling is level-independent. */
7
+ level?: 1 | 2 | 3 | 4 | 5 | 6
8
+ /** Primary accent underline behind the text. On by default. */
9
+ accent?: boolean
10
+ /** Center the heading (text-align). */
11
+ centered?: boolean
12
+ /** Token size (sm|md|lg); inherits the global size when unset. */
13
+ size?: Size
14
+ /** Heading text. */
15
+ children?: Snippet
16
+ }
17
+
18
+ let { level = 1, accent = true, centered = false, size, children }: Props = $props()
19
+
20
+ const tag = $derived(`h${level}`)
21
+ </script>
22
+
23
+ <!--
24
+ Display/page-title heading — the `.hs-display` recipe from theme.css, carried
25
+ in-component so it works without the global stylesheet (DS-0083 / DS-0089).
26
+ The accent underline sits behind the text via a negative-z pseudo-element;
27
+ the bg-colored text-shadow lets the glyphs "cut into" the highlight.
28
+ -->
29
+ <svelte:element
30
+ this={tag}
31
+ class="ss-heading"
32
+ class:accent
33
+ class:centered
34
+ data-size-variant={resolveComponentSize('Heading', size)}
35
+ >
36
+ <span class="txt">{@render children?.()}</span>
37
+ </svelte:element>
38
+
39
+ <style>.ss-heading {
40
+ --ss-heading-size: var(--ss-size-display);
41
+ --ss-heading-mb: var(--ss-s-4);
42
+ --ss-heading-shadow: 3px;
43
+ }
44
+ .ss-heading[data-size-variant=sm] {
45
+ --ss-heading-size: clamp(30px, 6.5vw, 44px);
46
+ --ss-heading-mb: var(--ss-s-3);
47
+ --ss-heading-shadow: 2px;
48
+ }
49
+ .ss-heading[data-size-variant=lg] {
50
+ --ss-heading-size: clamp(44px, 9vw, 64px);
51
+ --ss-heading-mb: var(--ss-s-6);
52
+ --ss-heading-shadow: 4px;
53
+ }
54
+ .ss-heading {
55
+ font-family: var(--ss-font-display);
56
+ font-style: normal;
57
+ font-weight: 400;
58
+ font-size: var(--ss-heading-size);
59
+ line-height: 1.05;
60
+ letter-spacing: -0.015em;
61
+ color: var(--ss-fg);
62
+ margin: 0 0 var(--ss-heading-mb) 0;
63
+ text-shadow: var(--ss-heading-shadow) var(--ss-heading-shadow) var(--ss-bg);
64
+ position: relative;
65
+ z-index: 0;
66
+ }
67
+ .ss-heading.centered {
68
+ text-align: center;
69
+ }
70
+ .ss-heading .txt {
71
+ position: relative;
72
+ }
73
+ .ss-heading.accent .txt::before {
74
+ content: "";
75
+ position: absolute;
76
+ left: -2%;
77
+ right: -8%;
78
+ top: 70%;
79
+ height: 20%;
80
+ background: var(--ss-primary);
81
+ opacity: 0.9;
82
+ z-index: -1;
83
+ }</style>
@@ -0,0 +1,17 @@
1
+ import type { Snippet } from 'svelte';
2
+ import { type Size } from '../config.js';
3
+ interface Props {
4
+ /** Heading level (1–6) — picks the rendered element (h1…h6); styling is level-independent. */
5
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
6
+ /** Primary accent underline behind the text. On by default. */
7
+ accent?: boolean;
8
+ /** Center the heading (text-align). */
9
+ centered?: boolean;
10
+ /** Token size (sm|md|lg); inherits the global size when unset. */
11
+ size?: Size;
12
+ /** Heading text. */
13
+ children?: Snippet;
14
+ }
15
+ declare const Heading: import("svelte").Component<Props, {}, "">;
16
+ type Heading = ReturnType<typeof Heading>;
17
+ export default Heading;