@njeybe/nativ 2.0.2 → 2.2.0

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.
@@ -1,78 +1,214 @@
1
- # UI/UX Specifications & Layout Design
2
-
3
- ## 1. System Identity & Visual Design Style
4
- - **System Domain Archetype:** Developer Mission Control / Analytical Workbench / Workflow Pipeline / Creative Canvas
5
- - **Design Style Archetype:** Modern Minimalist / Neo-Brutalism / Glassmorphism / Bento Grid / Neumorphism / Claymorphism / Skeuomorphism / Spatial UI
6
- - **Zero-Emoji Mandate:** Strictly enforced. All visual iconography must be precision vector SVGs aligned to the stroke and geometry of the chosen style. Never use Unicode emojis.
7
-
8
- ---
9
-
10
- ## 2. Design Tokens & CSS Variables
11
- Define explicit CSS variables for the chosen style to avoid ad-hoc hardcoded values:
12
-
13
- ```css
14
- :root {
15
- /* Surface & Canvas */
16
- --bg-canvas: #f8fafc;
17
- --surface: #ffffff;
18
- --surface-hover: #f1f5f9;
19
- --border-subtle: #e2e8f0;
20
- --border-hover: #cbd5e1;
21
-
22
- /* Typography & Contrast */
23
- --text-primary: #0f172a;
24
- --text-secondary: #64748b;
25
- --text-muted: #94a3b8;
26
-
27
- /* Brand & Accents */
28
- --brand: #4f46e5;
29
- --brand-hover: #4338ca;
30
- --brand-surface: #eef2ff;
31
-
32
- /* Status Colors */
33
- --status-success: #059669;
34
- --status-success-bg: #ecfdf5;
35
- --status-warning: #d97706;
36
- --status-warning-bg: #fffbeb;
37
- --status-danger: #e11d48;
38
- --status-danger-bg: #fff1f2;
39
- --status-info: #0284c7;
40
- --status-info-bg: #f0f9ff;
41
-
42
- /* Elevation & Geometry (Adjust by Design Style) */
43
- --radius-sm: 6px;
44
- --radius-md: 10px;
45
- --radius-lg: 16px;
46
- --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
47
- --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08);
48
- }
49
- ```
50
-
51
- ---
52
-
53
- ## 3. Layout Structure & Navigation Hierarchy
54
- - **Navigation Modality:** Vertical Pinned Sidebar (240px) or Top App Bar depending on application density.
55
- - **Content Area:** Fluid layout, max-width bounded, responsive grid/flex partitions.
56
- - **Docked Telemetry Drawer:** Collapsible bottom drawer for live logs, streaming output, or contextual diff inspections.
57
-
58
- ---
59
-
60
- ## 4. The 5 UI States Matrix
61
- Every component and view must implement all five states:
62
-
63
- | State | Visual & Interactive Requirement |
64
- | :--- | :--- |
65
- | **Default / Populated** | Crisp typography, tabular alignment for metrics, subtle hover feedback. |
66
- | **Empty State** | Meaningful vector SVG illustration, clear explanatory text, primary CTA button. |
67
- | **Loading / Skeleton** | Shimmer pulse cards matching the exact dimensions of loaded content (zero CLS). |
68
- | **Error / Degraded** | Actionable error alert card with an inline "Retry" action and non-cryptic diagnosis. |
69
- | **Overflow / Truncated** | Ellipsis truncation with full-value tooltips; pagination or virtual scrolling for >20 items. |
70
-
71
- ---
72
-
73
- ## 5. Interaction Ergonomics & Accessibility
74
- - **Micro-Transitions:** `transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);`.
75
- - **Active Click State:** `transform: scale(0.98)` (or brutalist `translate(2px, 2px)`).
76
- - **Focus Rings:** `:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }`.
77
- - **Dialogs & Drawers:** Dismissible via `Escape` key and backdrop click; background scroll locking.
78
- - **Accessible Labels:** `aria-label` required on all icon-only buttons.
1
+ # UI/UX Specifications
2
+
3
+ Plain language, concise. The Architect fills this in; workers follow it. Tasks point at a component with a specRef such as `ui_specs.md#appointment-list`.
4
+
5
+ ---
6
+
7
+ ## Planning Level
8
+ Pick one level and design track and write them here:
9
+ - **Level:** Quick | Standard | Full
10
+ - **Track:** Experience-First (Outside-In) | Data-First (Inside-Out)
11
+
12
+ - **Quick:** small fix, fast-path task, no design phase.
13
+ - **Standard:** new screen in an existing design. Flow + wireframe or component tree + component map. Reuse existing tokens.
14
+ - **Full:** new app, new platform or redesign. Discovery questions, brief, flows, two directions with style tiles, wireframes or component trees, component map.
15
+
16
+ - **Experience-First (Outside-In):** UI flows and screen data needs drive API contracts and DB schema.
17
+ - **Data-First (Inside-Out):** Core database schema or pipeline models drive API contracts and UI views.
18
+
19
+ ---
20
+
21
+ ## Design Brief
22
+ - **Who uses it:**
23
+ - **The job they are doing:**
24
+ - **Tone (three words):**
25
+ - **Things to avoid:**
26
+
27
+ ---
28
+
29
+ ## Users & Top Tasks
30
+ Top 3-5 user tasks and how often each happens.
31
+
32
+ | Task | Frequency |
33
+ | :--- | :--- |
34
+ | | |
35
+
36
+ ---
37
+
38
+ ## Real Content Samples
39
+ Real sample data per screen, drawn from `db_schema.json` and `api_contracts.json`. Include extremes: long names, empty values, big numbers. Never "Item 1" or lorem ipsum.
40
+
41
+ ---
42
+
43
+ ## User Flows
44
+ Each key journey step by step, with tap/click counts.
45
+
46
+ 1. Journey name (N taps)
47
+ 1. Step
48
+ 2. Step
49
+
50
+ ---
51
+
52
+ ## Design Directions
53
+ Exactly two directions.
54
+
55
+ - **Direction A:**
56
+ - **Direction B:**
57
+ - **Chosen and why:**
58
+ - **Full level only:** style tile at `.ai/design/style-tile.html`
59
+
60
+ ---
61
+
62
+ ## Design Tokens
63
+ Placeholders the Architect fills, each with a one-line rationale. Do not copy a default palette.
64
+
65
+ ```css
66
+ :root {
67
+ /* Surface & canvas */
68
+ --bg-canvas: <value>; /* why */
69
+ --surface: <value>; /* why */
70
+ --surface-hover: <value>; /* why */
71
+ --border-subtle: <value>; /* why */
72
+ --border-hover: <value>; /* why */
73
+
74
+ /* Typography & contrast */
75
+ --text-primary: <value>; /* why */
76
+ --text-secondary: <value>; /* why */
77
+ --text-muted: <value>; /* why */
78
+
79
+ /* Brand & accents */
80
+ --brand: <value>; /* why */
81
+ --brand-hover: <value>; /* why */
82
+ --brand-surface: <value>; /* why */
83
+
84
+ /* Status */
85
+ --status-success: <value>; --status-success-bg: <value>;
86
+ --status-warning: <value>; --status-warning-bg: <value>;
87
+ --status-danger: <value>; --status-danger-bg: <value>;
88
+ --status-info: <value>; --status-info-bg: <value>;
89
+
90
+ /* Geometry & elevation */
91
+ --radius-sm: <value>; --radius-md: <value>; --radius-lg: <value>;
92
+ --shadow-sm: <value>; --shadow-md: <value>;
93
+ }
94
+ ```
95
+
96
+ **Flutter mapping:** each token maps to a `ThemeData` field (`colorScheme`, `textTheme`) or a `ThemeExtension` (status colors, radii, shadows). List the mapping here.
97
+
98
+ | Token | Flutter target |
99
+ | :--- | :--- |
100
+ | `--brand` | `colorScheme.primary` |
101
+ | `--status-*` | `ThemeExtension` |
102
+
103
+ ---
104
+
105
+ ## Platform Rules
106
+ - **Primary platform (designed first):**
107
+ - **Web:** sidebar or top bar, density, keyboard support, hover states, targets at least 32px, behavior on wide screens.
108
+ - **Mobile:** bottom nav and sheets, back gesture, one main action per screen, thumb reach, targets at least 48dp, offline / slow / permission-denied states, safe areas and keyboard.
109
+ - **Mobile design language (choose explicitly):** Material 3 | Cupertino | custom.
110
+
111
+ ---
112
+
113
+ ## Wireframes
114
+ Choose the format that best communicates the layout:
115
+ 1. **ASCII Box Art:** Max 80 columns. Best for mobile screens, simple CRUD lists, and master-detail views.
116
+ 2. **Semantic Component Tree:** Indented hierarchy with layout annotations (e.g. grid, split-view, v-stack, h-stack). Best for dense dashboards, data tables, and responsive multi-column web views.
117
+
118
+ Label each region `<ComponentName>`. One desktop wireframe per key screen, plus mobile for the primary screen. Use real content. No HTML mockups.
119
+
120
+ ```
121
+ +--------------------------------------------------+
122
+ | <AppHeader> Clinic Dela Cruz [Sign out] |
123
+ +----------+---------------------------------------+
124
+ | <SideNav>| <AppointmentList> |
125
+ | Today | 09:00 Maria Concepcion-Villanueva |
126
+ | Patients | 09:30 (no name given) |
127
+ +----------+---------------------------------------+
128
+ ```
129
+
130
+ Or Semantic Component Tree:
131
+ ```yaml
132
+ Screen: AppointmentDashboard (Desktop 1280px+)
133
+ Layout: SplitView (sidebar: 240px, content: 1fr)
134
+ Tree:
135
+ - <AppSidebar (sticky, h-full)>:
136
+ - <ClinicBrandHeader title="Clinic Dela Cruz">
137
+ - <NavMenu active="today" items=["Today", "Patients"]>
138
+ - <MainContainer (v-stack, gap-6, p-6)>:
139
+ - <AppointmentFilterBar (h-stack, justify-between)>
140
+ - <AppointmentList (v-stack, gap-3)>:
141
+ - Columns: [Time, PatientName, StatusBadge, ActionButtons]
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Component Map
147
+
148
+ | Region | Component | File path | States | Section |
149
+ | :--- | :--- | :--- | :--- | :--- |
150
+ | | | | | [appointment-list](#appointment-list) |
151
+
152
+ ### appointment-list
153
+ Example component section. One per component: purpose, data, states, mutations, behavior. Keep the heading anchor stable.
154
+ - **Purpose:** Display upcoming patient appointments with instant check-in.
155
+ - **Data:** `Appointment[]` from `api_contracts.json#GET /appointments`.
156
+ - **States:** Loading skeleton (3 rows), Empty (prompt to book), Error (inline retry).
157
+ - **Mutations:**
158
+ - *Check in:* Inline button spinner -> optimistic status badge change to Checked In.
159
+ - *Cancel:* Confirm dialog -> optimistic remove. On error: rollback item with error toast.
160
+
161
+ ---
162
+
163
+ ## Copy & Wording
164
+ - **UI language(s):** e.g. English / Filipino
165
+ - **Key labels:**
166
+ - **Button verbs (domain words):**
167
+ - **Empty-state text:**
168
+ - **Error messages (plain language):**
169
+
170
+ ---
171
+
172
+ ## Signature Moments
173
+ One or two. Everything else stays restrained.
174
+
175
+ ---
176
+
177
+ ## Anti-Generic Checklist
178
+ **Web**
179
+ - [ ] No unconsidered font defaults. Consumer/brand: distinct curated typeface (e.g. Outfit, Plus Jakarta Sans, DM Sans). Data-dense B2B SaaS/utility: Inter, Roboto, or native system type permitted for density and zero-FOIT. No unstyled browser defaults without a reason.
180
+ - [ ] No default indigo/purple accent.
181
+ - [ ] No rows of identical cards with pastel icon boxes.
182
+ - [ ] No gradient-text hero.
183
+ - [ ] No decorative blobs.
184
+ - [ ] No greeting banners.
185
+ - [ ] No emojis. Icons are vector SVG.
186
+
187
+ **Mobile**
188
+ - [ ] No default Material seed blue.
189
+ - [ ] No unthemed default widgets without a reason.
190
+ - [ ] No emojis.
191
+
192
+ ---
193
+
194
+ ## States
195
+ Every component and view covers these.
196
+
197
+ | State | Requirement |
198
+ | :--- | :--- |
199
+ | **Loading** | Skeleton matching loaded dimensions. |
200
+ | **Empty** | Short explanation and a primary action. |
201
+ | **Error** | Plain diagnosis with a Retry action. |
202
+ | **Success** | Clear confirmation. |
203
+ | **Disabled** | Visibly inactive, with a reason where useful. |
204
+ | **Mutation / Action** | Behavior during Create/Update/Delete (optimistic vs inline spinner, disabled submit, rollback on failure). |
205
+ | **Mobile only** | Offline, slow connection, permission denied. |
206
+
207
+ ---
208
+
209
+ ## Accessibility
210
+ - **Transitions:** `transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);`
211
+ - **Active state:** `transform: scale(0.98)`.
212
+ - **Focus rings:** `:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }`
213
+ - **Dialogs and drawers:** close with `Escape` and backdrop click; lock background scroll.
214
+ - **Labels:** `aria-label` on every icon-only button.