sv5ui-plus 5.0.4 → 5.0.6
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/README.md +6 -6
- package/dist/adapters/notify.d.ts +1 -1
- package/dist/adapters/notify.js +18 -18
- package/dist/compat.d.ts +2 -2
- package/dist/compat.js +2 -2
- package/dist/components/BentoGrid/BentoCard.svelte +33 -33
- package/dist/components/BentoGrid/BentoCard.svelte.d.ts +1 -1
- package/dist/components/BentoGrid/BentoGrid.svelte +1 -1
- package/dist/components/BentoGrid/BentoGrid.svelte.d.ts +1 -1
- package/dist/components/BentoGrid/bento-grid.types.d.ts +2 -2
- package/dist/components/BentoGrid/bento-grid.variants.d.ts +1 -1
- package/dist/components/BentoGrid/bento-grid.variants.js +10 -10
- package/dist/components/BentoGrid/index.d.ts +4 -4
- package/dist/components/BentoGrid/index.js +4 -4
- package/dist/components/Chart/Chart.svelte +1 -1
- package/dist/components/Chart/Chart.svelte.d.ts +1 -1
- package/dist/components/Chart/chart.types.d.ts +3 -3
- package/dist/components/Chart/index.d.ts +2 -2
- package/dist/components/Chart/index.js +2 -2
- package/dist/components/Chat/ChatBubble.svelte +19 -19
- package/dist/components/Chat/ChatBubble.svelte.d.ts +1 -1
- package/dist/components/Chat/ChatInput.svelte +26 -27
- package/dist/components/Chat/ChatInput.svelte.d.ts +1 -1
- package/dist/components/Chat/ChatMessage.svelte +1 -1
- package/dist/components/Chat/ChatMessage.svelte.d.ts +1 -1
- package/dist/components/Chat/chat.types.d.ts +6 -6
- package/dist/components/Chat/chat.variants.d.ts +1 -1
- package/dist/components/Chat/chat.variants.js +29 -29
- package/dist/components/Chat/index.d.ts +5 -5
- package/dist/components/Chat/index.js +5 -5
- package/dist/components/CodeBlock/CodeBlock.svelte +15 -15
- package/dist/components/CodeBlock/CodeBlock.svelte.d.ts +1 -1
- package/dist/components/CodeBlock/code-block.types.d.ts +5 -5
- package/dist/components/CodeBlock/code-block.variants.d.ts +1 -1
- package/dist/components/CodeBlock/code-block.variants.js +40 -40
- package/dist/components/CodeBlock/index.d.ts +2 -2
- package/dist/components/CodeBlock/index.js +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.svelte +93 -97
- package/dist/components/ConfirmDialog/ConfirmDialog.svelte.d.ts +1 -1
- package/dist/components/ConfirmDialog/confirm.d.ts +1 -1
- package/dist/components/ConfirmDialog/confirm.js +9 -9
- package/dist/components/ConfirmDialog/confirm.types.d.ts +4 -4
- package/dist/components/ConfirmDialog/index.d.ts +4 -4
- package/dist/components/ConfirmDialog/index.js +2 -2
- package/dist/components/DatePickerField/DatePickerField.svelte +11 -11
- package/dist/components/DatePickerField/DatePickerField.svelte.d.ts +2 -2
- package/dist/components/DatePickerField/date-picker-field.types.d.ts +1 -1
- package/dist/components/DatePickerField/index.d.ts +2 -2
- package/dist/components/DatePickerField/index.js +1 -1
- package/dist/components/DateRangePickerField/DateRangePickerField.svelte +26 -26
- package/dist/components/DateRangePickerField/DateRangePickerField.svelte.d.ts +2 -2
- package/dist/components/DateRangePickerField/date-range-picker-field.types.d.ts +1 -1
- package/dist/components/DateRangePickerField/index.d.ts +2 -2
- package/dist/components/DateRangePickerField/index.js +1 -1
- package/dist/components/Fonts/Fonts.svelte +12 -12
- package/dist/components/Fonts/Fonts.svelte.d.ts +1 -1
- package/dist/components/Fonts/fonts.d.ts +1 -1
- package/dist/components/Fonts/fonts.js +42 -42
- package/dist/components/Fonts/fonts.types.d.ts +6 -6
- package/dist/components/Fonts/index.d.ts +3 -3
- package/dist/components/Fonts/index.js +2 -2
- package/dist/components/FormSelect/FormSelect.svelte +4 -4
- package/dist/components/FormSelect/FormSelect.svelte.d.ts +2 -2
- package/dist/components/FormSelect/form-select.types.d.ts +3 -3
- package/dist/components/FormSelect/index.d.ts +2 -2
- package/dist/components/FormSelect/index.js +1 -1
- package/dist/components/List/List.svelte +1 -1
- package/dist/components/List/List.svelte.d.ts +1 -1
- package/dist/components/List/ListItem.svelte +31 -39
- package/dist/components/List/ListItem.svelte.d.ts +1 -1
- package/dist/components/List/index.d.ts +4 -4
- package/dist/components/List/index.js +4 -4
- package/dist/components/List/list.types.d.ts +4 -4
- package/dist/components/List/list.variants.d.ts +1 -1
- package/dist/components/List/list.variants.js +22 -22
- package/dist/components/LocaleButton/LocaleButton.svelte +104 -108
- package/dist/components/LocaleButton/LocaleButton.svelte.d.ts +1 -1
- package/dist/components/LocaleButton/index.d.ts +2 -2
- package/dist/components/LocaleButton/index.js +1 -1
- package/dist/components/LocaleButton/locale-button.types.d.ts +12 -12
- package/dist/components/LocaleButton/locale-button.variants.d.ts +2 -2
- package/dist/components/LocaleButton/locale-button.variants.js +68 -68
- package/dist/components/Marquee/Marquee.svelte +34 -34
- package/dist/components/Marquee/Marquee.svelte.d.ts +1 -1
- package/dist/components/Marquee/index.d.ts +3 -3
- package/dist/components/Marquee/index.js +3 -3
- package/dist/components/Marquee/marquee.types.d.ts +4 -4
- package/dist/components/Marquee/marquee.variants.d.ts +1 -1
- package/dist/components/Marquee/marquee.variants.js +15 -15
- package/dist/components/NavigationMenu/NavigationMenu.svelte +366 -379
- package/dist/components/NavigationMenu/NavigationMenu.svelte.d.ts +1 -1
- package/dist/components/NavigationMenu/index.d.ts +2 -2
- package/dist/components/NavigationMenu/index.js +1 -1
- package/dist/components/NavigationMenu/navigation-menu.types.d.ts +17 -17
- package/dist/components/NavigationMenu/navigation-menu.variants.d.ts +1 -1
- package/dist/components/NavigationMenu/navigation-menu.variants.js +177 -177
- package/dist/components/NumberTicker/NumberTicker.svelte +1 -5
- package/dist/components/NumberTicker/NumberTicker.svelte.d.ts +1 -1
- package/dist/components/NumberTicker/index.d.ts +3 -3
- package/dist/components/NumberTicker/index.js +3 -3
- package/dist/components/NumberTicker/number-ticker.types.d.ts +1 -1
- package/dist/components/NumberTicker/number-ticker.variants.d.ts +1 -1
- package/dist/components/NumberTicker/number-ticker.variants.js +3 -3
- package/dist/components/PasswordInput/PasswordInput.svelte +58 -58
- package/dist/components/PasswordInput/PasswordInput.svelte.d.ts +1 -1
- package/dist/components/PasswordInput/index.d.ts +2 -2
- package/dist/components/PasswordInput/index.js +1 -1
- package/dist/components/PasswordInput/password-input.types.d.ts +9 -9
- package/dist/components/PasswordInput/password-input.variants.d.ts +2 -2
- package/dist/components/PasswordInput/password-input.variants.js +62 -62
- package/dist/components/Prose/Prose.svelte +5 -5
- package/dist/components/Prose/Prose.svelte.d.ts +1 -1
- package/dist/components/Prose/index.d.ts +3 -3
- package/dist/components/Prose/index.js +3 -3
- package/dist/components/Prose/prose.types.d.ts +4 -4
- package/dist/components/Prose/prose.variants.d.ts +1 -1
- package/dist/components/Prose/prose.variants.js +27 -27
- package/dist/components/{Resizable/Resizable.svelte → ResizeContainer/ResizeContainer.svelte} +3 -3
- package/dist/components/ResizeContainer/ResizeContainer.svelte.d.ts +4 -0
- package/dist/components/ResizeContainer/index.d.ts +4 -0
- package/dist/components/ResizeContainer/index.js +4 -0
- package/dist/components/ResizeContainer/resize-container.types.d.ts +18 -0
- package/dist/components/ResizeContainer/resize-container.variants.d.ts +30 -0
- package/dist/components/ResizeContainer/resize-container.variants.js +17 -0
- package/dist/components/SafeTable/SafeTable.svelte +74 -74
- package/dist/components/SafeTable/SafeTable.svelte.d.ts +2 -2
- package/dist/components/SafeTable/index.d.ts +2 -2
- package/dist/components/SafeTable/index.js +1 -1
- package/dist/components/SafeTable/safe-table.types.d.ts +1 -1
- package/dist/components/Search/Search.svelte +63 -63
- package/dist/components/Search/Search.svelte.d.ts +1 -1
- package/dist/components/Search/index.d.ts +2 -2
- package/dist/components/Search/index.js +1 -1
- package/dist/components/Search/search.types.d.ts +5 -5
- package/dist/components/SortableGroup/SortableGroup.svelte +16 -10
- package/dist/components/SortableGroup/SortableGroup.svelte.d.ts +3 -3
- package/dist/components/SortableGroup/index.d.ts +1 -1
- package/dist/components/SortableGroup/index.js +1 -1
- package/dist/components/SortableList/SortableList.svelte +49 -46
- package/dist/components/SortableList/SortableList.svelte.d.ts +2 -2
- package/dist/components/SortableList/index.d.ts +2 -2
- package/dist/components/SortableList/index.js +1 -1
- package/dist/components/SortableList/sortable-list.types.d.ts +3 -3
- package/dist/components/Spotlight/Spotlight.svelte +13 -13
- package/dist/components/Spotlight/Spotlight.svelte.d.ts +1 -1
- package/dist/components/Spotlight/index.d.ts +3 -3
- package/dist/components/Spotlight/index.js +3 -3
- package/dist/components/Spotlight/spotlight.types.d.ts +2 -2
- package/dist/components/Spotlight/spotlight.variants.d.ts +1 -1
- package/dist/components/Spotlight/spotlight.variants.js +5 -5
- package/dist/components/TableBulkActionBar/TableBulkActionBar.svelte +23 -23
- package/dist/components/TableBulkActionBar/TableBulkActionBar.svelte.d.ts +1 -1
- package/dist/components/TableBulkActionBar/index.d.ts +2 -2
- package/dist/components/TableBulkActionBar/index.js +1 -1
- package/dist/components/TableBulkActionBar/table-bulk-action-bar.types.d.ts +3 -3
- package/dist/components/TableBulkActionBar/table-bulk-action-bar.variants.d.ts +1 -1
- package/dist/components/TableBulkActionBar/table-bulk-action-bar.variants.js +7 -7
- package/dist/components/TreeView/TreeView.svelte +59 -59
- package/dist/components/TreeView/TreeView.svelte.d.ts +1 -1
- package/dist/components/TreeView/index.d.ts +3 -3
- package/dist/components/TreeView/index.js +2 -2
- package/dist/components/TreeView/tree-view.types.d.ts +4 -4
- package/dist/components/TreeView/tree-view.variants.d.ts +1 -1
- package/dist/components/TreeView/tree-view.variants.js +19 -19
- package/dist/config.d.ts +1 -1
- package/dist/config.js +28 -28
- package/dist/editor.d.ts +1 -1
- package/dist/editor.js +1 -1
- package/dist/form/resolve-form-field-name.js +1 -1
- package/dist/hooks/internal/DragDropProviderScope.svelte +1 -1
- package/dist/hooks/internal/DragDropProviderScope.svelte.d.ts +1 -1
- package/dist/hooks/internal/SortableProvider.svelte +16 -11
- package/dist/hooks/internal/SortableProvider.svelte.d.ts +1 -1
- package/dist/hooks/internal/drag-drop-context.d.ts +1 -1
- package/dist/hooks/internal/drag-drop-context.js +1 -1
- package/dist/hooks/internal/sortable-context.d.ts +6 -6
- package/dist/hooks/internal/sortable-context.js +2 -2
- package/dist/hooks/useDragDrop/index.d.ts +1 -1
- package/dist/hooks/useDragDrop/index.js +1 -1
- package/dist/hooks/useDragDrop/useDragDrop.svelte.d.ts +3 -3
- package/dist/hooks/useDragDrop/useDragDrop.svelte.js +15 -15
- package/dist/hooks/useSortable/index.d.ts +2 -2
- package/dist/hooks/useSortable/index.js +2 -2
- package/dist/hooks/useSortable/useSortable.svelte.d.ts +4 -4
- package/dist/hooks/useSortable/useSortable.svelte.js +23 -23
- package/dist/hooks/utils.js +1 -1
- package/dist/index.d.ts +29 -31
- package/dist/index.js +28 -30
- package/dist/mcp/install-template.mjs +44 -44
- package/dist/mcp/server.mjs +262 -263
- package/dist/mcp/sv5ui-plus-docs.data.json +4 -10
- package/package.json +17 -14
- package/dist/components/ColorPicker/ColorPicker.svelte +0 -109
- package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +0 -4
- package/dist/components/ColorPicker/color-picker.types.d.ts +0 -26
- package/dist/components/ColorPicker/color-picker.variants.d.ts +0 -69
- package/dist/components/ColorPicker/color-picker.variants.js +0 -13
- package/dist/components/ColorPicker/index.d.ts +0 -4
- package/dist/components/ColorPicker/index.js +0 -4
- package/dist/components/Resizable/Resizable.svelte.d.ts +0 -4
- package/dist/components/Resizable/index.d.ts +0 -4
- package/dist/components/Resizable/index.js +0 -4
- package/dist/components/Resizable/resizable.types.d.ts +0 -18
- package/dist/components/Resizable/resizable.types.js +0 -1
- package/dist/components/Resizable/resizable.variants.d.ts +0 -48
- package/dist/components/Resizable/resizable.variants.js +0 -17
- package/dist/components/ScrollArea/ScrollArea.svelte +0 -54
- package/dist/components/ScrollArea/ScrollArea.svelte.d.ts +0 -4
- package/dist/components/ScrollArea/index.d.ts +0 -4
- package/dist/components/ScrollArea/index.js +0 -4
- package/dist/components/ScrollArea/scroll-area.types.d.ts +0 -27
- package/dist/components/ScrollArea/scroll-area.types.js +0 -1
- package/dist/components/ScrollArea/scroll-area.variants.d.ts +0 -45
- package/dist/components/ScrollArea/scroll-area.variants.js +0 -27
- /package/dist/components/{ColorPicker/color-picker.types.js → ResizeContainer/resize-container.types.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as DateRangePickerField } from
|
|
2
|
-
export type { DateRangePickerFieldProps } from
|
|
1
|
+
export { default as DateRangePickerField } from "./DateRangePickerField.svelte";
|
|
2
|
+
export type { DateRangePickerFieldProps } from "./date-range-picker-field.types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as DateRangePickerField } from
|
|
1
|
+
export { default as DateRangePickerField } from "./DateRangePickerField.svelte";
|
|
@@ -17,16 +17,16 @@ const hasFonts = $derived(href.length > 0 || inlineCss.length > 0);
|
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<svelte:head>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
{#if hasFonts}
|
|
21
|
+
{#if resolvedPreconnect && href}
|
|
22
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
23
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />
|
|
24
|
+
{/if}
|
|
25
|
+
{#if href}
|
|
26
|
+
<link rel="stylesheet" {href} />
|
|
27
|
+
{/if}
|
|
28
|
+
{#if inlineCss}
|
|
29
|
+
<svelte:element this={"style"}>{inlineCss}</svelte:element>
|
|
30
|
+
{/if}
|
|
31
|
+
{/if}
|
|
32
32
|
</svelte:head>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FontDefinition, GoogleFontDisplay, FontsConfig, FontsOptions } from
|
|
1
|
+
import type { FontDefinition, GoogleFontDisplay, FontsConfig, FontsOptions } from "./fonts.types.js";
|
|
2
2
|
export declare const defaultFontFamilies: FontDefinition[];
|
|
3
3
|
export declare const fontsDefaults: {
|
|
4
4
|
families: FontDefinition[];
|
|
@@ -2,31 +2,31 @@ const defaultSansFallback = "ui-sans-serif, system-ui, -apple-system, BlinkMacSy
|
|
|
2
2
|
const defaultMonoFallback = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace";
|
|
3
3
|
export const defaultFontFamilies = [
|
|
4
4
|
{
|
|
5
|
-
name:
|
|
6
|
-
variable:
|
|
7
|
-
weights: [400, 500, 600, 700]
|
|
5
|
+
name: "Inter",
|
|
6
|
+
variable: "--font-sans-family",
|
|
7
|
+
weights: [400, 500, 600, 700],
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
|
-
name:
|
|
11
|
-
variable:
|
|
12
|
-
weights: [400, 500, 600, 700]
|
|
10
|
+
name: "Inter",
|
|
11
|
+
variable: "--font-heading-family",
|
|
12
|
+
weights: [400, 500, 600, 700],
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
name:
|
|
16
|
-
variable:
|
|
17
|
-
weights: [400, 500, 700]
|
|
18
|
-
}
|
|
15
|
+
name: "JetBrains Mono",
|
|
16
|
+
variable: "--font-mono-family",
|
|
17
|
+
weights: [400, 500, 700],
|
|
18
|
+
},
|
|
19
19
|
];
|
|
20
20
|
export const fontsDefaults = {
|
|
21
21
|
families: defaultFontFamilies,
|
|
22
|
-
display:
|
|
23
|
-
preconnect: true
|
|
22
|
+
display: "swap",
|
|
23
|
+
preconnect: true,
|
|
24
24
|
};
|
|
25
25
|
function isLocalFont(font) {
|
|
26
|
-
return font.provider ===
|
|
26
|
+
return font.provider === "local";
|
|
27
27
|
}
|
|
28
28
|
function normalizeFontName(name) {
|
|
29
|
-
return name.trim().replace(/\s+/g,
|
|
29
|
+
return name.trim().replace(/\s+/g, " ");
|
|
30
30
|
}
|
|
31
31
|
function getFontWeights(weights) {
|
|
32
32
|
const normalized = (weights ?? [400]).filter((weight, index, source) => Number.isInteger(weight) &&
|
|
@@ -36,43 +36,43 @@ function getFontWeights(weights) {
|
|
|
36
36
|
return normalized.length > 0 ? [...normalized].sort((a, b) => a - b) : [400];
|
|
37
37
|
}
|
|
38
38
|
function getFontStyles(styles) {
|
|
39
|
-
const normalized = (styles ?? [
|
|
39
|
+
const normalized = (styles ?? ["normal"]).filter((style, index, source) => (style === "normal" || style === "italic") && source.indexOf(style) === index);
|
|
40
40
|
if (normalized.length === 0)
|
|
41
|
-
return [
|
|
42
|
-
if (normalized.includes(
|
|
43
|
-
return [
|
|
41
|
+
return ["normal"];
|
|
42
|
+
if (normalized.includes("normal") && normalized.includes("italic")) {
|
|
43
|
+
return ["normal", "italic"];
|
|
44
44
|
}
|
|
45
|
-
return normalized[0] ===
|
|
45
|
+
return normalized[0] === "italic" ? ["italic"] : ["normal"];
|
|
46
46
|
}
|
|
47
47
|
function encodeFamilyName(name) {
|
|
48
|
-
return normalizeFontName(name).replaceAll(
|
|
48
|
+
return normalizeFontName(name).replaceAll(" ", "+");
|
|
49
49
|
}
|
|
50
50
|
function escapeFontName(name) {
|
|
51
|
-
return name.replaceAll(
|
|
51
|
+
return name.replaceAll("\\", "\\\\").replaceAll("'", "\\'");
|
|
52
52
|
}
|
|
53
53
|
function getDefaultFallback(variable) {
|
|
54
|
-
return variable?.includes(
|
|
54
|
+
return variable?.includes("mono") ? defaultMonoFallback : defaultSansFallback;
|
|
55
55
|
}
|
|
56
56
|
function buildFamilyQuery(font) {
|
|
57
57
|
const name = encodeFamilyName(font.name);
|
|
58
58
|
const weights = getFontWeights(font.weights);
|
|
59
59
|
const styles = getFontStyles(font.styles);
|
|
60
|
-
if (styles.length === 1 && styles[0] ===
|
|
61
|
-
return `${name}:wght@${weights.join(
|
|
60
|
+
if (styles.length === 1 && styles[0] === "normal") {
|
|
61
|
+
return `${name}:wght@${weights.join(";")}`;
|
|
62
62
|
}
|
|
63
|
-
const pairs = styles.flatMap((style) => weights.map((weight) => `${style ===
|
|
64
|
-
return `${name}:ital,wght@${pairs.join(
|
|
63
|
+
const pairs = styles.flatMap((style) => weights.map((weight) => `${style === "italic" ? 1 : 0},${weight}`));
|
|
64
|
+
return `${name}:ital,wght@${pairs.join(";")}`;
|
|
65
65
|
}
|
|
66
|
-
export function buildGoogleFontsUrl(fonts, display =
|
|
66
|
+
export function buildGoogleFontsUrl(fonts, display = "swap") {
|
|
67
67
|
const families = fonts
|
|
68
68
|
.filter((font) => !isLocalFont(font))
|
|
69
69
|
.map((font) => buildFamilyQuery(font))
|
|
70
70
|
.filter((family, index, source) => family.length > 0 && source.indexOf(family) === index);
|
|
71
71
|
if (families.length === 0)
|
|
72
|
-
return
|
|
72
|
+
return "";
|
|
73
73
|
const familyParams = families
|
|
74
|
-
.map((f) => `family=${encodeURIComponent(f).replaceAll(
|
|
75
|
-
.join(
|
|
74
|
+
.map((f) => `family=${encodeURIComponent(f).replaceAll("%2B", "+")}`)
|
|
75
|
+
.join("&");
|
|
76
76
|
return `https://fonts.googleapis.com/css2?${familyParams}&display=${display}`;
|
|
77
77
|
}
|
|
78
78
|
export function buildFontFamily(font) {
|
|
@@ -83,31 +83,31 @@ function buildLocalFontSourceReference(source) {
|
|
|
83
83
|
const url = `url('${source.src.replaceAll("'", "\\'")}')`;
|
|
84
84
|
return source.format ? `${url} format('${source.format}')` : url;
|
|
85
85
|
}
|
|
86
|
-
export function buildLocalFontFaceCss(fonts, defaultDisplay =
|
|
86
|
+
export function buildLocalFontFaceCss(fonts, defaultDisplay = "swap") {
|
|
87
87
|
const declarations = fonts.filter(isLocalFont).flatMap((font) => font.sources.map((source) => {
|
|
88
88
|
const lines = [
|
|
89
|
-
|
|
89
|
+
"@font-face {",
|
|
90
90
|
` font-family: '${escapeFontName(normalizeFontName(font.name))}';`,
|
|
91
91
|
` src: ${buildLocalFontSourceReference(source)};`,
|
|
92
92
|
` font-display: ${font.display ?? defaultDisplay};`,
|
|
93
|
-
` font-style: ${source.style ??
|
|
94
|
-
` font-weight: ${source.weight ?? 400}
|
|
93
|
+
` font-style: ${source.style ?? "normal"};`,
|
|
94
|
+
` font-weight: ${source.weight ?? 400};`,
|
|
95
95
|
];
|
|
96
96
|
if (source.unicodeRange) {
|
|
97
97
|
lines.push(` unicode-range: ${source.unicodeRange};`);
|
|
98
98
|
}
|
|
99
|
-
lines.push(
|
|
100
|
-
return lines.join(
|
|
99
|
+
lines.push("}");
|
|
100
|
+
return lines.join("\n");
|
|
101
101
|
}));
|
|
102
|
-
return declarations.join(
|
|
102
|
+
return declarations.join("\n\n");
|
|
103
103
|
}
|
|
104
104
|
export function buildFontVariablesCss(fonts) {
|
|
105
105
|
const declarations = fonts
|
|
106
|
-
.filter((font) => typeof font.variable ===
|
|
106
|
+
.filter((font) => typeof font.variable === "string" && font.variable.length > 2)
|
|
107
107
|
.map((font) => ` ${font.variable}: ${buildFontFamily(font)};`);
|
|
108
108
|
if (declarations.length === 0)
|
|
109
|
-
return
|
|
110
|
-
return `:root {\n${declarations.join(
|
|
109
|
+
return "";
|
|
110
|
+
return `:root {\n${declarations.join("\n")}\n}`;
|
|
111
111
|
}
|
|
112
112
|
export function resolveFontsOptions(config) {
|
|
113
113
|
if (config === false)
|
|
@@ -115,11 +115,11 @@ export function resolveFontsOptions(config) {
|
|
|
115
115
|
if (config === true) {
|
|
116
116
|
return fontsDefaults;
|
|
117
117
|
}
|
|
118
|
-
if (config && typeof config ===
|
|
118
|
+
if (config && typeof config === "object") {
|
|
119
119
|
return {
|
|
120
120
|
families: config.families ?? fontsDefaults.families,
|
|
121
121
|
display: config.display ?? fontsDefaults.display,
|
|
122
|
-
preconnect: config.preconnect ?? fontsDefaults.preconnect
|
|
122
|
+
preconnect: config.preconnect ?? fontsDefaults.preconnect,
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
return fontsDefaults;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export type GoogleFontStyle =
|
|
2
|
-
export type GoogleFontDisplay =
|
|
3
|
-
export type FontProvider =
|
|
1
|
+
export type GoogleFontStyle = "normal" | "italic";
|
|
2
|
+
export type GoogleFontDisplay = "auto" | "block" | "swap" | "fallback" | "optional";
|
|
3
|
+
export type FontProvider = "google" | "local";
|
|
4
4
|
export type GoogleFontDefinition = {
|
|
5
|
-
provider?:
|
|
5
|
+
provider?: "google";
|
|
6
6
|
name: string;
|
|
7
7
|
weights?: number[];
|
|
8
8
|
styles?: GoogleFontStyle[];
|
|
9
9
|
variable?: `--${string}`;
|
|
10
10
|
fallback?: string;
|
|
11
11
|
};
|
|
12
|
-
export type LocalFontSourceFormat =
|
|
12
|
+
export type LocalFontSourceFormat = "woff2" | "woff" | "truetype" | "opentype" | "embedded-opentype" | "svg";
|
|
13
13
|
export type LocalFontSource = {
|
|
14
14
|
src: string;
|
|
15
15
|
format?: LocalFontSourceFormat;
|
|
@@ -18,7 +18,7 @@ export type LocalFontSource = {
|
|
|
18
18
|
unicodeRange?: string;
|
|
19
19
|
};
|
|
20
20
|
export type LocalFontDefinition = {
|
|
21
|
-
provider:
|
|
21
|
+
provider: "local";
|
|
22
22
|
name: string;
|
|
23
23
|
sources: LocalFontSource[];
|
|
24
24
|
variable?: `--${string}`;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as Fonts } from
|
|
2
|
-
export { buildFontFamily, buildFontVariablesCss, buildGoogleFontsUrl, buildLocalFontFaceCss, defaultFontFamilies, fontsDefaults, resolveFontsOptions } from
|
|
3
|
-
export type { FontDefinition, FontsConfig, FontsOptions, GoogleFontDefinition, GoogleFontDisplay, GoogleFontStyle, LocalFontDefinition, LocalFontSource, LocalFontSourceFormat, FontsProps, FontProvider } from
|
|
1
|
+
export { default as Fonts } from "./Fonts.svelte";
|
|
2
|
+
export { buildFontFamily, buildFontVariablesCss, buildGoogleFontsUrl, buildLocalFontFaceCss, defaultFontFamilies, fontsDefaults, resolveFontsOptions, } from "./fonts.js";
|
|
3
|
+
export type { FontDefinition, FontsConfig, FontsOptions, GoogleFontDefinition, GoogleFontDisplay, GoogleFontStyle, LocalFontDefinition, LocalFontSource, LocalFontSourceFormat, FontsProps, FontProvider, } from "./fonts.types.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Fonts } from
|
|
2
|
-
export { buildFontFamily, buildFontVariablesCss, buildGoogleFontsUrl, buildLocalFontFaceCss, defaultFontFamilies, fontsDefaults, resolveFontsOptions } from
|
|
1
|
+
export { default as Fonts } from "./Fonts.svelte";
|
|
2
|
+
export { buildFontFamily, buildFontVariablesCss, buildGoogleFontsUrl, buildLocalFontFaceCss, defaultFontFamilies, fontsDefaults, resolveFontsOptions, } from "./fonts.js";
|
|
@@ -9,9 +9,9 @@ let { name, value = $bindable(""), disabled = false, ...selectProps } = $props()
|
|
|
9
9
|
<Select {...selectProps} bind:value {disabled} />
|
|
10
10
|
|
|
11
11
|
{#if Array.isArray(value)}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
{#each value as item (item)}
|
|
13
|
+
<input type="hidden" {name} value={item} {disabled} />
|
|
14
|
+
{/each}
|
|
15
15
|
{:else}
|
|
16
|
-
|
|
16
|
+
<input type="hidden" {name} value={value ?? ""} {disabled} />
|
|
17
17
|
{/if}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { FormSelectProps as Props } from
|
|
2
|
-
import type { FormSelectProps } from
|
|
1
|
+
export type { FormSelectProps as Props } from "./form-select.types.js";
|
|
2
|
+
import type { FormSelectProps } from "./form-select.types.js";
|
|
3
3
|
declare const FormSelect: import("svelte").Component<FormSelectProps, {}, "value">;
|
|
4
4
|
type FormSelect = ReturnType<typeof FormSelect>;
|
|
5
5
|
export default FormSelect;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps } from
|
|
2
|
-
import type { Select } from
|
|
3
|
-
export type FormSelectProps = Omit<ComponentProps<typeof Select>,
|
|
1
|
+
import type { ComponentProps } from "svelte";
|
|
2
|
+
import type { Select } from "sv5ui";
|
|
3
|
+
export type FormSelectProps = Omit<ComponentProps<typeof Select>, "name"> & {
|
|
4
4
|
/** Native form field name (written to hidden inputs). */
|
|
5
5
|
name: string;
|
|
6
6
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as FormSelect } from
|
|
2
|
-
export type { FormSelectProps } from
|
|
1
|
+
export { default as FormSelect } from "./FormSelect.svelte";
|
|
2
|
+
export type { FormSelectProps } from "./form-select.types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as FormSelect } from
|
|
1
|
+
export { default as FormSelect } from "./FormSelect.svelte";
|
|
@@ -17,48 +17,40 @@ let styles = $derived(listVariants({
|
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
{#snippet contentWrapper()}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
{#if leading}
|
|
21
|
+
<div class={styles.leading()}>
|
|
22
|
+
{@render leading()}
|
|
23
|
+
</div>
|
|
24
|
+
{/if}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
<div class={styles.itemContent()}>
|
|
27
|
+
{#if children}
|
|
28
|
+
{@render children()}
|
|
29
|
+
{:else}
|
|
30
|
+
{#if title}
|
|
31
|
+
<div class={styles.itemTitle()}>{title}</div>
|
|
32
|
+
{/if}
|
|
33
|
+
{#if description}
|
|
34
|
+
<div class={styles.itemDescription()}>{description}</div>
|
|
35
|
+
{/if}
|
|
36
|
+
{/if}
|
|
37
|
+
</div>
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
{#if trailing}
|
|
40
|
+
<div class={styles.trailing()}>
|
|
41
|
+
{@render trailing()}
|
|
42
|
+
</div>
|
|
43
|
+
{/if}
|
|
44
44
|
{/snippet}
|
|
45
45
|
|
|
46
46
|
<li>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{:else}
|
|
57
|
-
<div
|
|
58
|
-
class={twMerge(styles.item(), className)}
|
|
59
|
-
{...restProps as any}
|
|
60
|
-
>
|
|
61
|
-
{@render contentWrapper()}
|
|
62
|
-
</div>
|
|
63
|
-
{/if}
|
|
47
|
+
{#if href}
|
|
48
|
+
<a {href} {target} class={twMerge(styles.item(), className)} {...restProps as any}>
|
|
49
|
+
{@render contentWrapper()}
|
|
50
|
+
</a>
|
|
51
|
+
{:else}
|
|
52
|
+
<div class={twMerge(styles.item(), className)} {...restProps as any}>
|
|
53
|
+
{@render contentWrapper()}
|
|
54
|
+
</div>
|
|
55
|
+
{/if}
|
|
64
56
|
</li>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import List from
|
|
2
|
-
import ListItem from
|
|
1
|
+
import List from "./List.svelte";
|
|
2
|
+
import ListItem from "./ListItem.svelte";
|
|
3
3
|
export { List, ListItem };
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
4
|
+
export * from "./list.types.js";
|
|
5
|
+
export * from "./list.variants.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import List from
|
|
2
|
-
import ListItem from
|
|
1
|
+
import List from "./List.svelte";
|
|
2
|
+
import ListItem from "./ListItem.svelte";
|
|
3
3
|
export { List, ListItem };
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
4
|
+
export * from "./list.types.js";
|
|
5
|
+
export * from "./list.variants.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Snippet } from
|
|
2
|
-
import type { HTMLAttributes, HTMLLiAttributes } from
|
|
3
|
-
import type { ListVariantProps } from
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes, HTMLLiAttributes } from "svelte/elements";
|
|
3
|
+
import type { ListVariantProps } from "./list.variants.js";
|
|
4
4
|
export interface ListProps extends HTMLAttributes<HTMLUListElement> {
|
|
5
5
|
/**
|
|
6
6
|
* The variant of the list.
|
|
7
7
|
* @default 'default'
|
|
8
8
|
*/
|
|
9
|
-
variant?: ListVariantProps[
|
|
9
|
+
variant?: ListVariantProps["variant"];
|
|
10
10
|
/**
|
|
11
11
|
* Additional CSS classes.
|
|
12
12
|
*/
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
2
|
export const listVariants = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base:
|
|
5
|
-
item:
|
|
6
|
-
itemContent:
|
|
7
|
-
itemTitle:
|
|
8
|
-
itemDescription:
|
|
9
|
-
leading:
|
|
10
|
-
trailing:
|
|
4
|
+
base: "flex flex-col w-full text-surface-900 dark:text-surface-50",
|
|
5
|
+
item: "flex items-center justify-between w-full px-4 py-3",
|
|
6
|
+
itemContent: "flex flex-col flex-1 min-w-0",
|
|
7
|
+
itemTitle: "text-sm font-medium truncate",
|
|
8
|
+
itemDescription: "text-xs text-surface-500 dark:text-surface-400 truncate mt-0.5",
|
|
9
|
+
leading: "mr-3 shrink-0 flex items-center justify-center",
|
|
10
|
+
trailing: "ml-3 shrink-0 flex items-center justify-center text-surface-500 dark:text-surface-400",
|
|
11
11
|
},
|
|
12
12
|
variants: {
|
|
13
13
|
variant: {
|
|
14
14
|
default: {
|
|
15
|
-
base:
|
|
15
|
+
base: "",
|
|
16
16
|
},
|
|
17
17
|
bordered: {
|
|
18
|
-
base:
|
|
19
|
-
item:
|
|
18
|
+
base: "border border-outline-variant rounded-lg overflow-hidden",
|
|
19
|
+
item: "border-b border-outline-variant last:border-b-0",
|
|
20
20
|
},
|
|
21
21
|
separated: {
|
|
22
|
-
base:
|
|
23
|
-
item:
|
|
24
|
-
}
|
|
22
|
+
base: "gap-2",
|
|
23
|
+
item: "rounded-lg border border-outline-variant",
|
|
24
|
+
},
|
|
25
25
|
},
|
|
26
26
|
interactive: {
|
|
27
27
|
true: {
|
|
28
|
-
item:
|
|
29
|
-
}
|
|
28
|
+
item: "transition-colors hover:bg-surface-100 dark:hover:bg-surface-800 cursor-pointer active:bg-surface-200 dark:active:bg-surface-700",
|
|
29
|
+
},
|
|
30
30
|
},
|
|
31
31
|
disabled: {
|
|
32
32
|
true: {
|
|
33
|
-
item:
|
|
34
|
-
}
|
|
35
|
-
}
|
|
33
|
+
item: "opacity-50 cursor-not-allowed hover:bg-transparent dark:hover:bg-transparent active:bg-transparent dark:active:bg-transparent",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
36
|
},
|
|
37
37
|
defaultVariants: {
|
|
38
|
-
variant:
|
|
38
|
+
variant: "default",
|
|
39
39
|
interactive: false,
|
|
40
|
-
disabled: false
|
|
41
|
-
}
|
|
40
|
+
disabled: false,
|
|
41
|
+
},
|
|
42
42
|
});
|