@b3-crow/ui-kit 0.0.34 → 0.0.36
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/components/backgrounds/DashboardBackground.d.ts +4 -0
- package/dist/components/backgrounds/DashboardBackground.d.ts.map +1 -0
- package/dist/components/backgrounds/DashboardBackground.js +20 -0
- package/dist/components/backgrounds/DashboardBackground.js.map +1 -0
- package/dist/components/buttons/CollapseToggleButton.d.ts +7 -0
- package/dist/components/buttons/CollapseToggleButton.d.ts.map +1 -0
- package/dist/components/buttons/CollapseToggleButton.js +7 -0
- package/dist/components/buttons/CollapseToggleButton.js.map +1 -0
- package/dist/components/cards/MetricsCard.d.ts +10 -0
- package/dist/components/cards/MetricsCard.d.ts.map +1 -0
- package/dist/components/cards/MetricsCard.js +27 -0
- package/dist/components/cards/MetricsCard.js.map +1 -0
- package/dist/components/cards/PatternCard.d.ts +15 -0
- package/dist/components/cards/PatternCard.d.ts.map +1 -0
- package/dist/components/cards/PatternCard.js +45 -0
- package/dist/components/cards/PatternCard.js.map +1 -0
- package/dist/components/cards/TipCard.d.ts +5 -0
- package/dist/components/cards/TipCard.d.ts.map +1 -0
- package/dist/components/cards/TipCard.js +10 -0
- package/dist/components/cards/TipCard.js.map +1 -0
- package/dist/components/chat/ChatHistorySection.d.ts +4 -0
- package/dist/components/chat/ChatHistorySection.d.ts.map +1 -0
- package/dist/components/chat/ChatHistorySection.js +121 -0
- package/dist/components/chat/ChatHistorySection.js.map +1 -0
- package/dist/components/chat/MessageBubble.d.ts +13 -0
- package/dist/components/chat/MessageBubble.d.ts.map +1 -0
- package/dist/components/chat/MessageBubble.js +19 -0
- package/dist/components/chat/MessageBubble.js.map +1 -0
- package/dist/components/display/CodeBlock.d.ts.map +1 -1
- package/dist/components/display/CodeBlock.js +17 -5
- package/dist/components/display/CodeBlock.js.map +1 -1
- package/dist/components/display/IconBadge.d.ts +12 -0
- package/dist/components/display/IconBadge.d.ts.map +1 -0
- package/dist/components/display/IconBadge.js +26 -0
- package/dist/components/display/IconBadge.js.map +1 -0
- package/dist/components/display/SourceIcon.d.ts +7 -0
- package/dist/components/display/SourceIcon.d.ts.map +1 -0
- package/dist/components/display/SourceIcon.js +23 -0
- package/dist/components/display/SourceIcon.js.map +1 -0
- package/dist/components/display/StatusBadge.d.ts +14 -0
- package/dist/components/display/StatusBadge.d.ts.map +1 -0
- package/dist/components/display/StatusBadge.js +30 -0
- package/dist/components/display/StatusBadge.js.map +1 -0
- package/dist/components/display/StatusIndicator.d.ts +7 -0
- package/dist/components/display/StatusIndicator.d.ts.map +1 -0
- package/dist/components/display/StatusIndicator.js +26 -0
- package/dist/components/display/StatusIndicator.js.map +1 -0
- package/dist/components/display/Tag.d.ts +7 -0
- package/dist/components/display/Tag.d.ts.map +1 -0
- package/dist/components/display/Tag.js +12 -0
- package/dist/components/display/Tag.js.map +1 -0
- package/dist/components/feedback/GeneratingState.d.ts +12 -0
- package/dist/components/feedback/GeneratingState.d.ts.map +1 -0
- package/dist/components/feedback/GeneratingState.js +19 -0
- package/dist/components/feedback/GeneratingState.js.map +1 -0
- package/dist/components/feedback/SettingsModal.d.ts +4 -0
- package/dist/components/feedback/SettingsModal.d.ts.map +1 -0
- package/dist/components/feedback/SettingsModal.js +56 -0
- package/dist/components/feedback/SettingsModal.js.map +1 -0
- package/dist/components/index.d.ts +32 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +33 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/FilterDropdown.d.ts +14 -0
- package/dist/components/inputs/FilterDropdown.d.ts.map +1 -0
- package/dist/components/inputs/FilterDropdown.js +112 -0
- package/dist/components/inputs/FilterDropdown.js.map +1 -0
- package/dist/components/inputs/SearchInput.d.ts +14 -0
- package/dist/components/inputs/SearchInput.d.ts.map +1 -0
- package/dist/components/inputs/SearchInput.js +38 -0
- package/dist/components/inputs/SearchInput.js.map +1 -0
- package/dist/components/inputs/SettingsDropup.d.ts +10 -0
- package/dist/components/inputs/SettingsDropup.d.ts.map +1 -0
- package/dist/components/inputs/SettingsDropup.js +94 -0
- package/dist/components/inputs/SettingsDropup.js.map +1 -0
- package/dist/components/inputs/SuggestionChip.d.ts +10 -0
- package/dist/components/inputs/SuggestionChip.d.ts.map +1 -0
- package/dist/components/inputs/SuggestionChip.js +12 -0
- package/dist/components/inputs/SuggestionChip.js.map +1 -0
- package/dist/components/inputs/ToggleSwitch.d.ts +8 -0
- package/dist/components/inputs/ToggleSwitch.d.ts.map +1 -0
- package/dist/components/inputs/ToggleSwitch.js +29 -0
- package/dist/components/inputs/ToggleSwitch.js.map +1 -0
- package/dist/components/layout/GlassPanel.d.ts +4 -0
- package/dist/components/layout/GlassPanel.d.ts.map +1 -0
- package/dist/components/layout/GlassPanel.js +11 -0
- package/dist/components/layout/GlassPanel.js.map +1 -0
- package/dist/components/layout/Header.d.ts +4 -0
- package/dist/components/layout/Header.d.ts.map +1 -0
- package/dist/components/layout/Header.js +127 -0
- package/dist/components/layout/Header.js.map +1 -0
- package/dist/components/layout/ListItem.d.ts +10 -0
- package/dist/components/layout/ListItem.d.ts.map +1 -0
- package/dist/components/layout/ListItem.js +14 -0
- package/dist/components/layout/ListItem.js.map +1 -0
- package/dist/components/layout/MobileSidebar.d.ts +4 -0
- package/dist/components/layout/MobileSidebar.d.ts.map +1 -0
- package/dist/components/layout/MobileSidebar.js +45 -0
- package/dist/components/layout/MobileSidebar.js.map +1 -0
- package/dist/components/layout/NavMenu.d.ts +10 -0
- package/dist/components/layout/NavMenu.d.ts.map +1 -0
- package/dist/components/layout/NavMenu.js +68 -0
- package/dist/components/layout/NavMenu.js.map +1 -0
- package/dist/components/layout/NavTooltip.d.ts +10 -0
- package/dist/components/layout/NavTooltip.d.ts.map +1 -0
- package/dist/components/layout/NavTooltip.js +36 -0
- package/dist/components/layout/NavTooltip.js.map +1 -0
- package/dist/components/layout/SectionHeader.d.ts +13 -0
- package/dist/components/layout/SectionHeader.d.ts.map +1 -0
- package/dist/components/layout/SectionHeader.js +22 -0
- package/dist/components/layout/SectionHeader.js.map +1 -0
- package/dist/components/layout/SidePanel.d.ts +12 -0
- package/dist/components/layout/SidePanel.d.ts.map +1 -0
- package/dist/components/layout/SidePanel.js +79 -0
- package/dist/components/layout/SidePanel.js.map +1 -0
- package/dist/components/layout/Sidebar.d.ts +4 -0
- package/dist/components/layout/Sidebar.d.ts.map +1 -0
- package/dist/components/layout/Sidebar.js +15 -0
- package/dist/components/layout/Sidebar.js.map +1 -0
- package/dist/components/layout/SidebarLogo.d.ts +9 -0
- package/dist/components/layout/SidebarLogo.d.ts.map +1 -0
- package/dist/components/layout/SidebarLogo.js +10 -0
- package/dist/components/layout/SidebarLogo.js.map +1 -0
- package/dist/components/providers/LenisProvider.d.ts +22 -0
- package/dist/components/providers/LenisProvider.d.ts.map +1 -0
- package/dist/components/providers/LenisProvider.js +45 -0
- package/dist/components/providers/LenisProvider.js.map +1 -0
- package/dist/lib/constants/accessibility.d.ts +24 -0
- package/dist/lib/constants/accessibility.d.ts.map +1 -0
- package/dist/lib/constants/accessibility.js +26 -0
- package/dist/lib/constants/accessibility.js.map +1 -0
- package/dist/lib/constants/animations.d.ts +73 -0
- package/dist/lib/constants/animations.d.ts.map +1 -0
- package/dist/lib/constants/animations.js +48 -0
- package/dist/lib/constants/animations.js.map +1 -0
- package/dist/lib/constants/colors.d.ts +55 -0
- package/dist/lib/constants/colors.d.ts.map +1 -0
- package/dist/lib/constants/colors.js +55 -0
- package/dist/lib/constants/colors.js.map +1 -0
- package/dist/lib/constants/gradients.d.ts +29 -0
- package/dist/lib/constants/gradients.d.ts.map +1 -0
- package/dist/lib/constants/gradients.js +29 -0
- package/dist/lib/constants/gradients.js.map +1 -0
- package/dist/lib/constants/icons.d.ts +4 -0
- package/dist/lib/constants/icons.d.ts.map +1 -0
- package/dist/lib/constants/icons.js +23 -0
- package/dist/lib/constants/icons.js.map +1 -0
- package/dist/lib/constants/navigation.d.ts +3 -0
- package/dist/lib/constants/navigation.d.ts.map +1 -0
- package/dist/lib/constants/navigation.js +35 -0
- package/dist/lib/constants/navigation.js.map +1 -0
- package/dist/lib/constants/sizing.d.ts +61 -0
- package/dist/lib/constants/sizing.d.ts.map +1 -0
- package/dist/lib/constants/sizing.js +49 -0
- package/dist/lib/constants/sizing.js.map +1 -0
- package/dist/lib/constants/styles.d.ts +44 -0
- package/dist/lib/constants/styles.d.ts.map +1 -0
- package/dist/lib/constants/styles.js +44 -0
- package/dist/lib/constants/styles.js.map +1 -0
- package/dist/lib/constants.d.ts +32 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +105 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/types.d.ts +94 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils/accessibilityUtils.d.ts +9 -0
- package/dist/lib/utils/accessibilityUtils.d.ts.map +1 -0
- package/dist/lib/utils/accessibilityUtils.js +56 -0
- package/dist/lib/utils/accessibilityUtils.js.map +1 -0
- package/dist/lib/utils/pathUtils.d.ts +4 -0
- package/dist/lib/utils/pathUtils.d.ts.map +1 -0
- package/dist/lib/utils/pathUtils.js +16 -0
- package/dist/lib/utils/pathUtils.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +24 -14
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
const badgeVariants = cva('inline-flex items-center rounded font-medium', {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
positive: 'bg-emerald-500/10 text-emerald-400 border border-emerald-500/20',
|
|
9
|
+
negative: 'bg-rose-500/10 text-rose-400 border border-rose-500/20',
|
|
10
|
+
warning: 'bg-yellow-500/10 text-yellow-400 border border-yellow-500/20',
|
|
11
|
+
neutral: 'bg-gray-500/10 text-gray-400 border border-gray-500/20',
|
|
12
|
+
info: 'bg-violet-500/10 text-violet-300 border border-violet-500/20',
|
|
13
|
+
high: 'bg-violet-500/20 text-violet-300 border border-violet-500/20',
|
|
14
|
+
medium: 'bg-violet-500/10 text-violet-400 border border-violet-500/10',
|
|
15
|
+
low: 'bg-gray-500/10 text-gray-400 border border-gray-500/10',
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: 'px-2 py-0.5 text-[10px]',
|
|
19
|
+
sm: 'px-1.5 py-0.5 text-[9px]',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: 'neutral',
|
|
24
|
+
size: 'default',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
export function StatusBadge({ children, variant = 'neutral', size = 'default', className = '', uppercase = false, tracking = false, }) {
|
|
28
|
+
return (_jsx("span", { className: cn(badgeVariants({ variant, size }), uppercase && 'uppercase', tracking && 'tracking-wider', className), children: children }));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=StatusBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBadge.js","sourceRoot":"","sources":["../../../src/components/display/StatusBadge.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,MAAM,aAAa,GAAG,GAAG,CAAC,8CAA8C,EAAE;IACxE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,QAAQ,EACN,iEAAiE;YACnE,QAAQ,EAAE,wDAAwD;YAClE,OAAO,EAAE,8DAA8D;YACvE,OAAO,EAAE,wDAAwD;YACjE,IAAI,EAAE,8DAA8D;YACpE,IAAI,EAAE,8DAA8D;YACpE,MAAM,EAAE,8DAA8D;YACtE,GAAG,EAAE,wDAAwD;SAC9D;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,yBAAyB;YAClC,EAAE,EAAE,0BAA0B;SAC/B;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CAAC;AASH,MAAM,UAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,SAAS,EAChB,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,KAAK,EACjB,QAAQ,GAAG,KAAK,GACC;IACjB,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAChC,SAAS,IAAI,WAAW,EACxB,QAAQ,IAAI,gBAAgB,EAC5B,SAAS,CACV,YAEA,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface StatusIndicatorProps {
|
|
2
|
+
status?: 'active' | 'inactive' | 'processing';
|
|
3
|
+
label?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function StatusIndicator({ status, label, className, }: StatusIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=StatusIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/display/StatusIndicator.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoBD,wBAAgB,eAAe,CAAC,EAC9B,MAAiB,EACjB,KAAK,EACL,SAAS,GACV,EAAE,oBAAoB,2CAuBtB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
const statusConfig = {
|
|
5
|
+
active: {
|
|
6
|
+
dotColor: 'bg-violet-400',
|
|
7
|
+
textColor: 'text-violet-300',
|
|
8
|
+
label: 'System Active',
|
|
9
|
+
},
|
|
10
|
+
inactive: {
|
|
11
|
+
dotColor: 'bg-gray-500',
|
|
12
|
+
textColor: 'text-gray-400',
|
|
13
|
+
label: 'System Offline',
|
|
14
|
+
},
|
|
15
|
+
processing: {
|
|
16
|
+
dotColor: 'bg-amber-400',
|
|
17
|
+
textColor: 'text-amber-300',
|
|
18
|
+
label: 'Processing',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export function StatusIndicator({ status = 'active', label, className, }) {
|
|
22
|
+
const config = statusConfig[status];
|
|
23
|
+
const displayLabel = label ?? config.label;
|
|
24
|
+
return (_jsxs("div", { className: cn('inline-flex items-center gap-2 px-4 py-1.5 rounded-full', 'backdrop-blur-sm bg-violet-500/10 border border-violet-500/20', className), children: [_jsx("div", { className: cn('w-1.5 h-1.5 rounded-full', config.dotColor) }), _jsx("span", { className: cn('text-[10px] font-bold uppercase tracking-[1px] leading-[15px]', config.textColor), children: displayLabel })] }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=StatusIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusIndicator.js","sourceRoot":"","sources":["../../../src/components/display/StatusIndicator.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAQrC,MAAM,YAAY,GAAG;IACnB,MAAM,EAAE;QACN,QAAQ,EAAE,eAAe;QACzB,SAAS,EAAE,iBAAiB;QAC5B,KAAK,EAAE,eAAe;KACvB;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,aAAa;QACvB,SAAS,EAAE,eAAe;QAC1B,KAAK,EAAE,gBAAgB;KACxB;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,cAAc;QACxB,SAAS,EAAE,gBAAgB;QAC3B,KAAK,EAAE,YAAY;KACpB;CACO,CAAC;AAEX,MAAM,UAAU,eAAe,CAAC,EAC9B,MAAM,GAAG,QAAQ,EACjB,KAAK,EACL,SAAS,GACY;IACrB,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC;IAE3C,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,yDAAyD,EACzD,+DAA+D,EAC/D,SAAS,CACV,aAED,cAAK,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAI,EACnE,eACE,SAAS,EAAE,EAAE,CACX,+DAA+D,EAC/D,MAAM,CAAC,SAAS,CACjB,YAEA,YAAY,GACR,IACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface TagProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
variant?: 'default' | 'active';
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function Tag({ children, variant, className }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=Tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../src/components/display/Tag.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD,wBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAmB,EAAE,SAAS,EAAE,EAAE,QAAQ,2CAczE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
const tagStyles = {
|
|
5
|
+
default: { background: 'rgba(107, 114, 128, 0.20)', color: '#9CA3AF' },
|
|
6
|
+
active: { background: 'rgba(139, 92, 246, 0.20)', color: '#C4B5FD' },
|
|
7
|
+
};
|
|
8
|
+
export function Tag({ children, variant = 'default', className }) {
|
|
9
|
+
const style = tagStyles[variant];
|
|
10
|
+
return (_jsx("span", { className: cn('inline-flex items-center px-2 py-0.5 rounded text-[10px] font-medium', className), style: style, children: children }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../../src/components/display/Tag.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAQrC,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,EAAE,UAAU,EAAE,2BAA2B,EAAE,KAAK,EAAE,SAAS,EAAE;IACtE,MAAM,EAAE,EAAE,UAAU,EAAE,0BAA0B,EAAE,KAAK,EAAE,SAAS,EAAE;CAC5D,CAAC;AAEX,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,SAAS,EAAY;IACxE,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAEjC,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,sEAAsE,EACtE,SAAS,CACV,EACD,KAAK,EAAE,KAAK,YAEX,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface GeneratingStateProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
subtitle?: string;
|
|
4
|
+
showDots?: boolean;
|
|
5
|
+
showOrbitals?: boolean;
|
|
6
|
+
avatarSrc?: string;
|
|
7
|
+
avatarAlt?: string;
|
|
8
|
+
orbitalDurationFast?: number;
|
|
9
|
+
orbitalDurationSlow?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function GeneratingState({ label, subtitle, showDots, showOrbitals, avatarSrc, avatarAlt, orbitalDurationFast, orbitalDurationSlow, }: GeneratingStateProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=GeneratingState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneratingState.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/GeneratingState.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AA6BD,wBAAgB,eAAe,CAAC,EAC9B,KAAiC,EACjC,QAAuB,EACvB,QAAe,EACf,YAAmB,EACnB,SAA2B,EAC3B,SAAwB,EACxB,mBAA0B,EAC1B,mBAA0B,GAC3B,EAAE,oBAAoB,2CA6DtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
function AnimatedDot({ delay }) {
|
|
5
|
+
return (_jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-purple-400 animate-pulse", style: { animationDelay: delay } }));
|
|
6
|
+
}
|
|
7
|
+
function OrbitalRing({ duration, direction = 'normal', }) {
|
|
8
|
+
return (_jsx("div", { className: "absolute rounded-full border border-purple-500/30 animate-spin", style: {
|
|
9
|
+
animationDuration: `${duration}ms`,
|
|
10
|
+
animationDirection: direction,
|
|
11
|
+
} }));
|
|
12
|
+
}
|
|
13
|
+
export function GeneratingState({ label = 'Processing your request', subtitle = 'Processing', showDots = true, showOrbitals = true, avatarSrc = '/favicon.webp', avatarAlt = 'Processing', orbitalDurationFast = 3000, orbitalDurationSlow = 5000, }) {
|
|
14
|
+
return (_jsx("div", { className: "flex justify-start animate-fadeIn", children: _jsx("div", { className: "border rounded-2xl px-5 py-4 max-w-[85%]", style: {
|
|
15
|
+
background: 'rgba(255, 255, 255, 0.03)',
|
|
16
|
+
borderColor: 'rgba(255, 255, 255, 0.1)',
|
|
17
|
+
}, children: _jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "relative", children: [_jsx("div", { className: "w-10 h-10 rounded-full flex items-center justify-center ring-1 ring-purple-500/40", style: { background: 'rgba(0, 0, 0, 0.6)' }, children: _jsx(Image, { src: avatarSrc, alt: avatarAlt, width: 24, height: 24, className: "rounded-full animate-pulse" }) }), showOrbitals && (_jsxs(_Fragment, { children: [_jsx(OrbitalRing, { duration: orbitalDurationFast, direction: "normal" }), _jsx(OrbitalRing, { duration: orbitalDurationSlow, direction: "reverse" })] }))] }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-[13px] font-medium text-white/90", children: label }), showDots && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("div", { className: "flex gap-[3px]", children: [_jsx(AnimatedDot, { delay: "0ms" }), _jsx(AnimatedDot, { delay: "200ms" }), _jsx(AnimatedDot, { delay: "400ms" })] }), _jsx("span", { className: "text-[11px] text-gray-500 uppercase tracking-wider", children: subtitle })] }))] })] }) }) }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=GeneratingState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneratingState.js","sourceRoot":"","sources":["../../../src/components/feedback/GeneratingState.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,YAAY,CAAC;AAa/B,SAAS,WAAW,CAAC,EAAE,KAAK,EAAqB;IAC/C,OAAO,CACL,cACE,SAAS,EAAC,sDAAsD,EAChE,KAAK,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,GAChC,CACH,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,QAAQ,EACR,SAAS,GAAG,QAAQ,GAIrB;IACC,OAAO,CACL,cACE,SAAS,EAAC,gEAAgE,EAC1E,KAAK,EAAE;YACL,iBAAiB,EAAE,GAAG,QAAQ,IAAI;YAClC,kBAAkB,EAAE,SAAS;SAC9B,GACD,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAC9B,KAAK,GAAG,yBAAyB,EACjC,QAAQ,GAAG,YAAY,EACvB,QAAQ,GAAG,IAAI,EACf,YAAY,GAAG,IAAI,EACnB,SAAS,GAAG,eAAe,EAC3B,SAAS,GAAG,YAAY,EACxB,mBAAmB,GAAG,IAAI,EAC1B,mBAAmB,GAAG,IAAI,GACL;IACrB,OAAO,CACL,cAAK,SAAS,EAAC,mCAAmC,YAChD,cACE,SAAS,EAAC,0CAA0C,EACpD,KAAK,EAAE;gBACL,UAAU,EAAE,2BAA2B;gBACvC,WAAW,EAAE,0BAA0B;aACxC,YAED,eAAK,SAAS,EAAC,yBAAyB,aACtC,eAAK,SAAS,EAAC,UAAU,aACvB,cACE,SAAS,EAAC,mFAAmF,EAC7F,KAAK,EAAE,EAAE,UAAU,EAAE,oBAAoB,EAAE,YAE3C,KAAC,KAAK,IACJ,GAAG,EAAE,SAAS,EACd,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,SAAS,EAAC,4BAA4B,GACtC,GACE,EAEL,YAAY,IAAI,CACf,8BACE,KAAC,WAAW,IACV,QAAQ,EAAE,mBAAmB,EAC7B,SAAS,EAAC,QAAQ,GAClB,EACF,KAAC,WAAW,IACV,QAAQ,EAAE,mBAAmB,EAC7B,SAAS,EAAC,SAAS,GACnB,IACD,CACJ,IACG,EAEN,eAAK,SAAS,EAAC,qBAAqB,aAClC,eAAM,SAAS,EAAC,uCAAuC,YACpD,KAAK,GACD,EAEN,QAAQ,IAAI,CACX,eAAK,SAAS,EAAC,yBAAyB,aACtC,eAAK,SAAS,EAAC,gBAAgB,aAC7B,KAAC,WAAW,IAAC,KAAK,EAAC,KAAK,GAAG,EAC3B,KAAC,WAAW,IAAC,KAAK,EAAC,OAAO,GAAG,EAC7B,KAAC,WAAW,IAAC,KAAK,EAAC,OAAO,GAAG,IACzB,EACN,eAAM,SAAS,EAAC,oDAAoD,YACjE,QAAQ,GACJ,IACH,CACP,IACG,IACF,GACF,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SettingsModalProps } from '../../lib/types';
|
|
2
|
+
export type { SettingsModalProps };
|
|
3
|
+
export declare function SettingsModal({ isOpen, onClose, userEmail, userName, onLogout, onNotificationsChange, initialNotifications, }: SettingsModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
//# sourceMappingURL=SettingsModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsModal.d.ts","sourceRoot":"","sources":["../../../src/components/feedback/SettingsModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAM1D,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEnC,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,OAAO,EACP,SAA8B,EAC9B,QAAiB,EACjB,QAAQ,EACR,qBAAqB,EACrB,oBAA2B,GAC5B,EAAE,kBAAkB,kDA2KpB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Bell, BellOff, Globe, LogOut, User, X } from 'lucide-react';
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
import { ToggleSwitch } from '../inputs/ToggleSwitch';
|
|
7
|
+
export function SettingsModal({ isOpen, onClose, userEmail = 'user@example.com', userName = 'User', onLogout, onNotificationsChange, initialNotifications = true, }) {
|
|
8
|
+
const [notifications, setNotifications] = useState(initialNotifications);
|
|
9
|
+
const [isClosing, setIsClosing] = useState(false);
|
|
10
|
+
const closeTimeoutRef = useRef(null);
|
|
11
|
+
const modalRef = useRef(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (isOpen) {
|
|
14
|
+
setIsClosing(false);
|
|
15
|
+
modalRef.current?.focus();
|
|
16
|
+
}
|
|
17
|
+
}, [isOpen]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setNotifications(initialNotifications);
|
|
20
|
+
}, [initialNotifications]);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
return () => {
|
|
23
|
+
if (closeTimeoutRef.current) {
|
|
24
|
+
clearTimeout(closeTimeoutRef.current);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
const handleClose = useCallback(() => {
|
|
29
|
+
setIsClosing(true);
|
|
30
|
+
closeTimeoutRef.current = setTimeout(() => {
|
|
31
|
+
onClose();
|
|
32
|
+
}, 200);
|
|
33
|
+
}, [onClose]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!isOpen)
|
|
36
|
+
return;
|
|
37
|
+
const handleKeyDown = (e) => {
|
|
38
|
+
if (e.key === 'Escape') {
|
|
39
|
+
handleClose();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
43
|
+
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
44
|
+
}, [isOpen, handleClose]);
|
|
45
|
+
const toggleNotifications = () => {
|
|
46
|
+
const newValue = !notifications;
|
|
47
|
+
setNotifications(newValue);
|
|
48
|
+
onNotificationsChange?.(newValue);
|
|
49
|
+
};
|
|
50
|
+
if (!isOpen)
|
|
51
|
+
return null;
|
|
52
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { role: "presentation", "aria-hidden": "true", onClick: handleClose, className: cn('fixed inset-0 bg-black/60 backdrop-blur-sm z-[100] transition-opacity duration-200', isClosing ? 'opacity-0' : 'opacity-100') }), _jsxs("div", { ref: modalRef, role: "dialog", "aria-modal": "true", "aria-labelledby": "settings-modal-title", tabIndex: -1, className: cn('fixed top-1/2 left-1/2 w-[400px] max-w-[90vw] z-[101]', 'bg-[rgba(10,5,20,0.98)] backdrop-blur-[20px] rounded-2xl', 'border border-white/[0.08]', 'shadow-[0px_24px_48px_rgba(0,0,0,0.5),0px_0px_1px_rgba(139,92,246,0.3)]', 'transition-all duration-200 ease-[cubic-bezier(0.16,1,0.3,1)]', isClosing
|
|
53
|
+
? 'opacity-0 -translate-x-1/2 -translate-y-1/2 scale-95'
|
|
54
|
+
: 'opacity-100 -translate-x-1/2 -translate-y-1/2 scale-100'), children: [_jsxs("div", { className: "flex items-center justify-between px-6 py-5 border-b border-white/[0.06]", children: [_jsx("h2", { id: "settings-modal-title", className: "text-white text-lg font-semibold font-[Sora,sans-serif] m-0", children: "Settings" }), _jsx("button", { type: "button", onClick: handleClose, "aria-label": "Close settings", className: "w-8 h-8 flex items-center justify-center bg-transparent border-none rounded-lg cursor-pointer transition-colors hover:bg-white/[0.06]", children: _jsx(X, { size: 18, className: "text-gray-500", strokeWidth: 2 }) })] }), _jsx("div", { className: "px-6 py-5 border-b border-white/[0.06]", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "w-12 h-12 rounded-full bg-violet-500/20 flex items-center justify-center border border-violet-500/30", children: _jsx(User, { size: 24, className: "text-violet-400", strokeWidth: 1.5 }) }), _jsxs("div", { children: [_jsx("div", { className: "text-white text-sm font-medium font-[Sora,sans-serif]", children: userName }), _jsx("div", { className: "text-gray-500 text-xs font-[Sora,sans-serif] mt-0.5", children: userEmail })] })] }) }), _jsxs("div", { className: "p-3 px-4", children: [_jsxs("button", { type: "button", onClick: toggleNotifications, className: "w-full px-3 py-3.5 flex items-center justify-between bg-transparent border-none rounded-[10px] cursor-pointer transition-colors hover:bg-white/[0.04]", children: [_jsxs("div", { className: "flex items-center gap-3", children: [notifications ? (_jsx(Bell, { size: 18, className: "text-emerald-500", strokeWidth: 2 })) : (_jsx(BellOff, { size: 18, className: "text-gray-500", strokeWidth: 2 })), _jsx("span", { className: "text-gray-300 text-sm font-[Sora,sans-serif]", children: "Notifications" })] }), _jsx(ToggleSwitch, { enabled: notifications, onChange: toggleNotifications, "aria-label": "Toggle notifications" })] }), _jsxs("button", { type: "button", disabled: true, "aria-disabled": "true", className: "w-full px-3 py-3.5 flex items-center justify-between bg-transparent border-none rounded-[10px] cursor-not-allowed opacity-60", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Globe, { size: 18, className: "text-gray-500", strokeWidth: 2 }), _jsx("span", { className: "text-gray-300 text-sm font-[Sora,sans-serif]", children: "Language" })] }), _jsx("div", { className: "text-gray-500 text-[13px] font-[Sora,sans-serif]", children: "English" })] })] }), onLogout && (_jsx("div", { className: "px-4 pt-3 pb-5 border-t border-white/[0.06]", children: _jsxs("button", { type: "button", onClick: onLogout, className: "w-full p-3 flex items-center justify-center gap-2 bg-red-500/10 border border-red-500/20 rounded-[10px] cursor-pointer transition-all hover:bg-red-500/15 hover:border-red-500/30", children: [_jsx(LogOut, { size: 16, className: "text-red-500", strokeWidth: 2 }), _jsx("span", { className: "text-red-500 text-sm font-medium font-[Sora,sans-serif]", children: "Sign out" })] }) }))] })] }));
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=SettingsModal.js.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AI,CAChE,CAAC,CAAC,CAAC,CACF,KAAC,OAAO,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,eAAe,EAAC,WAAW,EAAE,CAAC,GAAI,CAChE,EACD,eAAM,SAAS,EAAC,8CAA8C,8BAEvD,IACH,EACN,KAAC,YAAY,IACX,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,mBAAmB,gBAClB,sBAAsB,GACjC,IACK,EAET,kBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,yBACM,MAAM,EACpB,SAAS,EAAC,8HAA8H,aAExI,eAAK,SAAS,EAAC,yBAAyB,aACtC,KAAC,KAAK,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,eAAe,EAAC,WAAW,EAAE,CAAC,GAAI,EAC7D,eAAM,SAAS,EAAC,8CAA8C,yBAEvD,IACH,EACN,cAAK,SAAS,EAAC,kDAAkD,wBAE3D,IACC,IACL,EAEL,QAAQ,IAAI,CACX,cAAK,SAAS,EAAC,6CAA6C,YAC1D,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAC,mLAAmL,aAE7L,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,cAAc,EAAC,WAAW,EAAE,CAAC,GAAI,EAC7D,eAAM,SAAS,EAAC,yDAAyD,yBAElE,IACA,GACL,CACP,IACG,IACL,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,41 +1,73 @@
|
|
|
1
1
|
export * from './backgrounds/AnimatedBackground';
|
|
2
2
|
export * from './backgrounds/Globe';
|
|
3
3
|
export * from './backgrounds/GradientBackground';
|
|
4
|
+
export * from './backgrounds/DashboardBackground';
|
|
4
5
|
export * from './buttons/Button';
|
|
5
6
|
export * from './buttons/CompanyPageButton';
|
|
7
|
+
export * from './buttons/CollapseToggleButton';
|
|
6
8
|
export * from './cards/Card';
|
|
7
9
|
export * from './cards/CheckoutSummary';
|
|
8
10
|
export * from './cards/ConnectionOption';
|
|
9
11
|
export * from './cards/InvitationDetailsCard';
|
|
12
|
+
export * from './cards/MetricsCard';
|
|
13
|
+
export * from './cards/PatternCard';
|
|
10
14
|
export * from './cards/OrderSummaryCard';
|
|
11
15
|
export * from './cards/PendingInviteCard';
|
|
12
16
|
export * from './cards/PlanCard';
|
|
13
17
|
export * from './cards/PricingCard';
|
|
14
18
|
export * from './cards/RunAgentCard';
|
|
15
19
|
export * from './cards/SyncStatusCard';
|
|
20
|
+
export * from './cards/TipCard';
|
|
21
|
+
export * from './chat/MessageBubble';
|
|
22
|
+
export * from './chat/ChatHistorySection';
|
|
16
23
|
export * from './display/CodeBlock';
|
|
17
24
|
export * from './display/ConnectionStatus';
|
|
25
|
+
export * from './display/IconBadge';
|
|
18
26
|
export * from './display/Logo';
|
|
19
27
|
export * from './display/PackageManagerSelector';
|
|
28
|
+
export * from './display/SourceIcon';
|
|
29
|
+
export * from './display/StatusBadge';
|
|
30
|
+
export * from './display/StatusIndicator';
|
|
31
|
+
export * from './display/Tag';
|
|
32
|
+
export * from './feedback/GeneratingState';
|
|
33
|
+
export * from './feedback/SettingsModal';
|
|
20
34
|
export * from './inputs/ApiKeyInput';
|
|
21
35
|
export * from './inputs/Checkbox';
|
|
22
36
|
export * from './inputs/EmailTagInput';
|
|
37
|
+
export * from './inputs/FilterDropdown';
|
|
23
38
|
export * from './inputs/Input';
|
|
24
39
|
export * from './inputs/InputField';
|
|
25
40
|
export * from './inputs/NumberStepper';
|
|
26
41
|
export * from './inputs/PermissionToggle';
|
|
42
|
+
export * from './inputs/SearchInput';
|
|
27
43
|
export * from './inputs/Select';
|
|
44
|
+
export * from './inputs/SuggestionChip';
|
|
28
45
|
export * from './inputs/TagInput';
|
|
29
46
|
export * from './inputs/ToggleOption';
|
|
47
|
+
export * from './inputs/ToggleSwitch';
|
|
48
|
+
export * from './inputs/SettingsDropup';
|
|
30
49
|
export * from './layout/Divider';
|
|
31
50
|
export * from './layout/Footer';
|
|
32
51
|
export * from './layout/FormSection';
|
|
52
|
+
export * from './layout/GlassPanel';
|
|
33
53
|
export * from './layout/LinkGroup';
|
|
54
|
+
export * from './layout/ListItem';
|
|
34
55
|
export * from './layout/Navbar';
|
|
35
56
|
export * from './layout/PageHeader';
|
|
57
|
+
export * from './layout/SectionHeader';
|
|
36
58
|
export * from './layout/SegmentedControl';
|
|
59
|
+
export * from './layout/Header';
|
|
60
|
+
export * from './layout/Sidebar';
|
|
61
|
+
export * from './layout/SidebarLogo';
|
|
62
|
+
export * from './layout/MobileSidebar';
|
|
63
|
+
export * from './layout/NavMenu';
|
|
64
|
+
export * from './layout/NavTooltip';
|
|
65
|
+
export * from './layout/SidePanel';
|
|
66
|
+
export * from './providers/LenisProvider';
|
|
37
67
|
export * from './typography/HeroText';
|
|
38
68
|
export * from './typography/SectionLabel';
|
|
39
69
|
export * from './typography/Subtitle';
|
|
40
70
|
export * from './typography/TypewriterText';
|
|
71
|
+
export * from '../lib/constants';
|
|
72
|
+
export * from '../lib/types';
|
|
41
73
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAElD,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAE/C,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;A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C,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AAEtC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,uBAAuB,CAAC;AAEtC,cAAc,6BAA6B,CAAC;AAG5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,41 +1,74 @@
|
|
|
1
1
|
export * from './backgrounds/AnimatedBackground';
|
|
2
2
|
export * from './backgrounds/Globe';
|
|
3
3
|
export * from './backgrounds/GradientBackground';
|
|
4
|
+
export * from './backgrounds/DashboardBackground';
|
|
4
5
|
export * from './buttons/Button';
|
|
5
6
|
export * from './buttons/CompanyPageButton';
|
|
7
|
+
export * from './buttons/CollapseToggleButton';
|
|
6
8
|
export * from './cards/Card';
|
|
7
9
|
export * from './cards/CheckoutSummary';
|
|
8
10
|
export * from './cards/ConnectionOption';
|
|
9
11
|
export * from './cards/InvitationDetailsCard';
|
|
12
|
+
export * from './cards/MetricsCard';
|
|
13
|
+
export * from './cards/PatternCard';
|
|
10
14
|
export * from './cards/OrderSummaryCard';
|
|
11
15
|
export * from './cards/PendingInviteCard';
|
|
12
16
|
export * from './cards/PlanCard';
|
|
13
17
|
export * from './cards/PricingCard';
|
|
14
18
|
export * from './cards/RunAgentCard';
|
|
15
19
|
export * from './cards/SyncStatusCard';
|
|
20
|
+
export * from './cards/TipCard';
|
|
21
|
+
export * from './chat/MessageBubble';
|
|
22
|
+
export * from './chat/ChatHistorySection';
|
|
16
23
|
export * from './display/CodeBlock';
|
|
17
24
|
export * from './display/ConnectionStatus';
|
|
25
|
+
export * from './display/IconBadge';
|
|
18
26
|
export * from './display/Logo';
|
|
19
27
|
export * from './display/PackageManagerSelector';
|
|
28
|
+
export * from './display/SourceIcon';
|
|
29
|
+
export * from './display/StatusBadge';
|
|
30
|
+
export * from './display/StatusIndicator';
|
|
31
|
+
export * from './display/Tag';
|
|
32
|
+
export * from './feedback/GeneratingState';
|
|
33
|
+
export * from './feedback/SettingsModal';
|
|
20
34
|
export * from './inputs/ApiKeyInput';
|
|
21
35
|
export * from './inputs/Checkbox';
|
|
22
36
|
export * from './inputs/EmailTagInput';
|
|
37
|
+
export * from './inputs/FilterDropdown';
|
|
23
38
|
export * from './inputs/Input';
|
|
24
39
|
export * from './inputs/InputField';
|
|
25
40
|
export * from './inputs/NumberStepper';
|
|
26
41
|
export * from './inputs/PermissionToggle';
|
|
42
|
+
export * from './inputs/SearchInput';
|
|
27
43
|
export * from './inputs/Select';
|
|
44
|
+
export * from './inputs/SuggestionChip';
|
|
28
45
|
export * from './inputs/TagInput';
|
|
29
46
|
export * from './inputs/ToggleOption';
|
|
47
|
+
export * from './inputs/ToggleSwitch';
|
|
48
|
+
export * from './inputs/SettingsDropup';
|
|
30
49
|
export * from './layout/Divider';
|
|
31
50
|
export * from './layout/Footer';
|
|
32
51
|
export * from './layout/FormSection';
|
|
52
|
+
export * from './layout/GlassPanel';
|
|
33
53
|
export * from './layout/LinkGroup';
|
|
54
|
+
export * from './layout/ListItem';
|
|
34
55
|
export * from './layout/Navbar';
|
|
35
56
|
export * from './layout/PageHeader';
|
|
57
|
+
export * from './layout/SectionHeader';
|
|
36
58
|
export * from './layout/SegmentedControl';
|
|
59
|
+
export * from './layout/Header';
|
|
60
|
+
export * from './layout/Sidebar';
|
|
61
|
+
export * from './layout/SidebarLogo';
|
|
62
|
+
export * from './layout/MobileSidebar';
|
|
63
|
+
export * from './layout/NavMenu';
|
|
64
|
+
export * from './layout/NavTooltip';
|
|
65
|
+
export * from './layout/SidePanel';
|
|
66
|
+
export * from './providers/LenisProvider';
|
|
37
67
|
export * from './typography/HeroText';
|
|
38
68
|
export * from './typography/SectionLabel';
|
|
39
69
|
export * from './typography/Subtitle';
|
|
40
70
|
export * from './typography/TypewriterText';
|
|
71
|
+
// Shared constants and types from lib
|
|
72
|
+
export * from '../lib/constants';
|
|
73
|
+
export * from '../lib/types';
|
|
41
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAElD,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAE/C,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAE1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}
|
|
5
|
+
export interface FilterDropdownProps {
|
|
6
|
+
label: string;
|
|
7
|
+
options: FilterOption[];
|
|
8
|
+
value?: string;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
showBorder?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function FilterDropdown({ label, options, value, onChange, className, showBorder, }: FilterDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=FilterDropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterDropdown.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/FilterDropdown.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,EACR,SAAS,EACT,UAAkB,GACnB,EAAE,mBAAmB,2CAuLrB"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Check, ChevronDown } from 'lucide-react';
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
|
+
import { createPortal } from 'react-dom';
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
|
+
export function FilterDropdown({ label, options, value, onChange, className, showBorder = false, }) {
|
|
8
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
9
|
+
const [selectedValue, setSelectedValue] = useState(value || options[0]?.value);
|
|
10
|
+
const [focusedIndex, setFocusedIndex] = useState(-1);
|
|
11
|
+
const [dropdownPosition, setDropdownPosition] = useState({ top: 0, left: 0 });
|
|
12
|
+
const buttonRef = useRef(null);
|
|
13
|
+
const dropdownRef = useRef(null);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (value !== undefined && value !== selectedValue) {
|
|
16
|
+
const timer = setTimeout(() => setSelectedValue(value), 0);
|
|
17
|
+
return () => clearTimeout(timer);
|
|
18
|
+
}
|
|
19
|
+
}, [value, selectedValue]);
|
|
20
|
+
const selectedOption = options.find(opt => opt.value === selectedValue);
|
|
21
|
+
const updatePosition = useCallback(() => {
|
|
22
|
+
if (buttonRef.current) {
|
|
23
|
+
const rect = buttonRef.current.getBoundingClientRect();
|
|
24
|
+
setDropdownPosition({
|
|
25
|
+
top: rect.bottom + 4,
|
|
26
|
+
left: rect.left,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}, []);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
function handleClickOutside(event) {
|
|
32
|
+
const target = event.target;
|
|
33
|
+
if (buttonRef.current &&
|
|
34
|
+
!buttonRef.current.contains(target) &&
|
|
35
|
+
dropdownRef.current &&
|
|
36
|
+
!dropdownRef.current.contains(target)) {
|
|
37
|
+
setIsOpen(false);
|
|
38
|
+
setFocusedIndex(-1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
42
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
43
|
+
}, []);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (!isOpen)
|
|
46
|
+
return;
|
|
47
|
+
updatePosition();
|
|
48
|
+
window.addEventListener('resize', updatePosition);
|
|
49
|
+
return () => window.removeEventListener('resize', updatePosition);
|
|
50
|
+
}, [isOpen, updatePosition]);
|
|
51
|
+
const selectOption = (optionValue) => {
|
|
52
|
+
setSelectedValue(optionValue);
|
|
53
|
+
onChange?.(optionValue);
|
|
54
|
+
setIsOpen(false);
|
|
55
|
+
setFocusedIndex(-1);
|
|
56
|
+
};
|
|
57
|
+
const toggleDropdown = () => {
|
|
58
|
+
const newIsOpen = !isOpen;
|
|
59
|
+
if (newIsOpen) {
|
|
60
|
+
updatePosition();
|
|
61
|
+
setFocusedIndex(0);
|
|
62
|
+
}
|
|
63
|
+
setIsOpen(newIsOpen);
|
|
64
|
+
};
|
|
65
|
+
const handleFilterKeyDown = (e) => {
|
|
66
|
+
if (!isOpen) {
|
|
67
|
+
if (e.key === 'Enter' || e.key === ' ' || e.key === 'ArrowDown') {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
updatePosition();
|
|
70
|
+
setIsOpen(true);
|
|
71
|
+
setFocusedIndex(0);
|
|
72
|
+
}
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
switch (e.key) {
|
|
76
|
+
case 'Escape':
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
setIsOpen(false);
|
|
79
|
+
setFocusedIndex(-1);
|
|
80
|
+
buttonRef.current?.focus();
|
|
81
|
+
break;
|
|
82
|
+
case 'ArrowDown':
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
setFocusedIndex(prev => (prev < options.length - 1 ? prev + 1 : 0));
|
|
85
|
+
break;
|
|
86
|
+
case 'ArrowUp':
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
setFocusedIndex(prev => (prev > 0 ? prev - 1 : options.length - 1));
|
|
89
|
+
break;
|
|
90
|
+
case 'Enter':
|
|
91
|
+
case ' ':
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
if (focusedIndex >= 0 && focusedIndex < options.length) {
|
|
94
|
+
selectOption(options[focusedIndex].value);
|
|
95
|
+
}
|
|
96
|
+
break;
|
|
97
|
+
case 'Tab':
|
|
98
|
+
setIsOpen(false);
|
|
99
|
+
setFocusedIndex(-1);
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return (_jsxs("div", { className: cn('relative', className), children: [_jsxs("button", { ref: buttonRef, type: "button", onClick: toggleDropdown, onKeyDown: handleFilterKeyDown, "aria-expanded": isOpen, "aria-haspopup": "listbox", "aria-label": `${label} filter`, className: cn('h-[34px] px-3 flex items-center gap-2 rounded-lg transition-colors hover:bg-white/5', showBorder && 'border-r border-white/10 rounded-r-none pr-4', isOpen ? 'bg-white/5' : 'bg-transparent'), children: [_jsx("span", { className: "text-xs font-medium text-gray-300", children: selectedOption?.label || label }), _jsx(ChevronDown, { size: 12, className: cn('text-gray-500 transition-transform', isOpen && 'rotate-180') })] }), isOpen &&
|
|
104
|
+
typeof document !== 'undefined' &&
|
|
105
|
+
createPortal(_jsx("div", { ref: dropdownRef, role: "listbox", "aria-label": `${label} options`, className: "fixed min-w-[160px] py-1 rounded-lg z-[9999] bg-[rgba(20,10,35,0.98)] border border-white/10 shadow-[0_10px_40px_rgba(0,0,0,0.5)]", style: {
|
|
106
|
+
top: dropdownPosition.top,
|
|
107
|
+
left: dropdownPosition.left,
|
|
108
|
+
}, children: options.map((option, index) => (_jsxs("button", { type: "button", role: "option", "aria-selected": selectedValue === option.value, onClick: () => selectOption(option.value), className: cn('w-full px-3 py-2 flex items-center justify-between text-left transition-colors', focusedIndex === index && 'bg-white/5', focusedIndex !== index && 'hover:bg-white/5'), children: [_jsx("span", { className: cn('text-xs', selectedValue === option.value
|
|
109
|
+
? 'text-white'
|
|
110
|
+
: 'text-gray-400'), children: option.label }), selectedValue === option.value && (_jsx(Check, { size: 12, className: "text-purple-400" }))] }, option.value))) }), document.body)] }));
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=FilterDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterDropdown.js","sourceRoot":"","sources":["../../../src/components/inputs/FilterDropdown.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,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value?: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
onSubmit?: (value: string) => void;
|
|
7
|
+
showMicButton?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
helperText?: string;
|
|
11
|
+
variant?: 'default' | 'transparent';
|
|
12
|
+
}
|
|
13
|
+
export declare function SearchInput({ placeholder, value: controlledValue, defaultValue, onChange, onSubmit, showMicButton, disabled, className, helperText, variant, }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=SearchInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/SearchInput.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CACrC;AA6DD,wBAAgB,WAAW,CAAC,EAC1B,WAAyB,EACzB,KAAK,EAAE,eAAe,EACtB,YAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,aAAoB,EACpB,QAAgB,EAChB,SAAS,EACT,UAAU,EACV,OAAmB,GACpB,EAAE,gBAAgB,2CAgElB"}
|