@classic-homes/theme-svelte 1.2.1 → 1.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.
@@ -96,6 +96,12 @@
96
96
  * cover the tab. Defaults to 0.
97
97
  */
98
98
  tabInset?: number;
99
+ /**
100
+ * Thickness (px) of the collapsed tab — how far it protrudes into the page
101
+ * from its edge. The 56px default fits a title + subtitle; a single-line
102
+ * tab reads better around 36-40.
103
+ */
104
+ tabThickness?: number;
99
105
  /** Disable close button */
100
106
  disableClose?: boolean;
101
107
  /** Disable resize functionality */
@@ -141,6 +147,7 @@
141
147
  cardConfig = {},
142
148
  tabWidth = DEFAULT_TAB_WIDTH,
143
149
  tabInset = 0,
150
+ tabThickness = undefined,
144
151
  disableClose = false,
145
152
  disableResize = false,
146
153
  disableDrag = false,
@@ -1169,6 +1176,7 @@
1169
1176
  {disableClose}
1170
1177
  {tabWidth}
1171
1178
  {tabInset}
1179
+ {tabThickness}
1172
1180
  onclick={handleTabClick}
1173
1181
  onClose={handleClose}
1174
1182
  offset={internalTabOffset}
@@ -44,6 +44,12 @@ interface Props {
44
44
  * cover the tab. Defaults to 0.
45
45
  */
46
46
  tabInset?: number;
47
+ /**
48
+ * Thickness (px) of the collapsed tab — how far it protrudes into the page
49
+ * from its edge. The 56px default fits a title + subtitle; a single-line
50
+ * tab reads better around 36-40.
51
+ */
52
+ tabThickness?: number;
47
53
  /** Disable close button */
48
54
  disableClose?: boolean;
49
55
  /** Disable resize functionality */
@@ -37,6 +37,13 @@
37
37
  * to 0 (flush with the edge).
38
38
  */
39
39
  tabInset?: number;
40
+ /**
41
+ * Thickness (px) of the tab — how far it protrudes into the page from its
42
+ * edge. The 56px default fits a title + subtitle; a single-line tab reads
43
+ * better around 36-40. Only applies to side tabs; top/bottom tabs stay
44
+ * content-height.
45
+ */
46
+ tabThickness?: number;
40
47
  /** Additional class */
41
48
  class?: string;
42
49
  }
@@ -52,6 +59,7 @@
52
59
  onOffsetChange,
53
60
  tabWidth = DEFAULT_TAB_WIDTH,
54
61
  tabInset = 0,
62
+ tabThickness = TAB_THICKNESS,
55
63
  class: className,
56
64
  }: Props = $props();
57
65
 
@@ -83,8 +91,10 @@
83
91
  // Geometry is entirely pixel-based (see getTabTransform): the tab carries an
84
92
  // explicit width so nothing has to resolve a percentage against a
85
93
  // content-sized box while a rotation is composed onto it.
86
- const tabTransform = $derived<string>(getTabTransform(edge, tabWidth, effectiveOffset));
87
- const tabBounds = $derived(getTabBounds(edge, tabWidth));
94
+ const tabTransform = $derived<string>(
95
+ getTabTransform(edge, tabWidth, effectiveOffset, tabThickness)
96
+ );
97
+ const tabBounds = $derived(getTabBounds(edge, tabWidth, tabThickness));
88
98
 
89
99
  // Non-reactive drag bookkeeping.
90
100
  let drag = { startX: 0, startY: 0, startOffset: 0, moved: false, pointerId: -1 };
@@ -210,7 +220,7 @@
210
220
  style={`${insetStyle} width: ${tabWidth}px; ${
211
221
  /* Side tabs rotate, so they need a fixed thickness for a deterministic edge
212
222
  hug; top/bottom stay content-height. */
213
- isVertical ? `height: ${TAB_THICKNESS}px; ` : ''
223
+ isVertical ? `height: ${tabThickness}px; ` : ''
214
224
  }transform-origin: 0 0; transform: ${tabTransform};`}
215
225
  onpointerdown={handlePointerDown}
216
226
  onpointermove={draggable ? handlePointerMove : undefined}
@@ -220,14 +230,34 @@
220
230
  <button
221
231
  type="button"
222
232
  aria-label={`Expand ${title} panel`}
223
- class="flex min-w-0 flex-1 flex-col text-left leading-tight hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
233
+ class="flex min-w-0 flex-1 items-center gap-1.5 text-left leading-tight hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
224
234
  onclick={draggable ? undefined : onclick}
225
235
  onkeydown={handleExpandKeyDown}
226
236
  >
227
- <span class="truncate text-sm font-semibold">{title}</span>
228
- {#if subtitle}
229
- <span class="truncate text-xs text-muted-foreground">{subtitle}</span>
230
- {/if}
237
+ <!-- Expand chevron, pointing into the page (the direction the panel opens).
238
+ The chip rotates with its edge, so the pre-rotation "up" chevron lands
239
+ correctly on side edges; only a top tab needs flipping. -->
240
+ <svg
241
+ xmlns="http://www.w3.org/2000/svg"
242
+ width="14"
243
+ height="14"
244
+ viewBox="0 0 24 24"
245
+ fill="none"
246
+ stroke="currentColor"
247
+ stroke-width="2"
248
+ stroke-linecap="round"
249
+ stroke-linejoin="round"
250
+ aria-hidden="true"
251
+ class={cn('shrink-0 text-muted-foreground', edge === 'top' && 'rotate-180')}
252
+ >
253
+ <path d="m18 15-6-6-6 6" />
254
+ </svg>
255
+ <span class="flex min-w-0 flex-col">
256
+ <span class="truncate text-sm font-semibold">{title}</span>
257
+ {#if subtitle}
258
+ <span class="truncate text-xs text-muted-foreground">{subtitle}</span>
259
+ {/if}
260
+ </span>
231
261
  </button>
232
262
 
233
263
  {#if !disableClose && onClose}
@@ -27,6 +27,13 @@ interface Props {
27
27
  * to 0 (flush with the edge).
28
28
  */
29
29
  tabInset?: number;
30
+ /**
31
+ * Thickness (px) of the tab — how far it protrudes into the page from its
32
+ * edge. The 56px default fits a title + subtitle; a single-line tab reads
33
+ * better around 36-40. Only applies to side tabs; top/bottom tabs stay
34
+ * content-height.
35
+ */
36
+ tabThickness?: number;
30
37
  /** Additional class */
31
38
  class?: string;
32
39
  }
@@ -176,7 +176,9 @@
176
176
  {@render illustration()}
177
177
  </div>
178
178
  {:else if statusCode}
179
- <div class="mb-6">
179
+ <!-- Decorative watermark: the title carries the status; at 30%
180
+ opacity this can never meet text contrast, so hide it from AT -->
181
+ <div class="mb-6" aria-hidden="true">
180
182
  <span class="text-8xl font-bold text-muted-foreground/30 sm:text-9xl">
181
183
  {statusCode}
182
184
  </span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/theme-svelte",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Svelte components for the Classic theme system",
5
5
  "type": "module",
6
6
  "svelte": "./dist/lib/index.js",