@leap-online/jolt 0.5.1 → 0.6.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/badge/badge.svelte +43 -5
- package/dist/components/badge/badge.svelte.d.ts +16 -2
- package/dist/components/description-list/description-list.svelte +108 -0
- package/dist/components/description-list/description-list.svelte.d.ts +29 -0
- package/dist/components/description-list/index.d.ts +1 -0
- package/dist/components/description-list/index.js +1 -0
- package/dist/components/feed-item/feed-item.svelte +104 -0
- package/dist/components/feed-item/feed-item.svelte.d.ts +16 -0
- package/dist/components/feed-item/index.d.ts +1 -0
- package/dist/components/feed-item/index.js +1 -0
- package/dist/components/severity-dot/index.d.ts +1 -0
- package/dist/components/severity-dot/index.js +1 -0
- package/dist/components/severity-dot/severity-dot.svelte +55 -0
- package/dist/components/severity-dot/severity-dot.svelte.d.ts +12 -0
- package/dist/components/time-ago/index.d.ts +1 -0
- package/dist/components/time-ago/index.js +1 -0
- package/dist/components/time-ago/time-ago.svelte +48 -0
- package/dist/components/time-ago/time-ago.svelte.d.ts +9 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -1
- package/dist/styles/theme.css +12 -0
- package/dist/utils/format.d.ts +24 -0
- package/dist/utils/format.js +82 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/package.json +125 -126
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
outline: 'border-foreground/20 text-foreground',
|
|
12
12
|
brand: 'border-transparent bg-brand text-brand-foreground',
|
|
13
13
|
destructive: 'border-transparent bg-destructive text-destructive-foreground',
|
|
14
|
+
neutral: 'border-border bg-muted text-muted-foreground',
|
|
15
|
+
info: 'border-info/20 bg-info/10 text-info',
|
|
16
|
+
success: 'border-success/20 bg-success/10 text-success',
|
|
17
|
+
warning: 'border-warning/20 bg-warning/10 text-warning',
|
|
18
|
+
danger: 'border-destructive/20 bg-destructive/10 text-destructive',
|
|
14
19
|
},
|
|
15
20
|
},
|
|
16
21
|
defaultVariants: {
|
|
@@ -21,25 +26,58 @@
|
|
|
21
26
|
export type BadgeVariant = VariantProps<typeof badgeVariants>['variant'];
|
|
22
27
|
export type BadgeIcon = Component<{ class?: string }>;
|
|
23
28
|
|
|
24
|
-
export type
|
|
25
|
-
label: string;
|
|
29
|
+
export type BadgeBase = {
|
|
26
30
|
icon?: BadgeIcon;
|
|
27
31
|
iconClass?: string;
|
|
28
32
|
variant?: BadgeVariant;
|
|
33
|
+
dot?: boolean;
|
|
29
34
|
class?: string;
|
|
30
35
|
};
|
|
36
|
+
|
|
37
|
+
export type Props = BadgeBase &
|
|
38
|
+
(
|
|
39
|
+
| { label: string; count?: never; maxCount?: never }
|
|
40
|
+
| { count: number; maxCount?: number; label?: never }
|
|
41
|
+
);
|
|
31
42
|
</script>
|
|
32
43
|
|
|
33
44
|
<script lang="ts">
|
|
34
45
|
import { cls } from '../../utils/index.js';
|
|
35
46
|
|
|
36
|
-
|
|
47
|
+
function formatCount(value: number, limit: number): string {
|
|
48
|
+
return value > limit ? `${limit}+` : String(value);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
let {
|
|
52
|
+
class: className,
|
|
53
|
+
label,
|
|
54
|
+
count,
|
|
55
|
+
icon,
|
|
56
|
+
iconClass,
|
|
57
|
+
variant = 'default',
|
|
58
|
+
dot = false,
|
|
59
|
+
maxCount = 99,
|
|
60
|
+
}: Props = $props();
|
|
61
|
+
|
|
62
|
+
const isCount = $derived(typeof count === 'number');
|
|
63
|
+
const countLabel = $derived(typeof count === 'number' ? formatCount(count, maxCount) : label);
|
|
37
64
|
</script>
|
|
38
65
|
|
|
39
|
-
<span
|
|
66
|
+
<span
|
|
67
|
+
data-slot="badge"
|
|
68
|
+
data-variant={variant}
|
|
69
|
+
class={cls(
|
|
70
|
+
badgeVariants({ variant }),
|
|
71
|
+
isCount && 'min-w-5 justify-center px-1.5 tabular-nums',
|
|
72
|
+
className,
|
|
73
|
+
)}
|
|
74
|
+
>
|
|
75
|
+
{#if dot}
|
|
76
|
+
<span data-slot="badge-dot" aria-hidden="true" class="size-1.5 rounded-full bg-current"></span>
|
|
77
|
+
{/if}
|
|
40
78
|
{#if icon}
|
|
41
79
|
{@const Icon = icon}
|
|
42
80
|
<Icon class={cls('size-3', iconClass)} />
|
|
43
81
|
{/if}
|
|
44
|
-
{label}
|
|
82
|
+
{isCount ? countLabel : label}
|
|
45
83
|
</span>
|
|
@@ -7,19 +7,33 @@ export declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
7
7
|
outline: string;
|
|
8
8
|
brand: string;
|
|
9
9
|
destructive: string;
|
|
10
|
+
neutral: string;
|
|
11
|
+
info: string;
|
|
12
|
+
success: string;
|
|
13
|
+
warning: string;
|
|
14
|
+
danger: string;
|
|
10
15
|
};
|
|
11
16
|
}, undefined, "inline-flex items-center gap-1 rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-hidden", undefined, undefined, undefined>;
|
|
12
17
|
export type BadgeVariant = VariantProps<typeof badgeVariants>['variant'];
|
|
13
18
|
export type BadgeIcon = Component<{
|
|
14
19
|
class?: string;
|
|
15
20
|
}>;
|
|
16
|
-
export type
|
|
17
|
-
label: string;
|
|
21
|
+
export type BadgeBase = {
|
|
18
22
|
icon?: BadgeIcon;
|
|
19
23
|
iconClass?: string;
|
|
20
24
|
variant?: BadgeVariant;
|
|
25
|
+
dot?: boolean;
|
|
21
26
|
class?: string;
|
|
22
27
|
};
|
|
28
|
+
export type Props = BadgeBase & ({
|
|
29
|
+
label: string;
|
|
30
|
+
count?: never;
|
|
31
|
+
maxCount?: never;
|
|
32
|
+
} | {
|
|
33
|
+
count: number;
|
|
34
|
+
maxCount?: number;
|
|
35
|
+
label?: never;
|
|
36
|
+
});
|
|
23
37
|
declare const Badge: Component<Props, {}, "">;
|
|
24
38
|
type Badge = ReturnType<typeof Badge>;
|
|
25
39
|
export default Badge;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
export type DescriptionListItem = {
|
|
5
|
+
/** Stable key for the row. Falls back to the array index. */
|
|
6
|
+
id?: string;
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
/** Show a copy control for the value. */
|
|
10
|
+
copyable?: boolean;
|
|
11
|
+
/** Value copied by the control. Defaults to `value`. */
|
|
12
|
+
copyValue?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type DescriptionListLayout = 'horizontal' | 'stacked';
|
|
16
|
+
|
|
17
|
+
export type Props = {
|
|
18
|
+
items: DescriptionListItem[];
|
|
19
|
+
/** Label/value arrangement. Horizontal falls back to stacked on narrow screens. */
|
|
20
|
+
layout?: DescriptionListLayout;
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
/** Number of skeleton rows while loading. Defaults to the item count, with a minimum of three. */
|
|
23
|
+
skeletonRows?: number;
|
|
24
|
+
/** Custom value renderer. Copy controls still use `copyValue` or `value`. */
|
|
25
|
+
value?: Snippet<[DescriptionListItem]>;
|
|
26
|
+
class?: string;
|
|
27
|
+
rowClass?: string;
|
|
28
|
+
labelClass?: string;
|
|
29
|
+
valueClass?: string;
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<script lang="ts">
|
|
34
|
+
import { cls } from '../../utils/index.js';
|
|
35
|
+
import { CopyButton } from '../copy-button/index.js';
|
|
36
|
+
import { Skeleton } from '../skeleton/index.js';
|
|
37
|
+
|
|
38
|
+
let {
|
|
39
|
+
items,
|
|
40
|
+
layout = 'horizontal',
|
|
41
|
+
loading = false,
|
|
42
|
+
skeletonRows,
|
|
43
|
+
value: valueSnippet,
|
|
44
|
+
class: className,
|
|
45
|
+
rowClass,
|
|
46
|
+
labelClass,
|
|
47
|
+
valueClass,
|
|
48
|
+
}: Props = $props();
|
|
49
|
+
|
|
50
|
+
const rowCount = $derived(skeletonRows ?? Math.max(items.length, 3));
|
|
51
|
+
const skeletonRowIndexes = $derived([...Array(rowCount).keys()]);
|
|
52
|
+
const layoutClass = $derived(
|
|
53
|
+
layout === 'horizontal'
|
|
54
|
+
? 'grid grid-cols-1 gap-1 sm:grid-cols-[minmax(7rem,0.35fr)_1fr] sm:gap-x-4'
|
|
55
|
+
: 'grid grid-cols-1 gap-1',
|
|
56
|
+
);
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<dl
|
|
60
|
+
data-slot="description-list"
|
|
61
|
+
data-layout={layout}
|
|
62
|
+
aria-busy={loading || undefined}
|
|
63
|
+
class={cls('w-full text-sm', className)}
|
|
64
|
+
>
|
|
65
|
+
{#if loading}
|
|
66
|
+
{#each skeletonRowIndexes as index (index)}
|
|
67
|
+
<div
|
|
68
|
+
data-slot="description-list-row"
|
|
69
|
+
class={cls('border-b py-2.5 last:border-b-0', layoutClass, rowClass)}
|
|
70
|
+
>
|
|
71
|
+
<Skeleton class="h-5 w-24" />
|
|
72
|
+
<Skeleton class="h-5 w-40" />
|
|
73
|
+
</div>
|
|
74
|
+
{/each}
|
|
75
|
+
{:else}
|
|
76
|
+
{#each items as item, index (item.id ?? index)}
|
|
77
|
+
<div
|
|
78
|
+
data-slot="description-list-row"
|
|
79
|
+
class={cls('group grid gap-1 border-b py-2.5 last:border-b-0', layoutClass, rowClass)}
|
|
80
|
+
>
|
|
81
|
+
<dt data-slot="description-list-label" class={cls('text-muted-foreground', labelClass)}>
|
|
82
|
+
{item.label}
|
|
83
|
+
</dt>
|
|
84
|
+
<dd
|
|
85
|
+
data-slot="description-list-value"
|
|
86
|
+
class={cls('flex min-w-0 items-center gap-1.5', valueClass)}
|
|
87
|
+
>
|
|
88
|
+
<span class="min-w-0 break-words">
|
|
89
|
+
{#if valueSnippet}
|
|
90
|
+
{@render valueSnippet(item)}
|
|
91
|
+
{:else}
|
|
92
|
+
{item.value}
|
|
93
|
+
{/if}
|
|
94
|
+
</span>
|
|
95
|
+
{#if item.copyable}
|
|
96
|
+
<CopyButton
|
|
97
|
+
value={item.copyValue ?? item.value}
|
|
98
|
+
copyLabel={`Copy ${item.label}`}
|
|
99
|
+
variant="ghost"
|
|
100
|
+
size="icon"
|
|
101
|
+
class="-my-0.5 size-6 shrink-0 text-muted-foreground"
|
|
102
|
+
/>
|
|
103
|
+
{/if}
|
|
104
|
+
</dd>
|
|
105
|
+
</div>
|
|
106
|
+
{/each}
|
|
107
|
+
{/if}
|
|
108
|
+
</dl>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export type DescriptionListItem = {
|
|
3
|
+
/** Stable key for the row. Falls back to the array index. */
|
|
4
|
+
id?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
/** Show a copy control for the value. */
|
|
8
|
+
copyable?: boolean;
|
|
9
|
+
/** Value copied by the control. Defaults to `value`. */
|
|
10
|
+
copyValue?: string;
|
|
11
|
+
};
|
|
12
|
+
export type DescriptionListLayout = 'horizontal' | 'stacked';
|
|
13
|
+
export type Props = {
|
|
14
|
+
items: DescriptionListItem[];
|
|
15
|
+
/** Label/value arrangement. Horizontal falls back to stacked on narrow screens. */
|
|
16
|
+
layout?: DescriptionListLayout;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
/** Number of skeleton rows while loading. Defaults to the item count, with a minimum of three. */
|
|
19
|
+
skeletonRows?: number;
|
|
20
|
+
/** Custom value renderer. Copy controls still use `copyValue` or `value`. */
|
|
21
|
+
value?: Snippet<[DescriptionListItem]>;
|
|
22
|
+
class?: string;
|
|
23
|
+
rowClass?: string;
|
|
24
|
+
labelClass?: string;
|
|
25
|
+
valueClass?: string;
|
|
26
|
+
};
|
|
27
|
+
declare const DescriptionList: import("svelte").Component<Props, {}, "">;
|
|
28
|
+
type DescriptionList = ReturnType<typeof DescriptionList>;
|
|
29
|
+
export default DescriptionList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DescriptionList, type DescriptionListItem, type DescriptionListLayout, type Props as DescriptionListProps, } from './description-list.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DescriptionList, } from './description-list.svelte';
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
export type Props = {
|
|
5
|
+
title: string;
|
|
6
|
+
meta?: string;
|
|
7
|
+
leading?: Snippet;
|
|
8
|
+
trailing?: Snippet;
|
|
9
|
+
unread?: boolean;
|
|
10
|
+
/** Renders the row as a link. Takes precedence over `onActivate`. */
|
|
11
|
+
href?: string;
|
|
12
|
+
/** Renders the row as a button. */
|
|
13
|
+
onActivate?: () => void;
|
|
14
|
+
class?: string;
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
import { cls } from '../../utils/index.js';
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
title,
|
|
23
|
+
meta,
|
|
24
|
+
leading,
|
|
25
|
+
trailing,
|
|
26
|
+
unread = false,
|
|
27
|
+
href,
|
|
28
|
+
onActivate,
|
|
29
|
+
class: className,
|
|
30
|
+
}: Props = $props();
|
|
31
|
+
|
|
32
|
+
const isInteractive = $derived(Boolean(href || onActivate));
|
|
33
|
+
const activationLabel = $derived(unread ? `${title}, unread` : title);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<div
|
|
37
|
+
data-slot="feed-item"
|
|
38
|
+
data-unread={unread ? 'true' : undefined}
|
|
39
|
+
class={cls(
|
|
40
|
+
'group relative flex items-start gap-3 rounded-lg px-3 py-2.5 text-sm',
|
|
41
|
+
isInteractive && 'transition-colors hover:bg-muted/50',
|
|
42
|
+
className,
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
{#if href}
|
|
46
|
+
<a
|
|
47
|
+
{href}
|
|
48
|
+
aria-label={activationLabel}
|
|
49
|
+
class="absolute inset-0 rounded-lg focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-hidden"
|
|
50
|
+
></a>
|
|
51
|
+
{:else if onActivate}
|
|
52
|
+
<button
|
|
53
|
+
type="button"
|
|
54
|
+
aria-label={activationLabel}
|
|
55
|
+
onclick={onActivate}
|
|
56
|
+
class="absolute inset-0 rounded-lg focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-hidden"
|
|
57
|
+
></button>
|
|
58
|
+
{/if}
|
|
59
|
+
|
|
60
|
+
<div
|
|
61
|
+
class={cls(
|
|
62
|
+
'relative z-10 flex min-w-0 flex-1 items-start gap-3',
|
|
63
|
+
isInteractive && 'pointer-events-none',
|
|
64
|
+
)}
|
|
65
|
+
>
|
|
66
|
+
{#if leading}
|
|
67
|
+
<div class="flex shrink-0 items-start">
|
|
68
|
+
{@render leading()}
|
|
69
|
+
</div>
|
|
70
|
+
{/if}
|
|
71
|
+
|
|
72
|
+
<div class="min-w-0 flex-1">
|
|
73
|
+
<div class="flex min-w-0 items-center gap-2">
|
|
74
|
+
{#if unread}
|
|
75
|
+
<span class="size-1.5 shrink-0 rounded-full bg-brand" aria-hidden="true"></span>
|
|
76
|
+
{/if}
|
|
77
|
+
<span
|
|
78
|
+
data-slot="feed-item-title"
|
|
79
|
+
class={cls('truncate', unread ? 'font-semibold' : 'font-medium')}
|
|
80
|
+
>
|
|
81
|
+
{title}
|
|
82
|
+
</span>
|
|
83
|
+
</div>
|
|
84
|
+
{#if meta}
|
|
85
|
+
<p data-slot="feed-item-meta" class="mt-0.5 truncate text-xs text-muted-foreground">
|
|
86
|
+
{meta}
|
|
87
|
+
</p>
|
|
88
|
+
{/if}
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
{#if trailing}
|
|
92
|
+
<div
|
|
93
|
+
data-slot="feed-item-trailing"
|
|
94
|
+
class={cls('shrink-0', isInteractive && 'pointer-events-auto')}
|
|
95
|
+
>
|
|
96
|
+
{@render trailing()}
|
|
97
|
+
</div>
|
|
98
|
+
{/if}
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
{#if unread && !isInteractive}
|
|
102
|
+
<span class="sr-only">Unread</span>
|
|
103
|
+
{/if}
|
|
104
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export type Props = {
|
|
3
|
+
title: string;
|
|
4
|
+
meta?: string;
|
|
5
|
+
leading?: Snippet;
|
|
6
|
+
trailing?: Snippet;
|
|
7
|
+
unread?: boolean;
|
|
8
|
+
/** Renders the row as a link. Takes precedence over `onActivate`. */
|
|
9
|
+
href?: string;
|
|
10
|
+
/** Renders the row as a button. */
|
|
11
|
+
onActivate?: () => void;
|
|
12
|
+
class?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const FeedItem: import("svelte").Component<Props, {}, "">;
|
|
15
|
+
type FeedItem = ReturnType<typeof FeedItem>;
|
|
16
|
+
export default FeedItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FeedItem, type Props as FeedItemProps } from './feed-item.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FeedItem } from './feed-item.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type Severity, default as SeverityDot, type Props as SeverityDotProps, } from './severity-dot.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SeverityDot, } from './severity-dot.svelte';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Component } from 'svelte';
|
|
3
|
+
|
|
4
|
+
export type Severity = 'critical' | 'high' | 'medium' | 'low';
|
|
5
|
+
|
|
6
|
+
type SeverityConfig = {
|
|
7
|
+
label: string;
|
|
8
|
+
icon: Component<{ class?: string }>;
|
|
9
|
+
tone: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type Props = {
|
|
13
|
+
severity: Severity;
|
|
14
|
+
/** Accessible and optional visible label. Defaults from the severity. */
|
|
15
|
+
label?: string;
|
|
16
|
+
showLabel?: boolean;
|
|
17
|
+
class?: string;
|
|
18
|
+
};
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import { CircleAlert, Info, OctagonAlert, TriangleAlert } from '@lucide/svelte';
|
|
23
|
+
import { cls } from '../../utils/index.js';
|
|
24
|
+
|
|
25
|
+
const severityConfig = {
|
|
26
|
+
critical: { label: 'Critical', icon: OctagonAlert, tone: 'text-destructive' },
|
|
27
|
+
high: { label: 'High', icon: TriangleAlert, tone: 'text-warning' },
|
|
28
|
+
medium: { label: 'Medium', icon: CircleAlert, tone: 'text-info' },
|
|
29
|
+
low: { label: 'Low', icon: Info, tone: 'text-muted-foreground' },
|
|
30
|
+
} satisfies Record<Severity, SeverityConfig>;
|
|
31
|
+
|
|
32
|
+
let { severity, label, showLabel = false, class: className }: Props = $props();
|
|
33
|
+
|
|
34
|
+
const config = $derived(severityConfig[severity]);
|
|
35
|
+
const text = $derived(label ?? config.label);
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<span
|
|
39
|
+
data-slot="severity-dot"
|
|
40
|
+
data-severity={severity}
|
|
41
|
+
role={showLabel ? undefined : 'img'}
|
|
42
|
+
aria-label={showLabel ? undefined : text}
|
|
43
|
+
title={showLabel ? undefined : text}
|
|
44
|
+
class={cls('inline-flex items-center gap-1.5 text-xs font-medium', config.tone, className)}
|
|
45
|
+
>
|
|
46
|
+
{#if config.icon}
|
|
47
|
+
{@const Icon = config.icon}
|
|
48
|
+
<span aria-hidden="true">
|
|
49
|
+
<Icon class="size-3.5 shrink-0" />
|
|
50
|
+
</span>
|
|
51
|
+
{/if}
|
|
52
|
+
{#if showLabel}
|
|
53
|
+
<span>{text}</span>
|
|
54
|
+
{/if}
|
|
55
|
+
</span>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
|
+
export type Severity = 'critical' | 'high' | 'medium' | 'low';
|
|
3
|
+
export type Props = {
|
|
4
|
+
severity: Severity;
|
|
5
|
+
/** Accessible and optional visible label. Defaults from the severity. */
|
|
6
|
+
label?: string;
|
|
7
|
+
showLabel?: boolean;
|
|
8
|
+
class?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const SeverityDot: Component<Props, {}, "">;
|
|
11
|
+
type SeverityDot = ReturnType<typeof SeverityDot>;
|
|
12
|
+
export default SeverityDot;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TimeAgo, type Props as TimeAgoProps } from './time-ago.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TimeAgo } from './time-ago.svelte';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { DateInput } from '../../utils/format.js';
|
|
3
|
+
|
|
4
|
+
export type Props = {
|
|
5
|
+
/** The timestamp to describe relative to the current time. */
|
|
6
|
+
date: DateInput;
|
|
7
|
+
class?: string;
|
|
8
|
+
};
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { onMount } from 'svelte';
|
|
13
|
+
import { formatRelativeTime } from '../../utils/format.js';
|
|
14
|
+
import { cls } from '../../utils/index.js';
|
|
15
|
+
|
|
16
|
+
const absoluteFormat = new Intl.DateTimeFormat('en', {
|
|
17
|
+
dateStyle: 'medium',
|
|
18
|
+
timeStyle: 'short',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
let { date, class: className }: Props = $props();
|
|
22
|
+
|
|
23
|
+
let now = $state(new Date());
|
|
24
|
+
|
|
25
|
+
onMount(() => {
|
|
26
|
+
const timer = setInterval(() => {
|
|
27
|
+
now = new Date();
|
|
28
|
+
}, 60_000);
|
|
29
|
+
|
|
30
|
+
return () => clearInterval(timer);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const parsedDate = $derived(date instanceof Date ? date : new Date(date));
|
|
34
|
+
const isValidDate = $derived(!Number.isNaN(parsedDate.getTime()));
|
|
35
|
+
const isoDate = $derived(isValidDate ? parsedDate.toISOString() : undefined);
|
|
36
|
+
const absoluteLabel = $derived(isValidDate ? absoluteFormat.format(parsedDate) : 'Invalid date');
|
|
37
|
+
const relativeLabel = $derived(formatRelativeTime(date, now));
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<time
|
|
41
|
+
data-slot="time-ago"
|
|
42
|
+
datetime={isoDate}
|
|
43
|
+
title={absoluteLabel}
|
|
44
|
+
aria-label={absoluteLabel}
|
|
45
|
+
class={cls('whitespace-nowrap', className)}
|
|
46
|
+
>
|
|
47
|
+
{relativeLabel}
|
|
48
|
+
</time>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DateInput } from '../../utils/format.js';
|
|
2
|
+
export type Props = {
|
|
3
|
+
/** The timestamp to describe relative to the current time. */
|
|
4
|
+
date: DateInput;
|
|
5
|
+
class?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const TimeAgo: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type TimeAgo = ReturnType<typeof TimeAgo>;
|
|
9
|
+
export default TimeAgo;
|
package/dist/index.d.ts
CHANGED
|
@@ -21,10 +21,12 @@ export * from './components/copy-button/index.js';
|
|
|
21
21
|
export * from './components/data-table/index.js';
|
|
22
22
|
export * from './components/date-picker/index.js';
|
|
23
23
|
export * from './components/date-range-picker/index.js';
|
|
24
|
+
export * from './components/description-list/index.js';
|
|
24
25
|
export * from './components/dialog/index.js';
|
|
25
26
|
export * from './components/dropdown-menu/index.js';
|
|
26
27
|
export * from './components/email-input/index.js';
|
|
27
28
|
export * from './components/empty-state/index.js';
|
|
29
|
+
export * from './components/feed-item/index.js';
|
|
28
30
|
export * from './components/field/index.js';
|
|
29
31
|
export * from './components/file-upload/index.js';
|
|
30
32
|
export * from './components/hover-card/index.js';
|
|
@@ -46,6 +48,7 @@ export * from './components/reaction-bar/index.js';
|
|
|
46
48
|
export * from './components/scroll-area/index.js';
|
|
47
49
|
export * from './components/select/index.js';
|
|
48
50
|
export * from './components/separator/index.js';
|
|
51
|
+
export * from './components/severity-dot/index.js';
|
|
49
52
|
export * from './components/sheet/index.js';
|
|
50
53
|
export * from './components/sidebar/index.js';
|
|
51
54
|
export * from './components/skeleton/index.js';
|
|
@@ -57,6 +60,7 @@ export * from './components/table/index.js';
|
|
|
57
60
|
export * from './components/tabs/index.js';
|
|
58
61
|
export * from './components/tags-input/index.js';
|
|
59
62
|
export * from './components/textarea/index.js';
|
|
63
|
+
export * from './components/time-ago/index.js';
|
|
60
64
|
export * from './components/time-picker/index.js';
|
|
61
65
|
export * from './components/toast/index.js';
|
|
62
66
|
export * from './components/toggle/index.js';
|
|
@@ -65,4 +69,4 @@ export * from './components/tooltip/index.js';
|
|
|
65
69
|
export * from './components/tree-view/index.js';
|
|
66
70
|
export * from './form/index.js';
|
|
67
71
|
export type { WithElementRef } from './types/index.js';
|
|
68
|
-
export { cls } from './utils/index.js';
|
|
72
|
+
export { cls, type DateInput, formatBytes, formatDuration, formatNumber, formatRelativeTime, } from './utils/index.js';
|
package/dist/index.js
CHANGED
|
@@ -21,10 +21,12 @@ export * from './components/copy-button/index.js';
|
|
|
21
21
|
export * from './components/data-table/index.js';
|
|
22
22
|
export * from './components/date-picker/index.js';
|
|
23
23
|
export * from './components/date-range-picker/index.js';
|
|
24
|
+
export * from './components/description-list/index.js';
|
|
24
25
|
export * from './components/dialog/index.js';
|
|
25
26
|
export * from './components/dropdown-menu/index.js';
|
|
26
27
|
export * from './components/email-input/index.js';
|
|
27
28
|
export * from './components/empty-state/index.js';
|
|
29
|
+
export * from './components/feed-item/index.js';
|
|
28
30
|
export * from './components/field/index.js';
|
|
29
31
|
export * from './components/file-upload/index.js';
|
|
30
32
|
export * from './components/hover-card/index.js';
|
|
@@ -46,6 +48,7 @@ export * from './components/reaction-bar/index.js';
|
|
|
46
48
|
export * from './components/scroll-area/index.js';
|
|
47
49
|
export * from './components/select/index.js';
|
|
48
50
|
export * from './components/separator/index.js';
|
|
51
|
+
export * from './components/severity-dot/index.js';
|
|
49
52
|
export * from './components/sheet/index.js';
|
|
50
53
|
export * from './components/sidebar/index.js';
|
|
51
54
|
export * from './components/skeleton/index.js';
|
|
@@ -57,6 +60,7 @@ export * from './components/table/index.js';
|
|
|
57
60
|
export * from './components/tabs/index.js';
|
|
58
61
|
export * from './components/tags-input/index.js';
|
|
59
62
|
export * from './components/textarea/index.js';
|
|
63
|
+
export * from './components/time-ago/index.js';
|
|
60
64
|
export * from './components/time-picker/index.js';
|
|
61
65
|
export * from './components/toast/index.js';
|
|
62
66
|
export * from './components/toggle/index.js';
|
|
@@ -64,4 +68,4 @@ export * from './components/toggle-group/index.js';
|
|
|
64
68
|
export * from './components/tooltip/index.js';
|
|
65
69
|
export * from './components/tree-view/index.js';
|
|
66
70
|
export * from './form/index.js';
|
|
67
|
-
export { cls } from './utils/index.js';
|
|
71
|
+
export { cls, formatBytes, formatDuration, formatNumber, formatRelativeTime, } from './utils/index.js';
|
package/dist/styles/theme.css
CHANGED
|
@@ -102,6 +102,10 @@
|
|
|
102
102
|
--color-destructive-foreground: var(--destructive-foreground);
|
|
103
103
|
--color-success: var(--success);
|
|
104
104
|
--color-success-foreground: var(--success-foreground);
|
|
105
|
+
--color-info: var(--info);
|
|
106
|
+
--color-info-foreground: var(--info-foreground);
|
|
107
|
+
--color-warning: var(--warning);
|
|
108
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
105
109
|
--color-border: var(--border);
|
|
106
110
|
--color-input: var(--input);
|
|
107
111
|
--color-ring: var(--ring);
|
|
@@ -135,6 +139,10 @@
|
|
|
135
139
|
--destructive-foreground: oklch(100% 0 0);
|
|
136
140
|
--success: oklch(52% 0.14 150);
|
|
137
141
|
--success-foreground: oklch(100% 0 0);
|
|
142
|
+
--info: oklch(48.8% 0.217 264.376);
|
|
143
|
+
--info-foreground: oklch(100% 0 0);
|
|
144
|
+
--warning: oklch(51% 0.145 49);
|
|
145
|
+
--warning-foreground: oklch(100% 0 0);
|
|
138
146
|
--border: oklch(94.01% 0 0);
|
|
139
147
|
--input: oklch(90.32% 0.0017 247.84);
|
|
140
148
|
--ring: oklch(57.66% 0.1141 95.56);
|
|
@@ -168,6 +176,10 @@
|
|
|
168
176
|
--destructive-foreground: oklch(14.52% 0.0021 286.13);
|
|
169
177
|
--success: oklch(70% 0.15 150);
|
|
170
178
|
--success-foreground: oklch(14.52% 0.0021 286.13);
|
|
179
|
+
--info: oklch(80.9% 0.105 251.813);
|
|
180
|
+
--info-foreground: oklch(14.52% 0.0021 286.13);
|
|
181
|
+
--warning: oklch(87.9% 0.169 91.605);
|
|
182
|
+
--warning-foreground: oklch(14.52% 0.0021 286.13);
|
|
171
183
|
--border: oklch(27.02% 0.0073 285.9);
|
|
172
184
|
--input: oklch(32.39% 0.0123 285.69);
|
|
173
185
|
--ring: oklch(72.18% 0.1244 97.16);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type DateInput = Date | string | number;
|
|
2
|
+
/**
|
|
3
|
+
* Formats a date relative to now, for example `3 hours ago` or `in 2 days`.
|
|
4
|
+
*
|
|
5
|
+
* Values under 45 seconds render as `just now`. Invalid dates render as
|
|
6
|
+
* `Invalid date` rather than throwing, so list rows stay renderable.
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatRelativeTime(value: DateInput, now?: Date): string;
|
|
9
|
+
/**
|
|
10
|
+
* Formats a duration in seconds using the two largest relevant units.
|
|
11
|
+
*
|
|
12
|
+
* Examples: `45s`, `2m 10s`, `1h 5m`, `3d 2h`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatDuration(seconds: number): string;
|
|
15
|
+
/**
|
|
16
|
+
* Formats a byte count using binary units, for example `1.5 KB` or `2 MB`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatBytes(bytes: number): string;
|
|
19
|
+
/**
|
|
20
|
+
* Formats a number with the English grouping convention.
|
|
21
|
+
*
|
|
22
|
+
* Non-finite values render as an em dash, matching table fallbacks.
|
|
23
|
+
*/
|
|
24
|
+
export declare function formatNumber(value: number): string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const relativeTimeFormat = new Intl.RelativeTimeFormat('en', { numeric: 'auto' });
|
|
2
|
+
const numberFormat = new Intl.NumberFormat('en');
|
|
3
|
+
const byteFormat = new Intl.NumberFormat('en', { maximumFractionDigits: 1 });
|
|
4
|
+
const TIME_UNITS = [
|
|
5
|
+
['year', 365 * 24 * 60 * 60],
|
|
6
|
+
['month', 30 * 24 * 60 * 60],
|
|
7
|
+
['week', 7 * 24 * 60 * 60],
|
|
8
|
+
['day', 24 * 60 * 60],
|
|
9
|
+
['hour', 60 * 60],
|
|
10
|
+
['minute', 60],
|
|
11
|
+
];
|
|
12
|
+
const BYTE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
13
|
+
/**
|
|
14
|
+
* Formats a date relative to now, for example `3 hours ago` or `in 2 days`.
|
|
15
|
+
*
|
|
16
|
+
* Values under 45 seconds render as `just now`. Invalid dates render as
|
|
17
|
+
* `Invalid date` rather than throwing, so list rows stay renderable.
|
|
18
|
+
*/
|
|
19
|
+
export function formatRelativeTime(value, now = new Date()) {
|
|
20
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
21
|
+
if (Number.isNaN(date.getTime()))
|
|
22
|
+
return 'Invalid date';
|
|
23
|
+
const seconds = (date.getTime() - now.getTime()) / 1000;
|
|
24
|
+
const absoluteSeconds = Math.abs(seconds);
|
|
25
|
+
if (absoluteSeconds < 45)
|
|
26
|
+
return 'just now';
|
|
27
|
+
if (absoluteSeconds < 90)
|
|
28
|
+
return relativeTimeFormat.format(Math.sign(seconds), 'minute');
|
|
29
|
+
for (const [unit, unitSeconds] of TIME_UNITS) {
|
|
30
|
+
if (absoluteSeconds >= unitSeconds) {
|
|
31
|
+
return relativeTimeFormat.format(Math.round(seconds / unitSeconds), unit);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return relativeTimeFormat.format(Math.round(seconds), 'second');
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Formats a duration in seconds using the two largest relevant units.
|
|
38
|
+
*
|
|
39
|
+
* Examples: `45s`, `2m 10s`, `1h 5m`, `3d 2h`.
|
|
40
|
+
*/
|
|
41
|
+
export function formatDuration(seconds) {
|
|
42
|
+
if (!Number.isFinite(seconds) || seconds <= 0)
|
|
43
|
+
return '0s';
|
|
44
|
+
const total = Math.round(seconds);
|
|
45
|
+
const days = Math.floor(total / 86_400);
|
|
46
|
+
const hours = Math.floor((total % 86_400) / 3_600);
|
|
47
|
+
const minutes = Math.floor((total % 3_600) / 60);
|
|
48
|
+
const remainingSeconds = total % 60;
|
|
49
|
+
if (days > 0)
|
|
50
|
+
return hours > 0 ? `${days}d ${hours}h` : `${days}d`;
|
|
51
|
+
if (hours > 0)
|
|
52
|
+
return minutes > 0 ? `${hours}h ${minutes}m` : `${hours}h`;
|
|
53
|
+
if (minutes > 0)
|
|
54
|
+
return remainingSeconds > 0 ? `${minutes}m ${remainingSeconds}s` : `${minutes}m`;
|
|
55
|
+
return `${remainingSeconds}s`;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Formats a byte count using binary units, for example `1.5 KB` or `2 MB`.
|
|
59
|
+
*/
|
|
60
|
+
export function formatBytes(bytes) {
|
|
61
|
+
if (!Number.isFinite(bytes) || bytes <= 0)
|
|
62
|
+
return '0 B';
|
|
63
|
+
let value = bytes;
|
|
64
|
+
let unitIndex = 0;
|
|
65
|
+
while (value >= 1024 && unitIndex < BYTE_UNITS.length - 1) {
|
|
66
|
+
value /= 1024;
|
|
67
|
+
unitIndex += 1;
|
|
68
|
+
}
|
|
69
|
+
if (unitIndex === 0)
|
|
70
|
+
return `${formatNumber(Math.round(value))} B`;
|
|
71
|
+
return `${byteFormat.format(value)} ${BYTE_UNITS[unitIndex]}`;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Formats a number with the English grouping convention.
|
|
75
|
+
*
|
|
76
|
+
* Non-finite values render as an em dash, matching table fallbacks.
|
|
77
|
+
*/
|
|
78
|
+
export function formatNumber(value) {
|
|
79
|
+
if (!Number.isFinite(value))
|
|
80
|
+
return '—';
|
|
81
|
+
return numberFormat.format(value);
|
|
82
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,127 +1,126 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
2
|
+
"name": "@leap-online/jolt",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Leap's Svelte 5 component library.",
|
|
5
|
+
"author": "Leap Software Solutions",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Leap-Software-Solutions/jolt.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/Leap-Software-Solutions/jolt#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Leap-Software-Solutions/jolt/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=24"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"svelte",
|
|
21
|
+
"component-library",
|
|
22
|
+
"design-system",
|
|
23
|
+
"bits-ui",
|
|
24
|
+
"tailwindcss"
|
|
25
|
+
],
|
|
26
|
+
"sideEffects": [
|
|
27
|
+
"**/*.css"
|
|
28
|
+
],
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"!dist/**/*.stories.*",
|
|
32
|
+
"!dist/**/*.test.*",
|
|
33
|
+
"!dist/**/*.spec.*",
|
|
34
|
+
"THIRD_PARTY_NOTICES.md"
|
|
35
|
+
],
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"svelte": "./dist/index.js",
|
|
40
|
+
"default": "./dist/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./styles.css": "./dist/styles/theme.css",
|
|
43
|
+
"./package.json": "./package.json"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"bits-ui": "^2.20.0",
|
|
47
|
+
"svelte": "^5.33.0",
|
|
48
|
+
"tailwindcss": "^4.0.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@fontsource-variable/manrope": "^5.3.0",
|
|
53
|
+
"@internationalized/date": "^3.12.2",
|
|
54
|
+
"@lucide/svelte": "^1.70.0",
|
|
55
|
+
"@tanstack/svelte-table": "^9.3.1",
|
|
56
|
+
"clsx": "^2.1.1",
|
|
57
|
+
"highlight.js": "11.12.0",
|
|
58
|
+
"marked": "18.2.0",
|
|
59
|
+
"sanitize-html": "2.18.2",
|
|
60
|
+
"svelte-sonner": "^1.2.3",
|
|
61
|
+
"tailwind-merge": "^3.7.0",
|
|
62
|
+
"tailwind-variants": "^4.0.1",
|
|
63
|
+
"tw-animate-css": "^1.4.0",
|
|
64
|
+
"valibot": "^1.5.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@arethetypeswrong/cli": "0.18.5",
|
|
68
|
+
"@changesets/cli": "3.0.3",
|
|
69
|
+
"@eslint/compat": "2.1.1",
|
|
70
|
+
"@eslint/js": "10.0.1",
|
|
71
|
+
"@storybook/addon-a11y": "10.6.6",
|
|
72
|
+
"@storybook/addon-docs": "10.6.6",
|
|
73
|
+
"@storybook/addon-svelte-csf": "5.1.6",
|
|
74
|
+
"@storybook/addon-themes": "10.6.6",
|
|
75
|
+
"@storybook/addon-vitest": "10.6.6",
|
|
76
|
+
"@storybook/svelte-vite": "10.6.6",
|
|
77
|
+
"@sveltejs/package": "3.0.2",
|
|
78
|
+
"@sveltejs/vite-plugin-svelte": "7.3.1",
|
|
79
|
+
"@tailwindcss/vite": "4.3.5",
|
|
80
|
+
"@types/node": "26.6.6",
|
|
81
|
+
"@types/sanitize-html": "2.16.2",
|
|
82
|
+
"@vitest/browser-playwright": "5.1.0",
|
|
83
|
+
"bits-ui": "2.20.6",
|
|
84
|
+
"eslint": "10.14.0",
|
|
85
|
+
"eslint-config-prettier": "10.1.8",
|
|
86
|
+
"eslint-plugin-import-x": "4.18.1",
|
|
87
|
+
"eslint-plugin-simple-import-sort": "14.0.0",
|
|
88
|
+
"eslint-plugin-storybook": "10.6.6",
|
|
89
|
+
"eslint-plugin-svelte": "3.24.1",
|
|
90
|
+
"globals": "17.14.0",
|
|
91
|
+
"playwright": "1.65.0",
|
|
92
|
+
"prettier": "3.9.10",
|
|
93
|
+
"prettier-plugin-svelte": "4.1.1",
|
|
94
|
+
"prettier-plugin-tailwindcss": "0.8.1",
|
|
95
|
+
"publint": "0.3.25",
|
|
96
|
+
"storybook": "10.6.6",
|
|
97
|
+
"svelte": "5.57.3",
|
|
98
|
+
"svelte-check": "4.7.8",
|
|
99
|
+
"tailwindcss": "4.3.5",
|
|
100
|
+
"typescript": "6.0.3",
|
|
101
|
+
"typescript-eslint": "8.72.1",
|
|
102
|
+
"vite": "8.3.7",
|
|
103
|
+
"vitest": "5.1.0"
|
|
104
|
+
},
|
|
105
|
+
"publishConfig": {
|
|
106
|
+
"access": "public"
|
|
107
|
+
},
|
|
108
|
+
"scripts": {
|
|
109
|
+
"dev": "storybook dev -p 6006 --no-open",
|
|
110
|
+
"build": "svelte-package",
|
|
111
|
+
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
112
|
+
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
|
113
|
+
"lint": "prettier --check . && eslint .",
|
|
114
|
+
"format": "prettier --write .",
|
|
115
|
+
"test": "vitest run",
|
|
116
|
+
"test:unit": "vitest run --project=unit",
|
|
117
|
+
"test:components": "vitest run --project=components",
|
|
118
|
+
"test:storybook": "vitest run --project=storybook",
|
|
119
|
+
"storybook": "storybook dev -p 6006 --no-open",
|
|
120
|
+
"storybook:build": "storybook build",
|
|
121
|
+
"package": "svelte-package && publint",
|
|
122
|
+
"package:types": "attw --pack .",
|
|
123
|
+
"test:consumer": "pnpm build && node tests/consumer/verify.mjs",
|
|
124
|
+
"changeset": "changeset"
|
|
125
|
+
}
|
|
126
|
+
}
|