sv5ui-plus 5.0.4 → 5.0.5
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 +4 -4
- package/dist/components/PasswordInput/password-input.variants.d.ts +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/mcp/sv5ui-plus-docs.data.json +2 -2
- package/package.json +6 -6
- 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.types.js +0 -1
- 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/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/README.md
CHANGED
|
@@ -21,14 +21,14 @@ Import core UI from SV5UI and addons from SV5UI Plus:
|
|
|
21
21
|
```svelte
|
|
22
22
|
<script lang="ts">
|
|
23
23
|
import { Button, Icon } from 'sv5ui'
|
|
24
|
-
import {
|
|
24
|
+
import { ConfirmDialog, Search } from 'sv5ui-plus'
|
|
25
25
|
</script>
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
For an incremental migration from Svelora, `sv5ui-plus/compat` re-exports SV5UI together with SV5UI Plus addons:
|
|
29
29
|
|
|
30
30
|
```ts
|
|
31
|
-
import { Button,
|
|
31
|
+
import { Button, ConfirmDialog } from 'sv5ui-plus/compat'
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
New code should use the explicit `sv5ui` and `sv5ui-plus` imports.
|
|
@@ -36,8 +36,8 @@ New code should use the explicit `sv5ui` and `sv5ui-plus` imports.
|
|
|
36
36
|
## Addons
|
|
37
37
|
|
|
38
38
|
- Content and display: `BentoGrid`, `Chart`, `Chat`, `CodeBlock`, `Fonts`, `List`, `Marquee`, `NumberTicker`, `Prose`, `Spotlight`
|
|
39
|
-
- Forms and overlays: `
|
|
40
|
-
- Layout and data: `Resizable`, `
|
|
39
|
+
- Forms and overlays: `ConfirmDialog`, `LocaleButton`, `PasswordInput`, `Search`
|
|
40
|
+
- Layout and data: `Resizable`, `SafeTable`, `TableBulkActionBar`, `TreeView`
|
|
41
41
|
- Forms: `FormSelect`, `DatePickerField`, `DateRangePickerField`, `PasswordInput`
|
|
42
42
|
- Drag and drop: `SortableGroup`, `SortableList`, `useDragDrop`, `useSortable`
|
|
43
43
|
- SvelteKit adapter: `SvelteKitNavigationMenu`
|
|
@@ -265,7 +265,7 @@ export type PasswordInputVariantProps = VariantProps<typeof passwordInputVariant
|
|
|
265
265
|
export type PasswordInputSlots = keyof ReturnType<typeof passwordInputVariants>;
|
|
266
266
|
export declare const passwordInputDefaults: {
|
|
267
267
|
defaultVariants: {
|
|
268
|
-
color?: "primary" | "surface" | "error" | "
|
|
268
|
+
color?: "primary" | "surface" | "error" | "warning" | "info" | "success" | "secondary" | "tertiary" | undefined;
|
|
269
269
|
variant?: "none" | "outline" | "soft" | "subtle" | "ghost" | undefined;
|
|
270
270
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
271
271
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from './components/BentoGrid/index.js';
|
|
|
2
2
|
export * from './components/Chart/index.js';
|
|
3
3
|
export * from './components/Chat/index.js';
|
|
4
4
|
export * from './components/CodeBlock/index.js';
|
|
5
|
-
export * from './components/ColorPicker/index.js';
|
|
6
5
|
export * from './components/ConfirmDialog/index.js';
|
|
7
6
|
export * from './components/DatePickerField/index.js';
|
|
8
7
|
export * from './components/DateRangePickerField/index.js';
|
|
@@ -16,7 +15,6 @@ export * from './components/NumberTicker/index.js';
|
|
|
16
15
|
export * from './components/PasswordInput/index.js';
|
|
17
16
|
export * from './components/Prose/index.js';
|
|
18
17
|
export * from './components/Resizable/index.js';
|
|
19
|
-
export * from './components/ScrollArea/index.js';
|
|
20
18
|
export * from './components/Search/index.js';
|
|
21
19
|
export * from './components/SortableGroup/index.js';
|
|
22
20
|
export * from './components/SortableList/index.js';
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ export * from './components/BentoGrid/index.js';
|
|
|
3
3
|
export * from './components/Chart/index.js';
|
|
4
4
|
export * from './components/Chat/index.js';
|
|
5
5
|
export * from './components/CodeBlock/index.js';
|
|
6
|
-
export * from './components/ColorPicker/index.js';
|
|
7
6
|
export * from './components/ConfirmDialog/index.js';
|
|
8
7
|
export * from './components/DatePickerField/index.js';
|
|
9
8
|
export * from './components/DateRangePickerField/index.js';
|
|
@@ -17,7 +16,6 @@ export * from './components/NumberTicker/index.js';
|
|
|
17
16
|
export * from './components/PasswordInput/index.js';
|
|
18
17
|
export * from './components/Prose/index.js';
|
|
19
18
|
export * from './components/Resizable/index.js';
|
|
20
|
-
export * from './components/ScrollArea/index.js';
|
|
21
19
|
export * from './components/Search/index.js';
|
|
22
20
|
export * from './components/SortableGroup/index.js';
|
|
23
21
|
export * from './components/SortableList/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sv5ui-plus",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.5",
|
|
4
4
|
"description": "Community companion components and hooks for SV5UI and Svelte 5",
|
|
5
5
|
"packageManager": "bun@1.3.14",
|
|
6
6
|
"author": "asphum",
|
|
@@ -120,19 +120,19 @@
|
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
|
-
"@biomejs/biome": "2.5.
|
|
123
|
+
"@biomejs/biome": "2.5.10",
|
|
124
124
|
"@inlang/paraglide-js": "^2.24.1",
|
|
125
125
|
"@sveltejs/adapter-vercel": "^6.3.4",
|
|
126
126
|
"@sveltejs/kit": "^2.70.3",
|
|
127
127
|
"@sveltejs/package": "^2.5.8",
|
|
128
128
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
129
129
|
"@tailwindcss/vite": "^4.3.3",
|
|
130
|
-
"@types/node": "^26.
|
|
130
|
+
"@types/node": "^26.3.0",
|
|
131
131
|
"@vitest/browser-playwright": "^4.1.11",
|
|
132
132
|
"playwright": "^1.62.1",
|
|
133
133
|
"publint": "^0.3.24",
|
|
134
|
-
"sv5ui": "^2.
|
|
135
|
-
"svelte": "^5.56.
|
|
134
|
+
"sv5ui": "^2.6.1",
|
|
135
|
+
"svelte": "^5.56.10",
|
|
136
136
|
"svelte-check": "^4.7.6",
|
|
137
137
|
"tailwindcss": "^4.3.3",
|
|
138
138
|
"typescript": "6.0.3",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"@dnd-kit/svelte": "^0.5.0",
|
|
164
164
|
"@internationalized/date": "^3.12.3",
|
|
165
165
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
166
|
-
"apexcharts": "^
|
|
166
|
+
"apexcharts": "^7.0.0",
|
|
167
167
|
"bits-ui": "^2.19.0",
|
|
168
168
|
"shiki": "^4.4.3",
|
|
169
169
|
"tailwind-merge": "^3.6.0",
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
<script lang="ts">import { twMerge } from "tailwind-merge";
|
|
2
|
-
import { Popover } from "sv5ui";
|
|
3
|
-
import { Input } from "sv5ui";
|
|
4
|
-
import { Icon } from "sv5ui";
|
|
5
|
-
import { colorPickerVariants } from "./color-picker.variants.js";
|
|
6
|
-
let { value = $bindable("#000000"), placeholder = "Select color", swatches = [
|
|
7
|
-
"#ef4444",
|
|
8
|
-
"#f97316",
|
|
9
|
-
"#f59e0b",
|
|
10
|
-
"#eab308",
|
|
11
|
-
"#84cc16",
|
|
12
|
-
"#22c55e",
|
|
13
|
-
"#10b981",
|
|
14
|
-
"#14b8a6",
|
|
15
|
-
"#06b6d4",
|
|
16
|
-
"#0ea5e9",
|
|
17
|
-
"#3b82f6",
|
|
18
|
-
"#6366f1",
|
|
19
|
-
"#8b5cf6",
|
|
20
|
-
"#a855f7",
|
|
21
|
-
"#d946ef",
|
|
22
|
-
"#ec4899",
|
|
23
|
-
"#f43f5e",
|
|
24
|
-
"#ffffff",
|
|
25
|
-
"#94a3b8",
|
|
26
|
-
"#000000"
|
|
27
|
-
], disabled = false, class: className, ...restProps } = $props();
|
|
28
|
-
const styles = $derived(colorPickerVariants());
|
|
29
|
-
// Validate hex
|
|
30
|
-
let hexInput = $state(value);
|
|
31
|
-
$effect(() => {
|
|
32
|
-
hexInput = value;
|
|
33
|
-
});
|
|
34
|
-
function handleHexInput(e) {
|
|
35
|
-
const target = e.target;
|
|
36
|
-
let val = target.value;
|
|
37
|
-
if (!val.startsWith("#")) {
|
|
38
|
-
val = "#" + val;
|
|
39
|
-
}
|
|
40
|
-
hexInput = val;
|
|
41
|
-
// Basic hex validation regex (3, 4, 6, or 8 digits)
|
|
42
|
-
if (/^#([A-Fa-f0-9]{3,4}){1,2}$/.test(val)) {
|
|
43
|
-
value = val;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function setSwatch(swatch) {
|
|
47
|
-
value = swatch;
|
|
48
|
-
hexInput = swatch;
|
|
49
|
-
}
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<div class={twMerge(styles.base(), className)} {...restProps}>
|
|
53
|
-
<Popover>
|
|
54
|
-
{#snippet children({ open })}
|
|
55
|
-
<div
|
|
56
|
-
class={styles.trigger()}
|
|
57
|
-
aria-disabled={disabled}
|
|
58
|
-
>
|
|
59
|
-
<div
|
|
60
|
-
class={styles.colorIndicator()}
|
|
61
|
-
style="background-color: {value || '#000'};"
|
|
62
|
-
></div>
|
|
63
|
-
<span class="truncate flex-1 text-left text-on-surface">
|
|
64
|
-
{value || placeholder}
|
|
65
|
-
</span>
|
|
66
|
-
<Icon name="lucide:chevron-down" class="text-on-surface-variant w-4 h-4" />
|
|
67
|
-
</div>
|
|
68
|
-
{/snippet}
|
|
69
|
-
|
|
70
|
-
{#snippet content()}
|
|
71
|
-
<div class={styles.content()}>
|
|
72
|
-
<div class={styles.hexInputWrapper()}>
|
|
73
|
-
<span class="text-sm font-medium">Hex</span>
|
|
74
|
-
<Input
|
|
75
|
-
value={hexInput}
|
|
76
|
-
oninput={handleHexInput}
|
|
77
|
-
class="h-8 font-mono text-xs"
|
|
78
|
-
/>
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
<div class={styles.swatchGrid()}>
|
|
82
|
-
{#each swatches as swatch}
|
|
83
|
-
<button
|
|
84
|
-
type="button"
|
|
85
|
-
class={styles.swatch()}
|
|
86
|
-
style="background-color: {swatch};"
|
|
87
|
-
title={swatch}
|
|
88
|
-
aria-label={`Select color ${swatch}`}
|
|
89
|
-
onclick={() => setSwatch(swatch)}
|
|
90
|
-
></button>
|
|
91
|
-
{/each}
|
|
92
|
-
</div>
|
|
93
|
-
|
|
94
|
-
<div class="pt-2 border-t border-outline-variant flex flex-col gap-1">
|
|
95
|
-
<span class="text-xs text-on-surface-variant mb-1">Custom Color</span>
|
|
96
|
-
<!-- Native color picker wrapper -->
|
|
97
|
-
<label class="cursor-pointer relative overflow-hidden rounded-md border border-outline-variant w-full h-8 flex items-center justify-center bg-surface-container hover:bg-surface-container-high transition-colors">
|
|
98
|
-
<span class="text-xs font-medium z-10 pointer-events-none mix-blend-difference text-white">Pick Custom</span>
|
|
99
|
-
<input
|
|
100
|
-
type="color"
|
|
101
|
-
bind:value
|
|
102
|
-
class="absolute inset-0 opacity-0 w-full h-full cursor-pointer scale-150"
|
|
103
|
-
/>
|
|
104
|
-
</label>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
{/snippet}
|
|
108
|
-
</Popover>
|
|
109
|
-
</div>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
export interface ColorPickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'value'> {
|
|
3
|
-
/**
|
|
4
|
-
* The bound color value (Hex format).
|
|
5
|
-
* @default '#000000'
|
|
6
|
-
*/
|
|
7
|
-
value?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Placeholder text when no color is selected.
|
|
10
|
-
* @default 'Select color'
|
|
11
|
-
*/
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Array of predefined color swatches.
|
|
15
|
-
*/
|
|
16
|
-
swatches?: string[];
|
|
17
|
-
/**
|
|
18
|
-
* Whether the color picker is disabled.
|
|
19
|
-
* @default false
|
|
20
|
-
*/
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Additional CSS classes.
|
|
24
|
-
*/
|
|
25
|
-
class?: string;
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
-
export declare const colorPickerVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
-
[key: string]: {
|
|
4
|
-
[key: string]: import("tailwind-variants").ClassValue | {
|
|
5
|
-
base?: import("tailwind-variants").ClassValue;
|
|
6
|
-
trigger?: import("tailwind-variants").ClassValue;
|
|
7
|
-
colorIndicator?: import("tailwind-variants").ClassValue;
|
|
8
|
-
content?: import("tailwind-variants").ClassValue;
|
|
9
|
-
swatchGrid?: import("tailwind-variants").ClassValue;
|
|
10
|
-
swatch?: import("tailwind-variants").ClassValue;
|
|
11
|
-
nativeInput?: import("tailwind-variants").ClassValue;
|
|
12
|
-
hexInputWrapper?: import("tailwind-variants").ClassValue;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
} | {
|
|
16
|
-
[x: string]: {
|
|
17
|
-
[x: string]: import("tailwind-variants").ClassValue | {
|
|
18
|
-
base?: import("tailwind-variants").ClassValue;
|
|
19
|
-
trigger?: import("tailwind-variants").ClassValue;
|
|
20
|
-
colorIndicator?: import("tailwind-variants").ClassValue;
|
|
21
|
-
content?: import("tailwind-variants").ClassValue;
|
|
22
|
-
swatchGrid?: import("tailwind-variants").ClassValue;
|
|
23
|
-
swatch?: import("tailwind-variants").ClassValue;
|
|
24
|
-
nativeInput?: import("tailwind-variants").ClassValue;
|
|
25
|
-
hexInputWrapper?: import("tailwind-variants").ClassValue;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
} | {}, {
|
|
29
|
-
base: string;
|
|
30
|
-
trigger: string;
|
|
31
|
-
colorIndicator: string;
|
|
32
|
-
content: string;
|
|
33
|
-
swatchGrid: string;
|
|
34
|
-
swatch: string;
|
|
35
|
-
nativeInput: string;
|
|
36
|
-
hexInputWrapper: string;
|
|
37
|
-
}, undefined, {
|
|
38
|
-
[key: string]: {
|
|
39
|
-
[key: string]: import("tailwind-variants").ClassValue | {
|
|
40
|
-
base?: import("tailwind-variants").ClassValue;
|
|
41
|
-
trigger?: import("tailwind-variants").ClassValue;
|
|
42
|
-
colorIndicator?: import("tailwind-variants").ClassValue;
|
|
43
|
-
content?: import("tailwind-variants").ClassValue;
|
|
44
|
-
swatchGrid?: import("tailwind-variants").ClassValue;
|
|
45
|
-
swatch?: import("tailwind-variants").ClassValue;
|
|
46
|
-
nativeInput?: import("tailwind-variants").ClassValue;
|
|
47
|
-
hexInputWrapper?: import("tailwind-variants").ClassValue;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
} | {}, {
|
|
51
|
-
base: string;
|
|
52
|
-
trigger: string;
|
|
53
|
-
colorIndicator: string;
|
|
54
|
-
content: string;
|
|
55
|
-
swatchGrid: string;
|
|
56
|
-
swatch: string;
|
|
57
|
-
nativeInput: string;
|
|
58
|
-
hexInputWrapper: string;
|
|
59
|
-
}, import("tailwind-variants").TVReturnTypeLike<unknown, {
|
|
60
|
-
base: string;
|
|
61
|
-
trigger: string;
|
|
62
|
-
colorIndicator: string;
|
|
63
|
-
content: string;
|
|
64
|
-
swatchGrid: string;
|
|
65
|
-
swatch: string;
|
|
66
|
-
nativeInput: string;
|
|
67
|
-
hexInputWrapper: string;
|
|
68
|
-
}>>;
|
|
69
|
-
export type ColorPickerVariantProps = VariantProps<typeof colorPickerVariants>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { tv } from 'tailwind-variants';
|
|
2
|
-
export const colorPickerVariants = tv({
|
|
3
|
-
slots: {
|
|
4
|
-
base: 'relative inline-flex',
|
|
5
|
-
trigger: 'flex items-center gap-2 px-3 py-2 border border-outline-variant rounded-md bg-surface text-sm w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary',
|
|
6
|
-
colorIndicator: 'w-5 h-5 rounded border border-outline/50 shrink-0',
|
|
7
|
-
content: 'w-64 p-3 flex flex-col gap-3 bg-surface border border-outline-variant rounded-md shadow-md',
|
|
8
|
-
swatchGrid: 'grid grid-cols-6 gap-2',
|
|
9
|
-
swatch: 'w-6 h-6 rounded border border-outline/50 cursor-pointer hover:scale-110 transition-transform focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary',
|
|
10
|
-
nativeInput: 'w-full h-8 cursor-pointer rounded overflow-hidden',
|
|
11
|
-
hexInputWrapper: 'flex items-center gap-2'
|
|
12
|
-
}
|
|
13
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script lang="ts">import { twMerge } from "tailwind-merge";
|
|
2
|
-
import { scrollAreaVariants } from "./scroll-area.variants.js";
|
|
3
|
-
let { orientation = "vertical", hideScrollbar = false, class: className, viewportClass, children, ...restProps } = $props();
|
|
4
|
-
let styles = $derived(scrollAreaVariants({
|
|
5
|
-
orientation,
|
|
6
|
-
hideScrollbar
|
|
7
|
-
}));
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<div class={twMerge(styles.root(), className)} {...restProps}>
|
|
11
|
-
<div
|
|
12
|
-
class={twMerge(
|
|
13
|
-
styles.viewport(),
|
|
14
|
-
!hideScrollbar && 'sv5ui-plus-scrollbar',
|
|
15
|
-
viewportClass
|
|
16
|
-
)}
|
|
17
|
-
data-orientation={orientation}
|
|
18
|
-
>
|
|
19
|
-
{@render children?.()}
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<style>
|
|
24
|
-
/* Custom scrollbar styling for Webkit browsers */
|
|
25
|
-
:global(.sv5ui-plus-scrollbar::-webkit-scrollbar) {
|
|
26
|
-
width: 6px;
|
|
27
|
-
height: 6px;
|
|
28
|
-
}
|
|
29
|
-
:global(.sv5ui-plus-scrollbar::-webkit-scrollbar-track) {
|
|
30
|
-
background: transparent;
|
|
31
|
-
}
|
|
32
|
-
:global(.sv5ui-plus-scrollbar::-webkit-scrollbar-thumb) {
|
|
33
|
-
background-color: var(--color-outline-variant, rgba(156, 163, 175, 0.5));
|
|
34
|
-
border-radius: 9999px;
|
|
35
|
-
}
|
|
36
|
-
:global(.sv5ui-plus-scrollbar::-webkit-scrollbar-thumb:hover) {
|
|
37
|
-
background-color: var(--color-outline, rgba(107, 114, 128, 0.8));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/* Firefox support */
|
|
41
|
-
:global(.sv5ui-plus-scrollbar) {
|
|
42
|
-
scrollbar-width: thin;
|
|
43
|
-
scrollbar-color: var(--color-outline-variant, rgba(156, 163, 175, 0.5)) transparent;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* Hide scrollbar utility */
|
|
47
|
-
:global(.scrollbar-none::-webkit-scrollbar) {
|
|
48
|
-
display: none;
|
|
49
|
-
}
|
|
50
|
-
:global(.scrollbar-none) {
|
|
51
|
-
-ms-overflow-style: none; /* IE and Edge */
|
|
52
|
-
scrollbar-width: none; /* Firefox */
|
|
53
|
-
}
|
|
54
|
-
</style>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
import type { ScrollAreaVariantProps } from './scroll-area.variants.js';
|
|
4
|
-
export interface ScrollAreaProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
6
|
-
* Orientation of the scrolling area.
|
|
7
|
-
* @default 'vertical'
|
|
8
|
-
*/
|
|
9
|
-
orientation?: ScrollAreaVariantProps['orientation'];
|
|
10
|
-
/**
|
|
11
|
-
* Whether to hide the scrollbar track/thumb completely while still allowing scrolling.
|
|
12
|
-
* @default false
|
|
13
|
-
*/
|
|
14
|
-
hideScrollbar?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Additional CSS classes for the root container.
|
|
17
|
-
*/
|
|
18
|
-
class?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Additional CSS classes for the viewport (the scrollable area).
|
|
21
|
-
*/
|
|
22
|
-
viewportClass?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Content to be scrolled.
|
|
25
|
-
*/
|
|
26
|
-
children?: Snippet;
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
-
export declare const scrollAreaVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
-
orientation: {
|
|
4
|
-
vertical: "";
|
|
5
|
-
horizontal: "";
|
|
6
|
-
both: "";
|
|
7
|
-
};
|
|
8
|
-
hideScrollbar: {
|
|
9
|
-
true: {
|
|
10
|
-
viewport: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
}, {
|
|
14
|
-
root: string;
|
|
15
|
-
viewport: string;
|
|
16
|
-
}, undefined, {
|
|
17
|
-
orientation: {
|
|
18
|
-
vertical: "";
|
|
19
|
-
horizontal: "";
|
|
20
|
-
both: "";
|
|
21
|
-
};
|
|
22
|
-
hideScrollbar: {
|
|
23
|
-
true: {
|
|
24
|
-
viewport: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
}, {
|
|
28
|
-
root: string;
|
|
29
|
-
viewport: string;
|
|
30
|
-
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
31
|
-
orientation: {
|
|
32
|
-
vertical: "";
|
|
33
|
-
horizontal: "";
|
|
34
|
-
both: "";
|
|
35
|
-
};
|
|
36
|
-
hideScrollbar: {
|
|
37
|
-
true: {
|
|
38
|
-
viewport: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
}, {
|
|
42
|
-
root: string;
|
|
43
|
-
viewport: string;
|
|
44
|
-
}>>;
|
|
45
|
-
export type ScrollAreaVariantProps = VariantProps<typeof scrollAreaVariants>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { tv } from 'tailwind-variants';
|
|
2
|
-
export const scrollAreaVariants = tv({
|
|
3
|
-
slots: {
|
|
4
|
-
root: 'relative overflow-hidden',
|
|
5
|
-
viewport: 'h-full w-full rounded-[inherit] overflow-auto'
|
|
6
|
-
// Note: For actual custom scrollbars without a JS library, we can use
|
|
7
|
-
// global CSS webkit scrollbar styles or a plugin.
|
|
8
|
-
// Here we just define standard utility classes to hide or style them if Tailwind scrollbar plugin is used.
|
|
9
|
-
// We'll add a custom class `sv5ui-plus-scrollbar` to be styled in global css if needed.
|
|
10
|
-
},
|
|
11
|
-
variants: {
|
|
12
|
-
orientation: {
|
|
13
|
-
vertical: '',
|
|
14
|
-
horizontal: '',
|
|
15
|
-
both: ''
|
|
16
|
-
},
|
|
17
|
-
hideScrollbar: {
|
|
18
|
-
true: {
|
|
19
|
-
viewport: 'scrollbar-none' // Requires tailwind-scrollbar plugin or custom CSS
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
defaultVariants: {
|
|
24
|
-
orientation: 'vertical',
|
|
25
|
-
hideScrollbar: false
|
|
26
|
-
}
|
|
27
|
-
});
|