@larose-ui/enterprise 0.1.0 → 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +58 -0
  2. package/dist/index.js +4 -2
  3. package/package.json +14 -9
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # @larose-ui/enterprise
2
+
3
+ > Enterprise patterns — audit trails, session guards, schema IaC.
4
+
5
+ Part of **[laRose UI](https://github.com/hamdymohamedak/larose-ui)** — the UI Operating System for modern SaaS applications.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @larose-ui/enterprise
11
+ # or
12
+ pnpm add @larose-ui/enterprise
13
+ # or
14
+ yarn add @larose-ui/enterprise
15
+ ```
16
+
17
+
18
+ **Peer dependency:** `react >=18`
19
+
20
+
21
+ ## Quick start
22
+
23
+ ```tsx
24
+ import { SessionGuard, AuditedInput, AuditProvider } from '@larose-ui/enterprise';
25
+
26
+ <SessionGuard loginUrl="/login">
27
+ <AuditProvider actor="admin@acme.com">
28
+ <AuditedInput field="salary" label="Salary" resourceId="emp-1" />
29
+ </AuditProvider>
30
+ </SessionGuard>
31
+ ```
32
+
33
+ ## Features
34
+
35
+ - Audit trails on sensitive fields
36
+ - Session expiry handling
37
+ - Version compatibility checks
38
+ - UI schema renderer (IaC for forms)
39
+
40
+ ## Related packages
41
+
42
+ | Layer | Packages |
43
+ |-------|----------|
44
+ | Foundation | `@larose-ui/core`, `@larose-ui/tokens`, `@larose-ui/react` |
45
+ | Runtime | `@larose-ui/runtime`, `@larose-ui/network`, `@larose-ui/offline` |
46
+ | Intelligence | `@larose-ui/data`, `@larose-ui/forms`, `@larose-ui/permissions` |
47
+ | Platform | `@larose-ui/observability`, `@larose-ui/enterprise`, `@larose-ui/ai` |
48
+
49
+ ## Documentation
50
+
51
+ - [Monorepo README](https://github.com/hamdymohamedak/larose-ui#readme)
52
+ - [Architecture](https://github.com/hamdymohamedak/larose-ui/blob/main/docs/architecture/ARCHITECTURE.md)
53
+ - [Roadmap](https://github.com/hamdymohamedak/larose-ui/blob/main/docs/ROADMAP.md)
54
+ - [Report an issue](https://github.com/hamdymohamedak/larose-ui/issues)
55
+
56
+ ## License
57
+
58
+ MIT © [laRose UI](https://github.com/hamdymohamedak/larose-ui)
package/dist/index.js CHANGED
@@ -331,6 +331,7 @@ function SensitiveAction({
331
331
 
332
332
  // src/security/SessionGuard.tsx
333
333
  import { useCallback as useCallback3, useEffect, useState as useState4 } from "react";
334
+ import { isSafeRedirectPath } from "@larose-ui/core";
334
335
  import { Dialog as Dialog2 } from "@larose-ui/react";
335
336
  import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
336
337
  function SessionGuard({
@@ -347,11 +348,12 @@ function SessionGuard({
347
348
  window.addEventListener("larose:session-expired", handler);
348
349
  return () => window.removeEventListener("larose:session-expired", handler);
349
350
  }, []);
351
+ const safeLoginUrl = isSafeRedirectPath(loginUrl) ? loginUrl : "/login";
350
352
  const handleRedirect = useCallback3(() => {
351
353
  const returnUrl = window.location.pathname + window.location.search;
352
354
  onSessionExpired?.(returnUrl);
353
- window.location.href = `${loginUrl}?returnUrl=${encodeURIComponent(returnUrl)}`;
354
- }, [loginUrl, onSessionExpired]);
355
+ window.location.href = `${safeLoginUrl}?returnUrl=${encodeURIComponent(returnUrl)}`;
356
+ }, [safeLoginUrl, onSessionExpired]);
355
357
  return /* @__PURE__ */ jsxs5(Fragment3, { children: [
356
358
  children,
357
359
  /* @__PURE__ */ jsx7(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@larose-ui/enterprise",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Enterprise features — audit trails, version compatibility, UI schema IaC, security patterns",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,15 +13,16 @@
13
13
  }
14
14
  },
15
15
  "files": [
16
- "dist"
16
+ "dist",
17
+ "README.md"
17
18
  ],
18
19
  "dependencies": {
19
- "@larose-ui/core": "0.1.0",
20
- "@larose-ui/permissions": "0.1.0",
21
- "@larose-ui/observability": "0.1.0",
22
- "@larose-ui/forms": "0.1.0",
23
- "@larose-ui/react": "0.1.0",
24
- "@larose-ui/runtime": "0.1.0"
20
+ "@larose-ui/core": "0.1.2",
21
+ "@larose-ui/forms": "0.1.2",
22
+ "@larose-ui/observability": "0.1.2",
23
+ "@larose-ui/permissions": "0.1.2",
24
+ "@larose-ui/react": "0.1.2",
25
+ "@larose-ui/runtime": "0.1.2"
25
26
  },
26
27
  "peerDependencies": {
27
28
  "react": ">=18"
@@ -44,7 +45,7 @@
44
45
  },
45
46
  "repository": {
46
47
  "type": "git",
47
- "url": "https://github.com/larose-ui/larose.git",
48
+ "url": "git+https://github.com/hamdymohamedak/larose-ui.git",
48
49
  "directory": "packages/enterprise"
49
50
  },
50
51
  "keywords": [
@@ -54,6 +55,10 @@
54
55
  "design-system",
55
56
  "saas"
56
57
  ],
58
+ "homepage": "https://github.com/hamdymohamedak/larose-ui/blob/main/packages/enterprise#readme",
59
+ "bugs": {
60
+ "url": "https://github.com/hamdymohamedak/larose-ui/issues"
61
+ },
57
62
  "scripts": {
58
63
  "build": "tsup",
59
64
  "test": "vitest run",