@flowtomic/ui 0.1.15 → 0.2.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.
Files changed (152) hide show
  1. package/dist/components/_reference/shadcn-ai/prompt-input.d.ts +48 -0
  2. package/dist/components/_reference/shadcn-ai/prompt-input.d.ts.map +1 -0
  3. package/dist/components/_reference/shadcn-ai/prompt-input.js +67 -0
  4. package/dist/components/atoms/actions/badge/badge.d.ts +97 -1
  5. package/dist/components/atoms/actions/badge/badge.d.ts.map +1 -1
  6. package/dist/components/atoms/actions/badge/badge.js +83 -0
  7. package/dist/components/atoms/actions/button/button.d.ts +134 -1
  8. package/dist/components/atoms/actions/button/button.d.ts.map +1 -1
  9. package/dist/components/atoms/actions/button/button.js +106 -0
  10. package/dist/components/atoms/actions/context-menu/context-menu.d.ts +79 -0
  11. package/dist/components/atoms/actions/context-menu/context-menu.d.ts.map +1 -1
  12. package/dist/components/atoms/actions/context-menu/context-menu.js +55 -0
  13. package/dist/components/atoms/actions/dropdown-menu/dropdown-menu.d.ts +51 -3
  14. package/dist/components/atoms/actions/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  15. package/dist/components/atoms/actions/dropdown-menu/dropdown-menu.js +51 -3
  16. package/dist/components/atoms/animation/encrypted-text/encrypted-text.d.ts.map +1 -1
  17. package/dist/components/atoms/animation/encrypted-text/encrypted-text.js +3 -1
  18. package/dist/components/atoms/feedback/alert/alert.d.ts +77 -12
  19. package/dist/components/atoms/feedback/alert/alert.d.ts.map +1 -1
  20. package/dist/components/atoms/feedback/alert/alert.js +64 -12
  21. package/dist/components/atoms/feedback/alert-dialog/alert-dialog.d.ts +2 -2
  22. package/dist/components/atoms/feedback/dialog/dialog.d.ts +66 -8
  23. package/dist/components/atoms/feedback/dialog/dialog.d.ts.map +1 -1
  24. package/dist/components/atoms/feedback/dialog/dialog.js +66 -8
  25. package/dist/components/atoms/feedback/hover-card/hover-card.d.ts +45 -5
  26. package/dist/components/atoms/feedback/hover-card/hover-card.d.ts.map +1 -1
  27. package/dist/components/atoms/feedback/hover-card/hover-card.js +45 -5
  28. package/dist/components/atoms/feedback/inline-citation/inline-citation.d.ts +53 -2
  29. package/dist/components/atoms/feedback/inline-citation/inline-citation.d.ts.map +1 -1
  30. package/dist/components/atoms/feedback/inline-citation/inline-citation.js +53 -2
  31. package/dist/components/atoms/feedback/popover/popover.d.ts +78 -0
  32. package/dist/components/atoms/feedback/popover/popover.d.ts.map +1 -1
  33. package/dist/components/atoms/feedback/popover/popover.js +64 -0
  34. package/dist/components/atoms/feedback/sheet/sheet.d.ts +90 -0
  35. package/dist/components/atoms/feedback/sheet/sheet.d.ts.map +1 -1
  36. package/dist/components/atoms/feedback/sheet/sheet.js +78 -0
  37. package/dist/components/atoms/feedback/sonner/sonner.d.ts +66 -6
  38. package/dist/components/atoms/feedback/sonner/sonner.d.ts.map +1 -1
  39. package/dist/components/atoms/feedback/sonner/sonner.js +66 -6
  40. package/dist/components/atoms/feedback/tooltip/tooltip.d.ts +54 -4
  41. package/dist/components/atoms/feedback/tooltip/tooltip.d.ts.map +1 -1
  42. package/dist/components/atoms/feedback/tooltip/tooltip.js +63 -5
  43. package/dist/components/atoms/forms/checkbox/checkbox.d.ts +62 -4
  44. package/dist/components/atoms/forms/checkbox/checkbox.d.ts.map +1 -1
  45. package/dist/components/atoms/forms/checkbox/checkbox.js +58 -4
  46. package/dist/components/atoms/forms/field/field.d.ts +67 -0
  47. package/dist/components/atoms/forms/field/field.d.ts.map +1 -1
  48. package/dist/components/atoms/forms/field/field.js +47 -0
  49. package/dist/components/atoms/forms/form/form.d.ts +60 -0
  50. package/dist/components/atoms/forms/form/form.d.ts.map +1 -1
  51. package/dist/components/atoms/forms/form/form.js +3 -0
  52. package/dist/components/atoms/forms/input/input.d.ts +100 -1
  53. package/dist/components/atoms/forms/input/input.d.ts.map +1 -1
  54. package/dist/components/atoms/forms/input/input.js +82 -0
  55. package/dist/components/atoms/forms/input-otp/input-otp.d.ts +62 -0
  56. package/dist/components/atoms/forms/input-otp/input-otp.d.ts.map +1 -1
  57. package/dist/components/atoms/forms/input-otp/input-otp.js +50 -0
  58. package/dist/components/atoms/forms/label/label.d.ts +54 -0
  59. package/dist/components/atoms/forms/label/label.d.ts.map +1 -1
  60. package/dist/components/atoms/forms/label/label.js +50 -0
  61. package/dist/components/atoms/forms/radio-group/radio-group.d.ts +47 -0
  62. package/dist/components/atoms/forms/radio-group/radio-group.d.ts.map +1 -1
  63. package/dist/components/atoms/forms/radio-group/radio-group.js +43 -0
  64. package/dist/components/atoms/forms/select/select.d.ts +62 -0
  65. package/dist/components/atoms/forms/select/select.d.ts.map +1 -1
  66. package/dist/components/atoms/forms/select/select.js +62 -0
  67. package/dist/components/atoms/forms/slider/slider.d.ts +60 -0
  68. package/dist/components/atoms/forms/slider/slider.d.ts.map +1 -1
  69. package/dist/components/atoms/forms/slider/slider.js +53 -1
  70. package/dist/components/atoms/forms/switch/switch.d.ts +67 -0
  71. package/dist/components/atoms/forms/switch/switch.d.ts.map +1 -1
  72. package/dist/components/atoms/forms/switch/switch.js +63 -0
  73. package/dist/components/atoms/forms/textarea/textarea.d.ts +66 -0
  74. package/dist/components/atoms/forms/textarea/textarea.d.ts.map +1 -1
  75. package/dist/components/atoms/forms/textarea/textarea.js +13 -0
  76. package/dist/components/atoms/forms/toggle/toggle.d.ts +65 -1
  77. package/dist/components/atoms/forms/toggle/toggle.d.ts.map +1 -1
  78. package/dist/components/atoms/forms/toggle/toggle.js +58 -0
  79. package/dist/components/atoms/index.d.ts +0 -2
  80. package/dist/components/atoms/index.d.ts.map +1 -1
  81. package/dist/components/atoms/index.js +0 -1
  82. package/dist/components/atoms/layout/accordion/accordion.d.ts +84 -0
  83. package/dist/components/atoms/layout/accordion/accordion.d.ts.map +1 -1
  84. package/dist/components/atoms/layout/accordion/accordion.js +72 -0
  85. package/dist/components/atoms/layout/aspect-ratio/aspect-ratio.d.ts +54 -0
  86. package/dist/components/atoms/layout/aspect-ratio/aspect-ratio.d.ts.map +1 -1
  87. package/dist/components/atoms/layout/aspect-ratio/aspect-ratio.js +49 -0
  88. package/dist/components/atoms/layout/collapsible/collapsible.d.ts +47 -5
  89. package/dist/components/atoms/layout/collapsible/collapsible.d.ts.map +1 -1
  90. package/dist/components/atoms/layout/collapsible/collapsible.js +47 -5
  91. package/dist/components/atoms/layout/drawer/drawer.d.ts +55 -0
  92. package/dist/components/atoms/layout/drawer/drawer.d.ts.map +1 -1
  93. package/dist/components/atoms/layout/index.d.ts +2 -0
  94. package/dist/components/atoms/layout/index.d.ts.map +1 -1
  95. package/dist/components/atoms/layout/index.js +1 -0
  96. package/dist/components/atoms/layout/resizable/resizable.d.ts +77 -2
  97. package/dist/components/atoms/layout/resizable/resizable.d.ts.map +1 -1
  98. package/dist/components/atoms/layout/resizable/resizable.js +68 -0
  99. package/dist/components/atoms/layout/scroll-area/scroll-area.d.ts +34 -2
  100. package/dist/components/atoms/layout/scroll-area/scroll-area.d.ts.map +1 -1
  101. package/dist/components/atoms/layout/scroll-area/scroll-area.js +35 -3
  102. package/dist/components/atoms/layout/sidebar/sidebar.d.ts +66 -1
  103. package/dist/components/atoms/layout/sidebar/sidebar.d.ts.map +1 -1
  104. package/dist/components/atoms/layout/sidebar/sidebar.js +66 -0
  105. package/dist/components/atoms/layout/toggle-group/toggle-group.d.ts +73 -0
  106. package/dist/components/atoms/layout/toggle-group/toggle-group.d.ts.map +1 -1
  107. package/dist/components/atoms/layout/toggle-group/toggle-group.js +57 -0
  108. package/dist/components/atoms/layout/widget-resize-handle/index.d.ts +3 -0
  109. package/dist/components/atoms/layout/widget-resize-handle/index.d.ts.map +1 -0
  110. package/dist/components/atoms/layout/widget-resize-handle/index.js +1 -0
  111. package/dist/components/atoms/layout/widget-resize-handle/widget-resize-handle.d.ts +98 -0
  112. package/dist/components/atoms/layout/widget-resize-handle/widget-resize-handle.d.ts.map +1 -0
  113. package/dist/components/atoms/layout/widget-resize-handle/widget-resize-handle.js +117 -0
  114. package/dist/components/atoms/navigation/command/command.d.ts +7 -7
  115. package/dist/components/molecules/data-display/message/message.d.ts +22 -6
  116. package/dist/components/molecules/data-display/message/message.d.ts.map +1 -1
  117. package/dist/components/molecules/data-display/message/message.js +192 -8
  118. package/dist/components/molecules/draggable-widget/draggable-widget.d.ts.map +1 -1
  119. package/dist/components/molecules/draggable-widget/draggable-widget.js +6 -2
  120. package/dist/components/molecules/feedback/edit-chat-message-modal/edit-chat-message-modal.d.ts.map +1 -1
  121. package/dist/components/molecules/feedback/edit-chat-message-modal/edit-chat-message-modal.js +1 -1
  122. package/dist/components/molecules/forms/autocomplete/autocomplete-section.d.ts.map +1 -1
  123. package/dist/components/molecules/forms/autocomplete/autocomplete-section.js +3 -1
  124. package/dist/components/molecules/forms/chat-input/chat-input.d.ts.map +1 -1
  125. package/dist/components/molecules/forms/chat-input/chat-input.js +1 -1
  126. package/dist/components/molecules/forms/item/item.d.ts +1 -1
  127. package/dist/components/molecules/forms/text-editor/text-editor.d.ts.map +1 -1
  128. package/dist/components/molecules/navigation/menu-dock/menu-dock.js +1 -1
  129. package/dist/components/organisms/chat-log/chat-log.d.ts +1 -1
  130. package/dist/components/organisms/chat-log/chat-log.d.ts.map +1 -1
  131. package/dist/components/organisms/chat-log/chat-log.js +5 -5
  132. package/dist/components/organisms/document-editor/document-editor.d.ts.map +1 -1
  133. package/dist/components/organisms/document-editor/document-editor.js +2 -2
  134. package/dist/components/organisms/draggable-dashboard-grid/draggable-dashboard-grid.d.ts.map +1 -1
  135. package/dist/components/organisms/draggable-dashboard-grid/draggable-dashboard-grid.js +1 -1
  136. package/dist/components/organisms/form-layout/form-layout.d.ts.map +1 -1
  137. package/dist/components/organisms/form-layout/form-layout.js +3 -1
  138. package/dist/components/organisms/genealogy-canvas/genealogy-canvas.d.ts +0 -5
  139. package/dist/components/organisms/genealogy-canvas/genealogy-canvas.d.ts.map +1 -1
  140. package/dist/components/organisms/genealogy-canvas/genealogy-canvas.js +50 -55
  141. package/dist/components/organisms/model-selector/model-selector.d.ts +1 -1
  142. package/dist/components/organisms/prompt-input/index.d.ts +1 -1
  143. package/dist/components/organisms/prompt-input/index.d.ts.map +1 -1
  144. package/dist/components/organisms/prompt-input/index.js +1 -1
  145. package/dist/components/organisms/prompt-input/prompt-input.d.ts +22 -7
  146. package/dist/components/organisms/prompt-input/prompt-input.d.ts.map +1 -1
  147. package/dist/components/organisms/prompt-input/prompt-input.js +26 -17
  148. package/dist/index.js +480 -480
  149. package/dist/test/setup.d.ts +2 -0
  150. package/dist/test/setup.d.ts.map +1 -0
  151. package/dist/test/setup.js +43 -0
  152. package/package.json +18 -2
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Copyright 2023 Vercel, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Button } from '@repo/shadcn-ui/components/ui/button';
17
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@repo/shadcn-ui/components/ui/select';
18
+ import { Textarea } from '@repo/shadcn-ui/components/ui/textarea';
19
+ import type { ChatStatus } from 'ai';
20
+ import type { ComponentProps, HTMLAttributes } from 'react';
21
+ export type PromptInputProps = HTMLAttributes<HTMLFormElement>;
22
+ export declare const PromptInput: ({ className, ...props }: PromptInputProps) => import("react/jsx-runtime").JSX.Element;
23
+ export type PromptInputTextareaProps = ComponentProps<typeof Textarea> & {
24
+ minHeight?: number;
25
+ maxHeight?: number;
26
+ };
27
+ export declare const PromptInputTextarea: ({ onChange, className, placeholder, minHeight, maxHeight, ...props }: PromptInputTextareaProps) => import("react/jsx-runtime").JSX.Element;
28
+ export type PromptInputToolbarProps = HTMLAttributes<HTMLDivElement>;
29
+ export declare const PromptInputToolbar: ({ className, ...props }: PromptInputToolbarProps) => import("react/jsx-runtime").JSX.Element;
30
+ export type PromptInputToolsProps = HTMLAttributes<HTMLDivElement>;
31
+ export declare const PromptInputTools: ({ className, ...props }: PromptInputToolsProps) => import("react/jsx-runtime").JSX.Element;
32
+ export type PromptInputButtonProps = ComponentProps<typeof Button>;
33
+ export declare const PromptInputButton: ({ variant, className, size, ...props }: PromptInputButtonProps) => import("react/jsx-runtime").JSX.Element;
34
+ export type PromptInputSubmitProps = ComponentProps<typeof Button> & {
35
+ status?: ChatStatus;
36
+ };
37
+ export declare const PromptInputSubmit: ({ className, variant, size, status, children, ...props }: PromptInputSubmitProps) => import("react/jsx-runtime").JSX.Element;
38
+ export type PromptInputModelSelectProps = ComponentProps<typeof Select>;
39
+ export declare const PromptInputModelSelect: (props: PromptInputModelSelectProps) => import("react/jsx-runtime").JSX.Element;
40
+ export type PromptInputModelSelectTriggerProps = ComponentProps<typeof SelectTrigger>;
41
+ export declare const PromptInputModelSelectTrigger: ({ className, ...props }: PromptInputModelSelectTriggerProps) => import("react/jsx-runtime").JSX.Element;
42
+ export type PromptInputModelSelectContentProps = ComponentProps<typeof SelectContent>;
43
+ export declare const PromptInputModelSelectContent: ({ className, ...props }: PromptInputModelSelectContentProps) => import("react/jsx-runtime").JSX.Element;
44
+ export type PromptInputModelSelectItemProps = ComponentProps<typeof SelectItem>;
45
+ export declare const PromptInputModelSelectItem: ({ className, ...props }: PromptInputModelSelectItemProps) => import("react/jsx-runtime").JSX.Element;
46
+ export type PromptInputModelSelectValueProps = ComponentProps<typeof SelectValue>;
47
+ export declare const PromptInputModelSelectValue: ({ className, ...props }: PromptInputModelSelectValueProps) => import("react/jsx-runtime").JSX.Element;
48
+ //# sourceMappingURL=prompt-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-input.d.ts","sourceRoot":"","sources":["../../../../src/components/_reference/shadcn-ai/prompt-input.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,EACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAErC,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EAEf,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAE/D,eAAO,MAAM,WAAW,GAAI,yBAAyB,gBAAgB,4CAQpE,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,GAAG;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,sEAOjC,wBAAwB,4CAkC1B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAErE,eAAO,MAAM,kBAAkB,GAAI,yBAGhC,uBAAuB,4CAKzB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnE,eAAO,MAAM,gBAAgB,GAAI,yBAG9B,qBAAqB,4CASvB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAEnE,eAAO,MAAM,iBAAiB,GAAI,wCAK/B,sBAAsB,4CAkBxB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACnE,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,0DAO/B,sBAAsB,4CAsBxB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAExE,eAAO,MAAM,sBAAsB,GAAI,OAAO,2BAA2B,4CAExE,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,cAAc,CAC7D,OAAO,aAAa,CACrB,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,yBAG3C,kCAAkC,4CASpC,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,cAAc,CAC7D,OAAO,aAAa,CACrB,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,yBAG3C,kCAAkC,4CAEpC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAEhF,eAAO,MAAM,0BAA0B,GAAI,yBAGxC,+BAA+B,4CAEjC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,cAAc,CAC3D,OAAO,WAAW,CACnB,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,yBAGzC,gCAAgC,4CAElC,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Copyright 2023 Vercel, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ 'use client';
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ import { Button } from '@repo/shadcn-ui/components/ui/button';
19
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@repo/shadcn-ui/components/ui/select';
20
+ import { Textarea } from '@repo/shadcn-ui/components/ui/textarea';
21
+ import { cn } from '@repo/shadcn-ui/lib/utils';
22
+ import { Loader2Icon, SendIcon, SquareIcon, XIcon } from 'lucide-react';
23
+ import { Children } from 'react';
24
+ export const PromptInput = ({ className, ...props }) => (_jsx("form", { className: cn('w-full divide-y overflow-hidden rounded-xl border bg-background shadow-sm', className), ...props }));
25
+ export const PromptInputTextarea = ({ onChange, className, placeholder = 'What would you like to know?', minHeight = 48, maxHeight = 164, ...props }) => {
26
+ const handleKeyDown = (e) => {
27
+ if (e.key === 'Enter') {
28
+ if (e.shiftKey) {
29
+ // Allow newline
30
+ return;
31
+ }
32
+ // Submit on Enter (without Shift)
33
+ e.preventDefault();
34
+ const form = e.currentTarget.form;
35
+ if (form) {
36
+ form.requestSubmit();
37
+ }
38
+ }
39
+ };
40
+ return (_jsx(Textarea, { className: cn('w-full resize-none rounded-none border-none p-3 shadow-none outline-none ring-0', 'field-sizing-content max-h-[6lh] bg-transparent dark:bg-transparent', 'focus-visible:ring-0', className), name: "message", onChange: (e) => {
41
+ onChange?.(e);
42
+ }, onKeyDown: handleKeyDown, placeholder: placeholder, ...props }));
43
+ };
44
+ export const PromptInputToolbar = ({ className, ...props }) => (_jsx("div", { className: cn('flex items-center justify-between p-1', className), ...props }));
45
+ export const PromptInputTools = ({ className, ...props }) => (_jsx("div", { className: cn('flex items-center gap-1', '[&_button:first-child]:rounded-bl-xl', className), ...props }));
46
+ export const PromptInputButton = ({ variant = 'ghost', className, size, ...props }) => {
47
+ const newSize = (size ?? Children.count(props.children) > 1) ? 'default' : 'icon';
48
+ return (_jsx(Button, { className: cn('shrink-0 gap-1.5 rounded-lg', variant === 'ghost' && 'text-muted-foreground', newSize === 'default' && 'px-3', className), size: newSize, type: "button", variant: variant, ...props }));
49
+ };
50
+ export const PromptInputSubmit = ({ className, variant = 'default', size = 'icon', status, children, ...props }) => {
51
+ let Icon = _jsx(SendIcon, { className: "size-4" });
52
+ if (status === 'submitted') {
53
+ Icon = _jsx(Loader2Icon, { className: "size-4 animate-spin" });
54
+ }
55
+ else if (status === 'streaming') {
56
+ Icon = _jsx(SquareIcon, { className: "size-4" });
57
+ }
58
+ else if (status === 'error') {
59
+ Icon = _jsx(XIcon, { className: "size-4" });
60
+ }
61
+ return (_jsx(Button, { className: cn('gap-1.5 rounded-lg', className), size: size, type: "submit", variant: variant, ...props, children: children ?? Icon }));
62
+ };
63
+ export const PromptInputModelSelect = (props) => (_jsx(Select, { ...props }));
64
+ export const PromptInputModelSelectTrigger = ({ className, ...props }) => (_jsx(SelectTrigger, { className: cn('border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors', 'hover:bg-accent hover:text-foreground [&[aria-expanded="true"]]:bg-accent [&[aria-expanded="true"]]:text-foreground', className), ...props }));
65
+ export const PromptInputModelSelectContent = ({ className, ...props }) => (_jsx(SelectContent, { className: cn(className), ...props }));
66
+ export const PromptInputModelSelectItem = ({ className, ...props }) => (_jsx(SelectItem, { className: cn(className), ...props }));
67
+ export const PromptInputModelSelectValue = ({ className, ...props }) => (_jsx(SelectValue, { className: cn(className), ...props }));
@@ -1,12 +1,108 @@
1
+ /**
2
+ * # Badge Component
3
+ *
4
+ * O componente `Badge` é um elemento visual usado para destacar informações concisas como status,
5
+ * métricas, contadores ou rótulos. Ele fornece uma forma consistente de exibir informações
6
+ * secundárias de forma não intrusiva.
7
+ *
8
+ * ## Características Principais
9
+ *
10
+ * - **Variantes Semânticas**: Suporta múltiplas variantes (default, secondary, destructive, outline, success, warning, info)
11
+ * - **Tamanhos Flexíveis**: Três tamanhos disponíveis (sm, md, lg)
12
+ * - **Não Interativo**: Badge é puramente visual, não possui interação por padrão
13
+ * - **Acessível**: Suporta foco via teclado quando necessário
14
+ * - **Customizável**: Pode ser estilizado via className e props HTML padrão
15
+ *
16
+ * ## Variantes
17
+ *
18
+ * - **`default`**: Variante primária com cor de tema
19
+ * - **`secondary`**: Variante secundária com cor neutra
20
+ * - **`destructive`**: Variante para ações destrutivas ou erros
21
+ * - **`outline`**: Variante com borda e fundo transparente
22
+ * - **`success`**: Variante para sucesso ou confirmação (verde)
23
+ * - **`warning`**: Variante para avisos (amarelo)
24
+ * - **`info`**: Variante para informações (azul)
25
+ *
26
+ * ## Tamanhos
27
+ *
28
+ * - **`sm`**: Tamanho pequeno (px-2 py-0.5 text-xs)
29
+ * - **`md`**: Tamanho médio (px-2.5 py-0.5 text-xs) - padrão
30
+ * - **`lg`**: Tamanho grande (px-3 py-1 text-sm)
31
+ *
32
+ * ## Uso Básico
33
+ *
34
+ * ```tsx
35
+ * import { Badge } from "@flowtomic/ui/components/atoms/actions/badge";
36
+ *
37
+ * function MyComponent() {
38
+ * return (
39
+ * <div>
40
+ * <Badge>Novo</Badge>
41
+ * <Badge variant="success">Ativo</Badge>
42
+ * <Badge variant="destructive" size="sm">Erro</Badge>
43
+ * </div>
44
+ * );
45
+ * }
46
+ * ```
47
+ *
48
+ * ## Casos de Uso
49
+ *
50
+ * - **Status**: Exibir status de itens (ativo, inativo, pendente)
51
+ * - **Contadores**: Mostrar contadores ou números (notificações, itens)
52
+ * - **Métricas**: Exibir métricas com ícones (tendências, percentuais)
53
+ * - **Rótulos**: Rotular categorias ou tags
54
+ *
55
+ * ## Acessibilidade
56
+ *
57
+ * - Badge é renderizado como `<div>`, não possui role semântico por padrão
58
+ * - Para uso em contexto interativo, considere usar `Button` com variante apropriada
59
+ * - Suporta foco via teclado quando necessário (via tabIndex)
60
+ * - Use `aria-label` ou `aria-labelledby` quando o conteúdo não for auto-descritivo
61
+ *
62
+ * @see [Button Component](../button/button.tsx) para versão interativa
63
+ */
1
64
  import { type VariantProps } from "class-variance-authority";
2
65
  import React from "react";
66
+ /**
67
+ * Variantes de estilo do Badge usando class-variance-authority.
68
+ * Define as classes CSS para diferentes variantes e tamanhos.
69
+ */
3
70
  declare const badgeVariants: (props?: ({
4
- variant?: "default" | "destructive" | "outline" | "secondary" | "success" | "info" | "warning" | null | undefined;
71
+ variant?: "outline" | "default" | "destructive" | "secondary" | "success" | "info" | "warning" | null | undefined;
5
72
  size?: "sm" | "lg" | "md" | null | undefined;
6
73
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
74
+ /**
75
+ * Props do componente Badge.
76
+ *
77
+ * @interface BadgeProps
78
+ * @extends {React.HTMLAttributes<HTMLDivElement>}
79
+ * @extends {VariantProps<typeof badgeVariants>}
80
+ *
81
+ * @property {React.ReactNode} children - Conteúdo do badge (texto, ícones, etc.)
82
+ * @property {'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'info'} variant - Variante visual do badge
83
+ * @property {'sm' | 'md' | 'lg'} size - Tamanho do badge
84
+ * @property {string} className - Classes CSS adicionais
85
+ */
7
86
  export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
87
+ /** Conteúdo do badge (texto, ícones, etc.) */
8
88
  children: React.ReactNode;
9
89
  }
90
+ /**
91
+ * Componente Badge para destacar informações concisas.
92
+ *
93
+ * @component
94
+ * @param {BadgeProps} props - Props do componente
95
+ * @returns {JSX.Element} Elemento Badge renderizado
96
+ *
97
+ * @example
98
+ * ```tsx
99
+ * <Badge variant="success">Ativo</Badge>
100
+ * <Badge variant="destructive" size="sm">Erro</Badge>
101
+ * <Badge variant="info">
102
+ * <Icon /> 5
103
+ * </Badge>
104
+ * ```
105
+ */
10
106
  declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLDivElement>>;
11
107
  export { Badge, badgeVariants };
12
108
  //# sourceMappingURL=badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/actions/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,aAAa;;;8EA0BlB,CAAC;AAEF,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,QAAA,MAAM,KAAK,mFAQV,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/actions/badge/badge.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;;GAGG;AACH,QAAA,MAAM,aAAa;;;8EA0BlB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,8CAA8C;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,KAAK,mFAQV,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
@@ -1,7 +1,74 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * # Badge Component
4
+ *
5
+ * O componente `Badge` é um elemento visual usado para destacar informações concisas como status,
6
+ * métricas, contadores ou rótulos. Ele fornece uma forma consistente de exibir informações
7
+ * secundárias de forma não intrusiva.
8
+ *
9
+ * ## Características Principais
10
+ *
11
+ * - **Variantes Semânticas**: Suporta múltiplas variantes (default, secondary, destructive, outline, success, warning, info)
12
+ * - **Tamanhos Flexíveis**: Três tamanhos disponíveis (sm, md, lg)
13
+ * - **Não Interativo**: Badge é puramente visual, não possui interação por padrão
14
+ * - **Acessível**: Suporta foco via teclado quando necessário
15
+ * - **Customizável**: Pode ser estilizado via className e props HTML padrão
16
+ *
17
+ * ## Variantes
18
+ *
19
+ * - **`default`**: Variante primária com cor de tema
20
+ * - **`secondary`**: Variante secundária com cor neutra
21
+ * - **`destructive`**: Variante para ações destrutivas ou erros
22
+ * - **`outline`**: Variante com borda e fundo transparente
23
+ * - **`success`**: Variante para sucesso ou confirmação (verde)
24
+ * - **`warning`**: Variante para avisos (amarelo)
25
+ * - **`info`**: Variante para informações (azul)
26
+ *
27
+ * ## Tamanhos
28
+ *
29
+ * - **`sm`**: Tamanho pequeno (px-2 py-0.5 text-xs)
30
+ * - **`md`**: Tamanho médio (px-2.5 py-0.5 text-xs) - padrão
31
+ * - **`lg`**: Tamanho grande (px-3 py-1 text-sm)
32
+ *
33
+ * ## Uso Básico
34
+ *
35
+ * ```tsx
36
+ * import { Badge } from "@flowtomic/ui/components/atoms/actions/badge";
37
+ *
38
+ * function MyComponent() {
39
+ * return (
40
+ * <div>
41
+ * <Badge>Novo</Badge>
42
+ * <Badge variant="success">Ativo</Badge>
43
+ * <Badge variant="destructive" size="sm">Erro</Badge>
44
+ * </div>
45
+ * );
46
+ * }
47
+ * ```
48
+ *
49
+ * ## Casos de Uso
50
+ *
51
+ * - **Status**: Exibir status de itens (ativo, inativo, pendente)
52
+ * - **Contadores**: Mostrar contadores ou números (notificações, itens)
53
+ * - **Métricas**: Exibir métricas com ícones (tendências, percentuais)
54
+ * - **Rótulos**: Rotular categorias ou tags
55
+ *
56
+ * ## Acessibilidade
57
+ *
58
+ * - Badge é renderizado como `<div>`, não possui role semântico por padrão
59
+ * - Para uso em contexto interativo, considere usar `Button` com variante apropriada
60
+ * - Suporta foco via teclado quando necessário (via tabIndex)
61
+ * - Use `aria-label` ou `aria-labelledby` quando o conteúdo não for auto-descritivo
62
+ *
63
+ * @see [Button Component](../button/button.tsx) para versão interativa
64
+ */
2
65
  import { cva } from "class-variance-authority";
3
66
  import React from "react";
4
67
  import { cn } from "@/lib/utils";
68
+ /**
69
+ * Variantes de estilo do Badge usando class-variance-authority.
70
+ * Define as classes CSS para diferentes variantes e tamanhos.
71
+ */
5
72
  const badgeVariants = cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
6
73
  variants: {
7
74
  variant: {
@@ -24,6 +91,22 @@ const badgeVariants = cva("inline-flex items-center rounded-full border px-2.5 p
24
91
  size: "md",
25
92
  },
26
93
  });
94
+ /**
95
+ * Componente Badge para destacar informações concisas.
96
+ *
97
+ * @component
98
+ * @param {BadgeProps} props - Props do componente
99
+ * @returns {JSX.Element} Elemento Badge renderizado
100
+ *
101
+ * @example
102
+ * ```tsx
103
+ * <Badge variant="success">Ativo</Badge>
104
+ * <Badge variant="destructive" size="sm">Erro</Badge>
105
+ * <Badge variant="info">
106
+ * <Icon /> 5
107
+ * </Badge>
108
+ * ```
109
+ */
27
110
  const Badge = React.forwardRef(({ className, variant, size, children, ...props }, ref) => {
28
111
  return (_jsx("div", { ref: ref, className: cn(badgeVariants({ variant, size }), className), ...props, children: children }));
29
112
  });
@@ -1,15 +1,148 @@
1
+ /**
2
+ * # Button Component
3
+ *
4
+ * O componente `Button` é um elemento interativo usado para acionar ações ou eventos dentro da interface do usuário.
5
+ * Ele fornece uma forma consistente e acessível de criar botões com múltiplas variantes de estilo e tamanhos.
6
+ *
7
+ * ## Características Principais
8
+ *
9
+ * - **Variantes Semânticas**: Suporta múltiplas variantes (default, destructive, outline, secondary, ghost, link, success, info, natural)
10
+ * - **Tamanhos Flexíveis**: Múltiplos tamanhos incluindo opções para ícones (default, sm, lg, icon, icon-sm, icon-lg)
11
+ * - **Animações Opcionais**: Suporta animações sutis via Framer Motion quando `animated={true}`
12
+ * - **Composição**: Suporta composição via `asChild` usando Radix UI Slot
13
+ * - **Acessível**: Segue padrões WAI-ARIA e suporta navegação por teclado
14
+ * - **Customizável**: Pode ser estilizado via className e props HTML padrão
15
+ *
16
+ * ## Variantes
17
+ *
18
+ * - **`default`**: Variante primária com cor de tema e sombra
19
+ * - **`destructive`**: Variante para ações destrutivas ou perigosas
20
+ * - **`outline`**: Variante com borda e fundo transparente
21
+ * - **`secondary`**: Variante secundária com cor neutra
22
+ * - **`ghost`**: Variante sem fundo, apenas texto
23
+ * - **`link`**: Variante estilizada como link
24
+ * - **`success`**: Variante para ações de sucesso (verde)
25
+ * - **`info`**: Variante para informações (accent)
26
+ * - **`natural`**: Variante com estilo natural e borda
27
+ *
28
+ * ## Tamanhos
29
+ *
30
+ * - **`default`**: Tamanho padrão (h-9 px-4 py-2)
31
+ * - **`sm`**: Tamanho pequeno (h-8 px-3 text-xs)
32
+ * - **`lg`**: Tamanho grande (h-10 px-8)
33
+ * - **`icon`**: Tamanho para ícone (h-9 w-9)
34
+ * - **`icon-sm`**: Tamanho pequeno para ícone (size-8)
35
+ * - **`icon-lg`**: Tamanho grande para ícone (size-10)
36
+ *
37
+ * ## Props Especiais
38
+ *
39
+ * - **`asChild`**: Quando `true`, o Button não renderiza um elemento próprio, mas passa suas props para o primeiro filho usando Radix UI Slot
40
+ * - **`animated`**: Quando `true`, aplica animações sutis de hover e tap via Framer Motion
41
+ * - **`transition`**: Permite customizar a transição de animação quando `animated={true}`
42
+ *
43
+ * ## Uso Básico
44
+ *
45
+ * ```tsx
46
+ * import { Button } from "@flowtomic/ui/components/atoms/actions/button";
47
+ *
48
+ * function MyComponent() {
49
+ * return (
50
+ * <div>
51
+ * <Button>Clique aqui</Button>
52
+ * <Button variant="destructive">Excluir</Button>
53
+ * <Button variant="outline" size="sm">Cancelar</Button>
54
+ * <Button animated>Animado</Button>
55
+ * </div>
56
+ * );
57
+ * }
58
+ * ```
59
+ *
60
+ * ## Composição com asChild
61
+ *
62
+ * ```tsx
63
+ * import { Button } from "@flowtomic/ui/components/atoms/actions/button";
64
+ * import { Link } from "react-router-dom";
65
+ *
66
+ * function MyComponent() {
67
+ * return (
68
+ * <Button asChild>
69
+ * <Link to="/page">Navegar</Link>
70
+ * </Button>
71
+ * );
72
+ * }
73
+ * ```
74
+ *
75
+ * ## Acessibilidade
76
+ *
77
+ * - Renderizado como `<button>` por padrão, garantindo semântica correta
78
+ * - Suporta navegação por teclado (Tab, Enter, Espaço)
79
+ * - Suporta estados disabled com feedback visual
80
+ * - Suporta aria-* attributes para melhor acessibilidade
81
+ * - Quando `asChild={true}`, o elemento filho deve ser acessível
82
+ *
83
+ * @see [Radix UI Slot](https://www.radix-ui.com/primitives/docs/utilities/slot) para mais sobre composição
84
+ * @see [Framer Motion](https://www.framer.com/motion/) para mais sobre animações
85
+ */
1
86
  import { type VariantProps } from "class-variance-authority";
2
87
  import { type Transition } from "motion/react";
3
88
  import * as React from "react";
89
+ /**
90
+ * Variantes de estilo do Button usando class-variance-authority.
91
+ * Define as classes CSS para diferentes variantes e tamanhos.
92
+ */
4
93
  declare const buttonVariants: (props?: ({
5
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "success" | "info" | "natural" | null | undefined;
94
+ variant?: "link" | "outline" | "default" | "destructive" | "secondary" | "ghost" | "success" | "info" | "natural" | null | undefined;
6
95
  size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
7
96
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
97
+ /**
98
+ * Props do componente Button.
99
+ *
100
+ * @interface ButtonProps
101
+ * @extends {Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "transition">}
102
+ * @extends {VariantProps<typeof buttonVariants>}
103
+ *
104
+ * @property {boolean} [asChild=false] - Quando `true`, passa props para o primeiro filho usando Radix UI Slot
105
+ * @property {boolean} [animated=false] - Quando `true`, aplica animações sutis via Framer Motion
106
+ * @property {Transition} [transition] - Configuração de transição customizada para animações
107
+ * @property {'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link' | 'success' | 'info' | 'natural'} [variant='default'] - Variante visual do botão
108
+ * @property {'default' | 'sm' | 'lg' | 'icon' | 'icon-sm' | 'icon-lg'} [size='default'] - Tamanho do botão
109
+ * @property {string} [className] - Classes CSS adicionais
110
+ * @property {React.ReactNode} [children] - Conteúdo do botão (texto, ícones, etc.)
111
+ */
8
112
  export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "transition">, VariantProps<typeof buttonVariants> {
113
+ /**
114
+ * Quando `true`, o Button não renderiza um elemento próprio, mas passa suas props
115
+ * para o primeiro filho usando Radix UI Slot. Útil para composição com outros componentes.
116
+ */
9
117
  asChild?: boolean;
118
+ /**
119
+ * Quando `true`, aplica animações sutis de hover e tap via Framer Motion.
120
+ * As animações incluem scale no hover (1.02) e no tap (0.98).
121
+ */
10
122
  animated?: boolean;
123
+ /**
124
+ * Configuração de transição customizada para animações quando `animated={true}`.
125
+ * Se não fornecido, usa transição spring padrão.
126
+ */
11
127
  transition?: Transition;
12
128
  }
129
+ /**
130
+ * Componente Button para acionar ações ou eventos.
131
+ *
132
+ * @component
133
+ * @param {ButtonProps} props - Props do componente
134
+ * @returns {JSX.Element} Elemento Button renderizado
135
+ *
136
+ * @example
137
+ * ```tsx
138
+ * <Button variant="default">Clique aqui</Button>
139
+ * <Button variant="destructive" size="sm">Excluir</Button>
140
+ * <Button animated>Animado</Button>
141
+ * <Button asChild>
142
+ * <Link to="/page">Navegar</Link>
143
+ * </Button>
144
+ * ```
145
+ */
13
146
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
14
147
  export { Button, buttonVariants };
15
148
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/actions/button/button.tsx"],"names":[],"mappings":"AACA,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,QAAA,MAAM,cAAc;;;8EA+BnB,CAAC;AAEF,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC,EACvE,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,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;;;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,9 +1,98 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * # Button Component
4
+ *
5
+ * O componente `Button` é um elemento interativo usado para acionar ações ou eventos dentro da interface do usuário.
6
+ * Ele fornece uma forma consistente e acessível de criar botões com múltiplas variantes de estilo e tamanhos.
7
+ *
8
+ * ## Características Principais
9
+ *
10
+ * - **Variantes Semânticas**: Suporta múltiplas variantes (default, destructive, outline, secondary, ghost, link, success, info, natural)
11
+ * - **Tamanhos Flexíveis**: Múltiplos tamanhos incluindo opções para ícones (default, sm, lg, icon, icon-sm, icon-lg)
12
+ * - **Animações Opcionais**: Suporta animações sutis via Framer Motion quando `animated={true}`
13
+ * - **Composição**: Suporta composição via `asChild` usando Radix UI Slot
14
+ * - **Acessível**: Segue padrões WAI-ARIA e suporta navegação por teclado
15
+ * - **Customizável**: Pode ser estilizado via className e props HTML padrão
16
+ *
17
+ * ## Variantes
18
+ *
19
+ * - **`default`**: Variante primária com cor de tema e sombra
20
+ * - **`destructive`**: Variante para ações destrutivas ou perigosas
21
+ * - **`outline`**: Variante com borda e fundo transparente
22
+ * - **`secondary`**: Variante secundária com cor neutra
23
+ * - **`ghost`**: Variante sem fundo, apenas texto
24
+ * - **`link`**: Variante estilizada como link
25
+ * - **`success`**: Variante para ações de sucesso (verde)
26
+ * - **`info`**: Variante para informações (accent)
27
+ * - **`natural`**: Variante com estilo natural e borda
28
+ *
29
+ * ## Tamanhos
30
+ *
31
+ * - **`default`**: Tamanho padrão (h-9 px-4 py-2)
32
+ * - **`sm`**: Tamanho pequeno (h-8 px-3 text-xs)
33
+ * - **`lg`**: Tamanho grande (h-10 px-8)
34
+ * - **`icon`**: Tamanho para ícone (h-9 w-9)
35
+ * - **`icon-sm`**: Tamanho pequeno para ícone (size-8)
36
+ * - **`icon-lg`**: Tamanho grande para ícone (size-10)
37
+ *
38
+ * ## Props Especiais
39
+ *
40
+ * - **`asChild`**: Quando `true`, o Button não renderiza um elemento próprio, mas passa suas props para o primeiro filho usando Radix UI Slot
41
+ * - **`animated`**: Quando `true`, aplica animações sutis de hover e tap via Framer Motion
42
+ * - **`transition`**: Permite customizar a transição de animação quando `animated={true}`
43
+ *
44
+ * ## Uso Básico
45
+ *
46
+ * ```tsx
47
+ * import { Button } from "@flowtomic/ui/components/atoms/actions/button";
48
+ *
49
+ * function MyComponent() {
50
+ * return (
51
+ * <div>
52
+ * <Button>Clique aqui</Button>
53
+ * <Button variant="destructive">Excluir</Button>
54
+ * <Button variant="outline" size="sm">Cancelar</Button>
55
+ * <Button animated>Animado</Button>
56
+ * </div>
57
+ * );
58
+ * }
59
+ * ```
60
+ *
61
+ * ## Composição com asChild
62
+ *
63
+ * ```tsx
64
+ * import { Button } from "@flowtomic/ui/components/atoms/actions/button";
65
+ * import { Link } from "react-router-dom";
66
+ *
67
+ * function MyComponent() {
68
+ * return (
69
+ * <Button asChild>
70
+ * <Link to="/page">Navegar</Link>
71
+ * </Button>
72
+ * );
73
+ * }
74
+ * ```
75
+ *
76
+ * ## Acessibilidade
77
+ *
78
+ * - Renderizado como `<button>` por padrão, garantindo semântica correta
79
+ * - Suporta navegação por teclado (Tab, Enter, Espaço)
80
+ * - Suporta estados disabled com feedback visual
81
+ * - Suporta aria-* attributes para melhor acessibilidade
82
+ * - Quando `asChild={true}`, o elemento filho deve ser acessível
83
+ *
84
+ * @see [Radix UI Slot](https://www.radix-ui.com/primitives/docs/utilities/slot) para mais sobre composição
85
+ * @see [Framer Motion](https://www.framer.com/motion/) para mais sobre animações
86
+ */
2
87
  import { Slot } from "@radix-ui/react-slot";
3
88
  import { cva } from "class-variance-authority";
4
89
  import { motion } from "motion/react";
5
90
  import * as React from "react";
6
91
  import { cn } from "@/lib/utils";
92
+ /**
93
+ * Variantes de estilo do Button usando class-variance-authority.
94
+ * Define as classes CSS para diferentes variantes e tamanhos.
95
+ */
7
96
  const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
8
97
  variants: {
9
98
  variant: {
@@ -31,6 +120,23 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
31
120
  size: "default",
32
121
  },
33
122
  });
123
+ /**
124
+ * Componente Button para acionar ações ou eventos.
125
+ *
126
+ * @component
127
+ * @param {ButtonProps} props - Props do componente
128
+ * @returns {JSX.Element} Elemento Button renderizado
129
+ *
130
+ * @example
131
+ * ```tsx
132
+ * <Button variant="default">Clique aqui</Button>
133
+ * <Button variant="destructive" size="sm">Excluir</Button>
134
+ * <Button animated>Animado</Button>
135
+ * <Button asChild>
136
+ * <Link to="/page">Navegar</Link>
137
+ * </Button>
138
+ * ```
139
+ */
34
140
  const Button = React.forwardRef(({ className, variant, size, asChild = false, animated = false, transition, ...props }, ref) => {
35
141
  const baseClassName = cn(buttonVariants({ variant, size, className }));
36
142
  if (animated && !asChild) {