@omerdlw/base-framework 3.4.1 → 4.0.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.
- package/dist/ambient/index.js +4 -5
- package/dist/background/index.js +3 -4
- package/dist/{chunk-DC4XZPDK.js → chunk-3FSDBJ7V.js} +4 -4
- package/dist/{chunk-DC4XZPDK.js.map → chunk-3FSDBJ7V.js.map} +1 -1
- package/dist/{chunk-GTJMM32W.js → chunk-5TQSH6KE.js} +6 -7
- package/dist/chunk-5TQSH6KE.js.map +1 -0
- package/dist/{chunk-DGVRHX3C.js → chunk-6P3F4JU3.js} +5 -6
- package/dist/{chunk-DGVRHX3C.js.map → chunk-6P3F4JU3.js.map} +1 -1
- package/dist/{chunk-3JLG24KI.js → chunk-AKPH5CEJ.js} +199 -9
- package/dist/chunk-AKPH5CEJ.js.map +1 -0
- package/dist/{chunk-KRHH3UQ6.js → chunk-AWLK2I56.js} +7 -8
- package/dist/{chunk-KRHH3UQ6.js.map → chunk-AWLK2I56.js.map} +1 -1
- package/dist/{chunk-M36DFIJ6.js → chunk-C527JOJQ.js} +4 -4
- package/dist/{chunk-M36DFIJ6.js.map → chunk-C527JOJQ.js.map} +1 -1
- package/dist/{chunk-E2QQJZYY.js → chunk-EXB7VFD3.js} +4 -4
- package/dist/{chunk-E2QQJZYY.js.map → chunk-EXB7VFD3.js.map} +1 -1
- package/dist/chunk-FG2AKFXP.js +108 -0
- package/dist/chunk-FG2AKFXP.js.map +1 -0
- package/dist/chunk-GA5SZ6E2.js +17 -0
- package/dist/{chunk-2E6OASVV.js.map → chunk-GA5SZ6E2.js.map} +1 -1
- package/dist/chunk-GG2ILNK2.js +44 -0
- package/dist/chunk-GG2ILNK2.js.map +1 -0
- package/dist/{chunk-VMR7ZKIF.js → chunk-JA75E4BG.js} +5 -5
- package/dist/{chunk-VMR7ZKIF.js.map → chunk-JA75E4BG.js.map} +1 -1
- package/dist/{chunk-BLWJZHRL.js → chunk-QZA5AIT6.js} +6 -9
- package/dist/chunk-QZA5AIT6.js.map +1 -0
- package/dist/{chunk-ST7QOM4O.js → chunk-T53WFIZN.js} +3 -3
- package/dist/{chunk-ST7QOM4O.js.map → chunk-T53WFIZN.js.map} +1 -1
- package/dist/{chunk-KN4KOTC7.js → chunk-WVED7PDH.js} +4 -4
- package/dist/{chunk-KN4KOTC7.js.map → chunk-WVED7PDH.js.map} +1 -1
- package/dist/{chunk-HPJWMBUS.js → chunk-XIFQMK2Z.js} +34 -37
- package/dist/chunk-XIFQMK2Z.js.map +1 -0
- package/dist/{chunk-7A47AXKI.js → chunk-YKHAFHB7.js} +4 -5
- package/dist/{chunk-7A47AXKI.js.map → chunk-YKHAFHB7.js.map} +1 -1
- package/dist/context-menu/index.js +7 -10
- package/dist/controls/index.js +3 -3
- package/dist/core/error/boundary.d.ts.map +1 -1
- package/dist/core/provider/index.d.ts +3 -8
- package/dist/core/provider/index.d.ts.map +1 -1
- package/dist/dock/index.js +6 -9
- package/dist/error/index.js +2 -5
- package/dist/foundation/recipes/index.d.ts +0 -7
- package/dist/foundation/recipes/index.d.ts.map +1 -1
- package/dist/index.js +15 -18
- package/dist/loading/index.js +2 -4
- package/dist/modal/index.js +10 -12
- package/dist/modal/index.js.map +1 -1
- package/dist/modules/dock/card/icon.d.ts.map +1 -1
- package/dist/modules/dock/card/use-card.d.ts +38 -38
- package/dist/modules/dock/media/controls.d.ts.map +1 -1
- package/dist/modules/dock/motion.d.ts +24 -24
- package/dist/modules/dock/status/model.d.ts.map +1 -1
- package/dist/modules/dock/surface/controls.d.ts.map +1 -1
- package/dist/modules/dock/surface/header-button.d.ts.map +1 -1
- package/dist/modules/dock/theme.d.ts +14 -14
- package/dist/modules/index.js +13 -16
- package/dist/modules/modal/container.d.ts.map +1 -1
- package/dist/notification/index.js +4 -4
- package/dist/overlay-ZCMQVNYT.js +12 -0
- package/dist/{overlay-YMLS3SAQ.js.map → overlay-ZCMQVNYT.js.map} +1 -1
- package/dist/provider/index.js +3 -8
- package/dist/react/theme/index.d.ts +7 -2
- package/dist/react/theme/index.d.ts.map +1 -1
- package/dist/react/theme/parts.d.ts +89 -0
- package/dist/react/theme/parts.d.ts.map +1 -0
- package/dist/recipes/index.js +1 -115
- package/dist/recipes/index.js.map +1 -1
- package/dist/theme/index.js +1 -1
- package/docs/README.md +11 -12
- package/docs/architecture-and-rules.md +8 -8
- package/docs/core-engine.md +11 -13
- package/docs/custom-modules.md +1 -1
- package/docs/design.md +60 -153
- package/docs/getting-started.md +3 -5
- package/docs/modules/README.md +1 -1
- package/docs/modules/background.md +1 -1
- package/docs/modules/context-menu.md +1 -1
- package/docs/modules/dock.md +23 -23
- package/docs/modules/error-boundary.md +1 -1
- package/docs/modules/loading.md +1 -1
- package/docs/modules/modal.md +1 -1
- package/package.json +1 -7
- package/templates/AGENTS.md +4 -3
- package/MIGRATION.md +0 -99
- package/dist/chunk-2E6OASVV.js +0 -17
- package/dist/chunk-3JLG24KI.js.map +0 -1
- package/dist/chunk-6LWCTP2Y.js +0 -448
- package/dist/chunk-6LWCTP2Y.js.map +0 -1
- package/dist/chunk-BLWJZHRL.js.map +0 -1
- package/dist/chunk-EBNZXYLT.js +0 -704
- package/dist/chunk-EBNZXYLT.js.map +0 -1
- package/dist/chunk-FLYL76ZT.js +0 -139
- package/dist/chunk-FLYL76ZT.js.map +0 -1
- package/dist/chunk-GTJMM32W.js.map +0 -1
- package/dist/chunk-HPJWMBUS.js.map +0 -1
- package/dist/chunk-ICFPSAJZ.js +0 -112
- package/dist/chunk-ICFPSAJZ.js.map +0 -1
- package/dist/chunk-S2ZOLTTS.js +0 -140
- package/dist/chunk-S2ZOLTTS.js.map +0 -1
- package/dist/foundation/recipes/anatomy.d.ts +0 -139
- package/dist/foundation/recipes/anatomy.d.ts.map +0 -1
- package/dist/foundation/recipes/define.d.ts +0 -133
- package/dist/foundation/recipes/define.d.ts.map +0 -1
- package/dist/overlay-YMLS3SAQ.js +0 -14
- package/dist/react/ui/components/avatar.d.ts +0 -10
- package/dist/react/ui/components/avatar.d.ts.map +0 -1
- package/dist/react/ui/components/button.d.ts +0 -6
- package/dist/react/ui/components/button.d.ts.map +0 -1
- package/dist/react/ui/components/carousel.d.ts +0 -27
- package/dist/react/ui/components/carousel.d.ts.map +0 -1
- package/dist/react/ui/components/checkbox.d.ts +0 -10
- package/dist/react/ui/components/checkbox.d.ts.map +0 -1
- package/dist/react/ui/components/icon.d.ts +0 -6
- package/dist/react/ui/components/icon.d.ts.map +0 -1
- package/dist/react/ui/components/image.d.ts +0 -6
- package/dist/react/ui/components/image.d.ts.map +0 -1
- package/dist/react/ui/components/indicator.d.ts +0 -55
- package/dist/react/ui/components/indicator.d.ts.map +0 -1
- package/dist/react/ui/components/input.d.ts +0 -10
- package/dist/react/ui/components/input.d.ts.map +0 -1
- package/dist/react/ui/components/loader.d.ts +0 -10
- package/dist/react/ui/components/loader.d.ts.map +0 -1
- package/dist/react/ui/components/segmented.d.ts +0 -6
- package/dist/react/ui/components/segmented.d.ts.map +0 -1
- package/dist/react/ui/components/select/options.d.ts +0 -22
- package/dist/react/ui/components/select/options.d.ts.map +0 -1
- package/dist/react/ui/components/select/select.d.ts +0 -6
- package/dist/react/ui/components/select/select.d.ts.map +0 -1
- package/dist/react/ui/components/skeleton.d.ts +0 -10
- package/dist/react/ui/components/skeleton.d.ts.map +0 -1
- package/dist/react/ui/components/switch.d.ts +0 -6
- package/dist/react/ui/components/switch.d.ts.map +0 -1
- package/dist/react/ui/components/tooltip/group.d.ts +0 -35
- package/dist/react/ui/components/tooltip/group.d.ts.map +0 -1
- package/dist/react/ui/components/tooltip/placement.d.ts +0 -42
- package/dist/react/ui/components/tooltip/placement.d.ts.map +0 -1
- package/dist/react/ui/components/tooltip/slot.d.ts +0 -23
- package/dist/react/ui/components/tooltip/slot.d.ts.map +0 -1
- package/dist/react/ui/components/tooltip/tooltip.d.ts +0 -13
- package/dist/react/ui/components/tooltip/tooltip.d.ts.map +0 -1
- package/dist/react/ui/index.d.ts +0 -20
- package/dist/react/ui/index.d.ts.map +0 -1
- package/dist/react/ui/provider.d.ts +0 -22
- package/dist/react/ui/provider.d.ts.map +0 -1
- package/dist/react/ui/types.d.ts +0 -341
- package/dist/react/ui/types.d.ts.map +0 -1
- package/dist/ui/index.d.ts +0 -1
- package/dist/ui/index.js +0 -2259
- package/dist/ui/index.js.map +0 -1
package/docs/core-engine.md
CHANGED
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
| :--------------------------------- | :-------------------- | :----------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
11
|
| `@omerdlw/base-framework/utils` | `foundation/utils/` | ✅ | Scheduling, stores, string/number/object helpers, motion retiming (`defineMotion`, `retime`), `report`, `toUserMessage`. Foundation layer: imports nothing from other layers. |
|
|
12
12
|
| `@omerdlw/base-framework/result` | `foundation/result/` | ✅ | `Result<T, E>`, `createSafeAction`. → [result.md](./modules/result.md) |
|
|
13
|
-
| `@omerdlw/base-framework/recipes` | `foundation/recipes/` | ✅ | Server-safe `
|
|
13
|
+
| `@omerdlw/base-framework/recipes` | `foundation/recipes/` | ✅ | Server-safe `defineRecipe`, `splitVariants`, `cn`, `createCn`. → [design.md](./design.md) |
|
|
14
14
|
| `@omerdlw/base-framework/events` | `foundation/events/` | ✅ | `globalEvents` bus, `EVENT_TYPES`, `FrameworkEventMap`. |
|
|
15
15
|
| `@omerdlw/base-framework/hooks` | `react/hooks/` | client | Universal React hooks. |
|
|
16
|
-
| `@omerdlw/base-framework/theme` | `react/theme/` | client | Theme specs and provider (shared by core and modules).
|
|
17
|
-
| `@omerdlw/base-framework/ui` | `react/ui/` | client | Styled components (`Button`, `Icon`, `Loader`, `Tooltip`, …) the modules render with too. → [design.md](./design.md) |
|
|
16
|
+
| `@omerdlw/base-framework/theme` | `react/theme/` | client | Theme specs and provider (shared by core and modules); the app's `components` and `icons` the modules draw with. → [design.md](./design.md) |
|
|
18
17
|
| `@omerdlw/base-framework/kernel` | `core/kernel/` | client | Module host, registry, `usePage`. → [kernel.md](./modules/kernel.md) |
|
|
19
18
|
| `@omerdlw/base-framework/error` | `core/error/` | client | Boundaries, reporter. → [error-boundary.md](./modules/error-boundary.md) |
|
|
20
19
|
| `@omerdlw/base-framework/provider` | `core/provider/` | client | `CoreProvider`: the one component that assembles everything. |
|
|
@@ -40,16 +39,15 @@ Server-safe entries (`utils`, `recipes`, `result`, `events`) must not import Rea
|
|
|
40
39
|
</Compose>
|
|
41
40
|
```
|
|
42
41
|
|
|
43
|
-
| Prop | Type
|
|
44
|
-
| :---------------- |
|
|
45
|
-
| `modules` | `readonly AnyCoreModule[]`
|
|
46
|
-
| `registryEntries` | `readonly AppRegistryEntry[]`
|
|
47
|
-
| `providers` | `readonly ProviderEntry[]`
|
|
48
|
-
| `overlays` | `ReactNode`
|
|
49
|
-
| `slots` | `{ beforeContent?, afterContent?, overlays? }`
|
|
50
|
-
| `tooltip` | `boolean \| { delayDuration?, skipDelayDuration? }` | The framework's `TooltipProvider` (default on: 300 / 150 ms). `false` removes it (then `Tooltip` components need their own provider). |
|
|
42
|
+
| Prop | Type | Meaning |
|
|
43
|
+
| :---------------- | :--------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
44
|
+
| `modules` | `readonly AnyCoreModule[]` | **Required.** Which modules to install (order does not matter; `uses` sorts them). Listing only some (`[dockModule, notificationModule]`) ships only those. Read **once** at mount. |
|
|
45
|
+
| `registryEntries` | `readonly AppRegistryEntry[]` | Initial (static) registry entries: dock cards, global context menus… `{ type, items: { key: value } }`. |
|
|
46
|
+
| `providers` | `readonly ProviderEntry[]` | Extra providers nested **inside** the module host (so they can use modules). A provider is a component or `[Component, props]`. |
|
|
47
|
+
| `overlays` | `ReactNode` | Rendered after `children`, inside the pipeline. |
|
|
48
|
+
| `slots` | `{ beforeContent?, afterContent?, overlays? }` | Positional content around `children`. |
|
|
51
49
|
|
|
52
|
-
Resulting tree: `GlobalError` → `
|
|
50
|
+
Resulting tree: `GlobalError` → `ModuleHost` (registry, page controller stack, module providers, backdrops, **children**, overlays; each module UI inside `ModuleError`) → your `providers` → `beforeContent`, `children`, `afterContent`, `overlays`, `slots.overlays`, `GlobalErrorListener`.
|
|
53
51
|
|
|
54
52
|
`Compose` (from `@omerdlw/base-framework/kernel`) is the helper that nests provider lists; use it for your own pipelines.
|
|
55
53
|
|
|
@@ -170,7 +168,7 @@ The only numbers left in module code are relative stacking inside a module's own
|
|
|
170
168
|
|
|
171
169
|
## 9. Gotchas
|
|
172
170
|
|
|
173
|
-
- Importing `@omerdlw/base-framework/hooks` or `@omerdlw/base-framework/
|
|
171
|
+
- Importing `@omerdlw/base-framework/hooks` or `@omerdlw/base-framework/theme` from a server-safe entry breaks the lint boundary and the Edge bundle.
|
|
174
172
|
- `createStore` snapshots are frozen in development: mutate through `publish`/`setState`, never in place.
|
|
175
173
|
- `useStore` without a selector re-renders on every change; select a slice.
|
|
176
174
|
- A theme file that is not listed in `src/config/index.ts` crashes the first component that uses it (by design, with a clear message).
|
package/docs/custom-modules.md
CHANGED
|
@@ -146,7 +146,7 @@ Create `src/modules/tour/overlay.tsx`:
|
|
|
146
146
|
|
|
147
147
|
import React from "react";
|
|
148
148
|
import { useTheme } from "@omerdlw/base-framework/theme";
|
|
149
|
-
import { Button } from "@omerdlw/base-framework/
|
|
149
|
+
import { ThemeButton as Button } from "@omerdlw/base-framework/theme";
|
|
150
150
|
import { useTour } from "./context";
|
|
151
151
|
import { tourTheme } from "./constants";
|
|
152
152
|
|
package/docs/design.md
CHANGED
|
@@ -1,185 +1,92 @@
|
|
|
1
|
-
# Design
|
|
1
|
+
# Design: the app's components, the framework's modules
|
|
2
2
|
|
|
3
|
-
> **Read this first if you need to:**
|
|
3
|
+
> **Read this first if you need to:** understand why the framework ships no UI, give the modules (dock, modal, error screen, loading, media bar…) your own button, icon, spinner and tooltip, or name the icons they show.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## 1. The idea
|
|
8
8
|
|
|
9
|
-
The framework holds **no design**.
|
|
9
|
+
The framework holds **no design and no UI components**. There is no CSS file, no colour or size token, no motion value, no icon set and no `Button`. The modules own their mechanics and take every class and every timing from the app's theme ([theming.md](./theming.md)).
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- The app gives the parts their look in **one file** with `defineUi(...)`: a base, named variants, compound variants and defaults for each part (`cva`-shaped). It also gives the motion and the icons.
|
|
13
|
-
- The result is a plain, **server-safe object**. A Server Component calls a part (`ui.parts.button.root({ intent: "primary" })`); `<UiProvider ui={ui}>` hands it to the components.
|
|
14
|
-
- A one-line **module augmentation** types the components from the app's recipes: a variant the app wrote type-checks; one nobody wrote does not.
|
|
11
|
+
A module does still need a few pieces to draw: a button, an icon, a spinner and a tooltip. It never imports them. It renders the component the app hands to `ThemeProvider`:
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
| Slot | What a module passes it | Without it |
|
|
14
|
+
| :-------- | :----------------------------------------------------------------------------------------- | :------------------------------- |
|
|
15
|
+
| `Button` | `ThemeButtonProps`: button attributes, `data-*`, `ref`; the look is the theme slot's class | a plain `<button type="button">` |
|
|
16
|
+
| `Icon` | `ThemeIconProps`: `icon` (a name), `size` in px, `className`, `color`, `style`, `onClick` | nothing |
|
|
17
|
+
| `Spinner` | `ThemeSpinnerProps`: `className`, `size` | nothing |
|
|
18
|
+
| `Tooltip` | `ThemeTooltipProps`: the trigger as `children`, `text`, `className`, `sideOffset` | the trigger alone |
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
@omerdlw/base-framework/recipes defineUi, recipes, createCn, ANATOMY (server-safe)
|
|
20
|
-
@omerdlw/base-framework/ui UiProvider + components ("use client")
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
`design` sits beside `hooks` in the layer hierarchy: it imports `hooks`, `theme`, `kernel` and `utils`, and never imports a module. The modules render with its `Button`, `Icon`, `Loader` and `Tooltip`, so those pick up the app's look too.
|
|
20
|
+
The component library belongs to the app. A new app copies it from the template's `src/design/components` as source and changes it freely.
|
|
24
21
|
|
|
25
22
|
---
|
|
26
23
|
|
|
27
24
|
## 2. Setup
|
|
28
25
|
|
|
29
|
-
### 2.1 The ui
|
|
30
|
-
|
|
31
|
-
```ts
|
|
32
|
-
// src/design/ui.ts — no "use client": Server Components import it too
|
|
33
|
-
import { defineUi } from "@omerdlw/base-framework/recipes";
|
|
34
|
-
|
|
35
|
-
export const ui = defineUi({
|
|
36
|
-
parts: {
|
|
37
|
-
button: {
|
|
38
|
-
root: {
|
|
39
|
-
base: "inline-flex items-center justify-center gap-2 font-medium",
|
|
40
|
-
variants: {
|
|
41
|
-
intent: {
|
|
42
|
-
primary: "bg-primary text-on-primary",
|
|
43
|
-
ghost: "bg-transparent",
|
|
44
|
-
},
|
|
45
|
-
size: { sm: "h-8 px-3 text-sm", md: "h-10 px-4" },
|
|
46
|
-
},
|
|
47
|
-
defaultVariants: { size: "md" },
|
|
48
|
-
},
|
|
49
|
-
busyLabel: { base: "invisible col-start-1 row-start-1" },
|
|
50
|
-
busySpinner: { base: "col-start-1 row-start-1 grid place-items-center" },
|
|
51
|
-
},
|
|
52
|
-
// …every part you use
|
|
53
|
-
},
|
|
54
|
-
icons: {
|
|
55
|
-
check: "lucide:check",
|
|
56
|
-
chevron: "lucide:chevron-down",
|
|
57
|
-
spinner: "lucide:loader",
|
|
58
|
-
},
|
|
59
|
-
motion: { follow: { type: "spring", stiffness: 500, damping: 40 } },
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
declare module "@omerdlw/base-framework/recipes" {
|
|
63
|
-
interface UiRegister {
|
|
64
|
-
ui: typeof ui;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
A part takes a recipe (`{ base, variants, compoundVariants, defaultVariants }`); `reset: true` drops what the anatomy declared. Your CSS (colours, type scale, utilities) lives in your app; the framework neither ships nor reads it.
|
|
70
|
-
|
|
71
|
-
### 2.2 The provider
|
|
72
|
-
|
|
73
26
|
```tsx
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
import {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
27
|
+
"use client";
|
|
28
|
+
|
|
29
|
+
import {
|
|
30
|
+
ThemeProvider,
|
|
31
|
+
type ThemeComponents,
|
|
32
|
+
} from "@omerdlw/base-framework/theme";
|
|
33
|
+
import { Button } from "@/design/components/button";
|
|
34
|
+
import { Icon } from "@/design/components/icon";
|
|
35
|
+
import { Spinner } from "@/design/components/loader";
|
|
36
|
+
import { Tooltip } from "@/design/components/tooltip";
|
|
37
|
+
|
|
38
|
+
const COMPONENTS: Partial<ThemeComponents> = { Button, Icon, Spinner, Tooltip };
|
|
39
|
+
|
|
40
|
+
const ICONS = {
|
|
41
|
+
back: "solar:alt-arrow-left-bold",
|
|
42
|
+
close: "solar:close-bold",
|
|
43
|
+
error: "solar:danger-circle-bold",
|
|
44
|
+
// …
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export function DesignProvider({ children }: { children: React.ReactNode }) {
|
|
48
|
+
return (
|
|
49
|
+
<ThemeProvider components={COMPONENTS} icons={ICONS} themes={themes}>
|
|
50
|
+
{children}
|
|
51
|
+
</ThemeProvider>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
81
54
|
```
|
|
82
55
|
|
|
83
|
-
A nested `
|
|
56
|
+
A nested `ThemeProvider` merges its `components` and `icons` over its parent's, so a subtree can swap one slot. Tooltip timing (open delay, skip window) belongs to the app's own tooltip provider.
|
|
84
57
|
|
|
85
58
|
---
|
|
86
59
|
|
|
87
|
-
## 3.
|
|
88
|
-
|
|
89
|
-
### 3.1 Parts
|
|
90
|
-
|
|
91
|
-
| Level | Where | Reach |
|
|
92
|
-
| :----------- | :------------------------------------------------ | :------------------- |
|
|
93
|
-
| **Recipes** | `defineUi({ parts })` | one part, everywhere |
|
|
94
|
-
| **Subtree** | a nested `<UiProvider ui={otherUi}>` | one part, below it |
|
|
95
|
-
| **Instance** | `className` (root) and `classNames={{ part: … }}` | one element |
|
|
96
|
-
|
|
97
|
-
A variant you add arrives as a prop the component never named; it styles the part and never reaches the DOM. A component of your own can live in the same system: `defineUi({ parts: { badge: { root: { … } } } })` and call `ui.parts.badge.root(…)`.
|
|
98
|
-
|
|
99
|
-
### 3.2 Motion
|
|
100
|
-
|
|
101
|
-
```ts
|
|
102
|
-
defineUi({
|
|
103
|
-
motion: {
|
|
104
|
-
follow: { type: "spring", stiffness: 500, damping: 40 }, // segmented pill, highlight
|
|
105
|
-
menu: {
|
|
106
|
-
// select menu; custom = 1 or -1 (opens down / up)
|
|
107
|
-
initial: (rise) => ({ opacity: 0, y: rise * -8 }),
|
|
108
|
-
animate: { opacity: 1, y: 0, transition: { duration: 0.3 } },
|
|
109
|
-
exit: (rise) => ({
|
|
110
|
-
opacity: 0,
|
|
111
|
-
y: rise * -6,
|
|
112
|
-
transition: { duration: 0.15 },
|
|
113
|
-
}),
|
|
114
|
-
},
|
|
115
|
-
option: {
|
|
116
|
-
// each option; custom = its index
|
|
117
|
-
initial: { opacity: 0 },
|
|
118
|
-
animate: (index) => ({ opacity: 1, transition: { delay: 0.02 * index } }),
|
|
119
|
-
},
|
|
120
|
-
glide: { duration: 0.8, ease: [0.5, 0, 0.1, 1] }, // carousel arrows
|
|
121
|
-
},
|
|
122
|
-
});
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
`menu` and `option` are `motion/react` variants (`initial`, `animate`, `exit`). Leave a key out and that part does not animate: the pill and the highlight jump, the menu appears, the carousel scrolls in one step. Every value is retimed by `ThemeProvider motion`'s tempo and replaced by its `still` transition for reduced motion.
|
|
126
|
-
|
|
127
|
-
### 3.3 Icons and labels
|
|
60
|
+
## 3. Icons
|
|
128
61
|
|
|
129
|
-
|
|
62
|
+
When an app gives a module an icon (a dock card's `icon`, an action's `icon`), the module passes the string straight to the app's `Icon`.
|
|
130
63
|
|
|
131
|
-
|
|
64
|
+
The framework's own icons are named by **key** (`FrameworkIcon`). The app's `icons` map turns each key into a name its `Icon` understands. A key the map does not name is passed through unchanged.
|
|
132
65
|
|
|
133
|
-
|
|
66
|
+
| Key | Where it shows |
|
|
67
|
+
| :----------------------------------------- | :------------------------------ |
|
|
68
|
+
| `close` | modal close, dock surface close |
|
|
69
|
+
| `back`, `next` | dock controls, breadcrumbs |
|
|
70
|
+
| `error` | error boundary fallback |
|
|
71
|
+
| `danger`, `forbidden` | route guard status cards |
|
|
72
|
+
| `wifi`, `wifiOff` | online / offline status |
|
|
73
|
+
| `play`, `pause` | dock header and media bar |
|
|
74
|
+
| `rewind`, `forward`, `pip`, `repeat` | media bar |
|
|
75
|
+
| `volumeMuted`, `volumeSmall`, `volumeLoud` | media bar volume |
|
|
134
76
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
```ts
|
|
138
|
-
defineUi({
|
|
139
|
-
merge: {
|
|
140
|
-
theme: { radius: ["card", "tile"], spacing: ["control-md"] },
|
|
141
|
-
classGroups: {
|
|
142
|
-
"font-size": ["type-body", "type-meta"],
|
|
143
|
-
duration: ["duration-move"],
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
ui.cn("type-body", "type-meta"); // "type-meta"
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
`theme` extends Tailwind's scales; `classGroups` lists whole class names per group.
|
|
77
|
+
In a module of your own, draw with `ThemeButton`, `ThemeIcon`, `ThemeSpinner` and `ThemeTooltip` from `@omerdlw/base-framework/theme`. They read the same slots.
|
|
151
78
|
|
|
152
79
|
---
|
|
153
80
|
|
|
154
|
-
## 4.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
| Component | Parts (`classNames` keys) | States | Notes |
|
|
159
|
-
| :------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
160
|
-
| `Button` | `root`, `bare`, `busy`, `busyLabel`, `busySpinner` | — | With an `intent` prop it draws `root`, without one `bare`. `loading` stacks `busyLabel` and `busySpinner` inside `busy`. Pass `href` to render a `next/link` with the same classes. |
|
|
161
|
-
| `Input`, `Textarea` | `field`, `area` | — | `Textarea` draws `field` plus `area`. |
|
|
162
|
-
| `Switch` | `track`, `thumb` | — | `data-state="checked"/"unchecked"` on both; `role="switch"`, `onCheckedChange`. |
|
|
163
|
-
| `Checkbox`, `CheckboxIndicator` | `root`, `box`, `glyph` | `checked` (box, glyph) | `pending` plays the loader. |
|
|
164
|
-
| `SegmentedControl` | `root`, `segment`, `pill`, `chosen`, `icon`, `count` | `active` (segment) | Tabs with a sliding pill; `chosen` paints the active tab until the pill is measured. |
|
|
165
|
-
| `Select` | `root`, `trigger`, `value`, `label`, `placeholder`, `chevron`, `menu`, `option`, `highlight`, `optionBody`, `text`, `description`, `icon`, `check`, `empty` | — | Listbox: arrows, Enter/Space, Escape; flips up; anchor positioning where supported; scroll lock while open. `offset` and `collisionPadding` (px, default 0); the room left in the viewport is `--select-available-height` on the menu. `floatingProps` for the portal. |
|
|
166
|
-
| `Carousel` | `root`, `track`, `slide`, `arrow`, `icon` | `side`, `visible` (arrow) | Touch, wheel, mouse drag; arrow glide; `onNearEnd`. `trackProps` for data hooks; inject `glide`, `renderSlide`, `ready`, `frameSelector` to drive it from your own engine. |
|
|
167
|
-
| `Tooltip`, `TooltipProvider` | `content`, `label` | — | Built-in placement (flip, `align`, shift); `sideOffset`/`collisionPadding` default to 0. Content gets `data-state` (`delayed-open`, `instant-open`, `closed`), `data-side`, `data-align` and `--tooltip-*` vars; stays mounted for its exit animation. `contentProps`, `triggerRef`. The content's `z-index` is copied to the `[data-tooltip-wrapper]` portal. |
|
|
168
|
-
| `Image` | `frame`, `picture`, `fallback` | `layout` (frame, picture), `loading` (frame) | `loading` is true until the picture decodes (paused off screen); CORS retry; fallback. |
|
|
169
|
-
| `Avatar` | `root`, `image`, `initials` | — | `size` sets width and height inline; without it the root's classes size it. |
|
|
170
|
-
| `Loader`, `Spinner` | `root`, `label`, `overlay`, `dots`, `dot`, `spinner`, `icon` | `over` (root) | Three `dot`s inside `dots`; `size` sets `--loader-size` on `dots`. Over content, `label` keeps the width and `overlay` holds the dots. |
|
|
171
|
-
| `SkeletonBlock`, `SkeletonLines` | `block`, `lines`, `line`, `bar` | — | `SkeletonLines` draws one `bar` per width inside a `line`. |
|
|
172
|
-
| `SlidingPill`, `useSlidingPill`, `SlidingHighlight`, `HighlightGroup`, `useHighlight` | `highlight.fill` | — | Positioned inline (absolute, no pointer events); the `follow` motion moves them. |
|
|
173
|
-
| `Icon` | — | — | Iconify. `size` in px, or let its class size it (`1em`). |
|
|
174
|
-
|
|
175
|
-
Pure helpers for your own racks: `glideTarget`, `rackClip`, `readScroll`, `useDragScroll`.
|
|
81
|
+
## 4. Recipes
|
|
82
|
+
|
|
83
|
+
`@omerdlw/base-framework/recipes` remains, and is server-safe: `defineRecipe`, `extendRecipe`, `compileRecipe`, `splitVariants`, `cn` and `createCn`. They are tools for writing the app's own component recipes; the framework defines none of its own.
|
|
176
84
|
|
|
177
85
|
---
|
|
178
86
|
|
|
179
87
|
## 5. Rules
|
|
180
88
|
|
|
181
|
-
1. **No design in the framework.** A class, a colour, a duration or an icon name in `src/` is a bug; it belongs in the app
|
|
182
|
-
2. **
|
|
183
|
-
3. **
|
|
184
|
-
4. **
|
|
185
|
-
5. **Server Components call parts, client components render components.** `ui.parts.*` is safe anywhere; components are `"use client"`.
|
|
89
|
+
1. **No design in the framework.** A class, a colour, a duration, a component or an icon name in `src/` is a bug; it belongs in the app.
|
|
90
|
+
2. **Modules draw through the slots.** Never import an app component into a module; use `ThemeButton`, `ThemeIcon`, `ThemeSpinner` and `ThemeTooltip`.
|
|
91
|
+
3. **Name framework icons by key.** A new icon that a module shows needs a new `FrameworkIcon` key and a row in section 3.
|
|
92
|
+
4. **Write classes literally.** Tailwind reads source files; a class built at runtime is never generated.
|
package/docs/getting-started.md
CHANGED
|
@@ -20,7 +20,7 @@ Before installing `@omerdlw/base-framework`, verify your environment:
|
|
|
20
20
|
Install `@omerdlw/base-framework` alongside its required peer dependencies:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npm install @omerdlw/base-framework motion
|
|
23
|
+
npm install @omerdlw/base-framework motion tailwind-merge
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
### Peer Dependencies Breakdown
|
|
@@ -28,14 +28,13 @@ npm install @omerdlw/base-framework motion @iconify-icon/react tailwind-merge
|
|
|
28
28
|
| Package | Purpose in Base Framework |
|
|
29
29
|
| :-------------------- | :-------------------------------------------------------------------------------- |
|
|
30
30
|
| `motion` (`>=12.0.0`) | Hardware GPU-accelerated motion presets (`translate3d`, `scale`, spring physics). |
|
|
31
|
-
| `@iconify-icon/react` | Unified SVG-free icon rendering via `<Icon icon="solar:..." />`. |
|
|
32
31
|
| `tailwind-merge` | Conflict resolution behind `cn()` class merging. |
|
|
33
32
|
|
|
34
33
|
---
|
|
35
34
|
|
|
36
35
|
## 3. Styling
|
|
37
36
|
|
|
38
|
-
The framework ships no CSS and no class names: Tailwind has nothing to scan in the package. Every class lives in your app, in your module themes ([theming.md](./theming.md)) and your
|
|
37
|
+
The framework ships no CSS and no class names: Tailwind has nothing to scan in the package. Every class lives in your app, in your module themes ([theming.md](./theming.md)) and in your own components ([design.md](./design.md)), so Tailwind finds it in your own sources. Your stylesheet is entirely yours:
|
|
39
38
|
|
|
40
39
|
```css
|
|
41
40
|
/* src/app/globals.css */
|
|
@@ -125,7 +124,7 @@ Create `src/app/page.tsx`:
|
|
|
125
124
|
"use client";
|
|
126
125
|
|
|
127
126
|
import { usePage } from "@omerdlw/base-framework/kernel";
|
|
128
|
-
import { Button, Icon } from "
|
|
127
|
+
import { Button, Icon } from "@/design/components"; // your own components
|
|
129
128
|
|
|
130
129
|
export default function HomePage() {
|
|
131
130
|
const page = usePage({
|
|
@@ -180,7 +179,6 @@ export default function HomePage() {
|
|
|
180
179
|
| `@omerdlw/base-framework/result` | Functional error handling | `Result<T, E>`, `ok()`, `err()`, `isResult()`, `createSafeAction()` |
|
|
181
180
|
| `@omerdlw/base-framework/events` | Cross-cutting event bus | `globalEvents`, `EVENT_TYPES`, `FrameworkEventMap` |
|
|
182
181
|
| `@omerdlw/base-framework/theme` | Declarative theme engine (slots and motion) | `defineThemeSpec()`, `defineTheme()`, `ThemeProvider`, `useTheme()`, `useModuleMotion()`, `useMotionTokens()` |
|
|
183
|
-
| `@omerdlw/base-framework/ui` | Unstyled components your `defineUi` styles | `Button`, `Icon`, `Select`, `Carousel`, `UiProvider`, … |
|
|
184
182
|
| `@omerdlw/base-framework/hooks` | Universal React hooks | `useStore()`, `useClickOutside()`, `useGlobalEvent()`, `useRequiredContext()` |
|
|
185
183
|
| `@omerdlw/base-framework/utils` | Pure runtime utilities | `clamp()`, `debounce()`, `throttle()`, `createStore()`, `createScheduler()`, `report()`, `defineMotion()`, `gpuTransform()` |
|
|
186
184
|
| `@omerdlw/base-framework/error` | Isolated error boundaries | `GlobalError`, `ModuleError`, `UserError`, `toUserMessage()` |
|
package/docs/modules/README.md
CHANGED
|
@@ -163,7 +163,7 @@ Every page follows this skeleton (omit sections that do not apply). Keep it **ve
|
|
|
163
163
|
src/app ─┐
|
|
164
164
|
src/features ─┼─▶ @omerdlw/base-framework/<module> ──▶ @omerdlw/base-framework/kernel ──▶ @omerdlw/base-framework/{utils,hooks,events,result}
|
|
165
165
|
src/core/provider.tsx ┘ │
|
|
166
|
-
└──▶ @omerdlw/base-framework/
|
|
166
|
+
└──▶ @omerdlw/base-framework/theme
|
|
167
167
|
```
|
|
168
168
|
|
|
169
169
|
Modules are installed by `CoreProvider` from the list the app passes; orchestration drives modules through their `defineModule` definitions and never imports them.
|
|
@@ -200,6 +200,6 @@ Flat layout ([architecture §2.1](../architecture-and-rules.md#21-flat-layout-de
|
|
|
200
200
|
|
|
201
201
|
## 12. Dependencies
|
|
202
202
|
|
|
203
|
-
- **Uses:** `@omerdlw/base-framework/kernel` (`defineModule`, `definePeer`, `useModuleRegistration`, `useRegistryValue`), `@omerdlw/base-framework/hooks`, `@omerdlw/base-framework/utils`, `@omerdlw/base-framework/
|
|
203
|
+
- **Uses:** `@omerdlw/base-framework/kernel` (`defineModule`, `definePeer`, `useModuleRegistration`, `useRegistryValue`), `@omerdlw/base-framework/hooks`, `@omerdlw/base-framework/utils`, `@omerdlw/base-framework/theme` (`ThemeSpinner`), `@omerdlw/base-framework/theme`, `motion/react`, `next/navigation`; the route `src/app/api/background/youtube`.
|
|
204
204
|
- **Peer:** `media` (read through `definePeer`, listed in `uses`).
|
|
205
205
|
- **Used by:** `src/core/provider.tsx` (installs it) and every page that calls `usePage({ background })`; the dock and audio sources interact with it only through `media`.
|
|
@@ -244,6 +244,6 @@ No classes or colors in the module, except the pointer-following `left/top/posit
|
|
|
244
244
|
|
|
245
245
|
## 9. Dependencies
|
|
246
246
|
|
|
247
|
-
- **Uses:** `@omerdlw/base-framework/kernel` (`defineModule`, `useModuleRegistration`, `useRegistryEntries`, `useModuleState`), `@omerdlw/base-framework/utils`, `@omerdlw/base-framework/hooks`, `@omerdlw/base-framework/
|
|
247
|
+
- **Uses:** `@omerdlw/base-framework/kernel` (`defineModule`, `useModuleRegistration`, `useRegistryEntries`, `useModuleState`), `@omerdlw/base-framework/utils`, `@omerdlw/base-framework/hooks`, `@omerdlw/base-framework/theme` (`ThemeIcon`), `@omerdlw/base-framework/theme`, `next/navigation`, `motion/react`.
|
|
248
248
|
- **Peer:** `dock` — read with `useModuleState("dock", selectDockPageCard, null)`; works (without a default header) when the dock is not installed.
|
|
249
249
|
- **Used by:** `src/core/provider.tsx` (installs it), `page.modules.contextMenu`, and features that register menus.
|
package/docs/modules/dock.md
CHANGED
|
@@ -228,28 +228,28 @@ Everything below is exported from `@omerdlw/base-framework/dock`. Anything not l
|
|
|
228
228
|
|
|
229
229
|
### 6.1 `DockPageConfig` (the `dock` key of `usePage`)
|
|
230
230
|
|
|
231
|
-
| Field | Type
|
|
232
|
-
| :--------------------------------------- |
|
|
233
|
-
| `title`, `description` | `string \| ReactNode`
|
|
234
|
-
| `icon` |
|
|
235
|
-
| `iconOverlay` | `{ icon, title?, onClick? }`
|
|
236
|
-
| `badge` | `ReactNode`
|
|
237
|
-
| `banner` / `bannerUrl` | `string \| { url, position, size, repeat, opacity }`
|
|
238
|
-
| `style` | `DockVisualStyleInput`
|
|
239
|
-
| `className`, `width` |
|
|
240
|
-
| `component`, `content`, `props` |
|
|
241
|
-
| `action`, `headerAction` | `ReactNode \| ComponentType`
|
|
242
|
-
| `actions` | `Partial<DockActionDescriptor>[]`
|
|
243
|
-
| `guard` | `{ when: boolean, message?, onBlock? }`
|
|
244
|
-
| `surfaces` | `Record<string, SurfaceDef \| Component>`
|
|
245
|
-
| `name` | `string`
|
|
246
|
-
| `path`, `targetPath` | `string`
|
|
247
|
-
| `isLoading` | `boolean`
|
|
248
|
-
| `isOverlay`, `dismissible` | `boolean`
|
|
249
|
-
| `dockPolicy` | `{ clearTransientState?, dismissSurfaces?, prefetch? }`
|
|
250
|
-
| `keepWhenDescendant`, `prefetchDisabled` | `boolean \| (activePath, item) => boolean`, `boolean`
|
|
251
|
-
| `stackOrder` | `number`
|
|
252
|
-
| `registry` | `RegistryMetadata`
|
|
231
|
+
| Field | Type | Meaning |
|
|
232
|
+
| :--------------------------------------- | :---------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
233
|
+
| `title`, `description` | `string \| ReactNode` | Header text. `title` falls back to the page-level `title`. |
|
|
234
|
+
| `icon` | icon name your `Icon` draws (`"solar:home-2-bold"`), image URL, or node | Card icon. |
|
|
235
|
+
| `iconOverlay` | `{ icon, title?, onClick? }` | Small badge on the icon. |
|
|
236
|
+
| `badge` | `ReactNode` | Badge on the card. Update it live with `globalEvents.emit(DOCK_EVENTS.UPDATE_BADGE, { key: card.name.toLowerCase(), value, color? })` (`value` `null`/`""` hides it); needs `name`. |
|
|
237
|
+
| `banner` / `bannerUrl` | `string \| { url, position, size, repeat, opacity }` | Header banner. Object form is flattened to `bannerUrl` + `banner*`. Individual fields: `bannerPosition`, `bannerSize`, `bannerRepeat`, `bannerOpacity`. |
|
|
238
|
+
| `style` | `DockVisualStyleInput` | Per-card overrides for `card`, `icon`, `title`, `description` (`className`, CSS, `scale`, `size`), plus `active` / `inactive` / `hover` variants, `background`, `borderColor`. Merged section by section across registrations. |
|
|
239
|
+
| `className`, `width` | | Extra class; card width in px (clamped to the viewport). |
|
|
240
|
+
| `component`, `content`, `props` | | Replace the card body with your own component/node. |
|
|
241
|
+
| `action`, `headerAction` | `ReactNode \| ComponentType` | Inline action under the header / in the header. Shown only on the card that owns the current path (or overlay cards). |
|
|
242
|
+
| `actions` | `Partial<DockActionDescriptor>[]` | Toolbar actions while the page is mounted ([§10](#10-contextual-actions)). |
|
|
243
|
+
| `guard` | `{ when: boolean, message?, onBlock? }` | Navigation guard while the page is mounted ([§12](#12-navigation-guards-and-transactions)). |
|
|
244
|
+
| `surfaces` | `Record<string, SurfaceDef \| Component>` | Named surfaces opened with `page.modules.dock.surface("key", props)`. |
|
|
245
|
+
| `name` | `string` | Stable name used for search and active-item matching. |
|
|
246
|
+
| `path`, `targetPath` | `string` | `path` defaults to the current pathname. `targetPath` is where clicking navigates when it differs from `path`. |
|
|
247
|
+
| `isLoading` | `boolean` | Show the loading skeleton card. Defaults from `usePage({ loading })` (`true`, a string, or `{ isLoading }`). |
|
|
248
|
+
| `isOverlay`, `dismissible` | `boolean` | Overlay cards dim the page and ignore outside clicks. |
|
|
249
|
+
| `dockPolicy` | `{ clearTransientState?, dismissSurfaces?, prefetch? }` | Route policy used when navigating **to** this card ([§12.4](#124-route-policy)). |
|
|
250
|
+
| `keepWhenDescendant`, `prefetchDisabled` | `boolean \| (activePath, item) => boolean`, `boolean` | By default a card whose path is a **prefix of the active path** (an ancestor, except `/`) is removed from the stack so the same section is not shown twice; `keepWhenDescendant` keeps it. `prefetchDisabled` opts out of prefetch. |
|
|
251
|
+
| `stackOrder` | `number` | Where the card sits in the stack under the active card, ascending from the card nearest to it. Cards without one keep registration order at `0`, and `/` falls back to last. Use a negative value to pull a card toward the active one. |
|
|
252
|
+
| `registry` | `RegistryMetadata` | `priority`, `source`, `lifecycle`, … for this registration. |
|
|
253
253
|
|
|
254
254
|
How `usePage` turns the slice into registry entries (`dockModule.page`):
|
|
255
255
|
|
|
@@ -750,7 +750,7 @@ Gotchas:
|
|
|
750
750
|
|
|
751
751
|
## 20. Dependencies
|
|
752
752
|
|
|
753
|
-
- **Uses:** `@omerdlw/base-framework/kernel` (`defineModule`, `definePeer`, `useRegistryEntries`, `useModuleRegistration`), `@omerdlw/base-framework/events`, `@omerdlw/base-framework/hooks`, `@omerdlw/base-framework/utils`, `@omerdlw/base-framework/
|
|
753
|
+
- **Uses:** `@omerdlw/base-framework/kernel` (`defineModule`, `definePeer`, `useRegistryEntries`, `useModuleRegistration`), `@omerdlw/base-framework/events`, `@omerdlw/base-framework/hooks`, `@omerdlw/base-framework/utils`, `@omerdlw/base-framework/theme` (`ThemeButton`, `ThemeIcon`, `ThemeTooltip`), `next/navigation`, `motion/react`.
|
|
754
754
|
- **Peers:** `loading` (page-loading flag, `stopLoading` after navigation), `media` (session state and controls), `notification` (is a toast visible). Each is read through `definePeer` with an inert stand-in, and listed in `uses`.
|
|
755
755
|
- **Used by:** `src/features/**` (surfaces, statuses, context actions, motion presets), `src/app/**` (`usePage({ dock })`, `registry.tsx`), `controls` and `notification` (they locate the dock by DOM id `dock-card-stack`), and the `context-menu` (reads the active card through `useModuleState("dock", …)`).
|
|
756
756
|
- **Never imports** another module's source (enforced by `npm run check:architecture`).
|
|
@@ -155,5 +155,5 @@ Raw `Error.message` values (database, SDK, vendor wording) never reach the UI. `
|
|
|
155
155
|
|
|
156
156
|
## 11. Dependencies
|
|
157
157
|
|
|
158
|
-
- **Uses:** `@omerdlw/base-framework/events` (`APP_ERROR`), `@omerdlw/base-framework/
|
|
158
|
+
- **Uses:** `@omerdlw/base-framework/events` (`APP_ERROR`), `@omerdlw/base-framework/theme` (`ThemeButton`, `ThemeIcon` for the fallback, icon key `error`), `@omerdlw/base-framework/theme`, `@omerdlw/base-framework/utils` (`report`, `setReportSink`, `toUserMessage`), `next/navigation` (`usePathname`).
|
|
159
159
|
- **Used by:** `src/core/provider.tsx`; the dock (turns `APP_ERROR` into its error status) and the notification module (toasts `APP_ERROR` with `notify: true`) react to the event without importing this module.
|
package/docs/modules/loading.md
CHANGED
|
@@ -153,5 +153,5 @@ No classes or inline styles in the module. The `loadingTheme` slot `overlay` (st
|
|
|
153
153
|
|
|
154
154
|
## 9. Dependencies
|
|
155
155
|
|
|
156
|
-
- **Uses:** `@omerdlw/base-framework/kernel` (`defineModule`, `useModuleRegistration`, `useRegistryValue`), `@omerdlw/base-framework/
|
|
156
|
+
- **Uses:** `@omerdlw/base-framework/kernel` (`defineModule`, `useModuleRegistration`, `useRegistryValue`), `@omerdlw/base-framework/theme` (`ThemeSpinner`), `@omerdlw/base-framework/hooks` (`useIsFullscreenStateActive`), `@omerdlw/base-framework/utils` (`createStore`), `@omerdlw/base-framework/theme`.
|
|
157
157
|
- **Used by:** `src/core/provider.tsx` (installs it); the **dock**, which reads `isLoading` and calls `stopLoading` through `definePeer("loading")` (inert when not installed); pages and features through `useLoading*` / `page.modules.loading`.
|
package/docs/modules/modal.md
CHANGED
|
@@ -229,5 +229,5 @@ Flat layout ([architecture §2.1](../architecture-and-rules.md#21-flat-layout-de
|
|
|
229
229
|
|
|
230
230
|
## 10. Dependencies
|
|
231
231
|
|
|
232
|
-
- **Uses:** `@omerdlw/base-framework/kernel` (`defineModule`, `useModuleRegistration`, `useRegistryEntries`, `ModuleBoundary`), `@omerdlw/base-framework/utils` (`acquireGlobalScrollLock`, `createStore`), `@omerdlw/base-framework/
|
|
232
|
+
- **Uses:** `@omerdlw/base-framework/kernel` (`defineModule`, `useModuleRegistration`, `useRegistryEntries`, `ModuleBoundary`), `@omerdlw/base-framework/utils` (`acquireGlobalScrollLock`, `createStore`), `@omerdlw/base-framework/theme` (`ThemeButton`, `ThemeIcon`), `@omerdlw/base-framework/theme`, `motion/react`.
|
|
233
233
|
- **Used by:** `src/core/provider.tsx` (installs it), pages and features through `useModal` / `page.modules.modal`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omerdlw/base-framework",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Microkernel engine and first-party declarative UI modules for app-like Next.js products.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -44,11 +44,6 @@
|
|
|
44
44
|
"import": "./dist/theme/index.js",
|
|
45
45
|
"default": "./dist/theme/index.js"
|
|
46
46
|
},
|
|
47
|
-
"./ui": {
|
|
48
|
-
"types": "./dist/ui/index.d.ts",
|
|
49
|
-
"import": "./dist/ui/index.js",
|
|
50
|
-
"default": "./dist/ui/index.js"
|
|
51
|
-
},
|
|
52
47
|
"./kernel": {
|
|
53
48
|
"types": "./dist/kernel/index.d.ts",
|
|
54
49
|
"import": "./dist/kernel/index.js",
|
|
@@ -171,7 +166,6 @@
|
|
|
171
166
|
}
|
|
172
167
|
},
|
|
173
168
|
"dependencies": {
|
|
174
|
-
"@iconify-icon/react": "3.0.3",
|
|
175
169
|
"tailwind-merge": "^3.7.0"
|
|
176
170
|
},
|
|
177
171
|
"devDependencies": {
|
package/templates/AGENTS.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
- **Core Framework:** `@omerdlw/base-framework` (Microkernel & Declarative UI Modules)
|
|
12
12
|
- **Styling:** Tailwind CSS v4 (the app owns every token and utility; the framework ships no CSS)
|
|
13
13
|
- **Motion:** Motion (v13) with hardware GPU acceleration (`translate3d`, `scale`). Framework modules ship no animation of their own: the dock, modal, toast, context-menu and background motion lives in this app's theme files (`motion` next to `slots`), with tempo and vocabulary from `defineMotion`. Change module animation there, never in the framework.
|
|
14
|
-
- **Icons:**
|
|
14
|
+
- **Icons:** the app's own `<Icon icon="solar:..." />`; the framework's modules draw with it through `ThemeProvider` `components` and name their icons by key (`icons`)
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
@@ -123,9 +123,10 @@ Always import from the exact subpaths exposed by `@omerdlw/base-framework`:
|
|
|
123
123
|
| `useModal`, `useModalContext` | `@omerdlw/base-framework/modal` |
|
|
124
124
|
| `useAmbientTheme` | `@omerdlw/base-framework/ambient` |
|
|
125
125
|
| `report`, `createStore` | `@omerdlw/base-framework/utils` |
|
|
126
|
-
| `cn`, `
|
|
126
|
+
| `cn`, `defineRecipe`, `splitVariants` | `@omerdlw/base-framework/recipes` |
|
|
127
|
+
| `ThemeProvider`, `defineTheme` | `@omerdlw/base-framework/theme` |
|
|
127
128
|
| `useClickOutside`, `useGlobalEvent` | `@omerdlw/base-framework/hooks` |
|
|
128
|
-
| `Button`, `Icon`, `Spinner`, `Tooltip` |
|
|
129
|
+
| `Button`, `Icon`, `Spinner`, `Tooltip` | the app's own `src/design/components` |
|
|
129
130
|
|
|
130
131
|
### Rule 5: Modals and Surfaces Must Be Declared or Scoped
|
|
131
132
|
|