@fuzdev/fuz_ui 0.179.0 → 0.181.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 (50) hide show
  1. package/dist/ApiIndex.svelte +19 -18
  2. package/dist/ApiIndex.svelte.d.ts.map +1 -1
  3. package/dist/ApiModule.svelte +2 -2
  4. package/dist/ApiModulesList.svelte +52 -0
  5. package/dist/ApiModulesList.svelte.d.ts +15 -0
  6. package/dist/ApiModulesList.svelte.d.ts.map +1 -0
  7. package/dist/Card.svelte +11 -3
  8. package/dist/ContextmenuSeparator.svelte +1 -1
  9. package/dist/ContextmenuSubmenu.svelte +1 -1
  10. package/dist/Dialog.svelte +7 -3
  11. package/dist/DocsFooter.svelte +1 -1
  12. package/dist/DocsList.svelte +3 -3
  13. package/dist/DocsPrimaryNav.svelte +7 -3
  14. package/dist/DocsSearch.svelte +51 -14
  15. package/dist/DocsSearch.svelte.d.ts +16 -2
  16. package/dist/DocsSearch.svelte.d.ts.map +1 -1
  17. package/dist/DocsSecondaryNav.svelte +1 -1
  18. package/dist/DocsTertiaryNav.svelte +2 -9
  19. package/dist/DocsTertiaryNav.svelte.d.ts.map +1 -1
  20. package/dist/HueInput.svelte +2 -2
  21. package/dist/LibraryDetail.svelte +6 -6
  22. package/dist/LibrarySummary.svelte +9 -25
  23. package/dist/LibrarySummary.svelte.d.ts.map +1 -1
  24. package/dist/MdzNodeView.svelte +3 -3
  25. package/dist/ModuleLink.svelte +3 -1
  26. package/dist/ModuleLink.svelte.d.ts.map +1 -1
  27. package/dist/ProjectLinks.svelte +25 -13
  28. package/dist/Spiders.svelte +10 -10
  29. package/dist/StyleVariableButton.svelte +44 -0
  30. package/dist/StyleVariableButton.svelte.d.ts +10 -0
  31. package/dist/StyleVariableButton.svelte.d.ts.map +1 -0
  32. package/dist/Svg.svelte +1 -2
  33. package/dist/TomeSection.svelte +6 -1
  34. package/dist/TomeSection.svelte.d.ts.map +1 -1
  35. package/dist/alert.js +3 -3
  36. package/dist/api_search.svelte.d.ts +14 -2
  37. package/dist/api_search.svelte.d.ts.map +1 -1
  38. package/dist/api_search.svelte.js +32 -9
  39. package/dist/declaration.svelte.d.ts +1 -1
  40. package/dist/library.svelte.d.ts +1 -1
  41. package/dist/style_variable_helpers.svelte.d.ts +10 -0
  42. package/dist/style_variable_helpers.svelte.d.ts.map +1 -0
  43. package/dist/style_variable_helpers.svelte.js +9 -0
  44. package/package.json +12 -12
  45. package/src/lib/alert.ts +3 -3
  46. package/src/lib/api_search.svelte.ts +44 -9
  47. package/src/lib/style_variable_helpers.svelte.ts +14 -0
  48. package/dist/DocsModulesList.svelte +0 -34
  49. package/dist/DocsModulesList.svelte.d.ts +0 -8
  50. package/dist/DocsModulesList.svelte.d.ts.map +0 -1
@@ -2,12 +2,11 @@
2
2
  import {library_context, type Library} from './library.svelte.js';
3
3
  import {get_tome_by_name, type Tome} from './tome.js';
4
4
  import TomeContent from './TomeContent.svelte';
5
- import TomeSection from './TomeSection.svelte';
6
5
  import TomeLink from './TomeLink.svelte';
7
- import TomeSectionHeader from './TomeSectionHeader.svelte';
8
6
  import DocsSearch from './DocsSearch.svelte';
7
+ import ApiModulesList from './ApiModulesList.svelte';
9
8
  import ApiDeclarationList from './ApiDeclarationList.svelte';
10
- import {create_declaration_search} from './api_search.svelte.js';
9
+ import {create_api_search} from './api_search.svelte.js';
11
10
 
12
11
  const {
13
12
  library = library_context.get(),
@@ -31,7 +30,7 @@
31
30
  minimal?: boolean;
32
31
  } = $props();
33
32
 
34
- const search = $derived(create_declaration_search(library));
33
+ const search = $derived(create_api_search(library));
35
34
  </script>
36
35
 
37
36
  <svelte:head>
@@ -44,22 +43,24 @@
44
43
  <p>Browse the full <TomeLink name="api" /> docs.</p>
45
44
  </section>
46
45
  {:else}
47
- <TomeSection>
48
- <TomeSectionHeader text="Declarations" />
46
+ <section>
47
+ <p>{library.package_json.description}</p>
49
48
 
50
- <section>
51
- <p>{library.package_json.description}</p>
49
+ {#if search.modules.all.length + search.declarations.all.length > 1}
50
+ <DocsSearch
51
+ module_count={search.modules.all.length}
52
+ declaration_count={search.declarations.all.length}
53
+ filtered_module_count={search.query.trim() ? search.modules.filtered.length : undefined}
54
+ filtered_declaration_count={search.query.trim()
55
+ ? search.declarations.filtered.length
56
+ : undefined}
57
+ bind:search_query={search.query}
58
+ />
59
+ {/if}
60
+ </section>
52
61
 
53
- {#if search.all.length > 1}
54
- <DocsSearch
55
- total_count={search.all.length}
56
- result_count={search.filtered.length}
57
- bind:search_query={search.query}
58
- />
59
- {/if}
60
- </section>
62
+ <ApiModulesList modules={search.modules.filtered} search_query={search.query} />
61
63
 
62
- <ApiDeclarationList declarations={search.filtered} search_query={search.query} />
63
- </TomeSection>
64
+ <ApiDeclarationList declarations={search.declarations.filtered} search_query={search.query} />
64
65
  {/if}
65
66
  </TomeContent>
@@ -1 +1 @@
1
- {"version":3,"file":"ApiIndex.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiIndex.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAmB,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AASrD,KAAK,gBAAgB,GAAI;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAiDH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"ApiIndex.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiIndex.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAmB,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAQrD,KAAK,gBAAgB,GAAI;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAgDH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -75,8 +75,8 @@
75
75
  {#if search.all.length > 1}
76
76
  <DocsSearch
77
77
  placeholder="search declarations in this module..."
78
- total_count={search.all.length}
79
- result_count={search.filtered.length}
78
+ declaration_count={search.all.length}
79
+ filtered_declaration_count={search.query.trim() ? search.filtered.length : undefined}
80
80
  bind:search_query={search.query}
81
81
  />
82
82
  {/if}
@@ -0,0 +1,52 @@
1
+ <script lang="ts">
2
+ import type {Module} from './module.svelte.js';
3
+ import ModuleLink from './ModuleLink.svelte';
4
+ import TomeSection from './TomeSection.svelte';
5
+ import TomeSectionHeader from './TomeSectionHeader.svelte';
6
+
7
+ const {
8
+ modules,
9
+ search_query = '',
10
+ }: {
11
+ /**
12
+ * The modules to display.
13
+ */
14
+ modules: Array<Module>;
15
+ /**
16
+ * The current search query for highlighting.
17
+ */
18
+ search_query?: string;
19
+ } = $props();
20
+
21
+ const has_search = $derived(search_query.trim().length > 0);
22
+ </script>
23
+
24
+ {#if modules.length > 0 || has_search}
25
+ <TomeSection>
26
+ <TomeSectionHeader text="Modules" />
27
+ {#if modules.length === 0}
28
+ <p class="color_c">No modules match your search.</p>
29
+ {:else}
30
+ <ul class="modules_list">
31
+ {#each modules as module (module.path)}
32
+ <li>
33
+ <ModuleLink module_path={module.path} />
34
+ </li>
35
+ {/each}
36
+ </ul>
37
+ {/if}
38
+ </TomeSection>
39
+ {/if}
40
+
41
+ <style>
42
+ .modules_list {
43
+ display: flex;
44
+ flex-wrap: wrap;
45
+ gap: var(--space_xs);
46
+ padding: 0;
47
+ list-style: none;
48
+ }
49
+ .modules_list li {
50
+ margin: 0;
51
+ }
52
+ </style>
@@ -0,0 +1,15 @@
1
+ import type { Module } from './module.svelte.js';
2
+ type $$ComponentProps = {
3
+ /**
4
+ * The modules to display.
5
+ */
6
+ modules: Array<Module>;
7
+ /**
8
+ * The current search query for highlighting.
9
+ */
10
+ search_query?: string;
11
+ };
12
+ declare const ApiModulesList: import("svelte").Component<$$ComponentProps, {}, "">;
13
+ type ApiModulesList = ReturnType<typeof ApiModulesList>;
14
+ export default ApiModulesList;
15
+ //# sourceMappingURL=ApiModulesList.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiModulesList.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiModulesList.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAK9C,KAAK,gBAAgB,GAAI;IACxB;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAoCH,QAAA,MAAM,cAAc,sDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
package/dist/Card.svelte CHANGED
@@ -76,7 +76,7 @@
76
76
  align-items: center;
77
77
  padding: var(--space_lg);
78
78
  width: var(--card_width);
79
- background-color: var(--fg_1);
79
+ background-color: var(--fg_10);
80
80
  border-radius: var(--border_radius, var(--border_radius_md));
81
81
  text-decoration: none;
82
82
  text-align: left;
@@ -93,14 +93,22 @@
93
93
  box-shadow: var(
94
94
  --shadow,
95
95
  var(--shadow_inset_bottom_sm)
96
- color-mix(in hsl, var(--shadow_color) var(--shadow_alpha_2), transparent)
96
+ color-mix(
97
+ in hsl,
98
+ var(--shadow_color, var(--shadow_color_umbra)) var(--shadow_alpha_40),
99
+ transparent
100
+ )
97
101
  );
98
102
  }
99
103
  .link:active {
100
104
  box-shadow: var(
101
105
  --shadow,
102
106
  var(--shadow_inset_top_sm)
103
- color-mix(in hsl, var(--shadow_color) var(--shadow_alpha_2), transparent)
107
+ color-mix(
108
+ in hsl,
109
+ var(--shadow_color, var(--shadow_color_umbra)) var(--shadow_alpha_40),
110
+ transparent
111
+ )
104
112
  );
105
113
  }
106
114
  .link.selected .content,
@@ -10,7 +10,7 @@
10
10
  .contextmenu_separator {
11
11
  height: var(--border_width);
12
12
  margin: var(--spacing_xs) var(--spacing_sm);
13
- background-color: var(--border_color_1);
13
+ background-color: var(--border_color_10);
14
14
  list-style: none;
15
15
  }
16
16
  </style>
@@ -103,7 +103,7 @@
103
103
  menu {
104
104
  z-index: var(--contextmenu_depth);
105
105
  position: absolute;
106
- /* TODO this is a hack to avoid the pixel gap, probably change to 0 after adding transparent bg hitbox */
106
+ /* TODO this is a hack to avoid the pixel gap, probably change to 0 after adding transparent surface hitbox */
107
107
  left: -1px;
108
108
  top: 0;
109
109
  max-width: var(--contextmenu_width);
@@ -166,7 +166,11 @@
166
166
  <style>
167
167
  .dialog {
168
168
  --pane_shadow: var(--shadow_bottom_xl)
169
- color-mix(in hsl, var(--shadow_color) var(--shadow_alpha_5), transparent);
169
+ color-mix(
170
+ in hsl,
171
+ var(--shadow_color, var(--shadow_color_umbra)) var(--shadow_alpha_70),
172
+ transparent
173
+ );
170
174
  position: fixed;
171
175
  inset: 0;
172
176
  overflow: auto;
@@ -177,7 +181,7 @@
177
181
  }
178
182
 
179
183
  .dialog_wrapper {
180
- position: relative; /* for the bg */
184
+ position: relative; /* for the surface */
181
185
  min-height: 100%;
182
186
  display: flex;
183
187
  align-items: center;
@@ -193,7 +197,7 @@
193
197
  z-index: 0;
194
198
  opacity: 0;
195
199
  transition: opacity var(--duration_3) ease;
196
- background-color: var(--dialog_bg, var(--darken_6));
200
+ background-color: var(--dialog_bg, var(--darken_60));
197
201
  }
198
202
  .ready .dialog_bg {
199
203
  opacity: 1;
@@ -56,7 +56,7 @@
56
56
  border: var(--border_width) double var(--border_color);
57
57
  }
58
58
  .logo a:hover {
59
- --border_color: var(--color_a_5);
59
+ --border_color: var(--color_a_50);
60
60
  }
61
61
  .root_url {
62
62
  /* TODO messy */
@@ -33,12 +33,12 @@
33
33
 
34
34
  /* TODO should be fixed upstream in fuz_css */
35
35
  .docs_list :global(a.highlighted) {
36
- background-color: var(--bg_4);
36
+ background-color: var(--fg_10);
37
37
  }
38
38
  .docs_list :global(a:hover) {
39
- background-color: var(--bg_5);
39
+ background-color: var(--fg_10);
40
40
  }
41
41
  .docs_list :global(a:is(:active, .selected)) {
42
- background-color: var(--bg_7);
42
+ background-color: var(--fg_20);
43
43
  }
44
44
  </style>
@@ -47,7 +47,7 @@
47
47
  position: sticky;
48
48
  top: 0;
49
49
  z-index: 10;
50
- background-color: var(--bg);
50
+ background-color: var(--shade_00);
51
51
  height: var(--docs_primary_nav_height);
52
52
  transition: box-shadow var(--duration_2);
53
53
  box-shadow: none;
@@ -55,7 +55,11 @@
55
55
 
56
56
  .scrolled {
57
57
  box-shadow: var(--shadow_bottom_xs)
58
- color-mix(in hsl, var(--shadow_color) var(--shadow_alpha_1), transparent);
58
+ color-mix(
59
+ in hsl,
60
+ var(--shadow_color, var(--shadow_color_umbra)) var(--shadow_alpha_30),
61
+ transparent
62
+ );
59
63
  }
60
64
 
61
65
  .background {
@@ -63,7 +67,7 @@
63
67
  z-index: -1;
64
68
  width: 100%;
65
69
  height: 100%;
66
- background-color: var(--fg_1);
70
+ background-color: var(--shade_10);
67
71
  }
68
72
 
69
73
  .content {
@@ -2,25 +2,61 @@
2
2
  import type {SvelteHTMLElements} from 'svelte/elements';
3
3
 
4
4
  let {
5
- placeholder = 'search declarations and modules...',
6
- total_count,
7
- result_count,
5
+ placeholder = 'search modules and declarations...',
6
+ module_count,
7
+ declaration_count,
8
+ filtered_module_count,
9
+ filtered_declaration_count,
8
10
  search_query = $bindable(),
9
11
  ...rest
10
12
  }: SvelteHTMLElements['input'] & {
11
13
  placeholder?: string;
12
- total_count: number;
13
- result_count?: number;
14
+ /**
15
+ * Total number of modules.
16
+ */
17
+ module_count?: number;
18
+ /**
19
+ * Total number of declarations.
20
+ */
21
+ declaration_count?: number;
22
+ /**
23
+ * Number of modules after filtering.
24
+ */
25
+ filtered_module_count?: number;
26
+ /**
27
+ * Number of declarations after filtering.
28
+ */
29
+ filtered_declaration_count?: number;
14
30
  search_query: string;
15
31
  } = $props();
16
32
 
17
- const total_text = $derived(
18
- total_count === 1 ? `${total_count} declaration` : `${total_count} declarations`,
19
- );
20
- const result_text = $derived(
21
- result_count === 1 ? `${result_count} match found` : `${result_count} matches found`,
22
- );
23
33
  const has_search = $derived(search_query.trim().length > 0);
34
+
35
+ const total_text = $derived.by(() => {
36
+ const parts: Array<string> = [];
37
+ if (module_count !== undefined) {
38
+ parts.push(module_count === 1 ? '1 module' : `${module_count} modules`);
39
+ }
40
+ if (declaration_count !== undefined) {
41
+ parts.push(declaration_count === 1 ? '1 declaration' : `${declaration_count} declarations`);
42
+ }
43
+ return parts.join(' · ');
44
+ });
45
+
46
+ const result_text = $derived.by(() => {
47
+ const parts: Array<string> = [];
48
+ if (filtered_module_count !== undefined) {
49
+ parts.push(filtered_module_count === 1 ? '1 module' : `${filtered_module_count} modules`);
50
+ }
51
+ if (filtered_declaration_count !== undefined) {
52
+ parts.push(
53
+ filtered_declaration_count === 1
54
+ ? '1 declaration'
55
+ : `${filtered_declaration_count} declarations`,
56
+ );
57
+ }
58
+ return parts.join(' · ');
59
+ });
24
60
  </script>
25
61
 
26
62
  <label class="display:block position:relative">
@@ -41,8 +77,9 @@
41
77
  </label>
42
78
 
43
79
  <p>
44
- {total_text}
45
- {#if has_search && result_count !== undefined}
46
- · {result_text}
80
+ {#if has_search && result_text}
81
+ {result_text} found
82
+ {:else if total_text}
83
+ {total_text}
47
84
  {/if}
48
85
  </p>
@@ -1,8 +1,22 @@
1
1
  import type { SvelteHTMLElements } from 'svelte/elements';
2
2
  type $$ComponentProps = SvelteHTMLElements['input'] & {
3
3
  placeholder?: string;
4
- total_count: number;
5
- result_count?: number;
4
+ /**
5
+ * Total number of modules.
6
+ */
7
+ module_count?: number;
8
+ /**
9
+ * Total number of declarations.
10
+ */
11
+ declaration_count?: number;
12
+ /**
13
+ * Number of modules after filtering.
14
+ */
15
+ filtered_module_count?: number;
16
+ /**
17
+ * Number of declarations after filtering.
18
+ */
19
+ filtered_declaration_count?: number;
6
20
  search_query: string;
7
21
  };
8
22
  declare const DocsSearch: import("svelte").Component<$$ComponentProps, {}, "search_query">;
@@ -1 +1 @@
1
- {"version":3,"file":"DocsSearch.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsSearch.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAwCH,QAAA,MAAM,UAAU,kEAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"DocsSearch.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsSearch.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AA+DH,QAAA,MAAM,UAAU,kEAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
@@ -37,7 +37,7 @@
37
37
  margin-bottom: 0;
38
38
  overflow: auto;
39
39
  scrollbar-width: thin;
40
- background-color: var(--fg_1);
40
+ background-color: var(--shade_10);
41
41
  }
42
42
 
43
43
  .sidebar nav {
@@ -2,10 +2,9 @@
2
2
  import {page} from '$app/state';
3
3
  import type {SvelteHTMLElements} from 'svelte/elements';
4
4
 
5
- import DocsModulesList from './DocsModulesList.svelte';
6
5
  import DocsPageLinks from './DocsPageLinks.svelte';
7
6
  import {to_tome_pathname, Tome} from './tome.js';
8
- import {docs_links_context, DOCS_API_PATH} from './docs_helpers.svelte.js';
7
+ import {docs_links_context} from './docs_helpers.svelte.js';
9
8
  import {library_context} from './library.svelte.js';
10
9
  import TomeLink from './TomeLink.svelte';
11
10
  import ModuleLink from './ModuleLink.svelte';
@@ -47,9 +46,6 @@
47
46
  const docs_links = docs_links_context.get();
48
47
 
49
48
  const should_show_page_links = $derived(docs_links.docs_links.length > 0);
50
-
51
- const at_api_root = $derived(page.url.pathname === DOCS_API_PATH);
52
- const at_module = $derived(page.url.pathname.startsWith(DOCS_API_PATH + '/'));
53
49
  </script>
54
50
 
55
51
  <!-- TODO probably add a `nav` wrapper? around which? -->
@@ -57,9 +53,6 @@
57
53
  {#if should_show_page_links}
58
54
  <DocsPageLinks {sidebar} expand_width />
59
55
  {/if}
60
- {#if at_api_root || at_module}
61
- <DocsModulesList expand_width />
62
- {/if}
63
56
  {#if tomes_related_to_selected.length}
64
57
  <section class="related_section">
65
58
  <h4 class="mb_sm">related tomes</h4>
@@ -106,7 +99,7 @@
106
99
  ); /* needed with `overflow: auto` to avoid cutting off outline */
107
100
  overflow: auto;
108
101
  scrollbar-width: thin;
109
- background-color: var(--fg_1);
102
+ background-color: var(--shade_10);
110
103
  }
111
104
 
112
105
  /* sync this breakpoint with `/docs/+layout` */
@@ -1 +1 @@
1
- {"version":3,"file":"DocsTertiaryNav.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsTertiaryNav.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAIxD,OAAO,EAAmB,IAAI,EAAC,MAAM,WAAW,CAAC;AAOhD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG;IACtD,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AA+FH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"DocsTertiaryNav.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsTertiaryNav.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAGxD,OAAO,EAAmB,IAAI,EAAC,MAAM,WAAW,CAAC;AAOhD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG;IACtD,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAwFH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
@@ -79,7 +79,7 @@
79
79
  flex-direction: row;
80
80
  align-items: center;
81
81
  font-weight: 700;
82
- color: var(--bg);
82
+ color: var(--shade_00);
83
83
  padding-left: var(--space_xl);
84
84
  border-top-left-radius: var(--border_radius, var(--border_radius_md));
85
85
  border-top-right-radius: var(--border_radius, var(--border_radius_md));
@@ -121,6 +121,6 @@
121
121
  border-radius: var(--border_radius, var(--border_radius_md));
122
122
  /* TODO why is this necessary? */
123
123
  height: var(--input_height);
124
- color: var(--bg);
124
+ color: var(--shade_00);
125
125
  }
126
126
  </style>
@@ -267,25 +267,25 @@
267
267
  }
268
268
  .module {
269
269
  margin-bottom: var(--space_xs);
270
- --link_color: var(--text_color_3);
270
+ --link_color: var(--text_70);
271
271
  }
272
272
  .module_content {
273
- background-color: var(--bg_3);
273
+ background-color: var(--shade_30);
274
274
  border-radius: var(--border_radius_sm);
275
275
  padding: var(--space_xs);
276
276
  }
277
277
  /* TODO probably add variables/classes for these */
278
278
  .ts {
279
- --link_color: var(--color_a_5);
279
+ --link_color: var(--color_a_50);
280
280
  }
281
281
  .svelte {
282
- --link_color: var(--color_h_5);
282
+ --link_color: var(--color_h_50);
283
283
  }
284
284
  .css {
285
- --link_color: var(--color_b_5);
285
+ --link_color: var(--color_b_50);
286
286
  }
287
287
  .json {
288
- --link_color: var(--color_f_5);
288
+ --link_color: var(--color_f_50);
289
289
  }
290
290
  /* TODO extract */
291
291
  .declarations {
@@ -31,7 +31,7 @@
31
31
 
32
32
  <div class="library_summary">
33
33
  <!-- TODO maybe continue this snippet pattern, or maybe simplify? -->
34
- <header class="box">
34
+ <header class="box mb_lg">
35
35
  {#if repo_name}
36
36
  {@render repo_name(library.repo_name)}
37
37
  {:else}
@@ -55,10 +55,10 @@
55
55
  {#if motto}
56
56
  {@render motto(package_json.motto, package_json.glyph)}
57
57
  {:else}
58
- <blockquote class="px_xl">
58
+ <p class="panel py_md px_xl">
59
59
  {package_json.motto}
60
60
  {package_json.glyph}
61
- </blockquote>
61
+ </p>
62
62
  {/if}
63
63
  {/if}
64
64
  {#if package_json.description}
@@ -78,7 +78,7 @@
78
78
  {#if homepage_url}
79
79
  {@render homepage_url(library.homepage_url)}
80
80
  {:else}
81
- <div class="homepage_url">
81
+ <div class="mb_lg">
82
82
  <!-- eslint-disable svelte/no-navigation-without-resolve -->
83
83
  <a
84
84
  class="chip"
@@ -89,7 +89,7 @@
89
89
  </div>
90
90
  {/if}
91
91
  {/if}
92
- <div class="links">
92
+ <p class="display:flex gap_xs2">
93
93
  {#if library.repo_url}
94
94
  <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
95
95
  <a class="chip" href={library.repo_url}>repo</a>
@@ -102,12 +102,14 @@
102
102
  <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
103
103
  <a class="chip" href={library.npm_url}>npm</a>
104
104
  {/if}
105
- </div>
105
+ </p>
106
106
  {#if library.npm_url}
107
107
  {#if npm_url}
108
108
  {@render npm_url(library.npm_url)}
109
109
  {:else}
110
- <blockquote class="npm_url">npm i -D {package_json.name}</blockquote>
110
+ <p class="panel py_md px_xl font_family_mono text-align:center">
111
+ npm i -D {package_json.name}
112
+ </p>
111
113
  {/if}
112
114
  {/if}
113
115
  <!-- TODO more details behind a `<details>`, including author -->
@@ -123,16 +125,6 @@
123
125
  align-items: center;
124
126
  max-width: var(--max_width, var(--distance_sm));
125
127
  }
126
- header {
127
- margin-bottom: var(--space_lg);
128
- }
129
- .links {
130
- display: flex;
131
- margin-bottom: var(--space_lg);
132
- }
133
- .homepage_url {
134
- margin-bottom: var(--space_lg);
135
- }
136
128
  .repo_name {
137
129
  font-family: var(--font_family_serif);
138
130
  font-size: var(--font_size_xl2);
@@ -140,12 +132,4 @@
140
132
  text-align: center;
141
133
  margin-bottom: var(--space_lg);
142
134
  }
143
- .npm_url {
144
- font-family: var(--font_family_mono);
145
- text-align: center;
146
- }
147
- .chip {
148
- margin-left: var(--space_xs2);
149
- margin-right: var(--space_xs2);
150
- }
151
135
  </style>
@@ -1 +1 @@
1
- {"version":3,"file":"LibrarySummary.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibrarySummary.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAGpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAGhD,KAAK,gBAAgB,GAAI;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAyGH,QAAA,MAAM,cAAc,sDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"LibrarySummary.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibrarySummary.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAGpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAGhD,KAAK,gBAAgB,GAAI;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA2GH,QAAA,MAAM,cAAc,sDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
@@ -84,10 +84,10 @@
84
84
 
85
85
  {#snippet render_unregistered_tag(name: string, children: Array<MdzNode>)}
86
86
  {#if children.length > 0}
87
- <code class="color_c_5">&lt;{name}&gt;</code>{@render render_children(children)}<code
88
- class="color_c_5">&lt;/{name}&gt;</code
87
+ <code class="color_c_50">&lt;{name}&gt;</code>{@render render_children(children)}<code
88
+ class="color_c_50">&lt;/{name}&gt;</code
89
89
  >
90
90
  {:else}
91
- <code class="color_c_5">&lt;{name} /&gt;</code>
91
+ <code class="color_c_50">&lt;{name} /&gt;</code>
92
92
  {/if}
93
93
  {/snippet}
@@ -22,6 +22,8 @@
22
22
 
23
23
  const module = $derived(library.lookup_module(module_path));
24
24
 
25
+ const color_class = $derived(module_path.endsWith('.svelte') ? 'color_h' : '');
26
+
25
27
  const contextmenu_entries = $derived(module ? create_module_contextmenu(module) : undefined);
26
28
 
27
29
  // TODO @many support full https:// url variants - automatic detection? library prop?
@@ -31,7 +33,7 @@
31
33
  <!-- eslint-disable svelte/no-navigation-without-resolve -->
32
34
  <a
33
35
  {...rest}
34
- class="module_link {class_prop}"
36
+ class="module_link {class_prop} {color_class}"
35
37
  href={module.url_api + (hash ? ensure_start(hash, '#') : '')}
36
38
  {@attach contextmenu_attachment(contextmenu_entries)}
37
39
  >
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ModuleLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAOvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AA+CH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"ModuleLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ModuleLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAOvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAiDH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
@@ -24,14 +24,14 @@
24
24
  // TODO ideally this wouldn't duplicate metadata like descriptions, but adding fuz_gitops to this repo is heavy
25
25
  // prettier-ignore
26
26
  const project_items: Array<ProjectItem> = [
27
- {name: 'fuz_ui', url: 'https://ui.fuz.dev/', logo: logo_fuz_ui, description: 'Svelte UI library', glyph: '🧶', color_class: 'color_c_5'},
28
- {name: 'fuz_css', url: 'https://css.fuz.dev/', logo: logo_fuz_css, description: 'CSS framework and design system', glyph: '🌿', color_class: 'color_b_5'},
29
- {name: 'fuz_template', url: 'https://template.fuz.dev/', logo: logo_fuz_template, description: 'a static web app and Node library template with TypeScript, Svelte, SvelteKit, Vite, esbuild, Fuz, and Gro', glyph: '❄', color_class: 'color_h_5'},
30
- {name: 'fuz_code', url: 'https://code.fuz.dev/', logo: logo_fuz_code, description: 'syntax styling utilities and components for TypeScript, Svelte, SvelteKit', glyph: '🎨', color_class: 'color_g_5'},
31
- {name: 'fuz_blog', url: 'https://blog.fuz.dev/', logo: logo_fuz_blog, description: 'blog software from scratch with SvelteKit', glyph: '🖊️', color_class: 'color_e_5'},
32
- {name: 'fuz_mastodon', url: 'https://mastodon.fuz.dev/', logo: logo_fuz_mastodon, description: 'Mastodon components and helpers for Svelte, SvelteKit, and Fuz', glyph: '🦣', color_class: 'color_d_5'},
33
- {name: 'fuz_gitops', url: 'https://gitops.fuz.dev/', logo: logo_fuz_gitops, description: 'a tool for managing many repos', glyph: '🪄', color_class: 'color_a_5'},
34
- {name: 'fuz_util', url: 'https://util.fuz.dev/', logo: logo_fuz_util, description: 'utility belt for JS', glyph: '🦕', color_class: 'color_f_5'},
27
+ {name: 'fuz_ui', url: 'https://ui.fuz.dev/', logo: logo_fuz_ui, description: 'Svelte UI library', glyph: '🧶', color_class: 'color_c_50'},
28
+ {name: 'fuz_css', url: 'https://css.fuz.dev/', logo: logo_fuz_css, description: 'CSS framework and design system', glyph: '🌿', color_class: 'color_b_50'},
29
+ {name: 'fuz_template', url: 'https://template.fuz.dev/', logo: logo_fuz_template, description: 'a static web app and Node library template with TypeScript, Svelte, SvelteKit, Vite, esbuild, Fuz, and Gro', glyph: '❄', color_class: 'color_h_50'},
30
+ {name: 'fuz_code', url: 'https://code.fuz.dev/', logo: logo_fuz_code, description: 'syntax styling utilities and components for TypeScript, Svelte, SvelteKit', glyph: '🎨', color_class: 'color_g_50'},
31
+ {name: 'fuz_blog', url: 'https://blog.fuz.dev/', logo: logo_fuz_blog, description: 'blog software from scratch with SvelteKit', glyph: '🖊️', color_class: 'color_e_50'},
32
+ {name: 'fuz_mastodon', url: 'https://mastodon.fuz.dev/', logo: logo_fuz_mastodon, description: 'Mastodon components and helpers for Svelte, SvelteKit, and Fuz', glyph: '🦣', color_class: 'color_d_50'},
33
+ {name: 'fuz_gitops', url: 'https://gitops.fuz.dev/', logo: logo_fuz_gitops, description: 'a tool for managing many repos', glyph: '🪄', color_class: 'color_a_50'},
34
+ {name: 'fuz_util', url: 'https://util.fuz.dev/', logo: logo_fuz_util, description: 'utility belt for JS', glyph: '🦕', color_class: 'color_f_50'},
35
35
  ];
36
36
  </script>
37
37
 
@@ -44,11 +44,11 @@
44
44
 
45
45
  {#snippet package_thumbnail(project_item: ProjectItem)}
46
46
  <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
47
- <a class="thumbnail row bg px_md py_xs border_radius_sm mb_lg" href={project_item.url}
47
+ <a class="thumbnail row shade_00 px_md py_xs border_radius_sm mb_lg" href={project_item.url}
48
48
  ><Svg shrink={false} data={project_item.logo} size="var(--icon_size_lg)" />
49
49
  <div class="pl_lg width_atmost_sm">
50
50
  <div class="thumbnail_name {project_item.color_class}">{project_item.name}</div>
51
- <div class="thumbnail_description font_size_md text_color_3 font-weight:500">
51
+ <div class="thumbnail_description font_size_md text_70 font-weight:500">
52
52
  {project_item.description}
53
53
  {project_item.glyph}
54
54
  </div>
@@ -59,11 +59,19 @@
59
59
  <style>
60
60
  .thumbnail {
61
61
  box-shadow: var(--shadow_bottom_xs)
62
- color-mix(in hsl, var(--shadow_color) var(--shadow_alpha_1), transparent);
62
+ color-mix(
63
+ in hsl,
64
+ var(--shadow_color, var(--shadow_color_umbra)) var(--shadow_alpha_30),
65
+ transparent
66
+ );
63
67
  }
64
68
  .thumbnail:hover {
65
69
  box-shadow: var(--shadow_bottom_sm)
66
- color-mix(in hsl, var(--shadow_color) var(--shadow_alpha_1), transparent);
70
+ color-mix(
71
+ in hsl,
72
+ var(--shadow_color, var(--shadow_color_umbra)) var(--shadow_alpha_30),
73
+ transparent
74
+ );
67
75
 
68
76
  /* show the underline only on the name, not the description */
69
77
  text-decoration: none;
@@ -76,6 +84,10 @@
76
84
  }
77
85
  .thumbnail:active {
78
86
  box-shadow: var(--shadow_top_xs)
79
- color-mix(in hsl, var(--shadow_color) var(--shadow_alpha_1), transparent);
87
+ color-mix(
88
+ in hsl,
89
+ var(--shadow_color, var(--shadow_color_umbra)) var(--shadow_alpha_30),
90
+ transparent
91
+ );
80
92
  }
81
93
  </style>
@@ -14,16 +14,16 @@
14
14
 
15
15
  const {
16
16
  spiders = [
17
- 'var(--color_a_5)',
18
- 'var(--color_b_5)',
19
- 'var(--color_c_5)',
20
- 'var(--color_d_5)',
21
- 'var(--color_e_5)',
22
- 'var(--color_f_5)',
23
- 'var(--color_g_5)',
24
- 'var(--color_h_5)',
25
- 'var(--color_i_5)',
26
- 'var(--color_j_5)',
17
+ 'var(--color_a_50)',
18
+ 'var(--color_b_50)',
19
+ 'var(--color_c_50)',
20
+ 'var(--color_d_50)',
21
+ 'var(--color_e_50)',
22
+ 'var(--color_f_50)',
23
+ 'var(--color_g_50)',
24
+ 'var(--color_h_50)',
25
+ 'var(--color_i_50)',
26
+ 'var(--color_j_50)',
27
27
  ],
28
28
  seed = minute_of_day(),
29
29
  random = create_random_alea(seed),
@@ -0,0 +1,44 @@
1
+ <script lang="ts">
2
+ import type {SvelteHTMLElements} from 'svelte/elements';
3
+ import {default_variables} from '@fuzdev/fuz_css/variables.js';
4
+
5
+ import {selected_variable_context} from './style_variable_helpers.svelte.js';
6
+
7
+ const {
8
+ name,
9
+ inline = false,
10
+ plain = true,
11
+ children,
12
+ ...rest
13
+ }: SvelteHTMLElements['button'] & {
14
+ name: string; // TODO type? generate from `tomes`? or keep extensible?
15
+ inline?: boolean;
16
+ plain?: boolean;
17
+ } = $props();
18
+
19
+ // TODO add contextmenu behavior
20
+
21
+ const variable = $derived.by(() => {
22
+ const v = default_variables.find((v) => v.name === name);
23
+ if (!v) throw new Error(`cannot find variable named "${name}"`);
24
+ return v;
25
+ });
26
+
27
+ const selected_variable = selected_variable_context.get();
28
+ </script>
29
+
30
+ <button
31
+ type="button"
32
+ {...rest}
33
+ class:inline
34
+ class:plain
35
+ onclick={() => (selected_variable.value = variable)}
36
+ >{#if children}{@render children()}{:else}<span class="font_family_mono">{name}</span
37
+ >{/if}</button
38
+ >
39
+
40
+ <style>
41
+ button {
42
+ min-height: var(--input_height_sm);
43
+ }
44
+ </style>
@@ -0,0 +1,10 @@
1
+ import type { SvelteHTMLElements } from 'svelte/elements';
2
+ type $$ComponentProps = SvelteHTMLElements['button'] & {
3
+ name: string;
4
+ inline?: boolean;
5
+ plain?: boolean;
6
+ };
7
+ declare const StyleVariableButton: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type StyleVariableButton = ReturnType<typeof StyleVariableButton>;
9
+ export default StyleVariableButton;
10
+ //# sourceMappingURL=StyleVariableButton.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StyleVariableButton.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/StyleVariableButton.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAgCH,QAAA,MAAM,mBAAmB,sDAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
package/dist/Svg.svelte CHANGED
@@ -100,7 +100,6 @@
100
100
  .inline {
101
101
  display: inline-block;
102
102
  position: relative;
103
- /* TODO idk about this, but vertical align doesnt seem quite right either */
104
- top: 0.1em;
103
+ vertical-align: middle;
105
104
  }
106
105
  </style>
@@ -39,9 +39,14 @@
39
39
  // Provide own section ID to direct children (header) via context
40
40
  section_id_context.set(section_id);
41
41
 
42
- let fragment: string;
42
+ let fragment: string | undefined;
43
43
 
44
44
  register_section_header_context.set((f) => {
45
+ if (DEV && fragment !== undefined) {
46
+ throw Error(
47
+ `TomeSection already has header "${fragment}", cannot add "${f}". Did you forget to wrap a TomeSectionHeader in its own TomeSection?`,
48
+ );
49
+ }
45
50
  fragment = f;
46
51
  return parent_section_id; // Return parent section ID to header
47
52
  });
@@ -1 +1 @@
1
- {"version":3,"file":"TomeSection.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeSection.svelte"],"names":[],"mappings":"AAKC,MAAM,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;AAC7E,eAAO,MAAM,+BAA+B;;;;CAA0C,CAAC;AACvF,eAAO,MAAM,qBAAqB;;;CAA0B,CAAC;AAC7D,eAAO,MAAM,kBAAkB;;;;CAAuC,CAAC;AAGxE,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAMvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,SAAS,CAAC,GAAG;IACxD,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAyDH,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"TomeSection.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeSection.svelte"],"names":[],"mappings":"AAKC,MAAM,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;AAC7E,eAAO,MAAM,+BAA+B;;;;CAA0C,CAAC;AACvF,eAAO,MAAM,qBAAqB;;;CAA0B,CAAC;AAC7D,eAAO,MAAM,kBAAkB;;;;CAAuC,CAAC;AAGxE,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAMvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,SAAS,CAAC,GAAG;IACxD,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA8DH,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
package/dist/alert.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // TODO move to module context?
2
2
  export const alert_status_options = {
3
- inform: { color: 'var(--text_color_3)', icon: '✻' },
4
- help: { color: 'var(--color_b_5)', icon: '➺' },
5
- error: { color: 'var(--color_c_5)', icon: '!?' },
3
+ inform: { color: 'var(--text_70)', icon: '✻' },
4
+ help: { color: 'var(--color_b_50)', icon: '➺' },
5
+ error: { color: 'var(--color_c_50)', icon: '!?' },
6
6
  };
@@ -1,14 +1,26 @@
1
1
  import type { Declaration } from './declaration.svelte.js';
2
2
  import type { Library } from './library.svelte.js';
3
+ import type { Module } from './module.svelte.js';
3
4
  export interface DeclarationSearchState {
4
5
  query: string;
5
6
  all: Array<Declaration>;
6
7
  filtered: Array<Declaration>;
7
8
  }
9
+ export interface ApiSearchState {
10
+ query: string;
11
+ modules: {
12
+ all: Array<Module>;
13
+ filtered: Array<Module>;
14
+ };
15
+ declarations: {
16
+ all: Array<Declaration>;
17
+ filtered: Array<Declaration>;
18
+ };
19
+ }
8
20
  /**
9
- * Creates search state for the API index page (all declarations across all modules).
21
+ * Creates unified search state for the API index page (modules and declarations).
10
22
  */
11
- export declare const create_declaration_search: (library: Library) => DeclarationSearchState;
23
+ export declare const create_api_search: (library: Library) => ApiSearchState;
12
24
  /**
13
25
  * Creates search state for module-specific declaration lists.
14
26
  */
@@ -1 +1 @@
1
- {"version":3,"file":"api_search.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/api_search.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAEjD,MAAM,WAAW,sBAAsB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,OAAO,KAAG,sBAwB5D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAC5C,cAAc,KAAK,CAAC,WAAW,CAAC,KAC9B,sBAyCF,CAAC"}
1
+ {"version":3,"file":"api_search.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/api_search.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAE/C,MAAM,WAAW,sBAAsB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QACR,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACnB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;KACxB,CAAC;IACF,YAAY,EAAE;QACb,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;QACxB,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;KAC7B,CAAC;CACF;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,OAAO,KAAG,cA8CpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAC5C,cAAc,KAAK,CAAC,WAAW,CAAC,KAC9B,sBAyCF,CAAC"}
@@ -1,11 +1,24 @@
1
1
  /**
2
- * Creates search state for the API index page (all declarations across all modules).
2
+ * Creates unified search state for the API index page (modules and declarations).
3
3
  */
4
- export const create_declaration_search = (library) => {
4
+ export const create_api_search = (library) => {
5
5
  let query = $state('');
6
- const all = $derived(library.declarations);
7
- const filtered = $derived.by(() => {
8
- const items = query.trim() ? library.search_declarations(query) : all;
6
+ // Module filtering
7
+ const all_modules = $derived(library.modules_sorted);
8
+ const filtered_modules = $derived.by(() => {
9
+ if (!query.trim())
10
+ return all_modules;
11
+ const terms = query.trim().toLowerCase().split(/\s+/);
12
+ return all_modules.filter((m) => {
13
+ const path_lower = m.path.toLowerCase();
14
+ const comment_lower = m.module_comment?.toLowerCase() ?? '';
15
+ return terms.every((term) => path_lower.includes(term) || comment_lower.includes(term));
16
+ });
17
+ });
18
+ // Declaration filtering
19
+ const all_declarations = $derived(library.declarations);
20
+ const filtered_declarations = $derived.by(() => {
21
+ const items = query.trim() ? library.search_declarations(query) : all_declarations;
9
22
  return items.sort((a, b) => a.name.localeCompare(b.name));
10
23
  });
11
24
  return {
@@ -15,11 +28,21 @@ export const create_declaration_search = (library) => {
15
28
  set query(v) {
16
29
  query = v;
17
30
  },
18
- get all() {
19
- return all;
31
+ modules: {
32
+ get all() {
33
+ return all_modules;
34
+ },
35
+ get filtered() {
36
+ return filtered_modules;
37
+ },
20
38
  },
21
- get filtered() {
22
- return filtered;
39
+ declarations: {
40
+ get all() {
41
+ return all_declarations;
42
+ },
43
+ get filtered() {
44
+ return filtered_declarations;
45
+ },
23
46
  },
24
47
  };
25
48
  };
@@ -12,7 +12,7 @@ export declare class Declaration {
12
12
  */
13
13
  module_path: string;
14
14
  name: string;
15
- kind: "function" | "class" | "type" | "json" | "variable" | "constructor" | "component" | "css";
15
+ kind: "function" | "class" | "type" | "constructor" | "json" | "variable" | "component" | "css";
16
16
  /**
17
17
  * GitHub source URL with line number.
18
18
  */
@@ -86,7 +86,7 @@ export declare class Library {
86
86
  declarations?: {
87
87
  [x: string]: unknown;
88
88
  name: string;
89
- kind: "function" | "class" | "type" | "json" | "variable" | "constructor" | "component" | "css";
89
+ kind: "function" | "class" | "type" | "constructor" | "json" | "variable" | "component" | "css";
90
90
  doc_comment?: string | undefined;
91
91
  type_signature?: string | undefined;
92
92
  modifiers?: string[] | undefined;
@@ -0,0 +1,10 @@
1
+ import type { StyleVariable } from '@fuzdev/fuz_css/variable.js';
2
+ export declare class SelectedStyleVariable {
3
+ value: StyleVariable | null;
4
+ constructor(initial?: StyleVariable | null);
5
+ }
6
+ export declare const selected_variable_context: {
7
+ get: () => SelectedStyleVariable;
8
+ set: (value?: SelectedStyleVariable | undefined) => SelectedStyleVariable;
9
+ };
10
+ //# sourceMappingURL=style_variable_helpers.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style_variable_helpers.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/style_variable_helpers.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAK/D,qBAAa,qBAAqB;IACjC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAa;gBAE5B,OAAO,GAAE,aAAa,GAAG,IAAW;CAGhD;AAED,eAAO,MAAM,yBAAyB;;;CAAwD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { create_context } from './context_helpers.js';
2
+ // TODO maybe change this to a generic wrapper class for any value?
3
+ export class SelectedStyleVariable {
4
+ value = $state();
5
+ constructor(initial = null) {
6
+ this.value = initial;
7
+ }
8
+ }
9
+ export const selected_variable_context = create_context(() => new SelectedStyleVariable(null));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_ui",
3
- "version": "0.179.0",
3
+ "version": "0.181.0",
4
4
  "description": "Svelte UI library",
5
5
  "motto": "friendly user zystem",
6
6
  "glyph": "🧶",
@@ -34,9 +34,9 @@
34
34
  "node": ">=22.15"
35
35
  },
36
36
  "peerDependencies": {
37
- "@fuzdev/fuz_code": ">=0.40.0",
38
- "@fuzdev/fuz_css": ">=0.44.1",
39
- "@fuzdev/fuz_util": ">=0.45.3",
37
+ "@fuzdev/fuz_code": ">=0.41.0",
38
+ "@fuzdev/fuz_css": ">=0.45.0",
39
+ "@fuzdev/fuz_util": ">=0.48.2",
40
40
  "@jridgewell/trace-mapping": "^0.3",
41
41
  "@ryanatkn/gro": ">=0.186.0",
42
42
  "@sveltejs/kit": "^2.47.3",
@@ -61,16 +61,16 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "@changesets/changelog-git": "^0.2.1",
64
- "@fuzdev/fuz_code": "^0.40.0",
65
- "@fuzdev/fuz_css": "^0.44.1",
66
- "@fuzdev/fuz_util": "^0.45.3",
64
+ "@fuzdev/fuz_code": "^0.41.0",
65
+ "@fuzdev/fuz_css": "^0.46.0",
66
+ "@fuzdev/fuz_util": "^0.48.3",
67
67
  "@jridgewell/trace-mapping": "^0.3.31",
68
68
  "@ryanatkn/eslint-config": "^0.9.0",
69
- "@ryanatkn/gro": "^0.186.0",
69
+ "@ryanatkn/gro": "^0.190.0",
70
70
  "@sveltejs/adapter-static": "^3.0.10",
71
- "@sveltejs/kit": "^2.49.1",
71
+ "@sveltejs/kit": "^2.50.1",
72
72
  "@sveltejs/package": "^2.5.7",
73
- "@sveltejs/vite-plugin-svelte": "^6.2.1",
73
+ "@sveltejs/vite-plugin-svelte": "^6.2.4",
74
74
  "@types/node": "^24.10.1",
75
75
  "@webref/css": "^8.2.0",
76
76
  "eslint": "^9.39.1",
@@ -79,8 +79,8 @@
79
79
  "jsdom": "^27.2.0",
80
80
  "prettier": "^3.7.4",
81
81
  "prettier-plugin-svelte": "^3.4.1",
82
- "svelte": "^5.46.1",
83
- "svelte-check": "^4.3.5",
82
+ "svelte": "^5.49.1",
83
+ "svelte-check": "^4.3.6",
84
84
  "svelte2tsx": "^0.7.46",
85
85
  "tslib": "^2.8.1",
86
86
  "typescript": "^5.9.3",
package/src/lib/alert.ts CHANGED
@@ -8,7 +8,7 @@ export interface AlertStatusOptions {
8
8
  }
9
9
 
10
10
  export const alert_status_options: Record<AlertStatus, AlertStatusOptions> = {
11
- inform: {color: 'var(--text_color_3)', icon: '✻'},
12
- help: {color: 'var(--color_b_5)', icon: '➺'},
13
- error: {color: 'var(--color_c_5)', icon: '!?'},
11
+ inform: {color: 'var(--text_70)', icon: '✻'},
12
+ help: {color: 'var(--color_b_50)', icon: '➺'},
13
+ error: {color: 'var(--color_c_50)', icon: '!?'},
14
14
  };
@@ -1,5 +1,6 @@
1
1
  import type {Declaration} from './declaration.svelte.js';
2
2
  import type {Library} from './library.svelte.js';
3
+ import type {Module} from './module.svelte.js';
3
4
 
4
5
  export interface DeclarationSearchState {
5
6
  query: string;
@@ -7,16 +8,40 @@ export interface DeclarationSearchState {
7
8
  filtered: Array<Declaration>;
8
9
  }
9
10
 
11
+ export interface ApiSearchState {
12
+ query: string;
13
+ modules: {
14
+ all: Array<Module>;
15
+ filtered: Array<Module>;
16
+ };
17
+ declarations: {
18
+ all: Array<Declaration>;
19
+ filtered: Array<Declaration>;
20
+ };
21
+ }
22
+
10
23
  /**
11
- * Creates search state for the API index page (all declarations across all modules).
24
+ * Creates unified search state for the API index page (modules and declarations).
12
25
  */
13
- export const create_declaration_search = (library: Library): DeclarationSearchState => {
26
+ export const create_api_search = (library: Library): ApiSearchState => {
14
27
  let query = $state('');
15
28
 
16
- const all = $derived(library.declarations);
29
+ // Module filtering
30
+ const all_modules = $derived(library.modules_sorted);
31
+ const filtered_modules = $derived.by(() => {
32
+ if (!query.trim()) return all_modules;
33
+ const terms = query.trim().toLowerCase().split(/\s+/);
34
+ return all_modules.filter((m) => {
35
+ const path_lower = m.path.toLowerCase();
36
+ const comment_lower = m.module_comment?.toLowerCase() ?? '';
37
+ return terms.every((term) => path_lower.includes(term) || comment_lower.includes(term));
38
+ });
39
+ });
17
40
 
18
- const filtered = $derived.by(() => {
19
- const items = query.trim() ? library.search_declarations(query) : all;
41
+ // Declaration filtering
42
+ const all_declarations = $derived(library.declarations);
43
+ const filtered_declarations = $derived.by(() => {
44
+ const items = query.trim() ? library.search_declarations(query) : all_declarations;
20
45
  return items.sort((a, b) => a.name.localeCompare(b.name));
21
46
  });
22
47
 
@@ -27,11 +52,21 @@ export const create_declaration_search = (library: Library): DeclarationSearchSt
27
52
  set query(v: string) {
28
53
  query = v;
29
54
  },
30
- get all() {
31
- return all;
55
+ modules: {
56
+ get all() {
57
+ return all_modules;
58
+ },
59
+ get filtered() {
60
+ return filtered_modules;
61
+ },
32
62
  },
33
- get filtered() {
34
- return filtered;
63
+ declarations: {
64
+ get all() {
65
+ return all_declarations;
66
+ },
67
+ get filtered() {
68
+ return filtered_declarations;
69
+ },
35
70
  },
36
71
  };
37
72
  };
@@ -0,0 +1,14 @@
1
+ import type {StyleVariable} from '@fuzdev/fuz_css/variable.js';
2
+
3
+ import {create_context} from './context_helpers.js';
4
+
5
+ // TODO maybe change this to a generic wrapper class for any value?
6
+ export class SelectedStyleVariable {
7
+ value: StyleVariable | null = $state()!;
8
+
9
+ constructor(initial: StyleVariable | null = null) {
10
+ this.value = initial;
11
+ }
12
+ }
13
+
14
+ export const selected_variable_context = create_context(() => new SelectedStyleVariable(null));
@@ -1,34 +0,0 @@
1
- <script lang="ts">
2
- import {page} from '$app/state';
3
- import type {SvelteHTMLElements} from 'svelte/elements';
4
-
5
- import DocsList from './DocsList.svelte';
6
- import {library_context} from './library.svelte.js';
7
-
8
- const {
9
- expand_width = false,
10
- ...rest
11
- }: SvelteHTMLElements['div'] & {
12
- expand_width?: boolean;
13
- } = $props();
14
-
15
- const library = library_context.get();
16
- </script>
17
-
18
- <DocsList {...rest} {expand_width} class="modules_list">
19
- <h4 class="mb_sm">modules</h4>
20
- <ul class="unstyled">
21
- {#each library.modules_sorted as module (module.path)}
22
- <li>
23
- <!-- eslint-disable svelte/no-navigation-without-resolve -->
24
- <a
25
- class="menu_item"
26
- href={module.url_api}
27
- class:selected={module.url_api === page.url.pathname}
28
- >
29
- <div class="ellipsis">{module.path}</div>
30
- </a>
31
- </li>
32
- {/each}
33
- </ul>
34
- </DocsList>
@@ -1,8 +0,0 @@
1
- import type { SvelteHTMLElements } from 'svelte/elements';
2
- type $$ComponentProps = SvelteHTMLElements['div'] & {
3
- expand_width?: boolean;
4
- };
5
- declare const DocsModulesList: import("svelte").Component<$$ComponentProps, {}, "">;
6
- type DocsModulesList = ReturnType<typeof DocsModulesList>;
7
- export default DocsModulesList;
8
- //# sourceMappingURL=DocsModulesList.svelte.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DocsModulesList.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsModulesList.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAgCH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}