uisv 0.0.1 → 0.0.3
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/package.json +15 -3
- package/dist/components/alert.svelte +0 -244
- package/dist/components/alert.svelte.d.ts +0 -25
- package/dist/components/badge.svelte +0 -227
- package/dist/components/badge.svelte.d.ts +0 -19
- package/dist/components/button.svelte +0 -383
- package/dist/components/button.svelte.d.ts +0 -51
- package/dist/components/index.d.ts +0 -6
- package/dist/components/index.js +0 -6
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/theme/accordion.d.ts +0 -21
- package/dist/theme/accordion.js +0 -20
- package/dist/theme/alert.d.ts +0 -45
- package/dist/theme/alert.js +0 -102
- package/dist/theme/auth-form.d.ts +0 -21
- package/dist/theme/auth-form.js +0 -20
- package/dist/theme/avatar-group.d.ts +0 -41
- package/dist/theme/avatar-group.js +0 -40
- package/dist/theme/avatar.d.ts +0 -43
- package/dist/theme/avatar.js +0 -42
- package/dist/theme/badge.d.ts +0 -18
- package/dist/theme/badge.js +0 -131
- package/dist/theme/banner.d.ts +0 -29
- package/dist/theme/banner.js +0 -42
- package/dist/theme/blog-post.d.ts +0 -112
- package/dist/theme/blog-post.js +0 -116
- package/dist/theme/blog-posts.d.ts +0 -10
- package/dist/theme/blog-posts.js +0 -9
- package/dist/theme/breadcrumb.d.ts +0 -41
- package/dist/theme/breadcrumb.js +0 -42
- package/dist/theme/button.d.ts +0 -19
- package/dist/theme/button.js +0 -194
- package/dist/theme/calendar.d.ts +0 -59
- package/dist/theme/calendar.js +0 -68
- package/dist/theme/card.d.ts +0 -28
- package/dist/theme/card.js +0 -27
- package/dist/theme/carousel.d.ts +0 -36
- package/dist/theme/carousel.js +0 -38
- package/dist/theme/changelog-version.d.ts +0 -42
- package/dist/theme/changelog-version.js +0 -41
- package/dist/theme/changelog-versions.d.ts +0 -9
- package/dist/theme/changelog-versions.js +0 -8
- package/dist/theme/chat-message.d.ts +0 -101
- package/dist/theme/chat-message.js +0 -97
- package/dist/theme/chat-messages.d.ts +0 -15
- package/dist/theme/chat-messages.js +0 -14
- package/dist/theme/chat-palette.d.ts +0 -9
- package/dist/theme/chat-palette.js +0 -8
- package/dist/theme/chat-prompt-submit.d.ts +0 -6
- package/dist/theme/chat-prompt-submit.js +0 -5
- package/dist/theme/chat-prompt.d.ts +0 -29
- package/dist/theme/chat-prompt.js +0 -28
- package/dist/theme/checkbox-group.d.ts +0 -62
- package/dist/theme/checkbox-group.js +0 -105
- package/dist/theme/checkbox.d.ts +0 -92
- package/dist/theme/checkbox.js +0 -125
- package/dist/theme/chip.d.ts +0 -45
- package/dist/theme/chip.js +0 -62
- package/dist/theme/collapsible.d.ts +0 -7
- package/dist/theme/collapsible.js +0 -6
- package/dist/theme/color-picker.d.ts +0 -40
- package/dist/theme/color-picker.js +0 -39
- package/dist/theme/command-palette.d.ts +0 -47
- package/dist/theme/command-palette.js +0 -52
- package/dist/theme/container.d.ts +0 -4
- package/dist/theme/container.js +0 -3
- package/dist/theme/content/content-navigation.d.ts +0 -65
- package/dist/theme/content/content-navigation.js +0 -153
- package/dist/theme/content/content-search-button.d.ts +0 -7
- package/dist/theme/content/content-search-button.js +0 -6
- package/dist/theme/content/content-search.d.ts +0 -7
- package/dist/theme/content/content-search.js +0 -6
- package/dist/theme/content/content-surround.d.ts +0 -23
- package/dist/theme/content/content-surround.js +0 -21
- package/dist/theme/content/content-toc.d.ts +0 -53
- package/dist/theme/content/content-toc.js +0 -69
- package/dist/theme/content/index.d.ts +0 -5
- package/dist/theme/content/index.js +0 -5
- package/dist/theme/context-menu.d.ts +0 -91
- package/dist/theme/context-menu.js +0 -114
- package/dist/theme/dashboard-group.d.ts +0 -4
- package/dist/theme/dashboard-group.js +0 -3
- package/dist/theme/dashboard-navbar.d.ts +0 -22
- package/dist/theme/dashboard-navbar.js +0 -21
- package/dist/theme/dashboard-panel.d.ts +0 -18
- package/dist/theme/dashboard-panel.js +0 -17
- package/dist/theme/dashboard-resize-handle.d.ts +0 -4
- package/dist/theme/dashboard-resize-handle.js +0 -3
- package/dist/theme/dashboard-search-button.d.ts +0 -7
- package/dist/theme/dashboard-search-button.js +0 -6
- package/dist/theme/dashboard-search.d.ts +0 -7
- package/dist/theme/dashboard-search.js +0 -6
- package/dist/theme/dashboard-sidebar-collapse.d.ts +0 -10
- package/dist/theme/dashboard-sidebar-collapse.js +0 -9
- package/dist/theme/dashboard-sidebar-toggle.d.ts +0 -10
- package/dist/theme/dashboard-sidebar-toggle.js +0 -9
- package/dist/theme/dashboard-sidebar.d.ts +0 -38
- package/dist/theme/dashboard-sidebar.js +0 -37
- package/dist/theme/dashboard-toolbar.d.ts +0 -8
- package/dist/theme/dashboard-toolbar.js +0 -7
- package/dist/theme/drawer.d.ts +0 -54
- package/dist/theme/drawer.js +0 -110
- package/dist/theme/dropdown-menu.d.ts +0 -92
- package/dist/theme/dropdown-menu.js +0 -115
- package/dist/theme/error.d.ts +0 -10
- package/dist/theme/error.js +0 -9
- package/dist/theme/file-upload.d.ts +0 -100
- package/dist/theme/file-upload.js +0 -212
- package/dist/theme/footer-columns.d.ts +0 -27
- package/dist/theme/footer-columns.js +0 -25
- package/dist/theme/footer.d.ts +0 -12
- package/dist/theme/footer.js +0 -11
- package/dist/theme/form-field.d.ts +0 -41
- package/dist/theme/form-field.js +0 -30
- package/dist/theme/form.d.ts +0 -4
- package/dist/theme/form.js +0 -3
- package/dist/theme/header.d.ts +0 -26
- package/dist/theme/header.js +0 -25
- package/dist/theme/icons.d.ts +0 -44
- package/dist/theme/icons.js +0 -43
- package/dist/theme/index.d.ts +0 -99
- package/dist/theme/index.js +0 -99
- package/dist/theme/input-menu.d.ts +0 -159
- package/dist/theme/input-menu.js +0 -136
- package/dist/theme/input-number.d.ts +0 -16
- package/dist/theme/input-number.js +0 -130
- package/dist/theme/input-tags.d.ts +0 -86
- package/dist/theme/input-tags.js +0 -50
- package/dist/theme/input.d.ts +0 -20
- package/dist/theme/input.js +0 -179
- package/dist/theme/kbd.d.ts +0 -26
- package/dist/theme/kbd.js +0 -67
- package/dist/theme/link.d.ts +0 -18
- package/dist/theme/link.js +0 -19
- package/dist/theme/main.d.ts +0 -4
- package/dist/theme/main.js +0 -3
- package/dist/theme/marquee.d.ts +0 -47
- package/dist/theme/marquee.js +0 -56
- package/dist/theme/modal.d.ts +0 -30
- package/dist/theme/modal.js +0 -29
- package/dist/theme/navigation-menu.d.ts +0 -108
- package/dist/theme/navigation-menu.js +0 -315
- package/dist/theme/page-anchors.d.ts +0 -26
- package/dist/theme/page-anchors.js +0 -24
- package/dist/theme/page-aside.d.ts +0 -11
- package/dist/theme/page-aside.js +0 -10
- package/dist/theme/page-body.d.ts +0 -4
- package/dist/theme/page-body.js +0 -3
- package/dist/theme/page-card.d.ts +0 -90
- package/dist/theme/page-card.js +0 -156
- package/dist/theme/page-columns.d.ts +0 -4
- package/dist/theme/page-columns.js +0 -3
- package/dist/theme/page-cta.d.ts +0 -63
- package/dist/theme/page-cta.js +0 -62
- package/dist/theme/page-feature.d.ts +0 -27
- package/dist/theme/page-feature.js +0 -26
- package/dist/theme/page-grid.d.ts +0 -4
- package/dist/theme/page-grid.js +0 -3
- package/dist/theme/page-header.d.ts +0 -19
- package/dist/theme/page-header.js +0 -18
- package/dist/theme/page-hero.d.ts +0 -45
- package/dist/theme/page-hero.js +0 -44
- package/dist/theme/page-links.d.ts +0 -24
- package/dist/theme/page-links.js +0 -22
- package/dist/theme/page-list.d.ts +0 -9
- package/dist/theme/page-list.js +0 -8
- package/dist/theme/page-logos.d.ts +0 -16
- package/dist/theme/page-logos.js +0 -15
- package/dist/theme/page-section.d.ts +0 -85
- package/dist/theme/page-section.js +0 -75
- package/dist/theme/page.d.ts +0 -24
- package/dist/theme/page.js +0 -29
- package/dist/theme/pagination.d.ts +0 -14
- package/dist/theme/pagination.js +0 -13
- package/dist/theme/pin-input.d.ts +0 -45
- package/dist/theme/pin-input.js +0 -69
- package/dist/theme/popover.d.ts +0 -7
- package/dist/theme/popover.js +0 -6
- package/dist/theme/pricing-plan.d.ts +0 -81
- package/dist/theme/pricing-plan.js +0 -86
- package/dist/theme/pricing-plans.d.ts +0 -21
- package/dist/theme/pricing-plans.js +0 -20
- package/dist/theme/pricing-table.d.ts +0 -52
- package/dist/theme/pricing-table.js +0 -51
- package/dist/theme/progress.d.ts +0 -131
- package/dist/theme/progress.js +0 -241
- package/dist/theme/prose/a.d.ts +0 -5
- package/dist/theme/prose/a.js +0 -3
- package/dist/theme/prose/accordion-item.d.ts +0 -4
- package/dist/theme/prose/accordion-item.js +0 -3
- package/dist/theme/prose/accordion.d.ts +0 -7
- package/dist/theme/prose/accordion.js +0 -6
- package/dist/theme/prose/badge.d.ts +0 -4
- package/dist/theme/prose/badge.js +0 -3
- package/dist/theme/prose/blockquote.d.ts +0 -4
- package/dist/theme/prose/blockquote.js +0 -3
- package/dist/theme/prose/callout.d.ts +0 -25
- package/dist/theme/prose/callout.js +0 -42
- package/dist/theme/prose/card-group.d.ts +0 -4
- package/dist/theme/prose/card-group.js +0 -3
- package/dist/theme/prose/card.d.ts +0 -30
- package/dist/theme/prose/card.js +0 -45
- package/dist/theme/prose/code-collapse.d.ts +0 -20
- package/dist/theme/prose/code-collapse.js +0 -19
- package/dist/theme/prose/code-group.d.ts +0 -12
- package/dist/theme/prose/code-group.js +0 -10
- package/dist/theme/prose/code-icon.d.ts +0 -67
- package/dist/theme/prose/code-icon.js +0 -66
- package/dist/theme/prose/code-preview.d.ts +0 -15
- package/dist/theme/prose/code-preview.js +0 -14
- package/dist/theme/prose/code-tree.d.ts +0 -27
- package/dist/theme/prose/code-tree.js +0 -25
- package/dist/theme/prose/code.d.ts +0 -13
- package/dist/theme/prose/code.js +0 -12
- package/dist/theme/prose/collapsible.d.ts +0 -11
- package/dist/theme/prose/collapsible.js +0 -9
- package/dist/theme/prose/em.d.ts +0 -4
- package/dist/theme/prose/em.js +0 -3
- package/dist/theme/prose/field-group.d.ts +0 -4
- package/dist/theme/prose/field-group.js +0 -3
- package/dist/theme/prose/field.d.ts +0 -12
- package/dist/theme/prose/field.js +0 -11
- package/dist/theme/prose/h1.d.ts +0 -7
- package/dist/theme/prose/h1.js +0 -6
- package/dist/theme/prose/h2.d.ts +0 -10
- package/dist/theme/prose/h2.js +0 -8
- package/dist/theme/prose/h3.d.ts +0 -10
- package/dist/theme/prose/h3.js +0 -8
- package/dist/theme/prose/h4.d.ts +0 -7
- package/dist/theme/prose/h4.js +0 -6
- package/dist/theme/prose/hr.d.ts +0 -4
- package/dist/theme/prose/hr.js +0 -3
- package/dist/theme/prose/icon.d.ts +0 -4
- package/dist/theme/prose/icon.js +0 -3
- package/dist/theme/prose/img.d.ts +0 -21
- package/dist/theme/prose/img.js +0 -20
- package/dist/theme/prose/index.d.ts +0 -41
- package/dist/theme/prose/index.js +0 -41
- package/dist/theme/prose/kbd.d.ts +0 -4
- package/dist/theme/prose/kbd.js +0 -3
- package/dist/theme/prose/li.d.ts +0 -4
- package/dist/theme/prose/li.js +0 -3
- package/dist/theme/prose/ol.d.ts +0 -4
- package/dist/theme/prose/ol.js +0 -3
- package/dist/theme/prose/p.d.ts +0 -4
- package/dist/theme/prose/p.js +0 -3
- package/dist/theme/prose/pre.d.ts +0 -18
- package/dist/theme/prose/pre.js +0 -17
- package/dist/theme/prose/steps.d.ts +0 -14
- package/dist/theme/prose/steps.js +0 -13
- package/dist/theme/prose/strong.d.ts +0 -4
- package/dist/theme/prose/strong.js +0 -3
- package/dist/theme/prose/table.d.ts +0 -7
- package/dist/theme/prose/table.js +0 -6
- package/dist/theme/prose/tabs-item.d.ts +0 -4
- package/dist/theme/prose/tabs-item.js +0 -3
- package/dist/theme/prose/tabs.d.ts +0 -6
- package/dist/theme/prose/tabs.js +0 -5
- package/dist/theme/prose/tbody.d.ts +0 -4
- package/dist/theme/prose/tbody.js +0 -3
- package/dist/theme/prose/td.d.ts +0 -4
- package/dist/theme/prose/td.js +0 -3
- package/dist/theme/prose/th.d.ts +0 -4
- package/dist/theme/prose/th.js +0 -3
- package/dist/theme/prose/thead.d.ts +0 -4
- package/dist/theme/prose/thead.js +0 -3
- package/dist/theme/prose/tr.d.ts +0 -4
- package/dist/theme/prose/tr.js +0 -3
- package/dist/theme/prose/ul.d.ts +0 -4
- package/dist/theme/prose/ul.js +0 -3
- package/dist/theme/radio-group.d.ts +0 -117
- package/dist/theme/radio-group.js +0 -180
- package/dist/theme/select-menu.d.ts +0 -141
- package/dist/theme/select-menu.js +0 -21
- package/dist/theme/select.d.ts +0 -86
- package/dist/theme/select.js +0 -100
- package/dist/theme/separator.d.ts +0 -61
- package/dist/theme/separator.js +0 -104
- package/dist/theme/skeleton.d.ts +0 -4
- package/dist/theme/skeleton.js +0 -3
- package/dist/theme/slideover.d.ts +0 -42
- package/dist/theme/slideover.js +0 -59
- package/dist/theme/slider.d.ts +0 -60
- package/dist/theme/slider.js +0 -131
- package/dist/theme/stepper.d.ts +0 -94
- package/dist/theme/stepper.js +0 -137
- package/dist/theme/switch.d.ts +0 -84
- package/dist/theme/switch.js +0 -96
- package/dist/theme/table.d.ts +0 -56
- package/dist/theme/table.js +0 -99
- package/dist/theme/tabs.d.ts +0 -78
- package/dist/theme/tabs.js +0 -145
- package/dist/theme/textarea.d.ts +0 -72
- package/dist/theme/textarea.js +0 -39
- package/dist/theme/timeline.d.ts +0 -52
- package/dist/theme/timeline.js +0 -212
- package/dist/theme/toast.d.ts +0 -41
- package/dist/theme/toast.js +0 -47
- package/dist/theme/toaster.d.ts +0 -50
- package/dist/theme/toaster.js +0 -56
- package/dist/theme/tooltip.d.ts +0 -10
- package/dist/theme/tooltip.js +0 -9
- package/dist/theme/tree.d.ts +0 -66
- package/dist/theme/tree.js +0 -89
- package/dist/theme/user.d.ts +0 -85
- package/dist/theme/user.js +0 -83
- package/dist/types.d.ts +0 -7
- package/dist/types.js +0 -1
- package/dist/utils/common.d.ts +0 -14
- package/dist/utils/common.js +0 -18
- package/dist/utils/keys.d.ts +0 -8
- package/dist/utils/keys.js +0 -8
- package/dist/utils/types.d.ts +0 -1
- package/dist/utils/types.js +0 -1
- package/dist/vite.d.ts +0 -34
- package/dist/vite.js +0 -73
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uisv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "ui library for the rest of us",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "ui-sv/uisv",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build": "vite build && npm run prepack",
|
|
11
11
|
"preview": "vite preview",
|
|
12
12
|
"prepare": "svelte-kit sync || echo ''",
|
|
13
|
-
"prepack": "
|
|
13
|
+
"prepack": "svelte-kit sync && svelte-package && publint",
|
|
14
14
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
15
15
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
16
16
|
"format": "prettier --write .",
|
|
@@ -33,6 +33,10 @@
|
|
|
33
33
|
".": {
|
|
34
34
|
"types": "./dist/index.d.ts",
|
|
35
35
|
"svelte": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./vite": {
|
|
38
|
+
"types": "./dist/vite.d.ts",
|
|
39
|
+
"svelte": "./dist/vite.js"
|
|
36
40
|
}
|
|
37
41
|
},
|
|
38
42
|
"peerDependencies": {
|
|
@@ -49,14 +53,17 @@
|
|
|
49
53
|
"@sveltejs/vite-plugin-svelte": "^6.0.0",
|
|
50
54
|
"@tailwindcss/vite": "^4.1.13",
|
|
51
55
|
"@types/node": "^22",
|
|
56
|
+
"@unocss/preset-web-fonts": "^66.5.2",
|
|
52
57
|
"@unocss/reset": "^66.5.1",
|
|
53
58
|
"@vitest/browser": "^3.2.3",
|
|
54
59
|
"bits-ui": "^2.11.0",
|
|
60
|
+
"carta-md": "^4.11.1",
|
|
55
61
|
"defu": "^6.1.4",
|
|
56
62
|
"eslint": "^9.22.0",
|
|
57
63
|
"eslint-config-prettier": "^10.0.1",
|
|
58
64
|
"eslint-plugin-svelte": "^3.0.0",
|
|
59
65
|
"globals": "^16.0.0",
|
|
66
|
+
"mdsvex": "^0.12.3",
|
|
60
67
|
"playwright": "^1.53.0",
|
|
61
68
|
"prettier": "^3.4.2",
|
|
62
69
|
"prettier-plugin-svelte": "^3.3.3",
|
|
@@ -78,5 +85,10 @@
|
|
|
78
85
|
},
|
|
79
86
|
"keywords": [
|
|
80
87
|
"svelte"
|
|
81
|
-
]
|
|
88
|
+
],
|
|
89
|
+
"pnpm": {
|
|
90
|
+
"onlyBuiltDependencies": [
|
|
91
|
+
"esbuild"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
82
94
|
}
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import type { PropColor } from '../types.js';
|
|
3
|
-
import type { Component, Snippet } from 'svelte';
|
|
4
|
-
import type { ButtonProps } from './button.svelte';
|
|
5
|
-
import type { ClassNameValue } from 'tailwind-merge';
|
|
6
|
-
import { tv } from 'tailwind-variants';
|
|
7
|
-
import { isSnippet } from '../utils/common.js';
|
|
8
|
-
|
|
9
|
-
export type AlertProps = {
|
|
10
|
-
title?: string | Snippet;
|
|
11
|
-
description?: string | Snippet;
|
|
12
|
-
icon?: string | Snippet | Component;
|
|
13
|
-
color?: PropColor;
|
|
14
|
-
variant?: 'solid' | 'outline' | 'soft' | 'subtle';
|
|
15
|
-
position?: 'bottom' | 'right';
|
|
16
|
-
actions?: ButtonProps[];
|
|
17
|
-
close?: boolean | ButtonProps;
|
|
18
|
-
closeiicon?: string | Snippet | Component;
|
|
19
|
-
ui?: {
|
|
20
|
-
base?: ClassNameValue;
|
|
21
|
-
icon?: ClassNameValue;
|
|
22
|
-
description?: ClassNameValue;
|
|
23
|
-
title?: ClassNameValue;
|
|
24
|
-
};
|
|
25
|
-
onclose?: () => void | Promise<void>;
|
|
26
|
-
};
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<script lang="ts">
|
|
30
|
-
let {
|
|
31
|
-
title,
|
|
32
|
-
description,
|
|
33
|
-
close,
|
|
34
|
-
icon,
|
|
35
|
-
actions = [],
|
|
36
|
-
closeiicon = '',
|
|
37
|
-
color = 'primary',
|
|
38
|
-
variant = 'solid',
|
|
39
|
-
position = 'bottom',
|
|
40
|
-
ui = {},
|
|
41
|
-
onclose = () => {}
|
|
42
|
-
}: AlertProps = $props();
|
|
43
|
-
|
|
44
|
-
const classes = $derived.by(() =>
|
|
45
|
-
tv({
|
|
46
|
-
slots: {
|
|
47
|
-
base: 'flex gap-2 font-sans p-4 pb-2 rounded-lg',
|
|
48
|
-
icon: 'pi size-6',
|
|
49
|
-
actions: '',
|
|
50
|
-
description: 'text-opacity-50 text-sm',
|
|
51
|
-
title: 'font-medium'
|
|
52
|
-
},
|
|
53
|
-
variants: {
|
|
54
|
-
color: {
|
|
55
|
-
primary: '',
|
|
56
|
-
secondary: '',
|
|
57
|
-
info: '',
|
|
58
|
-
success: '',
|
|
59
|
-
warning: '',
|
|
60
|
-
error: ''
|
|
61
|
-
},
|
|
62
|
-
variant: {
|
|
63
|
-
solid: {
|
|
64
|
-
base: 'text-white',
|
|
65
|
-
description: 'text-white/90'
|
|
66
|
-
},
|
|
67
|
-
outline: 'border',
|
|
68
|
-
soft: '',
|
|
69
|
-
subtle: 'border'
|
|
70
|
-
},
|
|
71
|
-
position: {
|
|
72
|
-
right: {
|
|
73
|
-
base: ''
|
|
74
|
-
},
|
|
75
|
-
bottom: {
|
|
76
|
-
base: 'flex-col'
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
compoundVariants: [
|
|
81
|
-
{
|
|
82
|
-
variant: 'solid',
|
|
83
|
-
color: 'primary',
|
|
84
|
-
class: 'bg-primary-500'
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
variant: 'solid',
|
|
88
|
-
color: 'secondary',
|
|
89
|
-
class: 'bg-secondary-900'
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
variant: 'solid',
|
|
93
|
-
color: 'info',
|
|
94
|
-
class: 'bg-info-500'
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
variant: 'solid',
|
|
98
|
-
color: 'success',
|
|
99
|
-
class: 'bg-success-500'
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
variant: 'solid',
|
|
103
|
-
color: 'warning',
|
|
104
|
-
class: 'bg-warning-500'
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
variant: 'solid',
|
|
108
|
-
color: 'error',
|
|
109
|
-
class: 'bg-error-500'
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
{
|
|
113
|
-
variant: 'outline',
|
|
114
|
-
color: 'primary',
|
|
115
|
-
class: 'border-primary-300 text-primary-500'
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
variant: 'outline',
|
|
119
|
-
color: 'secondary',
|
|
120
|
-
class: 'border-secondary-300 text-secondary-900'
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
variant: 'outline',
|
|
124
|
-
color: 'info',
|
|
125
|
-
class: 'border-info-300 text-info-500'
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
variant: 'outline',
|
|
129
|
-
color: 'success',
|
|
130
|
-
class: 'border-success-300 text-success-500'
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
variant: 'outline',
|
|
134
|
-
color: 'warning',
|
|
135
|
-
class: 'border-warning-300 text-warning-500'
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
variant: 'outline',
|
|
139
|
-
color: 'error',
|
|
140
|
-
class: 'border-error-300 text-error-500'
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
{
|
|
144
|
-
variant: 'soft',
|
|
145
|
-
color: 'primary',
|
|
146
|
-
class: 'bg-primary-100 text-primary-500'
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
variant: 'soft',
|
|
150
|
-
color: 'secondary',
|
|
151
|
-
class: 'bg-secondary-50 text-secondary-900'
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
variant: 'soft',
|
|
155
|
-
color: 'info',
|
|
156
|
-
class: 'bg-info-50 text-info-500'
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
variant: 'soft',
|
|
160
|
-
color: 'success',
|
|
161
|
-
class: 'bg-success-50 text-success-500'
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
variant: 'soft',
|
|
165
|
-
color: 'warning',
|
|
166
|
-
class: 'bg-warning-50 text-warning-500'
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
variant: 'soft',
|
|
170
|
-
color: 'error',
|
|
171
|
-
class: 'bg-error-50 text-error-500'
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
{
|
|
175
|
-
variant: 'subtle',
|
|
176
|
-
color: 'primary',
|
|
177
|
-
class: 'bg-primary-100 text-primary-500 border-primary-300'
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
variant: 'subtle',
|
|
181
|
-
color: 'secondary',
|
|
182
|
-
class: 'bg-secondary-50 text-secondary-900 border-secondary-300'
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
variant: 'subtle',
|
|
186
|
-
color: 'info',
|
|
187
|
-
class: 'bg-info-50 text-info-500 border-info-300'
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
variant: 'subtle',
|
|
191
|
-
color: 'success',
|
|
192
|
-
class: 'bg-success-50 text-success-500 border-success-300'
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
variant: 'subtle',
|
|
196
|
-
color: 'warning',
|
|
197
|
-
class: 'bg-warning-50 text-warning-500 border-warning-300'
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
variant: 'subtle',
|
|
201
|
-
color: 'error',
|
|
202
|
-
class: 'bg-error-50 text-error-500 border-error-300'
|
|
203
|
-
}
|
|
204
|
-
]
|
|
205
|
-
})({ color, variant, position })
|
|
206
|
-
);
|
|
207
|
-
</script>
|
|
208
|
-
|
|
209
|
-
<div class={classes.base({ class: [position === 'bottom' ? '' : 'flex', ui.base] })}>
|
|
210
|
-
<div class="flex gap-2">
|
|
211
|
-
{#if icon}
|
|
212
|
-
<div class="size-6">
|
|
213
|
-
{#if typeof icon === 'string'}
|
|
214
|
-
<div class={classes.icon({ class: [icon] })}></div>
|
|
215
|
-
{:else if isSnippet(icon)}
|
|
216
|
-
{@render icon()}
|
|
217
|
-
{:else}
|
|
218
|
-
{@const Icon = icon}
|
|
219
|
-
<Icon />
|
|
220
|
-
{/if}
|
|
221
|
-
</div>
|
|
222
|
-
{/if}
|
|
223
|
-
|
|
224
|
-
<div class="space-y-1">
|
|
225
|
-
<div class={classes.title({ class: [ui.title] })}>
|
|
226
|
-
{#if isSnippet(title)}
|
|
227
|
-
{@render title()}
|
|
228
|
-
{:else}
|
|
229
|
-
{title}
|
|
230
|
-
{/if}
|
|
231
|
-
</div>
|
|
232
|
-
|
|
233
|
-
<div class={classes.description({ class: [ui.title] })}>
|
|
234
|
-
{#if isSnippet(description)}
|
|
235
|
-
{@render description()}
|
|
236
|
-
{:else}
|
|
237
|
-
{description}
|
|
238
|
-
{/if}
|
|
239
|
-
</div>
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
|
|
243
|
-
<div></div>
|
|
244
|
-
</div>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { PropColor } from '../types.js';
|
|
2
|
-
import type { Component, Snippet } from 'svelte';
|
|
3
|
-
import type { ButtonProps } from './button.svelte';
|
|
4
|
-
import type { ClassNameValue } from 'tailwind-merge';
|
|
5
|
-
export type AlertProps = {
|
|
6
|
-
title?: string | Snippet;
|
|
7
|
-
description?: string | Snippet;
|
|
8
|
-
icon?: string | Snippet | Component;
|
|
9
|
-
color?: PropColor;
|
|
10
|
-
variant?: 'solid' | 'outline' | 'soft' | 'subtle';
|
|
11
|
-
position?: 'bottom' | 'right';
|
|
12
|
-
actions?: ButtonProps[];
|
|
13
|
-
close?: boolean | ButtonProps;
|
|
14
|
-
closeiicon?: string | Snippet | Component;
|
|
15
|
-
ui?: {
|
|
16
|
-
base?: ClassNameValue;
|
|
17
|
-
icon?: ClassNameValue;
|
|
18
|
-
description?: ClassNameValue;
|
|
19
|
-
title?: ClassNameValue;
|
|
20
|
-
};
|
|
21
|
-
onclose?: () => void | Promise<void>;
|
|
22
|
-
};
|
|
23
|
-
declare const Alert: Component<AlertProps, {}, "">;
|
|
24
|
-
type Alert = ReturnType<typeof Alert>;
|
|
25
|
-
export default Alert;
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
import type { Component, Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
export type BadgeProps = {
|
|
5
|
-
label?: string;
|
|
6
|
-
color?: PropColor;
|
|
7
|
-
variant?: 'solid' | 'outline' | 'soft' | 'subtle';
|
|
8
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
-
icon?: string | Snippet | Component;
|
|
10
|
-
trailingicon?: boolean;
|
|
11
|
-
children?: Snippet;
|
|
12
|
-
ui?: {
|
|
13
|
-
base?: ClassNameValue;
|
|
14
|
-
icon?: ClassNameValue;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<script lang="ts">
|
|
20
|
-
import { tv } from 'tailwind-variants';
|
|
21
|
-
import { isSnippet } from '../utils/common.js';
|
|
22
|
-
import type { PropColor } from '../types.js';
|
|
23
|
-
import type { ClassNameValue } from 'tailwind-merge';
|
|
24
|
-
|
|
25
|
-
let {
|
|
26
|
-
icon,
|
|
27
|
-
label,
|
|
28
|
-
trailingicon,
|
|
29
|
-
color = 'primary',
|
|
30
|
-
size = 'md',
|
|
31
|
-
variant = 'solid',
|
|
32
|
-
ui = {},
|
|
33
|
-
children
|
|
34
|
-
}: BadgeProps = $props();
|
|
35
|
-
|
|
36
|
-
const classes = $derived.by(() => {
|
|
37
|
-
return tv({
|
|
38
|
-
slots: { icon: '', base: 'flex-inline items-center font-sans' },
|
|
39
|
-
variants: {
|
|
40
|
-
color: {
|
|
41
|
-
primary: '',
|
|
42
|
-
secondary: '',
|
|
43
|
-
error: '',
|
|
44
|
-
success: '',
|
|
45
|
-
info: '',
|
|
46
|
-
warning: ''
|
|
47
|
-
},
|
|
48
|
-
variant: {
|
|
49
|
-
link: '',
|
|
50
|
-
solid: 'text-white',
|
|
51
|
-
outline: 'border',
|
|
52
|
-
soft: '',
|
|
53
|
-
subtle: 'border',
|
|
54
|
-
ghost: ''
|
|
55
|
-
},
|
|
56
|
-
size: {
|
|
57
|
-
xs: {
|
|
58
|
-
base: 'font-medium text-[0.5rem] px-1 h-4 rounded gap-1',
|
|
59
|
-
icon: 'size-3'
|
|
60
|
-
},
|
|
61
|
-
sm: { base: 'font-medium text-[0.625rem] px-1 h-5 rounded gap-1', icon: 'size-3' },
|
|
62
|
-
md: { base: 'font-medium text-xs rounded-md px-2 h-6 gap-2', icon: 'size-4' },
|
|
63
|
-
lg: { base: 'font-medium text-sm px-2 h-7 rounded-md gap-2', icon: 'size-5' },
|
|
64
|
-
xl: { base: 'font-medium px-3 h-8 rounded-md gap-2', icon: 'size-5' }
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
compoundVariants: [
|
|
68
|
-
{
|
|
69
|
-
color: 'primary',
|
|
70
|
-
variant: 'solid',
|
|
71
|
-
class: 'bg-primary-400'
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
color: 'secondary',
|
|
75
|
-
variant: 'solid',
|
|
76
|
-
class: 'bg-secondary-900'
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
color: 'info',
|
|
80
|
-
variant: 'solid',
|
|
81
|
-
class: 'bg-blue-500'
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
color: 'success',
|
|
85
|
-
variant: 'solid',
|
|
86
|
-
class: 'bg-green-500'
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
color: 'error',
|
|
90
|
-
variant: 'solid',
|
|
91
|
-
class: 'bg-red-500'
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
color: 'warning',
|
|
95
|
-
variant: 'solid',
|
|
96
|
-
class: 'bg-yellow-500'
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
{
|
|
100
|
-
color: 'primary',
|
|
101
|
-
variant: 'outline',
|
|
102
|
-
class: 'border-primary-300 text-primary-400'
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
color: 'secondary',
|
|
106
|
-
variant: 'outline',
|
|
107
|
-
class: 'border-secondary-300 text-secondary-900'
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
color: 'info',
|
|
111
|
-
variant: 'outline',
|
|
112
|
-
class: 'border-blue-300 text-blue-500'
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
color: 'success',
|
|
116
|
-
variant: 'outline',
|
|
117
|
-
class: 'border-green-300 text-green-500'
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
color: 'error',
|
|
121
|
-
variant: 'outline',
|
|
122
|
-
class: 'border-red-300 text-red-500'
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
color: 'warning',
|
|
126
|
-
variant: 'outline',
|
|
127
|
-
class: 'border-yellow-300 text-yellow-500'
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
{
|
|
131
|
-
color: 'primary',
|
|
132
|
-
variant: 'soft',
|
|
133
|
-
class: ' bg-primary-50 text-primary-500'
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
color: 'secondary',
|
|
137
|
-
variant: 'soft',
|
|
138
|
-
class: 'bg-secondary-100 text-secondary-800'
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
color: 'info',
|
|
142
|
-
variant: 'soft',
|
|
143
|
-
class: 'bg-blue-100 text-blue-500'
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
color: 'success',
|
|
147
|
-
variant: 'soft',
|
|
148
|
-
class: 'bg-green-100 text-green-500'
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
color: 'error',
|
|
152
|
-
variant: 'soft',
|
|
153
|
-
class: 'bg-red-100 text-red-500'
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
color: 'warning',
|
|
157
|
-
variant: 'soft',
|
|
158
|
-
class: 'bg-yellow-100 text-yellow-500 '
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
{
|
|
162
|
-
color: 'primary',
|
|
163
|
-
variant: 'subtle',
|
|
164
|
-
class: 'bg-primary-50 text-primary-500 border-primary-200 '
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
color: 'secondary',
|
|
168
|
-
variant: 'subtle',
|
|
169
|
-
class: 'bg-secondary-100 text-secondary-800 border-secondary-300 '
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
color: 'info',
|
|
173
|
-
variant: 'subtle',
|
|
174
|
-
class: 'bg-blue-50 text-blue-600 border-blue-200'
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
color: 'success',
|
|
178
|
-
variant: 'subtle',
|
|
179
|
-
class: 'bg-green-100 text-green-600 border-green-300'
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
color: 'error',
|
|
183
|
-
variant: 'subtle',
|
|
184
|
-
class: 'bg-red-50 text-red-600 border-red-200'
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
color: 'warning',
|
|
188
|
-
variant: 'subtle',
|
|
189
|
-
class: 'bg-yellow-50 text-yellow-600 border-yellow-300'
|
|
190
|
-
}
|
|
191
|
-
]
|
|
192
|
-
})({ variant, size, color });
|
|
193
|
-
});
|
|
194
|
-
</script>
|
|
195
|
-
|
|
196
|
-
<span
|
|
197
|
-
class={classes.base({
|
|
198
|
-
class: [icon && !(children || label) ? 'px-0 aspect-square justify-center' : '', ui.base]
|
|
199
|
-
})}
|
|
200
|
-
>
|
|
201
|
-
{#if !trailingicon}
|
|
202
|
-
{@render Icon()}
|
|
203
|
-
{/if}
|
|
204
|
-
|
|
205
|
-
{#if label}
|
|
206
|
-
{label}
|
|
207
|
-
{:else}
|
|
208
|
-
{@render children?.()}
|
|
209
|
-
{/if}
|
|
210
|
-
|
|
211
|
-
{#if trailingicon}
|
|
212
|
-
{@render Icon()}
|
|
213
|
-
{/if}
|
|
214
|
-
</span>
|
|
215
|
-
|
|
216
|
-
{#snippet Icon()}
|
|
217
|
-
{#if icon}
|
|
218
|
-
{#if typeof icon === 'string'}
|
|
219
|
-
<div class={['pi', icon, classes.icon(), ui.icon]}></div>
|
|
220
|
-
{:else if isSnippet(icon)}
|
|
221
|
-
{@render icon()}
|
|
222
|
-
{:else}
|
|
223
|
-
{@const Icon = icon}
|
|
224
|
-
<Icon />
|
|
225
|
-
{/if}
|
|
226
|
-
{/if}
|
|
227
|
-
{/snippet}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Component, Snippet } from 'svelte';
|
|
2
|
-
export type BadgeProps = {
|
|
3
|
-
label?: string;
|
|
4
|
-
color?: PropColor;
|
|
5
|
-
variant?: 'solid' | 'outline' | 'soft' | 'subtle';
|
|
6
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
-
icon?: string | Snippet | Component;
|
|
8
|
-
trailingicon?: boolean;
|
|
9
|
-
children?: Snippet;
|
|
10
|
-
ui?: {
|
|
11
|
-
base?: ClassNameValue;
|
|
12
|
-
icon?: ClassNameValue;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
import type { PropColor } from '../types.js';
|
|
16
|
-
import type { ClassNameValue } from 'tailwind-merge';
|
|
17
|
-
declare const Badge: Component<BadgeProps, {}, "">;
|
|
18
|
-
type Badge = ReturnType<typeof Badge>;
|
|
19
|
-
export default Badge;
|