@jsenv/navi 0.15.3 → 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 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.
@@ -18754,6 +18754,11 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
18754
18754
  border-style: solid;
18755
18755
  border-color: var(--x-border-color);
18756
18756
  border-radius: var(--button-border-radius);
18757
+
18758
+ .navi_icon,
18759
+ img {
18760
+ border-radius: inherit;
18761
+ }
18757
18762
  }
18758
18763
 
18759
18764
  &[data-hover] {
@@ -23130,10 +23135,10 @@ const initMoveStickyFrontierViaPointer = (pointerdownEvent, {
23130
23135
  installImportMetaCss(import.meta);import.meta.css = /* css */`
23131
23136
  .navi_table_ui {
23132
23137
  position: fixed;
23133
- z-index: ${Z_INDEX_TABLE_UI};
23134
- overflow: hidden; /* Ensure UI elements cannot impact scrollbars of the document */
23135
23138
  inset: 0;
23139
+ z-index: ${Z_INDEX_TABLE_UI};
23136
23140
  pointer-events: none; /* UI elements must use pointer-events: auto if they need to be interactive */
23141
+ overflow: hidden; /* Ensure UI elements cannot impact scrollbars of the document */
23137
23142
  /* background: rgba(0, 255, 0, 0.2); */
23138
23143
  }
23139
23144
  `;
@@ -23774,16 +23779,17 @@ const TableCell = forwardRef((props, ref) => {
23774
23779
  });
23775
23780
  const RowNumberCol = ({
23776
23781
  width = 50,
23777
- minWidth = 30,
23778
- maxWidth = 100,
23782
+ // minWidth = 30,
23783
+ // maxWidth = 100,
23779
23784
  immovable = true,
23780
23785
  ...rest
23781
23786
  }) => {
23782
23787
  return jsx(Col, {
23783
23788
  id: "row_number",
23784
- width: width,
23785
- minWidth: minWidth,
23786
- maxWidth: maxWidth,
23789
+ width: width
23790
+ // minWidth={minWidth}
23791
+ // maxWidth={maxWidth}
23792
+ ,
23787
23793
  immovable: immovable,
23788
23794
  ...rest
23789
23795
  });
@@ -23954,8 +23960,8 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
23954
23960
  position: absolute;
23955
23961
  width: 1px;
23956
23962
  height: 1px;
23957
- padding: 0;
23958
23963
  margin: -1px;
23964
+ padding: 0;
23959
23965
  overflow: hidden;
23960
23966
  clip: rect(0, 0, 0, 0);
23961
23967
  white-space: nowrap;
@@ -23971,8 +23977,8 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
23971
23977
  position: absolute;
23972
23978
  width: 1px;
23973
23979
  height: 1px;
23974
- padding: 0;
23975
23980
  margin: -1px;
23981
+ padding: 0;
23976
23982
  overflow: hidden;
23977
23983
  clip: rect(0, 0, 0, 0);
23978
23984
  white-space: nowrap;
@@ -24689,12 +24695,12 @@ const Svg = props => {
24689
24695
 
24690
24696
  installImportMetaCss(import.meta);import.meta.css = /* css */`
24691
24697
  .svg_mask_content * {
24698
+ color: black !important;
24699
+ opacity: 1 !important;
24692
24700
  fill: black !important;
24693
- stroke: black !important;
24694
24701
  fill-opacity: 1 !important;
24702
+ stroke: black !important;
24695
24703
  stroke-opacity: 1 !important;
24696
- color: black !important;
24697
- opacity: 1 !important;
24698
24704
  }
24699
24705
  `;
24700
24706
  const SVGMaskOverlay = ({