mountain-ui
v1.0.80
Published
A comprehensive UI component library for ERP systems with field types, entities, and registry management built with Svelte
Maintainers
Readme
Mountain UI
A comprehensive UI component library for ERP systems built with Svelte. Features an extensive registry system for managing field types, entities, and custom UI components.
Features
- 🎨 Field Type Registry: Manage and display different field types (text, numbers, dates, links, calculations, lists, etc.)
- 📦 Entity Registry: Create and manage entity models with automatic form generation
- 🔧 Component System: Pre-built components for forms, cards, buttons, and icons
- 🎯 Type-Safe: Built with Svelte 5 and full runes support
- 📝 Form Context: Advanced form state management with context system
- 🔗 Relationships: Support for linked entities and relational data
Installation
npm install mountain-uiQuick Start
Basic Usage
import {
fieldTypeRegistry,
entityRegistry,
registerDefaultFieldTypes,
EntityForm
} from 'mountain-ui';
// Register default field types
registerDefaultFieldTypes();
// Use entity form component
import EntityForm from 'mountain-ui/EntityForm.svelte';Components
Field Type Components
FieldTypeIcon- Icon for field typesFieldTypeButton- Button component for field typesFieldTypeCard- Card display for field typesFieldTypeInput- Input component for field typesLabel- Label componentLine- Line separator component
Entity Components
EntityButton- Button for entity actionsEntityCard- Card display for entitiesEntityForm- Complete form for entity dataFieldButton- Button for field actionsFieldCard- Card for field displayFieldIcon- Icon for fieldsFieldInput- Input for field valuesFieldIsRequiredIcon- Indicator for required fieldsFieldIsSecretIcon- Indicator for secret fieldsFieldIsUniqueIcon- Indicator for unique fieldsFormCtx- Form context providerLinkIcon- Icon for linked fields
Registries
Field Type Registry
import { fieldTypeRegistry, createFieldType } from 'mountain-ui';
// Create custom field type
const customFieldType = createFieldType({
id: 'custom',
name: 'Custom Field',
icon: 'icon-path'
});
// Register it
fieldTypeRegistry.register(customFieldType);Entity Registry
import { entityRegistry, createEntity } from 'mountain-ui';
// Create entity
const entity = createEntity({
id: 'user',
name: 'User',
fields: [...]
});
// Register it
entityRegistry.register(entity);Dependencies
- Svelte ^5.56.1
- hamzus-ui ^0.0.255
Requirements
- Node.js >= 18.0.0
License
MIT
Author
Mountain Team
Repository
Developing
Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --openBuilding
To create a production version of your app:
npm run buildYou can preview the production build with npm run preview.
To deploy your app, you may need to install an adapter for your target environment.
