@pattern-stack/frontend-patterns 0.2.0-alpha.3 → 0.2.0-alpha.5
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/atoms/components/data/DataTable/DataTable.d.ts +2 -2
- package/dist/atoms/components/data/DataTable/DataTable.d.ts.map +1 -1
- package/dist/atoms/components/data/DataTable/DataTable.types.d.ts +46 -5
- package/dist/atoms/components/data/DataTable/DataTable.types.d.ts.map +1 -1
- package/dist/atoms/components/data/DataTable/index.d.ts +1 -0
- package/dist/atoms/components/data/DataTable/index.d.ts.map +1 -1
- package/dist/atoms/components/data/index.d.ts +1 -1
- package/dist/atoms/components/data/index.d.ts.map +1 -1
- package/dist/atoms/hooks/index.d.ts +2 -0
- package/dist/atoms/hooks/index.d.ts.map +1 -1
- package/dist/atoms/hooks/useEntityData.d.ts +36 -0
- package/dist/atoms/hooks/useEntityData.d.ts.map +1 -0
- package/dist/atoms/hooks/useEntityDetail.d.ts +43 -0
- package/dist/atoms/hooks/useEntityDetail.d.ts.map +1 -0
- package/dist/atoms/primitives/table.d.ts.map +1 -1
- package/dist/atoms/services/api/client.d.ts +12 -2
- package/dist/atoms/services/api/client.d.ts.map +1 -1
- package/dist/atoms/services/auth-service.d.ts +15 -0
- package/dist/atoms/services/auth-service.d.ts.map +1 -1
- package/dist/atoms/services/index.d.ts +2 -2
- package/dist/atoms/services/index.d.ts.map +1 -1
- package/dist/atoms/types/auth.d.ts +38 -2
- package/dist/atoms/types/auth.d.ts.map +1 -1
- package/dist/atoms/types/ui-config.d.ts +23 -5
- package/dist/atoms/types/ui-config.d.ts.map +1 -1
- package/dist/atoms/types/ui-metadata.d.ts +1 -10
- package/dist/atoms/types/ui-metadata.d.ts.map +1 -1
- package/dist/atoms/utils/field-detection.d.ts +2 -2
- package/dist/atoms/utils/field-detection.d.ts.map +1 -1
- package/dist/atoms/utils/ui-mapping.d.ts +4 -4
- package/dist/atoms/utils/ui-mapping.d.ts.map +1 -1
- package/dist/features/auth/components/ProtectedRoute.d.ts +3 -1
- package/dist/features/auth/components/ProtectedRoute.d.ts.map +1 -1
- package/dist/features/auth/hooks/useAuth.d.ts.map +1 -1
- package/dist/features/auth/providers/NoAuthProvider.d.ts +17 -0
- package/dist/features/auth/providers/NoAuthProvider.d.ts.map +1 -0
- package/dist/features/auth/providers/index.d.ts +1 -0
- package/dist/features/auth/providers/index.d.ts.map +1 -1
- package/dist/frontend-patterns.css +1 -4636
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +4117 -16385
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4114 -16382
- package/dist/index.js.map +1 -1
- package/dist/molecules/layout/FieldGrid/FieldGrid.d.ts +61 -0
- package/dist/molecules/layout/FieldGrid/FieldGrid.d.ts.map +1 -0
- package/dist/molecules/layout/FieldGrid/index.d.ts +2 -0
- package/dist/molecules/layout/FieldGrid/index.d.ts.map +1 -0
- package/dist/molecules/layout/index.d.ts +1 -0
- package/dist/molecules/layout/index.d.ts.map +1 -1
- package/dist/templates/factory.d.ts.map +1 -1
- package/package.json +4 -5
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ColumnMetadata } from "../../../atoms/types/ui-metadata";
|
|
3
|
+
export interface FieldGridSection {
|
|
4
|
+
/** Section title */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Section description */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Fields to display in this section */
|
|
9
|
+
fields: ColumnMetadata[];
|
|
10
|
+
/** Whether section is collapsible */
|
|
11
|
+
collapsible?: boolean;
|
|
12
|
+
/** Whether section starts collapsed */
|
|
13
|
+
defaultCollapsed?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface FieldGridProps {
|
|
16
|
+
/** Data object to render */
|
|
17
|
+
data: Record<string, unknown>;
|
|
18
|
+
/** Fields to display (flat list or use sections) */
|
|
19
|
+
fields?: ColumnMetadata[];
|
|
20
|
+
/** Grouped sections of fields */
|
|
21
|
+
sections?: FieldGridSection[];
|
|
22
|
+
/** Number of columns in grid (default: 2) */
|
|
23
|
+
columns?: 1 | 2 | 3;
|
|
24
|
+
/** Show labels above values (default: true) */
|
|
25
|
+
showLabels?: boolean;
|
|
26
|
+
/** Compact mode (less padding) */
|
|
27
|
+
compact?: boolean;
|
|
28
|
+
/** Show empty values as "-" (default: true) */
|
|
29
|
+
showEmpty?: boolean;
|
|
30
|
+
/** Additional CSS classes */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Declarative field grid for displaying entity data.
|
|
35
|
+
*
|
|
36
|
+
* Renders fields based on metadata with automatic type-based formatting.
|
|
37
|
+
* Supports flat field lists or grouped sections.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* // Flat list of fields
|
|
42
|
+
* <FieldGrid
|
|
43
|
+
* data={account}
|
|
44
|
+
* fields={[
|
|
45
|
+
* { field: 'name', label: 'Name', type: 'text' },
|
|
46
|
+
* { field: 'actual_value', label: 'Value', type: 'money' },
|
|
47
|
+
* ]}
|
|
48
|
+
* />
|
|
49
|
+
*
|
|
50
|
+
* // With sections
|
|
51
|
+
* <FieldGrid
|
|
52
|
+
* data={account}
|
|
53
|
+
* sections={[
|
|
54
|
+
* { title: 'Financial', fields: [...] },
|
|
55
|
+
* { title: 'Contact', fields: [...] },
|
|
56
|
+
* ]}
|
|
57
|
+
* />
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare const FieldGrid: React.FC<FieldGridProps>;
|
|
61
|
+
//# sourceMappingURL=FieldGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldGrid.d.ts","sourceRoot":"","sources":["../../../../src/molecules/layout/FieldGrid/FieldGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIvE,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,qCAAqC;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uCAAuC;IACvC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,oDAAoD;IACpD,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,iCAAiC;IACjC,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B,6CAA6C;IAC7C,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA0F9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecules/layout/FieldGrid/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -14,4 +14,5 @@ export { getNavigationItems } from "./navigation-context";
|
|
|
14
14
|
export { Sidebar } from "./Sidebar";
|
|
15
15
|
export { BulkSelectionBar } from "./BulkSelectionBar";
|
|
16
16
|
export { ListToolbar, type ListToolbarProps } from "./ListToolbar";
|
|
17
|
+
export { FieldGrid, type FieldGridProps, type FieldGridSection } from "./FieldGrid";
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecules/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecules/layout/index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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@pattern-stack/frontend-patterns",
|
|
3
3
|
"description": "Production-ready React frontend template with atomic architecture patterns. Build ultra-lean applications by importing shared UI foundation patterns.",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.2.0-alpha.
|
|
5
|
+
"version": "0.2.0-alpha.5",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react",
|
|
8
8
|
"typescript",
|
|
@@ -65,10 +65,8 @@
|
|
|
65
65
|
"style:check": "npm run lint:design-system",
|
|
66
66
|
"style:fix": "npm run lint:fix && npm run style:check",
|
|
67
67
|
"preview": "vite preview",
|
|
68
|
-
"generate
|
|
69
|
-
"generate-types:live": "npx openapi-typescript ${OPENAPI_URL:-http://localhost:8080/openapi.json} -o src/atoms/types/generated.ts",
|
|
68
|
+
"generate": "sync-patterns generate ./openapi.json --output ./src/generated --entities --collections",
|
|
70
69
|
"generate:hooks": "npx tsx cli/index.ts generate hooks",
|
|
71
|
-
"dev:with-types": "npm run generate-types && npm run dev",
|
|
72
70
|
"test": "vitest",
|
|
73
71
|
"test:ui": "vitest --ui",
|
|
74
72
|
"test:run": "vitest run",
|
|
@@ -100,6 +98,8 @@
|
|
|
100
98
|
"@radix-ui/react-slot": "^1.2.3",
|
|
101
99
|
"@tanstack/react-query": "^5.77.2",
|
|
102
100
|
"@tanstack/react-query-devtools": "^5.79.0",
|
|
101
|
+
"@tanstack/react-db": "^0.5.0",
|
|
102
|
+
"@tanstack/electric-db-collection": "^0.1.0",
|
|
103
103
|
"axios": "^1.9.0",
|
|
104
104
|
"class-variance-authority": "^0.7.1",
|
|
105
105
|
"clsx": "^2.1.1",
|
|
@@ -107,7 +107,6 @@
|
|
|
107
107
|
"lucide-react": "^0.511.0",
|
|
108
108
|
"mapbox-gl": "^3.1.2",
|
|
109
109
|
"openapi-types": "^12.1.3",
|
|
110
|
-
"openapi-typescript": "^7.8.0",
|
|
111
110
|
"react-hook-form": "^7.56.4",
|
|
112
111
|
"react-map-gl": "^7.1.7",
|
|
113
112
|
"react-router-dom": "^7.6.1",
|