@jsenv/navi 0.15.2 → 0.15.4
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/README.md +110 -0
- package/dist/jsenv_navi.js +710 -179
- package/dist/jsenv_navi.js.map +80 -21
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# @jsenv/navi
|
|
2
|
+
|
|
3
|
+
> ⚠️ **Work in Progress** - This framework is being actively developed and APIs may change.
|
|
4
|
+
|
|
5
|
+
> Helps to build modern web application
|
|
6
|
+
|
|
7
|
+
**@jsenv/navi** is a comprehensive frontend framework designed to simplify navigation, state management, and UI development. Named after Navi, the fairy guide from Zelda, it helps you navigate through the complexities of building modern web applications.
|
|
8
|
+
|
|
9
|
+
## What it provides
|
|
10
|
+
|
|
11
|
+
### 🧭 Navigation & Routing
|
|
12
|
+
|
|
13
|
+
- **Client-side routing** with URL synchronization and code splitting
|
|
14
|
+
- **Link components** that enhance standard anchor tags
|
|
15
|
+
- **Route components** with nested routing support
|
|
16
|
+
- **History management** and navigation state hooks
|
|
17
|
+
- **Keyboard navigation** with keyboard shortcuts
|
|
18
|
+
|
|
19
|
+
### 🔄 State Management & Actions
|
|
20
|
+
|
|
21
|
+
- **Signal-based reactive state** with local storage integration
|
|
22
|
+
- **Action system** for async operations with lifecycle management
|
|
23
|
+
- **Resource management** with caching and request deduplication
|
|
24
|
+
- **Form validation** with custom constraints and real-time feedback
|
|
25
|
+
- **State synchronization** utilities and debugging tools
|
|
26
|
+
|
|
27
|
+
### 🎨 UI Components
|
|
28
|
+
|
|
29
|
+
#### Form & Input Controls
|
|
30
|
+
|
|
31
|
+
- **Input, Button, Label** - Enhanced form elements with validation
|
|
32
|
+
- **Radio/RadioList, Checkbox/CheckboxList** - Selection controls with icons and custom appearances
|
|
33
|
+
- **Select, Form** - Complete form building blocks
|
|
34
|
+
- **Field validation** with constraint validation API integration
|
|
35
|
+
- **Editable components** with inline editing capabilities
|
|
36
|
+
|
|
37
|
+
#### Data Visualization
|
|
38
|
+
|
|
39
|
+
- **Table** - Complete table system with selection, sorting, and column management
|
|
40
|
+
- **Selection system** - Multi-selection with keyboard shortcuts
|
|
41
|
+
- **Error boundaries** - Graceful error handling components
|
|
42
|
+
|
|
43
|
+
#### Layout & Structure
|
|
44
|
+
|
|
45
|
+
- **Box** - Flexible layout container with spacing and alignment
|
|
46
|
+
- **Details** - Collapsible content with navigation state persistence
|
|
47
|
+
- **Dialog, Viewport layouts** - Modal and full-screen layouts
|
|
48
|
+
- **Separator** - Visual content dividers
|
|
49
|
+
- **UI Transitions** - Smooth component transitions
|
|
50
|
+
|
|
51
|
+
#### Typography & Graphics
|
|
52
|
+
|
|
53
|
+
- **Text, Title, Paragraph** - Typography components with theming
|
|
54
|
+
- **Code, Caption** - Specialized text displays
|
|
55
|
+
- **Icon, Image, Svg** - Graphics with built-in icon library
|
|
56
|
+
- **Badge, MessageBox** - Status and notification displays
|
|
57
|
+
- **Address** - Semantic contact information component
|
|
58
|
+
|
|
59
|
+
#### Interactive Features
|
|
60
|
+
|
|
61
|
+
- **Keyboard shortcuts** - Global and component-level hotkeys
|
|
62
|
+
- **Focus management** - Accessibility-focused navigation
|
|
63
|
+
- **Callouts & popovers** - Contextual overlays and tooltips
|
|
64
|
+
- **Copy to clipboard** - One-click content copying
|
|
65
|
+
|
|
66
|
+
## Quick Example
|
|
67
|
+
|
|
68
|
+
```jsx
|
|
69
|
+
import { render } from "preact";
|
|
70
|
+
import { Link, Button, Box } from "@jsenv/navi";
|
|
71
|
+
|
|
72
|
+
const userSignal = signal();
|
|
73
|
+
const requestUser = async ({ id }) => {
|
|
74
|
+
const response = await fetch(`/api/users/${id}`);
|
|
75
|
+
const user = response.json();
|
|
76
|
+
userSignal.value = user;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const App = () => {
|
|
80
|
+
const user = userSignal.value;
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<Box row spacing="lg">
|
|
84
|
+
<Link href="/profile">Go to Profile</Link>
|
|
85
|
+
|
|
86
|
+
<Button
|
|
87
|
+
action={async () => {
|
|
88
|
+
await requestUser();
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
Load User Data
|
|
92
|
+
</Button>
|
|
93
|
+
|
|
94
|
+
{user && <div>Welcome, {user.name}!</div>}
|
|
95
|
+
</Box>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
render(<App />, document.querySelector("#root"));
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Architecture
|
|
103
|
+
|
|
104
|
+
The framework is built around three core concepts:
|
|
105
|
+
|
|
106
|
+
1. **Signals** - Reactive state primitives that automatically update the UI
|
|
107
|
+
2. **Actions** - Async operations with built-in lifecycle management
|
|
108
|
+
3. **Components** - Composable UI building blocks with consistent APIs
|
|
109
|
+
|
|
110
|
+
This combination provides a powerful yet simple foundation for building interactive web applications that scale from simple pages to complex SPAs.
|