listpage-next 0.0.239 → 0.0.241

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.
@@ -0,0 +1,36 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { Loader2 } from "lucide-react";
4
+ const Button = (props)=>{
5
+ const { onClick, disabled, loading: userControlledLoading, children, type = 'primary', size = 'medium' } = props;
6
+ const [loading, setLoading] = useState(false);
7
+ const typeClass = {
8
+ primary: 'bg-blue-600 hover:bg-blue-500 text-white shadow-lg shadow-blue-900/20 transition-all transform hover:scale-[1.02] active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 flex items-center gap-2',
9
+ secondary: 'border border-gray-700 text-gray-300 hover:bg-gray-800 hover:text-white active:bg-gray-700 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-500 focus-visible:ring-offset-2 flex items-center gap-2'
10
+ };
11
+ const sizeClass = {
12
+ large: 'px-6 py-2.5 rounded-lg',
13
+ medium: 'px-4 py-2 text-sm rounded-lg font-medium',
14
+ small: 'px-3 py-1.5 text-xs rounded'
15
+ };
16
+ return /*#__PURE__*/ jsxs("button", {
17
+ disabled: disabled || loading || userControlledLoading,
18
+ className: `cursor-pointer flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed ${typeClass[type]} ${sizeClass[size]}`,
19
+ onClick: async ()=>{
20
+ try {
21
+ setLoading(true);
22
+ await onClick?.();
23
+ } finally{
24
+ setLoading(false);
25
+ }
26
+ },
27
+ children: [
28
+ (userControlledLoading || loading) && /*#__PURE__*/ jsx(Loader2, {
29
+ size: 18,
30
+ className: "animate-spin"
31
+ }),
32
+ children
33
+ ]
34
+ });
35
+ };
36
+ export { Button };
@@ -0,0 +1,30 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import react_simple_code_editor from "react-simple-code-editor";
3
+ import prismjs from "prismjs";
4
+ import "prismjs/components/prism-markdown";
5
+ const highlightWithJinja = (code)=>{
6
+ let html = prismjs.highlight(code, prismjs.languages.markdown || prismjs.languages.javascript, 'markdown');
7
+ return html.replace(/{{(.*?)}}/g, '<span class="token jinja-variable">{{$1}}</span>');
8
+ };
9
+ const PromptEditor = ({ value, onChange, placeholder, className })=>/*#__PURE__*/ jsx("div", {
10
+ className: `relative font-mono text-sm bg-[#0B1120] text-slate-300 overflow-hidden h-full flex flex-col ${className}`,
11
+ children: /*#__PURE__*/ jsx("div", {
12
+ className: "flex-1 overflow-auto custom-scrollbar",
13
+ children: /*#__PURE__*/ jsx(react_simple_code_editor, {
14
+ value: value,
15
+ onValueChange: onChange,
16
+ highlight: (code)=>highlightWithJinja(code),
17
+ padding: 24,
18
+ textareaClassName: "focus:outline-none",
19
+ style: {
20
+ fontFamily: '"Fira Code", "Consolas", monospace',
21
+ fontSize: 14,
22
+ lineHeight: '1.6',
23
+ backgroundColor: 'transparent',
24
+ minHeight: '100%'
25
+ },
26
+ placeholder: placeholder
27
+ })
28
+ })
29
+ });
30
+ export { PromptEditor };
@@ -0,0 +1,3 @@
1
+ import { PromptEditor } from "./PromptEditor/index.js";
2
+ import { Button } from "./Button/index.js";
3
+ export { Button, PromptEditor };
package/dist/ui.css CHANGED
@@ -22,7 +22,6 @@
22
22
  --text-sm: 0.875rem;
23
23
  --text-sm--line-height: calc(1.25 / 0.875);
24
24
  --font-weight-medium: 500;
25
- --radius-md: 0.375rem;
26
25
  --radius-lg: 0.5rem;
27
26
  --animate-spin: spin 1s linear infinite;
28
27
  --default-transition-duration: 150ms;
@@ -252,9 +251,6 @@
252
251
  .rounded-lg {
253
252
  border-radius: var(--radius-lg);
254
253
  }
255
- .rounded-md {
256
- border-radius: var(--radius-md);
257
- }
258
254
  .border {
259
255
  border-style: var(--tw-border-style);
260
256
  border-width: 1px;
package/dist/ui.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './ui';
package/dist/ui.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./ui.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.239",
3
+ "version": "0.0.241",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,8 +11,8 @@
11
11
  "import": "./dist/index.js"
12
12
  },
13
13
  "./ui": {
14
- "types": "./dist/ui/ui.d.ts",
15
- "import": "./dist/ui/ui.js"
14
+ "types": "./dist/ui.d.ts",
15
+ "import": "./dist/ui.js"
16
16
  },
17
17
  "./ui.css": "./dist/ui.css"
18
18
  },