### Install and Run Svelte Project Source: https://github.com/max-got/originui-svelte/blob/main/README.md Commands to clone the repository, install dependencies using pnpm, and start the development server for previewing components. ```bash git clone https://github.com/max-got/originui-svelte.git cd originui-svelte pnpm install pnpm dev ``` -------------------------------- ### Install Multiple Dependencies Source: https://github.com/max-got/originui-svelte/blob/main/README.md This bash command shows how to install both development and runtime dependencies, combining packages like `@iconify-json/ri` and `unplugin-icons` as dev dependencies, and `bits-ui` as a runtime dependency. ```bash # Combines dev and runtime dependencies pnpm i -D @iconify-json/ri unplugin-icons && pnpm i bits-ui ``` -------------------------------- ### Feature Branch Creation (Bash) Source: https://github.com/max-got/originui-svelte/blob/main/README.md Demonstrates the Git command to create a new feature branch for development, following a standard naming convention. ```Bash git checkout -b feature/your-feature-name ``` -------------------------------- ### Project Structure Overview (Svelte) Source: https://github.com/max-got/originui-svelte/blob/main/README.md This section outlines the directory structure of the Origin UI Svelte project. It categorizes UI components, utility functions, type definitions, and Svelte hooks for better organization and maintainability. ```svelte src/ ├── lib/ │ ├── components/ # UI Components organized by type │ │ ├── ui/ # Base UI components │ │ │ ├── badge.svelte # one component │ │ │ ├── button.svelte # one component │ │ │ ├── accordion/ # needs multiple components │ │ │ │ │── accordion-item.svelte # Base component Accordion Item │ │ │ │ │── accordion-trigger.svelte # Base component Accordion Trigger │ │ │ │ │── ... │ │ │ ├── inputs/ # Input components │ │ │ │ ├── input-01.svelte │ │ │ │ ├── input-02.svelte │ │ │ │ └── ... │ │ │ ├── buttons/ # Button components │ │ │ │ ├── button-01.svelte │ │ │ │ ├── button-02.svelte │ │ │ │ └── ... │ │ │ └── ... # Other component categories │ ├── utils/ # Utility functions │ ├── types/ # TypeScript type definitions │ └── hooks/ # Svelte hooks ``` -------------------------------- ### OriginUI Component Organization (Svelte) Source: https://github.com/max-got/originui-svelte/blob/main/README.md Outlines the structure for OriginUI components within the `src/lib/components` folder. Components are categorized, and placeholders are used for components that cannot be implemented yet. ```Svelte component-category/ ├── category-01.svelte ├── category-02.svelte └── ... ``` ```Svelte component-category/ └── category-03.todo.svelte ``` -------------------------------- ### Submitting Changes (Bash) Source: https://github.com/max-got/originui-svelte/blob/main/README.md Provides the Git commands to stage all changes, commit them with a conventional message, and push them to the remote repository. ```Bash git add . git commit -m "feat: add new component category" git push origin feature/your-feature-name ``` -------------------------------- ### Code Quality Checks Source: https://github.com/max-got/originui-svelte/blob/main/README.md Commands to run ESLint for code linting and Prettier for code formatting within the Svelte project. ```bash pnpm lint pnpm format ``` -------------------------------- ### Base Component Organization (Svelte) Source: https://github.com/max-got/originui-svelte/blob/main/README.md Defines the directory structure for base UI components in the `src/lib/components/ui` folder. Simple components reside directly in the folder, while those requiring multiple parts are placed in their own subdirectories. ```Svelte component-category/ ├── index.ts # Exports └── component.svelte # Main component ``` ```Svelte component-category/ └── component.svelte # Main component ``` -------------------------------- ### Generate Component Registry Source: https://github.com/max-got/originui-svelte/blob/main/README.md This bash script automatically generates a component registry by scanning the `src/lib/components/` directory. It creates type definitions and updates component type definitions and directory structures, ensuring the routing system is in sync with components. ```bash pnpm generate:registry ``` -------------------------------- ### Component Registry Architecture Source: https://github.com/max-got/originui-svelte/blob/main/README.md Illustrates the file structure for the component registry system, including auto-generated types and variables, the registry implementation, API endpoints, route definitions, and parameter validation files. ```typescript src/ ├── lib/ │ ├── componentRegistry.types.ts # Auto-generated types │ ├── componentRegistry.components.ts # Auto-generated variables │ ├── componentRegistry.ts # Registry implementation │ └── data/api/components/ │ ├── components.ts # API endpoints │ ├── components.handler.ts # Request handlers │ └── components.route.ts # Route definitions ├── routes/ │ └── (components)/ │ └── [path=componentsPath]/ │ ├── +page.server.ts # Dynamic route handling │ └── [directory]/[id]/ │ └── +page.server.ts # Component page handling └── params/ ├── componentDirectory.ts # Directory parameter validation └── componentId.ts # Component ID validation ``` -------------------------------- ### Register Possible Dependencies Source: https://github.com/max-got/originui-svelte/blob/main/README.md This TypeScript code snippet defines an array of possible dependencies that the system can detect. Each dependency object includes its name, package name, reference URL, and whether it's a development dependency. ```typescript export const POSSIBLE_DEPENDENCIES = [ { dev: false, // Whether it's a dev dependency name: 'bits-ui', // Import name to detect packageName: 'bits-ui@next', // NPM package name url: 'https://github.com/huntabyte/bits-ui' // Reference URL } // ... other dependencies ] as const; ``` -------------------------------- ### Import CSS Variables for Theming (CSS) Source: https://github.com/max-got/originui-svelte/blob/main/README.md This CSS code snippet demonstrates how to import and define theme-related CSS variables. It includes base definitions for light mode and overrides for dark mode, covering colors, radii, and other styling properties. ```css @theme inline { --color-background: var(--background); --color-foreground: var(--foreground); --font-sans: var(--font-sans); --font-mono: var(--font-mono); --color-ring: var(--ring); --color-input: var(--input); --color-border: var(--border); --color-destructive-foreground: var(--destructive-foreground); --color-destructive: var(--destructive); --color-accent-foreground: var(--accent-foreground); --color-accent: var(--accent); --color-muted-foreground: var(--muted-foreground); --color-muted: var(--muted); --color-secondary-foreground: var(--secondary-foreground); --color-secondary: var(--secondary); --color-primary-foreground: var(--primary-foreground); --color-primary: var(--primary); --color-popover-foreground: var(--popover-foreground); --color-popover: var(--popover); --color-card-foreground: var(--card-foreground); --color-card: var(--card); --radius-sm: calc(var(--radius) - 4px); --radius-md: calc(var(--radius) - 2px); --radius-lg: var(--radius); --radius-xl: calc(var(--radius) + 4px); } :root { --radius: 0.625rem; --background: oklch(1 0 0); /* --color-white */ --foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */ --card: oklch(1 0 0); /* --color-white */ --card-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */ --popover: oklch(1 0 0); /* --color-white */ --popover-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */ --primary: oklch(0.21 0.006 285.885); /* --color-zinc-900 */ --primary-foreground: oklch(0.985 0 0); /* --color-zinc-50 */ --secondary: oklch(0.967 0.001 286.375); /* --color-zinc-100 */ --secondary-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */ --muted: oklch(0.967 0.001 286.375); /* --color-zinc-100 */ --muted-foreground: oklch(0.552 0.016 285.938); /* --color-zinc-500 */ --accent: oklch(0.967 0.001 286.375); /* --color-zinc-100 */ --accent-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */ --destructive: oklch(0.637 0.237 25.331); /* --color-red-500 */ --destructive-foreground: oklch(0.637 0.237 25.331); /* --color-red-500 */ --border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */ --input: oklch(0.871 0.006 286.286); /* --color-zinc-300 */ --ring: oklch(0.871 0.006 286.286); /* --color-zinc-300 */ } .dark { --background: oklch(0.141 0.005 285.823); /* --color-zinc-950 */ --foreground: oklch(0.985 0 0); /* --color-zinc-50 */ --card: oklch(0.141 0.005 285.823); /* --color-zinc-950 */ --card-foreground: oklch(0.985 0 0); /* --color-zinc-50 */ --popover: oklch(0.141 0.005 285.823); /* --color-zinc-950 */ --popover-foreground: oklch(0.985 0 0); /* --color-zinc-50 */ --primary: oklch(0.985 0 0); /* --color-zinc-50 */ --primary-foreground: oklch(0.21 0.006 285.885); /* --color-zinc-900 */ --secondary: oklch(0.274 0.006 286.033); /* --color-zinc-800 */ --secondary-foreground: oklch(0.985 0 0); /* --color-zinc-50 */ --muted: oklch(0.21 0.006 285.885); /* --color-zinc-900 */ --muted-foreground: oklch(0.65 0.01 286); /* 🔥 near --color-zinc-400 */ --accent: oklch(0.21 0.006 285.885); /* --color-zinc-900 */ --accent-foreground: oklch(0.985 0 0); /* --color-zinc-50 */ --destructive: oklch(0.396 0.141 25.723); /* --color-red-900 */ --destructive-foreground: oklch(0.637 0.237 25.331); /* --color-red-500 */ --border: oklch(0.274 0.006 286.033); /* --color-zinc-800 */ --input: oklch(0.274 0.006 286.033); /* --color-zinc-800 */ --ring: oklch(0.442 0.017 285.786); /* --color-zinc-600 */ } ``` -------------------------------- ### Add New Dependency Configuration Source: https://github.com/max-got/originui-svelte/blob/main/README.md Provides a TypeScript interface for adding new dependencies to the `POSSIBLE_DEPENDENCIES` array. It specifies the required fields: `dev` (boolean), `name` (string), `packageName` (string), and `url` (string). ```typescript { dev: boolean, // true for devDependencies, false for dependencies name: string, // The import path to detect (e.g., 'your-package') packageName: string, // The exact package name with version (e.g., 'your-package@1.0.0') url: string // Package repository or documentation URL } ``` -------------------------------- ### Component Naming Convention (Svelte) Source: https://github.com/max-got/originui-svelte/blob/main/README.md Specifies the naming conventions for Svelte components, differentiating between regular components and those that are not yet implementable. ```Svelte component-category/ ├── category-XX.svelte # Regular component └── category-XX.todo.svelte # Not yet possible ``` -------------------------------- ### Detect Enhanced Images Source: https://github.com/max-got/originui-svelte/blob/main/README.md This TypeScript code demonstrates how the dependency detection system might identify the use of `@sveltejs/enhanced-img` by matching the source code against a regular expression. ```typescript // Automatically detects and adds @sveltejs/enhanced-img const enhancedImageMatch = source.match(ENHANCED_IMAGE_REGEX); ``` -------------------------------- ### Tailwind CSS Class Merging Utility Source: https://github.com/max-got/originui-svelte/blob/main/README.md The `cn` utility function, commonly used in Svelte projects with Tailwind CSS, for merging class names. ```typescript import { clsx, type ClassValue } from "clsx"; import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.