UNPKG

@copilotkit/a2ui-renderer

Version:

A2UI Renderer for CopilotKit - render A2UI surfaces in React applications

52 lines (50 loc) 1.56 kB
//#region src/react-renderer/a2ui-react/catalog/basic/utils.ts /** Standard leaf margin from the implementation guide. */ const LEAF_MARGIN = "8px"; /** Standard internal padding for visually bounded containers. */ const CONTAINER_PADDING = "16px"; /** Standard border for cards and inputs. */ const STANDARD_BORDER = "1px solid #ccc"; /** Standard border radius. */ const STANDARD_RADIUS = "8px"; const mapJustify = (j) => { switch (j) { case "center": return "center"; case "end": return "flex-end"; case "spaceAround": return "space-around"; case "spaceBetween": return "space-between"; case "spaceEvenly": return "space-evenly"; case "start": return "flex-start"; case "stretch": return "stretch"; default: return "flex-start"; } }; const mapAlign = (a) => { switch (a) { case "start": return "flex-start"; case "center": return "center"; case "end": return "flex-end"; case "stretch": return "stretch"; default: return "stretch"; } }; const getBaseLeafStyle = () => ({ margin: LEAF_MARGIN, boxSizing: "border-box" }); const getBaseContainerStyle = () => ({ margin: LEAF_MARGIN, padding: CONTAINER_PADDING, border: STANDARD_BORDER, borderRadius: STANDARD_RADIUS, boxSizing: "border-box" }); //#endregion exports.LEAF_MARGIN = LEAF_MARGIN; exports.STANDARD_BORDER = STANDARD_BORDER; exports.STANDARD_RADIUS = STANDARD_RADIUS; exports.getBaseContainerStyle = getBaseContainerStyle; exports.getBaseLeafStyle = getBaseLeafStyle; exports.mapAlign = mapAlign; exports.mapJustify = mapJustify; //# sourceMappingURL=utils.cjs.map