@r2digisolutions/ui 0.31.1 → 0.32.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/components/index.d.ts +3 -1
- package/dist/components/index.js +3 -1
- package/dist/components/ui/Dock/Dock.svelte +28 -0
- package/dist/components/ui/Dock/Dock.svelte.d.ts +10 -0
- package/dist/components/ui/Dock/DockItem.svelte +89 -0
- package/dist/components/ui/Dock/DockItem.svelte.d.ts +16 -0
- package/package.json +8 -8
|
@@ -25,4 +25,6 @@ export * from './ui/Dialog/index.js';
|
|
|
25
25
|
import Selector from './ui/Selector/Selector.svelte';
|
|
26
26
|
import SelectTile from './ui/SelectTile/SelectTile.svelte';
|
|
27
27
|
import MobileSheet from './ui/MobileSheet/MobileSheet.svelte';
|
|
28
|
-
|
|
28
|
+
import Dock from './ui/Dock/Dock.svelte';
|
|
29
|
+
import DockItem from './ui/Dock/DockItem.svelte';
|
|
30
|
+
export { Dock, DockItem, MobileSheet, SelectTile, Selector, Tag, NoContent, Alert, Avatar, Button, Badge, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Container, Checkbox, Field, Section, Loading, TableList, Heading, Label, Input, InputRadio, Textarea, };
|
package/dist/components/index.js
CHANGED
|
@@ -25,4 +25,6 @@ export * from './ui/Dialog/index.js';
|
|
|
25
25
|
import Selector from './ui/Selector/Selector.svelte';
|
|
26
26
|
import SelectTile from './ui/SelectTile/SelectTile.svelte';
|
|
27
27
|
import MobileSheet from './ui/MobileSheet/MobileSheet.svelte';
|
|
28
|
-
|
|
28
|
+
import Dock from './ui/Dock/Dock.svelte';
|
|
29
|
+
import DockItem from './ui/Dock/DockItem.svelte';
|
|
30
|
+
export { Dock, DockItem, MobileSheet, SelectTile, Selector, Tag, NoContent, Alert, Avatar, Button, Badge, Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, Container, Checkbox, Field, Section, Loading, TableList, Heading, Label, Input, InputRadio, Textarea, };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { ClassValue } from 'svelte/elements';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
class?: ClassValue;
|
|
7
|
+
size?: 'mini' | 'sm' | 'md';
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const { size = 'mini', children, ...props }: Props = $props();
|
|
12
|
+
|
|
13
|
+
const sizes: Record<NonNullable<Props['size']>, string> = {
|
|
14
|
+
mini: 'rounded-full p-0.5',
|
|
15
|
+
sm: 'rounded-full p-0.5',
|
|
16
|
+
md: 'rounded-2xl p-1'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const base = 'isolate inline-flex items-center overflow-hidden border backdrop-blur-md shadow-sm';
|
|
20
|
+
|
|
21
|
+
const theme =
|
|
22
|
+
'border-neutral-200/70 bg-neutral-50/70 shadow-black/5 ' +
|
|
23
|
+
'dark:border-neutral-800/70 dark:bg-neutral-950/40';
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<div class={[base, theme, sizes[size], props.class]}>
|
|
27
|
+
{@render children?.()}
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { ClassValue } from 'svelte/elements';
|
|
3
|
+
type Props = {
|
|
4
|
+
class?: ClassValue;
|
|
5
|
+
size?: 'mini' | 'sm' | 'md';
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
};
|
|
8
|
+
declare const Dock: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type Dock = ReturnType<typeof Dock>;
|
|
10
|
+
export default Dock;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { ClassValue } from 'svelte/elements';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
as?: 'button' | 'a';
|
|
7
|
+
href?: string;
|
|
8
|
+
onclick?: (e: MouseEvent) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
size?: 'mini' | 'sm' | 'md';
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
class?: ClassValue;
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
as = 'button',
|
|
19
|
+
href,
|
|
20
|
+
onclick,
|
|
21
|
+
disabled,
|
|
22
|
+
active = false,
|
|
23
|
+
size = 'mini',
|
|
24
|
+
ariaLabel,
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}: Props = $props();
|
|
28
|
+
|
|
29
|
+
const sizes: Record<NonNullable<Props['size']>, string> = {
|
|
30
|
+
mini: 'h-7 px-2 text-[11px]',
|
|
31
|
+
sm: 'h-8 px-2.5 text-xs',
|
|
32
|
+
md: 'h-9 px-3 text-sm'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const base =
|
|
36
|
+
'relative inline-flex items-center justify-center gap-1.5 whitespace-nowrap select-none transition-all ' +
|
|
37
|
+
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500/60';
|
|
38
|
+
|
|
39
|
+
const disabledCls = disabled ? 'opacity-50 pointer-events-none' : 'cursor-pointer';
|
|
40
|
+
|
|
41
|
+
const inactive =
|
|
42
|
+
'text-neutral-700 hover:bg-white/55 hover:text-neutral-900 ' +
|
|
43
|
+
'dark:text-neutral-200 dark:hover:bg-white/10 dark:hover:text-neutral-50';
|
|
44
|
+
|
|
45
|
+
const activeCls =
|
|
46
|
+
'bg-white text-neutral-900 shadow-sm ring-1 ring-neutral-200/70 ' +
|
|
47
|
+
'dark:bg-neutral-900/80 dark:text-neutral-50 dark:ring-neutral-800/70';
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
{#if as === 'a'}
|
|
51
|
+
<a
|
|
52
|
+
{href}
|
|
53
|
+
aria-label={ariaLabel}
|
|
54
|
+
data-active={active || undefined}
|
|
55
|
+
class={[
|
|
56
|
+
base,
|
|
57
|
+
sizes[size],
|
|
58
|
+
active ? activeCls : inactive,
|
|
59
|
+
// 🎯 SOLO CSS: posición automática
|
|
60
|
+
'[&[data-active]:first-child]:rounded-l-full',
|
|
61
|
+
'[&[data-active]:last-child]:rounded-r-full',
|
|
62
|
+
'[&[data-active]:not(:first-child):not(:last-child)]:rounded-full',
|
|
63
|
+
disabledCls,
|
|
64
|
+
props.class
|
|
65
|
+
]}
|
|
66
|
+
>
|
|
67
|
+
{@render children?.()}
|
|
68
|
+
</a>
|
|
69
|
+
{:else}
|
|
70
|
+
<button
|
|
71
|
+
type="button"
|
|
72
|
+
{disabled}
|
|
73
|
+
aria-label={ariaLabel}
|
|
74
|
+
data-active={active || undefined}
|
|
75
|
+
{onclick}
|
|
76
|
+
class={[
|
|
77
|
+
base,
|
|
78
|
+
sizes[size],
|
|
79
|
+
active ? activeCls : inactive,
|
|
80
|
+
'[&[data-active]:first-child]:rounded-l-full',
|
|
81
|
+
'[&[data-active]:last-child]:rounded-r-full',
|
|
82
|
+
'[&[data-active]:not(:first-child):not(:last-child)]:rounded-full',
|
|
83
|
+
disabledCls,
|
|
84
|
+
props.class
|
|
85
|
+
]}
|
|
86
|
+
>
|
|
87
|
+
{@render children?.()}
|
|
88
|
+
</button>
|
|
89
|
+
{/if}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { ClassValue } from 'svelte/elements';
|
|
3
|
+
type Props = {
|
|
4
|
+
as?: 'button' | 'a';
|
|
5
|
+
href?: string;
|
|
6
|
+
onclick?: (e: MouseEvent) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
active?: boolean;
|
|
9
|
+
size?: 'mini' | 'sm' | 'md';
|
|
10
|
+
ariaLabel?: string;
|
|
11
|
+
class?: ClassValue;
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
};
|
|
14
|
+
declare const DockItem: import("svelte").Component<Props, {}, "">;
|
|
15
|
+
type DockItem = ReturnType<typeof DockItem>;
|
|
16
|
+
export default DockItem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@r2digisolutions/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"packageManager": "bun@1.3.4",
|
|
6
6
|
"publishConfig": {
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"@storybook/addon-interactions": "8.6.14",
|
|
56
56
|
"@storybook/addon-svelte-csf": "5.0.10",
|
|
57
57
|
"@storybook/blocks": "8.6.14",
|
|
58
|
-
"@storybook/svelte": "10.1.
|
|
59
|
-
"@storybook/sveltekit": "10.1.
|
|
58
|
+
"@storybook/svelte": "10.1.7",
|
|
59
|
+
"@storybook/sveltekit": "10.1.7",
|
|
60
60
|
"@storybook/test": "8.6.14",
|
|
61
61
|
"@sveltejs/adapter-static": "3.0.10",
|
|
62
62
|
"@sveltejs/kit": "2.49.2",
|
|
63
63
|
"@sveltejs/package": "2.5.7",
|
|
64
64
|
"@sveltejs/vite-plugin-svelte": "6.2.1",
|
|
65
|
-
"@tailwindcss/postcss": "4.1.
|
|
65
|
+
"@tailwindcss/postcss": "4.1.18",
|
|
66
66
|
"@testing-library/svelte": "5.2.9",
|
|
67
67
|
"@vitest/browser": "4.0.15",
|
|
68
68
|
"changeset": "0.2.6",
|
|
@@ -71,15 +71,15 @@
|
|
|
71
71
|
"eslint-plugin-svelte": "3.13.1",
|
|
72
72
|
"globals": "16.5.0",
|
|
73
73
|
"jsdom": "27.3.0",
|
|
74
|
-
"lucide-svelte": "0.
|
|
74
|
+
"lucide-svelte": "0.561.0",
|
|
75
75
|
"prettier": "3.7.4",
|
|
76
76
|
"prettier-plugin-svelte": "3.4.0",
|
|
77
77
|
"prettier-plugin-tailwindcss": "0.7.2",
|
|
78
78
|
"publint": "0.3.16",
|
|
79
|
-
"storybook": "10.1.
|
|
80
|
-
"svelte": "5.45.
|
|
79
|
+
"storybook": "10.1.7",
|
|
80
|
+
"svelte": "5.45.10",
|
|
81
81
|
"svelte-check": "4.3.4",
|
|
82
|
-
"tailwindcss": "4.1.
|
|
82
|
+
"tailwindcss": "4.1.18",
|
|
83
83
|
"typescript": "5.9.3",
|
|
84
84
|
"typescript-eslint": "8.49.0",
|
|
85
85
|
"vite": "7.2.7",
|