@tenphi/starlight 0.6.1 → 0.8.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.
@@ -23,6 +23,10 @@ export const LogoRoot = customizeComponent(
23
23
  inlineSize: "100%",
24
24
  blockSize: "100%",
25
25
  },
26
+ Mark: {
27
+ $: "> svg > .td-logo__mark",
28
+ color: "#accent-surface-text",
29
+ },
26
30
  },
27
31
  }),
28
32
  );
@@ -104,7 +108,7 @@ export const StarlightHeaderRoot = customizeComponent(
104
108
  display: "flex",
105
109
  flow: "column",
106
110
  inlineSize: "100%",
107
- maxInlineSize: "($layout-width - ($sl-sidebar-pad-x * 2))",
111
+ maxInlineSize: "($layout-width - ($docs-sidebar-pad-x * 2))",
108
112
  blockSize: "100%",
109
113
  minInlineSize: "0",
110
114
  marginInlineStart: "auto",
@@ -146,13 +150,26 @@ export const StarlightHeaderRoot = customizeComponent(
146
150
  overflow: "hidden",
147
151
  maxInlineSize: {
148
152
  "": "none",
149
- "@mobile": "(100% - (($sl-menu-button-size + $sl-nav-gap) * 3))",
153
+ "@mobile": "(100% - (($docs-menu-button-size + $docs-nav-gap) * 3))",
154
+ },
155
+ },
156
+ Logo: {
157
+ $: ".td-header__logo",
158
+ inlineSize: {
159
+ "": "2rem",
160
+ "@mobile": "1.75rem",
161
+ },
162
+ blockSize: {
163
+ "": "2rem",
164
+ "@mobile": "1.75rem",
150
165
  },
151
166
  },
152
167
  SiteTitle: {
153
168
  $: ".site-title",
154
169
  color: "#text",
155
170
  preset: { "": "h4 / strong", "@mobile": "h5 / strong" },
171
+ textDecoration: "none",
172
+ whiteSpace: "nowrap",
156
173
  },
157
174
  Search: {
158
175
  $: ".td-header__search",
@@ -160,26 +177,27 @@ export const StarlightHeaderRoot = customizeComponent(
160
177
  zIndex: { "": "auto", "@mobile": "10" },
161
178
  inset: {
162
179
  "": "auto top",
163
- "@mobile": "(($sl-nav-height - $sl-menu-button-size) / 2) top",
180
+ "@mobile": "(($docs-nav-height - $docs-menu-button-size) / 2) top",
164
181
  },
165
182
  insetInlineEnd: {
166
183
  "": "auto",
167
184
  "@mobile":
168
- "($sl-nav-pad-x + (($sl-menu-button-size + $sl-nav-gap) * 2))",
185
+ "($docs-nav-pad-x + (($docs-menu-button-size + $docs-nav-gap) * 2))",
169
186
  },
170
187
  placeItems: { "": "normal", "@mobile": "center" },
171
- inlineSize: { "": "auto", "@mobile": "$sl-menu-button-size" },
172
- blockSize: { "": "auto", "@mobile": "$sl-menu-button-size" },
188
+ inlineSize: { "": "auto", "@mobile": "$docs-menu-button-size" },
189
+ blockSize: { "": "auto", "@mobile": "$docs-menu-button-size" },
173
190
  marginInlineStart: "0",
174
191
  },
175
192
  SearchElement: {
176
193
  $: ".td-header__search site-search",
177
194
  inlineSize: "100%",
178
- blockSize: { "": "auto", "@mobile": "$sl-menu-button-size" },
195
+ blockSize: { "": "auto", "@mobile": "$docs-menu-button-size" },
179
196
  },
180
197
  Tools: {
181
198
  $: ".td-header__tools",
182
199
  display: "flex",
200
+ hide: { "": false, "@mobile": true },
183
201
  flow: "row",
184
202
  alignItems: "center",
185
203
  justifyContent: "flex-end",
@@ -202,125 +220,144 @@ export const StarlightHeaderRoot = customizeComponent(
202
220
  zIndex: { "": "auto", "@mobile": "10" },
203
221
  inset: {
204
222
  "": "auto top",
205
- "@mobile": "(($sl-nav-height - $sl-menu-button-size) / 2) top",
223
+ "@mobile": "(($docs-nav-height - $docs-menu-button-size) / 2) top",
206
224
  },
207
225
  insetInlineEnd: {
208
226
  "": "auto",
209
- "@mobile": "($sl-nav-pad-x + $sl-menu-button-size + $sl-nav-gap)",
227
+ "@mobile":
228
+ "($docs-nav-pad-x + $docs-menu-button-size + $docs-nav-gap)",
210
229
  },
211
230
  placeItems: { "": "normal", "@mobile": "center" },
212
- inlineSize: { "": "auto", "@mobile": "$sl-menu-button-size" },
213
- blockSize: { "": "auto", "@mobile": "$sl-menu-button-size" },
231
+ inlineSize: { "": "auto", "@mobile": "$docs-menu-button-size" },
232
+ blockSize: { "": "auto", "@mobile": "$docs-menu-button-size" },
214
233
  },
215
234
  },
216
235
  }),
217
236
  );
218
237
 
238
+ const appearanceSelectStyles = {
239
+ display: "grid",
240
+ flexShrink: "0",
241
+ placeItems: "center",
242
+ margin: "0",
243
+ inlineSize: {
244
+ "": "$control-height",
245
+ "@mobile": "$docs-menu-button-size",
246
+ },
247
+ blockSize: {
248
+ "": "$control-height",
249
+ "@mobile": "$docs-menu-button-size",
250
+ },
251
+
252
+ Label: {
253
+ $: "label",
254
+ boxSizing: "border-box",
255
+ position: "relative",
256
+ display: "inline-flex",
257
+ alignItems: "center",
258
+ inlineSize: "100%",
259
+ blockSize: "100%",
260
+ padding: "0",
261
+ border: "0",
262
+ fill: "#clear",
263
+ },
264
+ Icon: {
265
+ $: ".label-icon",
266
+ position: "absolute",
267
+ zIndex: "1",
268
+ insetInlineStart: "50%",
269
+ inlineSize: "1rem",
270
+ blockSize: "1rem",
271
+ color: "#text-soft",
272
+ translate: "-50% 0",
273
+ pointerEvents: "none",
274
+ },
275
+ IconSvg: {
276
+ $: ".label-icon > svg",
277
+ display: "block",
278
+ inlineSize: "100%",
279
+ blockSize: "100%",
280
+ },
281
+ Select: {
282
+ $: "select",
283
+ appearance: "base-select",
284
+ position: "static",
285
+ inlineSize: "100%",
286
+ minInlineSize: "0",
287
+ blockSize: "100%",
288
+ minBlockSize: "0",
289
+ padding: "0",
290
+ margin: "0",
291
+ color: "#clear",
292
+ preset: "small / strong",
293
+ border: true,
294
+ radius: "$radius",
295
+ fill: {
296
+ "": "#surface-3",
297
+ ":hover": "#surface-3-hover",
298
+ ":active": "#surface-3-pressed",
299
+ },
300
+ shadow: "none",
301
+ cursor: "pointer",
302
+ transition: "color 120ms ease, fill 120ms ease",
303
+ },
304
+ PickerIcon: { $: "select::picker-icon", hide: true },
305
+ Picker: {
306
+ $: "select::picker(select)",
307
+ appearance: "base-select",
308
+ gap: "1px",
309
+ minInlineSize: "8rem",
310
+ marginBlockStart: "0.5rem",
311
+ padding: "4px",
312
+ color: "#text",
313
+ border: true,
314
+ radius: "$card-radius",
315
+ fill: "#surface-2",
316
+ shadow: "0 0.75rem 2rem #shadow",
317
+ },
318
+ OpenPicker: {
319
+ $: "select::picker(select):popover-open",
320
+ display: "grid",
321
+ },
322
+ Option: {
323
+ $: "option",
324
+ padding: "0.625rem 0.75rem",
325
+ color: "#text",
326
+ preset: "small",
327
+ radius: "$radius",
328
+ fill: "#surface-2",
329
+ },
330
+ HoverOption: {
331
+ $: "option:hover, option:focus",
332
+ fill: "#surface-2-hover",
333
+ },
334
+ CheckedOption: {
335
+ $: "option:checked",
336
+ color: "#accent-text",
337
+ fill: "#accent-surface-2-subtle",
338
+ },
339
+ Checkmark: {
340
+ $: "option::checkmark",
341
+ order: "1",
342
+ marginInlineStart: "auto",
343
+ },
344
+ };
345
+
219
346
  export const ThemeSelectRoot = customizeComponent(
220
347
  "ThemeSelect",
221
348
  { as: "starlight-theme-select" },
222
349
  tasty({
223
350
  as: "starlight-theme-select",
224
- styles: {
225
- display: "grid",
226
- placeItems: "center",
227
- margin: "0",
228
- inlineSize: {
229
- "": "$control-height",
230
- "@mobile": "$sl-menu-button-size",
231
- },
232
- blockSize: {
233
- "": "$control-height",
234
- "@mobile": "$sl-menu-button-size",
235
- },
351
+ styles: appearanceSelectStyles,
352
+ }),
353
+ );
236
354
 
237
- Label: {
238
- $: "label",
239
- boxSizing: "border-box",
240
- position: "relative",
241
- display: "inline-flex",
242
- alignItems: "center",
243
- inlineSize: "100%",
244
- blockSize: "100%",
245
- padding: "0",
246
- border: "0",
247
- fill: "#clear",
248
- },
249
- Icon: {
250
- $: ".label-icon",
251
- position: "absolute",
252
- zIndex: "1",
253
- insetInlineStart: "50%",
254
- inlineSize: "1rem",
255
- blockSize: "1rem",
256
- color: "#text-soft",
257
- translate: "-50% 0",
258
- pointerEvents: "none",
259
- },
260
- Select: {
261
- $: "select",
262
- appearance: "base-select",
263
- position: "static",
264
- inlineSize: "100%",
265
- minInlineSize: "0",
266
- blockSize: "100%",
267
- minBlockSize: "0",
268
- padding: "0",
269
- margin: "0",
270
- color: "#clear",
271
- preset: "small / strong",
272
- border: true,
273
- radius: "$radius",
274
- fill: {
275
- "": "#surface-3",
276
- ":hover": "#surface-3-hover",
277
- ":active": "#surface-3-pressed",
278
- },
279
- shadow: "none",
280
- cursor: "pointer",
281
- transition: "color 120ms ease, fill 120ms ease",
282
- },
283
- PickerIcon: { $: "select::picker-icon", hide: true },
284
- Picker: {
285
- $: "select::picker(select)",
286
- appearance: "base-select",
287
- gap: "1px",
288
- minInlineSize: "8rem",
289
- marginBlockStart: "0.5rem",
290
- padding: "4px",
291
- color: "#text",
292
- border: true,
293
- radius: "$card-radius",
294
- fill: "#surface-2",
295
- shadow: "0 0.75rem 2rem #shadow",
296
- },
297
- OpenPicker: {
298
- $: "select::picker(select):popover-open",
299
- display: "grid",
300
- },
301
- Option: {
302
- $: "option",
303
- padding: "0.625rem 0.75rem",
304
- color: "#text",
305
- preset: "small",
306
- radius: "$radius",
307
- fill: "#surface-2",
308
- },
309
- HoverOption: {
310
- $: "option:hover, option:focus",
311
- fill: "#surface-2-hover",
312
- },
313
- CheckedOption: {
314
- $: "option:checked",
315
- color: "#accent-text",
316
- fill: "color-mix(in oklab, #accent-surface 12%, #surface-2)",
317
- },
318
- Checkmark: {
319
- $: "option::checkmark",
320
- order: "1",
321
- marginInlineStart: "auto",
322
- },
323
- },
355
+ export const ContrastSelectRoot = customizeComponent(
356
+ "ContrastSelect",
357
+ { as: "cookbook-contrast-select" },
358
+ tasty({
359
+ as: "cookbook-contrast-select",
360
+ styles: appearanceSelectStyles,
324
361
  }),
325
362
  );
326
363
 
@@ -371,7 +408,7 @@ export const MobileNavigationTabsRoot = customizeComponent(
371
408
  CurrentLink: {
372
409
  $: 'a[aria-current="page"]',
373
410
  color: "#accent-text",
374
- fill: "color-mix(in oklab, #accent-surface 12%, #surface)",
411
+ fill: "#accent-surface-subtle",
375
412
  },
376
413
  },
377
414
  }),
@@ -28,11 +28,13 @@ const {
28
28
  >
29
29
  <rect width="64" height="64" rx="14" fill="currentColor"></rect>
30
30
  <path
31
- fill="#fff"
31
+ class="td-logo__mark"
32
+ fill="currentColor"
32
33
  d="M14.8 16c6.7.2 12.3 2 16.7 5.4v28.4c-4.4-3.1-10-4.7-16.6-4.9a3 3 0 0 1-2.9-3V19a3 3 0 0 1 2.8-3Z"
33
34
  ></path>
34
35
  <path
35
- fill="#fff"
36
+ class="td-logo__mark"
37
+ fill="currentColor"
36
38
  d="M49.2 16c-6.7.2-12.3 2-16.7 5.4v28.4c4.4-3.1 10-4.7 16.6-4.9a3 3 0 0 0 2.9-3V19a3 3 0 0 0-2.8-3Z"
37
39
  ></path>
38
40
  </svg>
@@ -62,6 +62,30 @@ describe("component style configuration", () => {
62
62
  });
63
63
  });
64
64
 
65
+ it("exposes bridged Markdown components through the same style registry", () => {
66
+ configureComponentStyles({
67
+ MarkdownTable: { Table: { radius: "0" } },
68
+ Mermaid: { Diagram: { maxInlineSize: "90%" } },
69
+ });
70
+
71
+ expect(
72
+ resolveComponentStyles("MarkdownTable", {
73
+ Table: { border: true, radius: "1cr" },
74
+ Cell: { padding: "1.5x 2x" },
75
+ }),
76
+ ).toEqual({
77
+ Table: { border: true, radius: "0" },
78
+ Cell: { padding: "1.5x 2x" },
79
+ });
80
+ expect(
81
+ resolveComponentStyles("Mermaid", {
82
+ Diagram: { display: "block", maxInlineSize: "100%" },
83
+ }),
84
+ ).toEqual({
85
+ Diagram: { display: "block", maxInlineSize: "90%" },
86
+ });
87
+ });
88
+
65
89
  it("keeps custom anatomy styles on the compatibility bridge", () => {
66
90
  expect(
67
91
  resolveLegacyAnatomyStyles({
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0-18 0M12 3v18"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0-18 0M12 3v18"/></svg>
package/dist/index.d.ts CHANGED
@@ -35,6 +35,8 @@ interface ResolvedDocsTheme {
35
35
  focus: Record<string, string>;
36
36
  shadow: Record<string, string>;
37
37
  };
38
+ /** Glaze-generated Tasty color tokens, including interaction and status roles. */
39
+ colorTokens: Record<string, Record<string, string>>;
38
40
  tokens: ThemeTokens;
39
41
  presets: Record<string, TypographyPreset>;
40
42
  contrast: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/starlight-runtime.d.ts","../src/integration.ts","../src/theme/index.ts","../src/theme/defaults.ts"],"mappings":";;;;UAEiB;EACf;EACA;EACA;EACA;EACA,mBAAmB;EACnB;GACC;;iBAGqB,UAAU,SAAS,mBAAmB;;;UCmC7C;EACf,SAAS;EACT;;iBAGsB,SACtB,UAAS,kBACR;iBA4aa,eACd,QAAQ,kBAAkB,gBACzB;;;UCldc;EACf;IACE,SAAS;IACT,UAAU;IACV,UAAU;IACV,MAAM;IACN,UAAU;IACV,YAAY;IACZ,eAAe;IACf,mBAAmB;IACnB,OAAO;IACP,QAAQ;;EAEV,QAAQ;EACR,SAAS,eAAe;EACxB;IACE;IACA;IACA;IACA;;EAEF,aAAa;;iBAGC,iBAAiB,QAAO,cAAmB;;;cCpC9C;;;;;;;;;;;;cAkBA,4BAA4B,eAAe"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/starlight-runtime.d.ts","../src/integration.ts","../src/theme/index.ts","../src/theme/defaults.ts"],"mappings":";;;;UAEiB;EACf;EACA;EACA;EACA;EACA,mBAAmB;EACnB;GACC;;iBAGqB,UAAU,SAAS,mBAAmB;;;UC+C7C;EACf,SAAS;EACT;;iBAGsB,SACtB,UAAS,kBACR;iBAoiBa,eACd,QAAQ,kBAAkB,gBACzB;;;UCrlBc;EACf;IACE,SAAS;IACT,UAAU;IACV,UAAU;IACV,MAAM;IACN,UAAU;IACV,YAAY;IACZ,eAAe;IACf,mBAAmB;IACnB,OAAO;IACP,QAAQ;;;EAGV,aAAa,eAAe;EAC5B,QAAQ;EACR,SAAS,eAAe;EACxB;IACE;IACA;IACA;IACA;;EAEF,aAAa;;iBAGC,iBAAiB,QAAO,cAAmB;;;cCvC9C;;;;;;;;;;;;cAkBA,4BAA4B,eAAe"}