@pattern-stack/frontend-patterns 0.2.0-alpha.1 → 0.2.0-alpha.3
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/core/Badge/Badge.d.ts +1 -1
- package/dist/atoms/components/data/DataTable/DataTable.d.ts.map +1 -1
- package/dist/atoms/components/data/DataTable/DataTable.types.d.ts +15 -3
- package/dist/atoms/components/data/DataTable/DataTable.types.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/useFieldMetadata.d.ts +18 -0
- package/dist/atoms/hooks/useFieldMetadata.d.ts.map +1 -0
- package/dist/atoms/hooks/useResponsiveTable.d.ts +103 -0
- package/dist/atoms/hooks/useResponsiveTable.d.ts.map +1 -0
- package/dist/atoms/primitives/sheet.d.ts +23 -0
- package/dist/atoms/primitives/sheet.d.ts.map +1 -0
- package/dist/atoms/services/auth-service.d.ts.map +1 -1
- package/dist/atoms/types/auth.d.ts +51 -0
- package/dist/atoms/types/auth.d.ts.map +1 -1
- package/dist/atoms/types/index.d.ts +1 -0
- package/dist/atoms/types/index.d.ts.map +1 -1
- package/dist/atoms/types/ui-config.d.ts +25 -8
- package/dist/atoms/types/ui-config.d.ts.map +1 -1
- package/dist/atoms/types/ui-metadata.d.ts +112 -0
- package/dist/atoms/types/ui-metadata.d.ts.map +1 -0
- package/dist/atoms/utils/ui-mapping.d.ts +9 -3
- package/dist/atoms/utils/ui-mapping.d.ts.map +1 -1
- package/dist/features/auth/hooks/useAuth.d.ts.map +1 -1
- package/dist/frontend-patterns.css +82 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +1030 -248
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1031 -248
- package/dist/index.js.map +1 -1
- package/dist/molecules/layout/ListToolbar/ListToolbar.d.ts +37 -0
- package/dist/molecules/layout/ListToolbar/ListToolbar.d.ts.map +1 -0
- package/dist/molecules/layout/ListToolbar/index.d.ts +2 -0
- package/dist/molecules/layout/ListToolbar/index.d.ts.map +1 -0
- package/dist/molecules/layout/PageTitle/PageTitle.d.ts +17 -0
- package/dist/molecules/layout/PageTitle/PageTitle.d.ts.map +1 -0
- package/dist/molecules/layout/PageTitle/index.d.ts +2 -0
- package/dist/molecules/layout/PageTitle/index.d.ts.map +1 -0
- package/dist/molecules/layout/index.d.ts +2 -0
- package/dist/molecules/layout/index.d.ts.map +1 -1
- package/dist/templates/ListPageTemplate.d.ts +21 -0
- package/dist/templates/ListPageTemplate.d.ts.map +1 -0
- package/dist/templates/admin/AdminCRUDTemplate.d.ts.map +1 -1
- package/dist/templates/factory.d.ts.map +1 -1
- package/dist/templates/index.d.ts +1 -0
- package/dist/templates/index.d.ts.map +1 -1
- package/package.json +4 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const badgeVariants: (props?: {
|
|
4
|
-
variant?: "success" | "secondary" | "
|
|
4
|
+
variant?: "success" | "secondary" | "warning" | "info" | "default" | "destructive" | "outline";
|
|
5
5
|
size?: "sm" | "lg" | "default";
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) => string;
|
|
7
7
|
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/DataTable/DataTable.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AASpD,OAAO,KAAK,EAGV,cAAc,EACf,MAAM,mBAAmB,CAAC;AAK3B,YAAY,EACV,MAAM,EACN,gBAAgB,EAChB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAI3B,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC3D,IAAI,EACJ,OAAO,EACP,iBAA+B,EAC/B,QAAa,EACb,cAAqB,EACrB,UAAiB,EACjB,UAAU,EACV,YAAkC,EAClC,SAAc,EACd,KAAa,EACb,SAAiB,EACjB,gBAAoB,EACpB,UAAiB,EACjB,gBAAgB,EAChB,EAAE,GACH,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/DataTable/DataTable.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AASpD,OAAO,KAAK,EAGV,cAAc,EACf,MAAM,mBAAmB,CAAC;AAK3B,YAAY,EACV,MAAM,EACN,gBAAgB,EAChB,cAAc,GACf,MAAM,mBAAmB,CAAC;AAI3B,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC3D,IAAI,EACJ,OAAO,EACP,iBAA+B,EAC/B,QAAa,EACb,cAAqB,EACrB,UAAiB,EACjB,UAAU,EACV,YAAkC,EAClC,SAAc,EACd,KAAa,EACb,SAAiB,EACjB,gBAAoB,EACpB,UAAiB,EACjB,gBAAgB,EAChB,EAAE,GACH,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,aAAa,2CA4YnC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResponsiveColumnConfig, DisplayMode, ResponsiveValue, Breakpoint } from "../../../config/responsive";
|
|
2
|
-
import type { UIConfig } from "../../../types/ui-config";
|
|
2
|
+
import type { UIConfig, UIFieldType, FieldFormat } from "../../../types/ui-config";
|
|
3
3
|
export interface Column<T> {
|
|
4
4
|
key: string;
|
|
5
5
|
header: string | React.ReactNode;
|
|
@@ -7,8 +7,20 @@ export interface Column<T> {
|
|
|
7
7
|
sortable?: boolean;
|
|
8
8
|
filterable?: boolean;
|
|
9
9
|
width?: string;
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Field type for automatic rendering.
|
|
12
|
+
* When set, DataTable uses defaultFieldRenderers to format the cell.
|
|
13
|
+
* Overridden by custom `cell` renderer if provided.
|
|
14
|
+
*
|
|
15
|
+
* Supports all UIFieldType values: status, category, money, percent,
|
|
16
|
+
* date, datetime, user, entity, boolean, text, number, email, url, phone.
|
|
17
|
+
*/
|
|
18
|
+
type?: UIFieldType;
|
|
19
|
+
/**
|
|
20
|
+
* Format configuration for typed fields.
|
|
21
|
+
* Used by money (currency, decimals, locale), date (locale), status (statusColors), etc.
|
|
22
|
+
*/
|
|
23
|
+
format?: FieldFormat;
|
|
12
24
|
}
|
|
13
25
|
export interface ResponsiveColumn<T> extends Column<T>, ResponsiveColumnConfig {
|
|
14
26
|
/** Responsive width adjustments */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.types.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/DataTable/DataTable.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,UAAU,EACX,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTable.types.d.ts","sourceRoot":"","sources":["../../../../../src/atoms/components/data/DataTable/DataTable.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,UAAU,EACX,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEnF,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,SA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SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE;QACzB,IAAI,EAAE,CAAC,EAAE,CAAC;QACV,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;KACjC,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,qDAAqD;IACrD,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atoms/hooks/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atoms/hooks/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ColumnMetadataResponse } from "../types/ui-metadata";
|
|
2
|
+
interface UseFieldMetadataOptions {
|
|
3
|
+
entity: string;
|
|
4
|
+
view?: "list" | "detail" | "form";
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Fetch field metadata from backend for dynamic UI rendering.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* const { data, isLoading } = useFieldMetadata({ entity: "accounts" });
|
|
13
|
+
* // data.columns contains ColumnMetadata[]
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function useFieldMetadata({ entity, view, enabled, }: UseFieldMetadataOptions): import("@tanstack/react-query").UseQueryResult<ColumnMetadataResponse, Error>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=useFieldMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFieldMetadata.d.ts","sourceRoot":"","sources":["../../../src/atoms/hooks/useFieldMetadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,UAAU,uBAAuB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,IAAa,EACb,OAAc,GACf,EAAE,uBAAuB,iFAazB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export type TableViewMode = "full" | "compact" | "cards";
|
|
2
|
+
export interface UseResponsiveTableOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Initial view mode
|
|
5
|
+
* @default "full"
|
|
6
|
+
*/
|
|
7
|
+
initialView?: TableViewMode;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to enable automatic view switching based on overflow
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
autoSwitch?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Minimum width (px) below which to always show cards
|
|
15
|
+
* This is a fallback for very narrow containers
|
|
16
|
+
* @default 400
|
|
17
|
+
*/
|
|
18
|
+
minWidthForCompact?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Debounce delay (ms) for resize/overflow checks
|
|
21
|
+
* @default 100
|
|
22
|
+
*/
|
|
23
|
+
debounceMs?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Callback when view mode changes
|
|
26
|
+
*/
|
|
27
|
+
onViewChange?: (view: TableViewMode) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface UseResponsiveTableResult {
|
|
30
|
+
/**
|
|
31
|
+
* Current view mode (full, compact, or cards)
|
|
32
|
+
*/
|
|
33
|
+
viewMode: TableViewMode;
|
|
34
|
+
/**
|
|
35
|
+
* Manually set the view mode (disables auto-switching)
|
|
36
|
+
*/
|
|
37
|
+
setViewMode: (mode: TableViewMode) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Re-enable auto-switching after manual override
|
|
40
|
+
*/
|
|
41
|
+
enableAutoSwitch: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Whether auto-switching is currently enabled
|
|
44
|
+
*/
|
|
45
|
+
isAutoSwitching: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Ref to attach to the full table container for overflow detection
|
|
48
|
+
*/
|
|
49
|
+
fullTableRef: React.RefObject<HTMLDivElement | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Ref to attach to the compact table container for overflow detection
|
|
52
|
+
*/
|
|
53
|
+
compactTableRef: React.RefObject<HTMLDivElement | null>;
|
|
54
|
+
/**
|
|
55
|
+
* Current overflow state for debugging
|
|
56
|
+
*/
|
|
57
|
+
overflowState: {
|
|
58
|
+
fullOverflows: boolean;
|
|
59
|
+
compactOverflows: boolean;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Hook for responsive table view switching based on content overflow.
|
|
64
|
+
*
|
|
65
|
+
* Instead of arbitrary breakpoints, this hook detects when tables
|
|
66
|
+
* would require horizontal scrolling and switches to a more compact view.
|
|
67
|
+
*
|
|
68
|
+
* View hierarchy: full → compact → cards
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* const {
|
|
73
|
+
* viewMode,
|
|
74
|
+
* setViewMode,
|
|
75
|
+
* fullTableRef,
|
|
76
|
+
* compactTableRef,
|
|
77
|
+
* isAutoSwitching
|
|
78
|
+
* } = useResponsiveTable();
|
|
79
|
+
*
|
|
80
|
+
* return (
|
|
81
|
+
* <div>
|
|
82
|
+
* {viewMode === 'full' && (
|
|
83
|
+
* <div ref={fullTableRef}>
|
|
84
|
+
* <DataTable columns={fullColumns} ... />
|
|
85
|
+
* </div>
|
|
86
|
+
* )}
|
|
87
|
+
* {viewMode === 'compact' && (
|
|
88
|
+
* <div ref={compactTableRef}>
|
|
89
|
+
* <DataTable columns={compactColumns} ... />
|
|
90
|
+
* </div>
|
|
91
|
+
* )}
|
|
92
|
+
* {viewMode === 'cards' && <CardList ... />}
|
|
93
|
+
* </div>
|
|
94
|
+
* );
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export declare function useResponsiveTable(options?: UseResponsiveTableOptions): UseResponsiveTableResult;
|
|
98
|
+
/**
|
|
99
|
+
* Simplified hook that just reports if a container has overflow
|
|
100
|
+
* Useful for custom overflow detection logic
|
|
101
|
+
*/
|
|
102
|
+
export declare function useOverflowDetection(ref: React.RefObject<HTMLElement>): boolean;
|
|
103
|
+
//# sourceMappingURL=useResponsiveTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResponsiveTable.d.ts","sourceRoot":"","sources":["../../../src/atoms/hooks/useResponsiveTable.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC;IAE5B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC;IAExB;;OAEG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAE3C;;OAEG;IACH,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAE7B;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAErD;;OAEG;IACH,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAExD;;OAEG;IACH,aAAa,EAAE;QACb,aAAa,EAAE,OAAO,CAAC;QACvB,gBAAgB,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,yBAA8B,GACtC,wBAAwB,CAiL1B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAChC,OAAO,CAoBT"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
|
|
4
|
+
declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
7
|
+
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> {
|
|
9
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
10
|
+
}
|
|
11
|
+
declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const SheetHeader: {
|
|
13
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
declare const SheetFooter: {
|
|
17
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
21
|
+
declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
22
|
+
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
23
|
+
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../src/atoms/primitives/sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAC;AAIzD,QAAA,MAAM,KAAK,sCAAsB,CAAC;AAClC,QAAA,MAAM,YAAY,6GAAyB,CAAC;AAC5C,QAAA,MAAM,UAAU,2GAAuB,CAAC;AACxC,QAAA,MAAM,WAAW,4CAAwB,CAAC;AAE1C,QAAA,MAAM,YAAY,6JAYhB,CAAC;AAUH,UAAU,iBACR,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC;IACrE,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;CAC5C;AAED,QAAA,MAAM,YAAY,0FAsBhB,CAAC;AAGH,QAAA,MAAM,WAAW;8BAGd,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAGF,QAAA,MAAM,WAAW;8BAGd,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAGF,QAAA,MAAM,UAAU,mKASd,CAAC;AAGH,QAAA,MAAM,gBAAgB,6KASpB,CAAC;AAGH,OAAO,EACL,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,gBAAgB,GACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-service.d.ts","sourceRoot":"","sources":["../../../src/atoms/services/auth-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,gBAAgB,EAGhB,SAAS,EACV,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"auth-service.d.ts","sourceRoot":"","sources":["../../../src/atoms/services/auth-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,gBAAgB,EAGhB,SAAS,EACV,MAAM,UAAU,CAAC;AAqBlB,qBAAa,WAAW,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ;IACpD,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,cAAc,CAA8B;gBAExC,MAAM,EAAE,UAAU;IAS9B,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,OAAO;IAef,OAAO,CAAC,OAAO;IAef,OAAO,CAAC,UAAU;IAclB,YAAY,IAAI,SAAS,GAAG,IAAI;IAchC,OAAO,CAAC,YAAY;IAUpB,aAAa,IAAI,CAAC,GAAG,IAAI;IAYzB,OAAO,CAAC,aAAa;IAIrB,SAAS,IAAI,IAAI;IAOX,KAAK,CAAC,WAAW,EAAE,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC;IAyChD,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;YAoBrB,mBAAmB;IAgDjC,OAAO,CAAC,oBAAoB;IAc5B,cAAc,IAAI,OAAO;IAOzB,kBAAkB,IAAI,OAAO;IAQvB,cAAc,IAAI,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAanC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAgB9B"}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* React-specific configuration for the auth system.
|
|
5
|
+
* Domain types (User, LoginRequest, etc.) should be generated
|
|
6
|
+
* from the backend OpenAPI spec.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use generated UserInfo or UserResponse from @/generated/types instead.
|
|
10
|
+
* This is kept for backward compatibility during migration.
|
|
11
|
+
*
|
|
12
|
+
* After running `pattern-stack generate hooks` against backend:
|
|
13
|
+
* - UserInfo: Basic user info in auth responses
|
|
14
|
+
* - UserResponse: Full user data for /me endpoint
|
|
15
|
+
*/
|
|
1
16
|
export interface BaseUser {
|
|
2
17
|
id: string;
|
|
3
18
|
email: string;
|
|
@@ -6,13 +21,23 @@ export interface BaseUser {
|
|
|
6
21
|
roles?: string[];
|
|
7
22
|
permissions?: string[];
|
|
8
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use BaseUser directly or generated UserInfo type.
|
|
26
|
+
*/
|
|
9
27
|
export type ExtendedUser = BaseUser;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use generated RegisterRequest from @/generated/types instead.
|
|
30
|
+
*/
|
|
10
31
|
export interface RegisterData {
|
|
11
32
|
email: string;
|
|
12
33
|
password: string;
|
|
13
34
|
name?: string;
|
|
14
35
|
username?: string;
|
|
15
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Auth endpoint configuration.
|
|
39
|
+
* Frontend-specific configuration for API endpoints.
|
|
40
|
+
*/
|
|
16
41
|
export interface AuthEndpoints {
|
|
17
42
|
login: string;
|
|
18
43
|
register?: string;
|
|
@@ -20,6 +45,10 @@ export interface AuthEndpoints {
|
|
|
20
45
|
me: string;
|
|
21
46
|
logout?: string;
|
|
22
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Auth system configuration.
|
|
50
|
+
* Frontend-specific configuration for the auth provider.
|
|
51
|
+
*/
|
|
23
52
|
export interface AuthConfig {
|
|
24
53
|
apiUrl: string;
|
|
25
54
|
endpoints: AuthEndpoints;
|
|
@@ -31,22 +60,40 @@ export interface AuthConfig {
|
|
|
31
60
|
adminRoles?: string[];
|
|
32
61
|
userRoles?: string[];
|
|
33
62
|
};
|
|
63
|
+
requireAuth?: boolean;
|
|
64
|
+
publicPaths?: string[];
|
|
34
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Use generated LoginRequest from @/generated/types instead.
|
|
68
|
+
* Backend expects: { email: string; password: string; }
|
|
69
|
+
*/
|
|
35
70
|
export interface LoginCredentials {
|
|
36
71
|
email: string;
|
|
37
72
|
password: string;
|
|
38
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated Use generated TokenResponse from @/generated/types instead.
|
|
76
|
+
* Backend returns: { user: UserInfo; access_token: string; refresh_token: string; token_type: "bearer"; }
|
|
77
|
+
*/
|
|
39
78
|
export interface LoginResponse<T extends BaseUser = BaseUser> {
|
|
40
79
|
token: string;
|
|
41
80
|
refreshToken?: string;
|
|
42
81
|
user: T;
|
|
43
82
|
expiresIn?: number;
|
|
44
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated Use generated RefreshResult from @/generated/types instead.
|
|
86
|
+
* Backend returns: { access_token: string; token_type: "bearer"; }
|
|
87
|
+
*/
|
|
45
88
|
export interface RefreshResponse {
|
|
46
89
|
token: string;
|
|
47
90
|
refreshToken?: string;
|
|
48
91
|
expiresIn?: number;
|
|
49
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Auth context type for React components.
|
|
95
|
+
* This is frontend-specific and should stay in this file.
|
|
96
|
+
*/
|
|
50
97
|
export interface AuthContextType<T extends BaseUser = BaseUser> {
|
|
51
98
|
user: T | null;
|
|
52
99
|
isAuthenticated: boolean;
|
|
@@ -58,6 +105,10 @@ export interface AuthContextType<T extends BaseUser = BaseUser> {
|
|
|
58
105
|
hasPermission: (permission: string) => boolean;
|
|
59
106
|
hasRole: (role: string) => boolean;
|
|
60
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Token storage data structure.
|
|
110
|
+
* Frontend-specific for managing stored tokens.
|
|
111
|
+
*/
|
|
61
112
|
export interface TokenData {
|
|
62
113
|
token: string;
|
|
63
114
|
refreshToken?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/atoms/types/auth.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/atoms/types/auth.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;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3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atoms/types/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
@@ -6,20 +6,37 @@
|
|
|
6
6
|
import type { ReactNode } from "react";
|
|
7
7
|
import type { Breakpoint } from "../config/responsive";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Display-focused UI types for field rendering.
|
|
10
|
+
* These types define HOW data should be displayed visually.
|
|
10
11
|
*/
|
|
11
|
-
export type UIFieldType = "
|
|
12
|
+
export type UIFieldType = "text" | "number" | "boolean" | "date" | "datetime" | "email" | "url" | "phone" | "money" | "percent" | "badge" | "status" | "entity" | "user" | "json" | "image" | "rating" | "color" | "file";
|
|
13
|
+
/**
|
|
14
|
+
* Format configuration for field renderers
|
|
15
|
+
* Passed from column metadata to customize rendering behavior
|
|
16
|
+
*/
|
|
17
|
+
export interface FieldFormat {
|
|
18
|
+
/** Currency code for money fields (e.g., "USD", "EUR") */
|
|
19
|
+
currency?: string;
|
|
20
|
+
/** Number of decimal places for money/percent/number fields */
|
|
21
|
+
decimals?: number;
|
|
22
|
+
/** Locale for number/date formatting (e.g., "en-US", "de-DE") */
|
|
23
|
+
locale?: string;
|
|
24
|
+
/** Date format string or Intl options */
|
|
25
|
+
dateFormat?: string;
|
|
26
|
+
/** Custom status-to-color mapping for status fields */
|
|
27
|
+
statusColors?: Record<string, "success" | "warning" | "error" | "info" | "neutral">;
|
|
28
|
+
/** Explicit entity type for entity fields (vendor, partner, company, customer) */
|
|
29
|
+
entityType?: "vendor" | "partner" | "company" | "customer";
|
|
30
|
+
/** Max value for rating display (default 5) */
|
|
31
|
+
max?: number;
|
|
32
|
+
}
|
|
12
33
|
/**
|
|
13
34
|
* UI configuration for a specific field
|
|
14
35
|
*/
|
|
15
36
|
export interface UIFieldConfig {
|
|
16
37
|
type: UIFieldType;
|
|
17
38
|
colorScheme?: "sequential" | "hash" | "static";
|
|
18
|
-
format?:
|
|
19
|
-
currency?: string;
|
|
20
|
-
decimals?: number;
|
|
21
|
-
dateFormat?: string;
|
|
22
|
-
};
|
|
39
|
+
format?: FieldFormat;
|
|
23
40
|
display?: {
|
|
24
41
|
[K in Breakpoint]?: "full" | "compact" | "icon-only";
|
|
25
42
|
};
|
|
@@ -40,7 +57,7 @@ export interface UIConfigurable<T = Record<string, unknown>> {
|
|
|
40
57
|
/**
|
|
41
58
|
* Renderer function for custom field rendering
|
|
42
59
|
*/
|
|
43
|
-
export type FieldRenderer<T = unknown> = (value: T, fieldName: string, breakpoint: Breakpoint, item?: Record<string, unknown
|
|
60
|
+
export type FieldRenderer<T = unknown> = (value: T, fieldName: string, breakpoint: Breakpoint, item?: Record<string, unknown>, format?: FieldFormat) => ReactNode;
|
|
44
61
|
/**
|
|
45
62
|
* Registry of field renderers
|
|
46
63
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-config.d.ts","sourceRoot":"","sources":["../../../src/atoms/types/ui-config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"ui-config.d.ts","sourceRoot":"","sources":["../../../src/atoms/types/ui-config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,QAAQ,GACR,SAAS,GACT,MAAM,GACN,UAAU,GACV,OAAO,GACP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,EAAE,CAAC;IACV,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,IAAI,CACvC,KAAK,EAAE,CAAC,EACR,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,EACtB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,MAAM,CAAC,EAAE,WAAW,KACjB,SAAS,CAAC;AAEf;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;KACjC,CAAC,IAAI,WAAW,GAAG,aAAa;CAClC,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI Metadata Types
|
|
3
|
+
*
|
|
4
|
+
* This file contains UI metadata types that mirror the backend OpenAPI specification.
|
|
5
|
+
* These types enable dynamic UI rendering based on field metadata from the API.
|
|
6
|
+
*
|
|
7
|
+
* @mirror backend: pattern_stack/atoms/metadata/schemas.py
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Semantic UI types for field rendering.
|
|
11
|
+
*
|
|
12
|
+
* Determines how a field should be rendered in the UI based on its semantic meaning.
|
|
13
|
+
* Each type maps to specific UI components and formatting rules.
|
|
14
|
+
*
|
|
15
|
+
* @mirror backend: pattern_stack/atoms/metadata/schemas.py::UIType
|
|
16
|
+
* Keep in sync with backend enum.
|
|
17
|
+
*/
|
|
18
|
+
export type UIType = "text" | "textarea" | "number" | "boolean" | "date" | "datetime" | "email" | "url" | "phone" | "currency" | "percentage" | "select" | "multiselect" | "reference" | "json" | "file" | "image" | "color" | "rating";
|
|
19
|
+
/**
|
|
20
|
+
* Business importance levels for field prioritization.
|
|
21
|
+
*
|
|
22
|
+
* Controls field visibility and display priority in responsive layouts.
|
|
23
|
+
* Uses semantic naming (primary/secondary/tertiary) with backward compatible
|
|
24
|
+
* severity levels (critical/high/medium/low/minimal).
|
|
25
|
+
*
|
|
26
|
+
* @mirror backend: pattern_stack/atoms/metadata/schemas.py::SemanticImportance
|
|
27
|
+
*
|
|
28
|
+
* Semantic levels:
|
|
29
|
+
* - primary: Most important, always show
|
|
30
|
+
* - secondary: Supporting information
|
|
31
|
+
* - tertiary: Optional/metadata field (default)
|
|
32
|
+
*
|
|
33
|
+
* Backward compatible severity levels (mapped to semantic):
|
|
34
|
+
* - critical, high -> equivalent to primary
|
|
35
|
+
* - medium -> equivalent to secondary
|
|
36
|
+
* - low, minimal -> equivalent to tertiary
|
|
37
|
+
*/
|
|
38
|
+
export type UIImportance = "primary" | "secondary" | "tertiary" | "critical" | "high" | "medium" | "low" | "minimal";
|
|
39
|
+
/**
|
|
40
|
+
* Column/field metadata for dynamic UI rendering.
|
|
41
|
+
*
|
|
42
|
+
* Provides comprehensive metadata about a data field including its type,
|
|
43
|
+
* importance, display properties, and validation rules. Used by DataTable,
|
|
44
|
+
* forms, and other data-driven components to render fields appropriately.
|
|
45
|
+
*
|
|
46
|
+
* @mirror backend: pattern_stack/atoms/metadata/schemas.py::ColumnMetadata
|
|
47
|
+
*/
|
|
48
|
+
export interface ColumnMetadata {
|
|
49
|
+
/** Field name/key in the data object */
|
|
50
|
+
field: string;
|
|
51
|
+
/** Human-readable label for display */
|
|
52
|
+
label: string;
|
|
53
|
+
/** Semantic UI type for rendering */
|
|
54
|
+
type: UIType;
|
|
55
|
+
/** Business importance level for prioritization */
|
|
56
|
+
importance: UIImportance;
|
|
57
|
+
/** Logical grouping for field organization */
|
|
58
|
+
group?: string;
|
|
59
|
+
/** Whether the field supports sorting */
|
|
60
|
+
sortable?: boolean;
|
|
61
|
+
/** Whether the field supports filtering */
|
|
62
|
+
filterable?: boolean;
|
|
63
|
+
/** Type-specific formatting options */
|
|
64
|
+
format?: Record<string, unknown>;
|
|
65
|
+
/** Help text describing the field */
|
|
66
|
+
description?: string;
|
|
67
|
+
/** Placeholder text for input fields */
|
|
68
|
+
placeholder?: string;
|
|
69
|
+
/** Whether the field is visible by default */
|
|
70
|
+
visible?: boolean;
|
|
71
|
+
/** Whether the field is required in forms */
|
|
72
|
+
required?: boolean;
|
|
73
|
+
/** Whether the field is computed/read-only */
|
|
74
|
+
computed?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* API response for column metadata.
|
|
78
|
+
*
|
|
79
|
+
* Returned by metadata endpoints to provide UI rendering information
|
|
80
|
+
* for a specific entity and view type.
|
|
81
|
+
*/
|
|
82
|
+
export interface ColumnMetadataResponse {
|
|
83
|
+
/** Array of column metadata definitions */
|
|
84
|
+
columns: ColumnMetadata[];
|
|
85
|
+
/** Entity type these columns belong to */
|
|
86
|
+
entity: string;
|
|
87
|
+
/** View context (list/detail/form) */
|
|
88
|
+
view: "list" | "detail" | "form";
|
|
89
|
+
/** Metadata schema version */
|
|
90
|
+
version: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Field group metadata for form sections.
|
|
94
|
+
*
|
|
95
|
+
* Organizes related fields into collapsible sections within forms.
|
|
96
|
+
* Groups provide visual organization and progressive disclosure of form fields.
|
|
97
|
+
*/
|
|
98
|
+
export interface FieldGroupMetadata {
|
|
99
|
+
/** Unique group identifier */
|
|
100
|
+
name: string;
|
|
101
|
+
/** Human-readable group label */
|
|
102
|
+
label: string;
|
|
103
|
+
/** Help text describing the group */
|
|
104
|
+
description?: string;
|
|
105
|
+
/** Display order relative to other groups */
|
|
106
|
+
order?: number;
|
|
107
|
+
/** Whether the group can be collapsed */
|
|
108
|
+
collapsible?: boolean;
|
|
109
|
+
/** Whether the group starts collapsed */
|
|
110
|
+
collapsed_default?: boolean;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=ui-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-metadata.d.ts","sourceRoot":"","sources":["../../../src/atoms/types/ui-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;GAQG;A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,MAAM,EAAE,MAAM,CAAC;IAEf,sCAAsC;IACtC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAEjC,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IAEb,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IAEd,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,yCAAyC;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
* Maps field types to their corresponding UI components
|
|
5
5
|
*/
|
|
6
6
|
import React from "react";
|
|
7
|
-
import type { UIFieldType } from "../types/ui-config";
|
|
7
|
+
import type { UIFieldType, FieldFormat } from "../types/ui-config";
|
|
8
8
|
import type { FieldRendererRegistry } from "../types/ui-config";
|
|
9
|
-
export type { FieldRendererRegistry };
|
|
9
|
+
export type { FieldRendererRegistry, FieldFormat };
|
|
10
10
|
import type { Breakpoint } from "../config/responsive";
|
|
11
|
+
/**
|
|
12
|
+
* Normalize a type string to canonical UIFieldType.
|
|
13
|
+
* Handles legacy names for backwards compatibility.
|
|
14
|
+
*/
|
|
15
|
+
export declare function normalizeFieldType(type: string): UIFieldType;
|
|
11
16
|
/**
|
|
12
17
|
* Default field renderers for each UI type
|
|
13
18
|
*/
|
|
@@ -15,5 +20,6 @@ export declare const defaultFieldRenderers: FieldRendererRegistry;
|
|
|
15
20
|
/**
|
|
16
21
|
* Render a field value using the appropriate component
|
|
17
22
|
*/
|
|
18
|
-
export declare function renderField(value: unknown, fieldName: string, fieldType:
|
|
23
|
+
export declare function renderField(value: unknown, fieldName: string, fieldType: string, // Accept string, not just UIFieldType
|
|
24
|
+
breakpoint: Breakpoint, item?: Record<string, unknown>, customRenderers?: Partial<FieldRendererRegistry>, format?: FieldFormat): React.ReactNode;
|
|
19
25
|
//# sourceMappingURL=ui-mapping.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-mapping.d.ts","sourceRoot":"","sources":["../../../src/atoms/utils/ui-mapping.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ui-mapping.d.ts","sourceRoot":"","sources":["../../../src/atoms/utils/ui-mapping.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAAE,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AA4BvD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAE5D;AAsJD;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,qBA+NnC,CAAC;AAEF;;GAEG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EAAE,sCAAsC;AACzD,UAAU,EAAE,UAAU,EACtB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,eAAe,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAChD,MAAM,CAAC,EAAE,WAAW,GACnB,KAAK,CAAC,SAAS,CAYjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../../src/features/auth/hooks/useAuth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../../src/features/auth/hooks/useAuth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EAGT,MAAM,sBAAsB,CAAC;AAG9B,UAAU,iBAAiB;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAAE,EAC1D,QAAQ,EACR,MAAM,GACP,EAAE,iBAAiB,2CAqLnB"}
|