Compare commits

...

7 Commits

Author SHA1 Message Date
Ilia Mashkov
d78eb3037c feat(font): add constants with information about fonts characteristics
Some checks failed
Lint / Lint Code (push) Failing after 7m23s
Test / Svelte Checks (push) Failing after 7m14s
2026-01-02 16:11:58 +03:00
Ilia Mashkov
9f8d7ad844 fix: minor changes 2026-01-02 16:11:05 +03:00
Ilia Mashkov
904b48844d feat(AppSidebar): create first version of AppSidebar widget 2026-01-02 16:10:45 +03:00
Ilia Mashkov
82d36ad156 feat: create single export file for CategoryFIlter feature 2026-01-02 16:10:17 +03:00
Ilia Mashkov
c65243ed02 chore: move App and app related code to app layer 2026-01-02 16:09:03 +03:00
Ilia Mashkov
11014f36af chore: create aliases for widgets and app layers 2026-01-02 16:07:57 +03:00
Ilia Mashkov
a76b83ee0e fix(shadcn): fix import path 2026-01-02 16:07:12 +03:00
23 changed files with 148 additions and 36 deletions

1
.gitignore vendored
View File

@@ -22,6 +22,7 @@ Thumbs.db
# Yarn
.yarn
.yarn/**
.pnp.*
# Zed

View File

@@ -1,20 +0,0 @@
<script lang="ts">
import favicon from '$shared/assets/favicon.svg';
import './app.css';
import Page from './routes/Page.svelte';
</script>
<svelte:head>
<link rel="icon" href={favicon} />
</svelte:head>
<div id="app-root">
<Page />
</div>
<style>
#app-root {
width: 100%;
height: 100vh;
}
</style>

8
src/app/App.svelte Normal file
View File

@@ -0,0 +1,8 @@
<script lang="ts">
import Page from '$routes/Page.svelte';
import Layout from './ui/Layout.svelte';
</script>
<Layout>
<Page />
</Layout>

32
src/app/ui/Layout.svelte Normal file
View File

@@ -0,0 +1,32 @@
<script lang="ts">
import favicon from '$shared/assets/favicon.svg';
import * as Sidebar from '$shared/shadcn/ui/sidebar/index';
import { AppSidebar } from '$widgets/AppSidebar';
let { children } = $props();
</script>
<svelte:head>
<link rel="icon" href={favicon} />
</svelte:head>
<div class="app">
<header></header>
<Sidebar.Provider>
<AppSidebar />
<main>
<Sidebar.Trigger />
{@render children?.()}
</main>
</Sidebar.Provider>
<footer></footer>
</div>
<style>
#app-root {
width: 100%;
height: 100vh;
}
</style>

View File

@@ -1 +1,13 @@
export type { FontCategory, FontProvider, FontSubset } from './model/font';
export type {
FontshareApiModel,
FontshareDesigner,
FontshareFeature,
FontshareFont,
FontsharePublisher,
FontshareStyle,
FontshareStyleProperties,
FontshareTag,
FontshareWeight,
} from './model/fontshare_fonts';
export type { FontFiles, FontItem, FontVariant, GoogleFontsApiModel } from './model/google_fonts';

View File

@@ -1,14 +1,77 @@
import type { Category } from '$shared/store/createFilterStore';
/**
* Font category
*/
export type FontCategory = 'sans-serif' | 'serif' | 'display' | 'handwriting' | 'monospace';
export const FONT_CATEGORIES: Category[] = [
{
id: 'sans-serif',
name: 'Sans-serif',
},
{
id: 'serif',
name: 'Serif',
},
{
id: 'display',
name: 'Display',
},
{
id: 'handwriting',
name: 'Handwriting',
},
{
id: 'monospace',
name: 'Monospace',
},
] as const;
/**
* Font provider
*/
export type FontProvider = 'google' | 'fontshare';
export const FONT_PROVIDERS: Category[] = [
{
id: 'google',
name: 'Google Fonts',
},
{
id: 'fontshare',
name: 'Fontshare',
},
] as const;
/**
* Font subset
*/
export type FontSubset = 'latin' | 'latin-ext' | 'cyrillic' | 'greek' | 'arabic' | 'devanagari';
export const FONT_SUBSETS: Category[] = [
{
id: 'latin',
name: 'Latin',
},
{
id: 'latin-ext',
name: 'Latin Extended',
},
{
id: 'cyrillic',
name: 'Cyrillic',
},
{
id: 'greek',
name: 'Greek',
},
{
id: 'arabic',
name: 'Arabic',
},
{
id: 'devanagari',
name: 'Devanagari',
},
] as const;

View File

@@ -0,0 +1,5 @@
import { FONT_CATEGORIES } from './model/state';
import { categoryFilterStore } from './store/categoryFilterStore';
import CategoryFilter from './ui/CategoryFilter.svelte';
export { CategoryFilter, categoryFilterStore, FONT_CATEGORIES };

View File

@@ -1,5 +1,6 @@
import App from '$app/App.svelte';
import { mount } from 'svelte';
import App from './App.svelte';
import '$app/styles/app.css';
mount(App, {
target: document.getElementById('app')!,

View File

@@ -1,10 +1,7 @@
<script>
import CategoryFilter from '$features/CategoryFilter/ui/CategoryFilter.svelte';
import Button from '$shared/shadcn/ui/button/button.svelte';
</script>
<h1>Welcome to Svelte + Vite</h1>
<p>
Visit <a href="https://svelte.dev/docs">svelte.dev/docs</a> to read the documentation
</p>
<CategoryFilter />

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { Input } from '$shared/shadcn/input/index.js';
import { Input } from '$shared/shadcn/ui/input/index.js';
import { cn } from '$shared/shadcn/utils/shadcn-utils.js';
import type { ComponentProps } from 'svelte';

View File

@@ -29,7 +29,7 @@ export type SidebarMenuButtonSize = VariantProps<typeof sidebarMenuButtonVariant
</script>
<script lang="ts">
import * as Tooltip from '$shared/shadcn/tooltip/index.js';
import * as Tooltip from '$shared/shadcn/ui/tooltip/index.js';
import {
cn,
type WithElementRef,

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { Skeleton } from '$shared/shadcn/skeleton/index.js';
import { Skeleton } from '$shared/shadcn/ui/skeleton/index.js';
import { cn, type WithElementRef } from '$shared/shadcn/utils/shadcn-utils.js';
import type { HTMLAttributes } from 'svelte/elements';

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import * as Tooltip from '$shared/shadcn/tooltip/index.js';
import * as Tooltip from '$shared/shadcn/ui/tooltip/index.js';
import { cn, type WithElementRef } from '$shared/shadcn/utils/shadcn-utils.js';
import type { HTMLAttributes } from 'svelte/elements';
import {

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { Separator } from '$shared/shadcn/separator/index.js';
import { Separator } from '$shared/shadcn/ui/separator/index.js';
import { cn } from '$shared/shadcn/utils/shadcn-utils.js';
import type { ComponentProps } from 'svelte';

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { Button } from '$shared/shadcn/button/index.js';
import { Button } from '$shared/shadcn/ui/button/index.js';
import { cn } from '$shared/shadcn/utils/shadcn-utils.js';
import PanelLeftIcon from '@lucide/svelte/icons/panel-left';
import type { ComponentProps } from 'svelte';

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import * as Sheet from '$shared/shadcn/sheet/index.js';
import * as Sheet from '$shared/shadcn/ui/sheet/index.js';
import { cn, type WithElementRef } from '$shared/shadcn/utils/shadcn-utils.js';
import type { HTMLAttributes } from 'svelte/elements';
import { SIDEBAR_WIDTH_MOBILE } from './constants.js';

View File

@@ -0,0 +1,3 @@
import AppSidebar from './ui/AppSidebar.svelte';
export { AppSidebar };

View File

@@ -0,0 +1,10 @@
<script lang="ts">
import { CategoryFilter } from '$features/CategoryFilter';
import * as Sidebar from '$shared/shadcn/ui/sidebar/index';
</script>
<Sidebar.Root>
<Sidebar.Content>
<CategoryFilter />
</Sidebar.Content>
</Sidebar.Root>

View File

@@ -1,8 +1,6 @@
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: vitePreprocess(),
compilerOptions: {

View File

@@ -24,11 +24,12 @@
"baseUrl": ".",
"paths": {
"$lib/*": ["./src/lib/*"],
"$app/*": ["./src/app/*"],
"$widgets/*": ["./src/widgets/*"],
"$shared/*": ["./src/shared/*"],
"$entities/*": ["./src/entities/*"],
"$features/*": ["./src/features/*"],
"$routes/*": ["./src/routes/*"],
"$services/*": ["./src/services/*"]
"$routes/*": ["./src/routes/*"]
}
},
"include": [

View File

@@ -7,11 +7,12 @@ export default defineConfig({
resolve: {
alias: {
$lib: '/src/lib',
$app: '/src/app',
$shared: '/src/shared',
$entities: '/src/entities',
$features: '/src/features',
$routes: '/src/routes',
$services: '/src/services',
$widgets: '/src/widgets',
},
},
build: {