@humain/ui 2.2.6 → 2.2.9
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/dist/index101.js +2 -2
- package/dist/index101.js.map +1 -1
- package/dist/index103.js +3 -3
- package/dist/index103.js.map +1 -1
- package/dist/index108.js +1 -1
- package/dist/index108.js.map +1 -1
- package/dist/index117.js +1 -1
- package/dist/index117.js.map +1 -1
- package/dist/index122.js +6 -6
- package/dist/index122.js.map +1 -1
- package/dist/index126.js +1 -1
- package/dist/index126.js.map +1 -1
- package/dist/index130.js +2 -2
- package/dist/index130.js.map +1 -1
- package/dist/index146.js +4 -4
- package/dist/index146.js.map +1 -1
- package/dist/index152.js +1 -1
- package/dist/index152.js.map +1 -1
- package/dist/index154.js +2 -2
- package/dist/index154.js.map +1 -1
- package/dist/index166.js +1 -1
- package/dist/index166.js.map +1 -1
- package/dist/index168.js +1 -1
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +1 -1
- package/dist/index169.js.map +1 -1
- package/dist/index173.js +2 -2
- package/dist/index173.js.map +1 -1
- package/dist/index175.js +4 -4
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +2 -2
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +2 -2
- package/dist/index177.js.map +1 -1
- package/dist/index184.js +1 -1
- package/dist/index184.js.map +1 -1
- package/dist/index191.js +3 -3
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +2 -2
- package/dist/index192.js.map +1 -1
- package/dist/index201.js +2 -2
- package/dist/index201.js.map +1 -1
- package/dist/index204.js +4 -4
- package/dist/index204.js.map +1 -1
- package/dist/index228.js +1 -1
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +1 -1
- package/dist/index229.js.map +1 -1
- package/dist/index24.js +2 -2
- package/dist/index24.js.map +1 -1
- package/dist/index5.js +1 -1
- package/dist/index5.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/wc/AICodeBlock.js +41 -41
- package/dist/wc/AICodeBlock.js.map +1 -1
- package/dist/wc/AIMermaidDiagram.js +7 -7
- package/dist/wc/AIMermaidDiagram.js.map +1 -1
- package/dist/wc/AIMessage.js +6 -6
- package/dist/wc/AIMessage.js.map +1 -1
- package/dist/wc/AISource.js +2 -2
- package/dist/wc/AISource.js.map +1 -1
- package/dist/wc/AIToolCall.js +1 -1
- package/dist/wc/AIToolCall.js.map +1 -1
- package/dist/wc/Breadcrumb.js +43 -43
- package/dist/wc/Breadcrumb.js.map +1 -1
- package/dist/wc/DropdownMenu.js +9 -9
- package/dist/wc/DropdownMenu.js.map +1 -1
- package/dist/wc/Kbd.js +22 -22
- package/dist/wc/Kbd.js.map +1 -1
- package/dist/wc/button.js +7 -7
- package/dist/wc/button.js.map +1 -1
- package/dist/wc/close-button.js +19 -19
- package/dist/wc/close-button.js.map +1 -1
- package/dist/wc/hf-ai-prompt-suggestion.js +14 -14
- package/dist/wc/hf-ai-prompt-suggestion.js.map +1 -1
- package/dist/wc/hf-ai-reasoning-block.js +13 -13
- package/dist/wc/hf-ai-reasoning-block.js.map +1 -1
- package/dist/wc/hf-ai-steps.js +53 -53
- package/dist/wc/hf-ai-steps.js.map +1 -1
- package/dist/wc/hf-ai-system-message.js +26 -26
- package/dist/wc/hf-ai-system-message.js.map +1 -1
- package/dist/wc/hf-code-snippet.js +35 -35
- package/dist/wc/hf-code-snippet.js.map +1 -1
- package/dist/wc/hf-command-menu.js +39 -39
- package/dist/wc/hf-command-menu.js.map +1 -1
- package/dist/wc/hf-data-table.js +3 -3
- package/dist/wc/hf-data-table.js.map +1 -1
- package/dist/wc/hf-display-value.js +50 -50
- package/dist/wc/hf-display-value.js.map +1 -1
- package/dist/wc/hf-nav-account-menu.js +5 -5
- package/dist/wc/hf-nav-account-menu.js.map +1 -1
- package/dist/wc/hf-rich-textarea.js +1 -1
- package/dist/wc/hf-rich-textarea.js.map +1 -1
- package/dist/wc/hf-steps.js +8 -8
- package/dist/wc/hf-steps.js.map +1 -1
- package/dist/wc/markdown-renderer.js +1 -1
- package/dist/wc/markdown-renderer.js.map +1 -1
- package/dist/wc/selection-group.js +26 -26
- package/dist/wc/selection-group.js.map +1 -1
- package/dist/wc/syntax-highlight.js +4 -4
- package/dist/wc/syntax-highlight.js.map +1 -1
- package/dist/wc/workflow-step-renderer.js +51 -51
- package/dist/wc/workflow-step-renderer.js.map +1 -1
- package/dist/wc-react/AICodeBlock.js +17 -17
- package/dist/wc-react/AICodeBlock.js.map +1 -1
- package/dist/wc-react/AIMermaidDiagram.js +16 -16
- package/dist/wc-react/AIMermaidDiagram.js.map +1 -1
- package/dist/wc-react/AIMessage.js +7 -7
- package/dist/wc-react/AIMessage.js.map +1 -1
- package/dist/wc-react/AISource.js +41 -41
- package/dist/wc-react/AISource.js.map +1 -1
- package/dist/wc-react/AIToolCall.js +6 -6
- package/dist/wc-react/AIToolCall.js.map +1 -1
- package/dist/wc-react/Breadcrumb.js +18 -18
- package/dist/wc-react/Breadcrumb.js.map +1 -1
- package/dist/wc-react/DropdownMenu.js +27 -27
- package/dist/wc-react/DropdownMenu.js.map +1 -1
- package/dist/wc-react/Kbd.js +17 -17
- package/dist/wc-react/Kbd.js.map +1 -1
- package/dist/wc-react/button.js +12 -12
- package/dist/wc-react/button.js.map +1 -1
- package/dist/wc-react/close-button.js +19 -19
- package/dist/wc-react/close-button.js.map +1 -1
- package/dist/wc-react/hf-ai-prompt-suggestion.js +1 -1
- package/dist/wc-react/hf-ai-prompt-suggestion.js.map +1 -1
- package/dist/wc-react/hf-ai-reasoning-block.js +1 -1
- package/dist/wc-react/hf-ai-reasoning-block.js.map +1 -1
- package/dist/wc-react/hf-ai-steps.js +33 -33
- package/dist/wc-react/hf-ai-steps.js.map +1 -1
- package/dist/wc-react/hf-ai-system-message.js +9 -9
- package/dist/wc-react/hf-ai-system-message.js.map +1 -1
- package/dist/wc-react/hf-code-snippet.js +3 -3
- package/dist/wc-react/hf-code-snippet.js.map +1 -1
- package/dist/wc-react/hf-command-menu.js +56 -56
- package/dist/wc-react/hf-command-menu.js.map +1 -1
- package/dist/wc-react/hf-data-table.js +3 -3
- package/dist/wc-react/hf-data-table.js.map +1 -1
- package/dist/wc-react/hf-display-value.js +58 -58
- package/dist/wc-react/hf-display-value.js.map +1 -1
- package/dist/wc-react/hf-nav-account-menu.js +7 -7
- package/dist/wc-react/hf-nav-account-menu.js.map +1 -1
- package/dist/wc-react/hf-rich-textarea.js +5 -5
- package/dist/wc-react/hf-rich-textarea.js.map +1 -1
- package/dist/wc-react/hf-steps.js +2 -2
- package/dist/wc-react/hf-steps.js.map +1 -1
- package/dist/wc-react/markdown-renderer.js +1 -1
- package/dist/wc-react/markdown-renderer.js.map +1 -1
- package/dist/wc-react/selection-group.js +7 -7
- package/dist/wc-react/selection-group.js.map +1 -1
- package/dist/wc-react/syntax-highlight.js +4 -4
- package/dist/wc-react/syntax-highlight.js.map +1 -1
- package/dist/wc-react/workflow-step-renderer.js +44 -44
- package/dist/wc-react/workflow-step-renderer.js.map +1 -1
- package/package.json +1 -1
- package/skills/humain-ui/SKILL.md +1 -1
- package/skills/humain-ui-wc/SKILL.md +1 -1
- package/skills/humain-ui-wc.skill +0 -0
- package/skills/humain-ui.skill +0 -0
- package/src/tokens.css +4 -0
package/dist/wc-react/Kbd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Kbd.js","names":[],"sources":["../../src/components/molecules/data/Kbd/Kbd.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// ============================================\n// Variants\n// ============================================\n\nexport const kbdVariants = cva(\n 'pointer-events-none inline-flex items-center justify-center select-none font-sans font-medium',\n {\n variants: {\n variant: {\n default:\n 'bg-muted text-muted-foreground border border-border rounded-sm shadow-[var(--shadow-kbd-default)]',\n ghost: 'bg-transparent text-muted-foreground',\n outline:\n 'bg-transparent border border-border text-muted-foreground rounded-sm shadow-[var(--shadow-kbd-outline)]',\n solid:\n 'bg-card/60 border border-border text-muted-foreground rounded shadow-[var(--shadow-kbd-default)]',\n tooltip:\n 'bg-background/20 text-background dark:bg-background/10 rounded-sm',\n footer:\n 'bg-background border border-border text-
|
|
1
|
+
{"version":3,"file":"Kbd.js","names":[],"sources":["../../src/components/molecules/data/Kbd/Kbd.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// ============================================\n// Variants\n// ============================================\n\nexport const kbdVariants = cva(\n 'pointer-events-none inline-flex items-center justify-center select-none font-sans font-medium',\n {\n variants: {\n variant: {\n default:\n 'bg-muted text-muted-foreground border border-border rounded-sm shadow-[var(--shadow-kbd-default)]',\n ghost: 'bg-transparent text-muted-foreground',\n outline:\n 'bg-transparent border border-border text-muted-foreground rounded-sm shadow-[var(--shadow-kbd-outline)]',\n solid:\n 'bg-card/60 border border-border text-muted-foreground rounded shadow-[var(--shadow-kbd-default)]',\n tooltip:\n 'bg-background/20 text-background dark:bg-background/10 rounded-sm',\n footer:\n 'bg-background border border-border text-secondary-foreground rounded-md shadow-[var(--shadow-kbd-footer)]',\n },\n size: {\n xs: 'h-4 min-w-4 px-0.5 text-[10px]',\n sm: 'h-5 min-w-5 px-1 text-xs',\n md: 'h-6 min-w-6 px-1.5 text-sm',\n lg: 'h-7 min-w-7 px-2 text-sm',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'sm',\n },\n },\n);\n\nexport const kbdGroupVariants = cva('inline-flex items-center', {\n variants: {\n gap: {\n none: 'gap-0',\n xs: 'gap-0.5',\n sm: 'gap-1',\n md: 'gap-1.5',\n lg: 'gap-2',\n },\n },\n defaultVariants: {\n gap: 'sm',\n },\n});\n\n// ============================================\n// Types\n// ============================================\n\nexport interface KbdProps\n extends React.ComponentProps<'kbd'>,\n VariantProps<typeof kbdVariants> {\n /** Icon to display before the key */\n icon?: React.ReactNode;\n /** Icon to display after the key */\n iconAfter?: React.ReactNode;\n}\n\nexport interface KbdGroupProps\n extends React.ComponentProps<'span'>,\n VariantProps<typeof kbdGroupVariants> {}\n\n// ============================================\n// Kbd Component\n// ============================================\n\n/**\n * Keyboard key indicator component for displaying keyboard shortcuts.\n *\n * @example\n * // Basic usage\n * <Kbd>⌘K</Kbd>\n *\n * @example\n * // With variant and size\n * <Kbd variant=\"solid\" size=\"md\">⌘</Kbd>\n *\n * @example\n * // With icon\n * <Kbd icon={<ArrowUp />} />\n */\nconst Kbd = React.forwardRef<HTMLElement, KbdProps>(\n ({ className, variant, size, icon, iconAfter, children, ...props }, ref) => {\n return (\n <kbd\n ref={ref}\n data-slot=\"kbd\"\n className={cn(kbdVariants({ variant, size }), className)}\n {...props}\n >\n {icon && (\n <span\n aria-hidden=\"true\"\n className=\"shrink-0 [&_svg:not([class*='size-'])]:size-3\"\n >\n {icon}\n </span>\n )}\n {children}\n {iconAfter && (\n <span\n aria-hidden=\"true\"\n className=\"shrink-0 [&_svg:not([class*='size-'])]:size-3\"\n >\n {iconAfter}\n </span>\n )}\n </kbd>\n );\n },\n);\nKbd.displayName = 'Kbd';\n\n// ============================================\n// KbdGroup Component\n// ============================================\n\n/**\n * Group multiple Kbd components together with consistent spacing.\n *\n * @example\n * <KbdGroup>\n * <Kbd>⌘</Kbd>\n * <Kbd>K</Kbd>\n * </KbdGroup>\n */\nconst KbdGroup = React.forwardRef<HTMLSpanElement, KbdGroupProps>(\n ({ className, gap, ...props }, ref) => {\n return (\n <span\n ref={ref}\n data-slot=\"kbd-group\"\n className={cn(kbdGroupVariants({ gap }), className)}\n {...props}\n />\n );\n },\n);\nKbdGroup.displayName = 'KbdGroup';\n\n// ============================================\n// Shortcut Component (convenience wrapper)\n// ============================================\n\nexport interface ShortcutProps extends Omit<KbdProps, 'children'> {\n /** Array of keys to display (e.g., ['⌘', 'K']) */\n keys: (string | React.ReactNode)[];\n /** Separator between keys (defaults to none, keys are grouped) */\n separator?: React.ReactNode;\n}\n\nfunction getShortcutPartKey(\n key: string | React.ReactNode,\n position: number,\n): string {\n return `${position}:${typeof key === 'string' ? key : 'node'}`;\n}\n\n/**\n * Convenience component for displaying keyboard shortcuts with multiple keys.\n *\n * @example\n * // Simple shortcut\n * <Shortcut keys={['⌘', 'K']} />\n *\n * @example\n * // With separator\n * <Shortcut keys={['⌘', 'Shift', 'P']} separator=\"+\" />\n */\nconst Shortcut = React.forwardRef<HTMLSpanElement, ShortcutProps>(\n ({ keys, separator, className, variant, size, ...props }, ref) => {\n if (separator) {\n return (\n <KbdGroup ref={ref} gap=\"xs\" className={className}>\n {keys.map((key, position) => (\n <React.Fragment key={getShortcutPartKey(key, position)}>\n <Kbd variant={variant} size={size} {...props}>\n {key}\n </Kbd>\n {position < keys.length - 1 && (\n <span className=\"text-muted-foreground text-xs\">\n {separator}\n </span>\n )}\n </React.Fragment>\n ))}\n </KbdGroup>\n );\n }\n\n return (\n <KbdGroup ref={ref} gap=\"xs\" className={className}>\n {keys.map((key, position) => (\n <Kbd\n key={getShortcutPartKey(key, position)}\n variant={variant}\n size={size}\n {...props}\n >\n {key}\n </Kbd>\n ))}\n </KbdGroup>\n );\n },\n);\nShortcut.displayName = 'Shortcut';\n\n// ============================================\n// Platform-aware helpers\n// ============================================\n\n/**\n * Common keyboard key symbols for macOS\n */\nexport const MAC_KEYS = {\n cmd: '⌘',\n command: '⌘',\n ctrl: '⌃',\n control: '⌃',\n alt: '⌥',\n option: '⌥',\n shift: '⇧',\n enter: '↵',\n return: '↵',\n backspace: '⌫',\n delete: '⌦',\n tab: '⇥',\n esc: 'esc',\n escape: 'esc',\n up: '↑',\n down: '↓',\n left: '←',\n right: '→',\n space: '␣',\n} as const;\n\n/**\n * Common keyboard key symbols for Windows/Linux\n */\nexport const WIN_KEYS = {\n cmd: 'Ctrl',\n command: 'Ctrl',\n ctrl: 'Ctrl',\n control: 'Ctrl',\n alt: 'Alt',\n option: 'Alt',\n shift: 'Shift',\n enter: 'Enter',\n return: 'Enter',\n backspace: 'Backspace',\n delete: 'Delete',\n tab: 'Tab',\n esc: 'Esc',\n escape: 'Esc',\n up: '↑',\n down: '↓',\n left: '←',\n right: '→',\n space: 'Space',\n} as const;\n\n// ============================================\n// Exports\n// ============================================\n\nexport { Kbd, KbdGroup, Shortcut };\n"],"mappings":";;;;AAWA,IAAa,IAAc,EACzB,iGACA;AAAA,EACE,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SACE;AAAA,MACF,OAAO;AAAA,MACP,SACE;AAAA,MACF,OACE;AAAA,MACF,SACE;AAAA,MACF,QACE;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACF,CACF,GAEa,IAAmB,EAAI,4BAA4B;AAAA,EAC9D,UAAU,EACR,KAAK;AAAA,IACH,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EACN,EACF;AAAA,EACA,iBAAiB,EACf,KAAK,KACP;AACF,CAAC,GAsCK,IAAM,EAAM,WAAA,CACf,EAAE,WAAA,GAAW,SAAA,GAAS,MAAA,GAAM,MAAA,GAAM,WAAA,GAAW,UAAA,GAAU,GAAG,EAAA,GAAS,MAEhE,gBAAA,EAAC,OAAD;AAAA,EACO,KAAA;AAAA,EACL,aAAU;AAAA,EACV,WAAW,EAAG,EAAY;AAAA,IAAE,SAAA;AAAA,IAAS,MAAA;AAAA,EAAK,CAAC,GAAG,CAAS;AAAA,EACvD,GAAI;AAAA,YAJN;AAAA,IAMG,KACC,gBAAA,EAAC,QAAD;AAAA,MACE,eAAY;AAAA,MACZ,WAAU;AAAA,gBAET;AAAA,IACG,CAAA;AAAA,IAEP;AAAA,IACA,KACC,gBAAA,EAAC,QAAD;AAAA,MACE,eAAY;AAAA,MAC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ACO,CAAA,CAGhB;AACA,EAAS,cAAc"}
|
package/dist/wc-react/button.js
CHANGED
|
@@ -4,7 +4,7 @@ import { t as T } from "./x.js";
|
|
|
4
4
|
import { t as P } from "./useRenderElement.js";
|
|
5
5
|
import { t as U } from "./dist.js";
|
|
6
6
|
import { t as W } from "./useButton.js";
|
|
7
|
-
import { n as
|
|
7
|
+
import { n as G, t as j } from "./spinner.js";
|
|
8
8
|
import * as l from "react";
|
|
9
9
|
import { jsx as r, jsxs as A } from "react/jsx-runtime";
|
|
10
10
|
var C = /* @__PURE__ */ l.forwardRef(function(e, t) {
|
|
@@ -18,7 +18,7 @@ var C = /* @__PURE__ */ l.forwardRef(function(e, t) {
|
|
|
18
18
|
ref: [t, y],
|
|
19
19
|
props: [x, g]
|
|
20
20
|
});
|
|
21
|
-
}), c = "focus-visible:scale-[1.015] motion-reduce:focus-visible:scale-100",
|
|
21
|
+
}), c = "focus-visible:scale-[1.015] motion-reduce:focus-visible:scale-100", H = U("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:aria-invalid:border-destructive/50 border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex origin-center items-center justify-center whitespace-nowrap transition-[color,background-color,border-color,box-shadow,transform,opacity] duration-200 ease-smooth motion-reduce:transition-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none", {
|
|
22
22
|
variants: {
|
|
23
23
|
appearance: {
|
|
24
24
|
solid: `${c} delight-click-ripple`,
|
|
@@ -289,20 +289,20 @@ var C = /* @__PURE__ */ l.forwardRef(function(e, t) {
|
|
|
289
289
|
size: "default",
|
|
290
290
|
shape: "rounded"
|
|
291
291
|
}
|
|
292
|
-
}),
|
|
292
|
+
}), M = {
|
|
293
293
|
success: "bg-success",
|
|
294
294
|
error: "bg-destructive",
|
|
295
295
|
warning: "bg-warning",
|
|
296
296
|
brand: "bg-primary",
|
|
297
297
|
gray: "bg-muted"
|
|
298
|
-
},
|
|
298
|
+
}, X = [
|
|
299
299
|
"icon",
|
|
300
300
|
"icon-xs",
|
|
301
301
|
"icon-sm",
|
|
302
302
|
"icon-lg",
|
|
303
303
|
"icon-xl",
|
|
304
304
|
"icon-2xl"
|
|
305
|
-
],
|
|
305
|
+
], Z = 600, q = {
|
|
306
306
|
round: "rounded-full",
|
|
307
307
|
rounded: "rounded-sm"
|
|
308
308
|
}, J = {
|
|
@@ -321,7 +321,7 @@ var C = /* @__PURE__ */ l.forwardRef(function(e, t) {
|
|
|
321
321
|
destructive: "bg-soft-destructive text-soft-destructive-foreground hover:bg-opacity-destructive-20 dark:bg-soft-destructive dark:text-soft-destructive-foreground"
|
|
322
322
|
}, Q = ({ color: a = "success", className: e }) => /* @__PURE__ */ r("span", {
|
|
323
323
|
"aria-hidden": "true",
|
|
324
|
-
className: n("size-2 rounded-full shrink-0 delight-breathing",
|
|
324
|
+
className: n("size-2 rounded-full shrink-0 delight-breathing", M[a], e)
|
|
325
325
|
});
|
|
326
326
|
function Y({ appearance: a, badge: e, shape: t, variant: o }) {
|
|
327
327
|
if (l.isValidElement(e)) return e;
|
|
@@ -329,7 +329,7 @@ function Y({ appearance: a, badge: e, shape: t, variant: o }) {
|
|
|
329
329
|
const d = (a === "solid" || a === "gradient") && o !== "secondary" ? "white" : "soft";
|
|
330
330
|
return /* @__PURE__ */ r("span", {
|
|
331
331
|
"data-slot": "badge",
|
|
332
|
-
className: n("inline-flex h-5 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap px-2 py-0.5 text-xs font-medium transition-colors [&>svg]:size-3 [&>svg]:shrink-0 [&>svg]:pointer-events-none",
|
|
332
|
+
className: n("inline-flex h-5 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap px-2 py-0.5 text-xs font-medium transition-colors [&>svg]:size-3 [&>svg]:shrink-0 [&>svg]:pointer-events-none", q[t], d === "white" ? "bg-opacity-white-80 transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-current/50" : K[o], d === "white" && J[o]),
|
|
333
333
|
children: e
|
|
334
334
|
});
|
|
335
335
|
}
|
|
@@ -354,10 +354,10 @@ var I = l.forwardRef(({ children: a, loading: e = !1, disabled: t, startIcon: o,
|
|
|
354
354
|
...z,
|
|
355
355
|
visible: !1
|
|
356
356
|
} : z);
|
|
357
|
-
},
|
|
357
|
+
}, Z);
|
|
358
358
|
return () => clearTimeout(F);
|
|
359
359
|
}, [s.visible, s.token]);
|
|
360
|
-
const f = s.visible && !e, m = N === "ai", O = m ? x ?? e : !1, w = n(
|
|
360
|
+
const f = s.visible && !e, m = N === "ai", O = m ? x ?? e : !1, w = n(H({
|
|
361
361
|
appearance: N,
|
|
362
362
|
variant: S,
|
|
363
363
|
shape: _,
|
|
@@ -371,7 +371,7 @@ var I = l.forwardRef(({ children: a, loading: e = !1, disabled: t, startIcon: o,
|
|
|
371
371
|
...u,
|
|
372
372
|
children: a
|
|
373
373
|
});
|
|
374
|
-
const k = B ||
|
|
374
|
+
const k = B || X.includes($), R = !k && !u["aria-label"] && !u["aria-labelledby"] && (typeof a == "string" || typeof a == "number") && (typeof i == "string" || typeof i == "number") ? {
|
|
375
375
|
...u,
|
|
376
376
|
"aria-label": `${a} ${i}`
|
|
377
377
|
} : u, D = k ? null : /* @__PURE__ */ r(Y, {
|
|
@@ -407,7 +407,7 @@ var I = l.forwardRef(({ children: a, loading: e = !1, disabled: t, startIcon: o,
|
|
|
407
407
|
})
|
|
408
408
|
]
|
|
409
409
|
});
|
|
410
|
-
return m ? /* @__PURE__ */ r(
|
|
410
|
+
return m ? /* @__PURE__ */ r(G, {
|
|
411
411
|
ref: v,
|
|
412
412
|
animated: O,
|
|
413
413
|
active: !0,
|
|
@@ -424,7 +424,7 @@ function ee({ className: a, size: e = "icon-sm", ...t }) {
|
|
|
424
424
|
variant: "secondary",
|
|
425
425
|
size: e,
|
|
426
426
|
iconOnly: !0,
|
|
427
|
-
className: n("text-
|
|
427
|
+
className: n("text-muted-foreground hover:text-secondary-foreground", a),
|
|
428
428
|
"aria-label": "Clear",
|
|
429
429
|
...t,
|
|
430
430
|
children: /* @__PURE__ */ r(T, {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":["Button"],"sources":["../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/button/Button.mjs","../../src/components/ui/button.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useButton } from \"../internals/use-button/useButton.mjs\";\nimport { useRenderElement } from \"../internals/useRenderElement.mjs\";\n/**\n * A button component that can be used to trigger actions.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Button](https://base-ui.com/react/components/button)\n */\nexport const Button = /*#__PURE__*/React.forwardRef(function Button(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled = false,\n focusableWhenDisabled = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled,\n native: nativeButton\n });\n const state = {\n disabled\n };\n return useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef],\n props: [elementProps, getButtonProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") Button.displayName = \"Button\";","import { Button as ButtonPrimitive } from '@base-ui/react/button';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Check, X } from 'lucide-react';\nimport * as React from 'react';\nimport { GradientBorder } from '@/components/ui/gradient-border';\nimport { Spinner } from '@/components/ui/spinner';\nimport { cn } from '@/lib/utils';\n\nconst buttonFocusExpansionClassName =\n 'focus-visible:scale-[1.015] motion-reduce:focus-visible:scale-100';\n\nconst buttonVariants = cva(\n \"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:aria-invalid:border-destructive/50 border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex origin-center items-center justify-center whitespace-nowrap transition-[color,background-color,border-color,box-shadow,transform,opacity] duration-200 ease-smooth motion-reduce:transition-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n appearance: {\n solid: `${buttonFocusExpansionClassName} delight-click-ripple`,\n gradient: `${buttonFocusExpansionClassName} bg-linear-[113deg] hover:opacity-80 delight-click-ripple`,\n soft: `${buttonFocusExpansionClassName} delight-click-ripple`,\n outline: `${buttonFocusExpansionClassName} bg-background shadow-xs`,\n ghost: `${buttonFocusExpansionClassName} bg-transparent`,\n link: 'border-none bg-transparent p-0 h-auto underline-offset-4 hover:underline focus-visible:ring-0 focus-visible:border-transparent',\n ai: `${buttonFocusExpansionClassName} bg-transparent border-0`,\n },\n variant: {\n primary: '',\n secondary: '',\n info: '',\n success: '',\n warning: '',\n destructive: '',\n },\n size: {\n default:\n 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2',\n xs: \"h-6 gap-1 px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: 'h-8 gap-1 px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5',\n md: 'h-10 gap-1.5 px-3.5 has-data-[icon=inline-end]:pe-3 has-data-[icon=inline-start]:ps-3',\n lg: 'h-11 gap-2 px-4 has-data-[icon=inline-end]:pe-3.5 has-data-[icon=inline-start]:ps-3.5',\n xl: \"h-12 gap-2 px-4.5 text-base has-data-[icon=inline-end]:pe-4 has-data-[icon=inline-start]:ps-4 [&_svg:not([class*='size-'])]:size-5\",\n '2xl':\n \"h-14 gap-2.5 px-5 text-lg has-data-[icon=inline-end]:pe-4.5 has-data-[icon=inline-start]:ps-4.5 [&_svg:not([class*='size-'])]:size-6\",\n icon: 'size-9',\n 'icon-xs': \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n 'icon-xl': \"size-12 [&_svg:not([class*='size-'])]:size-5\",\n 'icon-2xl': \"size-14 [&_svg:not([class*='size-'])]:size-6\",\n },\n shape: {\n rounded: 'rounded-md',\n round: 'rounded-full',\n },\n },\n compoundVariants: [\n // ===== SOLID =====\n {\n appearance: 'solid',\n variant: 'primary',\n className: 'bg-primary text-primary-foreground hover:bg-primary-hover',\n },\n {\n appearance: 'solid',\n variant: 'secondary',\n className:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',\n },\n {\n appearance: 'solid',\n variant: 'info',\n className: 'bg-info text-info-foreground hover:bg-info/80',\n },\n {\n appearance: 'solid',\n variant: 'success',\n className: 'bg-success text-success-foreground hover:bg-success/80',\n },\n {\n appearance: 'solid',\n variant: 'warning',\n className: 'bg-warning text-warning-foreground hover:bg-warning/80',\n },\n {\n appearance: 'solid',\n variant: 'destructive',\n className:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/80',\n },\n\n // ===== GRADIENT =====\n {\n appearance: 'gradient',\n variant: 'primary',\n className:\n 'from-custom-tw-gradient-from to-custom-tw-gradient-to text-primary-foreground hover:from-custom-tw-gradient-to hover:to-custom-tw-gradient-from',\n },\n {\n appearance: 'gradient',\n variant: 'secondary',\n className:\n 'from-secondary to-secondary/60 text-secondary-foreground hover:from-secondary/60 hover:to-secondary',\n },\n {\n appearance: 'gradient',\n variant: 'info',\n className:\n 'from-info to-info/60 text-info-foreground hover:from-info/60 hover:to-info',\n },\n {\n appearance: 'gradient',\n variant: 'success',\n className:\n 'from-success to-success/60 text-success-foreground hover:from-success/60 hover:to-success',\n },\n {\n appearance: 'gradient',\n variant: 'warning',\n className:\n 'from-warning to-warning/60 text-warning-foreground hover:from-warning/60 hover:to-warning',\n },\n {\n appearance: 'gradient',\n variant: 'destructive',\n className:\n 'from-destructive to-destructive/60 text-destructive-foreground hover:from-destructive/60 hover:to-destructive',\n },\n\n // ===== SOFT =====\n {\n appearance: 'soft',\n variant: 'primary',\n className:\n 'bg-primary/10 border-primary text-primary hover:bg-primary/20 hover:text-primary dark:bg-primary/30 dark:border-primary dark:text-primary dark:hover:bg-primary/50 shadow-xs',\n },\n {\n appearance: 'soft',\n variant: 'secondary',\n className:\n 'bg-secondary/10 text-secondary-foreground hover:bg-secondary/20',\n },\n {\n appearance: 'soft',\n variant: 'info',\n className: 'bg-info/10 text-info hover:bg-info/20',\n },\n {\n appearance: 'soft',\n variant: 'success',\n className: 'bg-success/10 text-success hover:bg-success/20',\n },\n {\n appearance: 'soft',\n variant: 'warning',\n className: 'bg-warning/10 text-warning hover:bg-warning/20',\n },\n {\n appearance: 'soft',\n variant: 'destructive',\n className:\n 'bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30',\n },\n\n // ===== OUTLINE =====\n {\n appearance: 'outline',\n className:\n 'bg-card border-border backdrop-blur-[2px] shadow-none supports-backdrop-filter:backdrop-blur-[2px]',\n },\n {\n appearance: 'outline',\n shape: 'rounded',\n className: 'rounded-xl',\n },\n {\n appearance: 'outline',\n size: 'xs',\n className: 'h-[26px] gap-1 px-2',\n },\n {\n appearance: 'outline',\n size: 'sm',\n className: 'h-8 gap-1.5 px-2.5',\n },\n {\n appearance: 'outline',\n size: 'default',\n className: 'h-9 gap-2 px-4',\n },\n {\n appearance: 'outline',\n size: 'md',\n className: 'h-10 gap-2 px-4',\n },\n {\n appearance: 'outline',\n size: 'lg',\n className: 'h-10 gap-2 px-4.5',\n },\n {\n appearance: 'outline',\n variant: 'primary',\n className: 'border-border text-foreground hover:bg-muted/50',\n },\n {\n appearance: 'outline',\n variant: 'secondary',\n className:\n 'border-border text-secondary-foreground hover:bg-muted/50 aria-expanded:bg-muted/50 aria-expanded:text-foreground',\n },\n {\n appearance: 'outline',\n variant: 'info',\n className: 'border-border text-info hover:bg-info/10',\n },\n {\n appearance: 'outline',\n variant: 'success',\n className: 'border-border text-success hover:bg-success/10',\n },\n {\n appearance: 'outline',\n variant: 'warning',\n className: 'border-border text-warning hover:bg-warning/10',\n },\n {\n appearance: 'outline',\n variant: 'destructive',\n className: 'border-border text-destructive hover:bg-destructive/10',\n },\n\n // ===== GHOST =====\n {\n appearance: 'ghost',\n variant: 'primary',\n className: 'text-primary hover:bg-primary/10',\n },\n {\n appearance: 'ghost',\n variant: 'secondary',\n className:\n 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',\n },\n {\n appearance: 'ghost',\n variant: 'info',\n className: 'text-info hover:bg-info/10',\n },\n {\n appearance: 'ghost',\n variant: 'success',\n className: 'text-success hover:bg-success/10',\n },\n {\n appearance: 'ghost',\n variant: 'warning',\n className: 'text-warning hover:bg-warning/10',\n },\n {\n appearance: 'ghost',\n variant: 'destructive',\n className: 'text-destructive hover:bg-destructive/10',\n },\n\n // ===== AI (inner button styling — GradientBorder wraps externally) =====\n {\n appearance: 'ai',\n variant: 'primary',\n className: 'text-primary hover:bg-primary/10',\n },\n {\n appearance: 'ai',\n variant: 'secondary',\n className: 'text-secondary-foreground hover:bg-muted',\n },\n\n // ===== LINK =====\n { appearance: 'link', variant: 'primary', className: 'text-primary' },\n {\n appearance: 'link',\n variant: 'secondary',\n className: 'text-secondary-foreground',\n },\n { appearance: 'link', variant: 'info', className: 'text-info' },\n { appearance: 'link', variant: 'success', className: 'text-success' },\n { appearance: 'link', variant: 'warning', className: 'text-warning' },\n {\n appearance: 'link',\n variant: 'destructive',\n className: 'text-destructive hover:text-destructive/80',\n },\n ],\n defaultVariants: {\n appearance: 'solid',\n variant: 'primary',\n size: 'default',\n shape: 'rounded',\n },\n },\n);\n\ntype DotColor = 'success' | 'error' | 'warning' | 'brand' | 'gray';\n\ntype ButtonAppearance =\n | 'solid'\n | 'gradient'\n | 'soft'\n | 'outline'\n | 'ghost'\n | 'link'\n | 'ai';\ntype ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'info'\n | 'success'\n | 'warning'\n | 'destructive';\ntype ButtonShape = 'rounded' | 'round';\n\n/**\n * Render prop type for polymorphic rendering.\n * Accepts either a React element or a function that receives props and returns an element.\n * @template Props The props to be passed to the rendered element\n */\ntype RenderProp<Props> =\n | React.ReactElement\n | ((props: Props) => React.ReactElement);\n\nexport interface ButtonProps\n extends React.ComponentProps<'button'>,\n Pick<VariantProps<typeof buttonVariants>, 'size'> {\n /** Visual appearance - how the button renders */\n appearance?: ButtonAppearance;\n /** Semantic variant - what the button means */\n variant?: ButtonVariant;\n /** Shape of the button corners */\n shape?: ButtonShape;\n /** Shows a loading spinner and disables the button */\n loading?: boolean;\n /** Set to false when render targets a non-button element. */\n nativeButton?: boolean;\n /** Icon displayed at the start (inline-start) of the button text - respects RTL */\n startIcon?: React.ReactNode;\n /** Icon displayed at the end (inline-end) of the button text - respects RTL */\n endIcon?: React.ReactNode;\n /** Shows a colored dot indicator before the button text */\n dotIndicator?: boolean;\n /** Color of the dot indicator */\n dotColor?: DotColor;\n /** Badge content displayed after the button label. Text badges are styled from the button appearance and variant. */\n badge?: React.ReactNode;\n /** For icon-only buttons - renders just the icon without text wrapper */\n iconOnly?: boolean;\n /** Enables animated gradient border (only for appearance=\"ai\"). Auto-true when loading. */\n animated?: boolean;\n /**\n * Render prop for polymorphic rendering. Accepts either a React element or a render function.\n * Use this to render the button as a different element (e.g., link) while preserving button styles.\n * Note: When render is provided, loading/startIcon/endIcon/dotIndicator/badge are ignored.\n */\n render?: RenderProp<React.ComponentProps<'button'>>;\n}\n\nconst dotColorClasses: Record<DotColor, string> = {\n success: 'bg-success',\n error: 'bg-destructive',\n warning: 'bg-warning',\n brand: 'bg-primary',\n gray: 'bg-muted',\n};\n\nconst devWarnings = new Set<string>();\n\n/** Icon-only size variants for type-safe detection */\nconst ICON_SIZES = [\n 'icon',\n 'icon-xs',\n 'icon-sm',\n 'icon-lg',\n 'icon-xl',\n 'icon-2xl',\n] as const;\n\nconst SUCCESS_FLASH_DURATION_MS = 600;\n\nconst buttonBadgeShapeClasses: Record<ButtonShape, string> = {\n round: 'rounded-full',\n rounded: 'rounded-sm',\n};\n\nconst buttonBadgeWhiteColorClasses: Record<ButtonVariant, string> = {\n primary: 'text-primary',\n secondary: 'text-secondary-foreground',\n info: 'text-info',\n success: 'text-success',\n warning: 'text-warning',\n destructive: 'text-destructive',\n};\n\nconst buttonBadgeSoftColorClasses: Record<ButtonVariant, string> = {\n primary:\n 'bg-soft-primary text-soft-primary-foreground hover:bg-opacity-primary-20 dark:bg-soft-primary dark:text-soft-primary-foreground',\n secondary:\n 'bg-soft-secondary text-soft-secondary-foreground hover:bg-opacity-secondary-20 dark:bg-soft-secondary dark:text-soft-secondary-foreground',\n info: 'bg-soft-info text-soft-info-foreground hover:bg-opacity-info-20 dark:bg-soft-info dark:text-soft-info-foreground',\n success:\n 'bg-soft-success text-soft-success-foreground hover:bg-opacity-success-20 dark:bg-soft-success dark:text-soft-success-foreground',\n warning:\n 'bg-soft-warning text-soft-warning-foreground hover:bg-opacity-warning-20 dark:bg-soft-warning dark:text-soft-warning-foreground',\n destructive:\n 'bg-soft-destructive text-soft-destructive-foreground hover:bg-opacity-destructive-20 dark:bg-soft-destructive dark:text-soft-destructive-foreground',\n};\n\ntype LoadingSuccessState = {\n wasLoading: boolean;\n visible: boolean;\n token: number;\n};\n\nconst Dot = ({\n color = 'success',\n className,\n}: {\n color?: DotColor;\n className?: string;\n}) => (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'size-2 rounded-full shrink-0 delight-breathing',\n dotColorClasses[color],\n className,\n )}\n />\n);\n\nfunction ButtonBadge({\n appearance,\n badge,\n shape,\n variant,\n}: {\n appearance: ButtonAppearance;\n badge: React.ReactNode;\n shape: ButtonShape;\n variant: ButtonVariant;\n}) {\n if (React.isValidElement(badge)) {\n return badge;\n }\n\n if (badge === true || badge === false || badge == null) {\n return null;\n }\n\n const badgeVariant =\n (appearance === 'solid' || appearance === 'gradient') &&\n variant !== 'secondary'\n ? 'white'\n : 'soft';\n\n return (\n <span\n data-slot=\"badge\"\n className={cn(\n 'inline-flex h-5 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap px-2 py-0.5 text-xs font-medium transition-colors [&>svg]:size-3 [&>svg]:shrink-0 [&>svg]:pointer-events-none',\n buttonBadgeShapeClasses[shape],\n badgeVariant === 'white'\n ? 'bg-opacity-white-80 transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-current/50'\n : buttonBadgeSoftColorClasses[variant],\n badgeVariant === 'white' && buttonBadgeWhiteColorClasses[variant],\n )}\n >\n {badge}\n </span>\n );\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n children,\n loading = false,\n disabled,\n startIcon,\n endIcon,\n dotIndicator = false,\n dotColor = 'success',\n badge,\n iconOnly = false,\n animated,\n render,\n className,\n appearance = 'solid',\n variant = 'primary',\n shape = 'rounded',\n size = 'default',\n ...props\n },\n ref,\n ) => {\n // Dev-mode warning for icon-only buttons missing accessible label (once)\n if (\n process.env.NODE_ENV !== 'production' &&\n !devWarnings.has('icon-a11y')\n ) {\n const hasIconSize = ICON_SIZES.includes(\n size as (typeof ICON_SIZES)[number],\n );\n if (\n (iconOnly || hasIconSize) &&\n !props['aria-label'] &&\n !props['aria-labelledby']\n ) {\n devWarnings.add('icon-a11y');\n console.warn(\n 'Button: Icon-only buttons require an `aria-label` or `aria-labelledby` for accessibility.',\n );\n }\n }\n\n // Track loading→done transition before paint so the button never commits a\n // stale success state after the loading prop changes.\n const [successState, setSuccessState] = React.useState<LoadingSuccessState>(\n () => ({\n wasLoading: loading,\n visible: false,\n token: 0,\n }),\n );\n\n if (successState.wasLoading !== loading) {\n const shouldFlash = successState.wasLoading && !loading;\n setSuccessState({\n wasLoading: loading,\n visible: shouldFlash,\n token: shouldFlash ? successState.token + 1 : successState.token,\n });\n }\n\n React.useEffect(() => {\n if (!successState.visible) return;\n const token = successState.token;\n const timer = setTimeout(() => {\n setSuccessState((current) =>\n current.token === token ? { ...current, visible: false } : current,\n );\n }, SUCCESS_FLASH_DURATION_MS);\n return () => clearTimeout(timer);\n }, [successState.visible, successState.token]);\n\n const showSuccess = successState.visible && !loading;\n\n const isAi = appearance === 'ai';\n const isAnimated = isAi ? (animated ?? loading) : false;\n\n const buttonClassName = cn(\n buttonVariants({ appearance, variant, shape, size }),\n className,\n );\n\n // When render prop is provided, pass through to primitive\n // (ignores loading/startIcon/endIcon/dotIndicator/badge)\n if (render) {\n return (\n <ButtonPrimitive\n ref={ref}\n data-slot=\"button\"\n className={buttonClassName}\n render={render}\n {...props}\n >\n {children}\n </ButtonPrimitive>\n );\n }\n\n // Determine if this is an icon-only button based on size or explicit prop\n const isIconOnly =\n iconOnly || ICON_SIZES.includes(size as (typeof ICON_SIZES)[number]);\n const shouldComposeBadgeLabel =\n !isIconOnly &&\n !props['aria-label'] &&\n !props['aria-labelledby'] &&\n (typeof children === 'string' || typeof children === 'number') &&\n (typeof badge === 'string' || typeof badge === 'number');\n const buttonProps = shouldComposeBadgeLabel\n ? { ...props, 'aria-label': `${children} ${badge}` }\n : props;\n const buttonBadge = !isIconOnly ? (\n <ButtonBadge\n appearance={appearance}\n badge={badge}\n shape={shape}\n variant={variant}\n />\n ) : null;\n\n // Build the button element (icon-only or full)\n const buttonElement = isIconOnly ? (\n <ButtonPrimitive\n ref={isAi ? undefined : ref}\n data-slot=\"button\"\n disabled={disabled || loading}\n className={cn(buttonClassName, loading && 'relative')}\n {...buttonProps}\n >\n {loading ? (\n <Spinner className=\"delight-fade-in\" />\n ) : showSuccess ? (\n <Check className=\"delight-bounce-in\" />\n ) : (\n children\n )}\n </ButtonPrimitive>\n ) : (\n <ButtonPrimitive\n ref={isAi ? undefined : ref}\n data-slot=\"button\"\n disabled={disabled || loading}\n className={cn(buttonClassName, (loading || showSuccess) && 'relative')}\n {...buttonProps}\n >\n {loading && <Spinner className=\"absolute delight-fade-in\" />}\n {showSuccess && !loading && (\n <Check className=\"absolute delight-bounce-in\" />\n )}\n <span\n className={cn(\n 'flex items-center gap-2',\n (loading || showSuccess) && 'invisible',\n )}\n >\n {dotIndicator && <Dot color={dotColor} />}\n {startIcon}\n {children}\n {endIcon}\n {buttonBadge}\n </span>\n </ButtonPrimitive>\n );\n\n if (isAi) {\n return (\n <GradientBorder\n ref={ref as React.Ref<HTMLDivElement>}\n animated={isAnimated}\n active\n disabled={disabled}\n className=\"w-auto inline-flex motion-reduce:animate-none\"\n innerClassName=\"flex\"\n >\n {buttonElement}\n </GradientBorder>\n );\n }\n\n return buttonElement;\n },\n);\n\nButton.displayName = 'Button';\n\n/**\n * Clear/Close icon button - a ghost button specifically for close/clear actions\n * Commonly used in tags, dialogs, and dismissible elements\n */\nexport interface ClearButtonProps\n extends Omit<\n ButtonProps,\n | 'appearance'\n | 'variant'\n | 'children'\n | 'startIcon'\n | 'endIcon'\n | 'dotIndicator'\n > {\n /** Size of the clear button */\n size?: 'icon-xs' | 'icon-sm' | 'icon' | 'icon-lg' | 'icon-xl' | 'icon-2xl';\n}\n\nfunction ClearButton({\n className,\n size = 'icon-sm',\n ...props\n}: ClearButtonProps) {\n return (\n <Button\n appearance=\"ghost\"\n variant=\"secondary\"\n size={size}\n iconOnly\n className={cn(\n 'text-text-quaternary hover:text-secondary-foreground',\n className,\n )}\n aria-label=\"Clear\"\n {...props}\n >\n <X />\n </Button>\n );\n}\n\nClearButton.displayName = 'ClearButton';\n\nexport type { ButtonAppearance, ButtonShape, ButtonVariant };\nexport { Button, buttonVariants, ClearButton, Dot };\n"],"x_google_ignoreList":[0],"mappings":";;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D;AAAA,IACE,YAAW;AAAA,IACX,SAAQ;AAAA,IACF,MAAA;AAAA,IACN,UAAA;AAAA,IACA,WAAW,EACT,wDACA,CACF;AAAA,IACA,cAAW;AAAA,IACX,GAAI;AAAA,cAEJ,gBAAA,EAAC,GAAD,CAAI,CAAA;AAAA,EACE,CAAA;AAEZ;AAEA,GAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"button.js","names":["Button"],"sources":["../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/@base-ui+react@1.6.0+1c528c44af60ea5b/node_modules/@base-ui/react/button/Button.mjs","../../src/components/ui/button.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useButton } from \"../internals/use-button/useButton.mjs\";\nimport { useRenderElement } from \"../internals/useRenderElement.mjs\";\n/**\n * A button component that can be used to trigger actions.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Button](https://base-ui.com/react/components/button)\n */\nexport const Button = /*#__PURE__*/React.forwardRef(function Button(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled = false,\n focusableWhenDisabled = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled,\n native: nativeButton\n });\n const state = {\n disabled\n };\n return useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef],\n props: [elementProps, getButtonProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") Button.displayName = \"Button\";","import { Button as ButtonPrimitive } from '@base-ui/react/button';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Check, X } from 'lucide-react';\nimport * as React from 'react';\nimport { GradientBorder } from '@/components/ui/gradient-border';\nimport { Spinner } from '@/components/ui/spinner';\nimport { cn } from '@/lib/utils';\n\nconst buttonFocusExpansionClassName =\n 'focus-visible:scale-[1.015] motion-reduce:focus-visible:scale-100';\n\nconst buttonVariants = cva(\n \"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:aria-invalid:border-destructive/50 border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex origin-center items-center justify-center whitespace-nowrap transition-[color,background-color,border-color,box-shadow,transform,opacity] duration-200 ease-smooth motion-reduce:transition-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n appearance: {\n solid: `${buttonFocusExpansionClassName} delight-click-ripple`,\n gradient: `${buttonFocusExpansionClassName} bg-linear-[113deg] hover:opacity-80 delight-click-ripple`,\n soft: `${buttonFocusExpansionClassName} delight-click-ripple`,\n outline: `${buttonFocusExpansionClassName} bg-background shadow-xs`,\n ghost: `${buttonFocusExpansionClassName} bg-transparent`,\n link: 'border-none bg-transparent p-0 h-auto underline-offset-4 hover:underline focus-visible:ring-0 focus-visible:border-transparent',\n ai: `${buttonFocusExpansionClassName} bg-transparent border-0`,\n },\n variant: {\n primary: '',\n secondary: '',\n info: '',\n success: '',\n warning: '',\n destructive: '',\n },\n size: {\n default:\n 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2',\n xs: \"h-6 gap-1 px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: 'h-8 gap-1 px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5',\n md: 'h-10 gap-1.5 px-3.5 has-data-[icon=inline-end]:pe-3 has-data-[icon=inline-start]:ps-3',\n lg: 'h-11 gap-2 px-4 has-data-[icon=inline-end]:pe-3.5 has-data-[icon=inline-start]:ps-3.5',\n xl: \"h-12 gap-2 px-4.5 text-base has-data-[icon=inline-end]:pe-4 has-data-[icon=inline-start]:ps-4 [&_svg:not([class*='size-'])]:size-5\",\n '2xl':\n \"h-14 gap-2.5 px-5 text-lg has-data-[icon=inline-end]:pe-4.5 has-data-[icon=inline-start]:ps-4.5 [&_svg:not([class*='size-'])]:size-6\",\n icon: 'size-9',\n 'icon-xs': \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n 'icon-xl': \"size-12 [&_svg:not([class*='size-'])]:size-5\",\n 'icon-2xl': \"size-14 [&_svg:not([class*='size-'])]:size-6\",\n },\n shape: {\n rounded: 'rounded-md',\n round: 'rounded-full',\n },\n },\n compoundVariants: [\n // ===== SOLID =====\n {\n appearance: 'solid',\n variant: 'primary',\n className: 'bg-primary text-primary-foreground hover:bg-primary-hover',\n },\n {\n appearance: 'solid',\n variant: 'secondary',\n className:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',\n },\n {\n appearance: 'solid',\n variant: 'info',\n className: 'bg-info text-info-foreground hover:bg-info/80',\n },\n {\n appearance: 'solid',\n variant: 'success',\n className: 'bg-success text-success-foreground hover:bg-success/80',\n },\n {\n appearance: 'solid',\n variant: 'warning',\n className: 'bg-warning text-warning-foreground hover:bg-warning/80',\n },\n {\n appearance: 'solid',\n variant: 'destructive',\n className:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/80',\n },\n\n // ===== GRADIENT =====\n {\n appearance: 'gradient',\n variant: 'primary',\n className:\n 'from-custom-tw-gradient-from to-custom-tw-gradient-to text-primary-foreground hover:from-custom-tw-gradient-to hover:to-custom-tw-gradient-from',\n },\n {\n appearance: 'gradient',\n variant: 'secondary',\n className:\n 'from-secondary to-secondary/60 text-secondary-foreground hover:from-secondary/60 hover:to-secondary',\n },\n {\n appearance: 'gradient',\n variant: 'info',\n className:\n 'from-info to-info/60 text-info-foreground hover:from-info/60 hover:to-info',\n },\n {\n appearance: 'gradient',\n variant: 'success',\n className:\n 'from-success to-success/60 text-success-foreground hover:from-success/60 hover:to-success',\n },\n {\n appearance: 'gradient',\n variant: 'warning',\n className:\n 'from-warning to-warning/60 text-warning-foreground hover:from-warning/60 hover:to-warning',\n },\n {\n appearance: 'gradient',\n variant: 'destructive',\n className:\n 'from-destructive to-destructive/60 text-destructive-foreground hover:from-destructive/60 hover:to-destructive',\n },\n\n // ===== SOFT =====\n {\n appearance: 'soft',\n variant: 'primary',\n className:\n 'bg-primary/10 border-primary text-primary hover:bg-primary/20 hover:text-primary dark:bg-primary/30 dark:border-primary dark:text-primary dark:hover:bg-primary/50 shadow-xs',\n },\n {\n appearance: 'soft',\n variant: 'secondary',\n className:\n 'bg-secondary/10 text-secondary-foreground hover:bg-secondary/20',\n },\n {\n appearance: 'soft',\n variant: 'info',\n className: 'bg-info/10 text-info hover:bg-info/20',\n },\n {\n appearance: 'soft',\n variant: 'success',\n className: 'bg-success/10 text-success hover:bg-success/20',\n },\n {\n appearance: 'soft',\n variant: 'warning',\n className: 'bg-warning/10 text-warning hover:bg-warning/20',\n },\n {\n appearance: 'soft',\n variant: 'destructive',\n className:\n 'bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30',\n },\n\n // ===== OUTLINE =====\n {\n appearance: 'outline',\n className:\n 'bg-card border-border backdrop-blur-[2px] shadow-none supports-backdrop-filter:backdrop-blur-[2px]',\n },\n {\n appearance: 'outline',\n shape: 'rounded',\n className: 'rounded-xl',\n },\n {\n appearance: 'outline',\n size: 'xs',\n className: 'h-[26px] gap-1 px-2',\n },\n {\n appearance: 'outline',\n size: 'sm',\n className: 'h-8 gap-1.5 px-2.5',\n },\n {\n appearance: 'outline',\n size: 'default',\n className: 'h-9 gap-2 px-4',\n },\n {\n appearance: 'outline',\n size: 'md',\n className: 'h-10 gap-2 px-4',\n },\n {\n appearance: 'outline',\n size: 'lg',\n className: 'h-10 gap-2 px-4.5',\n },\n {\n appearance: 'outline',\n variant: 'primary',\n className: 'border-border text-foreground hover:bg-muted/50',\n },\n {\n appearance: 'outline',\n variant: 'secondary',\n className:\n 'border-border text-secondary-foreground hover:bg-muted/50 aria-expanded:bg-muted/50 aria-expanded:text-foreground',\n },\n {\n appearance: 'outline',\n variant: 'info',\n className: 'border-border text-info hover:bg-info/10',\n },\n {\n appearance: 'outline',\n variant: 'success',\n className: 'border-border text-success hover:bg-success/10',\n },\n {\n appearance: 'outline',\n variant: 'warning',\n className: 'border-border text-warning hover:bg-warning/10',\n },\n {\n appearance: 'outline',\n variant: 'destructive',\n className: 'border-border text-destructive hover:bg-destructive/10',\n },\n\n // ===== GHOST =====\n {\n appearance: 'ghost',\n variant: 'primary',\n className: 'text-primary hover:bg-primary/10',\n },\n {\n appearance: 'ghost',\n variant: 'secondary',\n className:\n 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',\n },\n {\n appearance: 'ghost',\n variant: 'info',\n className: 'text-info hover:bg-info/10',\n },\n {\n appearance: 'ghost',\n variant: 'success',\n className: 'text-success hover:bg-success/10',\n },\n {\n appearance: 'ghost',\n variant: 'warning',\n className: 'text-warning hover:bg-warning/10',\n },\n {\n appearance: 'ghost',\n variant: 'destructive',\n className: 'text-destructive hover:bg-destructive/10',\n },\n\n // ===== AI (inner button styling — GradientBorder wraps externally) =====\n {\n appearance: 'ai',\n variant: 'primary',\n className: 'text-primary hover:bg-primary/10',\n },\n {\n appearance: 'ai',\n variant: 'secondary',\n className: 'text-secondary-foreground hover:bg-muted',\n },\n\n // ===== LINK =====\n { appearance: 'link', variant: 'primary', className: 'text-primary' },\n {\n appearance: 'link',\n variant: 'secondary',\n className: 'text-secondary-foreground',\n },\n { appearance: 'link', variant: 'info', className: 'text-info' },\n { appearance: 'link', variant: 'success', className: 'text-success' },\n { appearance: 'link', variant: 'warning', className: 'text-warning' },\n {\n appearance: 'link',\n variant: 'destructive',\n className: 'text-destructive hover:text-destructive/80',\n },\n ],\n defaultVariants: {\n appearance: 'solid',\n variant: 'primary',\n size: 'default',\n shape: 'rounded',\n },\n },\n);\n\ntype DotColor = 'success' | 'error' | 'warning' | 'brand' | 'gray';\n\ntype ButtonAppearance =\n | 'solid'\n | 'gradient'\n | 'soft'\n | 'outline'\n | 'ghost'\n | 'link'\n | 'ai';\ntype ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'info'\n | 'success'\n | 'warning'\n | 'destructive';\ntype ButtonShape = 'rounded' | 'round';\n\n/**\n * Render prop type for polymorphic rendering.\n * Accepts either a React element or a function that receives props and returns an element.\n * @template Props The props to be passed to the rendered element\n */\ntype RenderProp<Props> =\n | React.ReactElement\n | ((props: Props) => React.ReactElement);\n\nexport interface ButtonProps\n extends React.ComponentProps<'button'>,\n Pick<VariantProps<typeof buttonVariants>, 'size'> {\n /** Visual appearance - how the button renders */\n appearance?: ButtonAppearance;\n /** Semantic variant - what the button means */\n variant?: ButtonVariant;\n /** Shape of the button corners */\n shape?: ButtonShape;\n /** Shows a loading spinner and disables the button */\n loading?: boolean;\n /** Set to false when render targets a non-button element. */\n nativeButton?: boolean;\n /** Icon displayed at the start (inline-start) of the button text - respects RTL */\n startIcon?: React.ReactNode;\n /** Icon displayed at the end (inline-end) of the button text - respects RTL */\n endIcon?: React.ReactNode;\n /** Shows a colored dot indicator before the button text */\n dotIndicator?: boolean;\n /** Color of the dot indicator */\n dotColor?: DotColor;\n /** Badge content displayed after the button label. Text badges are styled from the button appearance and variant. */\n badge?: React.ReactNode;\n /** For icon-only buttons - renders just the icon without text wrapper */\n iconOnly?: boolean;\n /** Enables animated gradient border (only for appearance=\"ai\"). Auto-true when loading. */\n animated?: boolean;\n /**\n * Render prop for polymorphic rendering. Accepts either a React element or a render function.\n * Use this to render the button as a different element (e.g., link) while preserving button styles.\n * Note: When render is provided, loading/startIcon/endIcon/dotIndicator/badge are ignored.\n */\n render?: RenderProp<React.ComponentProps<'button'>>;\n}\n\nconst dotColorClasses: Record<DotColor, string> = {\n success: 'bg-success',\n error: 'bg-destructive',\n warning: 'bg-warning',\n brand: 'bg-primary',\n gray: 'bg-muted',\n};\n\nconst devWarnings = new Set<string>();\n\n/** Icon-only size variants for type-safe detection */\nconst ICON_SIZES = [\n 'icon',\n 'icon-xs',\n 'icon-sm',\n 'icon-lg',\n 'icon-xl',\n 'icon-2xl',\n] as const;\n\nconst SUCCESS_FLASH_DURATION_MS = 600;\n\nconst buttonBadgeShapeClasses: Record<ButtonShape, string> = {\n round: 'rounded-full',\n rounded: 'rounded-sm',\n};\n\nconst buttonBadgeWhiteColorClasses: Record<ButtonVariant, string> = {\n primary: 'text-primary',\n secondary: 'text-secondary-foreground',\n info: 'text-info',\n success: 'text-success',\n warning: 'text-warning',\n destructive: 'text-destructive',\n};\n\nconst buttonBadgeSoftColorClasses: Record<ButtonVariant, string> = {\n primary:\n 'bg-soft-primary text-soft-primary-foreground hover:bg-opacity-primary-20 dark:bg-soft-primary dark:text-soft-primary-foreground',\n secondary:\n 'bg-soft-secondary text-soft-secondary-foreground hover:bg-opacity-secondary-20 dark:bg-soft-secondary dark:text-soft-secondary-foreground',\n info: 'bg-soft-info text-soft-info-foreground hover:bg-opacity-info-20 dark:bg-soft-info dark:text-soft-info-foreground',\n success:\n 'bg-soft-success text-soft-success-foreground hover:bg-opacity-success-20 dark:bg-soft-success dark:text-soft-success-foreground',\n warning:\n 'bg-soft-warning text-soft-warning-foreground hover:bg-opacity-warning-20 dark:bg-soft-warning dark:text-soft-warning-foreground',\n destructive:\n 'bg-soft-destructive text-soft-destructive-foreground hover:bg-opacity-destructive-20 dark:bg-soft-destructive dark:text-soft-destructive-foreground',\n};\n\ntype LoadingSuccessState = {\n wasLoading: boolean;\n visible: boolean;\n token: number;\n};\n\nconst Dot = ({\n color = 'success',\n className,\n}: {\n color?: DotColor;\n className?: string;\n}) => (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'size-2 rounded-full shrink-0 delight-breathing',\n dotColorClasses[color],\n className,\n )}\n />\n);\n\nfunction ButtonBadge({\n appearance,\n badge,\n shape,\n variant,\n}: {\n appearance: ButtonAppearance;\n badge: React.ReactNode;\n shape: ButtonShape;\n variant: ButtonVariant;\n}) {\n if (React.isValidElement(badge)) {\n return badge;\n }\n\n if (badge === true || badge === false || badge == null) {\n return null;\n }\n\n const badgeVariant =\n (appearance === 'solid' || appearance === 'gradient') &&\n variant !== 'secondary'\n ? 'white'\n : 'soft';\n\n return (\n <span\n data-slot=\"badge\"\n className={cn(\n 'inline-flex h-5 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap px-2 py-0.5 text-xs font-medium transition-colors [&>svg]:size-3 [&>svg]:shrink-0 [&>svg]:pointer-events-none',\n buttonBadgeShapeClasses[shape],\n badgeVariant === 'white'\n ? 'bg-opacity-white-80 transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-current/50'\n : buttonBadgeSoftColorClasses[variant],\n badgeVariant === 'white' && buttonBadgeWhiteColorClasses[variant],\n )}\n >\n {badge}\n </span>\n );\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n children,\n loading = false,\n disabled,\n startIcon,\n endIcon,\n dotIndicator = false,\n dotColor = 'success',\n badge,\n iconOnly = false,\n animated,\n render,\n className,\n appearance = 'solid',\n variant = 'primary',\n shape = 'rounded',\n size = 'default',\n ...props\n },\n ref,\n ) => {\n // Dev-mode warning for icon-only buttons missing accessible label (once)\n if (\n process.env.NODE_ENV !== 'production' &&\n !devWarnings.has('icon-a11y')\n ) {\n const hasIconSize = ICON_SIZES.includes(\n size as (typeof ICON_SIZES)[number],\n );\n if (\n (iconOnly || hasIconSize) &&\n !props['aria-label'] &&\n !props['aria-labelledby']\n ) {\n devWarnings.add('icon-a11y');\n console.warn(\n 'Button: Icon-only buttons require an `aria-label` or `aria-labelledby` for accessibility.',\n );\n }\n }\n\n // Track loading→done transition before paint so the button never commits a\n // stale success state after the loading prop changes.\n const [successState, setSuccessState] = React.useState<LoadingSuccessState>(\n () => ({\n wasLoading: loading,\n visible: false,\n token: 0,\n }),\n );\n\n if (successState.wasLoading !== loading) {\n const shouldFlash = successState.wasLoading && !loading;\n setSuccessState({\n wasLoading: loading,\n visible: shouldFlash,\n token: shouldFlash ? successState.token + 1 : successState.token,\n });\n }\n\n React.useEffect(() => {\n if (!successState.visible) return;\n const token = successState.token;\n const timer = setTimeout(() => {\n setSuccessState((current) =>\n current.token === token ? { ...current, visible: false } : current,\n );\n }, SUCCESS_FLASH_DURATION_MS);\n return () => clearTimeout(timer);\n }, [successState.visible, successState.token]);\n\n const showSuccess = successState.visible && !loading;\n\n const isAi = appearance === 'ai';\n const isAnimated = isAi ? (animated ?? loading) : false;\n\n const buttonClassName = cn(\n buttonVariants({ appearance, variant, shape, size }),\n className,\n );\n\n // When render prop is provided, pass through to primitive\n // (ignores loading/startIcon/endIcon/dotIndicator/badge)\n if (render) {\n return (\n <ButtonPrimitive\n ref={ref}\n data-slot=\"button\"\n className={buttonClassName}\n render={render}\n {...props}\n >\n {children}\n </ButtonPrimitive>\n );\n }\n\n // Determine if this is an icon-only button based on size or explicit prop\n const isIconOnly =\n iconOnly || ICON_SIZES.includes(size as (typeof ICON_SIZES)[number]);\n const shouldComposeBadgeLabel =\n !isIconOnly &&\n !props['aria-label'] &&\n !props['aria-labelledby'] &&\n (typeof children === 'string' || typeof children === 'number') &&\n (typeof badge === 'string' || typeof badge === 'number');\n const buttonProps = shouldComposeBadgeLabel\n ? { ...props, 'aria-label': `${children} ${badge}` }\n : props;\n const buttonBadge = !isIconOnly ? (\n <ButtonBadge\n appearance={appearance}\n badge={badge}\n shape={shape}\n variant={variant}\n />\n ) : null;\n\n // Build the button element (icon-only or full)\n const buttonElement = isIconOnly ? (\n <ButtonPrimitive\n ref={isAi ? undefined : ref}\n data-slot=\"button\"\n disabled={disabled || loading}\n className={cn(buttonClassName, loading && 'relative')}\n {...buttonProps}\n >\n {loading ? (\n <Spinner className=\"delight-fade-in\" />\n ) : showSuccess ? (\n <Check className=\"delight-bounce-in\" />\n ) : (\n children\n )}\n </ButtonPrimitive>\n ) : (\n <ButtonPrimitive\n ref={isAi ? undefined : ref}\n data-slot=\"button\"\n disabled={disabled || loading}\n className={cn(buttonClassName, (loading || showSuccess) && 'relative')}\n {...buttonProps}\n >\n {loading && <Spinner className=\"absolute delight-fade-in\" />}\n {showSuccess && !loading && (\n <Check className=\"absolute delight-bounce-in\" />\n )}\n <span\n className={cn(\n 'flex items-center gap-2',\n (loading || showSuccess) && 'invisible',\n )}\n >\n {dotIndicator && <Dot color={dotColor} />}\n {startIcon}\n {children}\n {endIcon}\n {buttonBadge}\n </span>\n </ButtonPrimitive>\n );\n\n if (isAi) {\n return (\n <GradientBorder\n ref={ref as React.Ref<HTMLDivElement>}\n animated={isAnimated}\n active\n disabled={disabled}\n className=\"w-auto inline-flex motion-reduce:animate-none\"\n innerClassName=\"flex\"\n >\n {buttonElement}\n </GradientBorder>\n );\n }\n\n return buttonElement;\n },\n);\n\nButton.displayName = 'Button';\n\n/**\n * Clear/Close icon button - a ghost button specifically for close/clear actions\n * Commonly used in tags, dialogs, and dismissible elements\n */\nexport interface ClearButtonProps\n extends Omit<\n ButtonProps,\n | 'appearance'\n | 'variant'\n | 'children'\n | 'startIcon'\n | 'endIcon'\n | 'dotIndicator'\n > {\n /** Size of the clear button */\n size?: 'icon-xs' | 'icon-sm' | 'icon' | 'icon-lg' | 'icon-xl' | 'icon-2xl';\n}\n\nfunction ClearButton({\n className,\n size = 'icon-sm',\n ...props\n}: ClearButtonProps) {\n return (\n <Button\n appearance=\"ghost\"\n variant=\"secondary\"\n size={size}\n iconOnly\n className={cn(\n 'text-muted-foreground hover:text-secondary-foreground',\n className,\n )}\n aria-label=\"Clear\"\n {...props}\n >\n <X />\n </Button>\n );\n}\n\nClearButton.displayName = 'ClearButton';\n\nexport type { ButtonAppearance, ButtonShape, ButtonVariant };\nexport { Button, buttonVariants, ClearButton, Dot };\n"],"x_google_ignoreList":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A,EAAC,GAAD;AAAA,IACE,YAAW;AAAA,IACX,SAAQ;AAAA,IACF,MAAA;AAAA,IACN,UAAA;AAAA,IACA,WAAW,EACT,yDACA,CACF;AAAA,IACA,cAAW;AAAA,IACX,GAAI;AAAA,cAEJ,gBAAA,EAAC,GAAD,CAAI,CAAA;AAAA,EACE,CAAA;AAEZ;AAEA,GAAY,cAAc"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { f as
|
|
2
|
-
import { t as
|
|
1
|
+
import { f as i } from "./_shared.js";
|
|
2
|
+
import { t as n } from "./x.js";
|
|
3
3
|
import { t as m } from "./dist.js";
|
|
4
4
|
import { t as u } from "./button.js";
|
|
5
5
|
import * as l from "react";
|
|
6
|
-
import { jsx as
|
|
7
|
-
var
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
var d = m("", {
|
|
8
8
|
variants: { size: {
|
|
9
9
|
sm: "",
|
|
10
10
|
md: "",
|
|
@@ -15,36 +15,36 @@ var c = m("", {
|
|
|
15
15
|
sm: "icon-sm",
|
|
16
16
|
md: "icon",
|
|
17
17
|
lg: "icon-lg"
|
|
18
|
-
}, f = l.forwardRef(({ className:
|
|
19
|
-
ref:
|
|
18
|
+
}, f = l.forwardRef(({ className: a, size: e = "sm", "aria-label": t = "Close", ...o }, r) => /* @__PURE__ */ c(u, {
|
|
19
|
+
ref: r,
|
|
20
20
|
"data-slot": "close-button",
|
|
21
21
|
appearance: "ghost",
|
|
22
22
|
variant: "secondary",
|
|
23
|
-
size: v[
|
|
24
|
-
className:
|
|
25
|
-
"aria-label":
|
|
26
|
-
...
|
|
27
|
-
children: [/* @__PURE__ */
|
|
23
|
+
size: v[e ?? "sm"],
|
|
24
|
+
className: i(d({ size: e }), a),
|
|
25
|
+
"aria-label": t,
|
|
26
|
+
...o,
|
|
27
|
+
children: [/* @__PURE__ */ s(n, {}), /* @__PURE__ */ s("span", {
|
|
28
28
|
className: "sr-only",
|
|
29
|
-
children:
|
|
29
|
+
children: t
|
|
30
30
|
})]
|
|
31
31
|
}));
|
|
32
32
|
f.displayName = "CloseButton";
|
|
33
|
-
var p = m("flex shrink-0 items-center justify-center rounded-[3px] p-0.5 text-muted-foreground hover:bg-surface-1 hover:text-
|
|
33
|
+
var p = m("flex shrink-0 items-center justify-center rounded-[3px] p-0.5 text-muted-foreground hover:bg-surface-1 hover:text-secondary-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", {
|
|
34
34
|
variants: { size: {
|
|
35
35
|
sm: "[&>svg]:size-2.5",
|
|
36
36
|
md: "[&>svg]:size-3",
|
|
37
37
|
lg: "[&>svg]:size-3.5"
|
|
38
38
|
} },
|
|
39
39
|
defaultVariants: { size: "md" }
|
|
40
|
-
}), g = l.forwardRef(({ className:
|
|
41
|
-
ref:
|
|
40
|
+
}), g = l.forwardRef(({ className: a, size: e = "md", "aria-label": t = "Remove", ...o }, r) => /* @__PURE__ */ s("button", {
|
|
41
|
+
ref: r,
|
|
42
42
|
type: "button",
|
|
43
43
|
"data-slot": "remove-button",
|
|
44
|
-
className:
|
|
45
|
-
"aria-label":
|
|
46
|
-
...
|
|
47
|
-
children: /* @__PURE__ */
|
|
44
|
+
className: i(p({ size: e }), a),
|
|
45
|
+
"aria-label": t,
|
|
46
|
+
...o,
|
|
47
|
+
children: /* @__PURE__ */ s(n, {})
|
|
48
48
|
}));
|
|
49
49
|
g.displayName = "RemoveButton";
|
|
50
50
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"close-button.js","names":[],"sources":["../../src/components/ui/close-button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport * as React from 'react';\nimport { Button } from '@/components/ui/button';\nimport { cn } from '@/lib/utils';\n\n/**\n * CloseButton - for modal/overlay close buttons (dialogs, sheets, drawers)\n * Uses Button component with ghost variant, positioned by consumer\n */\nconst closeButtonVariants = cva('', {\n variants: {\n size: {\n sm: '',\n md: '',\n lg: '',\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n});\n\nconst buttonSizeMap = {\n sm: 'icon-sm',\n md: 'icon',\n lg: 'icon-lg',\n} as const;\n\nexport interface CloseButtonProps\n extends Omit<\n React.ComponentProps<typeof Button>,\n 'variant' | 'size' | 'children'\n >,\n VariantProps<typeof closeButtonVariants> {\n /** Accessible label for the close button */\n 'aria-label'?: string;\n}\n\nconst CloseButton = React.forwardRef<HTMLButtonElement, CloseButtonProps>(\n (\n { className, size = 'sm', 'aria-label': ariaLabel = 'Close', ...props },\n ref,\n ) => {\n return (\n <Button\n ref={ref}\n data-slot=\"close-button\"\n appearance=\"ghost\"\n variant=\"secondary\"\n size={buttonSizeMap[size ?? 'sm']}\n className={cn(closeButtonVariants({ size }), className)}\n aria-label={ariaLabel}\n {...props}\n >\n <X />\n <span className=\"sr-only\">{ariaLabel}</span>\n </Button>\n );\n },\n);\n\nCloseButton.displayName = 'CloseButton';\n\n/**\n * RemoveButton - for inline remove buttons (tags, list items, chips)\n * Lightweight button with smaller footprint\n */\nconst removeButtonVariants = cva(\n 'flex shrink-0 items-center justify-center rounded-[3px] p-0.5 text-muted-foreground hover:bg-surface-1 hover:text-
|
|
1
|
+
{"version":3,"file":"close-button.js","names":[],"sources":["../../src/components/ui/close-button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport * as React from 'react';\nimport { Button } from '@/components/ui/button';\nimport { cn } from '@/lib/utils';\n\n/**\n * CloseButton - for modal/overlay close buttons (dialogs, sheets, drawers)\n * Uses Button component with ghost variant, positioned by consumer\n */\nconst closeButtonVariants = cva('', {\n variants: {\n size: {\n sm: '',\n md: '',\n lg: '',\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n});\n\nconst buttonSizeMap = {\n sm: 'icon-sm',\n md: 'icon',\n lg: 'icon-lg',\n} as const;\n\nexport interface CloseButtonProps\n extends Omit<\n React.ComponentProps<typeof Button>,\n 'variant' | 'size' | 'children'\n >,\n VariantProps<typeof closeButtonVariants> {\n /** Accessible label for the close button */\n 'aria-label'?: string;\n}\n\nconst CloseButton = React.forwardRef<HTMLButtonElement, CloseButtonProps>(\n (\n { className, size = 'sm', 'aria-label': ariaLabel = 'Close', ...props },\n ref,\n ) => {\n return (\n <Button\n ref={ref}\n data-slot=\"close-button\"\n appearance=\"ghost\"\n variant=\"secondary\"\n size={buttonSizeMap[size ?? 'sm']}\n className={cn(closeButtonVariants({ size }), className)}\n aria-label={ariaLabel}\n {...props}\n >\n <X />\n <span className=\"sr-only\">{ariaLabel}</span>\n </Button>\n );\n },\n);\n\nCloseButton.displayName = 'CloseButton';\n\n/**\n * RemoveButton - for inline remove buttons (tags, list items, chips)\n * Lightweight button with smaller footprint\n */\nconst removeButtonVariants = cva(\n 'flex shrink-0 items-center justify-center rounded-[3px] p-0.5 text-muted-foreground hover:bg-surface-1 hover:text-secondary-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n {\n variants: {\n size: {\n sm: '[&>svg]:size-2.5',\n md: '[&>svg]:size-3',\n lg: '[&>svg]:size-3.5',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nexport interface RemoveButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof removeButtonVariants> {\n /** Accessible label for the remove button */\n 'aria-label'?: string;\n}\n\nconst RemoveButton = React.forwardRef<HTMLButtonElement, RemoveButtonProps>(\n (\n { className, size = 'md', 'aria-label': ariaLabel = 'Remove', ...props },\n ref,\n ) => {\n return (\n <button\n ref={ref}\n type=\"button\"\n data-slot=\"remove-button\"\n className={cn(removeButtonVariants({ size }), className)}\n aria-label={ariaLabel}\n {...props}\n >\n <X />\n </button>\n );\n },\n);\n\nRemoveButton.displayName = 'RemoveButton';\n\nexport { CloseButton, closeButtonVariants, RemoveButton, removeButtonVariants };\n"],"mappings":";;;;;;AAUA,IAAM,IAAsB,EAAI,IAAI;AA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a,cAAc"}
|
|
@@ -93,7 +93,7 @@ function x({ title: e, description: r, icon: t, onClick: s, featured: n = !1, cl
|
|
|
93
93
|
className: "text-sm font-medium text-foreground group-hover:text-primary transition-colors",
|
|
94
94
|
children: e
|
|
95
95
|
}), r && /* @__PURE__ */ i("p", {
|
|
96
|
-
className: "text-xs text-
|
|
96
|
+
className: "text-xs text-secondary-foreground line-clamp-2",
|
|
97
97
|
children: r
|
|
98
98
|
})]
|
|
99
99
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hf-ai-prompt-suggestion.js","names":[],"sources":["../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.27.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/arrow-right.mjs","../../src/components/organisms/ai/AIPromptSuggestion/AIPromptSuggestion.tsx","../../src/wc/hf-ai-prompt-suggestion.ts"],"sourcesContent":["/**\n * @license lucide-react v1.27.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"m12 5 7 7-7 7\", key: \"xquz4c\" }]\n];\nconst ArrowRight = createLucideIcon(\"arrow-right\", __iconNode);\n\nexport { __iconNode, ArrowRight as default };\n//# sourceMappingURL=arrow-right.mjs.map\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport { ArrowRight, Sparkles } from 'lucide-react';\nimport * as React from 'react';\nimport { cn } from '@/lib/utils';\n\n// =============================================================================\n// Variants\n// =============================================================================\n\nconst promptSuggestionVariants = cva(\n 'group inline-flex items-center gap-2 transition-all cursor-pointer',\n {\n variants: {\n variant: {\n default:\n 'px-4 py-2.5 rounded-full border border-border bg-background hover:border-border hover:shadow-sm text-secondary-foreground hover:text-foreground',\n outline:\n 'px-4 py-2.5 rounded-full border border-border bg-transparent hover:bg-muted text-secondary-foreground hover:text-foreground',\n ghost:\n 'px-3 py-2 rounded-lg hover:bg-accent text-muted-foreground hover:text-foreground',\n card: 'flex-col items-start p-4 rounded-xl border border-border bg-background hover:border-primary hover:shadow-md',\n highlight:\n 'text-primary hover:text-primary underline underline-offset-2',\n },\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-base',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n },\n);\n\n// =============================================================================\n// Main AIPromptSuggestion Component\n// =============================================================================\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction getSuggestionLimit(max: number | undefined): number | null {\n return typeof max === 'number' && Number.isFinite(max) && max > 0\n ? Math.floor(max)\n : null;\n}\n\ninterface HighlightedTextPart {\n key: string;\n text: string;\n highlighted: boolean;\n}\n\nfunction getHighlightedTextParts(\n text: string,\n highlight: string,\n): HighlightedTextPart[] {\n const escapedHighlight = escapeRegExp(highlight);\n const parts = text.split(new RegExp(`(${escapedHighlight})`, 'gi'));\n const normalizedHighlight = highlight.toLowerCase();\n let offset = 0;\n\n return parts.map((part) => {\n const partOffset = offset;\n offset += part.length;\n\n return {\n key: `${partOffset}:${part.toLowerCase() === normalizedHighlight ? 'highlight' : 'plain'}:${part}`,\n text: part,\n highlighted: part.toLowerCase() === normalizedHighlight,\n };\n });\n}\n\nexport interface AIPromptSuggestionProps\n extends VariantProps<typeof promptSuggestionVariants> {\n /** Suggestion text */\n children: string;\n /** Click handler */\n onClick?: () => void;\n /** Optional icon */\n icon?: React.ReactNode;\n /** Show arrow icon on hover */\n showArrow?: boolean;\n /** Highlight specific text within the suggestion */\n highlight?: string;\n /** Additional class name */\n className?: string;\n}\n\nfunction AIPromptSuggestion({\n children,\n onClick,\n icon,\n showArrow = false,\n highlight,\n variant,\n size,\n className,\n}: AIPromptSuggestionProps) {\n const renderedText = React.useMemo(() => {\n if (!highlight) {\n return <span>{children}</span>;\n }\n\n const parts = getHighlightedTextParts(children, highlight);\n\n return (\n <span>\n {parts.map((part) =>\n part.highlighted ? (\n <span key={part.key} className=\"text-primary font-medium\">\n {part.text}\n </span>\n ) : (\n <span key={part.key}>{part.text}</span>\n ),\n )}\n </span>\n );\n }, [children, highlight]);\n\n return (\n <button\n type=\"button\"\n data-slot=\"ai-prompt-suggestion\"\n onClick={onClick}\n className={cn(\n promptSuggestionVariants({ variant, size }),\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring',\n className,\n )}\n >\n {icon && (\n <span className=\"shrink-0\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n {renderedText}\n {showArrow && variant !== 'highlight' && (\n <ArrowRight\n className=\"size-4 opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all motion-reduce:transition-none\"\n aria-hidden=\"true\"\n />\n )}\n </button>\n );\n}\n\nAIPromptSuggestion.displayName = 'AIPromptSuggestion';\n\n// =============================================================================\n// Prompt Suggestion Card (Enhanced variant)\n// =============================================================================\n\nexport interface AIPromptSuggestionCardProps {\n /** Card title */\n title: string;\n /** Card description */\n description?: string;\n /** Icon to display */\n icon?: React.ReactNode;\n /** Click handler */\n onClick?: () => void;\n /** Whether the card is featured/highlighted */\n featured?: boolean;\n /** Additional class name */\n className?: string;\n}\n\nfunction AIPromptSuggestionCard({\n title,\n description,\n icon,\n onClick,\n featured = false,\n className,\n}: AIPromptSuggestionCardProps) {\n return (\n <button\n type=\"button\"\n data-slot=\"ai-prompt-suggestion-card\"\n onClick={onClick}\n className={cn(\n 'group flex flex-col items-start gap-2 p-4 rounded-xl border transition-all text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring',\n featured\n ? 'border-primary bg-primary/10 hover:border-primary hover:shadow-md'\n : 'border-border bg-background hover:border-border hover:shadow-md',\n className,\n )}\n >\n {icon && (\n <div\n className={cn(\n 'size-8 rounded-lg flex items-center justify-center',\n featured\n ? 'bg-primary/20 text-primary'\n : 'bg-accent text-muted-foreground',\n )}\n >\n {icon}\n </div>\n )}\n <div className=\"space-y-1\">\n <h4 className=\"text-sm font-medium text-foreground group-hover:text-primary transition-colors\">\n {title}\n </h4>\n {description && (\n <p className=\"text-xs text-text-quaternary line-clamp-2\">\n {description}\n </p>\n )}\n </div>\n </button>\n );\n}\n\nAIPromptSuggestionCard.displayName = 'AIPromptSuggestionCard';\n\n// =============================================================================\n// Prompt Suggestion List\n// =============================================================================\n\nexport interface AIPromptSuggestionListProps {\n /** Array of suggestions */\n suggestions: Array<{\n text: string;\n icon?: React.ReactNode;\n }>;\n /** Click handler (receives suggestion text) */\n onSelect?: (text: string) => void;\n /** Variant for all suggestions */\n variant?: AIPromptSuggestionProps['variant'];\n /** Layout direction */\n direction?: 'horizontal' | 'vertical';\n /** Maximum suggestions to show */\n max?: number;\n /** Additional class name */\n className?: string;\n}\n\nfunction AIPromptSuggestionList({\n suggestions,\n onSelect,\n variant = 'default',\n direction = 'horizontal',\n max,\n className,\n}: AIPromptSuggestionListProps) {\n const limit = getSuggestionLimit(max);\n const visibleSuggestions =\n limit === null ? suggestions : suggestions.slice(0, limit);\n\n return (\n <section\n data-slot=\"ai-prompt-suggestion-list\"\n aria-label=\"Prompt suggestions\"\n className={cn(\n 'flex gap-2',\n direction === 'horizontal' ? 'flex-wrap' : 'flex-col',\n className,\n )}\n >\n {visibleSuggestions.map((suggestion) => (\n <AIPromptSuggestion\n key={suggestion.text}\n variant={variant}\n icon={suggestion.icon}\n onClick={() => onSelect?.(suggestion.text)}\n >\n {suggestion.text}\n </AIPromptSuggestion>\n ))}\n </section>\n );\n}\n\nAIPromptSuggestionList.displayName = 'AIPromptSuggestionList';\n\n// =============================================================================\n// Quick Actions Grid\n// =============================================================================\n\nexport interface QuickAction {\n id: string;\n title: string;\n description?: string;\n icon?: React.ReactNode;\n prompt: string;\n}\n\nexport interface AIQuickActionsProps {\n /** Array of quick actions */\n actions: QuickAction[];\n /** Click handler (receives action prompt) */\n onSelect?: (prompt: string) => void;\n /** Visual variant */\n variant?: 'card' | 'pill';\n /** Number of columns (only for card variant) */\n columns?: 2 | 3 | 4;\n /** Additional class name */\n className?: string;\n}\n\nfunction AIQuickActions({\n actions,\n onSelect,\n variant = 'card',\n columns = 2,\n className,\n}: AIQuickActionsProps) {\n const gridCols = {\n 2: 'grid-cols-2',\n 3: 'grid-cols-3',\n 4: 'grid-cols-4',\n };\n\n if (variant === 'pill') {\n return (\n <div className={cn('flex flex-wrap gap-2', className)}>\n {actions.map((action) => (\n <AIPromptSuggestion\n key={action.id}\n icon={action.icon || <Sparkles className=\"size-4\" />}\n onClick={() => onSelect?.(action.prompt)}\n >\n {action.title}\n </AIPromptSuggestion>\n ))}\n </div>\n );\n }\n\n return (\n <div className={cn('grid gap-3', gridCols[columns], className)}>\n {actions.map((action) => (\n <AIPromptSuggestionCard\n key={action.id}\n title={action.title}\n description={action.description}\n icon={action.icon || <Sparkles className=\"size-4\" />}\n onClick={() => onSelect?.(action.prompt)}\n />\n ))}\n </div>\n );\n}\n\nAIQuickActions.displayName = 'AIQuickActions';\n\nexport {\n AIPromptSuggestion,\n AIPromptSuggestionCard,\n AIPromptSuggestionList,\n AIQuickActions,\n promptSuggestionVariants,\n};\n","/**\n * Web Component wrapper for AIPromptSuggestion\n * Custom element: <hf-ai-prompt-suggestion>\n *\n * @generated by scripts/generate-wc-components.ts\n * DO NOT EDIT MANUALLY\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { AIPromptSuggestion } from '../components/organisms/ai/AIPromptSuggestion';\nimport { parseAttr, parseValue, type PropDefs } from './_shared';\n\n/**\n * Event wrapper that dispatches custom DOM events\n */\nfunction createEventDispatcher(element: HTMLElement) {\n return {\n onClick: (value: unknown) => {\n const CustomEventConstructor =\n element.ownerDocument.defaultView?.CustomEvent ?? CustomEvent;\n element.dispatchEvent(new CustomEventConstructor('click', {\n detail: value,\n bubbles: true,\n composed: true\n }));\n }\n };\n}\n\n/**\n * Wrapper component that connects React events to DOM custom events\n */\nfunction AIPromptSuggestionWrapper(props: React.ComponentProps<typeof AIPromptSuggestion> & { _hostElement?: HTMLElement }) {\n const { _hostElement, ...restProps } = props;\n\n const eventHandlers = React.useMemo(() => {\n if (!_hostElement) return {};\n return createEventDispatcher(_hostElement);\n }, [_hostElement]);\n\n return React.createElement(AIPromptSuggestion, { ...restProps, ...eventHandlers });\n}\n\n/**\n * Prop type definitions for attribute parsing\n */\nconst propTypes: PropDefs = {\n variant: 'string',\n size: 'string',\n icon: 'json',\n showArrow: 'boolean',\n highlight: 'string',\n className: 'string'\n};\n\nclass AIPromptSuggestionWC extends HTMLElement {\n private _root: ReturnType<typeof createRoot> | null = null;\n private _childrenContainer: HTMLDivElement | null = null;\n private _props: Record<string, unknown> = {};\n private _initialized = false;\n\n connectedCallback() {\n setTimeout(() => this._initialize(), 0);\n }\n\n private _initialize() {\n if (this._initialized) return;\n this._initialized = true;\n\n const originalChildren: Node[] = [];\n for (const child of Array.from(this.childNodes)) {\n if (child.nodeType === Node.TEXT_NODE && !child.textContent?.trim()) {\n continue;\n }\n originalChildren.push(child);\n }\n\n const reactContainer = this.ownerDocument.createElement('div');\n reactContainer.style.display = 'contents';\n\n this._childrenContainer = this.ownerDocument.createElement('div');\n this._childrenContainer.style.display = 'contents';\n\n originalChildren.forEach((child) => this._childrenContainer!.appendChild(child));\n\n while (this.firstChild) this.removeChild(this.firstChild);\n this.appendChild(reactContainer);\n\n this._root = createRoot(reactContainer);\n this._render();\n }\n\n disconnectedCallback() {\n this._root?.unmount();\n this._root = null;\n }\n\n attributeChangedCallback(_name: string, _oldValue: string | null, _newValue: string | null) {\n this._render();\n }\n\n static get observedAttributes() {\n return Object.keys(propTypes).map((prop) =>\n prop.replace(/([A-Z])/g, '-$1').toLowerCase(),\n );\n }\n\n _setProp(name: string, value: unknown) {\n const propType = propTypes[name] || 'string';\n this._props[name] = parseValue(value, propType);\n this._render();\n }\n\n _getProp(name: string): unknown {\n if (name in this._props) {\n return this._props[name];\n }\n const attrName = name.replace(/([A-Z])/g, '-$1').toLowerCase();\n const propType = propTypes[name] || 'string';\n return parseAttr(this.getAttribute(attrName), propType);\n }\n\n private _render() {\n if (!this._root || !this._childrenContainer) return;\n\n const props: Record<string, unknown> = {};\n for (const [propName, propType] of Object.entries(propTypes)) {\n if (propName in this._props) {\n props[propName] = this._props[propName];\n } else {\n const attrName = propName.replace(/([A-Z])/g, '-$1').toLowerCase();\n props[propName] = parseAttr(this.getAttribute(attrName), propType);\n }\n }\n\n const element = React.createElement(\n AIPromptSuggestionWrapper,\n { ...props, _hostElement: this },\n React.createElement('span', {\n ref: (el: HTMLSpanElement | null) => {\n if (el && this._childrenContainer) {\n el.replaceWith(this._childrenContainer);\n }\n },\n style: { display: 'contents' },\n }),\n );\n\n this._root.render(element);\n }\n}\n\nfor (const propName of Object.keys(propTypes)) {\n Object.defineProperty(AIPromptSuggestionWC.prototype, propName, {\n get() {\n return this._getProp(propName);\n },\n set(value: unknown) {\n this._setProp(propName, value);\n },\n enumerable: true,\n configurable: true,\n });\n}\n\nif (typeof customElements !== 'undefined' && !customElements.get('hf-ai-prompt-suggestion')) {\n customElements.define('hf-ai-prompt-suggestion', AIPromptSuggestionWC);\n}\n\nexport { AIPromptSuggestionWC };\nexport default AIPromptSuggestionWC;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AASA,IAAM,IAAa,CACjB,CAAC,QAAQ;AAAA,EAAE,GAAG;AAAA,EAAY,KAAK;AAAS,CAAC,GACzC,CAAC,QAAQ;AAAA,EAAE,GAAG;AAAA,EAAiB,KAAK;AAAS,CAAC,CAChD,GACM,IAAa,EAAiB,eAAe,CAAU,GCJvD,IAA2B,EAC/B,sEACA;AAAA,EACE,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SACE;AAAA,MACF,SACE;AAAA,MACF,OACE;AAAA,MACF,MAAM;AAAA,MACN,WACE;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ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G,CAAQ;AAAA,IACnE;AAGF,UAAM,IAAU,EAAM,cACpB,GACA;AAAA,MAAE,GAAG;AAAA,MAAO,cAAc;AAAA,IAAK,GAC/B,EAAM,cAAc,QAAQ;AAAA,MAC1B,KAAA,CAAM,MAA+B;AACnC,QAAI,KAAM,KAAK,sBACb,EAAG,YAAY,KAAK,kBAAkB;AAAA,MAE1C;AAAA,MACA,OAAO,EAAE,SAAS,WAAW;AAAA,IAC/B,CAAC,CACH;AAEA,SAAK,MAAM,OAAO,CAAO;AAAA,EAC3B;AACF;AAEA,WAAW,KAAY,OAAO,KAAK,CAAS,EAC1C,QAAO,eAAe,EAAqB,WAAW,GAAU;AAAA,EAC9D,MAAM;AACJ,WAAO,KAAK,SAAS,CAAQ;AAAA,EAC/B;AAAA,EACA,IAAI,GAAgB;AAClB,SAAK,SAAS,GAAU,CAAK;AAAA,EAC/B;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAChB,CAAC;AAGC,OAAO,iBAAmB,OAAe,CAAC,eAAe,IAAI,yBAAyB,KACxF,eAAe,OAAO,2BAA2B,CAAoB"}
|
|
1
|
+
{"version":3,"file":"hf-ai-prompt-suggestion.js","names":[],"sources":["../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.27.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/arrow-right.mjs","../../src/components/organisms/ai/AIPromptSuggestion/AIPromptSuggestion.tsx","../../src/wc/hf-ai-prompt-suggestion.ts"],"sourcesContent":["/**\n * @license lucide-react v1.27.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"m12 5 7 7-7 7\", key: \"xquz4c\" }]\n];\nconst ArrowRight = createLucideIcon(\"arrow-right\", __iconNode);\n\nexport { __iconNode, ArrowRight as default };\n//# sourceMappingURL=arrow-right.mjs.map\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport { ArrowRight, Sparkles } from 'lucide-react';\nimport * as React from 'react';\nimport { cn } from '@/lib/utils';\n\n// =============================================================================\n// Variants\n// =============================================================================\n\nconst promptSuggestionVariants = cva(\n 'group inline-flex items-center gap-2 transition-all cursor-pointer',\n {\n variants: {\n variant: {\n default:\n 'px-4 py-2.5 rounded-full border border-border bg-background hover:border-border hover:shadow-sm text-secondary-foreground hover:text-foreground',\n outline:\n 'px-4 py-2.5 rounded-full border border-border bg-transparent hover:bg-muted text-secondary-foreground hover:text-foreground',\n ghost:\n 'px-3 py-2 rounded-lg hover:bg-accent text-muted-foreground hover:text-foreground',\n card: 'flex-col items-start p-4 rounded-xl border border-border bg-background hover:border-primary hover:shadow-md',\n highlight:\n 'text-primary hover:text-primary underline underline-offset-2',\n },\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-base',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n },\n);\n\n// =============================================================================\n// Main AIPromptSuggestion Component\n// =============================================================================\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction getSuggestionLimit(max: number | undefined): number | null {\n return typeof max === 'number' && Number.isFinite(max) && max > 0\n ? Math.floor(max)\n : null;\n}\n\ninterface HighlightedTextPart {\n key: string;\n text: string;\n highlighted: boolean;\n}\n\nfunction getHighlightedTextParts(\n text: string,\n highlight: string,\n): HighlightedTextPart[] {\n const escapedHighlight = escapeRegExp(highlight);\n const parts = text.split(new RegExp(`(${escapedHighlight})`, 'gi'));\n const normalizedHighlight = highlight.toLowerCase();\n let offset = 0;\n\n return parts.map((part) => {\n const partOffset = offset;\n offset += part.length;\n\n return {\n key: `${partOffset}:${part.toLowerCase() === normalizedHighlight ? 'highlight' : 'plain'}:${part}`,\n text: part,\n highlighted: part.toLowerCase() === normalizedHighlight,\n };\n });\n}\n\nexport interface AIPromptSuggestionProps\n extends VariantProps<typeof promptSuggestionVariants> {\n /** Suggestion text */\n children: string;\n /** Click handler */\n onClick?: () => void;\n /** Optional icon */\n icon?: React.ReactNode;\n /** Show arrow icon on hover */\n showArrow?: boolean;\n /** Highlight specific text within the suggestion */\n highlight?: string;\n /** Additional class name */\n className?: string;\n}\n\nfunction AIPromptSuggestion({\n children,\n onClick,\n icon,\n showArrow = false,\n highlight,\n variant,\n size,\n className,\n}: AIPromptSuggestionProps) {\n const renderedText = React.useMemo(() => {\n if (!highlight) {\n return <span>{children}</span>;\n }\n\n const parts = getHighlightedTextParts(children, highlight);\n\n return (\n <span>\n {parts.map((part) =>\n part.highlighted ? (\n <span key={part.key} className=\"text-primary font-medium\">\n {part.text}\n </span>\n ) : (\n <span key={part.key}>{part.text}</span>\n ),\n )}\n </span>\n );\n }, [children, highlight]);\n\n return (\n <button\n type=\"button\"\n data-slot=\"ai-prompt-suggestion\"\n onClick={onClick}\n className={cn(\n promptSuggestionVariants({ variant, size }),\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring',\n className,\n )}\n >\n {icon && (\n <span className=\"shrink-0\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n {renderedText}\n {showArrow && variant !== 'highlight' && (\n <ArrowRight\n className=\"size-4 opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all motion-reduce:transition-none\"\n aria-hidden=\"true\"\n />\n )}\n </button>\n );\n}\n\nAIPromptSuggestion.displayName = 'AIPromptSuggestion';\n\n// =============================================================================\n// Prompt Suggestion Card (Enhanced variant)\n// =============================================================================\n\nexport interface AIPromptSuggestionCardProps {\n /** Card title */\n title: string;\n /** Card description */\n description?: string;\n /** Icon to display */\n icon?: React.ReactNode;\n /** Click handler */\n onClick?: () => void;\n /** Whether the card is featured/highlighted */\n featured?: boolean;\n /** Additional class name */\n className?: string;\n}\n\nfunction AIPromptSuggestionCard({\n title,\n description,\n icon,\n onClick,\n featured = false,\n className,\n}: AIPromptSuggestionCardProps) {\n return (\n <button\n type=\"button\"\n data-slot=\"ai-prompt-suggestion-card\"\n onClick={onClick}\n className={cn(\n 'group flex flex-col items-start gap-2 p-4 rounded-xl border transition-all text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring',\n featured\n ? 'border-primary bg-primary/10 hover:border-primary hover:shadow-md'\n : 'border-border bg-background hover:border-border hover:shadow-md',\n className,\n )}\n >\n {icon && (\n <div\n className={cn(\n 'size-8 rounded-lg flex items-center justify-center',\n featured\n ? 'bg-primary/20 text-primary'\n : 'bg-accent text-muted-foreground',\n )}\n >\n {icon}\n </div>\n )}\n <div className=\"space-y-1\">\n <h4 className=\"text-sm font-medium text-foreground group-hover:text-primary transition-colors\">\n {title}\n </h4>\n {description && (\n <p className=\"text-xs text-secondary-foreground line-clamp-2\">\n {description}\n </p>\n )}\n </div>\n </button>\n );\n}\n\nAIPromptSuggestionCard.displayName = 'AIPromptSuggestionCard';\n\n// =============================================================================\n// Prompt Suggestion List\n// =============================================================================\n\nexport interface AIPromptSuggestionListProps {\n /** Array of suggestions */\n suggestions: Array<{\n text: string;\n icon?: React.ReactNode;\n }>;\n /** Click handler (receives suggestion text) */\n onSelect?: (text: string) => void;\n /** Variant for all suggestions */\n variant?: AIPromptSuggestionProps['variant'];\n /** Layout direction */\n direction?: 'horizontal' | 'vertical';\n /** Maximum suggestions to show */\n max?: number;\n /** Additional class name */\n className?: string;\n}\n\nfunction AIPromptSuggestionList({\n suggestions,\n onSelect,\n variant = 'default',\n direction = 'horizontal',\n max,\n className,\n}: AIPromptSuggestionListProps) {\n const limit = getSuggestionLimit(max);\n const visibleSuggestions =\n limit === null ? suggestions : suggestions.slice(0, limit);\n\n return (\n <section\n data-slot=\"ai-prompt-suggestion-list\"\n aria-label=\"Prompt suggestions\"\n className={cn(\n 'flex gap-2',\n direction === 'horizontal' ? 'flex-wrap' : 'flex-col',\n className,\n )}\n >\n {visibleSuggestions.map((suggestion) => (\n <AIPromptSuggestion\n key={suggestion.text}\n variant={variant}\n icon={suggestion.icon}\n onClick={() => onSelect?.(suggestion.text)}\n >\n {suggestion.text}\n </AIPromptSuggestion>\n ))}\n </section>\n );\n}\n\nAIPromptSuggestionList.displayName = 'AIPromptSuggestionList';\n\n// =============================================================================\n// Quick Actions Grid\n// =============================================================================\n\nexport interface QuickAction {\n id: string;\n title: string;\n description?: string;\n icon?: React.ReactNode;\n prompt: string;\n}\n\nexport interface AIQuickActionsProps {\n /** Array of quick actions */\n actions: QuickAction[];\n /** Click handler (receives action prompt) */\n onSelect?: (prompt: string) => void;\n /** Visual variant */\n variant?: 'card' | 'pill';\n /** Number of columns (only for card variant) */\n columns?: 2 | 3 | 4;\n /** Additional class name */\n className?: string;\n}\n\nfunction AIQuickActions({\n actions,\n onSelect,\n variant = 'card',\n columns = 2,\n className,\n}: AIQuickActionsProps) {\n const gridCols = {\n 2: 'grid-cols-2',\n 3: 'grid-cols-3',\n 4: 'grid-cols-4',\n };\n\n if (variant === 'pill') {\n return (\n <div className={cn('flex flex-wrap gap-2', className)}>\n {actions.map((action) => (\n <AIPromptSuggestion\n key={action.id}\n icon={action.icon || <Sparkles className=\"size-4\" />}\n onClick={() => onSelect?.(action.prompt)}\n >\n {action.title}\n </AIPromptSuggestion>\n ))}\n </div>\n );\n }\n\n return (\n <div className={cn('grid gap-3', gridCols[columns], className)}>\n {actions.map((action) => (\n <AIPromptSuggestionCard\n key={action.id}\n title={action.title}\n description={action.description}\n icon={action.icon || <Sparkles className=\"size-4\" />}\n onClick={() => onSelect?.(action.prompt)}\n />\n ))}\n </div>\n );\n}\n\nAIQuickActions.displayName = 'AIQuickActions';\n\nexport {\n AIPromptSuggestion,\n AIPromptSuggestionCard,\n AIPromptSuggestionList,\n AIQuickActions,\n promptSuggestionVariants,\n};\n","/**\n * Web Component wrapper for AIPromptSuggestion\n * Custom element: <hf-ai-prompt-suggestion>\n *\n * @generated by scripts/generate-wc-components.ts\n * DO NOT EDIT MANUALLY\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { AIPromptSuggestion } from '../components/organisms/ai/AIPromptSuggestion';\nimport { parseAttr, parseValue, type PropDefs } from './_shared';\n\n/**\n * Event wrapper that dispatches custom DOM events\n */\nfunction createEventDispatcher(element: HTMLElement) {\n return {\n onClick: (value: unknown) => {\n const CustomEventConstructor =\n element.ownerDocument.defaultView?.CustomEvent ?? CustomEvent;\n element.dispatchEvent(new CustomEventConstructor('click', {\n detail: value,\n bubbles: true,\n composed: true\n }));\n }\n };\n}\n\n/**\n * Wrapper component that connects React events to DOM custom events\n */\nfunction AIPromptSuggestionWrapper(props: React.ComponentProps<typeof AIPromptSuggestion> & { _hostElement?: HTMLElement }) {\n const { _hostElement, ...restProps } = props;\n\n const eventHandlers = React.useMemo(() => {\n if (!_hostElement) return {};\n return createEventDispatcher(_hostElement);\n }, [_hostElement]);\n\n return React.createElement(AIPromptSuggestion, { ...restProps, ...eventHandlers });\n}\n\n/**\n * Prop type definitions for attribute parsing\n */\nconst propTypes: PropDefs = {\n variant: 'string',\n size: 'string',\n icon: 'json',\n showArrow: 'boolean',\n highlight: 'string',\n className: 'string'\n};\n\nclass AIPromptSuggestionWC extends HTMLElement {\n private _root: ReturnType<typeof createRoot> | null = null;\n private _childrenContainer: HTMLDivElement | null = null;\n private _props: Record<string, unknown> = {};\n private _initialized = false;\n\n connectedCallback() {\n setTimeout(() => this._initialize(), 0);\n }\n\n private _initialize() {\n if (this._initialized) return;\n this._initialized = true;\n\n const originalChildren: Node[] = [];\n for (const child of Array.from(this.childNodes)) {\n if (child.nodeType === Node.TEXT_NODE && !child.textContent?.trim()) {\n continue;\n }\n originalChildren.push(child);\n }\n\n const reactContainer = this.ownerDocument.createElement('div');\n reactContainer.style.display = 'contents';\n\n this._childrenContainer = this.ownerDocument.createElement('div');\n this._childrenContainer.style.display = 'contents';\n\n originalChildren.forEach((child) => this._childrenContainer!.appendChild(child));\n\n while (this.firstChild) this.removeChild(this.firstChild);\n this.appendChild(reactContainer);\n\n this._root = createRoot(reactContainer);\n this._render();\n }\n\n disconnectedCallback() {\n this._root?.unmount();\n this._root = null;\n }\n\n attributeChangedCallback(_name: string, _oldValue: string | null, _newValue: string | null) {\n this._render();\n }\n\n static get observedAttributes() {\n return Object.keys(propTypes).map((prop) =>\n prop.replace(/([A-Z])/g, '-$1').toLowerCase(),\n );\n }\n\n _setProp(name: string, value: unknown) {\n const propType = propTypes[name] || 'string';\n this._props[name] = parseValue(value, propType);\n this._render();\n }\n\n _getProp(name: string): unknown {\n if (name in this._props) {\n return this._props[name];\n }\n const attrName = name.replace(/([A-Z])/g, '-$1').toLowerCase();\n const propType = propTypes[name] || 'string';\n return parseAttr(this.getAttribute(attrName), propType);\n }\n\n private _render() {\n if (!this._root || !this._childrenContainer) return;\n\n const props: Record<string, unknown> = {};\n for (const [propName, propType] of Object.entries(propTypes)) {\n if (propName in this._props) {\n props[propName] = this._props[propName];\n } else {\n const attrName = propName.replace(/([A-Z])/g, '-$1').toLowerCase();\n props[propName] = parseAttr(this.getAttribute(attrName), propType);\n }\n }\n\n const element = React.createElement(\n AIPromptSuggestionWrapper,\n { ...props, _hostElement: this },\n React.createElement('span', {\n ref: (el: HTMLSpanElement | null) => {\n if (el && this._childrenContainer) {\n el.replaceWith(this._childrenContainer);\n }\n },\n style: { display: 'contents' },\n }),\n );\n\n this._root.render(element);\n }\n}\n\nfor (const propName of Object.keys(propTypes)) {\n Object.defineProperty(AIPromptSuggestionWC.prototype, propName, {\n get() {\n return this._getProp(propName);\n },\n set(value: unknown) {\n this._setProp(propName, value);\n },\n enumerable: true,\n configurable: true,\n });\n}\n\nif (typeof customElements !== 'undefined' && !customElements.get('hf-ai-prompt-suggestion')) {\n customElements.define('hf-ai-prompt-suggestion', AIPromptSuggestionWC);\n}\n\nexport { AIPromptSuggestionWC };\nexport default AIPromptSuggestionWC;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AASA,IAAM,IAAa,CACjB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Q;AAAA,EACxD;AAAA,EAEA,UAAkB;AAChB,QAAI,CAAC,KAAK,SAAS,CAAC,KAAK,mBAAoB;AAE7C,UAAM,IAAiC,CAAC;AACxC,eAAW,CAAC,GAAU,CAAA,KAAa,OAAO,QAAQ,CAAS,EACzD,KAAI,KAAY,KAAK,OACnB,CAAA,EAAM,CAAA,IAAY,KAAK,OAAO,CAAA;AAAA,SACzB;AACL,YAAM,IAAW,EAAS,QAAQ,YAAY,KAAK,EAAE,YAAY;AACjE,MAAA,EAAM,CAAA,IAAY,EAAU,KAAK,aAAa,CAAQ,GAAG,CAAQ;AAAA,IACnE;AAGF,UAAM,IAAU,EAAM,cACpB,GACA;AAAA,MAAE,GAAG;AAAA,MAAO,cAAc;AAAA,IAAK,GAC/B,EAAM,cAAc,QAAQ;AAAA,MAC1B,KAAA,CAAM,MAA+B;AACnC,QAAI,KAAM,KAAK,sBACb,EAAG,YAAY,KAAK,kBAAkB;AAAA,MAE1C;AAAA,MACA,OAAO,EAAE,SAAS,WAAW;AAAA,IAC/B,CAAC,CACH;AAEA,SAAK,MAAM,OAAO,CAAO;AAAA,EAC3B;AACF;AAEA,WAAW,KAAY,OAAO,KAAK,CAAS,EAC1C,QAAO,eAAe,EAAqB,WAAW,GAAU;AAAA,EAC9D,MAAM;AACJ,WAAO,KAAK,SAAS,CAAQ;AAAA,EAC/B;AAAA,EACA,IAAI,GAAgB;AAClB,SAAK,SAAS,GAAU,CAAK;AAAA,EAC/B;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAChB,CAAC;AAGC,OAAO,iBAAmB,OAAe,CAAC,eAAe,IAAI,yBAAyB,KACxF,eAAe,OAAO,2BAA2B,CAAoB"}
|
|
@@ -100,7 +100,7 @@ function y({ title: e = "Reasoning", isOpen: r, onToggle: t, isStreaming: i = !1
|
|
|
100
100
|
className: "flex items-center gap-2",
|
|
101
101
|
children: [
|
|
102
102
|
/* @__PURE__ */ n(g, {
|
|
103
|
-
className: o("size-4", i ? "text-primary" : "text-
|
|
103
|
+
className: o("size-4", i ? "text-primary" : "text-muted-foreground"),
|
|
104
104
|
"aria-hidden": "true"
|
|
105
105
|
}),
|
|
106
106
|
/* @__PURE__ */ n("span", {
|