@peak-ai/canvas 1.0.0-rc.1
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/GrapesjsCanvas.d.ts +9 -0
- package/GrapesjsCanvas.js +4 -0
- package/GrapesjsCanvas.js.map +1 -0
- package/constants/index.d.ts +4 -0
- package/constants/index.js +2 -0
- package/constants/index.js.map +1 -0
- package/helpers/index.d.ts +1 -0
- package/helpers/index.js +2 -0
- package/helpers/index.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/index.js.map +1 -0
- package/index.styles.d.ts +1 -0
- package/index.styles.js +2 -0
- package/index.styles.js.map +1 -0
- package/package.json +50 -0
- package/plugins/grapejs-plugin.d.ts +2 -0
- package/plugins/grapejs-plugin.js +3 -0
- package/plugins/grapejs-plugin.js.map +1 -0
- package/plugins/helpers/render-components.d.ts +12 -0
- package/plugins/helpers/render-components.js +23 -0
- package/plugins/helpers/render-components.js.map +1 -0
- package/shadcn/components/ui/card.d.ts +12 -0
- package/shadcn/components/ui/card.js +2 -0
- package/shadcn/components/ui/card.js.map +1 -0
- package/shadcn/components/ui/chart.d.ts +41 -0
- package/shadcn/components/ui/chart.js +4 -0
- package/shadcn/components/ui/chart.js.map +1 -0
- package/shadcn/components/ui/checkbox.d.ts +4 -0
- package/shadcn/components/ui/checkbox.js +2 -0
- package/shadcn/components/ui/checkbox.js.map +1 -0
- package/shadcn/components/ui/hover-card.d.ts +6 -0
- package/shadcn/components/ui/hover-card.js +2 -0
- package/shadcn/components/ui/hover-card.js.map +1 -0
- package/shadcn/components/ui/input.d.ts +3 -0
- package/shadcn/components/ui/input.js +2 -0
- package/shadcn/components/ui/input.js.map +1 -0
- package/shadcn/components/ui/label.d.ts +6 -0
- package/shadcn/components/ui/label.js +2 -0
- package/shadcn/components/ui/label.js.map +1 -0
- package/shadcn/components/ui/scroll-area.d.ts +5 -0
- package/shadcn/components/ui/scroll-area.js +2 -0
- package/shadcn/components/ui/scroll-area.js.map +1 -0
- package/shadcn/components/ui/separator.d.ts +4 -0
- package/shadcn/components/ui/separator.js +2 -0
- package/shadcn/components/ui/separator.js.map +1 -0
- package/shadcn/components/ui/table.d.ts +10 -0
- package/shadcn/components/ui/table.js +2 -0
- package/shadcn/components/ui/table.js.map +1 -0
- package/shadcn/components/ui/textarea.d.ts +3 -0
- package/shadcn/components/ui/textarea.js +2 -0
- package/shadcn/components/ui/textarea.js.map +1 -0
- package/shadcn/components/ui/tooltip.d.ts +7 -0
- package/shadcn/components/ui/tooltip.js +2 -0
- package/shadcn/components/ui/tooltip.js.map +1 -0
- package/shadcn/utils.d.ts +2 -0
- package/shadcn/utils.js +2 -0
- package/shadcn/utils.js.map +1 -0
- package/types/grapesjs-tailwind.d.js +2 -0
- package/types/grapesjs-tailwind.d.js.map +1 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Editor } from 'grapesjs';
|
|
2
|
+
import 'grapesjs/dist/css/grapes.min.css';
|
|
3
|
+
type GrapejsCanvasProps = {
|
|
4
|
+
json: any;
|
|
5
|
+
mode?: 'editor' | 'preview';
|
|
6
|
+
setEditor: (editor: Editor) => void;
|
|
7
|
+
};
|
|
8
|
+
declare function GrapejsCanvas({ json, mode, setEditor }: GrapejsCanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default GrapejsCanvas;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */import React,{useEffect,useRef}from"react";// eslint-disable-next-line import/no-named-as-default
|
|
2
|
+
import grapesjs from"grapesjs";import"grapesjs/dist/css/grapes.min.css";import tailwind from"grapesjs-tailwind";import{TypesToRegister}from"./constants";import{toKebabCase}from"./helpers";import{createGrapesjsShadcnGenericPlugin}from"./plugins/grapejs-plugin";import{StyledEditor}from"./index.styles";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function setComponentProperties(editor,isPreview){function setPropertiesRecursively(comp){comp.set({editable:!isPreview,draggable:!isPreview,droppable:!isPreview&&comp.getName()!=="Shadcn-generic",selectable:!isPreview,hoverable:!isPreview,highlightable:!isPreview,copyable:false,resizable:false,removable:!isPreview,badgable:false});if(!isPreview){comp.set("toolbar",[{attributes:{"class":"fa fa-arrows"},command:"tlb-move"},{attributes:{"class":"fa fa-trash"},command:"tlb-delete"}])}comp.components().forEach(setPropertiesRecursively)}if(isPreview){editor.runCommand("core:preview")}else{editor.stopCommand("core:preview")}var wrapper=editor.getWrapper();wrapper==null||wrapper.find("*").forEach(setPropertiesRecursively)}function convertStyles(stylesArray){return stylesArray.map(function(block){var selectors=Array.isArray(block.selectors)?block.selectors.join(", "):block.selectors;var declarations=Object.entries(block.style).map(function(_ref){var prop=_ref[0],value=_ref[1];return toKebabCase(prop)+": "+value+";"}).join(" ");return selectors+" { "+declarations+" }"}).join("\n")}function GrapejsCanvas(_ref2){var json=_ref2.json,_ref2$mode=_ref2.mode,mode=_ref2$mode===void 0?"preview":_ref2$mode,setEditor=_ref2.setEditor;var editorRef=useRef(null);var editorInstance=useRef(null);useEffect(function(){var _json$pages,_json$pages$0$frames;if(!editorRef.current){return function(){// Cleanup if editorRef is not available
|
|
3
|
+
}}if(editorInstance.current){editorInstance.current.destroy();editorInstance.current=null}var currentMode=mode;var editor=grapesjs.init({container:editorRef.current,height:"100%",plugins:[tailwind,createGrapesjsShadcnGenericPlugin(currentMode)],canvas:{styles:["https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css"]},storageManager:{type:"none"},richTextEditor:{actions:["bold","italic","underline","strikethrough"]}});editorInstance.current=editor;if(setEditor){setEditor(editor)}TypesToRegister.forEach(function(_ref3){var type=_ref3.type,tagName=_ref3.tagName;if(!editor.DomComponents.getType(type)){editor.DomComponents.addType(type,{model:{defaults:{tagName:tagName}},view:{}})}});if(json&&((_json$pages=json.pages)==null?void 0:_json$pages.length)>0&&((_json$pages$0$frames=json.pages[0].frames)==null?void 0:_json$pages$0$frames.length)>0){var comp=json.pages[0].frames[0].component;editor.setComponents(comp);var cssText=convertStyles(json.styles||[]);editor.setStyle(cssText)}editor.on("load",function(){setComponentProperties(editor,mode==="preview")});return function(){editor.destroy()}},[json,mode]);return/*#__PURE__*/_jsxs(React.Fragment,{children:[/*#__PURE__*/_jsx(StyledEditor,{}),/*#__PURE__*/_jsx("div",{ref:editorRef})]})}export default GrapejsCanvas;
|
|
4
|
+
//# sourceMappingURL=GrapesjsCanvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GrapesjsCanvas.js","names":["React","useEffect","useRef","grapesjs","tailwind","TypesToRegister","toKebabCase","createGrapesjsShadcnGenericPlugin","StyledEditor","jsx","_jsx","jsxs","_jsxs","setComponentProperties","editor","isPreview","setPropertiesRecursively","comp","set","editable","draggable","droppable","getName","selectable","hoverable","highlightable","copyable","resizable","removable","badgable","attributes","command","components","forEach","runCommand","stopCommand","wrapper","getWrapper","find","convertStyles","stylesArray","map","block","selectors","Array","isArray","join","declarations","Object","entries","style","_ref","prop","value","GrapejsCanvas","_ref2","json","_ref2$mode","mode","setEditor","editorRef","editorInstance","_json$pages","_json$pages$0$frames","current","destroy","currentMode","init","container","height","plugins","canvas","styles","storageManager","type","richTextEditor","actions","_ref3","tagName","DomComponents","getType","addType","model","defaults","view","pages","length","frames","component","setComponents","cssText","setStyle","on","Fragment","children","ref"],"sources":["../src/GrapesjsCanvas.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useRef } from 'react';\n// eslint-disable-next-line import/no-named-as-default\nimport grapesjs, { Component, Editor } from 'grapesjs';\nimport 'grapesjs/dist/css/grapes.min.css';\nimport tailwind from 'grapesjs-tailwind';\nimport { TypesToRegister } from './constants';\nimport { toKebabCase } from './helpers';\nimport { createGrapesjsShadcnGenericPlugin } from './plugins/grapejs-plugin';\nimport { StyledEditor } from './index.styles';\n\ntype GrapejsCanvasProps = {\n json: any;\n mode?: 'editor' | 'preview';\n setEditor: (editor: Editor) => void;\n};\n\nfunction setComponentProperties(editor: Editor, isPreview: boolean) {\n function setPropertiesRecursively(comp: Component) {\n comp.set({\n editable: !isPreview,\n draggable: !isPreview,\n droppable: !isPreview && comp.getName() !== 'Shadcn-generic',\n selectable: !isPreview,\n hoverable: !isPreview,\n highlightable: !isPreview,\n copyable: false,\n resizable: false,\n removable: !isPreview,\n badgable: false,\n });\n\n if (!isPreview) {\n comp.set('toolbar', [\n { attributes: { class: 'fa fa-arrows' }, command: 'tlb-move' },\n { attributes: { class: 'fa fa-trash' }, command: 'tlb-delete' },\n ]);\n }\n\n comp.components().forEach(setPropertiesRecursively);\n }\n\n if (isPreview) {\n editor.runCommand('core:preview');\n } else {\n editor.stopCommand('core:preview');\n }\n\n const wrapper = editor.getWrapper();\n wrapper?.find('*').forEach(setPropertiesRecursively);\n}\n\nfunction convertStyles(stylesArray: any[]): string {\n return stylesArray\n .map((block) => {\n const selectors = Array.isArray(block.selectors)\n ? block.selectors.join(', ')\n : block.selectors;\n const declarations = Object.entries(block.style)\n .map(([prop, value]) => `${toKebabCase(prop)}: ${value};`)\n .join(' ');\n\n return `${selectors} { ${declarations} }`;\n })\n .join('\\n');\n}\n\nfunction GrapejsCanvas({ json, mode = 'preview', setEditor }: GrapejsCanvasProps) {\n const editorRef = useRef<HTMLDivElement>(null);\n const editorInstance = useRef<any>(null);\n\n useEffect(() => {\n if (!editorRef.current) {\n return () => {\n // Cleanup if editorRef is not available\n };\n }\n\n if (editorInstance.current) {\n editorInstance.current.destroy();\n editorInstance.current = null;\n }\n\n const currentMode = mode;\n\n const editor = grapesjs.init({\n container: editorRef.current,\n height: '100%',\n plugins: [tailwind, createGrapesjsShadcnGenericPlugin(currentMode)],\n canvas: {\n styles: ['https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css'],\n },\n storageManager: { type: 'none' },\n richTextEditor: {\n actions: ['bold', 'italic', 'underline', 'strikethrough'],\n },\n });\n\n editorInstance.current = editor;\n\n if (setEditor) {\n setEditor(editor);\n }\n\n TypesToRegister.forEach(({ type, tagName }) => {\n if (!editor.DomComponents.getType(type)) {\n editor.DomComponents.addType(type, {\n model: {\n defaults: { tagName },\n },\n view: {},\n });\n }\n });\n\n if (json && json.pages?.length > 0 && json.pages[0].frames?.length > 0) {\n const comp = json.pages[0].frames[0].component;\n editor.setComponents(comp);\n const cssText = convertStyles(json.styles || []);\n editor.setStyle(cssText);\n }\n\n editor.on('load', () => {\n setComponentProperties(editor, mode === 'preview');\n });\n\n return () => {\n editor.destroy();\n };\n }, [json, mode]);\n\n return (\n <React.Fragment>\n <StyledEditor />\n <div ref={editorRef} />\n </React.Fragment>\n );\n}\n\nexport default GrapejsCanvas;\n"],"mappings":"AAAA,uDACA,MAAO,CAAAA,KAAK,EAAIC,SAAS,CAAEC,MAAM,KAAQ,OAAO,CAChD;AACA,MAAO,CAAAC,QAAQ,KAA6B,UAAU,CACtD,MAAO,kCAAkC,CACzC,MAAO,CAAAC,QAAQ,KAAM,mBAAmB,CACxC,OAASC,eAAe,KAAQ,aAAa,CAC7C,OAASC,WAAW,KAAQ,WAAW,CACvC,OAASC,iCAAiC,KAAQ,0BAA0B,CAC5E,OAASC,YAAY,KAAQ,gBAAgB,CAAC,OAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBAQ9C,QAAS,CAAAC,sBAAsBA,CAACC,MAAc,CAAEC,SAAkB,CAAE,CAClE,QAAS,CAAAC,wBAAwBA,CAACC,IAAe,CAAE,CACjDA,IAAI,CAACC,GAAG,CAAC,CACPC,QAAQ,CAAE,CAACJ,SAAS,CACpBK,SAAS,CAAE,CAACL,SAAS,CACrBM,SAAS,CAAE,CAACN,SAAS,EAAIE,IAAI,CAACK,OAAO,CAAC,CAAC,GAAK,gBAAgB,CAC5DC,UAAU,CAAE,CAACR,SAAS,CACtBS,SAAS,CAAE,CAACT,SAAS,CACrBU,aAAa,CAAE,CAACV,SAAS,CACzBW,QAAQ,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AAA,CAACZ,KAAK,CAAC6F,QAAQ,EAAAC,QAAA,eACbpF,IAAA,CAACF,YAAY,GAAE,CAAC,cAChBE,IAAA,QAAKqF,GAAG,CAAEnC,SAAU,CAAE,CAAC,EACT,CAEpB,CAEA,cAAe,CAAAN,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export var TypesToRegister=[{tagName:"div",type:"div"},{tagName:"h1",type:"heading"},{tagName:"p",type:"text"},{tagName:"div",type:"container"},{tagName:"div",type:"grid"},{tagName:"table",type:"table"},{tagName:"thead",type:"thead"},{tagName:"tbody",type:"tbody"},{tagName:"tr",type:"tr"},{tagName:"th",type:"th"},{tagName:"td",type:"td"},{tagName:"button",type:"button"},{tagName:"section",type:"section"},{tagName:"img",type:"image"},{tagName:"a",type:"link"},{tagName:"video",type:"video"},{tagName:"form",type:"form"},{tagName:"input",type:"input"},{tagName:"textarea",type:"textarea"},{tagName:"select",type:"select"},{tagName:"ul",type:"ul"},{tagName:"ol",type:"ol"},{tagName:"li",type:"li"},{tagName:"header",type:"header"},{tagName:"footer",type:"footer"}];
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["TypesToRegister","tagName","type"],"sources":["../../src/constants/index.ts"],"sourcesContent":["export const TypesToRegister = [\n { tagName: 'div', type: 'div' },\n { tagName: 'h1', type: 'heading' },\n { tagName: 'p', type: 'text' },\n { tagName: 'div', type: 'container' },\n { tagName: 'div', type: 'grid' },\n { tagName: 'table', type: 'table' },\n { tagName: 'thead', type: 'thead' },\n { tagName: 'tbody', type: 'tbody' },\n { tagName: 'tr', type: 'tr' },\n { tagName: 'th', type: 'th' },\n { tagName: 'td', type: 'td' },\n { tagName: 'button', type: 'button' },\n { tagName: 'section', type: 'section' },\n { tagName: 'img', type: 'image' },\n { tagName: 'a', type: 'link' },\n { tagName: 'video', type: 'video' },\n { tagName: 'form', type: 'form' },\n { tagName: 'input', type: 'input' },\n { tagName: 'textarea', type: 'textarea' },\n { tagName: 'select', type: 'select' },\n { tagName: 'ul', type: 'ul' },\n { tagName: 'ol', type: 'ol' },\n { tagName: 'li', type: 'li' },\n { tagName: 'header', type: 'header' },\n { tagName: 'footer', type: 'footer' },\n];\n"],"mappings":"AAAA,MAAO,IAAM,CAAAA,eAAe,CAAG,CAC7B,CAAEC,OAAO,CAAE,KAAK,CAAEC,IAAI,CAAE,KAAM,CAAC,CAC/B,CAAED,OAAO,CAAE,IAAI,CAAEC,IAAI,CAAE,SAAU,CAAC,CAClC,CAAED,OAAO,CAAE,GAAG,CAAEC,IAAI,CAAE,MAAO,CAAC,CAC9B,CAAED,OAAO,CAAE,KAAK,CAAEC,IAAI,CAAE,WAAY,CAAC,CACrC,CAAED,OAAO,CAAE,KAAK,CAAEC,IAAI,CAAE,MAAO,CAAC,CAChC,CAAED,OAAO,CAAE,OAAO,CAAEC,IAAI,CAAE,OAAQ,CAAC,CACnC,CAAED,OAAO,CAAE,OAAO,CAAEC,IAAI,CAAE,OAAQ,CAAC,CACnC,CAAED,OAAO,CAAE,OAAO,CAAEC,IAAI,CAAE,OAAQ,CAAC,CACnC,CAAED,OAAO,CAAE,IAAI,CAAEC,IAAI,CAAE,IAAK,CAAC,CAC7B,CAAED,OAAO,CAAE,IAAI,CAAEC,IAAI,CAAE,IAAK,CAAC,CAC7B,CAAED,OAAO,CAAE,IAAI,CAAEC,IAAI,CAAE,IAAK,CAAC,CAC7B,CAAED,OAAO,CAAE,QAAQ,CAAEC,IAAI,CAAE,QAAS,CAAC,CACrC,CAAED,OAAO,CAAE,SAAS,CAAEC,IAAI,CAAE,SAAU,CAAC,CACvC,CAAED,OAAO,CAAE,KAAK,CAAEC,IAAI,CAAE,OAAQ,CAAC,CACjC,CAAED,OAAO,CAAE,GAAG,CAAEC,IAAI,CAAE,MAAO,CAAC,CAC9B,CAAED,OAAO,CAAE,OAAO,CAAEC,IAAI,CAAE,OAAQ,CAAC,CACnC,CAAED,OAAO,CAAE,MAAM,CAAEC,IAAI,CAAE,MAAO,CAAC,CACjC,CAAED,OAAO,CAAE,OAAO,CAAEC,IAAI,CAAE,OAAQ,CAAC,CACnC,CAAED,OAAO,CAAE,UAAU,CAAEC,IAAI,CAAE,UAAW,CAAC,CACzC,CAAED,OAAO,CAAE,QAAQ,CAAEC,IAAI,CAAE,QAAS,CAAC,CACrC,CAAED,OAAO,CAAE,IAAI,CAAEC,IAAI,CAAE,IAAK,CAAC,CAC7B,CAAED,OAAO,CAAE,IAAI,CAAEC,IAAI,CAAE,IAAK,CAAC,CAC7B,CAAED,OAAO,CAAE,IAAI,CAAEC,IAAI,CAAE,IAAK,CAAC,CAC7B,CAAED,OAAO,CAAE,QAAQ,CAAEC,IAAI,CAAE,QAAS,CAAC,CACrC,CAAED,OAAO,CAAE,QAAQ,CAAEC,IAAI,CAAE,QAAS,CAAC,CACtC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toKebabCase(str: string): string;
|
package/helpers/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["toKebabCase","str","replace","toLowerCase"],"sources":["../../src/helpers/index.ts"],"sourcesContent":["export function toKebabCase(str: string): string {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n"],"mappings":"AAAA,MAAO,SAAS,CAAAA,WAAWA,CAACC,GAAW,CAAU,CAC/C,MAAO,CAAAA,GAAG,CAACC,OAAO,CAAC,iBAAiB,CAAE,OAAO,CAAC,CAACC,WAAW,CAAC,CAC7D","ignoreList":[]}
|
package/index.d.ts
ADDED
package/index.js
ADDED
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","GrapejsCanvas"],"sources":["../src/index.ts"],"sourcesContent":["export { default as GrapejsCanvas } from './GrapesjsCanvas';\nexport * from './index.styles';\n"],"mappings":"AAAA,OAASA,OAAO,GAAI,CAAAC,aAAa,KAAQ,kBAAkB,CAC3D,WAAc,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledEditor: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
|
package/index.styles.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createGlobalStyle}from"styled-components";export var StyledEditor=createGlobalStyle([".gs-sidebar-left,.gs-sidebar-top,.gs-sidebar-right,.gjs-pn-panels,.gjs-pn-views,.gjs-off-prv,.gjs-pn-devices{display:none !important;}.gjs-cv-canvas{height:100% !important;width:100% !important;top:0 !important;}"]);
|
|
2
|
+
//# sourceMappingURL=index.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.styles.js","names":["createGlobalStyle","StyledEditor"],"sources":["../src/index.styles.ts"],"sourcesContent":["import { createGlobalStyle } from 'styled-components';\n\nexport const StyledEditor = createGlobalStyle`\n /* Hide GrapesJS panels */\n .gs-sidebar-left,\n .gs-sidebar-top,\n .gs-sidebar-right,\n .gjs-pn-panels,\n .gjs-pn-views,\n .gjs-off-prv,\n .gjs-pn-devices {\n display: none !important;\n }\n\n .gjs-cv-canvas {\n height: 100% !important;\n width: 100% !important;\n top: 0 !important;\n }\n`;\n"],"mappings":"AAAA,OAASA,iBAAiB,KAAQ,mBAAmB,CAErD,MAAO,IAAM,CAAAC,YAAY,CAAGD,iBAAiB,0NAiB5C","ignoreList":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@peak-ai/canvas",
|
|
3
|
+
"author": "squad-builder-experience",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"version": "1.0.0-rc.1",
|
|
6
|
+
"description": "",
|
|
7
|
+
"workspaces": [
|
|
8
|
+
"packages/*"
|
|
9
|
+
],
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@peak-ai/ais-components": "6.41.0",
|
|
12
|
+
"@radix-ui/react-checkbox": "^1.1.5",
|
|
13
|
+
"@radix-ui/react-hover-card": "^1.1.7",
|
|
14
|
+
"@radix-ui/react-label": "^2.1.3",
|
|
15
|
+
"@radix-ui/react-scroll-area": "^1.2.5",
|
|
16
|
+
"@radix-ui/react-separator": "^1.1.3",
|
|
17
|
+
"@radix-ui/react-slot": "^1.2.0",
|
|
18
|
+
"@radix-ui/react-tooltip": "^1.2.0",
|
|
19
|
+
"@tailwindcss/cli": "^4.1.3",
|
|
20
|
+
"@types/chroma-js": "^3.1.1",
|
|
21
|
+
"chroma-js": "^3.1.2",
|
|
22
|
+
"clsx": "^2.1.1",
|
|
23
|
+
"grapesjs": "0.22.6",
|
|
24
|
+
"grapesjs-tailwind": "1.0.7",
|
|
25
|
+
"lucide-react": "^0.487.0",
|
|
26
|
+
"plotly.js": "2.34.0",
|
|
27
|
+
"react": "^17.0.2",
|
|
28
|
+
"react-dom": "^17.0.2",
|
|
29
|
+
"react-plotly.js": "^2.6.0",
|
|
30
|
+
"react-resizable-panels": "^2.1.9",
|
|
31
|
+
"styled-components": "^5.0.0",
|
|
32
|
+
"tailwind-merge": "^3.2.0",
|
|
33
|
+
"tailwindcss": "^4.1.3",
|
|
34
|
+
"tslib": "^2.7.0",
|
|
35
|
+
"tw-animate-css": "^1.2.5"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"react": "^17.0.2",
|
|
39
|
+
"react-dom": "^17.0.2"
|
|
40
|
+
},
|
|
41
|
+
"resolutions": {
|
|
42
|
+
"@babel/traverse": "7.25.7",
|
|
43
|
+
"minimist": "1.2.6",
|
|
44
|
+
"tar": "^6.1.11"
|
|
45
|
+
},
|
|
46
|
+
"main": "index.js",
|
|
47
|
+
"types": "index.d.ts",
|
|
48
|
+
"module": "index.js",
|
|
49
|
+
"sideEffects": false
|
|
50
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";/* eslint-disable func-names *//* eslint-disable @typescript-eslint/no-explicit-any */import ReactDOM from"react-dom";import{getRenderers}from"./helpers/render-components";export function createGrapesjsShadcnGenericPlugin(mode){return function grapesjsShadcnGenericPlugin(editor){editor.DomComponents.addType("shadcn-generic",{model:{defaults:{tagName:"div",droppable:false,componentName:"Card",componentProps:{},traits:[]}},view:{events:{"input [data-slot]":"handleSlotInput"},handleSlotInput:function handleSlotInput(e){var _ref;var target=e.target;var slot=target.dataset.slot;var text=target.textContent||"";this.model.set("componentProps",_extends({},this.model.get("componentProps"),slot?(_ref={},_ref[slot]=text,_ref):{}))},render:function render(){var _this=this;var compName=this.model.get("componentName");var compProps=this.model.get("componentProps");if(typeof compProps==="string"){try{compProps=JSON.parse(compProps)}catch(err){// eslint-disable-next-line no-console
|
|
2
|
+
console.error("Invalid JSON in componentProps",err);compProps={}}}compProps.isEditable=mode==="editor";compProps.onChange=function(data){_this.model.set("componentProps",_extends({},_this.model.get("componentProps"),data))};var renderers=getRenderers();var renderer=renderers[compName];if(renderer){ReactDOM.render(renderer(compProps),this.el)}else{this.el.innerHTML="<div>Unsupported component: "+compName+"</div>"}return this},remove:function remove(){ReactDOM.unmountComponentAtNode(this.el);return this}}})}}
|
|
3
|
+
//# sourceMappingURL=grapejs-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grapejs-plugin.js","names":["ReactDOM","getRenderers","createGrapesjsShadcnGenericPlugin","mode","grapesjsShadcnGenericPlugin","editor","DomComponents","addType","model","defaults","tagName","droppable","componentName","componentProps","traits","view","events","handleSlotInput","e","_ref","target","slot","dataset","text","textContent","set","_extends","get","render","_this","compName","compProps","JSON","parse","err","console","error","isEditable","onChange","data","renderers","renderer","el","innerHTML","remove","unmountComponentAtNode"],"sources":["../../src/plugins/grapejs-plugin.tsx"],"sourcesContent":["/* eslint-disable func-names */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport ReactDOM from 'react-dom';\nimport { Editor } from 'grapesjs';\nimport { getRenderers } from './helpers/render-components';\n\nexport function createGrapesjsShadcnGenericPlugin(mode: 'editor' | 'preview') {\n return function grapesjsShadcnGenericPlugin(editor: Editor): void {\n editor.DomComponents.addType('shadcn-generic', {\n model: {\n defaults: {\n tagName: 'div',\n droppable: false,\n componentName: 'Card',\n componentProps: {},\n traits: [],\n },\n },\n view: {\n events: {\n 'input [data-slot]': 'handleSlotInput',\n } as any,\n handleSlotInput(e: Event) {\n const target = e.target as HTMLElement;\n const slot = target.dataset.slot;\n const text = target.textContent || '';\n this.model.set('componentProps', {\n ...this.model.get('componentProps'),\n ...(slot ? { [slot]: text } : {}),\n });\n },\n render: function () {\n const compName: string = this.model.get('componentName');\n let compProps: any = this.model.get('componentProps');\n\n if (typeof compProps === 'string') {\n try {\n compProps = JSON.parse(compProps);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Invalid JSON in componentProps', err);\n compProps = {};\n }\n }\n\n compProps.isEditable = mode === 'editor';\n\n compProps.onChange = (data: Record<string, string>) => {\n this.model.set('componentProps', {\n ...this.model.get('componentProps'),\n ...data,\n });\n };\n\n const renderers = getRenderers();\n const renderer = renderers[compName];\n\n if (renderer) {\n ReactDOM.render(renderer(compProps), this.el);\n } else {\n this.el.innerHTML = `<div>Unsupported component: ${compName}</div>`;\n }\n\n return this;\n },\n remove: function () {\n ReactDOM.unmountComponentAtNode(this.el);\n\n return this;\n },\n },\n });\n };\n}\n"],"mappings":"qDAAA,+BACA,uDACA,MAAO,CAAAA,QAAQ,KAAM,WAAW,CAEhC,OAASC,YAAY,KAAQ,6BAA6B,CAE1D,MAAO,SAAS,CAAAC,iCAAiCA,CAACC,IAA0B,CAAE,CAC5E,MAAO,SAAS,CAAAC,2BAA2BA,CAACC,MAAc,CAAQ,CAChEA,MAAM,CAACC,aAAa,CAACC,OAAO,CAAC,gBAAgB,CAAE,CAC7CC,KAAK,CAAE,CACLC,QAAQ,CAAE,CACRC,OAAO,CAAE,KAAK,CACdC,SAAS,CAAE,KAAK,C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AI,CAACrB,KAAK,CAACiB,GAAG,CAAC,gBAAgB,CAAAC,QAAA,IAC1BG,KAAI,CAACrB,KAAK,CAACmB,GAAG,CAAC,gBAAgB,CAAC,CAChCY,IAAI,CACR,CACH,CAAC,CAED,GAAM,CAAAC,SAAS,CAAGvC,YAAY,CAAC,CAAC,CAChC,GAAM,CAAAwC,QAAQ,CAAGD,SAAS,CAACV,QAAQ,CAAC,CAEpC,GAAIW,QAAQ,CAAE,CACZzC,QAAQ,CAAC4B,MAAM,CAACa,QAAQ,CAACV,SAAS,CAAC,CAAE,IAAI,CAACW,EAAE,CAC9C,CAAC,IAAM,CACL,IAAI,CAACA,EAAE,CAACC,SAAS,gCAAkCb,QAAQ,SAC7D,CAEA,MAAO,KACT,CAAC,CACDc,MAAM,CAAE,QAAR,CAAAA,MAAMA,CAAA,CAAc,CAClB5C,QAAQ,CAAC6C,sBAAsB,CAAC,IAAI,CAACH,EAAE,CAAC,CAExC,MAAO,KACT,CACF,CACF,CAAC,CACH,CACF","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
export declare function renderCard(props: any): JSX.Element;
|
|
3
|
+
export declare function renderChart(props: any): JSX.Element;
|
|
4
|
+
export declare function renderTable(props: any): JSX.Element;
|
|
5
|
+
export declare function renderCheckbox(props: any): JSX.Element;
|
|
6
|
+
export declare function renderHoverCard(props: any): JSX.Element;
|
|
7
|
+
export declare function renderInput(props: any): JSX.Element;
|
|
8
|
+
export declare function renderLabel(props: any): JSX.Element;
|
|
9
|
+
export declare function renderSeparator(props: any): JSX.Element;
|
|
10
|
+
export declare function renderTextarea(props: any): JSX.Element;
|
|
11
|
+
export declare function renderTooltip(props: any): JSX.Element;
|
|
12
|
+
export declare function getRenderers(): Record<string, (props: any) => JSX.Element>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["headerContent","headerDescription","bodyContent","footerContent","contentMetadata","className","isEditable"],_excluded2=["config","chartType","chartData","className","isEditable","title","subTitle"],_excluded3=["data","headerMapper","className","isEditable","title","subTitle"],_excluded4=["label","defaultChecked","className","isEditable"],_excluded5=["triggerContent","cardContent","className","isEditable"],_excluded6=["label","placeholder","value","className","isEditable"],_excluded7=["text","className","isEditable"],_excluded8=["className"],_excluded9=["label","placeholder","value","className","isEditable"],_excluded10=["triggerContent","tooltipContent","className","isEditable"];function _createForOfIteratorHelperLoose(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}/* eslint-disable func-names *//* eslint-disable @typescript-eslint/no-explicit-any */import chroma from"chroma-js";import{theme}from"@peak-ai/ais-components/theme";import{Card,CardHeader,CardTitle,CardDescription,CardContent,CardFooter}from"../../shadcn/components/ui/card";import{ChartContainer,ChartTooltip,ChartTooltipContent}from"../../shadcn/components/ui/chart";import{Checkbox}from"../../shadcn/components/ui/checkbox";import{HoverCard,HoverCardTrigger,HoverCardContent}from"../../shadcn/components/ui/hover-card";import{Input}from"../../shadcn/components/ui/input";import{Label}from"../../shadcn/components/ui/label";import{Separator}from"../../shadcn/components/ui/separator";import{Textarea}from"../../shadcn/components/ui/textarea";import{Tooltip,TooltipTrigger,TooltipContent}from"../../shadcn/components/ui/tooltip";import{PieChart,Pie,BarChart,Bar,LineChart,Line,XAxis,YAxis,ResponsiveContainer,CartesianGrid,Legend}from"recharts";import{Table,TableHeader,TableRow,TableHead,TableBody,TableCell}from"../../shadcn/components/ui/table";import{cn}from"../../shadcn/utils";import{ScrollArea,ScrollBar}from"../../shadcn/components/ui/scroll-area";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var baseColors=[[theme.colors.Blue_100,theme.colors.Blue_30],[theme.colors.Purpley_100,theme.colors.Purpley_30],[theme.colors.Light_Bluish_Green,"#06601b"],[theme.colors.Wild_Strawberry,"#4d001c"]];// const pallettes = [
|
|
2
|
+
// [
|
|
3
|
+
// [theme.colors.Blue_100, theme.colors.Blue_30],
|
|
4
|
+
// [theme.colors.Purpley_100, theme.colors.Purpley_30],
|
|
5
|
+
// ],
|
|
6
|
+
// [
|
|
7
|
+
// [theme.colors.Blue_100, theme.colors.Blue_30],
|
|
8
|
+
// [theme.colors.Light_Bluish_Green, '#06601b'],
|
|
9
|
+
// ],
|
|
10
|
+
// [
|
|
11
|
+
// [theme.colors.Wild_Strawberry, '#4d001c'],
|
|
12
|
+
// [theme.colors.Blue_100, theme.colors.Blue_30],
|
|
13
|
+
// [theme.colors.Navy_Blue, '#2a6bef'],
|
|
14
|
+
// ],
|
|
15
|
+
// [
|
|
16
|
+
// [theme.colors.Purpley_100, theme.colors.Purpley_30],
|
|
17
|
+
// [theme.colors.Wild_Strawberry, '#4d001c'],
|
|
18
|
+
// ],
|
|
19
|
+
// ];
|
|
20
|
+
function getNColors(n){var colors=[];// const pallette = pallettes[Math.floor(Math.random() * pallettes.length)];
|
|
21
|
+
for(var _iterator=_createForOfIteratorHelperLoose(baseColors),_step;!(_step=_iterator()).done;){var baseColor=_step.value;// eslint-disable-next-line import/no-named-as-default-member
|
|
22
|
+
colors.push(chroma.scale(baseColor).mode("lab").colors(n))}function getOneColor(existing){var color=null;do{var base=colors[Math.floor(Math.random()*colors.length)];var selectedColorIndex=Math.floor(Math.random()*base.length);color=base[selectedColorIndex]}while(existing.includes(color));return color}var selectedColors=[];for(var i=0;i<n;i++){selectedColors.push(getOneColor(selectedColors))}return selectedColors}export function renderCard(props){var _props$headerContent=props.headerContent,headerContent=_props$headerContent===void 0?"Default Card Title":_props$headerContent,_props$headerDescript=props.headerDescription,headerDescription=_props$headerDescript===void 0?"Default header description":_props$headerDescript,_props$bodyContent=props.bodyContent,bodyContent=_props$bodyContent===void 0?"Default body content. Click to edit.":_props$bodyContent,_props$footerContent=props.footerContent,footerContent=_props$footerContent===void 0?"":_props$footerContent,_props$contentMetadat=props.contentMetadata,contentMetadata=_props$contentMetadat===void 0?"":_props$contentMetadat,className=props.className,_props$isEditable=props.isEditable,isEditable=_props$isEditable===void 0?false:_props$isEditable,rest=_objectWithoutPropertiesLoose(props,_excluded);var defaultClasses="bg-white text-black p-4 rounded-lg shadow border w-80 max-w-[300px]";var mergedCardClassName=className?cn(defaultClasses,className):defaultClasses;return/*#__PURE__*/_jsxs(Card,_extends({},rest,{className:mergedCardClassName,children:[/*#__PURE__*/_jsxs(CardHeader,{children:[/*#__PURE__*/_jsx(CardTitle,{"data-slot":"headerContent",contentEditable:isEditable,className:"text-lg",children:headerContent}),/*#__PURE__*/_jsx(CardDescription,{"data-slot":"headerDescription",contentEditable:isEditable,className:"text-sm",children:headerDescription})]}),/*#__PURE__*/_jsxs(CardContent,{"data-slot":"bodyContent",contentEditable:false,children:[/*#__PURE__*/_jsx("div",{className:"text-4xl font-semibold truncate",children:bodyContent}),contentMetadata&&/*#__PURE__*/_jsx("div",{className:"text-xs",style:{color:"#2A44D4"},children:contentMetadata})]}),/*#__PURE__*/_jsx(CardFooter,{"data-slot":"footerContent",contentEditable:isEditable,className:"text-sm",children:footerContent})]}))}function renderChartComponent(chartType,data,config){switch(chartType){case"pie":return/*#__PURE__*/_jsxs(PieChart,{children:[data.length>=20&&/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{hideLabel:true})}),/*#__PURE__*/_jsx(Pie,{data:data,dataKey:config.dataKey,nameKey:config.nameKey,innerRadius:60,strokeWidth:10,label:data.length<20?function(_ref){var name=_ref.name,percent=_ref.percent;return name+": "+(percent*100).toFixed(0)+"%"}:undefined,labelLine:false})]});case"bar":config.dataKeys=config.dataKeys||[];return/*#__PURE__*/_jsxs(BarChart,_extends({data:data},config.chartUi,{children:[/*#__PURE__*/_jsx(CartesianGrid,{vertical:false}),/*#__PURE__*/_jsx(XAxis,{dataKey:config.xAxis}),/*#__PURE__*/_jsx(YAxis,{}),/*#__PURE__*/_jsx(Legend,{align:"left",wrapperStyle:{marginLeft:20}}),config.dataKeys.map(function(_ref2){var key=_ref2.key,name=_ref2.name,color=_ref2.color;return/*#__PURE__*/_jsx(Bar,{dataKey:key,fill:color!=null?color:"#4caf50",name:name,radius:2},key)}),/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{indicator:"dashed"})})]}));case"line":config.dataKeys=config.dataKeys||[];return/*#__PURE__*/_jsxs(LineChart,{data:data,children:[/*#__PURE__*/_jsx(CartesianGrid,{vertical:false}),/*#__PURE__*/_jsx(XAxis,{dataKey:config.xAxis}),/*#__PURE__*/_jsx(YAxis,{}),/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{indicator:"dashed"})}),config.dataKeys.map(function(_ref3){var key=_ref3.key,name=_ref3.name,color=_ref3.color;return/*#__PURE__*/_jsx(Line,{type:"monotone",dataKey:key,stroke:color!=null?color:"#4caf50",name:name},key)}),/*#__PURE__*/_jsx(Legend,{align:"left"})]});default:return/*#__PURE__*/_jsxs(PieChart,{children:[data.length>=20&&/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{hideLabel:true})}),/*#__PURE__*/_jsx(Pie,{data:data,dataKey:config.dataKey,nameKey:config.nameKey,innerRadius:60,strokeWidth:10,label:data.length<20?function(_ref4){var name=_ref4.name,percent=_ref4.percent;return name+": "+(percent*100).toFixed(0)+"%"}:undefined,labelLine:false})]})}}export function renderChart(props){var _props$config=props.config,config=_props$config===void 0?{}:_props$config,_props$chartType=props.chartType,chartType=_props$chartType===void 0?"pie":_props$chartType,_props$chartData=props.chartData,chartData=_props$chartData===void 0?[]:_props$chartData,className=props.className,_props$isEditable2=props.isEditable,isEditable=_props$isEditable2===void 0?false:_props$isEditable2,_props$title=props.title,title=_props$title===void 0?"Title":_props$title,_props$subTitle=props.subTitle,subTitle=_props$subTitle===void 0?"Subtitle":_props$subTitle,rest=_objectWithoutPropertiesLoose(props,_excluded2);var defaultClasses="aspect-auto h-[250px] w-full";var mergedClasses=className?cn(defaultClasses,className):defaultClasses;if(chartType==="pie"){var colors=getNColors(chartData.length);for(var i=0;i<chartData.length;i++){var data=chartData[i];if(!data.fill){data.fill=colors[i]}}}else if(!config.color){config.color=baseColors[Math.floor(Math.random()*baseColors.length)]}var width=undefined;if(chartType==="bar"){var totalDataPoints=chartData.length*config.dataKeys.length;config.chartUi={};if(totalDataPoints>15){width=totalDataPoints*15+config.dataKeys.length*3*chartData.length+chartData.length*10;config.chartUi={barSize:15,barGap:3,barCategoryGap:0.5,width:width}}}return/*#__PURE__*/_jsxs(Card,{className:"shadow border mt-2 mb-2",children:[/*#__PURE__*/_jsxs(CardHeader,{children:[/*#__PURE__*/_jsx(CardTitle,{"data-slot":"title",contentEditable:isEditable,className:"text-3xl",children:title}),/*#__PURE__*/_jsx(CardDescription,{"data-slot":"subTitle",contentEditable:isEditable,className:"text-sm",children:subTitle})]}),/*#__PURE__*/_jsx(CardContent,{"data-slot":"bodyContent",contentEditable:false,className:"px-6",children:chartType==="bar"&&config.chartUi?/*#__PURE__*/_jsx(ResponsiveContainer,{width:"95%",height:250,children:/*#__PURE__*/_jsxs(ScrollArea,{children:[/*#__PURE__*/_jsx("div",{className:width?"min-w-["+width+"px] w-full":"w-full",children:/*#__PURE__*/_jsx(ChartContainer,_extends({},rest,{config:config,className:mergedClasses,children:renderChartComponent(chartType,chartData,config)}))}),/*#__PURE__*/_jsx(ScrollBar,{orientation:"horizontal"})]})}):/*#__PURE__*/_jsx(ResponsiveContainer,{width:"95%",height:250,children:/*#__PURE__*/_jsx(ChartContainer,_extends({},rest,{config:config,className:mergedClasses,children:renderChartComponent(chartType,chartData,config)}))})})]})}export function renderTable(props){var _props$data=props.data,data=_props$data===void 0?[]:_props$data,_props$headerMapper=props.headerMapper,headerMapper=_props$headerMapper===void 0?{}:_props$headerMapper,className=props.className,_props$isEditable3=props.isEditable,isEditable=_props$isEditable3===void 0?false:_props$isEditable3,_props$title2=props.title,title=_props$title2===void 0?"Title":_props$title2,_props$subTitle2=props.subTitle,subTitle=_props$subTitle2===void 0?"Subtitle":_props$subTitle2,rest=_objectWithoutPropertiesLoose(props,_excluded3);var parsedData=data.map(function(datum){var newData=_extends({},datum);delete newData.id;return newData});var headers=Object.keys(parsedData[0]||{}).map(function(header){return headerMapper[header]||header});var rows=parsedData.map(function(datum){return Object.values(datum)});var defaultClasses="aspect-auto h-[250px] w-full";var mergedClasses=className?cn(defaultClasses,className):defaultClasses;var tableData=/*#__PURE__*/_jsxs(ScrollArea,{"data-slot":"table-container",className:mergedClasses,children:[/*#__PURE__*/_jsxs(Table,_extends({},rest,{className:"caption-bottom text-sm "+mergedClasses,"data-slot":"table",children:[/*#__PURE__*/_jsx(TableHeader,{"data-slot":"table-header",className:"sticky top-0",children:/*#__PURE__*/_jsx(TableRow,{children:headers.map(function(head,idx){return/*#__PURE__*/_jsx(TableHead,{"data-slot":"header-"+idx,contentEditable:false,children:head},idx)})})}),/*#__PURE__*/_jsx(TableBody,{"data-slot":"table-body",children:rows.map(function(row,rIdx){return/*#__PURE__*/_jsx(TableRow,{"data-slot":"row-"+rIdx,className:"hover:bg-muted/50 border-b transition-colors",children:row.map(function(cell,cIdx){return/*#__PURE__*/_jsx(TableCell,{"data-slot":"cell-"+rIdx+"-"+cIdx,className:"p-2 align-middle whitespace-nowrap",contentEditable:false,children:cell},cIdx)})},rIdx)})})]})),/*#__PURE__*/_jsx(ScrollBar,{orientation:"horizontal"})]});return/*#__PURE__*/_jsxs(Card,{className:"shadow border",children:[/*#__PURE__*/_jsxs(CardHeader,{children:[/*#__PURE__*/_jsx(CardTitle,{"data-slot":"title",contentEditable:isEditable,className:"text-3xl",children:title}),/*#__PURE__*/_jsx(CardDescription,{"data-slot":"subTitle",contentEditable:isEditable,className:"text-sm",children:subTitle})]}),/*#__PURE__*/_jsx(CardContent,{"data-slot":"bodyContent",contentEditable:isEditable,children:tableData})]})}export function renderCheckbox(props){var _props$label=props.label,label=_props$label===void 0?"":_props$label,_props$defaultChecked=props.defaultChecked,defaultChecked=_props$defaultChecked===void 0?false:_props$defaultChecked,className=props.className,_props$isEditable4=props.isEditable,isEditable=_props$isEditable4===void 0?false:_props$isEditable4,rest=_objectWithoutPropertiesLoose(props,_excluded4);var defaultClasses="flex items-center";var merged=className?cn(defaultClasses,className):defaultClasses;return/*#__PURE__*/_jsxs("div",_extends({className:merged},rest,{children:[/*#__PURE__*/_jsx(Checkbox,{defaultChecked:defaultChecked}),label&&/*#__PURE__*/_jsx(Label,{"data-slot":"label",contentEditable:isEditable,className:"ml-2",children:label})]}))}export function renderHoverCard(props){var _props$triggerContent=props.triggerContent,triggerContent=_props$triggerContent===void 0?"Hover over me":_props$triggerContent,_props$cardContent=props.cardContent,cardContent=_props$cardContent===void 0?"Additional information":_props$cardContent,className=props.className,_props$isEditable5=props.isEditable,isEditable=_props$isEditable5===void 0?false:_props$isEditable5,rest=_objectWithoutPropertiesLoose(props,_excluded5);var defaultClasses="w-[320px] max-w-[320px] shadow rounded-lg";var merged=className?cn(defaultClasses,className):defaultClasses;return/*#__PURE__*/_jsxs(HoverCard,_extends({className:merged},rest,{children:[/*#__PURE__*/_jsx(HoverCardTrigger,{asChild:true,children:/*#__PURE__*/_jsx("span",{"data-slot":"triggerContent",contentEditable:isEditable,children:triggerContent})}),/*#__PURE__*/_jsx(HoverCardContent,{children:/*#__PURE__*/_jsx("div",{"data-slot":"cardContent",contentEditable:isEditable,children:cardContent})})]}))}export function renderInput(props){var _props$label2=props.label,label=_props$label2===void 0?"":_props$label2,_props$placeholder=props.placeholder,placeholder=_props$placeholder===void 0?"":_props$placeholder,_props$value=props.value,value=_props$value===void 0?"":_props$value,className=props.className,_props$isEditable6=props.isEditable,isEditable=_props$isEditable6===void 0?false:_props$isEditable6,rest=_objectWithoutPropertiesLoose(props,_excluded6);var defaultClasses="w-[320px] p-2 border border-gray-300 rounded-md";var merged=className?cn(defaultClasses,className):defaultClasses;return/*#__PURE__*/_jsxs("div",_extends({className:"flex flex-col "+merged},rest,{children:[label&&/*#__PURE__*/_jsx(Label,{"data-slot":"label",contentEditable:isEditable,className:"mb-1",children:label}),/*#__PURE__*/_jsx(Input,{placeholder:placeholder,value:value})]}))}export function renderLabel(props){var _props$text=props.text,text=_props$text===void 0?"Label":_props$text,className=props.className,_props$isEditable7=props.isEditable,isEditable=_props$isEditable7===void 0?false:_props$isEditable7,rest=_objectWithoutPropertiesLoose(props,_excluded7);var defaultClasses="text-base font-semibold mb-2";var merged=className?cn(defaultClasses,className):defaultClasses;return/*#__PURE__*/_jsx(Label,_extends({"data-slot":"text",contentEditable:isEditable,className:merged},rest,{children:text}))}export function renderSeparator(props){var className=props.className,rest=_objectWithoutPropertiesLoose(props,_excluded8);var defaultClasses="my-4 border-t-2";var merged=className?cn(defaultClasses,className):defaultClasses;return/*#__PURE__*/_jsx(Separator,_extends({className:merged},rest))}export function renderTextarea(props){var _props$label3=props.label,label=_props$label3===void 0?"":_props$label3,_props$placeholder2=props.placeholder,placeholder=_props$placeholder2===void 0?"":_props$placeholder2,_props$value2=props.value,value=_props$value2===void 0?"":_props$value2,className=props.className,_props$isEditable8=props.isEditable,isEditable=_props$isEditable8===void 0?false:_props$isEditable8,rest=_objectWithoutPropertiesLoose(props,_excluded9);var defaultClasses="w-[320px] p-2 border border-gray-300 rounded-md";var merged=className?cn(defaultClasses,className):defaultClasses;return/*#__PURE__*/_jsxs("div",_extends({className:"flex flex-col "+merged},rest,{children:[label&&/*#__PURE__*/_jsx(Label,{"data-slot":"label",contentEditable:isEditable,className:"mb-1",children:label}),/*#__PURE__*/_jsx(Textarea,{placeholder:placeholder,value:value})]}))}export function renderTooltip(props){var _props$triggerContent2=props.triggerContent,triggerContent=_props$triggerContent2===void 0?"Hover here":_props$triggerContent2,_props$tooltipContent=props.tooltipContent,tooltipContent=_props$tooltipContent===void 0?"Tooltip information":_props$tooltipContent,className=props.className,_props$isEditable9=props.isEditable,isEditable=_props$isEditable9===void 0?false:_props$isEditable9,rest=_objectWithoutPropertiesLoose(props,_excluded10);var merged=className||"";return/*#__PURE__*/_jsxs(Tooltip,_extends({className:merged},rest,{children:[/*#__PURE__*/_jsx(TooltipTrigger,{asChild:true,children:/*#__PURE__*/_jsx("span",{"data-slot":"triggerContent",contentEditable:isEditable,children:triggerContent})}),/*#__PURE__*/_jsx(TooltipContent,{"data-slot":"tooltipContent",contentEditable:isEditable,children:tooltipContent})]}))}export function getRenderers(){return{Card:renderCard,Chart:renderChart,Table:renderTable,Checkbox:renderCheckbox,HoverCard:renderHoverCard,Input:renderInput,Label:renderLabel,Separator:renderSeparator,Textarea:renderTextarea,Tooltip:renderTooltip}}
|
|
23
|
+
//# sourceMappingURL=render-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-components.js","names":["chroma","theme","Card","CardHeader","CardTitle","CardDescription","CardContent","CardFooter","ChartContainer","ChartTooltip","ChartTooltipContent","Checkbox","HoverCard","HoverCardTrigger","HoverCardContent","Input","Label","Separator","Textarea","Tooltip","TooltipTrigger","TooltipContent","PieChart","Pie","BarChart","Bar","LineChart","Line","XAxis","YAxis","ResponsiveContainer","CartesianGrid","Legend","Table","TableHeader","TableRow","TableHead","TableBody","TableCell","cn","ScrollArea","ScrollBar","jsx","_jsx","jsxs","_jsxs","baseColors","colors","Blue_100","Blue_30","Purpley_100","Purpley_30","Light_Bluish_Green","Wild_Strawberry","getNColors","n","_iterator","_createForOfIteratorHelperLoose","_step","done","baseColor","value","push","scale","mode","getOneColor","existing","color","base","Math","floor","random","length","selectedColorIndex","includes","selectedColors","i","renderCard","props","_props$headerContent","headerContent","_props$headerDescript","headerDescription","_props$bodyContent","bodyContent","_props$footerContent","footerContent","_props$contentMetadat","contentMetadata","className","_props$isEditable","isEditable","rest","_objectWithoutPropertiesLoose","_excluded","defaultClasses","mergedCardClassName","_extends","children","contentEditable","style","renderChartComponent","chartType","data","config","cursor","content","hideLabel","dataKey","nameKey","innerRadius","strokeWidth","label","_ref","name","percent","toFixed","undefined","labelLine","dataKeys","chartUi","vertical","xAxis","align","wrapperStyle","marginLeft","map","_ref2","key","fill","radius","indicator","_ref3","type","stroke","_ref4","renderChart","_props$config","_props$chartType","_props$chartData","chartData","_props$isEditable2","_props$title","title","_props$subTitle","subTitle","_excluded2","mergedClasses","width","totalDataPoints","barSize","barGap","barCategoryGap","height","orientation","renderTable","_props$data","_props$headerMapper","headerMapper","_props$isEditable3","_props$title2","_props$subTitle2","_excluded3","parsedData","datum","newData","id","headers","Object","keys","header","rows","values","tableData","head","idx","row","rIdx","cell","cIdx","renderCheckbox","_props$label","_props$defaultChecked","defaultChecked","_props$isEditable4","_excluded4","merged","renderHoverCard","_props$triggerContent","triggerContent","_props$cardContent","cardContent","_props$isEditable5","_excluded5","asChild","renderInput","_props$label2","_props$placeholder","placeholder","_props$value","_props$isEditable6","_excluded6","renderLabel","_props$text","text","_props$isEditable7","_excluded7","renderSeparator","_excluded8","renderTextarea","_props$label3","_props$placeholder2","_props$value2","_props$isEditable8","_excluded9","renderTooltip","_props$triggerContent2","_props$tooltipContent","tooltipContent","_props$isEditable9","_excluded10","getRenderers","Chart"],"sources":["../../../src/plugins/helpers/render-components.tsx"],"sourcesContent":["/* eslint-disable func-names */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport chroma from 'chroma-js';\nimport { theme } from '@peak-ai/ais-components/theme';\n\nimport {\n Card,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n} from '../../shadcn/components/ui/card';\nimport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n} from '../../shadcn/components/ui/chart';\nimport { Checkbox } from '../../shadcn/components/ui/checkbox';\nimport {\n HoverCard,\n HoverCardTrigger,\n HoverCardContent,\n} from '../../shadcn/components/ui/hover-card';\nimport { Input } from '../../shadcn/components/ui/input';\nimport { Label } from '../../shadcn/components/ui/label';\nimport { Separator } from '../../shadcn/components/ui/separator';\nimport { Textarea } from '../../shadcn/components/ui/textarea';\nimport { Tooltip, TooltipTrigger, TooltipContent } from '../../shadcn/components/ui/tooltip';\nimport {\n PieChart,\n Pie,\n BarChart,\n Bar,\n LineChart,\n Line,\n XAxis,\n YAxis,\n ResponsiveContainer,\n CartesianGrid,\n Legend,\n} from 'recharts';\nimport {\n Table,\n TableHeader,\n TableRow,\n TableHead,\n TableBody,\n TableCell,\n} from '../../shadcn/components/ui/table';\nimport { cn } from '../../shadcn/utils';\nimport { ScrollArea, ScrollBar } from '../../shadcn/components/ui/scroll-area';\nimport { JSX } from 'react';\n\nconst baseColors = [\n [theme.colors.Blue_100, theme.colors.Blue_30],\n [theme.colors.Purpley_100, theme.colors.Purpley_30],\n [theme.colors.Light_Bluish_Green, '#06601b'],\n [theme.colors.Wild_Strawberry, '#4d001c'],\n];\n\n// const pallettes = [\n// [\n// [theme.colors.Blue_100, theme.colors.Blue_30],\n// [theme.colors.Purpley_100, theme.colors.Purpley_30],\n// ],\n// [\n// [theme.colors.Blue_100, theme.colors.Blue_30],\n// [theme.colors.Light_Bluish_Green, '#06601b'],\n// ],\n// [\n// [theme.colors.Wild_Strawberry, '#4d001c'],\n// [theme.colors.Blue_100, theme.colors.Blue_30],\n// [theme.colors.Navy_Blue, '#2a6bef'],\n// ],\n// [\n// [theme.colors.Purpley_100, theme.colors.Purpley_30],\n// [theme.colors.Wild_Strawberry, '#4d001c'],\n// ],\n// ];\n\nfunction getNColors(n: number) {\n const colors: Array<string[]> = [];\n // const pallette = pallettes[Math.floor(Math.random() * pallettes.length)];\n\n for (const baseColor of baseColors) {\n // eslint-disable-next-line import/no-named-as-default-member\n colors.push(chroma.scale(baseColor).mode('lab').colors(n));\n }\n\n function getOneColor(existing: Array<string>) {\n let color: null | string = null;\n\n do {\n const base = colors[Math.floor(Math.random() * colors.length)];\n const selectedColorIndex = Math.floor(Math.random() * base.length);\n color = base[selectedColorIndex];\n } while (existing.includes(color));\n\n return color as string;\n }\n\n const selectedColors: Array<string> = [];\n\n for (let i = 0; i < n; i++) {\n selectedColors.push(getOneColor(selectedColors));\n }\n\n return selectedColors;\n}\n\nexport function renderCard(props: any): JSX.Element {\n const {\n headerContent = 'Default Card Title',\n headerDescription = 'Default header description',\n bodyContent = 'Default body content. Click to edit.',\n footerContent = '',\n contentMetadata = '',\n className,\n isEditable = false,\n ...rest\n } = props;\n\n const defaultClasses = 'bg-white text-black p-4 rounded-lg shadow border w-80 max-w-[300px]';\n const mergedCardClassName = className ? cn(defaultClasses, className) : defaultClasses;\n\n return (\n <Card {...rest} className={mergedCardClassName}>\n <CardHeader>\n <CardTitle data-slot=\"headerContent\" contentEditable={isEditable} className=\"text-lg\">\n {headerContent}\n </CardTitle>\n <CardDescription\n data-slot=\"headerDescription\"\n contentEditable={isEditable}\n className=\"text-sm\"\n >\n {headerDescription}\n </CardDescription>\n </CardHeader>\n\n <CardContent data-slot=\"bodyContent\" contentEditable={false}>\n <div className=\"text-4xl font-semibold truncate\">{bodyContent}</div>\n {contentMetadata && (\n <div className=\"text-xs\" style={{ color: '#2A44D4' }}>\n {contentMetadata}\n </div>\n )}\n </CardContent>\n\n <CardFooter data-slot=\"footerContent\" contentEditable={isEditable} className=\"text-sm\">\n {footerContent}\n </CardFooter>\n </Card>\n );\n}\n\nfunction renderChartComponent(chartType: string, data: any, config: any): JSX.Element {\n switch (chartType) {\n case 'pie':\n return (\n <PieChart>\n {data.length >= 20 && (\n <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />\n )}\n <Pie\n data={data}\n dataKey={config.dataKey}\n nameKey={config.nameKey}\n innerRadius={60}\n strokeWidth={10}\n label={\n data.length < 20\n ? ({ name, percent }) => `${name}: ${(percent * 100).toFixed(0)}%`\n : undefined\n }\n labelLine={false}\n />\n </PieChart>\n );\n case 'bar':\n config.dataKeys = config.dataKeys || [];\n\n return (\n <BarChart data={data} {...config.chartUi}>\n <CartesianGrid vertical={false} />\n <XAxis dataKey={config.xAxis} />\n <YAxis />\n <Legend align=\"left\" wrapperStyle={{ marginLeft: 20 }} />\n {config.dataKeys.map(\n ({ key, name, color }: { key: string; name: string; color: string }) => {\n return (\n <Bar dataKey={key} fill={color ?? '#4caf50'} name={name} key={key} radius={2} />\n );\n },\n )}\n <ChartTooltip cursor={false} content={<ChartTooltipContent indicator=\"dashed\" />} />\n </BarChart>\n );\n case 'line':\n config.dataKeys = config.dataKeys || [];\n\n return (\n <LineChart data={data}>\n <CartesianGrid vertical={false} />\n <XAxis dataKey={config.xAxis} />\n <YAxis />\n <ChartTooltip cursor={false} content={<ChartTooltipContent indicator=\"dashed\" />} />\n {config.dataKeys.map(\n ({ key, name, color }: { key: string; name: string; color: string }) => {\n return (\n <Line\n type=\"monotone\"\n dataKey={key}\n stroke={color ?? '#4caf50'}\n name={name}\n key={key}\n />\n );\n },\n )}\n <Legend align=\"left\" />\n </LineChart>\n );\n default:\n return (\n <PieChart>\n {data.length >= 20 && (\n <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />\n )}\n <Pie\n data={data}\n dataKey={config.dataKey}\n nameKey={config.nameKey}\n innerRadius={60}\n strokeWidth={10}\n label={\n data.length < 20\n ? ({ name, percent }) => `${name}: ${(percent * 100).toFixed(0)}%`\n : undefined\n }\n labelLine={false}\n />\n </PieChart>\n );\n }\n}\n\nexport function renderChart(props: any): JSX.Element {\n const {\n config = {},\n chartType = 'pie',\n chartData = [],\n className,\n isEditable = false,\n title = 'Title',\n subTitle = 'Subtitle',\n ...rest\n } = props;\n\n const defaultClasses = 'aspect-auto h-[250px] w-full';\n const mergedClasses = className ? cn(defaultClasses, className) : defaultClasses;\n\n if (chartType === 'pie') {\n const colors = getNColors(chartData.length);\n\n for (let i = 0; i < chartData.length; i++) {\n const data = chartData[i];\n\n if (!data.fill) {\n data.fill = colors[i];\n }\n }\n } else if (!config.color) {\n config.color = baseColors[Math.floor(Math.random() * baseColors.length)];\n }\n\n let width: number | undefined = undefined;\n\n if (chartType === 'bar') {\n const totalDataPoints = chartData.length * config.dataKeys.length;\n config.chartUi = {};\n\n if (totalDataPoints > 15) {\n width =\n totalDataPoints * 15 +\n config.dataKeys.length * 3 * chartData.length +\n chartData.length * 10;\n config.chartUi = {\n barSize: 15,\n barGap: 3,\n barCategoryGap: 0.5,\n width,\n };\n }\n }\n\n return (\n <Card className=\"shadow border mt-2 mb-2\">\n <CardHeader>\n <CardTitle data-slot=\"title\" contentEditable={isEditable} className=\"text-3xl\">\n {title}\n </CardTitle>\n <CardDescription data-slot=\"subTitle\" contentEditable={isEditable} className=\"text-sm\">\n {subTitle}\n </CardDescription>\n </CardHeader>\n <CardContent data-slot=\"bodyContent\" contentEditable={false} className=\"px-6\">\n {chartType === 'bar' && config.chartUi ? (\n <ResponsiveContainer width=\"95%\" height={250}>\n <ScrollArea>\n <div className={width ? `min-w-[${width}px] w-full` : 'w-full'}>\n <ChartContainer {...rest} config={config} className={mergedClasses}>\n {renderChartComponent(chartType, chartData, config)}\n </ChartContainer>\n </div>\n <ScrollBar orientation=\"horizontal\" />\n </ScrollArea>\n </ResponsiveContainer>\n ) : (\n <ResponsiveContainer width=\"95%\" height={250}>\n <ChartContainer {...rest} config={config} className={mergedClasses}>\n {renderChartComponent(chartType, chartData, config)}\n </ChartContainer>\n </ResponsiveContainer>\n )}\n </CardContent>\n </Card>\n );\n}\n\nexport function renderTable(props: any): JSX.Element {\n const {\n data = [],\n headerMapper = {},\n className,\n isEditable = false,\n title = 'Title',\n subTitle = 'Subtitle',\n ...rest\n } = props;\n\n const parsedData = data.map((datum: any) => {\n const newData = {\n ...datum,\n };\n\n delete newData.id;\n\n return newData;\n });\n const headers = Object.keys(parsedData[0] || {}).map((header) => headerMapper[header] || header);\n const rows = parsedData.map((datum: ArrayLike<unknown> | { [s: string]: unknown }) =>\n Object.values(datum),\n );\n\n const defaultClasses = 'aspect-auto h-[250px] w-full';\n const mergedClasses = className ? cn(defaultClasses, className) : defaultClasses;\n\n const tableData = (\n <ScrollArea data-slot=\"table-container\" className={mergedClasses}>\n <Table {...rest} className={`caption-bottom text-sm ${mergedClasses}`} data-slot=\"table\">\n <TableHeader data-slot=\"table-header\" className=\"sticky top-0\">\n <TableRow>\n {headers.map((head: string, idx: number) => (\n <TableHead key={idx} data-slot={`header-${idx}`} contentEditable={false}>\n {head}\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody data-slot=\"table-body\">\n {rows.map((row: any[], rIdx: number) => (\n <TableRow\n key={rIdx}\n data-slot={`row-${rIdx}`}\n className=\"hover:bg-muted/50 border-b transition-colors\"\n >\n {row.map((cell: string, cIdx: number) => (\n <TableCell\n key={cIdx}\n data-slot={`cell-${rIdx}-${cIdx}`}\n className=\"p-2 align-middle whitespace-nowrap\"\n contentEditable={false}\n >\n {cell}\n </TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <ScrollBar orientation=\"horizontal\" />\n </ScrollArea>\n );\n\n return (\n <Card className=\"shadow border\">\n <CardHeader>\n <CardTitle data-slot=\"title\" contentEditable={isEditable} className=\"text-3xl\">\n {title}\n </CardTitle>\n <CardDescription data-slot=\"subTitle\" contentEditable={isEditable} className=\"text-sm\">\n {subTitle}\n </CardDescription>\n </CardHeader>\n <CardContent data-slot=\"bodyContent\" contentEditable={isEditable}>\n {tableData}\n </CardContent>\n </Card>\n );\n}\n\nexport function renderCheckbox(props: any): JSX.Element {\n const { label = '', defaultChecked = false, className, isEditable = false, ...rest } = props;\n const defaultClasses = 'flex items-center';\n const merged = className ? cn(defaultClasses, className) : defaultClasses;\n\n return (\n <div className={merged} {...rest}>\n <Checkbox defaultChecked={defaultChecked} />\n {label && (\n <Label data-slot=\"label\" contentEditable={isEditable} className=\"ml-2\">\n {label}\n </Label>\n )}\n </div>\n );\n}\n\nexport function renderHoverCard(props: any): JSX.Element {\n const {\n triggerContent = 'Hover over me',\n cardContent = 'Additional information',\n className,\n isEditable = false,\n ...rest\n } = props;\n const defaultClasses = 'w-[320px] max-w-[320px] shadow rounded-lg';\n const merged = className ? cn(defaultClasses, className) : defaultClasses;\n\n return (\n <HoverCard className={merged} {...rest}>\n <HoverCardTrigger asChild>\n <span data-slot=\"triggerContent\" contentEditable={isEditable}>\n {triggerContent}\n </span>\n </HoverCardTrigger>\n <HoverCardContent>\n <div data-slot=\"cardContent\" contentEditable={isEditable}>\n {cardContent}\n </div>\n </HoverCardContent>\n </HoverCard>\n );\n}\n\nexport function renderInput(props: any): JSX.Element {\n const {\n label = '',\n placeholder = '',\n value = '',\n className,\n isEditable = false,\n ...rest\n } = props;\n const defaultClasses = 'w-[320px] p-2 border border-gray-300 rounded-md';\n const merged = className ? cn(defaultClasses, className) : defaultClasses;\n\n return (\n <div className={`flex flex-col ${merged}`} {...rest}>\n {label && (\n <Label data-slot=\"label\" contentEditable={isEditable} className=\"mb-1\">\n {label}\n </Label>\n )}\n <Input placeholder={placeholder} value={value} />\n </div>\n );\n}\n\nexport function renderLabel(props: any): JSX.Element {\n const { text = 'Label', className, isEditable = false, ...rest } = props;\n const defaultClasses = 'text-base font-semibold mb-2';\n const merged = className ? cn(defaultClasses, className) : defaultClasses;\n\n return (\n <Label data-slot=\"text\" contentEditable={isEditable} className={merged} {...rest}>\n {text}\n </Label>\n );\n}\n\nexport function renderSeparator(props: any): JSX.Element {\n const { className, ...rest } = props;\n const defaultClasses = 'my-4 border-t-2';\n const merged = className ? cn(defaultClasses, className) : defaultClasses;\n\n return <Separator className={merged} {...rest} />;\n}\n\nexport function renderTextarea(props: any): JSX.Element {\n const {\n label = '',\n placeholder = '',\n value = '',\n className,\n isEditable = false,\n ...rest\n } = props;\n const defaultClasses = 'w-[320px] p-2 border border-gray-300 rounded-md';\n const merged = className ? cn(defaultClasses, className) : defaultClasses;\n\n return (\n <div className={`flex flex-col ${merged}`} {...rest}>\n {label && (\n <Label data-slot=\"label\" contentEditable={isEditable} className=\"mb-1\">\n {label}\n </Label>\n )}\n <Textarea placeholder={placeholder} value={value} />\n </div>\n );\n}\n\nexport function renderTooltip(props: any): JSX.Element {\n const {\n triggerContent = 'Hover here',\n tooltipContent = 'Tooltip information',\n className,\n isEditable = false,\n ...rest\n } = props;\n const merged = className || '';\n\n return (\n <Tooltip className={merged} {...rest}>\n <TooltipTrigger asChild>\n <span data-slot=\"triggerContent\" contentEditable={isEditable}>\n {triggerContent}\n </span>\n </TooltipTrigger>\n <TooltipContent data-slot=\"tooltipContent\" contentEditable={isEditable}>\n {tooltipContent}\n </TooltipContent>\n </Tooltip>\n );\n}\n\nexport function getRenderers(): Record<string, (props: any) => JSX.Element> {\n return {\n Card: renderCard,\n Chart: renderChart,\n Table: renderTable,\n Checkbox: renderCheckbox,\n HoverCard: renderHoverCard,\n Input: renderInput,\n Label: renderLabel,\n Separator: renderSeparator,\n Textarea: renderTextarea,\n Tooltip: renderTooltip,\n };\n}\n"],"mappings":"8vDAAA,+BACA,uDACA,MAAO,CAAAA,MAAM,KAAM,WAAW,CAC9B,OAASC,KAAK,KAAQ,+BAA+B,CAErD,OACEC,IAAI,CACJC,UAAU,CACVC,SAAS,CACTC,eAAe,CACfC,WAAW,CACXC,UAAU,KACL,iCAAiC,CACxC,OACEC,cAAc,CACdC,YAAY,CAC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,MAAAhG,QAAA,cACrBvD,IAAA,SAAM,YAAU,gBAAgB,CAACwD,eAAe,CAAER,UAAW,CAAAO,QAAA,CAC1D2F,cAAc,CACX,CAAC,CACO,CAAC,cACjBlJ,IAAA,CAACtB,cAAc,EAAC,YAAU,gBAAgB,CAAC8E,eAAe,CAAER,UAAW,CAAAO,QAAA,CACpEwH,cAAc,CACD,CAAC,GACV,CAEb,CAEA,MAAO,SAAS,CAAAG,YAAYA,CAAA,CAAgD,CAC1E,MAAO,CACL3N,IAAI,CAAE2E,UAAU,CAChBiJ,KAAK,CAAEtF,WAAW,CAClBvG,KAAK,CAAE0H,WAAW,CAClBhJ,QAAQ,CAAEyK,cAAc,CACxBxK,SAAS,CAAE+K,eAAe,CAC1B5K,KAAK,CAAEoL,WAAW,CAClBnL,KAAK,CAAE0L,WAAW,CAClBzL,SAAS,CAAE8L,eAAe,CAC1B7L,QAAQ,CAAE+L,cAAc,CACxB9L,OAAO,CAAEoM,aACX,CACF","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type CardProps = React.ComponentProps<'div'> & {
|
|
3
|
+
isEditable?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare function Card({ className, isEditable, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function CardHeader({ className, isEditable, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function CardTitle({ className, isEditable, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function CardDescription({ className, isEditable, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function CardAction({ className, isEditable, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function CardContent({ className, isEditable, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function CardFooter({ className, isEditable, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["className","isEditable"],_excluded2=["className","isEditable"],_excluded3=["className","isEditable"],_excluded4=["className","isEditable"],_excluded5=["className","isEditable"],_excluded6=["className","isEditable"],_excluded7=["className","isEditable"];import*as React from"react";import{cn}from"../../utils";import{jsx as _jsx}from"react/jsx-runtime";function Card(_ref){var className=_ref.className,isEditable=_ref.isEditable,props=_objectWithoutPropertiesLoose(_ref,_excluded);return/*#__PURE__*/_jsx("div",_extends({"data-slot":"card",className:cn("bg-white text-card-foreground flex flex-col gap-6 rounded-lg border py-6 shadow-sm p-6",className),contentEditable:isEditable},props))}function CardHeader(_ref2){var className=_ref2.className,isEditable=_ref2.isEditable,props=_objectWithoutPropertiesLoose(_ref2,_excluded2);return/*#__PURE__*/_jsx("div",_extends({"data-slot":"card-header",className:cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",className),contentEditable:isEditable},props))}function CardTitle(_ref3){var className=_ref3.className,isEditable=_ref3.isEditable,props=_objectWithoutPropertiesLoose(_ref3,_excluded3);return/*#__PURE__*/_jsx("div",_extends({"data-slot":"card-title",className:cn("leading-none font-semibold",className),contentEditable:isEditable},props))}function CardDescription(_ref4){var className=_ref4.className,isEditable=_ref4.isEditable,props=_objectWithoutPropertiesLoose(_ref4,_excluded4);return/*#__PURE__*/_jsx("div",_extends({"data-slot":"card-description",className:cn("text-muted-foreground text-sm text-gray-500",className),contentEditable:isEditable},props))}function CardAction(_ref5){var className=_ref5.className,isEditable=_ref5.isEditable,props=_objectWithoutPropertiesLoose(_ref5,_excluded5);return/*#__PURE__*/_jsx("div",_extends({"data-slot":"card-action",className:cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end",className),contentEditable:isEditable},props))}function CardContent(_ref6){var className=_ref6.className,isEditable=_ref6.isEditable,props=_objectWithoutPropertiesLoose(_ref6,_excluded6);return/*#__PURE__*/_jsx("div",_extends({"data-slot":"card-content",className:cn("px-6",className),contentEditable:isEditable},props))}function CardFooter(_ref7){var className=_ref7.className,isEditable=_ref7.isEditable,props=_objectWithoutPropertiesLoose(_ref7,_excluded7);return/*#__PURE__*/_jsx("div",_extends({"data-slot":"card-footer",className:cn("flex items-center px-6 [.border-t]:pt-6 text-gray-500",className),contentEditable:isEditable},props))}export{Card,CardHeader,CardFooter,CardTitle,CardAction,CardDescription,CardContent};
|
|
2
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","names":["React","cn","jsx","_jsx","Card","_ref","className","isEditable","props","_objectWithoutPropertiesLoose","_excluded","_extends","contentEditable","CardHeader","_ref2","_excluded2","CardTitle","_ref3","_excluded3","CardDescription","_ref4","_excluded4","CardAction","_ref5","_excluded5","CardContent","_ref6","_excluded6","CardFooter","_ref7","_excluded7"],"sources":["../../../../src/shadcn/components/ui/card.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../../utils';\n\ntype CardProps = React.ComponentProps<'div'> & {\n isEditable?: boolean;\n};\n\nfunction Card({ className, isEditable, ...props }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n 'bg-white text-card-foreground flex flex-col gap-6 rounded-lg border py-6 shadow-sm p-6',\n className,\n )}\n contentEditable={isEditable}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, isEditable, ...props }: CardProps) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',\n className,\n )}\n contentEditable={isEditable}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, isEditable, ...props }: CardProps) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('leading-none font-semibold', className)}\n contentEditable={isEditable}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, isEditable, ...props }: CardProps) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn('text-muted-foreground text-sm text-gray-500', className)}\n contentEditable={isEditable}\n {...props}\n />\n );\n}\n\nfunction CardAction({ className, isEditable, ...props }: CardProps) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n contentEditable={isEditable}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, isEditable, ...props }: CardProps) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn('px-6', className)}\n contentEditable={isEditable}\n {...props}\n />\n );\n}\n\nfunction CardFooter({ className, isEditable, ...props }: CardProps) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('flex items-center px-6 [.border-t]:pt-6 text-gray-500', className)}\n contentEditable={isEditable}\n {...props}\n />\n );\n}\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };\n"],"mappings":"iaAAA,MAAO,GAAK,CAAAA,KAAK,KAAM,OAAO,CAE9B,OAASC,EAAE,KAAQ,aAAa,CAAC,OAAAC,GAAA,IAAAC,IAAA,yBAMjC,QAAS,CAAAC,IAAIA,CAAAC,IAAA,CAAiD,IAA9C,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CAAEC,UAAU,CAAAF,IAAA,CAAVE,UAAU,CAAKC,KAAK,CAAAC,6BAAA,CAAAJ,IAAA,CAAAK,SAAA,EAC7C,mBACEP,IAAA,OAAAQ,QAAA,EACE,YAAU,MAAM,CAChBL,SAAS,CAAEL,EAAE,CACX,wFAAwF,CACxFK,SACF,CAAE,CACFM,eAAe,CAAEL,UAAW,EACxBC,KAAK,CACV,CAEL,CAEA,QAAS,CAAAK,UAAUA,CAAAC,KAAA,CAAiD,IAA9C,CAAAR,SAAS,CA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S,CAAEL,EAAE,CAAC,gEAAgE,CAAEK,SAAS,CAAE,CAC3FM,eAAe,CAAEL,UAAW,EACxBC,KAAK,CACV,CAEL,CAEA,QAAS,CAAAiB,WAAWA,CAAAC,KAAA,CAAiD,IAA9C,CAAApB,SAAS,CAAAoB,KAAA,CAATpB,SAAS,CAAEC,UAAU,CAAAmB,KAAA,CAAVnB,UAAU,CAAKC,KAAK,CAAAC,6BAAA,CAAAiB,KAAA,CAAAC,UAAA,EACpD,mBACExB,IAAA,OAAAQ,QAAA,EACE,YAAU,cAAc,CACxBL,SAAS,CAAEL,EAAE,CAAC,MAAM,CAAEK,SAAS,CAAE,CACjCM,eAAe,CAAEL,UAAW,EACxBC,KAAK,CACV,CAEL,CAEA,QAAS,CAAAoB,UAAUA,CAAAC,KAAA,CAAiD,IAA9C,CAAAvB,SAAS,CAAAuB,KAAA,CAATvB,SAAS,CAAEC,UAAU,CAAAsB,KAAA,CAAVtB,UAAU,CAAKC,KAAK,CAAAC,6BAAA,CAAAoB,KAAA,CAAAC,UAAA,EACnD,mBACE3B,IAAA,OAAAQ,QAAA,EACE,YAAU,aAAa,CACvBL,SAAS,CAAEL,EAAE,CAAC,uDAAuD,CAAEK,SAAS,CAAE,CAClFM,eAAe,CAAEL,UAAW,EACxBC,KAAK,CACV,CAEL,CAEA,OAASJ,IAAI,CAAES,UAAU,CAAEe,UAAU,CAAEZ,SAAS,CAAEM,UAAU,CAAEH,eAAe,CAAEM,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RechartsPrimitive from 'recharts';
|
|
3
|
+
declare const THEMES: {
|
|
4
|
+
readonly light: "";
|
|
5
|
+
readonly dark: ".dark";
|
|
6
|
+
};
|
|
7
|
+
export type ChartConfig = {
|
|
8
|
+
[k in string]: {
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
icon?: React.ComponentType;
|
|
11
|
+
} & ({
|
|
12
|
+
color?: string;
|
|
13
|
+
theme?: never;
|
|
14
|
+
} | {
|
|
15
|
+
color?: never;
|
|
16
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
declare function ChartContainer({ id, className, children, config, isEditable, ...props }: React.ComponentProps<'div'> & {
|
|
20
|
+
config: ChartConfig;
|
|
21
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
|
|
22
|
+
isEditable?: boolean;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function ChartStyle({ id, config }: {
|
|
25
|
+
id: string;
|
|
26
|
+
config: ChartConfig;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
28
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
29
|
+
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<'div'> & {
|
|
30
|
+
hideLabel?: boolean;
|
|
31
|
+
hideIndicator?: boolean;
|
|
32
|
+
indicator?: 'line' | 'dot' | 'dashed';
|
|
33
|
+
nameKey?: string;
|
|
34
|
+
labelKey?: string;
|
|
35
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
36
|
+
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
37
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<'div'> & Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {
|
|
38
|
+
hideIcon?: boolean;
|
|
39
|
+
nameKey?: string;
|
|
40
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
41
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["id","className","children","config","isEditable"];import*as React from"react";import*as RechartsPrimitive from"recharts";import{cn}from"../../utils";// Format: { THEME_NAME: CSS_SELECTOR }
|
|
2
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var THEMES={light:"",dark:".dark"};var ChartContext=/*#__PURE__*/React.createContext(null);function useChart(){var context=React.useContext(ChartContext);if(!context){throw new Error("useChart must be used within a <ChartContainer />")}return context}function ChartContainer(_ref){var id=_ref.id,className=_ref.className,children=_ref.children,config=_ref.config,isEditable=_ref.isEditable,props=_objectWithoutPropertiesLoose(_ref,_excluded);var uniqueId=id||"id-"+Math.random().toString(36).substring(2,9);var chartId="chart-"+uniqueId;return/*#__PURE__*/_jsx(ChartContext.Provider,{value:{config:config},children:/*#__PURE__*/_jsxs("div",_extends({"data-slot":"chart","data-chart":chartId,className:cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",className),contentEditable:isEditable},props,{children:[/*#__PURE__*/_jsx(ChartStyle,{id:chartId,config:config}),/*#__PURE__*/_jsx(RechartsPrimitive.ResponsiveContainer,{children:children})]}))})}function ChartStyle(_ref2){var id=_ref2.id,config=_ref2.config;var colorConfig=Object.entries(config).filter(function(_ref3){var conf=_ref3[1];return conf.theme||conf.color});if(!colorConfig.length){return null}return/*#__PURE__*/_jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(THEMES).map(function(_ref4){var theme=_ref4[0],prefix=_ref4[1];return"\n"+prefix+" [data-chart="+id+"] {\n"+colorConfig.map(function(_ref5){var _itemConfig$theme;var key=_ref5[0],itemConfig=_ref5[1];var color=((_itemConfig$theme=itemConfig.theme)==null?void 0:_itemConfig$theme[theme])||itemConfig.color;return color?" --color-"+key+": "+color+";":null}).join("\n")+"\n}\n"}).join("\n")}})}var ChartTooltip=RechartsPrimitive.Tooltip;function ChartTooltipContent(_ref6){var active=_ref6.active,payload=_ref6.payload,className=_ref6.className,_ref6$indicator=_ref6.indicator,indicator=_ref6$indicator===void 0?"dot":_ref6$indicator,_ref6$hideLabel=_ref6.hideLabel,hideLabel=_ref6$hideLabel===void 0?false:_ref6$hideLabel,_ref6$hideIndicator=_ref6.hideIndicator,hideIndicator=_ref6$hideIndicator===void 0?false:_ref6$hideIndicator,label=_ref6.label,labelFormatter=_ref6.labelFormatter,labelClassName=_ref6.labelClassName,formatter=_ref6.formatter,color=_ref6.color,nameKey=_ref6.nameKey,labelKey=_ref6.labelKey;var _useChart=useChart(),config=_useChart.config;var tooltipLabel=React.useMemo(function(){var _config;if(hideLabel||!(payload!=null&&payload.length)){return null}var item=payload[0];var key=""+(labelKey||(item==null?void 0:item.dataKey)||(item==null?void 0:item.name)||"value");var itemConfig=getPayloadConfigFromPayload(config,item,key);var value=!labelKey&&typeof label==="string"?((_config=config[label])==null?void 0:_config.label)||label:itemConfig==null?void 0:itemConfig.label;if(labelFormatter){return/*#__PURE__*/_jsx("div",{className:cn("font-medium",labelClassName),children:labelFormatter(value,payload)})}if(!value){return null}return/*#__PURE__*/_jsx("div",{className:cn("font-medium",labelClassName),children:value})},[label,labelFormatter,payload,hideLabel,labelClassName,config,labelKey]);if(!active||!(payload!=null&&payload.length)){return null}var nestLabel=payload.length===1&&indicator!=="dot";return/*#__PURE__*/_jsxs("div",{className:cn("border-border/50 bg-white grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",className),children:[!nestLabel?tooltipLabel:null,/*#__PURE__*/_jsx("div",{className:"grid gap-1.5",children:payload.map(function(item,index){var key=""+(nameKey||item.name||item.dataKey||"value");var itemConfig=getPayloadConfigFromPayload(config,item,key);var indicatorColor=color||item.payload.fill||item.color;return/*#__PURE__*/_jsx("div",{className:cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",indicator==="dot"&&"items-center"),children:formatter&&(item==null?void 0:item.value)!==undefined&&item.name?formatter(item.value,item.name,item,index,item.payload):/*#__PURE__*/_jsxs(React.Fragment,{children:[itemConfig!=null&&itemConfig.icon?/*#__PURE__*/_jsx(itemConfig.icon,{}):!hideIndicator&&/*#__PURE__*/_jsx("div",{className:cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",{"h-2.5 w-2.5":indicator==="dot","w-1":indicator==="line","w-0 border-[1.5px] border-dashed bg-transparent":indicator==="dashed","my-0.5":nestLabel&&indicator==="dashed"}),style:{"--color-bg":indicatorColor,"--color-border":indicatorColor}}),/*#__PURE__*/_jsxs("div",{className:cn("flex flex-1 justify-between leading-none",nestLabel?"items-end":"items-center"),children:[/*#__PURE__*/_jsxs("div",{className:"grid gap-1.5",children:[nestLabel?tooltipLabel:null,/*#__PURE__*/_jsx("span",{className:"text-muted-foreground",children:(itemConfig==null?void 0:itemConfig.label)||item.name})]}),item.value&&/*#__PURE__*/_jsx("span",{className:"text-foreground font-mono font-medium tabular-nums",children:item.value.toLocaleString()})]})]})},item.dataKey+"-"+index)})})]})}var ChartLegend=RechartsPrimitive.Legend;function ChartLegendContent(_ref7){var className=_ref7.className,_ref7$hideIcon=_ref7.hideIcon,hideIcon=_ref7$hideIcon===void 0?false:_ref7$hideIcon,payload=_ref7.payload,_ref7$verticalAlign=_ref7.verticalAlign,verticalAlign=_ref7$verticalAlign===void 0?"bottom":_ref7$verticalAlign,nameKey=_ref7.nameKey;var _useChart2=useChart(),config=_useChart2.config;if(!(payload!=null&&payload.length)){return null}return/*#__PURE__*/_jsx("div",{className:cn("flex items-center justify-center gap-4",verticalAlign==="top"?"pb-3":"pt-3",className),children:payload.map(function(item,index){var key=""+(nameKey||"value");var itemConfig=getPayloadConfigFromPayload(config,item,key);return/*#__PURE__*/_jsxs("div",{className:cn("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),children:[itemConfig!=null&&itemConfig.icon&&!hideIcon?/*#__PURE__*/_jsx(itemConfig.icon,{}):/*#__PURE__*/_jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:item.color}}),itemConfig==null?void 0:itemConfig.label]},item.value+"-"+index)})})}// Helper to extract item config from a payload.
|
|
3
|
+
function getPayloadConfigFromPayload(config,payload,key){if(typeof payload!=="object"||payload===null){return undefined}var payloadPayload="payload"in payload&&typeof payload.payload==="object"&&payload.payload!==null?payload.payload:undefined;var configLabelKey=key;if(key in payload&&typeof payload[key]==="string"){configLabelKey=payload[key]}else if(payloadPayload&&key in payloadPayload&&typeof payloadPayload[key]==="string"){configLabelKey=payloadPayload[key]}return configLabelKey in config?config[configLabelKey]:config[key]}export{ChartContainer,ChartTooltip,ChartTooltipContent,ChartLegend,ChartLegendContent,ChartStyle};
|
|
4
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","names":["React","RechartsPrimitive","cn","jsx","_jsx","jsxs","_jsxs","THEMES","light","dark","ChartContext","createContext","useChart","context","useContext","Error","ChartContainer","_ref","id","className","children","config","isEditable","props","_objectWithoutPropertiesLoose","_excluded","uniqueId","Math","random","toString","substring","chartId","Provider","value","_extends","contentEditable","ChartStyle","ResponsiveContainer","_ref2","colorConfig","Object","entries","filter","_ref3","conf","theme","color","length","dangerouslySetInnerHTML","__html","map","_ref4","prefix","_ref5","_itemConfig$theme","key","itemConfig","join","ChartTooltip","Tooltip","ChartTooltipContent","_ref6","active","payload","_ref6$indicator","indicator","_ref6$hideLabel","hideLabel","_ref6$hideIndicator","hideIndicator","label","labelFormatter","labelClassName","formatter","nameKey","labelKey","_useChart","tooltipLabel","useMemo","_config","item","dataKey","name","getPayloadConfigFromPayload","nestLabel","index","indicatorColor","fill","undefined","Fragment","icon","style","toLocaleString","ChartLegend","Legend","ChartLegendContent","_ref7","_ref7$hideIcon","hideIcon","_ref7$verticalAlign","verticalAlign","_useChart2","backgroundColor","payloadPayload","configLabelKey"],"sources":["../../../../src/shadcn/components/ui/chart.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { cn } from '../../utils';\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: '', dark: '.dark' } as const;\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & (\n | { color?: string; theme?: never }\n | { color?: never; theme: Record<keyof typeof THEMES, string> }\n );\n};\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n isEditable,\n ...props\n}: React.ComponentProps<'div'> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n isEditable?: boolean;\n}) {\n const uniqueId = id || `id-${Math.random().toString(36).substring(2, 9)}`;\n const chartId = `chart-${uniqueId}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className,\n )}\n contentEditable={isEditable}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nfunction ChartStyle({ id, config }: { id: string; config: ChartConfig }) {\n const colorConfig = Object.entries(config).filter(([, conf]) => conf.theme || conf.color);\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color;\n\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n}\n`,\n )\n .join('\\n'),\n }}\n />\n );\n}\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n }) {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value =\n !labelKey && typeof label === 'string'\n ? config[label as keyof typeof config]?.label || label\n : itemConfig?.label;\n\n if (labelFormatter) {\n return (\n <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>\n );\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n className={cn(\n 'border-border/50 bg-white grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || item.payload.fill || item.color;\n\n return (\n <div\n key={`${item.dataKey}-${index}`}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <React.Fragment>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\n 'shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)',\n {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent':\n indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n },\n )}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">\n {itemConfig?.label || item.name}\n </span>\n </div>\n {item.value && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </React.Fragment>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey,\n}: React.ComponentProps<'div'> &\n Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {\n hideIcon?: boolean;\n nameKey?: string;\n }) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n className={cn(\n 'flex items-center justify-center gap-4',\n verticalAlign === 'top' ? 'pb-3' : 'pt-3',\n className,\n )}\n >\n {payload.map((item, index) => {\n const key = `${nameKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={`${item.value}-${index}`}\n className={cn(\n '[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3',\n )}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\n// Helper to extract item config from a payload.\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string;\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config];\n}\n\nexport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n};\n"],"mappings":"sNAAA,MAAO,GAAK,CAAAA,KAAK,KAAM,OAAO,CAC9B,MAAO,GAAK,CAAAC,iBAAiB,KAAM,UAAU,CAE7C,OAASC,EAAE,KAAQ,aAAa,CAEhC;AAAA,OAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBACA,GAAM,CAAAC,MAAM,CAAG,CAAEC,KAAK,CAAE,EAAE,CAAEC,IAAI,CAAE,OAAQ,CAAU,CAgBpD,GAAM,CAAAC,YAAY,cAAGV,KAAK,CAACW,aAAa,CAA2B,IAAI,CAAC,CAExE,QAAS,CAAAC,QAAQA,CAAA,CAAG,CAClB,GAAM,CAAAC,OAAO,CAAGb,KAAK,CAACc,UAAU,CAACJ,YAAY,CAAC,CAE9C,GAAI,CAACG,OAAO,CAAE,CACZ,KAAM,IAAI,CAAAE,KAAK,CAAC,mDAAmD,CACrE,CAEA,MAAO,CAAAF,OACT,CAEA,QAAS,CAAAG,cAAcA,CAAAC,IAAA,CAWpB,IAVD,CAAAC,EAAE,CAAAD,IAAA,CAAFC,EAAE,CACFC,SAAS,CAAAF,IAAA,CAATE,SAAS,CACTC,QAAQ,CAAAH,IAAA,CAARG,QAAQ,CACRC,MAAM,CAAAJ,IAAA,CAANI,MAAM,CACNC,UAAU,CAAAL,IAAA,CAAVK,UAAU,CACPC,KAAK,CAAAC,6BAAA,CAAAP,IAAA,CAAAQ,SAAA,EAMR,GAAM,CAAAC,QAAQ,CAAGR,EAAE,QAAUS,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE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D,MAAO,CAAAyB,SACT,CAEA,GAAM,CAAAe,cAAc,CAClB,SAAS,EAAI,CAAAxC,OAAO,EAAI,MAAO,CAAAA,OAAO,CAACA,OAAO,GAAK,QAAQ,EAAIA,OAAO,CAACA,OAAO,GAAK,IAAI,CACnFA,OAAO,CAACA,OAAO,CACfyB,SAAS,CAEf,GAAI,CAAAgB,cAAsB,CAAGjD,GAAG,CAEhC,GAAIA,GAAG,GAAI,CAAAQ,OAAO,EAAI,MAAO,CAAAA,OAAO,CAACR,GAAG,CAAyB,GAAK,QAAQ,CAAE,CAC9EiD,cAAc,CAAGzC,OAAO,CAACR,GAAG,CAC9B,CAAC,IAAM,IACLgD,cAAc,EACdhD,GAAG,GAAI,CAAAgD,cAAc,EACrB,MAAO,CAAAA,cAAc,CAAChD,GAAG,CAAgC,GAAK,QAAQ,CACtE,CACAiD,cAAc,CAAGD,cAAc,CAAChD,GAAG,CACrC,CAEA,MAAO,CAAAiD,cAAc,GAAI,CAAAnF,MAAM,CAAGA,MAAM,CAACmF,cAAc,CAAC,CAAGnF,MAAM,CAACkC,GAAG,CACvE,CAEA,OACEvC,cAAc,CACd0C,YAAY,CACZE,mBAAmB,CACnBiC,WAAW,CACXE,kBAAkB,CAClB3D,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["className"];import*as React from"react";import*as CheckboxPrimitive from"@radix-ui/react-checkbox";import{CheckIcon}from"lucide-react";import{cn}from"../../utils";import{jsx as _jsx}from"react/jsx-runtime";function Checkbox(_ref){var className=_ref.className,props=_objectWithoutPropertiesLoose(_ref,_excluded);return/*#__PURE__*/_jsx(CheckboxPrimitive.Root,_extends({"data-slot":"checkbox",className:cn("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",className)},props,{children:/*#__PURE__*/_jsx(CheckboxPrimitive.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:/*#__PURE__*/_jsx(CheckIcon,{className:"size-3.5"})})}))}export{Checkbox};
|
|
2
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["React","CheckboxPrimitive","CheckIcon","cn","jsx","_jsx","Checkbox","_ref","className","props","_objectWithoutPropertiesLoose","_excluded","Root","_extends","children","Indicator"],"sources":["../../../../src/shadcn/components/ui/checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { CheckIcon } from 'lucide-react';\n\nimport { cn } from '../../utils';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"mappings":"gLAAA,MAAO,GAAK,CAAAA,KAAK,KAAM,OAAO,CAC9B,MAAO,GAAK,CAAAC,iBAAiB,KAAM,0BAA0B,CAC7D,OAASC,SAAS,KAAQ,cAAc,CAExC,OAASC,EAAE,KAAQ,aAAa,CAAC,OAAAC,GAAA,IAAAC,IAAA,yBAEjC,QAAS,CAAAC,QAAQA,CAAAC,IAAA,CAA+E,IAA5E,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CAAKC,KAAK,CAAAC,6BAAA,CAAAH,IAAA,CAAAI,SAAA,EACrC,mBACEN,IAAA,CAACJ,iBAAiB,CAACW,IAAI,CAAAC,QAAA,EACrB,YAAU,UAAU,CACpBL,SAAS,CAAEL,EAAE,CACX,6eAA6e,CAC7eK,SACF,CAAE,EACEC,KAAK,EAAAK,QAAA,cAETT,IAAA,CAACJ,iBAAiB,CAACc,SAAS,EAC1B,YAAU,oBAAoB,CAC9BP,SAAS,CAAC,+DAA+D,CAAAM,QAAA,cAEzET,IAAA,CAACH,SAAS,EAACM,SAAS,CAAC,UAAU,CAAE,CAAC,CACP,CAAC,EACR,CAE5B,CAEA,OAASF,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
3
|
+
declare function HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function HoverCardContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import _objectDestructuringEmpty from"@babel/runtime/helpers/objectDestructuringEmpty";import _extends from"@babel/runtime/helpers/extends";var _excluded=["className","align","sideOffset"];import*as React from"react";import*as HoverCardPrimitive from"@radix-ui/react-hover-card";import{cn}from"../../utils";import{jsx as _jsx}from"react/jsx-runtime";function HoverCard(_ref){var props=_extends({},(_objectDestructuringEmpty(_ref),_ref));return/*#__PURE__*/_jsx(HoverCardPrimitive.Root,_extends({"data-slot":"hover-card"},props))}function HoverCardTrigger(_ref2){var props=_extends({},(_objectDestructuringEmpty(_ref2),_ref2));return/*#__PURE__*/_jsx(HoverCardPrimitive.Trigger,_extends({"data-slot":"hover-card-trigger"},props))}function HoverCardContent(_ref3){var className=_ref3.className,_ref3$align=_ref3.align,align=_ref3$align===void 0?"center":_ref3$align,_ref3$sideOffset=_ref3.sideOffset,sideOffset=_ref3$sideOffset===void 0?4:_ref3$sideOffset,props=_objectWithoutPropertiesLoose(_ref3,_excluded);return/*#__PURE__*/_jsx(HoverCardPrimitive.Portal,{"data-slot":"hover-card-portal",children:/*#__PURE__*/_jsx(HoverCardPrimitive.Content,_extends({"data-slot":"hover-card-content",align:align,sideOffset:sideOffset,className:cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",className)},props))})}export{HoverCard,HoverCardTrigger,HoverCardContent};
|
|
2
|
+
//# sourceMappingURL=hover-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover-card.js","names":["React","HoverCardPrimitive","cn","jsx","_jsx","HoverCard","_ref","props","_extends","_objectDestructuringEmpty","Root","HoverCardTrigger","_ref2","Trigger","HoverCardContent","_ref3","className","_ref3$align","align","_ref3$sideOffset","sideOffset","_objectWithoutPropertiesLoose","_excluded","Portal","children","Content"],"sources":["../../../../src/shadcn/components/ui/hover-card.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as HoverCardPrimitive from '@radix-ui/react-hover-card';\n\nimport { cn } from '../../utils';\n\nfunction HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {\n return <HoverCardPrimitive.Root data-slot=\"hover-card\" {...props} />;\n}\n\nfunction HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {\n return <HoverCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />;\n}\n\nfunction HoverCardContent({\n className,\n align = 'center',\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {\n return (\n <HoverCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <HoverCardPrimitive.Content\n data-slot=\"hover-card-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',\n className,\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n );\n}\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent };\n"],"mappings":"4RAAA,MAAO,GAAK,CAAAA,KAAK,KAAM,OAAO,CAC9B,MAAO,GAAK,CAAAC,kBAAkB,KAAM,4BAA4B,CAEhE,OAASC,EAAE,KAAQ,aAAa,CAAC,OAAAC,GAAA,IAAAC,IAAA,yBAEjC,QAAS,CAAAC,SAASA,CAAAC,IAAA,CAAqE,IAA/D,CAAAC,KAAK,CAAAC,QAAA,KAAAC,yBAAA,CAAAH,IAAA,EAAAA,IAAA,GAC3B,mBAAOF,IAAA,CAACH,kBAAkB,CAACS,IAAI,CAAAF,QAAA,EAAC,YAAU,YAAY,EAAKD,KAAK,CAAG,CACrE,CAEA,QAAS,CAAAI,gBAAgBA,CAAAC,KAAA,CAAwE,IAAlE,CAAAL,KAAK,CAAAC,QAAA,KAAAC,yBAAA,CAAAG,KAAA,EAAAA,KAAA,GAClC,mBAAOR,IAAA,CAACH,kBAAkB,CAACY,OAAO,CAAAL,QAAA,EAAC,YAAU,oBAAoB,EAAKD,KAAK,CAAG,CAChF,CAEA,QAAS,CAAAO,gBAAgBA,CAAAC,KAAA,CAKmC,IAJ1D,CAAAC,SAAS,CAAAD,KAAA,CAATC,SAAS,CAAAC,WAAA,CAAAF,KAAA,CACTG,KAAK,CAALA,KAAK,CAAAD,WAAA,UAAG,QAAQ,CAAAA,WAAA,CAAAE,gBAAA,CAAAJ,KAAA,CAChBK,UAAU,CAAVA,UAAU,CAAAD,gBAAA,UAAG,CAAC,CAAAA,gBAAA,CACXZ,KAAK,CAAAc,6BAAA,CAAAN,KAAA,CAAAO,SAAA,EAER,mBACElB,IAAA,CAACH,kBAAkB,CAACsB,MAAM,EAAC,YAAU,mBAAmB,CAAAC,QAAA,cACtDpB,IAAA,CAACH,kBAAkB,CAACwB,OAAO,CAAAjB,QAAA,EACzB,YAAU,oBAAoB,CAC9BU,KAAK,CAAEA,KAAM,CACbE,UAAU,CAAEA,UAAW,CACvBJ,SAAS,CAAEd,EAAE,CACX,meAAme,CACnec,SACF,CAAE,EACET,KAAK,CACV,CAAC,CACuB,CAE/B,CAEA,OAASF,SAAS,CAAEM,gBAAgB,CAAEG,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["className","type"];import*as React from"react";import{cn}from"../../utils";import{jsx as _jsx}from"react/jsx-runtime";function Input(_ref){var className=_ref.className,type=_ref.type,props=_objectWithoutPropertiesLoose(_ref,_excluded);return/*#__PURE__*/_jsx("input",_extends({type:type,"data-slot":"input",className:cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",className)},props))}export{Input};
|
|
2
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","names":["React","cn","jsx","_jsx","Input","_ref","className","type","props","_objectWithoutPropertiesLoose","_excluded","_extends"],"sources":["../../../../src/shadcn/components/ui/input.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../../utils';\n\nfunction Input({ className, type, ...props }: React.ComponentProps<'input'>) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n 'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n"],"mappings":"uLAAA,MAAO,GAAK,CAAAA,KAAK,KAAM,OAAO,CAE9B,OAASC,EAAE,KAAQ,aAAa,CAAC,OAAAC,GAAA,IAAAC,IAAA,yBAEjC,QAAS,CAAAC,KAAKA,CAAAC,IAAA,CAA+D,IAA5D,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CAAEC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CAAKC,KAAK,CAAAC,6BAAA,CAAAJ,IAAA,CAAAK,SAAA,EACxC,mBACEP,IAAA,SAAAQ,QAAA,EACEJ,IAAI,CAAEA,IAAK,CACX,YAAU,OAAO,CACjBD,SAAS,CAAEL,EAAE,CACX,icAAic,CACjc,+EAA+E,CAC/E,wGAAwG,CACxGK,SACF,CAAE,EACEE,KAAK,CACV,CAEL,CAEA,OAASJ,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
3
|
+
declare function Label({ className, isEditable, ...props }: React.ComponentProps<typeof LabelPrimitive.Root> & {
|
|
4
|
+
isEditable?: boolean;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Label };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["className","isEditable"];import*as React from"react";import*as LabelPrimitive from"@radix-ui/react-label";import{cn}from"../../utils";import{jsx as _jsx}from"react/jsx-runtime";function Label(_ref){var className=_ref.className,isEditable=_ref.isEditable,props=_objectWithoutPropertiesLoose(_ref,_excluded);return/*#__PURE__*/_jsx(LabelPrimitive.Root,_extends({"data-slot":"label",className:cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",className),contentEditable:isEditable},props))}export{Label};
|
|
2
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","names":["React","LabelPrimitive","cn","jsx","_jsx","Label","_ref","className","isEditable","props","_objectWithoutPropertiesLoose","_excluded","Root","_extends","contentEditable"],"sources":["../../../../src/shadcn/components/ui/label.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\n\nimport { cn } from '../../utils';\n\nfunction Label({\n className,\n isEditable,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root> & { isEditable?: boolean }) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n contentEditable={isEditable}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"mappings":"6LAAA,MAAO,GAAK,CAAAA,KAAK,KAAM,OAAO,CAC9B,MAAO,GAAK,CAAAC,cAAc,KAAM,uBAAuB,CAEvD,OAASC,EAAE,KAAQ,aAAa,CAAC,OAAAC,GAAA,IAAAC,IAAA,yBAEjC,QAAS,CAAAC,KAAKA,CAAAC,IAAA,CAIkE,IAH9E,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CACTC,UAAU,CAAAF,IAAA,CAAVE,UAAU,CACPC,KAAK,CAAAC,6BAAA,CAAAJ,IAAA,CAAAK,SAAA,EAER,mBACEP,IAAA,CAACH,cAAc,CAACW,IAAI,CAAAC,QAAA,EAClB,YAAU,OAAO,CACjBN,SAAS,CAAEL,EAAE,CACX,qNAAqN,CACrNK,SACF,CAAE,CACFO,eAAe,CAAEN,UAAW,EACxBC,KAAK,CACV,CAEL,CAEA,OAASJ,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
3
|
+
declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["className","children"],_excluded2=["className","orientation"];import*as React from"react";import*as ScrollAreaPrimitive from"@radix-ui/react-scroll-area";import{cn}from"../../utils";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function ScrollArea(_ref){var className=_ref.className,children=_ref.children,props=_objectWithoutPropertiesLoose(_ref,_excluded);return/*#__PURE__*/_jsxs(ScrollAreaPrimitive.Root,_extends({"data-slot":"scroll-area",className:cn("relative",className)},props,{children:[/*#__PURE__*/_jsx(ScrollAreaPrimitive.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:children}),/*#__PURE__*/_jsx(ScrollBar,{}),/*#__PURE__*/_jsx(ScrollAreaPrimitive.Corner,{})]}))}function ScrollBar(_ref2){var className=_ref2.className,_ref2$orientation=_ref2.orientation,orientation=_ref2$orientation===void 0?"vertical":_ref2$orientation,props=_objectWithoutPropertiesLoose(_ref2,_excluded2);return/*#__PURE__*/_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar,_extends({"data-slot":"scroll-area-scrollbar",orientation:orientation,className:cn("flex touch-none p-px transition-colors select-none",orientation==="vertical"&&"h-full w-2.5 border-l border-l-transparent",orientation==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",className)},props,{children:/*#__PURE__*/_jsx(ScrollAreaPrimitive.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})}))}export{ScrollArea,ScrollBar};
|
|
2
|
+
//# sourceMappingURL=scroll-area.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-area.js","names":["React","ScrollAreaPrimitive","cn","jsx","_jsx","jsxs","_jsxs","ScrollArea","_ref","className","children","props","_objectWithoutPropertiesLoose","_excluded","Root","_extends","Viewport","ScrollBar","Corner","_ref2","_ref2$orientation","orientation","_excluded2","ScrollAreaScrollbar","ScrollAreaThumb"],"sources":["../../../../src/shadcn/components/ui/scroll-area.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\n\nimport { cn } from '../../utils';\n\nfunction ScrollArea({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n className={cn('relative', className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n data-slot=\"scroll-area-viewport\"\n className=\"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n}\n\nfunction ScrollBar({\n className,\n orientation = 'vertical',\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {\n return (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n className={cn(\n 'flex touch-none p-px transition-colors select-none',\n orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent',\n orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent',\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb\n data-slot=\"scroll-area-thumb\"\n className=\"bg-border relative flex-1 rounded-full\"\n />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n );\n}\n\nexport { ScrollArea, ScrollBar };\n"],"mappings":"kOAAA,MAAO,GAAK,CAAAA,KAAK,KAAM,OAAO,CAC9B,MAAO,GAAK,CAAAC,mBAAmB,KAAM,6BAA6B,CAElE,OAASC,EAAE,KAAQ,aAAa,CAAC,OAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBAEjC,QAAS,CAAAC,UAAUA,CAAAC,IAAA,CAIuC,IAHxD,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CACTC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACLC,KAAK,CAAAC,6BAAA,CAAAJ,IAAA,CAAAK,SAAA,EAER,mBACEP,KAAA,CAACL,mBAAmB,CAACa,IAAI,CAAAC,QAAA,EACvB,YAAU,aAAa,CACvBN,SAAS,CAAEP,EAAE,CAAC,UAAU,CAAEO,SAAS,CAAE,EACjCE,KAAK,EAAAD,QAAA,eAETN,IAAA,CAACH,mBAAmB,CAACe,QAAQ,EAC3B,YAAU,sBAAsB,CAChCP,SAAS,CAAC,oJAAoJ,CAAAC,QAAA,CAE7JA,QAAQ,CACmB,CAAC,cAC/BN,IAAA,CAACa,SAAS,GAAE,CAAC,cACbb,IAAA,CAACH,mBAAmB,CAACiB,MAAM,GAAE,CAAC,GACN,CAE9B,CAEA,QAAS,CAAAD,SAASA,CAAAE,KAAA,CAIuD,IAHvE,CAAAV,SAAS,CAAAU,KAAA,CAATV,SAAS,CAAAW,iBAAA,CAAAD,KAAA,CACTE,WAAW,CAAXA,WAAW,CAAAD,iBAAA,UAAG,UAAU,CAAAA,iBAAA,CACrBT,KAAK,CAAAC,6BAAA,CAAAO,KAAA,CAAAG,UAAA,EAER,mBACElB,IAAA,CAACH,mBAAmB,CAACsB,mBAAmB,CAAAR,QAAA,EACtC,YAAU,uBAAuB,CACjCM,WAAW,CAAEA,WAAY,CACzBZ,SAAS,CAAEP,EAAE,CACX,oDAAoD,CACpDmB,WAAW,GAAK,UAAU,EAAI,4CAA4C,CAC1EA,WAAW,GAAK,YAAY,EAAI,8CAA8C,CAC9EZ,SACF,CAAE,EACEE,KAAK,EAAAD,QAAA,cAETN,IAAA,CAACH,mBAAmB,CAACuB,eAAe,EAClC,YAAU,mBAAmB,CAC7Bf,SAAS,CAAC,wCAAwC,CACnD,CAAC,EACqC,CAE7C,CAEA,OAASF,UAAU,CAAEU,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
3
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["className","orientation","decorative"];import*as React from"react";import*as SeparatorPrimitive from"@radix-ui/react-separator";import{cn}from"../../utils";import{jsx as _jsx}from"react/jsx-runtime";function Separator(_ref){var className=_ref.className,_ref$orientation=_ref.orientation,orientation=_ref$orientation===void 0?"horizontal":_ref$orientation,_ref$decorative=_ref.decorative,decorative=_ref$decorative===void 0?true:_ref$decorative,props=_objectWithoutPropertiesLoose(_ref,_excluded);return/*#__PURE__*/_jsx(SeparatorPrimitive.Root,_extends({"data-slot":"separator-root",decorative:decorative,orientation:orientation,className:cn("w-4/5 border-gray-300 my-6 shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",className)},props))}export{Separator};
|
|
2
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","names":["React","SeparatorPrimitive","cn","jsx","_jsx","Separator","_ref","className","_ref$orientation","orientation","_ref$decorative","decorative","props","_objectWithoutPropertiesLoose","_excluded","Root","_extends"],"sources":["../../../../src/shadcn/components/ui/separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\n\nimport { cn } from '../../utils';\n\nfunction Separator({\n className,\n orientation = 'horizontal',\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator-root\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'w-4/5 border-gray-300 my-6 shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Separator };\n"],"mappings":"2MAAA,MAAO,GAAK,CAAAA,KAAK,KAAM,OAAO,CAC9B,MAAO,GAAK,CAAAC,kBAAkB,KAAM,2BAA2B,CAE/D,OAASC,EAAE,KAAQ,aAAa,CAAC,OAAAC,GAAA,IAAAC,IAAA,yBAEjC,QAAS,CAAAC,SAASA,CAAAC,IAAA,CAKuC,IAJvD,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CAAAC,gBAAA,CAAAF,IAAA,CACTG,WAAW,CAAXA,WAAW,CAAAD,gBAAA,UAAG,YAAY,CAAAA,gBAAA,CAAAE,eAAA,CAAAJ,IAAA,CAC1BK,UAAU,CAAVA,UAAU,CAAAD,eAAA,UAAG,IAAI,CAAAA,eAAA,CACdE,KAAK,CAAAC,6BAAA,CAAAP,IAAA,CAAAQ,SAAA,EAER,mBACEV,IAAA,CAACH,kBAAkB,CAACc,IAAI,CAAAC,QAAA,EACtB,YAAU,gBAAgB,CAC1BL,UAAU,CAAEA,UAAW,CACvBF,WAAW,CAAEA,WAAY,CACzBF,SAAS,CAAEL,EAAE,CACX,iLAAiL,CACjLK,SACF,CAAE,EACEK,KAAK,CACV,CAEL,CAEA,OAASP,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<'table'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<'tr'>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["className"],_excluded2=["className"],_excluded3=["className"],_excluded4=["className"],_excluded5=["className"],_excluded6=["className"],_excluded7=["className"],_excluded8=["className"];import*as React from"react";import{cn}from"../../utils";import{jsx as _jsx}from"react/jsx-runtime";function Table(_ref){var className=_ref.className,props=_objectWithoutPropertiesLoose(_ref,_excluded);return/*#__PURE__*/_jsx("table",_extends({"data-slot":"table",className:cn("w-[640px] caption-bottom text-sm",className)},props))}function TableHeader(_ref2){var className=_ref2.className,props=_objectWithoutPropertiesLoose(_ref2,_excluded2);return/*#__PURE__*/_jsx("thead",_extends({"data-slot":"table-header",className:cn("[&_tr]:border-b font-bold bg-slate-100",className)},props))}function TableBody(_ref3){var className=_ref3.className,props=_objectWithoutPropertiesLoose(_ref3,_excluded3);return/*#__PURE__*/_jsx("tbody",_extends({"data-slot":"table-body",className:cn("[&_tr:last-child]:border-0",className)},props))}function TableFooter(_ref4){var className=_ref4.className,props=_objectWithoutPropertiesLoose(_ref4,_excluded4);return/*#__PURE__*/_jsx("tfoot",_extends({"data-slot":"table-footer",className:cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",className)},props))}function TableRow(_ref5){var className=_ref5.className,props=_objectWithoutPropertiesLoose(_ref5,_excluded5);return/*#__PURE__*/_jsx("tr",_extends({"data-slot":"table-row",className:cn("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",className)},props))}function TableHead(_ref6){var className=_ref6.className,props=_objectWithoutPropertiesLoose(_ref6,_excluded6);return/*#__PURE__*/_jsx("th",_extends({"data-slot":"table-head",className:cn("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",className)},props))}function TableCell(_ref7){var className=_ref7.className,props=_objectWithoutPropertiesLoose(_ref7,_excluded7);return/*#__PURE__*/_jsx("td",_extends({"data-slot":"table-cell",className:cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",className)},props))}function TableCaption(_ref8){var className=_ref8.className,props=_objectWithoutPropertiesLoose(_ref8,_excluded8);return/*#__PURE__*/_jsx("caption",_extends({"data-slot":"table-caption",className:cn("text-muted-foreground mt-4 text-sm",className)},props))}export{Table,TableHeader,TableBody,TableFooter,TableHead,TableRow,TableCell,TableCaption};
|
|
2
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","names":["React","cn","jsx","_jsx","Table","_ref","className","props","_objectWithoutPropertiesLoose","_excluded","_extends","TableHeader","_ref2","_excluded2","TableBody","_ref3","_excluded3","TableFooter","_ref4","_excluded4","TableRow","_ref5","_excluded5","TableHead","_ref6","_excluded6","TableCell","_ref7","_excluded7","TableCaption","_ref8","_excluded8"],"sources":["../../../../src/shadcn/components/ui/table.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../../utils';\n\nfunction Table({ className, ...props }: React.ComponentProps<'table'>) {\n return (\n <table\n data-slot=\"table\"\n className={cn('w-[640px] caption-bottom text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn('[&_tr]:border-b font-bold bg-slate-100', className)}\n {...props}\n />\n );\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n );\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className)}\n {...props}\n />\n );\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<'tr'>) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n 'hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<'th'>) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n 'text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<'td'>) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n 'p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn('text-muted-foreground mt-4 text-sm', className)}\n {...props}\n />\n );\n}\n\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };\n"],"mappings":"+VAAA,MAAO,GAAK,CAAAA,KAAK,KAAM,OAAO,CAE9B,OAASC,EAAE,KAAQ,aAAa,CAAC,OAAAC,GAAA,IAAAC,IAAA,yBAEjC,QAAS,CAAAC,KAAKA,CAAAC,IAAA,CAAyD,IAAtD,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CAAKC,KAAK,CAAAC,6BAAA,CAAAH,IAAA,CAAAI,SAAA,EAClC,mBACEN,IAAA,SAAAO,QAAA,EACE,YAAU,OAAO,CACjBJ,SAAS,CAAEL,EAAE,CAAC,kCAAkC,CAAEK,SAAS,CAAE,EACzDC,KAAK,CACV,CAEL,CAEA,QAAS,CAAAI,WAAWA,CAAAC,KAAA,CAAyD,IAAtD,CAAAN,SAAS,CAAAM,KAAA,CAATN,SAAS,CAAKC,KAAK,CAAAC,6BAAA,CAAAI,KAAA,CAAAC,UAAA,EACxC,mBACEV,IAAA,SAAAO,QAAA,EACE,YAAU,cAAc,CACxBJ,SAAS,CAAEL,EAAE,CAAC,wCAAwC,CAAEK,SAAS,CAAE,EAC/DC,KAAK,CACV,CAEL,CAEA,QAAS,CAAAO,SAASA,CAAAC,KAAA,CAAyD,IAAtD,CAAAT,SAAS,CAAAS,KAAA,CAATT,SAAS,CAAKC,KAAK,CAAAC,6BAAA,CAAAO,KAAA,CAAAC,UAAA,EACtC,mBACEb,IAAA,SAAAO,QAAA,EACE,YAAU,YAAY,CACtBJ,SAAS,CAAEL,EAAE,CAAC,4BAA4B,CAAEK,SAAS,CAAE,EACnDC,KAAK,CACV,CAEL,CAEA,QAAS,CAAAU,WAAWA,CAAAC,KAAA,CAAyD,IAAtD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,EACzC,mBACE5B,IAAA,WAAAO,QAAA,EACE,YAAU,eAAe,CACzBJ,SAAS,CAAEL,EAAE,CAAC,oCAAoC,CAAEK,SAAS,CAAE,EAC3DC,KAAK,CACV,CAEL,CAEA,OAASH,KAAK,CAAEO,WAAW,CAAEG,SAAS,CAAEG,WAAW,CAAEM,SAAS,CAAEH,QAAQ,CAAEM,SAAS,CAAEG,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["className"];import*as React from"react";import{cn}from"../../utils";import{jsx as _jsx}from"react/jsx-runtime";function Textarea(_ref){var className=_ref.className,props=_objectWithoutPropertiesLoose(_ref,_excluded);return/*#__PURE__*/_jsx("textarea",_extends({"data-slot":"textarea",className:cn("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",className)},props))}export{Textarea};
|
|
2
|
+
//# sourceMappingURL=textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.js","names":["React","cn","jsx","_jsx","Textarea","_ref","className","props","_objectWithoutPropertiesLoose","_excluded","_extends"],"sources":["../../../../src/shadcn/components/ui/textarea.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../../utils';\n\nfunction Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n 'border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Textarea };\n"],"mappings":"gLAAA,MAAO,GAAK,CAAAA,KAAK,KAAM,OAAO,CAE9B,OAASC,EAAE,KAAQ,aAAa,CAAC,OAAAC,GAAA,IAAAC,IAAA,yBAEjC,QAAS,CAAAC,QAAQA,CAAAC,IAAA,CAA4D,IAAzD,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CAAKC,KAAK,CAAAC,6BAAA,CAAAH,IAAA,CAAAI,SAAA,EACrC,mBACEN,IAAA,YAAAO,QAAA,EACE,YAAU,UAAU,CACpBJ,SAAS,CAAEL,EAAE,CACX,qcAAqc,CACrcK,SACF,CAAE,EACEC,KAAK,CACV,CAEL,CAEA,OAASH,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectDestructuringEmpty from"@babel/runtime/helpers/objectDestructuringEmpty";import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["delayDuration"],_excluded2=["className","sideOffset","children"];import*as React from"react";import*as TooltipPrimitive from"@radix-ui/react-tooltip";import{cn}from"../../utils";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function TooltipProvider(_ref){var _ref$delayDuration=_ref.delayDuration,delayDuration=_ref$delayDuration===void 0?0:_ref$delayDuration,props=_objectWithoutPropertiesLoose(_ref,_excluded);return/*#__PURE__*/_jsx(TooltipPrimitive.Provider,_extends({"data-slot":"tooltip-provider",delayDuration:delayDuration},props))}function Tooltip(_ref2){var props=_extends({},(_objectDestructuringEmpty(_ref2),_ref2));return/*#__PURE__*/_jsx(TooltipProvider,{children:/*#__PURE__*/_jsx(TooltipPrimitive.Root,_extends({"data-slot":"tooltip"},props))})}function TooltipTrigger(_ref3){var props=_extends({},(_objectDestructuringEmpty(_ref3),_ref3));return/*#__PURE__*/_jsx(TooltipPrimitive.Trigger,_extends({"data-slot":"tooltip-trigger"},props))}function TooltipContent(_ref4){var className=_ref4.className,_ref4$sideOffset=_ref4.sideOffset,sideOffset=_ref4$sideOffset===void 0?0:_ref4$sideOffset,children=_ref4.children,props=_objectWithoutPropertiesLoose(_ref4,_excluded2);return/*#__PURE__*/_jsx(TooltipPrimitive.Portal,{children:/*#__PURE__*/_jsxs(TooltipPrimitive.Content,_extends({"data-slot":"tooltip-content",sideOffset:sideOffset,className:cn("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",className)},props,{children:[children,/*#__PURE__*/_jsx(TooltipPrimitive.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]}))})}export{Tooltip,TooltipTrigger,TooltipContent,TooltipProvider};
|
|
2
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":["React","TooltipPrimitive","cn","jsx","_jsx","jsxs","_jsxs","TooltipProvider","_ref","_ref$delayDuration","delayDuration","props","_objectWithoutPropertiesLoose","_excluded","Provider","_extends","Tooltip","_ref2","_objectDestructuringEmpty","children","Root","TooltipTrigger","_ref3","Trigger","TooltipContent","_ref4","className","_ref4$sideOffset","sideOffset","_excluded2","Portal","Content","Arrow"],"sources":["../../../../src/shadcn/components/ui/tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\n\nimport { cn } from '../../utils';\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance',\n className,\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"],"mappings":"4TAAA,MAAO,GAAK,CAAAA,KAAK,KAAM,OAAO,CAC9B,MAAO,GAAK,CAAAC,gBAAgB,KAAM,yBAAyB,CAE3D,OAASC,EAAE,KAAQ,aAAa,CAAC,OAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBAEjC,QAAS,CAAAC,eAAeA,CAAAC,IAAA,CAGmC,KAAAC,kBAAA,CAAAD,IAAA,CAFzDE,aAAa,CAAbA,aAAa,CAAAD,kBAAA,UAAG,CAAC,CAAAA,kBAAA,CACdE,KAAK,CAAAC,6BAAA,CAAAJ,IAAA,CAAAK,SAAA,EAER,mBACET,IAAA,CAACH,gBAAgB,CAACa,QAAQ,CAAAC,QAAA,EACxB,YAAU,kBAAkB,CAC5BL,aAAa,CAAEA,aAAc,EACzBC,KAAK,CACV,CAEL,CAEA,QAAS,CAAAK,OAAOA,CAAAC,KAAA,CAAmE,IAA7D,CAAAN,KAAK,CAAAI,QAAA,KAAAG,yBAAA,CAAAD,KAAA,EAAAA,KAAA,GACzB,mBACEb,IAAA,CAACG,eAAe,EAAAY,QAAA,cACdf,IAAA,CAACH,gBAAgB,CAACmB,IAAI,CAAAL,QAAA,EAAC,YAAU,SAAS,EAAKJ,KAAK,CAAG,CAAC,CACzC,CAErB,CAEA,QAAS,CAAAU,cAAcA,CAAAC,KAAA,CAAsE,IAAhE,CAAAX,KAAK,CAAAI,QAAA,KAAAG,yBAAA,CAAAI,KAAA,EAAAA,KAAA,GAChC,mBAAOlB,IAAA,CAACH,gBAAgB,CAACsB,OAAO,CAAAR,QAAA,EAAC,YAAU,iBAAiB,EAAKJ,KAAK,CAAG,CAC3E,CAEA,QAAS,CAAAa,cAAcA,CAAAC,KAAA,CAKmC,IAJxD,CAAAC,SAAS,CAAAD,KAAA,CAATC,SAAS,CAAAC,gBAAA,CAAAF,KAAA,CACTG,UAAU,CAAVA,UAAU,CAAAD,gBAAA,UAAG,CAAC,CAAAA,gBAAA,CACdR,QAAQ,CAAAM,KAAA,CAARN,QAAQ,CACLR,KAAK,CAAAC,6BAAA,CAAAa,KAAA,CAAAI,UAAA,EAER,mBACEzB,IAAA,CAACH,gBAAgB,CAAC6B,MAAM,EAAAX,QAAA,cACtBb,KAAA,CAACL,gBAAgB,CAAC8B,OAAO,CAAAhB,QAAA,EACvB,YAAU,iBAAiB,CAC3Ba,UAAU,CAAEA,UAAW,CACvBF,SAAS,CAAExB,EAAE,CACX,waAAwa,CACxawB,SACF,CAAE,EACEf,KAAK,EAAAQ,QAAA,EAERA,QAAQ,cACTf,IAAA,CAACH,gBAAgB,CAAC+B,KAAK,EAACN,SAAS,CAAC,8FAA8F,CAAE,CAAC,GAC3G,CAAC,CACJ,CAE7B,CAEA,OAASV,OAAO,CAAEK,cAAc,CAAEG,cAAc,CAAEjB,eAAe","ignoreList":[]}
|
package/shadcn/utils.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["clsx","twMerge","cn","_len","arguments","length","inputs","Array","_key"],"sources":["../../src/shadcn/utils.ts"],"sourcesContent":["import { clsx, ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"AAAA,OAASA,IAAI,KAAoB,MAAM,CACvC,OAASC,OAAO,KAAQ,gBAAgB,CAExC,MAAO,SAAS,CAAAC,EAAEA,CAAA,CAA0B,SAAAC,IAAA,CAAAC,SAAA,CAAAC,MAAA,CAAtBC,MAAM,KAAAC,KAAA,CAAAJ,IAAA,EAAAK,IAAA,GAAAA,IAAA,CAAAL,IAAA,CAAAK,IAAA,IAANF,MAAM,CAAAE,IAAA,EAAAJ,SAAA,CAAAI,IAAA,EAC1B,MAAO,CAAAP,OAAO,CAACD,IAAI,CAACM,MAAM,CAAC,CAC7B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grapesjs-tailwind.d.js","names":[],"sources":["../../src/types/grapesjs-tailwind.d.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\ndeclare module 'grapesjs-tailwind' {\n import { Plugin } from 'grapesjs';\n\n export type GrapesjsTailwindOptions = {\n blocks?: boolean;\n categories?: boolean;\n classesViewerOptions?: {\n appendTo?: string | HTMLElement;\n open?: boolean;\n showEmpty?: boolean;\n };\n config?: {\n plugins?: any[];\n presets?: any[];\n theme?: Record<string, any>;\n variants?: Record<string, any>;\n };\n customClasses?: string[];\n customTailwindViewerCSS?: string;\n gridDevicesPanel?: boolean;\n importTailwind?: boolean;\n includeLib?: boolean;\n purgeCss?: boolean;\n tailwindConfig?: string;\n tailwindCssPath?: string;\n tailwindExtendUi?: boolean;\n };\n\n // eslint-disable-next-line init-declarations\n declare const grapesjsTailwind: Plugin<GrapesjsTailwindOptions>;\n export default grapesjsTailwind;\n}\n"],"mappings":"","ignoreList":[]}
|