@llmnative/react 1.11.1 → 1.13.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/index.css +1 -1
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +906 -877
- package/dist/index.mjs.map +1 -1
- package/dist/types/src/Theme.d.ts +15 -0
- package/dist/types/src/components/ui/Gallery.d.ts +15 -1
- package/dist/types/src/components/widgets/grid-core/GridGalleryView.d.ts +1 -1
- package/dist/types/src/components/widgets/grid-core/types.d.ts +11 -1
- package/package.json +1 -1
- package/themes/cyber.ts +5 -0
- package/themes/default.ts +5 -0
- package/themes/flat.ts +5 -0
|
@@ -147,6 +147,20 @@ export interface GalleryTheme {
|
|
|
147
147
|
gap?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
148
148
|
rowCols?: 1 | 2 | 3 | 4 | 6;
|
|
149
149
|
}
|
|
150
|
+
export interface RepeatTheme {
|
|
151
|
+
/** Extra classes merged (via twMerge — later wins on conflicting utilities) onto the
|
|
152
|
+
* per-item shell of every `Repeat`, on top of its hardcoded default (rounded card + border).
|
|
153
|
+
* Applies app-wide to every `Repeat`, regardless of `layout`. */
|
|
154
|
+
itemClassName?: string;
|
|
155
|
+
/** Same as `itemClassName`, but only for `layout="inline"` — merged AFTER `itemClassName`, so
|
|
156
|
+
* it wins on any conflicting utility. Lets a consumer keep the bordered/carded look for
|
|
157
|
+
* `horizontal`/`vertical` repeats (e.g. content list fields) while flattening only the compact
|
|
158
|
+
* inline ones (e.g. inline chip-like rows nested inside an already-bordered popover/card). */
|
|
159
|
+
inlineItemClassName?: string;
|
|
160
|
+
/** Extra classes merged onto the "Add" button rendered when `label` + `labelPosition="bottom"`
|
|
161
|
+
* are set. */
|
|
162
|
+
addButtonClassName?: string;
|
|
163
|
+
}
|
|
150
164
|
export interface ModalTheme {
|
|
151
165
|
size?: "sm" | "md" | "lg" | "xl" | "fullscreen";
|
|
152
166
|
position?: "center" | "top" | "left" | "right" | "bottom";
|
|
@@ -348,6 +362,7 @@ export interface ThemeConfig {
|
|
|
348
362
|
wrapperClassName?: string;
|
|
349
363
|
className?: string;
|
|
350
364
|
};
|
|
365
|
+
Repeat?: RepeatTheme;
|
|
351
366
|
}
|
|
352
367
|
type DeepRequired<T> = {
|
|
353
368
|
[K in keyof T]-?: NonNullable<T[K]> extends (...args: unknown[]) => unknown ? NonNullable<T[K]> : NonNullable<T[K]> extends object ? DeepRequired<NonNullable<T[K]>> : NonNullable<T[K]>;
|
|
@@ -33,6 +33,17 @@ export type GalleryOverlay = {
|
|
|
33
33
|
*/
|
|
34
34
|
style?: React.CSSProperties;
|
|
35
35
|
};
|
|
36
|
+
export interface GalleryItemRenderContext {
|
|
37
|
+
isSelected: boolean;
|
|
38
|
+
toggleSelection: () => void;
|
|
39
|
+
}
|
|
40
|
+
/** Full replacement for an item's default content (`<img>` + `overlays`) — for a card with no
|
|
41
|
+
* image at all (icon/text/badges). The selection checkbox, click-handling (bubbling from
|
|
42
|
+
* whatever's clicked inside up to `onRowClick`, same bail-out on interactive descendants as the
|
|
43
|
+
* default image) and the grid item's own sizing stay owned by `Gallery`; only what goes INSIDE
|
|
44
|
+
* that box is up to the caller. Purely additive: omitting it leaves every existing
|
|
45
|
+
* `img`/`thumbnail`/`overlays` consumer unaffected. */
|
|
46
|
+
export type GalleryItemRender = (item: GalleryRecord, index: number, ctx: GalleryItemRenderContext) => React.ReactNode;
|
|
36
47
|
export type GallerySelectionState = RecordSelectionState<GalleryRecord>;
|
|
37
48
|
export type GallerySelectionChangeHandler = (selection: GallerySelectionState) => void;
|
|
38
49
|
export interface GalleryProps extends UIProps {
|
|
@@ -41,6 +52,9 @@ export interface GalleryProps extends UIProps {
|
|
|
41
52
|
footer?: string | React.ReactNode;
|
|
42
53
|
/** Overlay badges rendered on each gallery item. */
|
|
43
54
|
overlays?: GalleryOverlay[];
|
|
55
|
+
/** Replaces an item's entire default content (image + overlays) with custom markup — see
|
|
56
|
+
* `GalleryItemRender`. Omit for the existing image-based card. */
|
|
57
|
+
renderItem?: GalleryItemRender;
|
|
44
58
|
onRowClick?: (record: GalleryRecord) => void;
|
|
45
59
|
onSelectionChange?: GallerySelectionChangeHandler;
|
|
46
60
|
/** Enable sorting, optionally with a default sort config. */
|
|
@@ -57,5 +71,5 @@ export interface GalleryProps extends UIProps {
|
|
|
57
71
|
footerClassName?: string;
|
|
58
72
|
selectedClassName?: string;
|
|
59
73
|
}
|
|
60
|
-
declare const Gallery: ({ records, header, footer, overlays, onRowClick, onSelectionChange, sortable, pagination, gap, columns, groupBy, selectedKeys, before, after, wrapperClassName, className, headerClassName, scrollClassName, bodyClassName, footerClassName, selectedClassName }: GalleryProps) => React.JSX.Element;
|
|
74
|
+
declare const Gallery: ({ records, header, footer, overlays, renderItem, onRowClick, onSelectionChange, sortable, pagination, gap, columns, groupBy, selectedKeys, before, after, wrapperClassName, className, headerClassName, scrollClassName, bodyClassName, footerClassName, selectedClassName }: GalleryProps) => React.JSX.Element;
|
|
61
75
|
export default Gallery;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type RecordProps } from "../../../providers/data/DataProvider";
|
|
3
3
|
import { type GridGalleryViewProps } from "./types";
|
|
4
|
-
declare function GridGalleryView<TRecord extends RecordProps>({ records, recordId, sortable, pagination, selection, selectedKeys, onSelectionChange, onRowClick, groupBy, wrapperClassName, before, after, columns, overlays, }: GridGalleryViewProps<TRecord>): React.JSX.Element;
|
|
4
|
+
declare function GridGalleryView<TRecord extends RecordProps>({ records, recordId, sortable, pagination, selection, selectedKeys, onSelectionChange, onRowClick, groupBy, wrapperClassName, before, after, columns, overlays, renderItem, }: GridGalleryViewProps<TRecord>): React.JSX.Element;
|
|
5
5
|
export default GridGalleryView;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type OrderConfig } from "../../../libs/order";
|
|
3
3
|
import { type PaginationParams } from "../../ui/Pagination";
|
|
4
|
-
import { type GalleryOverlay } from "../../ui/Gallery";
|
|
4
|
+
import { type GalleryItemRenderContext, type GalleryOverlay } from "../../ui/Gallery";
|
|
5
5
|
import { type DatabaseOptions, type RecordProps } from "../../../providers/data/DataProvider";
|
|
6
6
|
export type GridLayout = "table" | "gallery";
|
|
7
7
|
export type GridSticky = "top" | "bottom";
|
|
@@ -71,6 +71,14 @@ export type GridGalleryViewConfig<TRecord> = {
|
|
|
71
71
|
* simply stack, with the custom overlay rendered first.
|
|
72
72
|
*/
|
|
73
73
|
overlays?: GalleryOverlay[];
|
|
74
|
+
/**
|
|
75
|
+
* Full replacement for a card's default content (image + `fields`/`overlays`) — for a card
|
|
76
|
+
* with no image at all (icon/text/badges), forwarded to `<Gallery renderItem>`. Mutually
|
|
77
|
+
* exclusive in effect with `fields`/`overlays`: when set, `Gallery` renders ONLY this for
|
|
78
|
+
* every item (see `GalleryItemRender`'s doc comment in `ui/Gallery.tsx`) — `fields`/`overlays`
|
|
79
|
+
* are ignored, not merged, since there is no default image left to overlay them onto.
|
|
80
|
+
*/
|
|
81
|
+
renderItem?: (record: TRecord, index: number, ctx: GalleryItemRenderContext) => React.ReactNode;
|
|
74
82
|
};
|
|
75
83
|
/**
|
|
76
84
|
* Groups every Table/Gallery-view-switching concern under one input, instead of a flat
|
|
@@ -475,5 +483,7 @@ export type GridGalleryViewProps<TRecord extends RecordProps> = {
|
|
|
475
483
|
columns?: 1 | 2 | 3 | 4 | 6;
|
|
476
484
|
/** Overlay badges/render-props for each card — forwarded to `<Gallery overlays>`. */
|
|
477
485
|
overlays?: GalleryOverlay[];
|
|
486
|
+
/** Full replacement for a card's default content — forwarded to `<Gallery renderItem>`. */
|
|
487
|
+
renderItem?: (record: TRecord, index: number, ctx: GalleryItemRenderContext) => React.ReactNode;
|
|
478
488
|
};
|
|
479
489
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmnative/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "LLM-native React framework for deterministic UI generation. Data-driven by default, schema-driven optional. Ultra-low token consumption — built for AI agents, not just humans.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
package/themes/cyber.ts
CHANGED
|
@@ -468,6 +468,11 @@ export const components: Theme = {
|
|
|
468
468
|
wrapperClassName: '',
|
|
469
469
|
className: '',
|
|
470
470
|
},
|
|
471
|
+
Repeat: {
|
|
472
|
+
itemClassName: '',
|
|
473
|
+
inlineItemClassName: '',
|
|
474
|
+
addButtonClassName: '',
|
|
475
|
+
},
|
|
471
476
|
};
|
|
472
477
|
|
|
473
478
|
const definition: ThemeDefinition = { preset, motion, components };
|
package/themes/default.ts
CHANGED
|
@@ -482,6 +482,11 @@ export const components: Theme = {
|
|
|
482
482
|
wrapperClassName: '',
|
|
483
483
|
className: '',
|
|
484
484
|
},
|
|
485
|
+
Repeat: {
|
|
486
|
+
itemClassName: '',
|
|
487
|
+
inlineItemClassName: '',
|
|
488
|
+
addButtonClassName: '',
|
|
489
|
+
},
|
|
485
490
|
};
|
|
486
491
|
|
|
487
492
|
const definition: ThemeDefinition = { preset, motion, components };
|
package/themes/flat.ts
CHANGED
|
@@ -468,6 +468,11 @@ export const components: Theme = {
|
|
|
468
468
|
wrapperClassName: '',
|
|
469
469
|
className: '',
|
|
470
470
|
},
|
|
471
|
+
Repeat: {
|
|
472
|
+
itemClassName: '',
|
|
473
|
+
inlineItemClassName: '',
|
|
474
|
+
addButtonClassName: '',
|
|
475
|
+
},
|
|
471
476
|
};
|
|
472
477
|
|
|
473
478
|
const definition: ThemeDefinition = { preset, motion, components };
|