@burdenoff/microfe-botmanor 2026.813.1
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/README.md +12 -0
- package/dist/botlit/BotlitRoutes.js +357 -0
- package/dist/botlit/BotlitRoutes.js.map +1 -0
- package/dist/botlit/BotmanorRoot.js +12 -0
- package/dist/botlit/BotmanorRoot.js.map +1 -0
- package/dist/botlit/BotmanorRootInner.js +101 -0
- package/dist/botlit/BotmanorRootInner.js.map +1 -0
- package/dist/botlit/components/Badge.js +39 -0
- package/dist/botlit/components/Badge.js.map +1 -0
- package/dist/botlit/components/Button.js +46 -0
- package/dist/botlit/components/Button.js.map +1 -0
- package/dist/botlit/components/Card.js +31 -0
- package/dist/botlit/components/Card.js.map +1 -0
- package/dist/botlit/components/ChannelSelectorSheet.js +130 -0
- package/dist/botlit/components/ChannelSelectorSheet.js.map +1 -0
- package/dist/botlit/components/EmptyState.js +35 -0
- package/dist/botlit/components/EmptyState.js.map +1 -0
- package/dist/botlit/components/ErrorState.js +33 -0
- package/dist/botlit/components/ErrorState.js.map +1 -0
- package/dist/botlit/components/Input.js +59 -0
- package/dist/botlit/components/Input.js.map +1 -0
- package/dist/botlit/components/PageLayout.js +34 -0
- package/dist/botlit/components/PageLayout.js.map +1 -0
- package/dist/botlit/components/QuotaExhaustedDialog.js +20 -0
- package/dist/botlit/components/QuotaExhaustedDialog.js.map +1 -0
- package/dist/botlit/components/RouteLoader.js +52 -0
- package/dist/botlit/components/RouteLoader.js.map +1 -0
- package/dist/botlit/components/VersionHistoryPanel.js +144 -0
- package/dist/botlit/components/VersionHistoryPanel.js.map +1 -0
- package/dist/botlit/components/WorkspaceRequired.js +70 -0
- package/dist/botlit/components/WorkspaceRequired.js.map +1 -0
- package/dist/botlit/hooks/index.js +16 -0
- package/dist/botlit/hooks/internal/mutationInput.js +16 -0
- package/dist/botlit/hooks/internal/mutationInput.js.map +1 -0
- package/dist/botlit/hooks/internal/workspaceGateway.js +99 -0
- package/dist/botlit/hooks/internal/workspaceGateway.js.map +1 -0
- package/dist/botlit/hooks/useA2A.js +184 -0
- package/dist/botlit/hooks/useA2A.js.map +1 -0
- package/dist/botlit/hooks/useAgents.js +469 -0
- package/dist/botlit/hooks/useAgents.js.map +1 -0
- package/dist/botlit/hooks/useBots.js +306 -0
- package/dist/botlit/hooks/useBots.js.map +1 -0
- package/dist/botlit/hooks/useBuckets.js +119 -0
- package/dist/botlit/hooks/useBuckets.js.map +1 -0
- package/dist/botlit/hooks/useChannels.js +213 -0
- package/dist/botlit/hooks/useChannels.js.map +1 -0
- package/dist/botlit/hooks/useConversations.js +64 -0
- package/dist/botlit/hooks/useConversations.js.map +1 -0
- package/dist/botlit/hooks/useExecutions.js +86 -0
- package/dist/botlit/hooks/useExecutions.js.map +1 -0
- package/dist/botlit/hooks/useKnowledgeBases.js +113 -0
- package/dist/botlit/hooks/useKnowledgeBases.js.map +1 -0
- package/dist/botlit/hooks/useLLMProviders.js +83 -0
- package/dist/botlit/hooks/useLLMProviders.js.map +1 -0
- package/dist/botlit/hooks/useMCPServers.js +134 -0
- package/dist/botlit/hooks/useMCPServers.js.map +1 -0
- package/dist/botlit/hooks/usePolicies.js +120 -0
- package/dist/botlit/hooks/usePolicies.js.map +1 -0
- package/dist/botlit/hooks/usePromptTemplates.js +161 -0
- package/dist/botlit/hooks/usePromptTemplates.js.map +1 -0
- package/dist/botlit/hooks/useRetrievalProfiles.js +146 -0
- package/dist/botlit/hooks/useRetrievalProfiles.js.map +1 -0
- package/dist/botlit/hooks/useSkills.js +132 -0
- package/dist/botlit/hooks/useSkills.js.map +1 -0
- package/dist/botlit/hooks/useStore.js +167 -0
- package/dist/botlit/hooks/useStore.js.map +1 -0
- package/dist/botlit/hooks/useUserPlatformConnection.js +172 -0
- package/dist/botlit/hooks/useUserPlatformConnection.js.map +1 -0
- package/dist/botlit/index.js +11 -0
- package/dist/botlit/pages/A2AAgentDetailPage.js +589 -0
- package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -0
- package/dist/botlit/pages/A2ARegistryPage.js +240 -0
- package/dist/botlit/pages/A2ARegistryPage.js.map +1 -0
- package/dist/botlit/pages/AgentBuilderPage.js +486 -0
- package/dist/botlit/pages/AgentBuilderPage.js.map +1 -0
- package/dist/botlit/pages/AgentDetailPage.js +517 -0
- package/dist/botlit/pages/AgentDetailPage.js.map +1 -0
- package/dist/botlit/pages/AgentsListPage.js +294 -0
- package/dist/botlit/pages/AgentsListPage.js.map +1 -0
- package/dist/botlit/pages/BotChannelsTab.js +530 -0
- package/dist/botlit/pages/BotChannelsTab.js.map +1 -0
- package/dist/botlit/pages/BotDetailPage.js +872 -0
- package/dist/botlit/pages/BotDetailPage.js.map +1 -0
- package/dist/botlit/pages/BotWorkflowTab.js +229 -0
- package/dist/botlit/pages/BotWorkflowTab.js.map +1 -0
- package/dist/botlit/pages/BotsListPage.js +313 -0
- package/dist/botlit/pages/BotsListPage.js.map +1 -0
- package/dist/botlit/pages/BucketsPage.js +604 -0
- package/dist/botlit/pages/BucketsPage.js.map +1 -0
- package/dist/botlit/pages/ChannelDetailPage.js +955 -0
- package/dist/botlit/pages/ChannelDetailPage.js.map +1 -0
- package/dist/botlit/pages/ChannelRoutesPage.js +218 -0
- package/dist/botlit/pages/ChannelRoutesPage.js.map +1 -0
- package/dist/botlit/pages/ChannelsPage.js +304 -0
- package/dist/botlit/pages/ChannelsPage.js.map +1 -0
- package/dist/botlit/pages/ChatPage.js +247 -0
- package/dist/botlit/pages/ChatPage.js.map +1 -0
- package/dist/botlit/pages/DashboardPage.js +318 -0
- package/dist/botlit/pages/DashboardPage.js.map +1 -0
- package/dist/botlit/pages/ExecutionDetailPage.js +313 -0
- package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -0
- package/dist/botlit/pages/ExecutionsPage.js +294 -0
- package/dist/botlit/pages/ExecutionsPage.js.map +1 -0
- package/dist/botlit/pages/InstalledPackagesPage.js +619 -0
- package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -0
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js +473 -0
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -0
- package/dist/botlit/pages/KnowledgeBasesPage.js +150 -0
- package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -0
- package/dist/botlit/pages/MCPServerDetailPage.js +550 -0
- package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -0
- package/dist/botlit/pages/MCPServersPage.js +321 -0
- package/dist/botlit/pages/MCPServersPage.js.map +1 -0
- package/dist/botlit/pages/PoliciesPage.js +224 -0
- package/dist/botlit/pages/PoliciesPage.js.map +1 -0
- package/dist/botlit/pages/PolicyDetailPage.js +861 -0
- package/dist/botlit/pages/PolicyDetailPage.js.map +1 -0
- package/dist/botlit/pages/PromptStudioPage.js +236 -0
- package/dist/botlit/pages/PromptStudioPage.js.map +1 -0
- package/dist/botlit/pages/PromptTemplateDetailPage.js +812 -0
- package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -0
- package/dist/botlit/pages/PromptTemplatesPage.js +269 -0
- package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -0
- package/dist/botlit/pages/RetrievalProfileDetailPage.js +559 -0
- package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -0
- package/dist/botlit/pages/RetrievalProfilesPage.js +219 -0
- package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -0
- package/dist/botlit/pages/SettingsPage.js +655 -0
- package/dist/botlit/pages/SettingsPage.js.map +1 -0
- package/dist/botlit/pages/SkillDetailPage.js +778 -0
- package/dist/botlit/pages/SkillDetailPage.js.map +1 -0
- package/dist/botlit/pages/SkillsPage.js +206 -0
- package/dist/botlit/pages/SkillsPage.js.map +1 -0
- package/dist/botlit/pages/StorePackageDetailPage.js +462 -0
- package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -0
- package/dist/botlit/pages/StorePage.js +315 -0
- package/dist/botlit/pages/StorePage.js.map +1 -0
- package/dist/botlit/providers/BotlitProvider.js +93 -0
- package/dist/botlit/providers/BotlitProvider.js.map +1 -0
- package/dist/botlit/store/botlitStore.js +101 -0
- package/dist/botlit/store/botlitStore.js.map +1 -0
- package/dist/botlit/utils/cn.js +10 -0
- package/dist/botlit/utils/cn.js.map +1 -0
- package/dist/botlit/utils/formatters.js +37 -0
- package/dist/botlit/utils/formatters.js.map +1 -0
- package/dist/botlit/utils/navigation.js +9 -0
- package/dist/botlit/utils/navigation.js.map +1 -0
- package/dist/botlit/utils/unions.js +14 -0
- package/dist/botlit/utils/unions.js.map +1 -0
- package/dist/generated/global-operations.js +66 -0
- package/dist/generated/global-operations.js.map +1 -0
- package/dist/generated/global-types.js +8 -0
- package/dist/generated/global-types.js.map +1 -0
- package/dist/generated/wspace-operations.js +1591 -0
- package/dist/generated/wspace-operations.js.map +1 -0
- package/dist/generated/wspace-types.js +12 -0
- package/dist/generated/wspace-types.js.map +1 -0
- package/dist/index.js +13 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/package.json +133 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/botlit/components/Button.tsx
|
|
4
|
+
var r = {
|
|
5
|
+
default: "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90",
|
|
6
|
+
primary: "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90",
|
|
7
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
8
|
+
outline: "border border-border-default bg-bg-surface hover:bg-accent hover:text-text-primary",
|
|
9
|
+
ghost: "hover:bg-accent hover:text-text-primary",
|
|
10
|
+
destructive: "bg-status-error-bg text-status-error-text hover:bg-status-error-bg/90"
|
|
11
|
+
}, i = {
|
|
12
|
+
sm: "h-8 px-3 text-xs",
|
|
13
|
+
md: "h-10 px-4 text-sm",
|
|
14
|
+
lg: "h-12 px-6 text-base",
|
|
15
|
+
icon: "h-10 w-10"
|
|
16
|
+
}, a = ({ className: a, variant: o = "default", size: s = "md", isLoading: c, leftIcon: l, rightIcon: u, disabled: d, children: f, ...p }) => /* @__PURE__ */ n("button", {
|
|
17
|
+
className: e("inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50", r[o], i[s], a),
|
|
18
|
+
disabled: d || c,
|
|
19
|
+
...p,
|
|
20
|
+
children: [
|
|
21
|
+
c ? /* @__PURE__ */ n("svg", {
|
|
22
|
+
className: "h-4 w-4 animate-spin",
|
|
23
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
+
fill: "none",
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
children: [/* @__PURE__ */ t("circle", {
|
|
27
|
+
className: "opacity-25",
|
|
28
|
+
cx: "12",
|
|
29
|
+
cy: "12",
|
|
30
|
+
r: "10",
|
|
31
|
+
stroke: "currentColor",
|
|
32
|
+
strokeWidth: "4"
|
|
33
|
+
}), /* @__PURE__ */ t("path", {
|
|
34
|
+
className: "opacity-75",
|
|
35
|
+
fill: "currentColor",
|
|
36
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
37
|
+
})]
|
|
38
|
+
}) : l,
|
|
39
|
+
f,
|
|
40
|
+
u
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
//#endregion
|
|
44
|
+
export { a as Button };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","names":[],"sources":["../../../src/botlit/components/Button.tsx"],"sourcesContent":["/**\n * Button Component\n * @module botlit/components\n */\n\nimport type { FC, ButtonHTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: 'default' | 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';\n size?: 'sm' | 'md' | 'lg' | 'icon';\n isLoading?: boolean;\n leftIcon?: ReactNode;\n rightIcon?: ReactNode;\n}\n\nconst variantStyles = {\n default: 'bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90',\n primary: 'bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n outline: 'border border-border-default bg-bg-surface hover:bg-accent hover:text-text-primary',\n ghost: 'hover:bg-accent hover:text-text-primary',\n destructive: 'bg-status-error-bg text-status-error-text hover:bg-status-error-bg/90',\n};\n\nconst sizeStyles = {\n sm: 'h-8 px-3 text-xs',\n md: 'h-10 px-4 text-sm',\n lg: 'h-12 px-6 text-base',\n icon: 'h-10 w-10',\n};\n\nexport const Button: FC<ButtonProps> = ({\n className,\n variant = 'default',\n size = 'md',\n isLoading,\n leftIcon,\n rightIcon,\n disabled,\n children,\n ...props\n}) => {\n return (\n <button\n className={cn(\n 'inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2',\n 'disabled:pointer-events-none disabled:opacity-50',\n variantStyles[variant],\n sizeStyles[size],\n className\n )}\n disabled={disabled || isLoading}\n {...props}\n >\n {isLoading ? (\n <svg\n className=\"h-4 w-4 animate-spin\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n ) : (\n leftIcon\n )}\n {children}\n {rightIcon}\n </button>\n );\n};\n"],"mappings":";;;AAgBA,IAAM,IAAgB;CACpB,SAAS;CACT,SAAS;CACT,WAAW;CACX,SAAS;CACT,OAAO;CACP,aAAa;CACd,EAEK,IAAa;CACjB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACP,EAEY,KAA2B,EACtC,cACA,aAAU,WACV,UAAO,MACP,cACA,aACA,cACA,aACA,aACA,GAAG,QAGD,kBAAC,UAAD;CACE,WAAW,EACT,0FACA,4HACA,oDACA,EAAc,IACd,EAAW,IACX,EACD;CACD,UAAU,KAAY;CACtB,GAAI;WAVN;EAYG,IACC,kBAAC,OAAD;GACE,WAAU;GACV,OAAM;GACN,MAAK;GACL,SAAQ;aAJV,CAME,kBAAC,UAAD;IACE,WAAU;IACV,IAAG;IACH,IAAG;IACH,GAAE;IACF,QAAO;IACP,aAAY;IACZ,CAAA,EACF,kBAAC,QAAD;IACE,WAAU;IACV,MAAK;IACL,GAAE;IACF,CAAA,CACE;OAEN;EAED;EACA;EACM"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { GlassCard as t } from "@burdenoff/fe-libs/ui";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/botlit/components/Card.tsx
|
|
5
|
+
var r = ({ className: r, children: i, treatment: a = "plain", glow: o = !1, ...s }) => /* @__PURE__ */ n(t, {
|
|
6
|
+
treatment: a,
|
|
7
|
+
glow: o,
|
|
8
|
+
className: e("rounded-card", r),
|
|
9
|
+
...s,
|
|
10
|
+
children: i
|
|
11
|
+
}), i = ({ className: t, children: r, ...i }) => /* @__PURE__ */ n("div", {
|
|
12
|
+
className: e("flex flex-col space-y-1.5 p-6", t),
|
|
13
|
+
...i,
|
|
14
|
+
children: r
|
|
15
|
+
}), a = ({ className: t, children: r, ...i }) => /* @__PURE__ */ n("h3", {
|
|
16
|
+
className: e("text-lg font-semibold leading-none tracking-tight", t),
|
|
17
|
+
...i,
|
|
18
|
+
children: r
|
|
19
|
+
}), o = ({ className: t, children: r, ...i }) => /* @__PURE__ */ n("p", {
|
|
20
|
+
className: e("text-sm text-text-secondary", t),
|
|
21
|
+
...i,
|
|
22
|
+
children: r
|
|
23
|
+
}), s = ({ className: t, children: r, ...i }) => /* @__PURE__ */ n("div", {
|
|
24
|
+
className: e("p-6 pt-0", t),
|
|
25
|
+
...i,
|
|
26
|
+
children: r
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { r as Card, s as CardContent, o as CardDescription, i as CardHeader, a as CardTitle };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","names":[],"sources":["../../../src/botlit/components/Card.tsx"],"sourcesContent":["/**\n * Card Components\n * @module botlit/components\n *\n * Boff UI 2.0: the base Card now renders on the fe-libs `GlassCard` glass\n * language (seam border + soft pop shadow + no-movement hover). The original\n * API (className passthrough, sub-parts) is preserved 1:1; a new optional\n * `treatment`/`glow` prop opts a surface into the richer glass/metric/insight\n * treatments. Hover NEVER translates or scales — it only intensifies the\n * shadow/border per the no-movement policy.\n */\n\nimport type { FC, ReactNode, HTMLAttributes } from 'react';\nimport { GlassCard, type GlassCardProps } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface CardProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** Boff UI 2.0 glass treatment. Defaults to `plain`. */\n treatment?: GlassCardProps['treatment'];\n /** Featured/active accent glow (no movement). */\n glow?: boolean;\n}\n\nexport const Card: FC<CardProps> = ({\n className,\n children,\n treatment = 'plain',\n glow = false,\n ...props\n}) => {\n return (\n <GlassCard\n treatment={treatment}\n glow={glow}\n className={cn('rounded-card', className)}\n {...props}\n >\n {children}\n </GlassCard>\n );\n};\n\nexport const CardHeader: FC<HTMLAttributes<HTMLDivElement>> = ({\n className,\n children,\n ...props\n}) => {\n return (\n <div className={cn('flex flex-col space-y-1.5 p-6', className)} {...props}>\n {children}\n </div>\n );\n};\n\nexport const CardTitle: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n children,\n ...props\n}) => {\n return (\n <h3 className={cn('text-lg font-semibold leading-none tracking-tight', className)} {...props}>\n {children}\n </h3>\n );\n};\n\nexport const CardDescription: FC<HTMLAttributes<HTMLParagraphElement>> = ({\n className,\n children,\n ...props\n}) => {\n return (\n <p className={cn('text-sm text-text-secondary', className)} {...props}>\n {children}\n </p>\n );\n};\n\nexport const CardContent: FC<HTMLAttributes<HTMLDivElement>> = ({\n className,\n children,\n ...props\n}) => {\n return (\n <div className={cn('p-6 pt-0', className)} {...props}>\n {children}\n </div>\n );\n};\n\nexport const CardFooter: FC<HTMLAttributes<HTMLDivElement>> = ({\n className,\n children,\n ...props\n}) => {\n return (\n <div className={cn('flex items-center p-6 pt-0', className)} {...props}>\n {children}\n </div>\n );\n};\n"],"mappings":";;;;AAwBA,IAAa,KAAuB,EAClC,cACA,aACA,eAAY,SACZ,UAAO,IACP,GAAG,QAGD,kBAAC,GAAD;CACa;CACL;CACN,WAAW,EAAG,gBAAgB,EAAU;CACxC,GAAI;CAEH;CACS,CAAA,EAIH,KAAkD,EAC7D,cACA,aACA,GAAG,QAGD,kBAAC,OAAD;CAAK,WAAW,EAAG,iCAAiC,EAAU;CAAE,GAAI;CACjE;CACG,CAAA,EAIG,KAAqD,EAChE,cACA,aACA,GAAG,QAGD,kBAAC,MAAD;CAAI,WAAW,EAAG,qDAAqD,EAAU;CAAE,GAAI;CACpF;CACE,CAAA,EAII,KAA6D,EACxE,cACA,aACA,GAAG,QAGD,kBAAC,KAAD;CAAG,WAAW,EAAG,+BAA+B,EAAU;CAAE,GAAI;CAC7D;CACC,CAAA,EAIK,KAAmD,EAC9D,cACA,aACA,GAAG,QAGD,kBAAC,OAAD;CAAK,WAAW,EAAG,YAAY,EAAU;CAAE,GAAI;CAC5C;CACG,CAAA"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { Button as e } from "./Button.js";
|
|
2
|
+
import { Badge as t } from "./Badge.js";
|
|
3
|
+
import { useEffect as n } from "react";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { X as o } from "lucide-react";
|
|
6
|
+
//#region src/botlit/components/ChannelSelectorSheet.tsx
|
|
7
|
+
var s = ({ open: s, onClose: c, onSelectChannel: l, availableChannels: u, platformIcons: d, platformMeta: f }) => (n(() => (s ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
8
|
+
document.body.style.overflow = "";
|
|
9
|
+
}), [s]), n(() => {
|
|
10
|
+
let e = (e) => {
|
|
11
|
+
e.key === "Escape" && s && c();
|
|
12
|
+
};
|
|
13
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
14
|
+
}, [s, c]), s ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("div", {
|
|
15
|
+
className: "fixed inset-0 bg-black/50 z-40 transition-opacity duration-300",
|
|
16
|
+
onClick: c,
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
}), /* @__PURE__ */ a("div", {
|
|
19
|
+
className: "fixed inset-y-0 right-0 z-50 w-full sm:max-w-md bg-bg-surface shadow-xl transform transition-transform duration-300 ease-out flex flex-col",
|
|
20
|
+
role: "dialog",
|
|
21
|
+
"aria-modal": "true",
|
|
22
|
+
"aria-labelledby": "channel-selector-title",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ a("div", {
|
|
25
|
+
className: "flex items-center justify-between px-6 py-4 border-b border-border-subtle shrink-0",
|
|
26
|
+
children: [/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("h2", {
|
|
27
|
+
id: "channel-selector-title",
|
|
28
|
+
className: "text-lg font-semibold",
|
|
29
|
+
children: "Select a Channel"
|
|
30
|
+
}), /* @__PURE__ */ i("p", {
|
|
31
|
+
className: "text-sm text-text-secondary mt-0.5",
|
|
32
|
+
children: "Choose a platform to connect to your bot"
|
|
33
|
+
})] }), /* @__PURE__ */ i(e, {
|
|
34
|
+
variant: "ghost",
|
|
35
|
+
size: "icon",
|
|
36
|
+
onClick: c,
|
|
37
|
+
className: "shrink-0",
|
|
38
|
+
"aria-label": "Close",
|
|
39
|
+
children: /* @__PURE__ */ i(o, { size: 18 })
|
|
40
|
+
})]
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ i("div", {
|
|
43
|
+
className: "flex-1 overflow-y-auto px-6 py-4",
|
|
44
|
+
children: u.length === 0 ? /* @__PURE__ */ a("div", {
|
|
45
|
+
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
46
|
+
children: [/* @__PURE__ */ i("p", {
|
|
47
|
+
className: "text-sm text-text-secondary",
|
|
48
|
+
children: "No channels available to configure."
|
|
49
|
+
}), /* @__PURE__ */ i("p", {
|
|
50
|
+
className: "text-xs text-text-secondary mt-2",
|
|
51
|
+
children: "All available channels have already been connected to this bot."
|
|
52
|
+
})]
|
|
53
|
+
}) : /* @__PURE__ */ i("div", {
|
|
54
|
+
className: "space-y-3",
|
|
55
|
+
children: u.map((e) => {
|
|
56
|
+
let n = e.platform, r = f[n] || {
|
|
57
|
+
label: n,
|
|
58
|
+
badgeClass: "bg-gray-100 text-gray-700",
|
|
59
|
+
accentBg: "bg-gray-500/10",
|
|
60
|
+
accentText: "text-gray-600"
|
|
61
|
+
}, o = d[n];
|
|
62
|
+
return /* @__PURE__ */ i("button", {
|
|
63
|
+
onClick: () => {
|
|
64
|
+
l(e.id, n), c();
|
|
65
|
+
},
|
|
66
|
+
className: "w-full text-left p-4 rounded-lg border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:ring-offset-2",
|
|
67
|
+
children: /* @__PURE__ */ a("div", {
|
|
68
|
+
className: "flex items-start gap-3",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ i("div", {
|
|
71
|
+
className: `p-2 rounded-md ${r.accentBg} shrink-0`,
|
|
72
|
+
children: /* @__PURE__ */ i("span", {
|
|
73
|
+
className: r.accentText,
|
|
74
|
+
children: o
|
|
75
|
+
})
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ a("div", {
|
|
78
|
+
className: "flex-1 min-w-0",
|
|
79
|
+
children: [/* @__PURE__ */ a("div", {
|
|
80
|
+
className: "flex items-center gap-2 mb-1",
|
|
81
|
+
children: [/* @__PURE__ */ i("h3", {
|
|
82
|
+
className: "font-medium text-sm",
|
|
83
|
+
children: e.name
|
|
84
|
+
}), /* @__PURE__ */ i(t, {
|
|
85
|
+
className: `text-xs ${r.badgeClass}`,
|
|
86
|
+
children: r.label
|
|
87
|
+
})]
|
|
88
|
+
}), e.description && /* @__PURE__ */ i("p", {
|
|
89
|
+
className: "text-xs text-text-secondary line-clamp-2",
|
|
90
|
+
children: e.description
|
|
91
|
+
})]
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ i("div", {
|
|
94
|
+
className: "shrink-0 self-center text-text-secondary",
|
|
95
|
+
children: /* @__PURE__ */ i("svg", {
|
|
96
|
+
width: "16",
|
|
97
|
+
height: "16",
|
|
98
|
+
viewBox: "0 0 16 16",
|
|
99
|
+
fill: "none",
|
|
100
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
101
|
+
children: /* @__PURE__ */ i("path", {
|
|
102
|
+
d: "M6 12L10 8L6 4",
|
|
103
|
+
stroke: "currentColor",
|
|
104
|
+
strokeWidth: "2",
|
|
105
|
+
strokeLinecap: "round",
|
|
106
|
+
strokeLinejoin: "round"
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
})
|
|
112
|
+
}, e.id);
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ i("div", {
|
|
117
|
+
className: "px-6 py-4 border-t border-border-subtle shrink-0",
|
|
118
|
+
children: /* @__PURE__ */ i(e, {
|
|
119
|
+
variant: "outline",
|
|
120
|
+
onClick: c,
|
|
121
|
+
className: "w-full",
|
|
122
|
+
children: "Cancel"
|
|
123
|
+
})
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
})] }) : null);
|
|
127
|
+
//#endregion
|
|
128
|
+
export { s as ChannelSelectorSheet };
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=ChannelSelectorSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelSelectorSheet.js","names":[],"sources":["../../../src/botlit/components/ChannelSelectorSheet.tsx"],"sourcesContent":["/**\n * ChannelSelectorSheet\n * @module botlit/components\n *\n * A slide-in sheet component that displays available communication channels\n * for selection when setting up bot integrations.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { useEffect } from 'react';\nimport { X } from 'lucide-react';\nimport { Button } from './Button';\nimport { Badge } from './Badge';\nimport type { GlobalChannelData } from '../hooks/useUserPlatformConnection';\n\ninterface ChannelSelectorSheetProps {\n /** Controls visibility of the sheet */\n open: boolean;\n /** Callback when sheet is closed */\n onClose: () => void;\n /** Callback when a channel is selected */\n onSelectChannel: (channelId: string, platform: string) => void;\n /** Available channels to display (already filtered by backend) */\n availableChannels: GlobalChannelData[];\n /** Platform icons mapping */\n platformIcons: Record<string, ReactNode>;\n /** Platform metadata mapping */\n platformMeta: Record<\n string,\n { label: string; badgeClass: string; accentBg: string; accentText: string }\n >;\n}\n\nexport const ChannelSelectorSheet: FC<ChannelSelectorSheetProps> = ({\n open,\n onClose,\n onSelectChannel,\n availableChannels,\n platformIcons,\n platformMeta,\n}) => {\n // Lock body scroll when sheet is open\n useEffect(() => {\n if (open) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = '';\n }\n return () => {\n document.body.style.overflow = '';\n };\n }, [open]);\n\n // Close on Escape key\n useEffect(() => {\n const handleEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && open) {\n onClose();\n }\n };\n window.addEventListener('keydown', handleEscape);\n return () => window.removeEventListener('keydown', handleEscape);\n }, [open, onClose]);\n\n if (!open) return null;\n\n return (\n <>\n {/* Backdrop */}\n <div\n className=\"fixed inset-0 bg-black/50 z-40 transition-opacity duration-300\"\n onClick={onClose}\n aria-hidden=\"true\"\n />\n\n {/* Sheet */}\n <div\n className=\"fixed inset-y-0 right-0 z-50 w-full sm:max-w-md bg-bg-surface shadow-xl transform transition-transform duration-300 ease-out flex flex-col\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"channel-selector-title\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between px-6 py-4 border-b border-border-subtle shrink-0\">\n <div>\n <h2 id=\"channel-selector-title\" className=\"text-lg font-semibold\">\n Select a Channel\n </h2>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n Choose a platform to connect to your bot\n </p>\n </div>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={onClose}\n className=\"shrink-0\"\n aria-label=\"Close\"\n >\n <X size={18} />\n </Button>\n </div>\n\n {/* Content */}\n <div className=\"flex-1 overflow-y-auto px-6 py-4\">\n {availableChannels.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-12 text-center\">\n <p className=\"text-sm text-text-secondary\">No channels available to configure.</p>\n <p className=\"text-xs text-text-secondary mt-2\">\n All available channels have already been connected to this bot.\n </p>\n </div>\n ) : (\n <div className=\"space-y-3\">\n {availableChannels.map((channel) => {\n const platform = channel.platform as string;\n const meta = platformMeta[platform] || {\n label: platform,\n badgeClass: 'bg-gray-100 text-gray-700',\n accentBg: 'bg-gray-500/10',\n accentText: 'text-gray-600',\n };\n const icon = platformIcons[platform];\n\n return (\n <button\n key={channel.id}\n onClick={() => {\n onSelectChannel(channel.id, platform);\n onClose();\n }}\n className=\"w-full text-left p-4 rounded-lg border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:ring-offset-2\"\n >\n <div className=\"flex items-start gap-3\">\n {/* Icon */}\n <div className={`p-2 rounded-md ${meta.accentBg} shrink-0`}>\n <span className={meta.accentText}>{icon}</span>\n </div>\n\n {/* Content */}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-1\">\n <h3 className=\"font-medium text-sm\">{channel.name}</h3>\n <Badge className={`text-xs ${meta.badgeClass}`}>{meta.label}</Badge>\n </div>\n {channel.description && (\n <p className=\"text-xs text-text-secondary line-clamp-2\">\n {channel.description}\n </p>\n )}\n </div>\n\n {/* Arrow indicator */}\n <div className=\"shrink-0 self-center text-text-secondary\">\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M6 12L10 8L6 4\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n </button>\n );\n })}\n </div>\n )}\n </div>\n\n {/* Footer */}\n <div className=\"px-6 py-4 border-t border-border-subtle shrink-0\">\n <Button variant=\"outline\" onClick={onClose} className=\"w-full\">\n Cancel\n </Button>\n </div>\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;AAiCA,IAAa,KAAuD,EAClE,SACA,YACA,oBACA,sBACA,kBACA,uBAGA,SACM,IACF,SAAS,KAAK,MAAM,WAAW,WAE/B,SAAS,KAAK,MAAM,WAAW,UAEpB;AACX,UAAS,KAAK,MAAM,WAAW;IAEhC,CAAC,EAAK,CAAC,EAGV,QAAgB;CACd,IAAM,KAAgB,MAAqB;AACzC,EAAI,EAAE,QAAQ,YAAY,KACxB,GAAS;;AAIb,QADA,OAAO,iBAAiB,WAAW,EAAa,QACnC,OAAO,oBAAoB,WAAW,EAAa;GAC/D,CAAC,GAAM,EAAQ,CAAC,EAEd,IAGH,kBAAA,GAAA,EAAA,UAAA,CAEE,kBAAC,OAAD;CACE,WAAU;CACV,SAAS;CACT,eAAY;CACZ,CAAA,EAGF,kBAAC,OAAD;CACE,WAAU;CACV,MAAK;CACL,cAAW;CACX,mBAAgB;WAJlB;EAOE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;IAAI,IAAG;IAAyB,WAAU;cAAwB;IAE7D,CAAA,EACL,kBAAC,KAAD;IAAG,WAAU;cAAqC;IAE9C,CAAA,CACA,EAAA,CAAA,EACN,kBAAC,GAAD;IACE,SAAQ;IACR,MAAK;IACL,SAAS;IACT,WAAU;IACV,cAAW;cAEX,kBAAC,GAAD,EAAG,MAAM,IAAM,CAAA;IACR,CAAA,CACL;;EAGN,kBAAC,OAAD;GAAK,WAAU;aACZ,EAAkB,WAAW,IAC5B,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,KAAD;KAAG,WAAU;eAA8B;KAAuC,CAAA,EAClF,kBAAC,KAAD;KAAG,WAAU;eAAmC;KAE5C,CAAA,CACA;QAEN,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAkB,KAAK,MAAY;KAClC,IAAM,IAAW,EAAQ,UACnB,IAAO,EAAa,MAAa;MACrC,OAAO;MACP,YAAY;MACZ,UAAU;MACV,YAAY;MACb,EACK,IAAO,EAAc;AAE3B,YACE,kBAAC,UAAD;MAEE,eAAe;AAEb,OADA,EAAgB,EAAQ,IAAI,EAAS,EACrC,GAAS;;MAEX,WAAU;gBAEV,kBAAC,OAAD;OAAK,WAAU;iBAAf;QAEE,kBAAC,OAAD;SAAK,WAAW,kBAAkB,EAAK,SAAS;mBAC9C,kBAAC,QAAD;UAAM,WAAW,EAAK;oBAAa;UAAY,CAAA;SAC3C,CAAA;QAGN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,OAAD;UAAK,WAAU;oBAAf,CACE,kBAAC,MAAD;WAAI,WAAU;qBAAuB,EAAQ;WAAU,CAAA,EACvD,kBAAC,GAAD;WAAO,WAAW,WAAW,EAAK;qBAAe,EAAK;WAAc,CAAA,CAChE;aACL,EAAQ,eACP,kBAAC,KAAD;UAAG,WAAU;oBACV,EAAQ;UACP,CAAA,CAEF;;QAGN,kBAAC,OAAD;SAAK,WAAU;mBACb,kBAAC,OAAD;UACE,OAAM;UACN,QAAO;UACP,SAAQ;UACR,MAAK;UACL,OAAM;oBAEN,kBAAC,QAAD;WACE,GAAE;WACF,QAAO;WACP,aAAY;WACZ,eAAc;WACd,gBAAe;WACf,CAAA;UACE,CAAA;SACF,CAAA;QACF;;MACC,EA7CF,EAAQ,GA6CN;MAEX;IACE,CAAA;GAEJ,CAAA;EAGN,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD;IAAQ,SAAQ;IAAU,SAAS;IAAS,WAAU;cAAS;IAEtD,CAAA;GACL,CAAA;EACF;GACL,EAAA,CAAA,GAzHa"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { IllustratedEmptyState as t } from "@burdenoff/fe-libs/ui";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/botlit/components/EmptyState.tsx
|
|
5
|
+
var i = ({ icon: i, illustration: a, title: o, description: s, action: c, className: l }) => a ? /* @__PURE__ */ n(t, {
|
|
6
|
+
illustration: a,
|
|
7
|
+
title: o,
|
|
8
|
+
description: s,
|
|
9
|
+
action: c,
|
|
10
|
+
className: l
|
|
11
|
+
}) : /* @__PURE__ */ r("div", {
|
|
12
|
+
className: e("flex flex-col items-center justify-center py-12 px-4 text-center", l),
|
|
13
|
+
children: [
|
|
14
|
+
i && /* @__PURE__ */ n("div", {
|
|
15
|
+
className: "mb-4 text-text-secondary opacity-50",
|
|
16
|
+
children: i
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ n("h3", {
|
|
19
|
+
className: "text-lg font-medium text-text-primary",
|
|
20
|
+
children: o
|
|
21
|
+
}),
|
|
22
|
+
s && /* @__PURE__ */ n("p", {
|
|
23
|
+
className: "mt-2 text-sm text-text-secondary max-w-sm",
|
|
24
|
+
children: s
|
|
25
|
+
}),
|
|
26
|
+
c && /* @__PURE__ */ n("div", {
|
|
27
|
+
className: "mt-6",
|
|
28
|
+
children: c
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { i as EmptyState };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/botlit/components/EmptyState.tsx"],"sourcesContent":["/**\n * Empty State Component\n * @module botlit/components\n *\n * Boff UI 2.0: when an `illustration` name is supplied, this renders the\n * on-brand fe-libs `IllustratedEmptyState` (host serves /illustrations/<name>.webp).\n * The legacy `icon`-based layout is preserved as a graceful fallback so existing\n * call sites keep working unchanged.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n /** Boff UI 2.0 illustration name → /illustrations/<name>.webp */\n illustration?: string;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}\n\nexport const EmptyState: FC<EmptyStateProps> = ({\n icon,\n illustration,\n title,\n description,\n action,\n className,\n}) => {\n if (illustration) {\n return (\n <IllustratedEmptyState\n illustration={illustration}\n title={title}\n description={description}\n action={action}\n className={className}\n />\n );\n }\n\n return (\n <div\n className={cn('flex flex-col items-center justify-center py-12 px-4 text-center', className)}\n >\n {icon && <div className=\"mb-4 text-text-secondary opacity-50\">{icon}</div>}\n <h3 className=\"text-lg font-medium text-text-primary\">{title}</h3>\n {description && <p className=\"mt-2 text-sm text-text-secondary max-w-sm\">{description}</p>}\n {action && <div className=\"mt-6\">{action}</div>}\n </div>\n );\n};\n"],"mappings":";;;;AAwBA,IAAa,KAAmC,EAC9C,SACA,iBACA,UACA,gBACA,WACA,mBAEI,IAEA,kBAAC,GAAD;CACgB;CACP;CACM;CACL;CACG;CACX,CAAA,GAKJ,kBAAC,OAAD;CACE,WAAW,EAAG,oEAAoE,EAAU;WAD9F;EAGG,KAAQ,kBAAC,OAAD;GAAK,WAAU;aAAuC;GAAW,CAAA;EAC1E,kBAAC,MAAD;GAAI,WAAU;aAAyC;GAAW,CAAA;EACjE,KAAe,kBAAC,KAAD;GAAG,WAAU;aAA6C;GAAgB,CAAA;EACzF,KAAU,kBAAC,OAAD;GAAK,WAAU;aAAQ;GAAa,CAAA;EAC3C"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { Button as t } from "./Button.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { AlertTriangle as i, RefreshCw as a } from "lucide-react";
|
|
5
|
+
//#region src/botlit/components/ErrorState.tsx
|
|
6
|
+
var o = ({ resource: o, error: s, onRetry: c, className: l }) => /* @__PURE__ */ r("div", {
|
|
7
|
+
role: "alert",
|
|
8
|
+
className: e("flex flex-col items-center justify-center gap-3 rounded-lg border border-status-error-border bg-status-error-bg-subtle px-4 py-12 text-center", l),
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ n(i, {
|
|
11
|
+
size: 28,
|
|
12
|
+
className: "text-status-error-text"
|
|
13
|
+
}),
|
|
14
|
+
/* @__PURE__ */ r("div", { children: [/* @__PURE__ */ r("h3", {
|
|
15
|
+
className: "text-lg font-medium text-text-primary",
|
|
16
|
+
children: ["Couldn't load ", o]
|
|
17
|
+
}), /* @__PURE__ */ n("p", {
|
|
18
|
+
className: "mt-2 max-w-md text-sm text-text-secondary",
|
|
19
|
+
children: s?.message ?? "The request to the workspace gateway failed."
|
|
20
|
+
})] }),
|
|
21
|
+
c && /* @__PURE__ */ n(t, {
|
|
22
|
+
variant: "outline",
|
|
23
|
+
size: "sm",
|
|
24
|
+
leftIcon: /* @__PURE__ */ n(a, { size: 14 }),
|
|
25
|
+
onClick: c,
|
|
26
|
+
children: "Try again"
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { o as ErrorState };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=ErrorState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorState.js","names":[],"sources":["../../../src/botlit/components/ErrorState.tsx"],"sourcesContent":["/**\n * Error State Component\n * @module botlit/components\n *\n * Rendered when a gateway request FAILED. This is deliberately distinct from\n * `EmptyState` — \"we asked and there is nothing yet\" and \"we could not ask\"\n * are different situations and must not look the same to the user.\n */\n\nimport type { FC } from 'react';\nimport { AlertTriangle, RefreshCw } from 'lucide-react';\nimport { Button } from './Button';\nimport { cn } from '../utils/cn';\n\ninterface ErrorStateProps {\n /** What failed to load, e.g. \"agents\". Used to build the default title. */\n resource: string;\n error?: Error;\n onRetry?: () => void;\n className?: string;\n}\n\nexport const ErrorState: FC<ErrorStateProps> = ({ resource, error, onRetry, className }) => (\n <div\n role=\"alert\"\n className={cn(\n 'flex flex-col items-center justify-center gap-3 rounded-lg border border-status-error-border bg-status-error-bg-subtle px-4 py-12 text-center',\n className\n )}\n >\n <AlertTriangle size={28} className=\"text-status-error-text\" />\n <div>\n <h3 className=\"text-lg font-medium text-text-primary\">Couldn't load {resource}</h3>\n <p className=\"mt-2 max-w-md text-sm text-text-secondary\">\n {error?.message ?? 'The request to the workspace gateway failed.'}\n </p>\n </div>\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" leftIcon={<RefreshCw size={14} />} onClick={onRetry}>\n Try again\n </Button>\n )}\n </div>\n);\n"],"mappings":";;;;;AAsBA,IAAa,KAAmC,EAAE,aAAU,UAAO,YAAS,mBAC1E,kBAAC,OAAD;CACE,MAAK;CACL,WAAW,EACT,iJACA,EACD;WALH;EAOE,kBAAC,GAAD;GAAe,MAAM;GAAI,WAAU;GAA2B,CAAA;EAC9D,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;GAAI,WAAU;aAAd,CAAsD,kBAAoB,EAAc;MACxF,kBAAC,KAAD;GAAG,WAAU;aACV,GAAO,WAAW;GACjB,CAAA,CACA,EAAA,CAAA;EACL,KACC,kBAAC,GAAD;GAAQ,SAAQ;GAAU,MAAK;GAAK,UAAU,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;GAAE,SAAS;aAAS;GAEhF,CAAA;EAEP"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/botlit/components/Input.tsx
|
|
5
|
+
var i = t(({ className: t, type: i = "text", error: a, ...o }, s) => /* @__PURE__ */ r("div", {
|
|
6
|
+
className: "w-full",
|
|
7
|
+
children: [/* @__PURE__ */ n("input", {
|
|
8
|
+
type: i,
|
|
9
|
+
className: e("flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm", "ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium", "placeholder:text-text-secondary", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-50", a && "border-status-error-border focus-visible:ring-destructive", t),
|
|
10
|
+
ref: s,
|
|
11
|
+
...o
|
|
12
|
+
}), a && /* @__PURE__ */ n("p", {
|
|
13
|
+
className: "mt-1 text-xs text-status-error-text",
|
|
14
|
+
children: a
|
|
15
|
+
})]
|
|
16
|
+
}));
|
|
17
|
+
i.displayName = "Input";
|
|
18
|
+
var a = t(({ className: t, error: i, ...a }, o) => /* @__PURE__ */ r("div", {
|
|
19
|
+
className: "w-full",
|
|
20
|
+
children: [/* @__PURE__ */ n("textarea", {
|
|
21
|
+
className: e("flex min-h-[80px] w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm", "ring-offset-background placeholder:text-text-secondary", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-50", i && "border-status-error-border focus-visible:ring-destructive", t),
|
|
22
|
+
ref: o,
|
|
23
|
+
...a
|
|
24
|
+
}), i && /* @__PURE__ */ n("p", {
|
|
25
|
+
className: "mt-1 text-xs text-status-error-text",
|
|
26
|
+
children: i
|
|
27
|
+
})]
|
|
28
|
+
}));
|
|
29
|
+
a.displayName = "Textarea";
|
|
30
|
+
var o = ({ children: t, htmlFor: i, required: a, className: o }) => /* @__PURE__ */ r("label", {
|
|
31
|
+
htmlFor: i,
|
|
32
|
+
className: e("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", o),
|
|
33
|
+
children: [t, a && /* @__PURE__ */ n("span", {
|
|
34
|
+
className: "text-status-error-text ml-1",
|
|
35
|
+
children: "*"
|
|
36
|
+
})]
|
|
37
|
+
}), s = ({ label: t, htmlFor: i, required: a, error: s, description: c, children: l, className: u }) => /* @__PURE__ */ r("div", {
|
|
38
|
+
className: e("space-y-2", u),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ n(o, {
|
|
41
|
+
htmlFor: i,
|
|
42
|
+
required: a,
|
|
43
|
+
children: t
|
|
44
|
+
}),
|
|
45
|
+
l,
|
|
46
|
+
c && !s && /* @__PURE__ */ n("p", {
|
|
47
|
+
className: "text-xs text-text-secondary",
|
|
48
|
+
children: c
|
|
49
|
+
}),
|
|
50
|
+
s && /* @__PURE__ */ n("p", {
|
|
51
|
+
className: "text-xs text-status-error-text",
|
|
52
|
+
children: s
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
//#endregion
|
|
57
|
+
export { s as FormField, i as Input, a as Textarea };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.js","names":[],"sources":["../../../src/botlit/components/Input.tsx"],"sourcesContent":["/**\n * Input Components\n * @module botlit/components\n */\n\nimport type { FC, InputHTMLAttributes, TextareaHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n error?: string;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, type = 'text', error, ...props }, ref) => {\n return (\n <div className=\"w-full\">\n <input\n type={type}\n className={cn(\n 'flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm',\n 'ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium',\n 'placeholder:text-text-secondary',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n error && 'border-status-error-border focus-visible:ring-destructive',\n className\n )}\n ref={ref}\n {...props}\n />\n {error && <p className=\"mt-1 text-xs text-status-error-text\">{error}</p>}\n </div>\n );\n }\n);\n\nInput.displayName = 'Input';\n\ninterface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n error?: string;\n}\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, error, ...props }, ref) => {\n return (\n <div className=\"w-full\">\n <textarea\n className={cn(\n 'flex min-h-[80px] w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm',\n 'ring-offset-background placeholder:text-text-secondary',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n error && 'border-status-error-border focus-visible:ring-destructive',\n className\n )}\n ref={ref}\n {...props}\n />\n {error && <p className=\"mt-1 text-xs text-status-error-text\">{error}</p>}\n </div>\n );\n }\n);\n\nTextarea.displayName = 'Textarea';\n\ninterface LabelProps {\n children: React.ReactNode;\n htmlFor?: string;\n required?: boolean;\n className?: string;\n}\n\nexport const Label: FC<LabelProps> = ({ children, htmlFor, required, className }) => {\n return (\n <label\n htmlFor={htmlFor}\n className={cn(\n 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n >\n {children}\n {required && <span className=\"text-status-error-text ml-1\">*</span>}\n </label>\n );\n};\n\ninterface FormFieldProps {\n label: string;\n htmlFor?: string;\n required?: boolean;\n error?: string;\n description?: string;\n children: React.ReactNode;\n className?: string;\n}\n\nexport const FormField: FC<FormFieldProps> = ({\n label,\n htmlFor,\n required,\n error,\n description,\n children,\n className,\n}) => {\n return (\n <div className={cn('space-y-2', className)}>\n <Label htmlFor={htmlFor} required={required}>\n {label}\n </Label>\n {children}\n {description && !error && <p className=\"text-xs text-text-secondary\">{description}</p>}\n {error && <p className=\"text-xs text-status-error-text\">{error}</p>}\n </div>\n );\n};\n"],"mappings":";;;;AAaA,IAAa,IAAQ,GAClB,EAAE,cAAW,UAAO,QAAQ,UAAO,GAAG,KAAS,MAE5C,kBAAC,OAAD;CAAK,WAAU;WAAf,CACE,kBAAC,SAAD;EACQ;EACN,WAAW,EACT,4FACA,0FACA,mCACA,4HACA,mDACA,KAAS,6DACT,EACD;EACI;EACL,GAAI;EACJ,CAAA,EACD,KAAS,kBAAC,KAAD;EAAG,WAAU;YAAuC;EAAU,CAAA,CACpE;GAGX;AAED,EAAM,cAAc;AAMpB,IAAa,IAAW,GACrB,EAAE,cAAW,UAAO,GAAG,KAAS,MAE7B,kBAAC,OAAD;CAAK,WAAU;WAAf,CACE,kBAAC,YAAD;EACE,WAAW,EACT,oGACA,0DACA,4HACA,mDACA,KAAS,6DACT,EACD;EACI;EACL,GAAI;EACJ,CAAA,EACD,KAAS,kBAAC,KAAD;EAAG,WAAU;YAAuC;EAAU,CAAA,CACpE;GAGX;AAED,EAAS,cAAc;AASvB,IAAa,KAAyB,EAAE,aAAU,YAAS,aAAU,mBAEjE,kBAAC,SAAD;CACW;CACT,WAAW,EACT,8FACA,EACD;WALH,CAOG,GACA,KAAY,kBAAC,QAAD;EAAM,WAAU;YAA8B;EAAQ,CAAA,CAC7D;IAcC,KAAiC,EAC5C,UACA,YACA,aACA,UACA,gBACA,aACA,mBAGE,kBAAC,OAAD;CAAK,WAAW,EAAG,aAAa,EAAU;WAA1C;EACE,kBAAC,GAAD;GAAgB;GAAmB;aAChC;GACK,CAAA;EACP;EACA,KAAe,CAAC,KAAS,kBAAC,KAAD;GAAG,WAAU;aAA+B;GAAgB,CAAA;EACrF,KAAS,kBAAC,KAAD;GAAG,WAAU;aAAkC;GAAU,CAAA;EAC/D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { AuroraBackground as t } from "@burdenoff/fe-libs/ui";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/botlit/components/PageLayout.tsx
|
|
5
|
+
var i = ({ title: i, description: a, actions: o, children: s, className: c, hero: l = !1 }) => /* @__PURE__ */ r("div", {
|
|
6
|
+
className: e("flex flex-col h-full", c),
|
|
7
|
+
children: [/* @__PURE__ */ r("div", {
|
|
8
|
+
className: e("relative flex items-center justify-between gap-4 px-6 py-4 border-b border-border-seam", l ? "overflow-hidden bg-hero-mesh" : "bg-bg-surface"),
|
|
9
|
+
children: [
|
|
10
|
+
l && /* @__PURE__ */ n(t, { intensity: "subtle" }),
|
|
11
|
+
/* @__PURE__ */ r("div", {
|
|
12
|
+
className: "min-w-0",
|
|
13
|
+
children: [/* @__PURE__ */ n("h1", {
|
|
14
|
+
className: "text-2xl font-semibold tracking-tight text-text-primary",
|
|
15
|
+
children: i
|
|
16
|
+
}), a && /* @__PURE__ */ n("p", {
|
|
17
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
18
|
+
children: a
|
|
19
|
+
})]
|
|
20
|
+
}),
|
|
21
|
+
o && /* @__PURE__ */ n("div", {
|
|
22
|
+
className: "flex flex-shrink-0 items-center gap-3",
|
|
23
|
+
children: o
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
}), /* @__PURE__ */ n("div", {
|
|
27
|
+
className: "flex-1 overflow-auto p-6",
|
|
28
|
+
children: s
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { i as PageLayout };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=PageLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/botlit/components/PageLayout.tsx"],"sourcesContent":["/**\n * Page Layout Component\n * @module botlit/components\n *\n * Boff UI 2.0: the page header uses a seam border and can optionally host the\n * living-glass `AuroraBackground` (the ONE hero backdrop per MFE — opt in via\n * `hero`). The aurora sits behind the header content at -z-10 and never moves\n * page content. Reduced-motion is honoured by the primitive.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { AuroraBackground } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n title: ReactNode;\n description?: ReactNode;\n actions?: ReactNode;\n children: ReactNode;\n className?: string;\n /** Render the aurora hero backdrop behind the header (one per MFE). */\n hero?: boolean;\n}\n\nexport const PageLayout: FC<PageLayoutProps> = ({\n title,\n description,\n actions,\n children,\n className,\n hero = false,\n}) => {\n return (\n <div className={cn('flex flex-col h-full', className)}>\n {/* Page Header */}\n <div\n className={cn(\n 'relative flex items-center justify-between gap-4 px-6 py-4 border-b border-border-seam',\n hero ? 'overflow-hidden bg-hero-mesh' : 'bg-bg-surface'\n )}\n >\n {hero && <AuroraBackground intensity=\"subtle\" />}\n <div className=\"min-w-0\">\n <h1 className=\"text-2xl font-semibold tracking-tight text-text-primary\">{title}</h1>\n {description && <p className=\"mt-1 text-sm text-text-secondary\">{description}</p>}\n </div>\n {actions && <div className=\"flex flex-shrink-0 items-center gap-3\">{actions}</div>}\n </div>\n\n {/* Page Content */}\n <div className=\"flex-1 overflow-auto p-6\">{children}</div>\n </div>\n );\n};\n"],"mappings":";;;;AAwBA,IAAa,KAAmC,EAC9C,UACA,gBACA,YACA,aACA,cACA,UAAO,SAGL,kBAAC,OAAD;CAAK,WAAW,EAAG,wBAAwB,EAAU;WAArD,CAEE,kBAAC,OAAD;EACE,WAAW,EACT,0FACA,IAAO,iCAAiC,gBACzC;YAJH;GAMG,KAAQ,kBAAC,GAAD,EAAkB,WAAU,UAAW,CAAA;GAChD,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,MAAD;KAAI,WAAU;eAA2D;KAAW,CAAA,EACnF,KAAe,kBAAC,KAAD;KAAG,WAAU;eAAoC;KAAgB,CAAA,CAC7E;;GACL,KAAW,kBAAC,OAAD;IAAK,WAAU;cAAyC;IAAc,CAAA;GAC9E;KAGN,kBAAC,OAAD;EAAK,WAAU;EAA4B;EAAe,CAAA,CACtD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AlertDialog as e, AlertDialogAction as t, AlertDialogCancel as n, AlertDialogContent as r, AlertDialogDescription as i, AlertDialogFooter as a, AlertDialogHeader as o, AlertDialogTitle as s } from "@burdenoff/fe-libs/ui";
|
|
2
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
3
|
+
//#region src/botlit/components/QuotaExhaustedDialog.tsx
|
|
4
|
+
function u({ open: u, title: d, description: f, onClose: p, onViewBilling: m }) {
|
|
5
|
+
return /* @__PURE__ */ c(e, {
|
|
6
|
+
open: u,
|
|
7
|
+
onOpenChange: (e) => !e && p(),
|
|
8
|
+
children: /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ l(o, { children: [/* @__PURE__ */ c(s, { children: d }), /* @__PURE__ */ c(i, { children: f })] }), /* @__PURE__ */ l(a, { children: [/* @__PURE__ */ c(n, {
|
|
9
|
+
onClick: p,
|
|
10
|
+
children: "Dismiss"
|
|
11
|
+
}), /* @__PURE__ */ c(t, {
|
|
12
|
+
onClick: m,
|
|
13
|
+
children: "View Billing"
|
|
14
|
+
})] })] })
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { u as QuotaExhaustedDialog };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=QuotaExhaustedDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuotaExhaustedDialog.js","names":[],"sources":["../../../src/botlit/components/QuotaExhaustedDialog.tsx"],"sourcesContent":["import {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '@burdenoff/fe-libs/ui';\n\ninterface QuotaExhaustedDialogProps {\n open: boolean;\n title: string;\n description: string;\n onClose: () => void;\n onViewBilling: () => void;\n}\n\nexport function QuotaExhaustedDialog({\n open,\n title,\n description,\n onClose,\n onViewBilling,\n}: QuotaExhaustedDialogProps) {\n return (\n <AlertDialog open={open} onOpenChange={(nextOpen) => !nextOpen && onClose()}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n <AlertDialogDescription>{description}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel onClick={onClose}>Dismiss</AlertDialogCancel>\n <AlertDialogAction onClick={onViewBilling}>View Billing</AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n}\n"],"mappings":";;;AAmBA,SAAgB,EAAqB,EACnC,SACA,UACA,gBACA,YACA,oBAC4B;AAC5B,QACE,kBAAC,GAAD;EAAmB;EAAM,eAAe,MAAa,CAAC,KAAY,GAAS;YACzE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAmB,GAAyB,CAAA,EAC5C,kBAAC,GAAD,EAAA,UAAyB,GAAqC,CAAA,CAC5C,EAAA,CAAA,EACpB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;GAAmB,SAAS;aAAS;GAA2B,CAAA,EAChE,kBAAC,GAAD;GAAmB,SAAS;aAAe;GAAgC,CAAA,CACzD,EAAA,CAAA,CACD,EAAA,CAAA;EACT,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { GlassCard as e } from "@burdenoff/fe-libs/ui";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/botlit/components/RouteLoader.tsx
|
|
4
|
+
var r = ({ label: r = "Loading Botlit…" }) => /* @__PURE__ */ n("div", {
|
|
5
|
+
className: "mx-auto flex w-full max-w-6xl flex-col gap-6 px-4 py-6 sm:px-6",
|
|
6
|
+
role: "status",
|
|
7
|
+
"aria-live": "polite",
|
|
8
|
+
"aria-busy": "true",
|
|
9
|
+
"aria-label": r,
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ n("div", {
|
|
12
|
+
className: "flex flex-col gap-3",
|
|
13
|
+
children: [/* @__PURE__ */ t("div", { className: "h-7 w-48 rounded-md bg-muted/60 motion-safe:animate-vc-shimmer" }), /* @__PURE__ */ t("div", { className: "h-4 w-72 max-w-full rounded bg-muted/40 motion-safe:animate-vc-shimmer" })]
|
|
14
|
+
}),
|
|
15
|
+
/* @__PURE__ */ t("div", {
|
|
16
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
17
|
+
children: [
|
|
18
|
+
0,
|
|
19
|
+
1,
|
|
20
|
+
2
|
|
21
|
+
].map((r) => /* @__PURE__ */ n(e, {
|
|
22
|
+
treatment: "metric",
|
|
23
|
+
className: "flex flex-col gap-3 border-border-seam p-5",
|
|
24
|
+
children: [/* @__PURE__ */ t("div", { className: "h-3 w-20 rounded bg-muted/50 motion-safe:animate-vc-shimmer" }), /* @__PURE__ */ t("div", { className: "h-8 w-24 rounded-md bg-muted/60 motion-safe:animate-vc-shimmer" })]
|
|
25
|
+
}, r))
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ t(e, {
|
|
28
|
+
treatment: "glass",
|
|
29
|
+
className: "flex flex-col gap-4 border-border-seam p-6",
|
|
30
|
+
children: [
|
|
31
|
+
0,
|
|
32
|
+
1,
|
|
33
|
+
2,
|
|
34
|
+
3
|
|
35
|
+
].map((e) => /* @__PURE__ */ n("div", {
|
|
36
|
+
className: "flex items-center gap-4",
|
|
37
|
+
children: [/* @__PURE__ */ t("div", { className: "h-10 w-10 shrink-0 rounded-full bg-muted/50 motion-safe:animate-vc-shimmer" }), /* @__PURE__ */ n("div", {
|
|
38
|
+
className: "flex flex-1 flex-col gap-2",
|
|
39
|
+
children: [/* @__PURE__ */ t("div", { className: "h-4 w-1/3 rounded bg-muted/50 motion-safe:animate-vc-shimmer" }), /* @__PURE__ */ t("div", { className: "h-3 w-2/3 rounded bg-muted/30 motion-safe:animate-vc-shimmer" })]
|
|
40
|
+
})]
|
|
41
|
+
}, e))
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ t("p", {
|
|
44
|
+
className: "text-center text-sm text-text-secondary",
|
|
45
|
+
children: r
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
export { r as RouteLoader };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=RouteLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteLoader.js","names":[],"sources":["../../../src/botlit/components/RouteLoader.tsx"],"sourcesContent":["/**\n * Route Loader\n * @module botlit/components\n */\n\nimport type { FC } from 'react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\n\n/**\n * The single loading surface for Botlit — a calm glass-skeleton scaffold\n * (header + metric row + content block) instead of a bare spinner, so a cold\n * load reads as the page settling in rather than a hole in the middle of an\n * otherwise fully-drawn shell.\n *\n * It is deliberately used for EVERY pre-content state — the lazy\n * implementation chunk, the gateway-client handshake and the per-route lazy\n * page — so the content region never flips between loading idioms (and never\n * goes empty) between first paint and the page rendering.\n *\n * Boff UI 2.0: semantic tokens only, shimmer gated behind `motion-safe` so it\n * is static under `prefers-reduced-motion`.\n */\nexport interface RouteLoaderProps {\n /**\n * Announced to assistive tech and shown under the skeleton. Defaults to a\n * generic Botlit message; pass a route-specific one where it helps.\n */\n label?: string;\n}\n\nexport const RouteLoader: FC<RouteLoaderProps> = ({ label = 'Loading Botlit…' }) => (\n <div\n className=\"mx-auto flex w-full max-w-6xl flex-col gap-6 px-4 py-6 sm:px-6\"\n role=\"status\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n aria-label={label}\n >\n {/* Header skeleton */}\n <div className=\"flex flex-col gap-3\">\n <div className=\"h-7 w-48 rounded-md bg-muted/60 motion-safe:animate-vc-shimmer\" />\n <div className=\"h-4 w-72 max-w-full rounded bg-muted/40 motion-safe:animate-vc-shimmer\" />\n </div>\n\n {/* Metric row skeleton */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {[0, 1, 2].map((index) => (\n <GlassCard\n key={index}\n treatment=\"metric\"\n className=\"flex flex-col gap-3 border-border-seam p-5\"\n >\n <div className=\"h-3 w-20 rounded bg-muted/50 motion-safe:animate-vc-shimmer\" />\n <div className=\"h-8 w-24 rounded-md bg-muted/60 motion-safe:animate-vc-shimmer\" />\n </GlassCard>\n ))}\n </div>\n\n {/* Content block skeleton */}\n <GlassCard treatment=\"glass\" className=\"flex flex-col gap-4 border-border-seam p-6\">\n {[0, 1, 2, 3].map((index) => (\n <div key={index} className=\"flex items-center gap-4\">\n <div className=\"h-10 w-10 shrink-0 rounded-full bg-muted/50 motion-safe:animate-vc-shimmer\" />\n <div className=\"flex flex-1 flex-col gap-2\">\n <div className=\"h-4 w-1/3 rounded bg-muted/50 motion-safe:animate-vc-shimmer\" />\n <div className=\"h-3 w-2/3 rounded bg-muted/30 motion-safe:animate-vc-shimmer\" />\n </div>\n </div>\n ))}\n </GlassCard>\n\n <p className=\"text-center text-sm text-text-secondary\">{label}</p>\n </div>\n);\n"],"mappings":";;;AA8BA,IAAa,KAAqC,EAAE,WAAQ,wBAC1D,kBAAC,OAAD;CACE,WAAU;CACV,MAAK;CACL,aAAU;CACV,aAAU;CACV,cAAY;WALd;EAQE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD,EAAK,WAAU,kEAAmE,CAAA,EAClF,kBAAC,OAAD,EAAK,WAAU,0EAA2E,CAAA,CACtF;;EAGN,kBAAC,OAAD;GAAK,WAAU;aACZ;IAAC;IAAG;IAAG;IAAE,CAAC,KAAK,MACd,kBAAC,GAAD;IAEE,WAAU;IACV,WAAU;cAHZ,CAKE,kBAAC,OAAD,EAAK,WAAU,+DAAgE,CAAA,EAC/E,kBAAC,OAAD,EAAK,WAAU,kEAAmE,CAAA,CACxE;MANL,EAMK,CACZ;GACE,CAAA;EAGN,kBAAC,GAAD;GAAW,WAAU;GAAQ,WAAU;aACpC;IAAC;IAAG;IAAG;IAAG;IAAE,CAAC,KAAK,MACjB,kBAAC,OAAD;IAAiB,WAAU;cAA3B,CACE,kBAAC,OAAD,EAAK,WAAU,8EAA+E,CAAA,EAC9F,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,OAAD,EAAK,WAAU,gEAAiE,CAAA,EAChF,kBAAC,OAAD,EAAK,WAAU,gEAAiE,CAAA,CAC5E;OACF;MANI,EAMJ,CACN;GACQ,CAAA;EAEZ,kBAAC,KAAD;GAAG,WAAU;aAA2C;GAAU,CAAA;EAC9D"}
|