tera-system-ui 0.0.21 → 0.0.23
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/avatar/Avatar.d.ts +82 -0
- package/dist/components/avatar/Avatar.js +35 -0
- package/dist/components/avatar/Avatar.svelte +43 -0
- package/dist/components/avatar/Avatar.svelte.d.ts +3 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/dialog/Dialog.astro +2 -1
- package/dist/components/dialog/Dialog.d.ts +2 -0
- package/dist/components/dialog/Dialog.svelte +8 -8
- package/dist/components/dialog/Dialog.svelte.d.ts +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +22 -0
- package/dist/components/dropdown-menu/DropdownMenu.js +15 -0
- package/dist/components/dropdown-menu/components/DropdownMenu.svelte +34 -0
- package/dist/components/dropdown-menu/components/DropdownMenu.svelte.d.ts +3 -0
- package/dist/components/dropdown-menu/components/DropdownMenuGroup.svelte +12 -0
- package/dist/components/dropdown-menu/components/DropdownMenuGroup.svelte.d.ts +5 -0
- package/dist/components/dropdown-menu/components/DropdownMenuHeader.svelte +12 -0
- package/dist/components/dropdown-menu/components/DropdownMenuHeader.svelte.d.ts +5 -0
- package/dist/components/dropdown-menu/components/DropdownMenuItem.svelte +30 -0
- package/dist/components/dropdown-menu/components/DropdownMenuItem.svelte.d.ts +3 -0
- package/dist/components/dropdown-menu/components/DropdownMenuSeparator.svelte +11 -0
- package/dist/components/dropdown-menu/components/DropdownMenuSeparator.svelte.d.ts +5 -0
- package/dist/components/dropdown-menu/index.d.ts +5 -0
- package/dist/components/dropdown-menu/index.js +5 -0
- package/dist/components/icons/IconLogout.svelte +10 -0
- package/dist/components/icons/IconLogout.svelte.d.ts +4 -0
- package/dist/components/icons/IconSettings.svelte +10 -0
- package/dist/components/icons/IconSettings.svelte.d.ts +4 -0
- package/dist/components/icons/index.d.ts +2 -0
- package/dist/components/icons/index.js +2 -0
- package/dist/components/popover/Popover.svelte +25 -3
- package/dist/components/slider/Slider.d.ts +9 -0
- package/dist/components/slider/Slider.js +7 -0
- package/dist/components/slider/Slider.svelte +228 -0
- package/dist/components/slider/Slider.svelte.d.ts +3 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/tabs/Tabs.d.ts +17 -0
- package/dist/components/tabs/Tabs.js +15 -0
- package/dist/components/tabs/components/Tabs.svelte +48 -0
- package/dist/components/tabs/components/Tabs.svelte.d.ts +3 -0
- package/dist/components/tabs/components/TabsContent.svelte +36 -0
- package/dist/components/tabs/components/TabsContent.svelte.d.ts +6 -0
- package/dist/components/tabs/components/TabsItem.svelte +32 -0
- package/dist/components/tabs/components/TabsItem.svelte.d.ts +6 -0
- package/dist/components/tabs/components/TabsList.svelte +42 -0
- package/dist/components/tabs/components/TabsList.svelte.d.ts +5 -0
- package/dist/components/tabs/index.d.ts +4 -0
- package/dist/components/tabs/index.js +4 -0
- package/dist/components/tabs/tabs.svelte.d.ts +3 -0
- package/dist/components/tabs/tabs.svelte.js +11 -0
- package/dist/components/tera-ui-context/TeraUiContext.d.ts +1 -0
- package/dist/components/text-area/TextArea.d.ts +145 -0
- package/dist/components/text-area/TextArea.js +39 -0
- package/dist/components/text-area/TextArea.svelte +89 -0
- package/dist/components/text-area/TextArea.svelte.d.ts +3 -0
- package/dist/components/text-area/index.d.ts +1 -0
- package/dist/components/text-area/index.js +1 -0
- package/dist/components/user-avatar-with-menu/UserAvatarWithMenu.d.ts +11 -0
- package/dist/components/user-avatar-with-menu/UserAvatarWithMenu.js +7 -0
- package/dist/components/user-avatar-with-menu/UserAvatarWithMenu.svelte +68 -0
- package/dist/components/user-avatar-with-menu/UserAvatarWithMenu.svelte.d.ts +3 -0
- package/dist/components/user-avatar-with-menu/index.d.ts +1 -0
- package/dist/components/user-avatar-with-menu/index.js +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +7 -1
- package/dist/internal/service/user.service.d.ts +2 -0
- package/dist/internal/service/user.service.js +20 -0
- package/dist/types/user-data.d.ts +31 -0
- package/dist/types/user-data.js +1 -0
- package/package.json +25 -24
- package/scripts/add-component-template.js +1 -1
- package/scripts/generate-ts-index.js +8 -6
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {type AutoSizeConfig, type TextAreaProps} from "./TextArea";
|
|
3
|
+
import {styles} from "./TextArea";
|
|
4
|
+
import {IconX} from "../icons";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
class: className,
|
|
9
|
+
value = $bindable(),
|
|
10
|
+
ref = $bindable(),
|
|
11
|
+
size,
|
|
12
|
+
disabled,
|
|
13
|
+
variant = 'outlined',
|
|
14
|
+
autoSize,
|
|
15
|
+
onchange,
|
|
16
|
+
prefix,
|
|
17
|
+
rows,
|
|
18
|
+
allowClear,
|
|
19
|
+
...props
|
|
20
|
+
}: TextAreaProps = $props();
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
function createAutoSizeTextarea(node: HTMLTextAreaElement, autoSize?: AutoSizeConfig) {
|
|
24
|
+
if (!autoSize) {
|
|
25
|
+
return
|
|
26
|
+
}
|
|
27
|
+
let minRows: number | null = null
|
|
28
|
+
let maxRows: number | null = null
|
|
29
|
+
if (autoSize === true) {
|
|
30
|
+
minRows = 1
|
|
31
|
+
} else {
|
|
32
|
+
minRows = Math.max(autoSize.minRows || 0, 1)
|
|
33
|
+
maxRows = autoSize.maxRows || null
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const updateSize = () => {
|
|
38
|
+
node.style.height = 'auto';
|
|
39
|
+
const computedStyle = window.getComputedStyle(node);
|
|
40
|
+
const borderTopWidth = parseFloat(computedStyle.borderTopWidth);
|
|
41
|
+
const borderBottomWidth = parseFloat(computedStyle.borderBottomWidth);
|
|
42
|
+
const offset = borderTopWidth + borderBottomWidth;
|
|
43
|
+
const scrollHeight = node.scrollHeight + 4
|
|
44
|
+
|
|
45
|
+
const lineHeight = parseFloat(computedStyle.lineHeight);
|
|
46
|
+
const minHeight = minRows * lineHeight + offset;
|
|
47
|
+
const maxHeight = maxRows ? maxRows * lineHeight : null;
|
|
48
|
+
|
|
49
|
+
node.style.height = `${Math.max(minHeight, Math.min(scrollHeight, maxHeight ?? scrollHeight))}px`;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
$effect(() => {
|
|
53
|
+
// setup goes here
|
|
54
|
+
value
|
|
55
|
+
updateSize();
|
|
56
|
+
|
|
57
|
+
return () => {
|
|
58
|
+
// teardown goes here
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function clearText() {
|
|
64
|
+
value = ''
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<div class="relative">
|
|
70
|
+
<textarea
|
|
71
|
+
use:createAutoSizeTextarea={autoSize}
|
|
72
|
+
onchange={onchange}
|
|
73
|
+
bind:this={ref}
|
|
74
|
+
style={autoSize ? "resize: none;" : ''}
|
|
75
|
+
class={styles({ variant, disabled , size, className, allowClear })}
|
|
76
|
+
{disabled}
|
|
77
|
+
rows={autoSize ? 1 : rows}
|
|
78
|
+
{...props}
|
|
79
|
+
bind:value
|
|
80
|
+
>
|
|
81
|
+
</textarea>
|
|
82
|
+
|
|
83
|
+
{#if allowClear && value}
|
|
84
|
+
<button onclick={clearText}
|
|
85
|
+
class="absolute top-2 right-2 bg-neutral-token-6 text-neutral-token-1 hover:bg-neutral-token-8 size-3 grid place-content-center rounded-full">
|
|
86
|
+
<IconX class="size-2.5"/>
|
|
87
|
+
</button>
|
|
88
|
+
{/if}
|
|
89
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TextArea } from './TextArea.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TextArea } from './TextArea.svelte';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { UserData } from "../../types/user-data";
|
|
3
|
+
export declare const styles: import("tailwind-variants").TVReturnType<{}, undefined, "", import("tailwind-variants/dist/config").TVConfig<{}, {}>, {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "", import("tailwind-variants/dist/config").TVConfig<{}, {}>, unknown, unknown, undefined>>;
|
|
4
|
+
type UserAvatarWithMenuVariants = VariantProps<typeof styles>;
|
|
5
|
+
export interface UserAvatarWithMenuProps extends UserAvatarWithMenuVariants {
|
|
6
|
+
children?: any;
|
|
7
|
+
class?: string;
|
|
8
|
+
user?: UserData;
|
|
9
|
+
onLogout?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {type UserAvatarWithMenuProps} from "./UserAvatarWithMenu";
|
|
3
|
+
import {Avatar} from "../avatar";
|
|
4
|
+
import {
|
|
5
|
+
DropdownMenu,
|
|
6
|
+
DropdownMenuGroup,
|
|
7
|
+
DropdownMenuHeader,
|
|
8
|
+
DropdownMenuItem,
|
|
9
|
+
DropdownMenuSeparator
|
|
10
|
+
} from "../dropdown-menu";
|
|
11
|
+
import {IconLogout, IconSettings} from "../icons";
|
|
12
|
+
import {extractShortUsernameFromEmail} from "../../internal/service/user.service";
|
|
13
|
+
|
|
14
|
+
let {children, user, onLogout,...props}: UserAvatarWithMenuProps = $props();
|
|
15
|
+
|
|
16
|
+
let shortUserName = extractShortUsernameFromEmail(user?.email)
|
|
17
|
+
let triggerRef = $state()
|
|
18
|
+
let open = $state(false)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
{#if user}
|
|
23
|
+
<button class="rounded-full focus-visible:ring-0" bind:this={triggerRef}>
|
|
24
|
+
<Avatar
|
|
25
|
+
userUid={user.userUid}
|
|
26
|
+
>
|
|
27
|
+
{shortUserName}
|
|
28
|
+
</Avatar>
|
|
29
|
+
</button>
|
|
30
|
+
|
|
31
|
+
<DropdownMenu
|
|
32
|
+
bind:open
|
|
33
|
+
triggerRef={triggerRef}
|
|
34
|
+
class="!min-w-[14rem]"
|
|
35
|
+
>
|
|
36
|
+
<DropdownMenuHeader>
|
|
37
|
+
<div class="grid grid-cols-[auto,1fr] gap-2 overflow-hidden break-all items-center">
|
|
38
|
+
<Avatar border={false}
|
|
39
|
+
size="lg"
|
|
40
|
+
userUid={user.userUid}
|
|
41
|
+
>
|
|
42
|
+
{shortUserName}
|
|
43
|
+
</Avatar>
|
|
44
|
+
{#if user.email}
|
|
45
|
+
{user.email}
|
|
46
|
+
{/if}
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
</DropdownMenuHeader>
|
|
50
|
+
<DropdownMenuSeparator/>
|
|
51
|
+
|
|
52
|
+
<DropdownMenuGroup>
|
|
53
|
+
<DropdownMenuItem
|
|
54
|
+
href="/account-settings"
|
|
55
|
+
>
|
|
56
|
+
<IconSettings/>
|
|
57
|
+
Account Settings
|
|
58
|
+
</DropdownMenuItem>
|
|
59
|
+
</DropdownMenuGroup>
|
|
60
|
+
<DropdownMenuSeparator/>
|
|
61
|
+
<DropdownMenuGroup>
|
|
62
|
+
<DropdownMenuItem onclick={onLogout}>
|
|
63
|
+
<IconLogout/>
|
|
64
|
+
Logout
|
|
65
|
+
</DropdownMenuItem>
|
|
66
|
+
</DropdownMenuGroup>
|
|
67
|
+
</DropdownMenu>
|
|
68
|
+
{/if}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UserAvatarWithMenu } from './UserAvatarWithMenu.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UserAvatarWithMenu } from './UserAvatarWithMenu.svelte';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
export { Avatar } from './components/avatar';
|
|
1
2
|
export { BrandLogo } from './components/brand-logo';
|
|
2
3
|
export { Button } from './components/button';
|
|
3
4
|
export { Combobox } from './components/combobox';
|
|
4
5
|
export { Command } from './components/command';
|
|
5
6
|
export { Dialog, DialogAstro } from './components/dialog';
|
|
7
|
+
export { DropdownMenu, DropdownMenuItem, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuSeparator } from './components/dropdown-menu';
|
|
6
8
|
export { Header } from './components/header';
|
|
7
|
-
export { IconArrowBigRightFilled, IconBook, IconBookmarkPlus, IconCalculator, IconCheck, IconChevronDown, IconCopy, IconCopyCheckFilled, IconHamburger, IconLanguage, IconLoader2, IconMoon, IconPointFilled, IconSearch, IconSun, IconSwitchHorizontal, IconSwitchVertical, IconTransform, IconX } from './components/icons';
|
|
9
|
+
export { IconArrowBigRightFilled, IconBook, IconBookmarkPlus, IconCalculator, IconCheck, IconChevronDown, IconCopy, IconCopyCheckFilled, IconHamburger, IconLanguage, IconLoader2, IconLogout, IconMoon, IconPointFilled, IconSearch, IconSettings, IconSun, IconSwitchHorizontal, IconSwitchVertical, IconTransform, IconX } from './components/icons';
|
|
8
10
|
export { Input } from './components/input';
|
|
9
11
|
export { LanguagePickerButton } from './components/language-picker-button';
|
|
10
12
|
export { LightDarkToggle } from './components/light-dark-toggle';
|
|
11
13
|
export { Popover } from './components/popover';
|
|
12
14
|
export { PopoverResponsive } from './components/popover-responsive';
|
|
13
15
|
export { SideNavigation, SideNavigationLayout, toggleSideNavigation } from './components/side-navigation';
|
|
16
|
+
export { Slider } from './components/slider';
|
|
17
|
+
export { Tabs, TabsList, TabsItem, TabsContent } from './components/tabs';
|
|
14
18
|
export { TeraUiContext } from './components/tera-ui-context';
|
|
19
|
+
export { TextArea } from './components/text-area';
|
|
20
|
+
export { UserAvatarWithMenu } from './components/user-avatar-with-menu';
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
export { Avatar } from './components/avatar';
|
|
1
2
|
export { BrandLogo } from './components/brand-logo';
|
|
2
3
|
export { Button } from './components/button';
|
|
3
4
|
export { Combobox } from './components/combobox';
|
|
4
5
|
export { Command } from './components/command';
|
|
5
6
|
export { Dialog, DialogAstro } from './components/dialog';
|
|
7
|
+
export { DropdownMenu, DropdownMenuItem, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuSeparator } from './components/dropdown-menu';
|
|
6
8
|
export { Header } from './components/header';
|
|
7
|
-
export { IconArrowBigRightFilled, IconBook, IconBookmarkPlus, IconCalculator, IconCheck, IconChevronDown, IconCopy, IconCopyCheckFilled, IconHamburger, IconLanguage, IconLoader2, IconMoon, IconPointFilled, IconSearch, IconSun, IconSwitchHorizontal, IconSwitchVertical, IconTransform, IconX } from './components/icons';
|
|
9
|
+
export { IconArrowBigRightFilled, IconBook, IconBookmarkPlus, IconCalculator, IconCheck, IconChevronDown, IconCopy, IconCopyCheckFilled, IconHamburger, IconLanguage, IconLoader2, IconLogout, IconMoon, IconPointFilled, IconSearch, IconSettings, IconSun, IconSwitchHorizontal, IconSwitchVertical, IconTransform, IconX } from './components/icons';
|
|
8
10
|
export { Input } from './components/input';
|
|
9
11
|
export { LanguagePickerButton } from './components/language-picker-button';
|
|
10
12
|
export { LightDarkToggle } from './components/light-dark-toggle';
|
|
11
13
|
export { Popover } from './components/popover';
|
|
12
14
|
export { PopoverResponsive } from './components/popover-responsive';
|
|
13
15
|
export { SideNavigation, SideNavigationLayout, toggleSideNavigation } from './components/side-navigation';
|
|
16
|
+
export { Slider } from './components/slider';
|
|
17
|
+
export { Tabs, TabsList, TabsItem, TabsContent } from './components/tabs';
|
|
14
18
|
export { TeraUiContext } from './components/tera-ui-context';
|
|
19
|
+
export { TextArea } from './components/text-area';
|
|
20
|
+
export { UserAvatarWithMenu } from './components/user-avatar-with-menu';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getGlobalContext } from "../../components/tera-ui-context/global-context";
|
|
2
|
+
export function extractShortUsernameFromEmail(email) {
|
|
3
|
+
if (!email || typeof email !== 'string') {
|
|
4
|
+
return '?';
|
|
5
|
+
}
|
|
6
|
+
// Extract the part before the '@' symbol
|
|
7
|
+
const usernamePart = email.split('@')[0];
|
|
8
|
+
// Replace any non-alphanumeric characters with a space and trim extra spaces
|
|
9
|
+
const cleanUsername = usernamePart.replace(/[^a-zA-Z0-9]/g, ' ').trim();
|
|
10
|
+
// Split the username into words and create an initialism
|
|
11
|
+
const words = cleanUsername.split(' ');
|
|
12
|
+
let shortForm = words.map(word => word[0]).join('');
|
|
13
|
+
// Ensure the result is between 1 to 4 characters
|
|
14
|
+
shortForm = shortForm.slice(0, 4).toUpperCase();
|
|
15
|
+
return shortForm || '?';
|
|
16
|
+
}
|
|
17
|
+
export function getUserAvatarUrl(userUid) {
|
|
18
|
+
let baseUrl = `${getGlobalContext().apiUrl || 'https://hoidap.xyz/api/v1'}/users`;
|
|
19
|
+
return `${baseUrl}/avatar/${encodeURI(userUid)}`;
|
|
20
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface UserData {
|
|
2
|
+
displayName?: string;
|
|
3
|
+
profileImage?: any;
|
|
4
|
+
registerAt?: Date;
|
|
5
|
+
totalAnswer?: number;
|
|
6
|
+
totalQuestion?: number;
|
|
7
|
+
totalThanks?: number;
|
|
8
|
+
username?: string;
|
|
9
|
+
userUid?: string;
|
|
10
|
+
roleId?: string;
|
|
11
|
+
reputation?: string;
|
|
12
|
+
lastAccessDate?: string;
|
|
13
|
+
websiteUrl?: string;
|
|
14
|
+
location?: string;
|
|
15
|
+
aboutMe?: string;
|
|
16
|
+
views?: number;
|
|
17
|
+
upVotes?: number;
|
|
18
|
+
downVotes?: number;
|
|
19
|
+
passwordHash?: string;
|
|
20
|
+
mobile?: string;
|
|
21
|
+
email?: string;
|
|
22
|
+
data?: Map<any, any>;
|
|
23
|
+
jwtToken?: JwtToken;
|
|
24
|
+
userData?: string;
|
|
25
|
+
emailVerified?: boolean;
|
|
26
|
+
didResetPassword?: boolean;
|
|
27
|
+
language?: string;
|
|
28
|
+
suspended?: boolean;
|
|
29
|
+
registeredAtLocation?: string;
|
|
30
|
+
registeredFromSource?: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tera-system-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
|
-
"build": "vite build && npm run package",
|
|
6
|
+
"build": "npm run customPrepublish && npm run generate-index && vite build && npm run package && npm run postpublish",
|
|
7
7
|
"preview": "vite preview",
|
|
8
8
|
"package": "svelte-kit sync && svelte-package && publint",
|
|
9
9
|
"customPrepublish": "node ./scripts/prepublish.js",
|
|
10
10
|
"postpublish": "node ./scripts/postpublish.js",
|
|
11
|
-
"prepublishOnly": "npm run lang-compile && npm run customPrepublish && npm run package",
|
|
11
|
+
"prepublishOnly": "npm run lang-compile && npm run customPrepublish && npm run generate-index && npm run package",
|
|
12
12
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
13
13
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
14
14
|
"storybook": "storybook dev -p 6006",
|
|
15
15
|
"build-storybook": "storybook build",
|
|
16
|
-
"lang-compile": "paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide"
|
|
16
|
+
"lang-compile": "paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide",
|
|
17
|
+
"generate-index": "node ./scripts/generate-ts-index.js"
|
|
17
18
|
},
|
|
18
19
|
"bin": {
|
|
19
20
|
"ui": "./scripts/add-component-template.js",
|
|
@@ -59,39 +60,39 @@
|
|
|
59
60
|
"svelte": "^5.0.0"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
|
-
"@chromatic-com/storybook": "^3.2.
|
|
63
|
-
"@storybook/addon-essentials": "^8.
|
|
64
|
-
"@storybook/addon-interactions": "^8.
|
|
65
|
-
"@storybook/addon-links": "^8.
|
|
63
|
+
"@chromatic-com/storybook": "^3.2.2",
|
|
64
|
+
"@storybook/addon-essentials": "^8.4.4",
|
|
65
|
+
"@storybook/addon-interactions": "^8.4.4",
|
|
66
|
+
"@storybook/addon-links": "^8.4.4",
|
|
66
67
|
"@storybook/addon-styling": "^1.3.7",
|
|
67
68
|
"@storybook/addon-svelte-csf": "^5.0.0-next.8",
|
|
68
|
-
"@storybook/addon-themes": "^8.
|
|
69
|
-
"@storybook/addon-viewport": "^8.
|
|
70
|
-
"@storybook/blocks": "^8.
|
|
71
|
-
"@storybook/svelte": "^8.
|
|
72
|
-
"@storybook/sveltekit": "^8.
|
|
73
|
-
"@storybook/test": "^8.
|
|
69
|
+
"@storybook/addon-themes": "^8.4.4",
|
|
70
|
+
"@storybook/addon-viewport": "^8.4.4",
|
|
71
|
+
"@storybook/blocks": "^8.4.4",
|
|
72
|
+
"@storybook/svelte": "^8.4.4",
|
|
73
|
+
"@storybook/sveltekit": "^8.4.4",
|
|
74
|
+
"@storybook/test": "^8.4.4",
|
|
74
75
|
"@sveltejs/adapter-auto": "^3.3.1",
|
|
75
|
-
"@sveltejs/kit": "^2.
|
|
76
|
+
"@sveltejs/kit": "^2.8.1",
|
|
76
77
|
"@sveltejs/package": "^2.3.7",
|
|
77
|
-
"@sveltejs/vite-plugin-svelte": "^4.0.
|
|
78
|
+
"@sveltejs/vite-plugin-svelte": "^4.0.1",
|
|
78
79
|
"npx": "^10.2.2",
|
|
79
80
|
"publint": "^0.2.12",
|
|
80
|
-
"sass-embedded": "^1.
|
|
81
|
-
"storybook": "^8.
|
|
82
|
-
"svelte": "^5.1
|
|
83
|
-
"svelte-check": "^4.0.
|
|
84
|
-
"tailwindcss": "^3.4.
|
|
81
|
+
"sass-embedded": "^1.81.0",
|
|
82
|
+
"storybook": "^8.4.4",
|
|
83
|
+
"svelte": "^5.2.1",
|
|
84
|
+
"svelte-check": "^4.0.8",
|
|
85
|
+
"tailwindcss": "^3.4.15",
|
|
85
86
|
"typescript": "^5.6.3",
|
|
86
|
-
"vite": "^5.4.
|
|
87
|
+
"vite": "^5.4.11"
|
|
87
88
|
},
|
|
88
89
|
"dependencies": {
|
|
89
90
|
"@floating-ui/dom": "^1.6.12",
|
|
90
91
|
"@inlang/paraglide-sveltekit": "0.11.5",
|
|
91
|
-
"@tabler/icons-svelte": "^3.
|
|
92
|
+
"@tabler/icons-svelte": "^3.22.0",
|
|
92
93
|
"clsx": "^2.1.1",
|
|
93
94
|
"autoprefixer": "^10.4.20",
|
|
94
95
|
"@inlang/paraglide-js": "1.11.3",
|
|
95
|
-
"tailwind-variants": "^0.
|
|
96
|
+
"tailwind-variants": "^0.3.0"
|
|
96
97
|
}
|
|
97
98
|
}
|
|
@@ -44,8 +44,8 @@ function extractExportNames(filePath) {
|
|
|
44
44
|
const exportNames = [];
|
|
45
45
|
|
|
46
46
|
// Regular expressions to match the export names
|
|
47
|
-
const defaultExportRegex =
|
|
48
|
-
const namedExportRegex =
|
|
47
|
+
const defaultExportRegex = /^(?!\s*\/\/)\s*export\s*{\s*default\s+as\s+(\w+)/gm;
|
|
48
|
+
const namedExportRegex = /^(?!\s*\/\/)\s*export\s*{(\w+)\s*}/gm;
|
|
49
49
|
|
|
50
50
|
let match;
|
|
51
51
|
|
|
@@ -72,8 +72,9 @@ function extractExportNames(filePath) {
|
|
|
72
72
|
function findFilesByPattern(folderPath, namePattern) {
|
|
73
73
|
const result = [];
|
|
74
74
|
|
|
75
|
+
console.log(folderPath)
|
|
75
76
|
function searchFolder(currentPath) {
|
|
76
|
-
const filesAndDirs = fs.
|
|
77
|
+
const filesAndDirs = fs.readdirSync(currentPath);
|
|
77
78
|
|
|
78
79
|
for (const item of filesAndDirs) {
|
|
79
80
|
const itemPath = path.join(currentPath, item);
|
|
@@ -93,9 +94,10 @@ function findFilesByPattern(folderPath, namePattern) {
|
|
|
93
94
|
return result;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
const
|
|
97
|
+
const baseLib = './src/lib'
|
|
98
|
+
const GLOBAL_INDEX_PATH = baseLib + "/index.ts"
|
|
99
|
+
const COMPONENTS_PATH = baseLib + "/components"
|
|
100
|
+
const ICON_COMPONENTS_PATH = baseLib + "/components/icons"
|
|
99
101
|
|
|
100
102
|
const iconComponentsFileList = findFilesByPattern(ICON_COMPONENTS_PATH, /^Icon\w*\.svelte$/);
|
|
101
103
|
|