@r2digisolutions/ui 0.31.0 → 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.
@@ -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
- export { 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, };
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, };
@@ -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
- export { 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, };
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;
@@ -230,68 +230,77 @@
230
230
  </script>
231
231
 
232
232
  {#if props.open}
233
- <div class="fixed inset-0 z-99 flex flex-col md:hidden">
234
- <!-- Overlay -->
235
- <!-- svelte-ignore a11y_click_events_have_key_events -->
236
- <!-- svelte-ignore a11y_no_static_element_interactions -->
237
- <div
238
- in:fade={{ duration: 150 }}
239
- out:fade={{ duration: 120 }}
240
- class={['flex-1 bg-neutral-950/70 backdrop-blur-sm', props.overlayClass ?? '']}
241
- onclick={handleOverlayClick}
242
- ></div>
243
-
244
- <!-- Panel -->
245
- <div
246
- role="dialog"
247
- aria-modal="true"
248
- in:slide={{ duration: 220, easing: cubicOut }}
249
- out:slide={{ duration: 190, easing: cubicIn }}
250
- class={[
251
- 'relative w-full overflow-hidden rounded-t-3xl border-t border-neutral-800/70 bg-neutral-950/95 text-neutral-50 shadow-[0_-18px_45px_rgba(0,0,0,0.7)]',
252
- props.panelClass ?? ''
253
- ]}
254
- style={`max-height:${props.maxHeight ?? '80vh'};height:${currentHeight * 100}vh;`}
255
- >
256
- <div class={['flex h-full flex-col', isOpening ? 'sheet-inner-opening' : '']}>
257
- <!-- Handle drag -->
258
- <div
259
- class="flex items-center justify-center pt-2 pb-1 select-none"
260
- style="touch-action:none;"
261
- onpointerdown={onHandlePointerDown}
262
- >
233
+ <div class="fixed inset-0 z-99 overflow-hidden md:hidden">
234
+ <!-- Underlay global con blur (cubre TODO, también debajo del sheet) -->
235
+ <div class="pointer-events-none absolute inset-0 bg-neutral-950/55 backdrop-blur-sm"></div>
236
+
237
+ <!-- Contenedor real del overlay clicable + sheet -->
238
+ <div class="relative flex h-full flex-col">
239
+ <!-- Overlay superior clicable -->
240
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
241
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
242
+ <div
243
+ in:fade={{ duration: 150 }}
244
+ out:fade={{ duration: 120 }}
245
+ class={['flex-1', props.overlayClass ?? '']}
246
+ onclick={handleOverlayClick}
247
+ ></div>
248
+
249
+ <!-- Panel -->
250
+ <div
251
+ role="dialog"
252
+ aria-modal="true"
253
+ in:slide={{ duration: 220, easing: cubicOut }}
254
+ out:slide={{ duration: 190, easing: cubicIn }}
255
+ class={[
256
+ 'relative z-10 w-full overflow-hidden rounded-t-3xl border-t border-neutral-800/70',
257
+ // fondo ligeramente menos transparente y con un blur suave propio
258
+ 'bg-neutral-950/90 backdrop-blur-[2px]',
259
+ 'shadow-[0_-18px_45px_rgba(0,0,0,0.7)]',
260
+ props.panelClass ?? ''
261
+ ]}
262
+ style={`max-height:${props.maxHeight ?? '80vh'};height:${currentHeight * 100}vh;`}
263
+ >
264
+ <div class={['flex h-full flex-col', isOpening ? 'sheet-inner-opening' : '']}>
265
+ <!-- Handle drag -->
263
266
  <div
264
- class="h-1.5 w-10 rounded-full bg-neutral-700/80 transition-transform duration-150"
265
- style={`transform: translateY(${handleOffset}px) scaleX(${
266
- 1 + handleStretch
267
- }); opacity:${0.9 - handleStretch * 0.3};`}
268
- ></div>
269
- </div>
270
-
271
- <!-- Header opcional -->
272
- {#if props.header}
273
- <div class="px-4 pb-2">
274
- {@render props.header(sheetContext)}
267
+ class="flex items-center justify-center pt-2 pb-1 select-none"
268
+ style="touch-action:none;"
269
+ onpointerdown={onHandlePointerDown}
270
+ >
271
+ <div
272
+ class="h-1.5 w-10 rounded-full bg-neutral-700/80 transition-transform duration-150"
273
+ style={`transform: translateY(${handleOffset}px) scaleX(${
274
+ 1 + handleStretch
275
+ }); opacity:${0.9 - handleStretch * 0.3};`}
276
+ ></div>
275
277
  </div>
276
- {/if}
277
278
 
278
- <!-- Body -->
279
- <div class="flex min-h-0 flex-1 flex-col overflow-hidden px-3 pb-3">
280
- {#if props.content}
281
- <div class="min-h-0 flex-1 overflow-y-auto">
282
- {@render props.content(sheetContext)}
279
+ <!-- Header opcional -->
280
+ {#if props.header}
281
+ <div class="px-4 pb-2">
282
+ {@render props.header(sheetContext)}
283
283
  </div>
284
284
  {/if}
285
- </div>
286
285
 
287
- <!-- Footer siempre abajo, con pequeño safe-area -->
288
- {#if props.footer}
289
- <div
290
- class="border-t border-neutral-800/70 px-3 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom,0px))]"
291
- >
292
- {@render props.footer(sheetContext)}
286
+ <!-- Body -->
287
+ <div class="flex min-h-0 flex-1 flex-col overflow-hidden px-3 pb-3">
288
+ {#if props.content}
289
+ <div class="min-h-0 flex-1 overflow-y-auto">
290
+ {@render props.content(sheetContext)}
291
+ </div>
292
+ {/if}
293
293
  </div>
294
- {/if}
294
+
295
+ <!-- Footer -->
296
+ {#if props.footer}
297
+ <div
298
+ class="border-t border-neutral-800/70 px-3 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom,0px))]"
299
+ >
300
+ {@render props.footer(sheetContext)}
301
+ </div>
302
+ {/if}
303
+ </div>
295
304
  </div>
296
305
  </div>
297
306
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/ui",
3
- "version": "0.31.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.6",
59
- "@storybook/sveltekit": "10.1.6",
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.17",
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.560.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.6",
80
- "svelte": "5.45.8",
79
+ "storybook": "10.1.7",
80
+ "svelte": "5.45.10",
81
81
  "svelte-check": "4.3.4",
82
- "tailwindcss": "4.1.17",
82
+ "tailwindcss": "4.1.18",
83
83
  "typescript": "5.9.3",
84
84
  "typescript-eslint": "8.49.0",
85
85
  "vite": "7.2.7",