@fuzdev/fuz_ui 0.210.3 → 0.211.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.
- package/dist/Breadcrumb.svelte +11 -2
- package/dist/Breadcrumb.svelte.d.ts +6 -0
- package/dist/Breadcrumb.svelte.d.ts.map +1 -1
- package/dist/Docs.svelte +48 -7
- package/dist/Docs.svelte.d.ts +17 -0
- package/dist/Docs.svelte.d.ts.map +1 -1
- package/dist/DocsSecondaryNav.svelte +9 -0
- package/dist/DocsSecondaryNav.svelte.d.ts +5 -0
- package/dist/DocsSecondaryNav.svelte.d.ts.map +1 -1
- package/dist/HueInput.svelte +1 -11
- package/dist/HueInput.svelte.d.ts +1 -1
- package/dist/HueInput.svelte.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/Breadcrumb.svelte
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
const {
|
|
13
13
|
path,
|
|
14
14
|
selected_path,
|
|
15
|
+
root_path,
|
|
15
16
|
base_path,
|
|
16
17
|
separator,
|
|
17
18
|
children,
|
|
@@ -26,6 +27,12 @@
|
|
|
26
27
|
* `null` means none and `undefined` is detected from the current url.
|
|
27
28
|
*/
|
|
28
29
|
selected_path?: string | null | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Where the root link goes, prefixed with a slash and relative to the base path,
|
|
32
|
+
* e.g. `'/docs'` on a home page, where linking to the root would link to itself.
|
|
33
|
+
* Defaults to the root.
|
|
34
|
+
*/
|
|
35
|
+
root_path?: string;
|
|
29
36
|
/**
|
|
30
37
|
* Sets a custom base path of `path` and `selected_path`.
|
|
31
38
|
* Defaults to `base` from `$app/paths`.
|
|
@@ -53,7 +60,9 @@
|
|
|
53
60
|
|
|
54
61
|
const path_pieces = $derived(parse_path_pieces(final_path));
|
|
55
62
|
|
|
56
|
-
const
|
|
63
|
+
const root_href = $derived(
|
|
64
|
+
root_path === undefined ? ensure_end(final_base_path, '/') : final_base_path + root_path
|
|
65
|
+
);
|
|
57
66
|
|
|
58
67
|
// TODO animate these
|
|
59
68
|
// `transition:slide={{axis: 'x'}}`
|
|
@@ -61,7 +70,7 @@
|
|
|
61
70
|
|
|
62
71
|
<div {...rest} class="breadcrumb {rest.class}">
|
|
63
72
|
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
|
|
64
|
-
<a href={
|
|
73
|
+
<a href={root_href} class={{ selected: root_href === final_base_path + final_selected_path }}>
|
|
65
74
|
{#if children}
|
|
66
75
|
{@render children()}
|
|
67
76
|
{:else if icon_data}
|
|
@@ -10,6 +10,12 @@ type $$ComponentProps = SvelteHTMLElements['div'] & {
|
|
|
10
10
|
* `null` means none and `undefined` is detected from the current url.
|
|
11
11
|
*/
|
|
12
12
|
selected_path?: string | null | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Where the root link goes, prefixed with a slash and relative to the base path,
|
|
15
|
+
* e.g. `'/docs'` on a home page, where linking to the root would link to itself.
|
|
16
|
+
* Defaults to the root.
|
|
17
|
+
*/
|
|
18
|
+
root_path?: string;
|
|
13
19
|
/**
|
|
14
20
|
* Sets a custom base path of `path` and `selected_path`.
|
|
15
21
|
* Defaults to `base` from `$app/paths`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Breadcrumb.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAKzD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"Breadcrumb.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Breadcrumb.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAKzD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAuEH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
package/dist/Docs.svelte
CHANGED
|
@@ -18,9 +18,30 @@
|
|
|
18
18
|
|
|
19
19
|
const {
|
|
20
20
|
tomes,
|
|
21
|
+
primary_nav,
|
|
22
|
+
secondary_nav_header,
|
|
23
|
+
secondary_nav_footer,
|
|
24
|
+
footer,
|
|
21
25
|
children
|
|
22
26
|
}: {
|
|
23
27
|
tomes: Array<Tome>;
|
|
28
|
+
/**
|
|
29
|
+
* Rendered in the primary nav after the breadcrumb, at its end, e.g. links to the
|
|
30
|
+
* site's other sections.
|
|
31
|
+
*/
|
|
32
|
+
primary_nav?: Snippet;
|
|
33
|
+
/**
|
|
34
|
+
* Rendered above the tome menu in the secondary nav, in the sidebar and in the
|
|
35
|
+
* menu dialog of narrow screens, where the primary nav has little room.
|
|
36
|
+
*/
|
|
37
|
+
secondary_nav_header?: Snippet;
|
|
38
|
+
/** Rendered below the tome menu in the secondary nav, in the sidebar and in the menu dialog. */
|
|
39
|
+
secondary_nav_footer?: Snippet;
|
|
40
|
+
/**
|
|
41
|
+
* Replaces the default footer, a `DocsFooter` with the site's repo and a link to
|
|
42
|
+
* fuz.dev, e.g. for a site that isn't part of the Fuz stack.
|
|
43
|
+
*/
|
|
44
|
+
footer?: Snippet;
|
|
24
45
|
children: Snippet;
|
|
25
46
|
} = $props();
|
|
26
47
|
|
|
@@ -52,6 +73,11 @@
|
|
|
52
73
|
|
|
53
74
|
<div class="docs" style:--docs_menu_width={docs_menu_width}>
|
|
54
75
|
<DocsPrimaryNav>
|
|
76
|
+
{#if primary_nav}
|
|
77
|
+
<div class="primary-nav-end">
|
|
78
|
+
{@render primary_nav()}
|
|
79
|
+
</div>
|
|
80
|
+
{/if}
|
|
55
81
|
<div class="nav-dialog-toggle">
|
|
56
82
|
<button class="plain" type="button" onclick={() => toggle_secondary_nav_dialog()}>
|
|
57
83
|
menu
|
|
@@ -61,7 +87,7 @@
|
|
|
61
87
|
<!-- TODO @many dialog navs -->
|
|
62
88
|
{#if !innerWidth.current || innerWidth.current > SECONDARY_NAV_BREAKPOINT}
|
|
63
89
|
<div class="secondary-nav-wrapper">
|
|
64
|
-
<DocsSecondaryNav {tomes} />
|
|
90
|
+
<DocsSecondaryNav {tomes} header={secondary_nav_header} footer={secondary_nav_footer} />
|
|
65
91
|
</div>
|
|
66
92
|
{/if}
|
|
67
93
|
<main>
|
|
@@ -73,11 +99,15 @@
|
|
|
73
99
|
<DocsTertiaryNav {tomes} {tomes_by_slug} />
|
|
74
100
|
{/if}
|
|
75
101
|
<section class="box">
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
102
|
+
{#if footer}
|
|
103
|
+
{@render footer()}
|
|
104
|
+
{:else}
|
|
105
|
+
<DocsFooter repo_url={site.repo_url} root_url={FUZ_DEV_URL}>
|
|
106
|
+
<div class="mb_xl5">
|
|
107
|
+
<Breadcrumb />
|
|
108
|
+
</div>
|
|
109
|
+
</DocsFooter>
|
|
110
|
+
{/if}
|
|
81
111
|
</section>
|
|
82
112
|
</main>
|
|
83
113
|
</div>
|
|
@@ -94,7 +124,12 @@
|
|
|
94
124
|
<Breadcrumb />
|
|
95
125
|
</div>
|
|
96
126
|
<div class="px_lg pb_xl">
|
|
97
|
-
<DocsSecondaryNav
|
|
127
|
+
<DocsSecondaryNav
|
|
128
|
+
{tomes}
|
|
129
|
+
sidebar={false}
|
|
130
|
+
header={secondary_nav_header}
|
|
131
|
+
footer={secondary_nav_footer}
|
|
132
|
+
/>
|
|
98
133
|
<DocsTertiaryNav {tomes} {tomes_by_slug} sidebar={false} />
|
|
99
134
|
</div>
|
|
100
135
|
</div>
|
|
@@ -131,6 +166,12 @@
|
|
|
131
166
|
display: contents;
|
|
132
167
|
}
|
|
133
168
|
|
|
169
|
+
.primary-nav-end {
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
gap: var(--space_md);
|
|
173
|
+
padding: 0 var(--space_md);
|
|
174
|
+
}
|
|
134
175
|
.nav-dialog-toggle {
|
|
135
176
|
display: none;
|
|
136
177
|
}
|
package/dist/Docs.svelte.d.ts
CHANGED
|
@@ -2,6 +2,23 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import { Tome } from './tome.js';
|
|
3
3
|
type $$ComponentProps = {
|
|
4
4
|
tomes: Array<Tome>;
|
|
5
|
+
/**
|
|
6
|
+
* Rendered in the primary nav after the breadcrumb, at its end, e.g. links to the
|
|
7
|
+
* site's other sections.
|
|
8
|
+
*/
|
|
9
|
+
primary_nav?: Snippet;
|
|
10
|
+
/**
|
|
11
|
+
* Rendered above the tome menu in the secondary nav, in the sidebar and in the
|
|
12
|
+
* menu dialog of narrow screens, where the primary nav has little room.
|
|
13
|
+
*/
|
|
14
|
+
secondary_nav_header?: Snippet;
|
|
15
|
+
/** Rendered below the tome menu in the secondary nav, in the sidebar and in the menu dialog. */
|
|
16
|
+
secondary_nav_footer?: Snippet;
|
|
17
|
+
/**
|
|
18
|
+
* Replaces the default footer, a `DocsFooter` with the site's repo and a link to
|
|
19
|
+
* fuz.dev, e.g. for a site that isn't part of the Fuz stack.
|
|
20
|
+
*/
|
|
21
|
+
footer?: Snippet;
|
|
5
22
|
children: Snippet;
|
|
6
23
|
};
|
|
7
24
|
declare const Docs: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Docs.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Docs.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAMtC,OAAO,EAAE,IAAI,EAAiB,MAAM,WAAW,CAAC;AAW/C,KAAK,gBAAgB,GAAI;IACxB,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"Docs.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Docs.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAMtC,OAAO,EAAE,IAAI,EAAiB,MAAM,WAAW,CAAC;AAW/C,KAAK,gBAAgB,GAAI;IACxB,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,gGAAgG;IAChG,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAsHH,QAAA,MAAM,IAAI,sDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
3
4
|
|
|
4
5
|
import DocsMenu from './DocsMenu.svelte';
|
|
@@ -7,9 +8,15 @@
|
|
|
7
8
|
const {
|
|
8
9
|
tomes,
|
|
9
10
|
sidebar = true,
|
|
11
|
+
header,
|
|
12
|
+
footer,
|
|
10
13
|
...rest
|
|
11
14
|
}: SvelteHTMLElements['aside'] & {
|
|
12
15
|
tomes: Array<Tome>;
|
|
16
|
+
/** Rendered above the menu, e.g. links to the site's other sections. */
|
|
17
|
+
header?: Snippet;
|
|
18
|
+
/** Rendered below the menu. */
|
|
19
|
+
footer?: Snippet;
|
|
13
20
|
sidebar?: boolean; // TODO @many dialog navs (this shouldn't exist)
|
|
14
21
|
} = $props();
|
|
15
22
|
|
|
@@ -18,7 +25,9 @@
|
|
|
18
25
|
|
|
19
26
|
<aside {...rest} class={['docs-secondary-nav unstyled', rest.class, { sidebar }]}>
|
|
20
27
|
<nav aria-label="Secondary nav">
|
|
28
|
+
{@render header?.()}
|
|
21
29
|
<DocsMenu {tomes} {expand_width} />
|
|
30
|
+
{@render footer?.()}
|
|
22
31
|
</nav>
|
|
23
32
|
</aside>
|
|
24
33
|
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
2
3
|
import { Tome } from './tome.js';
|
|
3
4
|
type $$ComponentProps = SvelteHTMLElements['aside'] & {
|
|
4
5
|
tomes: Array<Tome>;
|
|
6
|
+
/** Rendered above the menu, e.g. links to the site's other sections. */
|
|
7
|
+
header?: Snippet;
|
|
8
|
+
/** Rendered below the menu. */
|
|
9
|
+
footer?: Snippet;
|
|
5
10
|
sidebar?: boolean;
|
|
6
11
|
};
|
|
7
12
|
declare const DocsSecondaryNav: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocsSecondaryNav.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsSecondaryNav.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEhC,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG;IACtD,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"DocsSecondaryNav.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsSecondaryNav.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEhC,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG;IACtD,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AA+BH,QAAA,MAAM,gBAAgB,sDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
package/dist/HueInput.svelte
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type
|
|
2
|
+
import { parse_hue, type Hue } from '@fuzdev/fuz_util/colors.ts';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
4
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
5
5
|
|
|
@@ -12,16 +12,6 @@
|
|
|
12
12
|
children?: Snippet;
|
|
13
13
|
} = $props();
|
|
14
14
|
|
|
15
|
-
// TODO probably upstream this to fuz_util
|
|
16
|
-
const parse_hue = (v: any): Hue | null => {
|
|
17
|
-
const t = typeof v;
|
|
18
|
-
if (t === 'number') return v;
|
|
19
|
-
if (t !== 'string') return null;
|
|
20
|
-
const parsed = Number(v);
|
|
21
|
-
if (Number.isNaN(parsed)) return null;
|
|
22
|
-
return parsed;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
15
|
const update_hue = (v: Hue) => {
|
|
26
16
|
value = v;
|
|
27
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HueInput.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/HueInput.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"HueInput.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/HueInput.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAmDH,QAAA,MAAM,QAAQ,2DAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.211.0",
|
|
4
4
|
"description": "Svelte UI library",
|
|
5
5
|
"tagline": "friendly user zystem",
|
|
6
6
|
"glyph": "🧶",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@fuzdev/fuz_code": ">=0.46.0",
|
|
37
37
|
"@fuzdev/fuz_css": ">=0.65.0",
|
|
38
|
-
"@fuzdev/fuz_util": ">=0.
|
|
38
|
+
"@fuzdev/fuz_util": ">=0.72.0",
|
|
39
39
|
"@fuzdev/gro": ">=0.204.0",
|
|
40
40
|
"@fuzdev/mdz": ">=0.2.0",
|
|
41
41
|
"@sveltejs/kit": "^2.47.3",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"@changesets/changelog-git": "^0.2.1",
|
|
65
65
|
"@fuzdev/blake3-wasm": "^0.2.0",
|
|
66
66
|
"@fuzdev/fuz_code": "^0.50.0",
|
|
67
|
-
"@fuzdev/fuz_css": "^0.
|
|
68
|
-
"@fuzdev/fuz_util": "^0.
|
|
67
|
+
"@fuzdev/fuz_css": "^0.66.0",
|
|
68
|
+
"@fuzdev/fuz_util": "^0.72.0",
|
|
69
69
|
"@fuzdev/gro": "^0.213.0",
|
|
70
70
|
"@fuzdev/mdz": "^0.3.0",
|
|
71
71
|
"@ryanatkn/eslint-config": "^0.12.2",
|