@flowtomic/ui 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -91,7 +91,7 @@ import * as React from "react";
91
91
  * Define as classes CSS para diferentes variantes e tamanhos.
92
92
  */
93
93
  declare const buttonVariants: (props?: ({
94
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "success" | "info" | "natural" | null | undefined;
94
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "success" | "info" | "natural" | "toolbar" | null | undefined;
95
95
  size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
96
96
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
97
97
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/actions/button/button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AAGH,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;GAGG;AACH,QAAA,MAAM,cAAc;;;8EA+BnB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC,EACvE,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,MAAM,uFA6BX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/actions/button/button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AAGH,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;GAGG;AACH,QAAA,MAAM,cAAc;;;8EAkCnB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC,EACvE,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,MAAM,uFA6BX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -105,6 +105,8 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
105
105
  success: "bg-success text-success-foreground shadow-sm hover:bg-success-hover",
106
106
  info: "bg-accent text-accent-foreground shadow-sm hover:bg-accent-hover",
107
107
  natural: "bg-background text-foreground border border-input shadow-sm hover:bg-accent hover:text-accent-foreground",
108
+ /** Toolbar-style: subtle bg for use in toolbars (e.g. Koda sidebar). */
109
+ toolbar: "bg-black/10 dark:bg-white/10 rounded-sm overflow-hidden whitespace-nowrap hover:bg-black/20 dark:hover:bg-white/20",
108
110
  },
109
111
  size: {
110
112
  default: "h-9 px-4 py-2",
@@ -11,12 +11,20 @@ export type CodeBlockProps = HTMLAttributes<HTMLDivElement> & {
11
11
  code: string;
12
12
  language: BundledLanguage;
13
13
  showLineNumbers?: boolean;
14
+ /** Max height in pixels; overflow becomes scrollable when set. */
15
+ maxHeight?: number;
16
+ /** When true, scrollbars are visible when content overflows. */
17
+ showScrollbars?: boolean;
14
18
  };
15
19
  export declare function highlightCode(code: string, language: BundledLanguage, showLineNumbers?: boolean): Promise<[string, string]>;
16
20
  export declare const CodeBlock: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
17
21
  code: string;
18
22
  language: BundledLanguage;
19
23
  showLineNumbers?: boolean;
24
+ /** Max height in pixels; overflow becomes scrollable when set. */
25
+ maxHeight?: number;
26
+ /** When true, scrollbars are visible when content overflows. */
27
+ showScrollbars?: boolean;
20
28
  } & React.RefAttributes<HTMLDivElement>>;
21
29
  export type CodeBlockCopyButtonProps = ComponentProps<typeof Button> & {
22
30
  onCopy?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/code/code-block/code-block.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,eAAe,EAAqC,MAAM,OAAO,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AA+BF,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,eAAe,EACzB,eAAe,UAAQ,6BAgBxB;AAED,eAAO,MAAM,SAAS;UAvDd,MAAM;cACF,eAAe;sBACP,OAAO;wCAsG1B,CAAC;AAGF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,mBAAmB,iHAoC/B,CAAC"}
1
+ {"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/code/code-block/code-block.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,eAAe,EAAqC,MAAM,OAAO,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AA+BF,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,eAAe,EACzB,eAAe,UAAQ,6BAgBxB;AAED,eAAO,MAAM,SAAS;UA3Dd,MAAM;cACF,eAAe;sBACP,OAAO;IACzB,kEAAkE;gBACtD,MAAM;IAClB,gEAAgE;qBAC/C,OAAO;wCAoHzB,CAAC;AAGF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,mBAAmB,iHAoC/B,CAAC"}
@@ -43,7 +43,7 @@ export async function highlightCode(code, language, showLineNumbers = false) {
43
43
  }),
44
44
  ]);
45
45
  }
46
- export const CodeBlock = React.forwardRef(({ code, language, showLineNumbers = false, className, children, ...props }, ref) => {
46
+ export const CodeBlock = React.forwardRef(({ code, language, showLineNumbers = false, maxHeight, showScrollbars = false, className, children, ...props }, ref) => {
47
47
  const [html, setHtml] = useState("");
48
48
  const [darkHtml, setDarkHtml] = useState("");
49
49
  const mounted = useRef(false);
@@ -59,7 +59,7 @@ export const CodeBlock = React.forwardRef(({ code, language, showLineNumbers = f
59
59
  mounted.current = false;
60
60
  };
61
61
  }, [code, language, showLineNumbers]);
62
- return (_jsx(CodeBlockContext.Provider, { value: { code }, children: _jsx("div", { ref: ref, className: cn("group relative w-full overflow-hidden rounded-md border bg-background text-foreground", className), ...props, children: _jsxs("div", { className: "relative", children: [_jsx("div", { className: "overflow-hidden dark:hidden [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm",
62
+ return (_jsx(CodeBlockContext.Provider, { value: { code }, children: _jsx("div", { ref: ref, className: cn("group relative w-full rounded-md border bg-background text-foreground", maxHeight != null || showScrollbars ? "overflow-auto" : "overflow-hidden", className), style: maxHeight != null ? { maxHeight: `${maxHeight}px` } : undefined, ...props, children: _jsxs("div", { className: "relative", children: [_jsx("div", { className: "overflow-hidden dark:hidden [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm",
63
63
  // biome-ignore lint/security/noDangerouslySetInnerHtml: "this is needed for syntax highlighting"
64
64
  dangerouslySetInnerHTML: { __html: html } }), _jsx("div", { className: "hidden overflow-hidden dark:block [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm",
65
65
  // biome-ignore lint/security/noDangerouslySetInnerHtml: "this is needed for syntax highlighting"
@@ -44,11 +44,11 @@ declare const CommandDialog: {
44
44
  /**
45
45
  * CommandInput - Input do command
46
46
  */
47
- declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof React.InputHTMLAttributes<HTMLInputElement> | "key"> & {
47
+ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
48
48
  ref?: React.Ref<HTMLInputElement>;
49
49
  } & {
50
50
  asChild?: boolean;
51
- }, keyof React.InputHTMLAttributes<HTMLInputElement> | "asChild" | "key">, "type" | "value" | "onChange"> & {
51
+ }, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
52
52
  value?: string;
53
53
  onValueChange?: (search: string) => void;
54
54
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -24,7 +24,7 @@ declare namespace Item {
24
24
  var displayName: string;
25
25
  }
26
26
  declare const itemMediaVariants: (props?: ({
27
- variant?: "image" | "default" | "icon" | null | undefined;
27
+ variant?: "default" | "icon" | "image" | null | undefined;
28
28
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
29
29
  export interface ItemMediaProps extends React.ComponentProps<"div">, VariantProps<typeof itemMediaVariants> {
30
30
  }
@@ -26,11 +26,11 @@ export declare const ModelSelectorDialog: {
26
26
  displayName: string;
27
27
  };
28
28
  export type ModelSelectorInputProps = ComponentProps<typeof CommandInput>;
29
- export declare const ModelSelectorInput: React.ForwardRefExoticComponent<Omit<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof React.InputHTMLAttributes<HTMLInputElement> | "key"> & {
29
+ export declare const ModelSelectorInput: React.ForwardRefExoticComponent<Omit<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
30
30
  ref?: React.Ref<HTMLInputElement>;
31
31
  } & {
32
32
  asChild?: boolean;
33
- }, keyof React.InputHTMLAttributes<HTMLInputElement> | "asChild" | "key">, "type" | "value" | "onChange"> & {
33
+ }, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
34
34
  value?: string;
35
35
  onValueChange?: (search: string) => void;
36
36
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;