@fayz-ai/ui 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics/AnalyticsCard.d.ts.map +1 -1
- package/dist/analytics/AnalyticsControls.d.ts.map +1 -1
- package/dist/analytics/batch.d.ts +19 -0
- package/dist/analytics/batch.d.ts.map +1 -0
- package/dist/analytics/context.d.ts.map +1 -1
- package/dist/analytics/index.d.ts +2 -0
- package/dist/analytics/index.d.ts.map +1 -1
- package/dist/{chunk-I6CPKAOD.js → chunk-7BMXN7MP.js} +215 -99
- package/dist/chunk-7BMXN7MP.js.map +1 -0
- package/dist/{chunk-6V5MGYXH.js → chunk-JGJNRNQW.js} +142 -31
- package/dist/chunk-JGJNRNQW.js.map +1 -0
- package/dist/{chunk-H63TOSQ7.js → chunk-QSHA2Q27.js} +475 -134
- package/dist/chunk-QSHA2Q27.js.map +1 -0
- package/dist/{chunk-SEIY2F5F.js → chunk-XRDCYOND.js} +231 -41
- package/dist/chunk-XRDCYOND.js.map +1 -0
- package/dist/chunk-ZBQ772DU.js +17 -0
- package/dist/chunk-ZBQ772DU.js.map +1 -0
- package/dist/dashboard/ChartWidget.d.ts.map +1 -1
- package/dist/dashboard/KpiCard.d.ts.map +1 -1
- package/dist/dashboard/SidebarOnboarding.d.ts +16 -11
- package/dist/dashboard/SidebarOnboarding.d.ts.map +1 -1
- package/dist/dashboard/Sparkline.d.ts +13 -0
- package/dist/dashboard/Sparkline.d.ts.map +1 -0
- package/dist/dashboard/index.d.ts +1 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +3 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +234 -115
- package/dist/index.js.map +1 -1
- package/dist/layout/AppShell.d.ts +4 -1
- package/dist/layout/AppShell.d.ts.map +1 -1
- package/dist/layout/AppShellSkeleton.d.ts +23 -0
- package/dist/layout/AppShellSkeleton.d.ts.map +1 -0
- package/dist/layout/ModulePage.d.ts +5 -1
- package/dist/layout/ModulePage.d.ts.map +1 -1
- package/dist/layout/Sidebar.d.ts +19 -1
- package/dist/layout/Sidebar.d.ts.map +1 -1
- package/dist/layout/Topbar.d.ts +4 -1
- package/dist/layout/Topbar.d.ts.map +1 -1
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +2 -1
- package/dist/layout/page-trail.d.ts +23 -0
- package/dist/layout/page-trail.d.ts.map +1 -0
- package/dist/layout/rail-flyout.d.ts +39 -0
- package/dist/layout/rail-flyout.d.ts.map +1 -0
- package/dist/primitives/bulk-action-bar.d.ts +30 -0
- package/dist/primitives/bulk-action-bar.d.ts.map +1 -0
- package/dist/primitives/checkbox.d.ts +5 -0
- package/dist/primitives/checkbox.d.ts.map +1 -1
- package/dist/primitives/data-table.d.ts +11 -1
- package/dist/primitives/data-table.d.ts.map +1 -1
- package/dist/primitives/dropdown.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +4 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +2 -2
- package/dist/primitives/list-chrome.d.ts +20 -0
- package/dist/primitives/list-chrome.d.ts.map +1 -0
- package/dist/primitives/modal.d.ts.map +1 -1
- package/dist/primitives/phone-field.d.ts +19 -0
- package/dist/primitives/phone-field.d.ts.map +1 -0
- package/dist/primitives/search-select.d.ts +6 -1
- package/dist/primitives/search-select.d.ts.map +1 -1
- package/dist/primitives/thumbnail.d.ts +19 -0
- package/dist/primitives/thumbnail.d.ts.map +1 -0
- package/dist/styles.css +111 -1
- package/dist/tailwind.cjs +7 -2
- package/dist/tailwind.cjs.map +1 -1
- package/dist/tailwind.d.ts.map +1 -1
- package/dist/tailwind.js +7 -2
- package/dist/tailwind.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-6V5MGYXH.js.map +0 -1
- package/dist/chunk-H63TOSQ7.js.map +0 -1
- package/dist/chunk-I6CPKAOD.js.map +0 -1
- package/dist/chunk-SEIY2F5F.js.map +0 -1
|
@@ -8,6 +8,7 @@ export { DashboardRangeProvider, DashboardRangeControl, useDashboardRange, DEFAU
|
|
|
8
8
|
export type { DashboardRangeOptions } from './DashboardCanvas';
|
|
9
9
|
export { KpiCard, formatKpiValue, type KpiCardProps } from './KpiCard';
|
|
10
10
|
export { ChartWidget, type ChartWidgetProps } from './ChartWidget';
|
|
11
|
+
export { Sparkline, type SparklineProps } from './Sparkline';
|
|
11
12
|
export { TableWidget, type TableWidgetProps } from './TableWidget';
|
|
12
13
|
export { OnboardingWidget, type OnboardingStepInput, type OnboardingWidgetProps } from './OnboardingWidget';
|
|
13
14
|
export { SidebarOnboarding, type SidebarOnboardingProps } from './SidebarOnboarding';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,UAAU,EACV,yBAAyB,EACzB,oBAAoB,EACpB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,sBAAsB,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,uBAAuB,EAAE,KAAK,yBAAyB,EAAE,MAAM,eAAe,CAAA;AACvF,OAAO,EAAE,sBAAsB,EAAE,KAAK,2BAA2B,EAAE,MAAM,0BAA0B,CAAA;AACnG,OAAO,EAAE,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAChG,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,2BAA2B,GACjC,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,qBAAqB,EAAE,MAAM,mB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ashboardGrid, DashboardNavigateProvider, DashboardRangeControl, DashboardRangeProvider, GoldCard, KpiCard, OnboardingWidget, SidebarOnboarding, TableWidget, WidgetGrid, defineChartWidget, defineCustomWidget, defineKpiWidget, defineOnboardingWidget, defineTableWidget, formatKpiValue, renderIcon, resolveDashboardLayout, useDashboardNavigate, useDashboardPreferences, useDashboardRange, useOnboardingProgress } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { ChartWidget, DEFAULT_RANGE_OPTIONS, DashboardCanvas, DashboardCustomizeMenu, DashboardGrid, DashboardNavigateProvider, DashboardRangeControl, DashboardRangeProvider, GoldCard, KpiCard, OnboardingWidget, SidebarOnboarding, Sparkline, TableWidget, WidgetGrid, defineChartWidget, defineCustomWidget, defineKpiWidget, defineOnboardingWidget, defineTableWidget, formatKpiValue, renderIcon, resolveDashboardLayout, useDashboardNavigate, useDashboardPreferences, useDashboardRange, useOnboardingProgress } from '../chunk-7BMXN7MP.js';
|
|
2
|
+
import '../chunk-JGJNRNQW.js';
|
|
3
|
+
import '../chunk-ZBQ772DU.js';
|
|
3
4
|
import '../chunk-OKZ6WQB3.js';
|
|
4
5
|
import '../chunk-22EVFMS3.js';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { cn } from './lib/cn';
|
|
2
|
-
export { Button, buttonVariants, type ButtonProps, Input, type InputProps, Badge, badgeVariants, type BadgeProps, Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, Modal, ModalPortal, ModalOverlay, ModalClose, ModalTrigger, ModalContent, ModalHeader, ModalBody, ModalFooter, ModalTitle, ModalDescription, type ModalSize, Dropdown, DropdownTrigger, DropdownContent, DropdownItem, DropdownCheckboxItem, DropdownRadioItem, DropdownLabel, DropdownSeparator, DropdownShortcut, DropdownGroup, DropdownPortal, DropdownSub, DropdownSubContent, DropdownSubTrigger, DropdownRadioGroup, DataTable, type DataTableProps, Checkbox, type CheckboxColor, type CheckboxProps, Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetBody, SheetFooter, SheetTitle, SheetDescription, Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, ToastProvider, toast, Tabs, TabsList, TabsTrigger, TabsContent, Separator, PhoneLink, normalizePhone, type PhoneLinkProps, type NormalizedPhone, Breadcrumb, Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, PageHeader, PageHeaderCrumb, type PageHeaderProps, StatTiles, type StatTilesProps, type StatTileData, Switch, type SwitchProps, Hint, type HintProps, TimePicker, Skeleton, TableSkeleton, ListView, DatePicker, SearchSelect, type SearchSelectOption, type SearchSelectProps, CurrencyInput, ConfirmDialog, Popover, PopoverTrigger, PopoverContent, SegmentedControl, type SegmentedControlProps, type SegmentedOption, HeaderTabs, type HeaderTabsProps, type HeaderTab, FilterChip, type FilterChipProps, type FilterChipOption, Markdown, renderMarkdown, type MarkdownProps, MarkdownEditor, type MarkdownEditorProps, SearchCombobox, type ComboboxOption, } from './primitives';
|
|
3
|
-
export { AppShell, type AppShellProps, type AppShellUser, type BottomNavItem, type BottomNavRouteItem, type BottomNavActionItem, type MobileHeaderVariant, Sidebar, type SidebarProps, type SidebarUser, type NavigationItem, ICON_MAP, Topbar, type TopbarProps, ModulePage, SubpageHeader, ContentSplit, ContentSplitTrigger, ModuleLayoutProvider, useModuleLayout, PageHeaderActions, BackStyleProvider, useBackStyle, SaveBar, SaveBarProvider, useSaveBar, useBackHandler, type SaveBarRegistration, useModuleHeaderSlot, useModuleHeaderActionsSlot, PageTransition, NavTransitionProvider, useNavTransition, type NavTransition, type ModulePageProps, type ModuleNavItem, type ModuleNavVariant, type SubpageHeaderProps, type ContentSplitProps, type ContentSplitTriggerProps, type BackButtonStyle, } from './layout';
|
|
2
|
+
export { Button, buttonVariants, type ButtonProps, Input, type InputProps, Badge, badgeVariants, type BadgeProps, Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, Modal, ModalPortal, ModalOverlay, ModalClose, ModalTrigger, ModalContent, ModalHeader, ModalBody, ModalFooter, ModalTitle, ModalDescription, type ModalSize, Dropdown, DropdownTrigger, DropdownContent, DropdownItem, DropdownCheckboxItem, DropdownRadioItem, DropdownLabel, DropdownSeparator, DropdownShortcut, DropdownGroup, DropdownPortal, DropdownSub, DropdownSubContent, DropdownSubTrigger, DropdownRadioGroup, DataTable, type DataTableProps, Checkbox, type CheckboxColor, type CheckboxProps, Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetBody, SheetFooter, SheetTitle, SheetDescription, Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, ToastProvider, toast, Tabs, TabsList, TabsTrigger, TabsContent, Separator, PhoneLink, normalizePhone, type PhoneLinkProps, type NormalizedPhone, Breadcrumb, Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, PageHeader, PageHeaderCrumb, type PageHeaderProps, SearchField, ChevronPager, BulkActionBar, type BulkAction, type BulkActionBarProps, Thumbnail, type ThumbnailProps, type ThumbnailSize, PhoneField, formatPhone, type PhoneFieldProps, type SearchFieldProps, type ChevronPagerProps, StatTiles, type StatTilesProps, type StatTileData, Switch, type SwitchProps, Hint, type HintProps, TimePicker, Skeleton, TableSkeleton, ListView, DatePicker, SearchSelect, type SearchSelectOption, type SearchSelectProps, CurrencyInput, ConfirmDialog, Popover, PopoverTrigger, PopoverContent, SegmentedControl, type SegmentedControlProps, type SegmentedOption, HeaderTabs, type HeaderTabsProps, type HeaderTab, FilterChip, type FilterChipProps, type FilterChipOption, Markdown, renderMarkdown, type MarkdownProps, MarkdownEditor, type MarkdownEditorProps, SearchCombobox, type ComboboxOption, } from './primitives';
|
|
3
|
+
export { AppShell, type AppShellProps, type AppShellUser, AppShellSkeleton, type AppShellSkeletonProps, type BottomNavItem, type BottomNavRouteItem, type BottomNavActionItem, type MobileHeaderVariant, Sidebar, type SidebarProps, type SidebarUser, type NavigationItem, ICON_MAP, Topbar, type TopbarProps, ModulePage, SubpageHeader, ContentSplit, ContentSplitTrigger, ModuleLayoutProvider, useModuleLayout, PageHeaderActions, BackStyleProvider, useBackStyle, PageTrail, usePageTrail, usePageTrailParent, navigateToCrumb, type PageTrailCrumb, SaveBar, SaveBarProvider, useSaveBar, useBackHandler, type SaveBarRegistration, useModuleHeaderSlot, useModuleHeaderActionsSlot, PageTransition, NavTransitionProvider, useNavTransition, type NavTransition, type ModulePageProps, type ModuleNavItem, type ModuleNavVariant, type SubpageHeaderProps, type ContentSplitProps, type ContentSplitTriggerProps, type BackButtonStyle, } from './layout';
|
|
4
4
|
export { useLayoutStore, usePageHeader, usePageHeaderSlot, usePageHeaderHost, useHasPageHeaderHost, useHasPageHeaderOutlet, PageHeaderOutlet, useThemeStore, lightTheme, darkTheme, type ThemeTokens, type SemanticColors, type UIPerceptionTokens, type CreateThemeOptions, } from './stores';
|
|
5
5
|
export { ThemeProvider, useTheme, createTheme, createFayzTheme, fayzThemePresets, type ThemeProviderProps, type FayzThemePresetId, } from './theme';
|
|
6
6
|
export { Avatar, AvatarImage, AvatarFallback } from './primitives/Avatar';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;AAG7B,OAAO,EACL,MAAM,EACN,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,EACL,KAAK,UAAU,EACf,KAAK,EACL,aAAa,EACb,KAAK,UAAU,EACf,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACX,KAAK,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX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AAGzE,OAAO,EACL,eAAe,EACf,UAAU,EACV,yBAAyB,EACzB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,sBAAsB,EACtB,KAAK,aAAa,EAClB,uBAAuB,EACvB,KAAK,yBAAyB,EAC9B,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,QAAQ,EACR,KAAK,aAAa,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,OAAO,EACP,cAAc,EACd,KAAK,YAAY,EACjB,WAAW,EACX,KAAK,gBAAgB,EACrB,WAAW,EACX,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,MAAM,aAAa,CAAA;AAIpB,cAAc,aAAa,CAAA;AAI3B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;AAG7B,OAAO,EACL,MAAM,EACN,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,EACL,KAAK,UAAU,EACf,KAAK,EACL,aAAa,EACb,KAAK,UAAU,EACf,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SA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EACd,KAAK,WAAW,GACjB,MAAM,aAAa,CAAA;AAIpB,cAAc,aAAa,CAAA;AAI3B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { Popover, PopoverTrigger, PopoverContent, Input, Hint } from './chunk-
|
|
2
|
-
export { Badge, Breadcrumb,
|
|
3
|
-
export { AppShell, BackStyleProvider, ContentSplit, ContentSplitTrigger, ModuleLayoutProvider, ModulePage, NavTransitionProvider, PageHeaderActions, PageTransition, Sidebar, SubpageHeader, Topbar,
|
|
1
|
+
import { Popover, PopoverTrigger, PopoverContent, Input, Hint, DatePicker } from './chunk-XRDCYOND.js';
|
|
2
|
+
export { Badge, Breadcrumb, BulkActionBar, ChevronPager, ConfirmDialog, CurrencyInput, DatePicker, FilterChip, Hint, Input, ListView, Markdown, MarkdownEditor, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, PhoneField, PhoneLink, Popover, PopoverContent, PopoverTrigger, SearchCombobox, SearchField, SearchSelect, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, StatTiles, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Thumbnail, TimePicker, ToastProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, formatPhone, normalizePhone, renderMarkdown, toast } from './chunk-XRDCYOND.js';
|
|
3
|
+
export { AppShell, AppShellSkeleton, BackStyleProvider, ContentSplit, ContentSplitTrigger, ModuleLayoutProvider, ModulePage, NavTransitionProvider, PageHeaderActions, PageTrail, PageTransition, Sidebar, SubpageHeader, Topbar, navigateToCrumb, useBackStyle, useModuleHeaderActionsSlot, useModuleHeaderSlot, useModuleLayout, useNavTransition, usePageTrail, usePageTrailParent } from './chunk-QSHA2Q27.js';
|
|
4
4
|
export { HeaderTabs, PageHeader, PageHeaderCrumb, PageHeaderOutlet, SaveBar, SaveBarProvider, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, useBackHandler, useHasPageHeaderHost, useHasPageHeaderOutlet, usePageHeader, usePageHeaderHost, usePageHeaderSlot, useSaveBar } from './chunk-VAKWUUVC.js';
|
|
5
5
|
export { ThemeProvider, createFayzTheme, createTheme, darkTheme, fayzThemePresets, lightTheme, useTheme, useThemeStore } from './chunk-VDAYIQX4.js';
|
|
6
|
-
import { ChartWidget, DashboardGrid } from './chunk-
|
|
7
|
-
export { ChartWidget, DEFAULT_RANGE_OPTIONS, DashboardCanvas, DashboardCustomizeMenu, DashboardGrid, DashboardNavigateProvider, DashboardRangeControl, DashboardRangeProvider, GoldCard, KpiCard, OnboardingWidget, SidebarOnboarding, TableWidget, WidgetGrid, defineChartWidget, defineCustomWidget, defineKpiWidget, defineOnboardingWidget, defineTableWidget, formatKpiValue, renderIcon, resolveDashboardLayout, useDashboardNavigate, useDashboardPreferences, useDashboardRange, useOnboardingProgress } from './chunk-
|
|
8
|
-
import { Skeleton, Dropdown, DropdownTrigger, DropdownContent, DropdownItem, Card, CardContent } from './chunk-
|
|
9
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, DataTable, Dropdown, DropdownCheckboxItem, DropdownContent, DropdownGroup, DropdownItem, DropdownLabel, DropdownPortal, DropdownRadioGroup, DropdownRadioItem, DropdownSeparator, DropdownShortcut, DropdownSub, DropdownSubContent, DropdownSubTrigger, DropdownTrigger, SegmentedControl, Skeleton, TableSkeleton } from './chunk-
|
|
6
|
+
import { ChartWidget, Sparkline, DashboardGrid } from './chunk-7BMXN7MP.js';
|
|
7
|
+
export { ChartWidget, DEFAULT_RANGE_OPTIONS, DashboardCanvas, DashboardCustomizeMenu, DashboardGrid, DashboardNavigateProvider, DashboardRangeControl, DashboardRangeProvider, GoldCard, KpiCard, OnboardingWidget, SidebarOnboarding, TableWidget, WidgetGrid, defineChartWidget, defineCustomWidget, defineKpiWidget, defineOnboardingWidget, defineTableWidget, formatKpiValue, renderIcon, resolveDashboardLayout, useDashboardNavigate, useDashboardPreferences, useDashboardRange, useOnboardingProgress } from './chunk-7BMXN7MP.js';
|
|
8
|
+
import { Skeleton, Dropdown, DropdownTrigger, DropdownContent, DropdownItem, Card, CardContent, DropdownSeparator } from './chunk-JGJNRNQW.js';
|
|
9
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, DataTable, Dropdown, DropdownCheckboxItem, DropdownContent, DropdownGroup, DropdownItem, DropdownLabel, DropdownPortal, DropdownRadioGroup, DropdownRadioItem, DropdownSeparator, DropdownShortcut, DropdownSub, DropdownSubContent, DropdownSubTrigger, DropdownTrigger, SegmentedControl, Skeleton, TableSkeleton } from './chunk-JGJNRNQW.js';
|
|
10
|
+
export { useLayoutStore } from './chunk-ZBQ772DU.js';
|
|
10
11
|
import { cn, Button } from './chunk-OKZ6WQB3.js';
|
|
11
12
|
export { Button, buttonVariants, cn } from './chunk-OKZ6WQB3.js';
|
|
12
13
|
export { ICON_MAP, getLucideIcon, registerIcons } from './chunk-22EVFMS3.js';
|
|
13
14
|
import * as React2 from 'react';
|
|
14
15
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
15
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
16
|
-
import { Construction, DatabaseZap, AlertCircle, SlidersHorizontal, Search, ChevronRight,
|
|
16
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
17
|
+
import { ChevronDown, Construction, DatabaseZap, AlertCircle, SlidersHorizontal, Search, ChevronRight, GitCompareArrows, Check, RefreshCw, X, TrendingUp, TrendingDown, Info, ArrowUpRight, Calendar } from 'lucide-react';
|
|
18
|
+
import { useTranslation, getCurrentLocale } from '@fayz-ai/core';
|
|
17
19
|
|
|
18
20
|
var Avatar = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
19
21
|
AvatarPrimitive.Root,
|
|
@@ -282,6 +284,62 @@ function toSpark(result, measureKey) {
|
|
|
282
284
|
if (!result?.rows?.length || result.rows.length < 2) return void 0;
|
|
283
285
|
return result.rows.map((row) => num(row[measureKey]));
|
|
284
286
|
}
|
|
287
|
+
|
|
288
|
+
// src/analytics/batch.ts
|
|
289
|
+
var BATCH_WINDOW_MS = 16;
|
|
290
|
+
function createBatchingProvider(provider, options = {}) {
|
|
291
|
+
const windowMs = options.windowMs ?? BATCH_WINDOW_MS;
|
|
292
|
+
const inflight = /* @__PURE__ */ new Map();
|
|
293
|
+
let queue = [];
|
|
294
|
+
let timer = null;
|
|
295
|
+
const flush = () => {
|
|
296
|
+
timer = null;
|
|
297
|
+
const batch = queue;
|
|
298
|
+
queue = [];
|
|
299
|
+
if (batch.length === 0) return;
|
|
300
|
+
const individually = () => {
|
|
301
|
+
for (const p of batch) provider.run(p.card, p.state).then(p.resolve, p.reject);
|
|
302
|
+
};
|
|
303
|
+
if (batch.length === 1 || !provider.runMany) {
|
|
304
|
+
individually();
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
let batchCall;
|
|
308
|
+
try {
|
|
309
|
+
batchCall = provider.runMany(batch.map(({ card, state }) => ({ card, state })));
|
|
310
|
+
} catch {
|
|
311
|
+
individually();
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
batchCall.then(
|
|
315
|
+
(results) => batch.forEach((p, i) => {
|
|
316
|
+
const result = results[i];
|
|
317
|
+
if (!result) p.reject(new Error("analytics: batch returned no result for this card"));
|
|
318
|
+
else if (result instanceof Error) p.reject(result);
|
|
319
|
+
else p.resolve(result);
|
|
320
|
+
}),
|
|
321
|
+
(error) => batch.forEach((p) => p.reject(error))
|
|
322
|
+
);
|
|
323
|
+
};
|
|
324
|
+
return {
|
|
325
|
+
run(card, state) {
|
|
326
|
+
const key = JSON.stringify([card.id, state, options.refreshToken ?? 0]);
|
|
327
|
+
const existing = inflight.get(key);
|
|
328
|
+
if (existing) return existing;
|
|
329
|
+
const promise = new Promise((resolve, reject) => {
|
|
330
|
+
queue.push({ card, state, resolve, reject });
|
|
331
|
+
if (timer == null) timer = setTimeout(flush, windowMs);
|
|
332
|
+
}).finally(() => {
|
|
333
|
+
inflight.delete(key);
|
|
334
|
+
});
|
|
335
|
+
inflight.set(key, promise);
|
|
336
|
+
return promise;
|
|
337
|
+
},
|
|
338
|
+
// Passed through so a caller that already has a batch of its own (an export
|
|
339
|
+
// of every card, say) still reaches the provider's own batching.
|
|
340
|
+
runMany: provider.runMany ? (requests) => provider.runMany(requests) : void 0
|
|
341
|
+
};
|
|
342
|
+
}
|
|
285
343
|
var AnalyticsContext = React2.createContext(null);
|
|
286
344
|
function useAnalyticsContext() {
|
|
287
345
|
const ctx = React2.useContext(AnalyticsContext);
|
|
@@ -350,23 +408,12 @@ function AnalyticsContextProvider({
|
|
|
350
408
|
setState((s) => ({ ...s, search, page: 1 }));
|
|
351
409
|
}, []);
|
|
352
410
|
const refresh = React2.useCallback(() => setRefreshToken((t) => t + 1), []);
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
const key = JSON.stringify([card.id, queryState, refreshToken]);
|
|
358
|
-
const existing = inflight.get(key);
|
|
359
|
-
if (existing) return existing;
|
|
360
|
-
const promise = provider.run(card, queryState).finally(() => {
|
|
361
|
-
inflight.delete(key);
|
|
362
|
-
});
|
|
363
|
-
inflight.set(key, promise);
|
|
364
|
-
return promise;
|
|
365
|
-
}
|
|
366
|
-
};
|
|
367
|
-
}, [provider, refreshToken]);
|
|
411
|
+
const batched = React2.useMemo(
|
|
412
|
+
() => createBatchingProvider(provider, { refreshToken }),
|
|
413
|
+
[provider, refreshToken]
|
|
414
|
+
);
|
|
368
415
|
const value = React2.useMemo(() => ({
|
|
369
|
-
provider:
|
|
416
|
+
provider: batched,
|
|
370
417
|
currency: currency ?? { code: "BRL", locale: "pt-BR", symbol: "R$" },
|
|
371
418
|
state,
|
|
372
419
|
preset,
|
|
@@ -385,7 +432,7 @@ function AnalyticsContextProvider({
|
|
|
385
432
|
onOpenCard,
|
|
386
433
|
createdBy
|
|
387
434
|
}), [
|
|
388
|
-
|
|
435
|
+
batched,
|
|
389
436
|
currency,
|
|
390
437
|
state,
|
|
391
438
|
preset,
|
|
@@ -518,26 +565,6 @@ function CardChrome({
|
|
|
518
565
|
/* @__PURE__ */ jsx(CardContent, { className: cn("flex-1", dense ? "p-4 pt-2" : "p-5 pt-2"), children })
|
|
519
566
|
] });
|
|
520
567
|
}
|
|
521
|
-
function Spark({ data, color }) {
|
|
522
|
-
const gid = React2.useId();
|
|
523
|
-
if (data.length < 2) return null;
|
|
524
|
-
const W = 120, H = 28, P = 2;
|
|
525
|
-
const min = Math.min(...data);
|
|
526
|
-
const max = Math.max(...data);
|
|
527
|
-
const span = max - min || 1;
|
|
528
|
-
const step = (W - P * 2) / (data.length - 1);
|
|
529
|
-
const pts = data.map((d, i) => [P + i * step, P + (H - P * 2) * (1 - (d - min) / span)]);
|
|
530
|
-
const line = pts.map(([x, y], i) => `${i === 0 ? "M" : "L"}${x.toFixed(1)},${y.toFixed(1)}`).join(" ");
|
|
531
|
-
const area = `${line} L${pts[pts.length - 1][0].toFixed(1)},${H} L${pts[0][0].toFixed(1)},${H} Z`;
|
|
532
|
-
return /* @__PURE__ */ jsxs("svg", { viewBox: `0 0 ${W} ${H}`, className: "h-7 w-full", preserveAspectRatio: "none", "aria-hidden": true, children: [
|
|
533
|
-
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gid, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
534
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: color, stopOpacity: "0.22" }),
|
|
535
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: color, stopOpacity: "0" })
|
|
536
|
-
] }) }),
|
|
537
|
-
/* @__PURE__ */ jsx("path", { d: area, fill: `url(#${gid})` }),
|
|
538
|
-
/* @__PURE__ */ jsx("path", { d: line, fill: "none", stroke: color, strokeWidth: "1.5", vectorEffect: "non-scaling-stroke", strokeLinejoin: "round" })
|
|
539
|
-
] });
|
|
540
|
-
}
|
|
541
568
|
function TrendChip({ current, previous }) {
|
|
542
569
|
const delta = deltaPercent(current, previous);
|
|
543
570
|
const trend = trendOf(current, previous);
|
|
@@ -640,7 +667,17 @@ function AnalyticsCard({ card, className, hideOpen }) {
|
|
|
640
667
|
/* @__PURE__ */ jsx("span", { className: "text-2xl font-semibold tracking-tight tabular-nums", children: formatAnalyticsValue(value, measure.format, currency, { compact: true }) }),
|
|
641
668
|
/* @__PURE__ */ jsx(TrendChip, { current: value, previous })
|
|
642
669
|
] }),
|
|
643
|
-
spark ? /* @__PURE__ */ jsx(
|
|
670
|
+
spark ? /* @__PURE__ */ jsx(
|
|
671
|
+
Sparkline,
|
|
672
|
+
{
|
|
673
|
+
data: spark,
|
|
674
|
+
color: "hsl(var(--info))",
|
|
675
|
+
width: 120,
|
|
676
|
+
height: 28,
|
|
677
|
+
padding: 2,
|
|
678
|
+
className: "h-7 w-full"
|
|
679
|
+
}
|
|
680
|
+
) : null
|
|
644
681
|
] });
|
|
645
682
|
}
|
|
646
683
|
case "breakdown": {
|
|
@@ -735,28 +772,35 @@ function collectFilters(cards) {
|
|
|
735
772
|
return [...byKey.values()];
|
|
736
773
|
}
|
|
737
774
|
var PRESETS = [
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
];
|
|
748
|
-
var COMPARE_OPTIONS = [
|
|
749
|
-
{ value: "previous_period", label: "Previous period" },
|
|
750
|
-
{ value: "previous_year", label: "Previous year" },
|
|
751
|
-
{ value: "none", label: "No comparison" }
|
|
775
|
+
"today",
|
|
776
|
+
"yesterday",
|
|
777
|
+
"last_7_days",
|
|
778
|
+
"last_30_days",
|
|
779
|
+
"last_90_days",
|
|
780
|
+
"this_month",
|
|
781
|
+
"last_month",
|
|
782
|
+
"this_quarter",
|
|
783
|
+
"this_year"
|
|
752
784
|
];
|
|
753
|
-
var
|
|
754
|
-
var ControlButton = React2.forwardRef(function ControlButton2({ icon: Icon, children, ...props }, ref) {
|
|
755
|
-
return /* @__PURE__ */ jsxs(Button, { ref, variant: "outline", size: "sm", className: "
|
|
756
|
-
Icon ? /* @__PURE__ */ jsx(Icon, { className: "h-3
|
|
757
|
-
children
|
|
785
|
+
var COMPARE_OPTIONS = ["previous_period", "previous_year", "none"];
|
|
786
|
+
var ControlButton = React2.forwardRef(function ControlButton2({ icon: Icon, children, className, ...props }, ref) {
|
|
787
|
+
return /* @__PURE__ */ jsxs(Button, { ref, variant: "outline", size: "sm", className: cn("gap-1.5", className), ...props, children: [
|
|
788
|
+
Icon ? /* @__PURE__ */ jsx(Icon, { className: "h-3 w-3 shrink-0 opacity-70" }) : null,
|
|
789
|
+
children,
|
|
790
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 shrink-0 opacity-60" })
|
|
758
791
|
] });
|
|
759
792
|
});
|
|
793
|
+
function formatSpan(from, to, locale) {
|
|
794
|
+
const opts = { day: "2-digit", month: "short" };
|
|
795
|
+
const a = parseDay(from);
|
|
796
|
+
const b = parseDay(to);
|
|
797
|
+
const fmt = (d) => d.toLocaleDateString(locale, {
|
|
798
|
+
...opts,
|
|
799
|
+
// The year only earns its space when the range leaves the current one.
|
|
800
|
+
...d.getFullYear() === (/* @__PURE__ */ new Date()).getFullYear() ? {} : { year: "numeric" }
|
|
801
|
+
});
|
|
802
|
+
return from === to ? fmt(a) : `${fmt(a)} \u2013 ${fmt(b)}`;
|
|
803
|
+
}
|
|
760
804
|
function useFilterOptions(filter) {
|
|
761
805
|
const [options, setOptions] = React2.useState(
|
|
762
806
|
Array.isArray(filter.options) ? filter.options : []
|
|
@@ -782,6 +826,7 @@ function FilterValues({
|
|
|
782
826
|
draft,
|
|
783
827
|
onChange
|
|
784
828
|
}) {
|
|
829
|
+
const t = useTranslation();
|
|
785
830
|
const options = useFilterOptions(filter);
|
|
786
831
|
const current = draft[filter.key];
|
|
787
832
|
if (filter.type === "text" || filter.type === "number") {
|
|
@@ -797,7 +842,7 @@ function FilterValues({
|
|
|
797
842
|
);
|
|
798
843
|
}
|
|
799
844
|
if (filter.type === "boolean") {
|
|
800
|
-
return /* @__PURE__ */ jsx("div", { className: "space-y-1", children: [{ label: "
|
|
845
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-1", children: [{ label: t("common.yes"), value: "true" }, { label: t("common.no"), value: "false" }].map((o) => /* @__PURE__ */ jsxs("label", { className: "flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-muted", children: [
|
|
801
846
|
/* @__PURE__ */ jsx(
|
|
802
847
|
"input",
|
|
803
848
|
{
|
|
@@ -814,7 +859,7 @@ function FilterValues({
|
|
|
814
859
|
const multi = filter.type === "multiselect";
|
|
815
860
|
const selected = new Set(Array.isArray(current) ? current.map(String) : current != null ? [String(current)] : []);
|
|
816
861
|
if (options.length === 0) {
|
|
817
|
-
return /* @__PURE__ */ jsx("p", { className: "px-2 py-1.5 text-xs text-muted-foreground", children: "
|
|
862
|
+
return /* @__PURE__ */ jsx("p", { className: "px-2 py-1.5 text-xs text-muted-foreground", children: t("analytics.filters.noOptions") });
|
|
818
863
|
}
|
|
819
864
|
return /* @__PURE__ */ jsx("div", { className: "max-h-56 space-y-0.5 overflow-y-auto", children: options.map((o) => /* @__PURE__ */ jsxs("label", { className: "flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-muted", children: [
|
|
820
865
|
/* @__PURE__ */ jsx(
|
|
@@ -840,6 +885,7 @@ function FilterValues({
|
|
|
840
885
|
] }, o.value)) });
|
|
841
886
|
}
|
|
842
887
|
function AnalyticsFilterPicker({ filters }) {
|
|
888
|
+
const t = useTranslation();
|
|
843
889
|
const { state, setFilters, clearFilters } = useAnalyticsContext();
|
|
844
890
|
const [open, setOpen] = React2.useState(false);
|
|
845
891
|
const [search, setSearch] = React2.useState("");
|
|
@@ -853,18 +899,18 @@ function AnalyticsFilterPicker({ filters }) {
|
|
|
853
899
|
const matching = q ? filters.filter((f) => f.label.toLowerCase().includes(q)) : filters;
|
|
854
900
|
const map = /* @__PURE__ */ new Map();
|
|
855
901
|
for (const f of matching) {
|
|
856
|
-
const key = f.group ??
|
|
902
|
+
const key = f.group ?? t("analytics.filters.general");
|
|
857
903
|
map.set(key, [...map.get(key) ?? [], f]);
|
|
858
904
|
}
|
|
859
905
|
return [...map.entries()].sort(([a], [b]) => a.localeCompare(b));
|
|
860
|
-
}, [filters, search]);
|
|
906
|
+
}, [filters, search, t]);
|
|
861
907
|
const activeCount = Object.keys(state.filters).length;
|
|
862
908
|
if (filters.length === 0) return null;
|
|
863
909
|
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
864
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", className: "
|
|
865
|
-
/* @__PURE__ */ jsx(SlidersHorizontal, { className: "h-3
|
|
866
|
-
"
|
|
867
|
-
activeCount > 0 ? /* @__PURE__ */ jsx("span", { className: "ml-0.5 rounded-full bg-primary px-1.5 text-[10px] font-
|
|
910
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", children: [
|
|
911
|
+
/* @__PURE__ */ jsx(SlidersHorizontal, { className: "h-3 w-3 shrink-0 opacity-70" }),
|
|
912
|
+
t("analytics.filters"),
|
|
913
|
+
activeCount > 0 ? /* @__PURE__ */ jsx("span", { className: "ml-0.5 rounded-full bg-primary px-1.5 text-[10px] font-semibold text-primary-foreground", children: activeCount }) : null
|
|
868
914
|
] }) }),
|
|
869
915
|
/* @__PURE__ */ jsxs(PopoverContent, { align: "end", className: "w-80 p-0", children: [
|
|
870
916
|
/* @__PURE__ */ jsx("div", { className: "border-b p-2", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
@@ -874,12 +920,12 @@ function AnalyticsFilterPicker({ filters }) {
|
|
|
874
920
|
{
|
|
875
921
|
value: search,
|
|
876
922
|
onChange: (e) => setSearch(e.target.value),
|
|
877
|
-
placeholder: "
|
|
923
|
+
placeholder: t("analytics.filters.search"),
|
|
878
924
|
className: "h-8 pl-8 text-sm"
|
|
879
925
|
}
|
|
880
926
|
)
|
|
881
927
|
] }) }),
|
|
882
|
-
/* @__PURE__ */ jsx("div", { className: "max-h-80 overflow-y-auto p-1", children: groups.length === 0 ? /* @__PURE__ */ jsx("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "
|
|
928
|
+
/* @__PURE__ */ jsx("div", { className: "max-h-80 overflow-y-auto p-1", children: groups.length === 0 ? /* @__PURE__ */ jsx("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: t("analytics.filters.none") }) : groups.map(([group, groupFilters]) => /* @__PURE__ */ jsxs("div", { children: [
|
|
883
929
|
/* @__PURE__ */ jsxs(
|
|
884
930
|
"button",
|
|
885
931
|
{
|
|
@@ -916,81 +962,154 @@ function AnalyticsFilterPicker({ filters }) {
|
|
|
916
962
|
{
|
|
917
963
|
variant: "ghost",
|
|
918
964
|
size: "sm",
|
|
919
|
-
className: "h-8 text-xs",
|
|
920
965
|
onClick: () => {
|
|
921
966
|
setDraft({});
|
|
922
967
|
clearFilters();
|
|
923
968
|
setOpen(false);
|
|
924
969
|
},
|
|
925
|
-
children: "
|
|
970
|
+
children: t("analytics.filters.clear")
|
|
926
971
|
}
|
|
927
972
|
),
|
|
928
|
-
/* @__PURE__ */ jsx(Button, { size: "sm",
|
|
973
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", onClick: () => {
|
|
929
974
|
setFilters(draft);
|
|
930
975
|
setOpen(false);
|
|
931
|
-
}, children: "
|
|
976
|
+
}, children: t("analytics.filters.apply") })
|
|
932
977
|
] })
|
|
933
978
|
] })
|
|
934
979
|
] });
|
|
935
980
|
}
|
|
936
|
-
function
|
|
937
|
-
const
|
|
938
|
-
const
|
|
939
|
-
const
|
|
940
|
-
const
|
|
941
|
-
const
|
|
942
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
981
|
+
function AnalyticsRangeControl() {
|
|
982
|
+
const t = useTranslation();
|
|
983
|
+
const locale = getCurrentLocale();
|
|
984
|
+
const { state, preset, setPreset, setDateRange } = useAnalyticsContext();
|
|
985
|
+
const custom = preset === "custom";
|
|
986
|
+
const span = formatSpan(state.dateRange.from, state.dateRange.to, locale);
|
|
987
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
943
988
|
/* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
944
|
-
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
showCompare ? /* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
948
|
-
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(ControlButton, { icon: GitCompareArrows, children: [
|
|
949
|
-
"Compare: ",
|
|
950
|
-
compareLabel
|
|
989
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(ControlButton, { icon: Calendar, children: [
|
|
990
|
+
custom ? t("analytics.range.custom") : t(`analytics.range.${preset}`),
|
|
991
|
+
!custom ? /* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: span }) : null
|
|
951
992
|
] }) }),
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
993
|
+
/* @__PURE__ */ jsxs(DropdownContent, { align: "start", className: "w-56", children: [
|
|
994
|
+
PRESETS.map((p) => /* @__PURE__ */ jsxs(DropdownItem, { onSelect: () => setPreset(p), children: [
|
|
995
|
+
t(`analytics.range.${p}`),
|
|
996
|
+
preset === p ? /* @__PURE__ */ jsx(Check, { className: "ml-auto h-3.5 w-3.5 shrink-0 pl-1" }) : null
|
|
997
|
+
] }, p)),
|
|
998
|
+
/* @__PURE__ */ jsx(DropdownSeparator, {}),
|
|
999
|
+
/* @__PURE__ */ jsxs(DropdownItem, { onSelect: () => setDateRange({ ...state.dateRange }), children: [
|
|
1000
|
+
t("analytics.range.custom"),
|
|
1001
|
+
custom ? /* @__PURE__ */ jsx(Check, { className: "ml-auto h-3.5 w-3.5 shrink-0 pl-1" }) : null
|
|
1002
|
+
] })
|
|
1003
|
+
] })
|
|
1004
|
+
] }),
|
|
1005
|
+
custom ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1006
|
+
/* @__PURE__ */ jsx(
|
|
1007
|
+
DatePicker,
|
|
1008
|
+
{
|
|
1009
|
+
variant: "toolbar",
|
|
1010
|
+
value: state.dateRange.from,
|
|
1011
|
+
onChange: (from) => setDateRange({
|
|
1012
|
+
from,
|
|
1013
|
+
to: from > state.dateRange.to ? from : state.dateRange.to
|
|
1014
|
+
})
|
|
1015
|
+
}
|
|
1016
|
+
),
|
|
1017
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "\u2013" }),
|
|
958
1018
|
/* @__PURE__ */ jsx(
|
|
959
|
-
|
|
1019
|
+
DatePicker,
|
|
960
1020
|
{
|
|
961
|
-
variant: "
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
1021
|
+
variant: "toolbar",
|
|
1022
|
+
value: state.dateRange.to,
|
|
1023
|
+
onChange: (to) => setDateRange({
|
|
1024
|
+
from: to < state.dateRange.from ? to : state.dateRange.from,
|
|
1025
|
+
to
|
|
1026
|
+
})
|
|
967
1027
|
}
|
|
968
1028
|
)
|
|
969
|
-
] })
|
|
1029
|
+
] }) : null
|
|
970
1030
|
] });
|
|
971
1031
|
}
|
|
1032
|
+
function AnalyticsControls({ filters = [], showCompare = true, actions, className }) {
|
|
1033
|
+
const t = useTranslation();
|
|
1034
|
+
const { state, setCompare, refresh } = useAnalyticsContext();
|
|
1035
|
+
const compare = state.compare ?? "none";
|
|
1036
|
+
const activeFilters = Object.entries(state.filters);
|
|
1037
|
+
const filterLabel = (key) => filters.find((f) => f.key === key)?.label ?? key;
|
|
1038
|
+
return (
|
|
1039
|
+
// A surface of its own, on the same chrome as Card — rounded, hairline
|
|
1040
|
+
// border, soft shadow. It used to be a bare tinted strip with square edges
|
|
1041
|
+
// running the full content width, which on a grey page background read as a
|
|
1042
|
+
// seam in the layout rather than as a control that floats over the grid it
|
|
1043
|
+
// is filtering. It is also what makes the sticky state legible: a bar that
|
|
1044
|
+
// has an edge and a shadow is clearly ON TOP of the cards scrolling under
|
|
1045
|
+
// it, where a flat tint just smeared into them.
|
|
1046
|
+
/* @__PURE__ */ jsxs(
|
|
1047
|
+
"div",
|
|
1048
|
+
{
|
|
1049
|
+
className: cn(
|
|
1050
|
+
"flex flex-wrap items-center gap-2 rounded-card border bg-card/95 px-3 py-2 shadow-sm backdrop-blur",
|
|
1051
|
+
className
|
|
1052
|
+
),
|
|
1053
|
+
children: [
|
|
1054
|
+
/* @__PURE__ */ jsx(AnalyticsRangeControl, {}),
|
|
1055
|
+
showCompare ? /* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
1056
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
1057
|
+
ControlButton,
|
|
1058
|
+
{
|
|
1059
|
+
icon: GitCompareArrows,
|
|
1060
|
+
className: compare === "none" ? "text-muted-foreground" : void 0,
|
|
1061
|
+
children: t(`analytics.compare.${compare}`)
|
|
1062
|
+
}
|
|
1063
|
+
) }),
|
|
1064
|
+
/* @__PURE__ */ jsx(DropdownContent, { align: "start", className: "w-48", children: COMPARE_OPTIONS.map((c) => /* @__PURE__ */ jsxs(DropdownItem, { onSelect: () => setCompare(c), children: [
|
|
1065
|
+
t(`analytics.compare.${c}`),
|
|
1066
|
+
compare === c ? /* @__PURE__ */ jsx(Check, { className: "ml-auto h-3.5 w-3.5 shrink-0 pl-1" }) : null
|
|
1067
|
+
] }, c)) })
|
|
1068
|
+
] }) : null,
|
|
1069
|
+
/* @__PURE__ */ jsx(AnalyticsFilterPicker, { filters }),
|
|
1070
|
+
activeFilters.map(([key, value]) => /* @__PURE__ */ jsx(ActiveFilterChip, { label: filterLabel(key), value, filterKey: key }, key)),
|
|
1071
|
+
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
1072
|
+
actions,
|
|
1073
|
+
/* @__PURE__ */ jsx(
|
|
1074
|
+
Button,
|
|
1075
|
+
{
|
|
1076
|
+
variant: "outline",
|
|
1077
|
+
size: "sm",
|
|
1078
|
+
onClick: refresh,
|
|
1079
|
+
"aria-label": t("analytics.refresh"),
|
|
1080
|
+
className: "w-[26px] p-0",
|
|
1081
|
+
children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-3 w-3" })
|
|
1082
|
+
}
|
|
1083
|
+
)
|
|
1084
|
+
] })
|
|
1085
|
+
]
|
|
1086
|
+
}
|
|
1087
|
+
)
|
|
1088
|
+
);
|
|
1089
|
+
}
|
|
972
1090
|
function ActiveFilterChip({ label, value, filterKey }) {
|
|
1091
|
+
const t = useTranslation();
|
|
973
1092
|
const { setFilter } = useAnalyticsContext();
|
|
974
|
-
const text = Array.isArray(value) ?
|
|
975
|
-
return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 rounded-full border bg-
|
|
976
|
-
/* @__PURE__ */ jsxs("span", { className: "
|
|
1093
|
+
const text = Array.isArray(value) ? value.length === 1 ? String(value[0]) : t("analytics.filters.selected", { count: value.length }) : String(value);
|
|
1094
|
+
return /* @__PURE__ */ jsxs("span", { className: "inline-flex h-[26px] shrink-0 items-center gap-1 rounded-full border border-primary/30 bg-primary/10 py-1 pl-2.5 pr-1 text-xs font-medium text-primary", children: [
|
|
1095
|
+
/* @__PURE__ */ jsxs("span", { className: "opacity-70", children: [
|
|
977
1096
|
label,
|
|
978
1097
|
":"
|
|
979
1098
|
] }),
|
|
980
|
-
/* @__PURE__ */ jsx("span", { className: "
|
|
1099
|
+
/* @__PURE__ */ jsx("span", { className: "max-w-[10rem] truncate", children: text }),
|
|
981
1100
|
/* @__PURE__ */ jsx(
|
|
982
1101
|
"button",
|
|
983
1102
|
{
|
|
984
1103
|
type: "button",
|
|
985
1104
|
onClick: () => setFilter(filterKey, void 0),
|
|
986
|
-
"aria-label":
|
|
987
|
-
className: "rounded-full p-0.5 hover:bg-
|
|
1105
|
+
"aria-label": `${t("analytics.filters.remove")}: ${label}`,
|
|
1106
|
+
className: "rounded-full p-0.5 transition-colors hover:bg-primary/20",
|
|
988
1107
|
children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
|
|
989
1108
|
}
|
|
990
1109
|
)
|
|
991
1110
|
] });
|
|
992
1111
|
}
|
|
993
1112
|
|
|
994
|
-
export { AnalyticsCard, AnalyticsContextProvider, AnalyticsControls, AnalyticsFilterPicker, AnalyticsGrid, Avatar, AvatarFallback, AvatarImage, autoGrain, collectFilters, comparisonRange, deltaPercent, errorMessage, formatAnalyticsValue, formatBucket, formatCompact, formatDuration, isEngineMissing, num, parseDay, rangeLengthDays, resolveRangePreset, resolveRatios, resolveRowRatios, toBreakdown, toChartData, toDayString, toSpark, trendOf, useAnalyticsCard, useAnalyticsContext, useAnalyticsContextOptional, vizCategory, vizMeasures };
|
|
1113
|
+
export { AnalyticsCard, AnalyticsContextProvider, AnalyticsControls, AnalyticsFilterPicker, AnalyticsGrid, Avatar, AvatarFallback, AvatarImage, BATCH_WINDOW_MS, autoGrain, collectFilters, comparisonRange, createBatchingProvider, deltaPercent, errorMessage, formatAnalyticsValue, formatBucket, formatCompact, formatDuration, isEngineMissing, num, parseDay, rangeLengthDays, resolveRangePreset, resolveRatios, resolveRowRatios, toBreakdown, toChartData, toDayString, toSpark, trendOf, useAnalyticsCard, useAnalyticsContext, useAnalyticsContextOptional, vizCategory, vizMeasures };
|
|
995
1114
|
//# sourceMappingURL=index.js.map
|
|
996
1115
|
//# sourceMappingURL=index.js.map
|